desktop/inc/strings.hrc                          |    1 +
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |   10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 6a32706e7cc9a6bfe8df7748d0252235c90b021c
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Wed Aug 5 16:33:16 2020 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Thu Aug 13 09:39:59 2020 +0200

    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.mehrbr...@cib.de>

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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to