diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-08-05 16:33:16 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-08-13 09:39:59 +0200 |
commit | 6a32706e7cc9a6bfe8df7748d0252235c90b021c (patch) | |
tree | cece6bda7f390764bb3598d1f2898c4e37ea776c /desktop | |
parent | 0e8681d4a13719e87344ab24f83bd746a51ce8a1 (diff) |
Add "All supported files" filter to extension add dialog
Did you know you can install xcu files directly via extension manager?
Now it should be easier to discover...
Change-Id: I9a96708fd13f762b20916540e6fa9b87bb582677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100176
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/strings.hrc | 1 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/desktop/inc/strings.hrc b/desktop/inc/strings.hrc index d6d2c6244210..3953c73ff60b 100644 --- a/desktop/inc/strings.hrc +++ b/desktop/inc/strings.hrc @@ -44,6 +44,7 @@ #define RID_STR_CANNOT_DETERMINE_LIBNAME NC_("RID_STR_CANNOT_DETERMINE_LIBNAME", "The library name could not be determined.") #define RID_STR_PACKAGE_BUNDLE NC_("RID_STR_PACKAGE_BUNDLE", "Extension") +#define RID_STR_ALL_SUPPORTED NC_("RID_STR_PACKAGE_BUNDLE", "All supported files") #define RID_STR_DYN_COMPONENT NC_("RID_STR_DYN_COMPONENT", "UNO Dynamic Library Component") #define RID_STR_JAVA_COMPONENT NC_("RID_STR_JAVA_COMPONENT", "UNO Java Component") diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index b6b698d236e9..91fe52ebed50 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -635,7 +635,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() // collect and set filter list: typedef std::map< OUString, OUString > t_string2string; t_string2string title2filter; - OUString sDefaultFilter( StrAllFiles::get() ); + OUStringBuffer supportedFilters; const uno::Sequence< uno::Reference< deployment::XPackageTypeInfo > > packageTypes( m_pManager->getExtensionManager()->getSupportedPackageTypes() ); @@ -648,6 +648,9 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() const OUString title( xPackageType->getShortDescription() ); const std::pair< t_string2string::iterator, bool > insertion( title2filter.emplace( title, filter ) ); + if (!supportedFilters.isEmpty()) + supportedFilters.append(';'); + supportedFilters.append(filter); if ( ! insertion.second ) { // already existing, append extensions: OUStringBuffer buf; @@ -656,13 +659,12 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() buf.append( filter ); insertion.first->second = buf.makeStringAndClear(); } - if ( xPackageType->getMediaType() == "application/vnd.sun.star.package-bundle" ) - sDefaultFilter = title; } } // All files at top: xFilePicker->appendFilter( StrAllFiles::get(), "*.*" ); + xFilePicker->appendFilter( DpResId(RID_STR_ALL_SUPPORTED), supportedFilters.makeStringAndClear() ); // then supported ones: for (auto const& elem : title2filter) { @@ -675,7 +677,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() TOOLS_WARN_EXCEPTION( "desktop", "" ); } } - xFilePicker->setCurrentFilter( sDefaultFilter ); + xFilePicker->setCurrentFilter( DpResId(RID_STR_ALL_SUPPORTED) ); if ( xFilePicker->execute() != ui::dialogs::ExecutableDialogResults::OK ) return uno::Sequence<OUString>(); // cancelled |