svx/uiconfig/ui/docrecoverysavedialog.ui |   93 +++++++++++++++----------------
 vcl/inc/qt5/QtBuilder.hxx                |    4 -
 vcl/qt5/QtBuilder.cxx                    |   38 ++++++------
 vcl/qt5/QtInstanceBuilder.cxx            |    1 
 4 files changed, 66 insertions(+), 70 deletions(-)

New commits:
commit 3c492ebe592ff83f13b4a6db6ff6f4eb5336c277
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 4 17:04:52 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Apr 6 20:33:33 2025 +0200

    tdf#130857 qt weld: Support more button types in button boxes
    
    So far, QtBuilder only added button to the parent button box
    when those buttons were created for "GtkButton" objects in
    a .ui file, but not for other button types like "GtkMenuButton".
    
    Move the logic from the "GtkButton" specific handling to
    QtBuilder::setButtonProperties so it is also used for
    other button types.
    
    This will e.g. be used e.g. by the Math "Format" -> "Spacing"
    dialog (starmath/uiconfig/smath/ui/spacingdialog.ui, not supported
    by QtInstanceBuilder yet) which has a "GtkMenuButton" (with ID "category")
    in its button box.
    
    Change-Id: I1748fa85ca3e85dff09a93c4d1c453a151956c62
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183728
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx
index 5cae4374bd5e..371c2af22d17 100644
--- a/vcl/inc/qt5/QtBuilder.hxx
+++ b/vcl/inc/qt5/QtBuilder.hxx
@@ -86,13 +86,13 @@ private:
     static void deleteObject(QObject* pObject);
     // remove pOldWidget from the widget hierarchy and set (child widget) 
pNewWidget in its place
     static void replaceWidget(QWidget* pOldWidget, QWidget* pNewWidget);
-    void setButtonProperties(QAbstractButton& rButton, stringmap& rProps);
+    void setButtonProperties(QAbstractButton& rButton, stringmap& rProps, 
QWidget* pParentWidget);
     static void setCheckButtonProperties(QAbstractButton& rButton, stringmap& 
rProps);
     static void setDialogProperties(QDialog& rDialog, stringmap& rProps);
     static void setEntryProperties(QLineEdit& rLineEdit, stringmap& rProps);
     static void setLabelProperties(QLabel& rLabel, stringmap& rProps);
     static void setMessageDialogProperties(QMessageBox& rMessageBox, 
stringmap& rProps);
-    void setMenuButtonProperties(QToolButton& rButton, stringmap& rProps);
+    void setMenuButtonProperties(QToolButton& rButton, stringmap& rProps, 
QWidget* pParentWidget);
     void setScaleProperties(QSlider& rSlider, stringmap& rProps);
     void setSpinButtonProperties(QDoubleSpinBox& rSpinBox, stringmap& rProps);
     static void setTextViewProperties(QPlainTextEdit& rTextEdit, stringmap& 
rProps);
diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index 782d574f7e03..f2fc67967892 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -185,21 +185,8 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, std:
     }
     else if (sName == u"GtkButton")
     {
-        QPushButton* pButton = nullptr;
-        if (QDialogButtonBox* pButtonBox = 
qobject_cast<QDialogButtonBox*>(pParentWidget))
-        {
-            pButton = pButtonBox->addButton("", QDialogButtonBox::NoRole);
-
-            // for message boxes, avoid implicit standard buttons in addition 
to those explicitly added
-            if (QMessageBox* pMessageBox = 
qobject_cast<QMessageBox*>(pParentWidget->window()))
-                pMessageBox->setStandardButtons(QMessageBox::NoButton);
-        }
-        else
-        {
-            pButton = new QPushButton(pParentWidget);
-        }
-
-        setButtonProperties(*pButton, rMap);
+        QPushButton* pButton = new QPushButton(pParentWidget);
+        setButtonProperties(*pButton, rMap, pParentWidget);
         pObject = pButton;
     }
     else if (sName == u"GtkCheckButton")
@@ -288,7 +275,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, std:
     else if (sName == u"GtkMenuButton")
     {
         QToolButton* pMenuButton = new QToolButton(pParentWidget);
-        setMenuButtonProperties(*pMenuButton, rMap);
+        setMenuButtonProperties(*pMenuButton, rMap, pParentWidget);
         pObject = pMenuButton;
     }
     else if (sName == u"GtkNotebook")
@@ -349,7 +336,7 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, std:
     else if (sName == u"GtkToggleButton")
     {
         QToolButton* pButton = new QToolButton(pParentWidget);
-        setButtonProperties(*pButton, rMap);
+        setButtonProperties(*pButton, rMap, pParentWidget);
         pObject = pButton;
     }
     else if (sName == u"GtkToolbar")
@@ -750,7 +737,8 @@ void QtBuilder::replaceWidget(QWidget* pOldWidget, QWidget* 
pNewWidget)
     deleteObject(pOldWidget);
 }
 
-void QtBuilder::setButtonProperties(QAbstractButton& rButton, stringmap& 
rProps)
+void QtBuilder::setButtonProperties(QAbstractButton& rButton, stringmap& 
rProps,
+                                    QWidget* pParentWidget)
 {
     for (auto const & [ rKey, rValue ] : rProps)
     {
@@ -771,6 +759,15 @@ void QtBuilder::setButtonProperties(QAbstractButton& 
rButton, stringmap& rProps)
             rButton.setText(convertAccelerator(rValue));
         }
     }
+
+    if (QDialogButtonBox* pButtonBox = 
qobject_cast<QDialogButtonBox*>(pParentWidget))
+    {
+        pButtonBox->addButton(&rButton, QDialogButtonBox::NoRole);
+
+        // for message boxes, avoid implicit standard buttons in addition to 
those explicitly added
+        if (QMessageBox* pMessageBox = 
qobject_cast<QMessageBox*>(pParentWidget->window()))
+            pMessageBox->setStandardButtons(QMessageBox::NoButton);
+    }
 }
 
 void QtBuilder::setCheckButtonProperties(QAbstractButton& rButton, stringmap& 
rProps)
@@ -817,7 +814,8 @@ void QtBuilder::setLabelProperties(QLabel& rLabel, 
stringmap& rProps)
     }
 }
 
-void QtBuilder::setMenuButtonProperties(QToolButton& rButton, stringmap& 
rProps)
+void QtBuilder::setMenuButtonProperties(QToolButton& rButton, stringmap& 
rProps,
+                                        QWidget* pParentWidget)
 {
     const OUString sMenu = extractPopupMenu(rProps);
     if (!sMenu.isEmpty())
@@ -827,7 +825,7 @@ void QtBuilder::setMenuButtonProperties(QToolButton& 
rButton, stringmap& rProps)
         rButton.setMenu(pMenu);
     }
 
-    setButtonProperties(rButton, rProps);
+    setButtonProperties(rButton, rProps, pParentWidget);
 }
 
 void QtBuilder::setMessageDialogProperties(QMessageBox& rMessageBox, 
stringmap& rProps)
commit f0fe0f843923e9da5e9401ba41651842a8e502c0
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 4 16:06:42 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Apr 6 20:33:26 2025 +0200

    tdf#130857 qt weld: Support doc recovery 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.
    
    This is the dialog showing the list of files
    that will be restored when LO crashes.
    
    Change-Id: I4bcf439309d7db433e0bb1e404c75e971460c2ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183727
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 9df7422e4b67..e0541ca989b6 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -126,6 +126,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"svt/ui/printersetupdialog.ui"_ustr,
         u"svt/ui/restartdialog.ui"_ustr,
         u"svx/ui/compressgraphicdialog.ui"_ustr,
+        u"svx/ui/docrecoverysavedialog.ui"_ustr,
         u"svx/ui/fontworkgallerydialog.ui"_ustr,
         u"svx/ui/deletefooterdialog.ui"_ustr,
         u"svx/ui/deleteheaderdialog.ui"_ustr,
commit 14088f6d2db96b83782c8e52126fc4a5584ffd69
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 4 16:02:49 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Apr 6 20:33:19 2025 +0200

    svx: Resave docrecoverysavedialog.ui with glade 3.40
    
    This is the dialog showing the list of files
    that will be restored when LO crashes.
    
    Change-Id: I291e94a6ce35569b51856278057a963c092ed430
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183726
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/svx/uiconfig/ui/docrecoverysavedialog.ui 
b/svx/uiconfig/ui/docrecoverysavedialog.ui
index 509b4f087bec..7793561a0180 100644
--- a/svx/uiconfig/ui/docrecoverysavedialog.ui
+++ b/svx/uiconfig/ui/docrecoverysavedialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="svx">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkTreeStore" id="liststore1">
@@ -13,33 +13,30 @@
     </columns>
   </object>
   <object class="GtkDialog" id="DocRecoverySaveDialog">
-    <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="docrecoverysavedialog|DocRecoverySaveDialog">%PRODUCTNAME 
%PRODUCTVERSION Document Recovery</property>
     <property name="modal">True</property>
-    <property name="default_width">0</property>
-    <property name="default_height">0</property>
-    <property name="type_hint">dialog</property>
-    <child>
-      <placeholder/>
-    </child>
+    <property name="default-width">0</property>
+    <property name="default-height">0</property>
+    <property name="type-hint">dialog</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>
               </object>
               <packing>
@@ -52,7 +49,7 @@
           <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>
@@ -60,72 +57,72 @@
           <!-- n-columns=1 n-rows=1 -->
           <object class="GtkGrid" id="bgrid1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="vexpand">True</property>
-            <property name="row_spacing">12</property>
+            <property name="row-spacing">12</property>
             <child>
-              <!-- n-columns=1 n-rows=1 -->
+              <!-- n-columns=1 n-rows=2 -->
               <object class="GtkGrid" id="grid1">
                 <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="row_spacing">24</property>
+                <property name="row-spacing">24</property>
                 <child>
                   <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="docrecoverysavedialog|label1">Due to an error, %PRODUCTNAME crashed. 
All the files you were working on will now be saved. The next time %PRODUCTNAME 
is launched, your files will be recovered automatically.</property>
                     <property name="wrap">True</property>
-                    <property name="width_chars">70</property>
-                    <property name="max_width_chars">70</property>
+                    <property name="width-chars">70</property>
+                    <property name="max-width-chars">70</property>
                     <property name="xalign">0</property>
                   </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>
                 <child>
-                  <!-- n-columns=1 n-rows=1 -->
+                  <!-- n-columns=1 n-rows=2 -->
                   <object class="GtkGrid" id="grid2">
                     <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="row_spacing">6</property>
+                    <property name="row-spacing">6</property>
                     <child>
                       <object class="GtkLabel" id="label2">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="docrecoverysavedialog|label2">The following files will be 
recovered:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">filelist</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">filelist</property>
                         <property name="xalign">0</property>
                       </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>
                     <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="filelist">
                             <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="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-selection2"/>
                             </child>
@@ -153,20 +150,20 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </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>

Reply via email to