Commit Graph

44 Commits

Author SHA1 Message Date
Andrew Wiltshire
fb5268ebae Adds "Show Hidden Content" checkbox (#7309)
* Adds "Show Hidden Content Dialogue"

* Update FileBrowser.cpp

* Automatically rearrange layout to fit check boxes

* check if files are hidden in a cross platform manner

* put the hidden files checkbox below the user and factory check boxes at all times

* removed layout rearrangement code

* moved checkbox code to FileBrowser

* Removed unused include

* Cleanup in FileBrowser

Move the method `addContentCheckBox` to the other private methods.
Remove the method parameters because it can use the members.

Remove the conditional when adding the "Hidden content" checkbox because
it was always true.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2024-06-30 22:23:19 +02:00
saker
bfeb781dc0 Redesign file browser searching (#7130) 2024-05-29 21:46:58 -04:00
saker
3a928d80b2 Enforce lazy loading for FileBrowser (#6996) 2023-11-23 20:31:49 -05:00
saker
aa050ae0b7 Fix memory leaks (#6879)
* Replace knobFModel with std::vector

* Create QPixmap's on the stack

* Assign parent for QGraphicsScene
A call to QGraphicsView::setScene does not make
the view take ownership of the scene.

* Do not allocate QList on the heap

* Use static QPixmap's
The QPixmap's need to be created within the constructor, and not outside
where they are defined, since it can't find them otherwise.
I'm not too sure why.

* Clear m_vi2->knobFModel in destructor

* Use local static QPixmap's

* Do not allocate QPixmap with new in AudioFileProcessor

* Do not allocate QPixmap with new in Nes

* Do not allocate QPixmap with new in Organic

* Do not allocate QPixmap with new in SaControlsDialog

* Do not allocate QPixmap with new in Vestige

* Do not allocate QPixmap with new for FileBrowser

* Do not allocate QPixmap with new in MixerLine

* Do not allocate QPixmap with new in SendButtonIndicator

* Do not allocate QPixmap with new in AutomationClipView

* Do not allocate QPixmap with new in MidiClipView

* Do not allocate QPixmap with new in AutomationEditor

* Do not allocate QPixmap with new in PianoRoll

* Do not allocate QPixmap with new in TimeLineWidget

* Do not allocate QPixmap with new in EnvelopeAndLfoView

* Do not allocate QPixmap with new in PianoView

* Do not allocate QPixmap with new in ComboBox

* Do not allocate QPixmap with new in Fader

* Do not allocate QPixmap with new for LcdWidget

* Do not allocate QPixmap with new for LedCheckbox

* Use m_ as prefix for members

* Use uniform initialization
I already started using uniform initialization for the QPixmap changes
for some reason, so I'm finishing that up.

* Uniform initiaization

* And then he realized he was making copies...

* Do not call QPixmap copy constructor

* Do not call QPixmap copy constructor in SaControlsDialog

* Do not make pixmap's static for Lcd's and Led's

* Initialize pixmaps in-class

* Fix few mistakes and formatting
2023-11-19 00:44:15 -05:00
saker
fad0011508 Analyze and improve search in the file browser (again) (#6985)
Improves performance when searching in the file browser (confirmed with profiling using KCacheGrind), adds a search indicator at the bottom to let the user know a search is in progress, blacklists unnecessary system directories (speeding up both the search speed and potentially load times as well by reducing the number of filesystem entries to consider), and fixes an issue that causes not all of the search results to appear.
2023-11-18 20:47:15 -05:00
saker
5596abb66a Improve search performance in FileBrowser (#6962)
Improves the search performance of the file browser by delegating the search to a worker thread. The main thread then builds the tree and displays it to the user.
2023-11-10 14:26:31 -05:00
MrTopom
a8d765f8d5 Make files visible when searching in `FileBrowser` (#6845)
* Change the title for SideBarWidgets to be vertically centered related to icon and with no underlining

* Update src/gui/SideBarWidget.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Updating FileBrowser display when searching : showing matching files

* Correcting increment and removing duplicated calls

* Correcting reload tree when filter is activated

---------

Co-authored-by: saker <sakertooth@gmail.com>
2023-09-10 11:52:18 -04:00
Dominic Clark
f10277715f Classier enums (#6760) 2023-08-24 19:16:02 +01:00
Dalton Messmer
2c6d88f799 Add GUARD_H closing comments 2023-01-05 17:58:49 -05:00
Dalton Messmer
fe6df8dbaf Add namespace prefix to include guards 2023-01-02 19:51:32 -05:00
Levin Oehlmann
773310384b clang-tidy: Apply modernize-redundant-void-arg everywhere (#6446) 2022-06-23 21:27:23 +02:00
sakertooth
420769a32d Fix Qt Deprecations (#6386)
Co-authored-by: Kevin Zander <veratil@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2022-06-23 20:28:04 +02:00
Levin Oehlmann
5904b249c0 clang-tidy: Apply modernize-use-override everywhere (#6439)
... to mark overriding functions `override` instead of `virtual`.
2022-06-19 23:03:55 +02:00
Levin Oehlmann
7227c89847 Namespace lmms (#6174)
This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules.

Also, this PR changes back `LmmsCore` to `Engine`, reverting c519921306 .

Co-authored-by: allejok96 <allejok96@gmail.com>
2022-06-19 20:08:46 +02:00
Johannes Lorenz
7db3fa94a1 Improve includes (#6320)
* Update ringbuffer submodule to fix includes

* Remove cyclic includes

* Remove Qt include prefixes

* Include C++ versions of C headers

E.g.: assert.h -> cassert

* Move CLIP_BORDER_WIDTH into ClipView

This allows to remove includes to TrackView.h in ClipView cpp files.

* Elliminate useless includes

This improves the include structure by elliminating includes that are
not used. Most of this was done by using `include-what-you-use` with
`CMAKE_C_INCLUDE_WHAT_YOU_USE` and `CMAKE_CXX_INCLUDE_WHAT_YOU_USE`
set to (broken down here):

```
include-what-you-use;
    -Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
    -Xiwyu;--keep=*/xmmintrin.h;
    -Xiwyu;--keep=*/lmmsconfig.h;
    -Xiwyu;--keep=*/weak_libjack.h;
    -Xiwyu;--keep=*/sys/*;
    -Xiwyu;--keep=*/debug.h;
    -Xiwyu;--keep=*/SDL/*;
    -Xiwyu;--keep=*/alsa/*;
    -Xiwyu;--keep=*/FL/x.h;
    -Xiwyu;--keep=*/MidiApple.h;
    -Xiwyu;--keep=*/MidiWinMM.h;
    -Xiwyu;--keep=*/AudioSoundIo.h
```

* Fixup: Remove empty #if-#ifdef pairs

* Remove LMMS_HAVE_STD(LIB|INT)_H
2022-03-02 13:30:43 +01:00
thmueller64
1949f93f10 Add checkboxes for selecting user and factory content (#5786)
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
Co-authored-by: Kevin Zander <veratil@gmail.com>
2020-11-26 22:25:32 +00:00
Spekular
437172a542 Stop sample previews on mouse release or browser focus loss (#5764)
Stop previews on mouse up and focus loss.
2020-11-08 14:09:58 +01:00
Spekular
109a7c4735 Keyboard shortcuts to preview/add sounds from sidebar (#5427)
- Extract file item preview start and end into new methods `previewFileItem` and `stopPreview`.
- Add event handlers:
  - `keyPressEvent` to allow auto preview (on up/down arrow navigation), manual preview (space), and send to editors (enter)
  - `keyReleaseEvent` to end previews when preview key is released
  - `hideEvent` to end previews when switching sidebar tab or hiding sidebar
- Functions that operate on a `FileItem` now take it as an argument instead of using a member variable
- `getContextActions` provides menu items for sending clips to the song editor and BB editor with minimal duplicate code
- Some formatting changes in affected code
- Replace many instances of `NULL` with `nullptr`
2020-10-03 21:31:13 +02:00
Michael Gregorius
b85aef2f33 Code review changes
Move openContainingFolder to the end of the method block.

Adjust FileBrowserTreeWidget::contextMenuEvent to the coding conventions
and also make the code more readable by splitting up some conditions.

Add comments to clarify as to why the member m_contextMenuItem is set to
nullptr at the end of the execution of contextMenuEvent. Please note
that this implementation is not exception safe and should be changed in
the future, e.g. by passing the FileItem as a parameter of the slot.
2020-04-19 22:08:09 +02:00
Michael Gregorius
2aea19fff1 Add "Open containing folder" (#5453)
Add functionality to open the containing folder of a file that's selected
in LMMS' file browser.

Technical details
------------------
Add a new private method openContainingFolder to FileBrowser. Add a new
action to the context menu of a selected file. This action in turn calls
the added method.

The current implementation of openContainingFolder delegates to
QDesktopServices::openUrl with the directory of the selected file. Please
note that this will only open the directory but not select the file as
this is much more complicated due to different implementations that are
needed for the different platforms (Linux/Windows/MacOS).

Using QDesktopServices::openUrl seems to be the most simple cross
platform way which uses functionality that's already available in Qt.
2020-04-14 14:45:08 +02:00
Hyunjin Song
044c88c271 Merge branch 'stable-1.2'
# Conflicts:
#	.gitmodules
#	.travis.yml
#	.travis/linux..before_install.sh
#	.travis/linux..install.sh
#	CMakeLists.txt
#	cmake/linux/package_linux.sh.in
#	cmake/modules/BuildPlugin.cmake
#	include/AutomatableModel.h
#	plugins/MidiImport/MidiImport.cpp
#	plugins/carlapatchbay/CMakeLists.txt
#	plugins/carlarack/CMakeLists.txt
#	src/core/Song.cpp
#	src/core/Track.cpp
#	src/gui/editors/SongEditor.cpp
#	tests/src/core/AutomatableModelTest.cpp
2020-04-04 12:08:55 +09:00
Johannes Lorenz
427d779668 FileBrowser: Add helpful comments 2020-01-22 05:57:28 +01:00
David CARLIER
dac59a5fa0 C++11 inheritance updates
Add `override` and remove `virtual` where applicable
2019-10-31 20:05:33 +01:00
CYBERDEViLNL
407444ea1d FileBrowser: Backup expanded directories and restore that state when the tree is reloaded. 2019-04-21 00:14:33 +02:00
Lukas W
c670d4827a Minor QString usage improvements 2018-07-11 20:13:47 +02:00
Lukas W
11c693205e Remove usage of deprecated Qt API
Removes usage of the following deprecated Qt functions:
- QPixmap::grabWidget
- QString::null
- qFind
- qSort
- qGreater
- qCopy
2018-06-17 14:27:28 +02:00
Matt Kline
68c9d227d0 Default some empty destructors
Moving empty destructors out of the .cpp files and into headers
allows them to be devirtualized in certain cases.
(When the compiler can't "see" a function in a header, it must largely
assume it's some black box that the linker will resolve.)

While we're at it, use C++11's `= default` to define empty virtual
desturctors for us.

For some classes (e.g., Piano), nothing is derived from it, so we can
mark the class as final and remove any explicit virtual dtor.

There are many other places where this can be done, but this is a large
enough patch as-is.
2018-05-06 16:34:08 -07:00
Michael Gregorius
1b24a0520d Move the search bar on top of the file browser for sidebar pages (#3657)
Move the search bar on top of the file browser for the following sidebar
windows:
* "My Projects"
* "My Samples"
* "My Presets"
* "My Home"
* "My Computer"

Add the greyed out text "Search" to the search text edit.
The text is only shown as long as no text is entered in the search field.

Also rename some variable names to something more meaningful. Rename the
member m_l of FileBrowser to m_fileBrowserTreeWidget. Rename the
following local variables in the constructor of FileBrowser:
* ops -> searchWidget
* opl -> searchWidgetLayout
2017-07-07 18:52:41 +02:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Karmo Rosental
674a2fb50c Fixed #3047 and #3180. (#3184) 2017-01-09 15:46:37 +01:00
grejppi
2d1813fb64 Remove FLP import, revert to GPLv2+ only (#2904) 2016-07-12 19:28:45 +03:00
Lukas W
b7d5b2ddf5 Fix #2558 2016-02-13 09:24:10 +13:00
Lukas W
ca8f80d44f Fix loading relative file path samples
Closes #2412
2016-02-11 11:58:42 +13:00
Lukas W
d6a25f90a9 FileBrowser: Fix file paths
Fixes #2412
2015-10-17 13:06:34 +02:00
Colin Wallace
aa77443eb1 merge the two filterItems functions into one;
also fix some formatting + use 'Pattern Editor' instead of 'B&B Editor' in context menu
2015-09-07 16:36:25 -07:00
Colin Wallace
c8a0d51a43 revert changes that caused FileBrowsers to steal focus when opened 2015-04-29 02:06:44 +00:00
Colin Wallace
616de244cc add ctrl+f shortcut to FileBrowser & default focus to filter widget when opened 2015-04-28 07:08:35 +00:00
Dave French
4206705ed2 Proposed fix 760 Improve search field 2015-01-12 22:10:15 +00:00
Dave French
cee287116b Proposed fix for 1150 Preset Browser: division between factory and user files fails if factory has folders 2014-12-26 11:00:26 +00:00
Lukas W
8e8879f735 Merge stable-1.1
Conflicts:
	include/ConfigManager.h
	include/MidiTime.h
	include/string_pair_drag.h
	src/gui/string_pair_drag.cpp
	src/gui/widgets/rubberband.cpp
2014-11-10 19:26:59 +01:00
Umcaruje
6fb923cba2 Correct the program name and site in the descriptions. 2014-11-04 22:56:50 +01:00
Vesa
bf6659fbb1 Merge branch 'stable-1.1'
Conflicts:
	src/gui/FileBrowser.cpp
2014-09-09 23:55:39 +03:00
Lukas W
876642c342 FileBrowser rename fixes 2014-09-03 11:43:40 +02:00
Lukas W
efacfdfae9 Rename file_browser.* to FileBrowser.* 2014-09-03 11:29:25 +02:00