[Libreoffice-commits] core.git: sw/source sw/uiconfig

Caolán McNamara caolanm at redhat.com
Sun Apr 15 19:14:40 UTC 2018


 sw/source/ui/dbui/mmresultdialogs.cxx |   44 +++++++++++++---------------------
 sw/uiconfig/swriter/ui/ccdialog.ui    |   14 +++++++---
 2 files changed, 28 insertions(+), 30 deletions(-)

New commits:
commit 0a73815a627bffe27dadaa74fb19f0bb7dd3a246
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 15 17:36:18 2018 +0100

    weld SwCopyToDialog
    
    Change-Id: I5801a6a2173c3f7df74be4a04355899d276ac2a1
    Reviewed-on: https://gerrit.libreoffice.org/52915
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 38d4e03aa2dc..e19dee61342f 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -188,32 +188,24 @@ IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, weld::Entry&, rEdit, void)
     m_xOKPB->set_sensitive(bIsEmptyAllowed  || !rEdit.get_text().isEmpty());
 }
 
-class SwCopyToDialog : public SfxModalDialog
+class SwCopyToDialog : public weld::GenericDialogController
 {
-    VclPtr<Edit> m_pCCED;
-    VclPtr<Edit> m_pBCCED;
+    std::unique_ptr<weld::Entry> m_xCCED;
+    std::unique_ptr<weld::Entry> m_xBCCED;
 
 public:
-    explicit SwCopyToDialog(vcl::Window* pParent)
-        : SfxModalDialog(pParent, "CCDialog",
-            "modules/swriter/ui/ccdialog.ui")
+    explicit SwCopyToDialog(weld::Window* pParent)
+        : GenericDialogController(pParent, "modules/swriter/ui/ccdialog.ui", "CCDialog")
+        , m_xCCED(m_xBuilder->weld_entry("cc"))
+        , m_xBCCED(m_xBuilder->weld_entry("bcc"))
     {
-        get(m_pCCED, "cc");
-        get(m_pBCCED, "bcc");
-    }
-    virtual ~SwCopyToDialog() override { disposeOnce(); }
-    virtual void dispose() override
-    {
-        m_pCCED.clear();
-        m_pBCCED.clear();
-        SfxModalDialog::dispose();
     }
 
-    OUString GetCC() {return m_pCCED->GetText();}
-    void SetCC(const OUString& rSet) {m_pCCED->SetText(rSet);}
+    OUString GetCC() {return m_xCCED->get_text();}
+    void SetCC(const OUString& rSet) {m_xCCED->set_text(rSet);}
 
-    OUString GetBCC() {return m_pBCCED->GetText();}
-    void SetBCC(const OUString& rSet) {m_pBCCED->SetText(rSet);}
+    OUString GetBCC() {return m_xBCCED->get_text();}
+    void SetBCC(const OUString& rSet) {m_xBCCED->set_text(rSet);}
 };
 
 SwMMResultSaveDialog::SwMMResultSaveDialog()
@@ -493,15 +485,15 @@ IMPL_LINK(SwMMResultEmailDialog, DocumentSelectionHdl_Impl, Button*, pButton, vo
     m_pToNF->Enable(bEnableFromTo);
 }
 
-IMPL_LINK(SwMMResultEmailDialog, CopyToHdl_Impl, Button*, pButton, void)
+IMPL_LINK_NOARG(SwMMResultEmailDialog, CopyToHdl_Impl, Button*, void)
 {
-    ScopedVclPtrInstance< SwCopyToDialog > pDlg(pButton);
-    pDlg->SetCC(m_sCC );
-    pDlg->SetBCC(m_sBCC);
-    if(RET_OK == pDlg->Execute())
+    SwCopyToDialog aDlg(GetFrameWeld());
+    aDlg.SetCC(m_sCC );
+    aDlg.SetBCC(m_sBCC);
+    if (aDlg.run() == RET_OK)
     {
-        m_sCC =     pDlg->GetCC() ;
-        m_sBCC =    pDlg->GetBCC();
+        m_sCC = aDlg.GetCC() ;
+        m_sBCC = aDlg.GetBCC();
     }
 }
 
diff --git a/sw/uiconfig/swriter/ui/ccdialog.ui b/sw/uiconfig/swriter/ui/ccdialog.ui
index 3621f238cd28..46572bf960b3 100644
--- a/sw/uiconfig/swriter/ui/ccdialog.ui
+++ b/sw/uiconfig/swriter/ui/ccdialog.ui
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="CCDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="ccdialog|CCDialog">Copy To</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 internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
@@ -96,10 +99,10 @@
                       <object class="GtkLabel" id="label2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
                         <property name="label" translatable="yes" context="ccdialog|label2">_Cc:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">cc</property>
+                        <property name="xalign">1</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -110,10 +113,10 @@
                       <object class="GtkLabel" id="label3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
                         <property name="label" translatable="yes" context="ccdialog|label3">_Bcc:</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">bcc</property>
+                        <property name="xalign">1</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -124,9 +127,9 @@
                       <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes" context="ccdialog|label4">Note: Separate e-mail addresses with a semicolon (;).</property>
                         <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -184,5 +187,8 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list