cui/uiconfig/ui/selectpathdialog.ui |   95 +++++++++++++++++-------------------
 vcl/qt5/QtInstanceBuilder.cxx       |    1 
 vcl/qt5/QtInstanceTreeView.cxx      |    8 ++-
 3 files changed, 53 insertions(+), 51 deletions(-)

New commits:
commit 89afe6ad2418675f01351d54ef757c83e1611553
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Apr 25 21:40:49 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Apr 26 00:33:34 2025 +0200

    tdf#130857 qt weld: Support "Select Paths" dialog
    
    This means that native Qt widgets are used for that dialog
    now when using the qt5 or qt6 VCL plugin and starting LO with
    environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
    
    To trigger the dialog in Writer:
    "Tools" -> "AutoText", click "Path" button.
    
    Change-Id: I9bcf5253e80e2740151dc801bcd326df09529699
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184652
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index ff073b2e6917..ec66f712ccce 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -81,6 +81,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"cui/ui/qrcodegen.ui"_ustr,
         u"cui/ui/querydialog.ui"_ustr,
         u"cui/ui/securityoptionsdialog.ui"_ustr,
+        u"cui/ui/selectpathdialog.ui"_ustr,
         u"cui/ui/spelloptionsdialog.ui"_ustr,
         u"cui/ui/splitcellsdialog.ui"_ustr,
         u"cui/ui/tipofthedaydialog.ui"_ustr,
commit eedf1e727cdf7106291b2af852d83540009090ea
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Apr 25 21:32:31 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Apr 26 00:33:27 2025 +0200

    cui: Resave selectpathdialog.ui with glade 3.40
    
    To trigger the dialog in Writer:
    "Tools" -> "AutoText", click "Path" button.
    
    Change-Id: Ib86d3d6d827da27f2c0c88b94ea71cdd9f3ed4fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184651
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/cui/uiconfig/ui/selectpathdialog.ui 
b/cui/uiconfig/ui/selectpathdialog.ui
index 5680294117b1..2f99dff23964 100644
--- a/cui/uiconfig/ui/selectpathdialog.ui
+++ b/cui/uiconfig/ui/selectpathdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkTreeStore" id="liststore1">
@@ -11,31 +11,31 @@
     </columns>
   </object>
   <object class="GtkDialog" id="SelectPathDialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
+    <property name="can-focus">False</property>
+    <property name="border-width">6</property>
     <property name="title" translatable="yes" 
context="selectpathdialog|SelectPathDialog">Select Paths</property>
     <property name="resizable">False</property>
     <property name="modal">True</property>
-    <property name="default_width">0</property>
-    <property name="default_height">0</property>
-    <property name="type_hint">normal</property>
+    <property name="default-width">0</property>
+    <property name="default-height">0</property>
+    <property name="type-hint">normal</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
-        <property name="can_focus">False</property>
+        <property name="can-focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="can-focus">False</property>
+            <property name="layout-style">end</property>
             <child>
               <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" 
context="stock">_OK</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="can-default">True</property>
+                <property name="has-default">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="ok-atkobject">
@@ -53,8 +53,8 @@
               <object class="GtkButton" id="cancel">
                 <property name="label" translatable="yes" 
context="stock">_Cancel</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="cancel-atkobject">
@@ -72,8 +72,8 @@
               <object class="GtkButton" id="help">
                 <property name="label" translatable="yes" 
context="stock">_Help</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -87,43 +87,43 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="pack_type">end</property>
+            <property name="pack-type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkFrame" id="frame1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
+            <property name="label-xalign">0</property>
+            <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=1 n-rows=1 -->
+              <!-- n-columns=2 n-rows=1 -->
               <object class="GtkGrid" id="grid1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <property name="vexpand">True</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
+                <property name="can-focus">False</property>
                 <property name="margin-start">12</property>
                 <property name="margin-top">6</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="row-spacing">6</property>
+                <property name="column-spacing">12</property>
                 <child>
                   <object class="GtkButtonBox" id="buttonbox1">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
-                    <property name="layout_style">start</property>
+                    <property name="layout-style">start</property>
                     <child>
                       <object class="GtkButton" id="add">
                         <property name="label" translatable="yes" 
context="selectpathdialog|add">_Add...</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="use_underline">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="use-underline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="add-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="cui/ui/selectpathdialog/add">Opens the Select Path 
dialog to select another folder or the Open dialog to select another 
file.</property>
@@ -140,8 +140,8 @@
                       <object class="GtkButton" id="delete">
                         <property name="label" translatable="yes" 
context="stock">_Delete</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
                         <property name="use-underline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="delete-atkobject">
@@ -157,27 +157,27 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
+                    <property name="can-focus">True</property>
                     <property name="hexpand">True</property>
                     <property name="vexpand">True</property>
-                    <property name="shadow_type">in</property>
+                    <property name="shadow-type">in</property>
                     <child>
                       <object class="GtkTreeView" id="paths">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="can-focus">True</property>
                         <property name="vexpand">True</property>
                         <property name="model">liststore1</property>
-                        <property name="headers_visible">False</property>
-                        <property name="headers_clickable">False</property>
-                        <property name="search_column">0</property>
-                        <property name="show_expanders">False</property>
+                        <property name="headers-visible">False</property>
+                        <property name="headers-clickable">False</property>
+                        <property name="search-column">0</property>
+                        <property name="show-expanders">False</property>
                         <child internal-child="selection">
                           <object class="GtkTreeSelection" 
id="treeview-selection1"/>
                         </child>
@@ -200,8 +200,8 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
                   </packing>
                 </child>
               </object>
@@ -209,7 +209,7 @@
             <child type="label">
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="label" translatable="yes" 
context="selectpathdialog|label1">Paths</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -230,8 +230,5 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
-    <child type="titlebar">
-      <placeholder/>
-    </child>
   </object>
 </interface>
commit 79bd0519fcfda31c183ddcda9fd01d46107a8afd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Apr 25 21:17:41 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Apr 26 00:33:20 2025 +0200

    tdf#130857 qt weld: Don't multi-select tree items in single sel mode
    
    Regardless of what selection mode is set for the tree view
    displaying the model, QItemSelectionModel::select
    adds to the selection and doesn't clear the previous one
    unless the QItemSelectionModel::Clear flag is passed.
    
    As a consequence, multiple tree view entries could be
    selected after QtInstanceTreeView::select was called.
    
    Prevent that by explicitly passing the
    QItemSelectionModel::Clear flag if the tree view
    is in single selection mode.
    
    Prior to this change, multiple entries were e.g. selected
    for the following scenario:
    
    * start Writer
    * "Tools" -> "AutoText", click "Categories" button
    * in the dialog, add various new categories by
      typing text in the "Category" edit and clicking
      the "New" button
    
    Behavior without this change in place for qt6 with
    SAL_VCL_QT_USE_WELDED_WIDGETS=1: All newly
    added categories would be selected at the same time.
    
    Behavior with this change in place: Only the last selected
    category is selected. This matches the behavior of other
    VCL plugins.
    
    Change-Id: I286b1e17b33d686553ae7c1533f07028b73bdfe5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184650
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx
index d44726b5a657..0ce37cf8d1a7 100644
--- a/vcl/qt5/QtInstanceTreeView.cxx
+++ b/vcl/qt5/QtInstanceTreeView.cxx
@@ -152,8 +152,12 @@ void QtInstanceTreeView::select(int nPos)
 {
     SolarMutexGuard g;
     GetQtInstance().RunInMainThread([&] {
-        m_pSelectionModel->select(modelIndex(nPos),
-                                  QItemSelectionModel::Select | 
QItemSelectionModel::Rows);
+        QItemSelectionModel::SelectionFlags eFlags
+            = QItemSelectionModel::Select | QItemSelectionModel::Rows;
+        if (m_pTreeView->selectionMode() == QAbstractItemView::SingleSelection)
+            eFlags |= QItemSelectionModel::Clear;
+
+        m_pSelectionModel->select(modelIndex(nPos), eFlags);
     });
 }
 

Reply via email to