Commit Graph

26 Commits

Author SHA1 Message Date
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