starmath/uiconfig/smath/ui/savedefaultsdialog.ui |   18 ++++++------
 vcl/inc/qt5/QtInstanceMessageDialog.hxx          |    3 +-
 vcl/qt5/QtInstance.cxx                           |   31 ----------------------
 vcl/qt5/QtInstanceMessageDialog.cxx              |   32 +++++++++++++++++++++++
 4 files changed, 44 insertions(+), 40 deletions(-)

New commits:
commit 0515c27ef685babf1907d38106410bf6d7597040
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Feb 15 18:56:46 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Feb 16 11:12:41 2025 +0100

    tdf#130857 qt weld: Move helper function to QtInstanceMessageDialog
    
    This is one step in preparation of reusing the logic in an upcoming
    commit to add support for the GtkMessageDialog:buttons property [1].
    
    [1] https://docs.gtk.org/gtk3/property.MessageDialog.buttons.html
    
    Change-Id: I432587529ec8b0bbb7b0a5c13a6e77b7ef178a89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181720
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index e0c8802007d5..b2a366083457 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -41,6 +41,8 @@ public:
     std::unique_ptr<weld::Button> weld_button_for_response(int nResponse) 
override;
     virtual int run() override;
 
+    void addStandardButtons(VclButtonsType eButtonType);
+
 private:
     void positionExtraControlsContainer();
     QPushButton* buttonForResponseCode(int nResponse);
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index a1482687b874..7c8c1b41a552 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -58,7 +58,6 @@
 #include <config_vclplug.h>
 #include <dndhelper.hxx>
 #include <vcl/qt/QtUtils.hxx>
-#include <vcl/stdtext.hxx>
 #include <vcl/sysdata.hxx>
 #include <sal/log.hxx>
 #include <o3tl/unreachable.hxx>
@@ -118,34 +117,6 @@ public:
     virtual void doAcquire(sal_uInt32 nLockCount) override;
     virtual sal_uInt32 doRelease(bool const bUnlockAll) override;
 };
-
-void lcl_setStandardButtons(QtInstanceMessageDialog& rMessageDialog, 
VclButtonsType eButtonType)
-{
-    switch (eButtonType)
-    {
-        case VclButtonsType::NONE:
-            break;
-        case VclButtonsType::Ok:
-            rMessageDialog.add_button(GetStandardText(StandardButtonType::OK), 
RET_OK);
-            break;
-        case VclButtonsType::Close:
-            
rMessageDialog.add_button(GetStandardText(StandardButtonType::Close), 
RET_CLOSE);
-            break;
-        case VclButtonsType::Cancel:
-            
rMessageDialog.add_button(GetStandardText(StandardButtonType::Cancel), 
RET_CANCEL);
-            break;
-        case VclButtonsType::YesNo:
-            
rMessageDialog.add_button(GetStandardText(StandardButtonType::Yes), RET_YES);
-            rMessageDialog.add_button(GetStandardText(StandardButtonType::No), 
RET_NO);
-            break;
-        case VclButtonsType::OkCancel:
-            rMessageDialog.add_button(GetStandardText(StandardButtonType::OK), 
RET_OK);
-            
rMessageDialog.add_button(GetStandardText(StandardButtonType::Cancel), 
RET_CANCEL);
-            break;
-        default:
-            assert(false && "Unhandled VCLButtonsType");
-    }
-}
 }
 
 bool QtYieldMutex::IsCurrentThread() const
@@ -973,7 +944,7 @@ weld::MessageDialog* 
QtInstance::CreateMessageDialog(weld::Widget* pParent,
         pMessageBox->setIcon(vclMessageTypeToQtIcon(eMessageType));
         pMessageBox->setWindowTitle(vclMessageTypeToQtTitle(eMessageType));
         QtInstanceMessageDialog* pDialog = new 
QtInstanceMessageDialog(pMessageBox);
-        lcl_setStandardButtons(*pDialog, eButtonsType);
+        pDialog->addStandardButtons(eButtonsType);
         return pDialog;
     }
 }
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index a07433efe930..b600879a08aa 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -12,6 +12,7 @@
 
 #include <QtInstanceButton.hxx>
 
+#include <vcl/stdtext.hxx>
 #include <vcl/qt/QtUtils.hxx>
 
 #include <QtWidgets/QLabel>
@@ -182,6 +183,35 @@ void QtInstanceMessageDialog::dialogFinished(int nResult)
 
     QtInstanceDialog::dialogFinished(nResponseCode);
 }
+
+void QtInstanceMessageDialog::addStandardButtons(VclButtonsType eButtonType)
+{
+    switch (eButtonType)
+    {
+        case VclButtonsType::NONE:
+            break;
+        case VclButtonsType::Ok:
+            add_button(GetStandardText(StandardButtonType::OK), RET_OK);
+            break;
+        case VclButtonsType::Close:
+            add_button(GetStandardText(StandardButtonType::Close), RET_CLOSE);
+            break;
+        case VclButtonsType::Cancel:
+            add_button(GetStandardText(StandardButtonType::Cancel), 
RET_CANCEL);
+            break;
+        case VclButtonsType::YesNo:
+            add_button(GetStandardText(StandardButtonType::Yes), RET_YES);
+            add_button(GetStandardText(StandardButtonType::No), RET_NO);
+            break;
+        case VclButtonsType::OkCancel:
+            add_button(GetStandardText(StandardButtonType::OK), RET_OK);
+            add_button(GetStandardText(StandardButtonType::Cancel), 
RET_CANCEL);
+            break;
+        default:
+            assert(false && "Unhandled VCLButtonsType");
+    }
+}
+
 void QtInstanceMessageDialog::positionExtraControlsContainer()
 {
     assert(m_pExtraControlsContainer);
commit da406dbd9eb7fc9ba8452688fa049cf43045959c
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Feb 15 18:47:57 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Feb 16 11:12:34 2025 +0100

    tdf#130857 qt weld: Move include to .cxx
    
    Change-Id: I147a286126a8ee8820aa2740339570f4d1d1ea25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181719
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index f016eb8b1b7a..e0c8802007d5 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -9,7 +9,6 @@
 
 #pragma once
 
-#include "QtInstanceButton.hxx"
 #include "QtInstanceDialog.hxx"
 #include <QtWidgets/QMessageBox>
 
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index c9217609a9d5..a07433efe930 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -10,6 +10,8 @@
 #include <QtInstanceMessageDialog.hxx>
 #include <QtInstanceMessageDialog.moc>
 
+#include <QtInstanceButton.hxx>
+
 #include <vcl/qt/QtUtils.hxx>
 
 #include <QtWidgets/QLabel>
commit f2ea471a37474a6f7cf53468ef39023fd0ddbed4
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Feb 15 18:19:37 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Feb 16 11:12:26 2025 +0100

    math: Resave savedefaultsdialog.ui with glade 3.40
    
    The dialog can be triggered like this:
    
    * start Math
    * "Format" -> "Font Size"
    * click the "Default" button in the dialog
    
    Change-Id: I50b2595f8edc0558200918d3a75ba1355d2f2c14
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181718
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui 
b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
index 7a4f861cc9e8..5856b306a5df 100644
--- a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
+++ b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
@@ -1,31 +1,31 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="sm">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkMessageDialog" id="SaveDefaultsDialog">
-    <property name="can_focus">False</property>
+    <property name="can-focus">False</property>
     <property name="title" translatable="yes" 
context="savedefaultsdialog|SaveDefaultsDialog">Save defaults?</property>
     <property name="resizable">False</property>
     <property name="modal">True</property>
-    <property name="type_hint">dialog</property>
-    <property name="skip_taskbar_hint">True</property>
-    <property name="message_type">question</property>
+    <property name="type-hint">dialog</property>
+    <property name="skip-taskbar-hint">True</property>
+    <property name="message-type">question</property>
     <property name="buttons">yes-no</property>
     <property name="text" translatable="yes" 
context="savedefaultsdialog|SaveDefaultsDialog">Should the changes be saved as 
defaults?</property>
-    <property name="secondary_text" translatable="yes" 
context="savedefaultsdialog|SaveDefaultsDialog">These changes will apply for 
all new formulas.</property>
+    <property name="secondary-text" translatable="yes" 
context="savedefaultsdialog|SaveDefaultsDialog">These changes will apply for 
all new formulas.</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="messagedialog-vbox">
-        <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="messagedialog-action_area">
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
           </object>
           <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>

Reply via email to