sw/uiconfig/swriter/ui/testmailsettings.ui |  129 ++++++++++++++---------------
 vcl/inc/qt5/QtBuilder.hxx                  |    2 
 vcl/qt5/QtBuilder.cxx                      |   14 +++
 3 files changed, 78 insertions(+), 67 deletions(-)

New commits:
commit 759c992ad1eeaac9d3f147037a52f693f895344d
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sun Oct 5 00:24:38 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Oct 5 11:24:29 2025 +0200

    tdf#130857 qt weld: Evaluate "GtkTextView" text
    
    A GtkTextView's text is set in a GtkTextBuffer
    that is specified via the GtkTextView::buffer property [1].
    
    Evaluate that and the GtkTextBuffer::text property [2]
    to set the initial text for "GtkTextBuffer" objects
    as specified in the .ui file.
    
    One example where such text is specified is in
    the mail merge test settings dialog that can be triggered
    as follows:
    
    * "Tools" -> "Options" -> "LibreOfficeDev Writer"
      -> "Mail Merge Email"
    * click the "Test Settings" button
    
    (Support for using native Qt widgets isn't declared
    for that dialog yet. This is one step towards making
    that possible in the future.)
    
    [1] https://docs.gtk.org/gtk3/property.TextView.buffer.html
    [2] https://docs.gtk.org/gtk3/property.TextBuffer.text.html
    
    Change-Id: I174380a021d859366a33eb96d96bfe9a52d452e2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191868
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx
index c2e06d87669b..f5f6bc7a395d 100644
--- a/vcl/inc/qt5/QtBuilder.hxx
+++ b/vcl/inc/qt5/QtBuilder.hxx
@@ -100,7 +100,7 @@ private:
     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);
+    void setTextViewProperties(QPlainTextEdit& rTextEdit, stringmap& rProps);
     static void setWidgetProperties(QWidget& rWidget, stringmap& rProps);
     static QWidget* windowForObject(QObject* pObject);
 
diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index ad988870fb24..d5027c3b636a 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -1084,9 +1084,21 @@ void QtBuilder::setTextViewProperties(QPlainTextEdit& 
rTextEdit, stringmap& rPro
     for (auto const & [ rKey, rValue ] : rProps)
     {
         if (rKey == u"accepts-tab")
+        {
             rTextEdit.setTabChangesFocus(!toBool(rValue));
+        }
+        else if (rKey == u"buffer")
+        {
+            const TextBuffer* pTextBuffer = get_buffer_by_name(rValue);
+            assert(pTextBuffer && "No TextBuffer with the given ID");
+            auto aIt = pTextBuffer->find(u"text"_ustr);
+            if (aIt != pTextBuffer->end())
+                rTextEdit.setPlainText(toQString(aIt->second));
+        }
         else if (rKey == u"editable")
+        {
             rTextEdit.setReadOnly(!toBool(rValue));
+        }
     }
 }
 
commit aa7a86d082ce5b2b62ee26e25a86175650156e43
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sun Oct 5 00:04:06 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Oct 5 11:24:21 2025 +0200

    tdf#130857 qt weld: Evaluate GtkTextView::editable
    
    Evaluate the GtkTextView::editable [1] property.
    This ensures that the QPlainTextEdit used in
    QtInstanceTextView is set to readonly when
    GtkTextView::editable is set to the (non-default)
    value of false.
    
    This will e.g. be relevant for the mail merge
    test settings dialog that can be triggered as
    follows:
    
    * "Tools" -> "Options" -> "LibreOfficeDev Writer"
      -> "Mail Merge Email"
    * click the "Test Settings" button
    
    (Support for using native Qt widgets isn't declared
    for that dialog yet. This is one step towards making
    that possible.)
    
    [1] https://docs.gtk.org/gtk3/property.TextView.editable.html
    
    Change-Id: I2436892589b6ba521ecdfa262a46046c7b6ea2d2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191867
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index 6ee30a28d69e..ad988870fb24 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -1085,6 +1085,8 @@ void QtBuilder::setTextViewProperties(QPlainTextEdit& 
rTextEdit, stringmap& rPro
     {
         if (rKey == u"accepts-tab")
             rTextEdit.setTabChangesFocus(!toBool(rValue));
+        else if (rKey == u"editable")
+            rTextEdit.setReadOnly(!toBool(rValue));
     }
 }
 
commit 62899d891f1472930684b843d4cdeef1147585a6
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Oct 4 23:56:17 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Oct 5 11:24:15 2025 +0200

    sw: Resave testmailsettings.ui with glade 3.40
    
    The dialog can be triggered as follows:
    
    * "Tools" -> "Options" -> "LibreOfficeDev Writer"
      -> "Mail Merge Email"
    * click the "Test Settings" button
    
    Change-Id: I1877a651e3cbf2ab14d2d5230ac9903c0657fe5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191866
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sw/uiconfig/swriter/ui/testmailsettings.ui 
b/sw/uiconfig/swriter/ui/testmailsettings.ui
index ed6e78b2682a..b774d8cde234 100644
--- a/sw/uiconfig/swriter/ui/testmailsettings.ui
+++ b/sw/uiconfig/swriter/ui/testmailsettings.ui
@@ -1,33 +1,33 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkTextBuffer" id="textbuffer1">
     <property name="text" translatable="yes" 
context="testmailsettings|textbuffer1">%PRODUCTNAME could not connect to the 
outgoing mail server. Check your system's settings and the settings in 
%PRODUCTNAME. Check the server name, the port and the secure connections 
settings</property>
   </object>
   <object class="GtkDialog" id="TestMailSettings">
-    <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="testmailsettings|TestMailSettings">Test Account Settings</property>
-    <property name="type_hint">dialog</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="stop">
                 <property name="label" translatable="yes" 
context="testmailsettings|stop">_Stop</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="use_underline">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="stop-atkobject">
                     <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|stop">Click the Stop button to stop a 
test session manually.</property>
@@ -44,8 +44,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>
               </object>
               <packing>
@@ -58,8 +58,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>
@@ -73,85 +73,85 @@
           <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="frame2">
             <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=3 n-rows=2 -->
               <object class="GtkGrid" id="grid2">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
-                <property name="hexpand">True</property>
-                <property name="vexpand">True</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="GtkLabel" id="establish">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="testmailsettings|establish">Establish network connection</property>
                     <property name="xalign">0</property>
                   </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="GtkLabel" id="find">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="testmailsettings|find">Find outgoing mail server</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="result1">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="testmailsettings|result1">Successful</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">2</property>
+                    <property name="top-attach">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="result2">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="testmailsettings|result2">Failed</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">2</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <child>
                       <object class="GtkImage" id="image1">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="icon-name">dialog-error</property>
                       </object>
                       <packing>
@@ -163,7 +163,7 @@
                     <child>
                       <object class="GtkImage" id="image3">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property 
name="icon-name">sw/res/sc20558.png</property>
                       </object>
                       <packing>
@@ -174,18 +174,18 @@
                     </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>
                 <child>
                   <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <child>
                       <object class="GtkImage" id="image2">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="icon-name">dialog-error</property>
                       </object>
                       <packing>
@@ -197,7 +197,7 @@
                     <child>
                       <object class="GtkImage" id="image4">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property 
name="icon-name">sw/res/sc20558.png</property>
                       </object>
                       <packing>
@@ -208,8 +208,8 @@
                     </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>
@@ -217,7 +217,7 @@
             <child type="label">
               <object class="GtkLabel" id="label8">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="label" translatable="yes" 
context="testmailsettings|label8">%PRODUCTNAME is testing the email account 
settings...</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -234,36 +234,36 @@
         <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 -->
               <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="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>
                 <child>
                   <object class="GtkScrolledWindow" id="scrolledwindow1">
                     <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="GtkTextView" id="errors">
                         <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="editable">False</property>
-                        <property name="wrap_mode">word</property>
-                        <property name="cursor_visible">False</property>
+                        <property name="wrap-mode">word</property>
+                        <property name="cursor-visible">False</property>
                         <property name="buffer">textbuffer1</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="errors-atkobject">
@@ -274,8 +274,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>
@@ -283,7 +283,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="testmailsettings|label1">Errors</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -303,9 +303,6 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
-    <child type="titlebar">
-      <placeholder/>
-    </child>
   </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <widgets>

Reply via email to