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

Caolán McNamara caolanm at redhat.com
Mon Oct 14 12:29:40 PDT 2013


 sw/UIConfig_swriter.mk                     |    1 
 sw/inc/dbui.hrc                            |    8 --
 sw/source/ui/dbui/dbui.cxx                 |   30 +++----
 sw/source/ui/dbui/dbui.src                 |   83 --------------------
 sw/source/ui/inc/dbui.hxx                  |   11 +-
 sw/uiconfig/swriter/ui/mmcreatingdialog.ui |  116 +++++++++++++++++++++++++++++
 6 files changed, 134 insertions(+), 115 deletions(-)

New commits:
commit 33450a258a92986c25923d37d033c948b702c585
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 14 20:28:47 2013 +0100

    convert creating document mail merge dialog to .ui
    
    Change-Id: Ibcb82ba8204fe94d31e32c74d8c2ade3228ff4f8

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index c346962..c3fff9b 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -160,6 +160,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/querydefaultcompatdialog \
 	sw/uiconfig/swriter/ui/querysavelabeldialog \
 	sw/uiconfig/swriter/ui/queryshowchangesdialog \
+	sw/uiconfig/swriter/ui/mmcreatingdialog \
 	sw/uiconfig/swriter/ui/mmoutputtypepage \
 	sw/uiconfig/swriter/ui/mmselectpage \
 	sw/uiconfig/swriter/ui/paradialog \
diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc
index 0e6a220..a988946 100644
--- a/sw/inc/dbui.hrc
+++ b/sw/inc/dbui.hrc
@@ -46,7 +46,6 @@
 #define DLG_MM_MAILBODY               (RC_DBUI_BEGIN + 24)
 #define DLG_MM_SENDMAILS              (RC_DBUI_BEGIN + 25)
 #define DLG_MAILMERGECHILD            (RC_DBUI_BEGIN + 26)
-#define DLG_MM_CREATIONMONITOR        (RC_DBUI_BEGIN + 30)
 // Strings ------------------------------------------------------------------
 
 #define SA_ADDRESS_HEADER       (RC_DBUI_BEGIN + 1)
@@ -75,19 +74,12 @@
 #define ST_DRAGSALUTATION       (RC_DBUI_BEGIN + 24)
 #define ST_TITLE_EDIT           (RC_DBUI_BEGIN + 25)
 
-
 // Elements -----------------------------------------------------------------
 
 #define BTN_OK              2
 #define BTN_CANCEL          3
 #define BTN_HELP            4
 
-#define PB_CANCELPRNMON     9
-#define FT_STATUS           12
-#define FT_CREATEDOCUMENTS  13
-#define FT_PROGRESS         14
-#define FT_COUNTING         15
-
 #define MM_PART_TITLE                   0
 #define MM_PART_FIRSTNAME               1
 #define MM_PART_LASTNAME                2
diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx
index f1b58e2..fd45bbc 100644
--- a/sw/source/ui/dbui/dbui.cxx
+++ b/sw/source/ui/dbui/dbui.cxx
@@ -46,22 +46,18 @@ PrintMonitor::PrintMonitor(Window *pParent, PrintMonitorType eType )
 
 // Progress Indicator for Creation of personalized Mail Merge documents:
 CreateMonitor::CreateMonitor( Window *pParent )
-:   ModelessDialog( pParent, SW_RES(DLG_MM_CREATIONMONITOR) ),
-    m_aStatus           (this, SW_RES( FT_STATUS )),
-    m_aProgress         (this, SW_RES( FT_PROGRESS )),
-    m_aCreateDocuments  (this, SW_RES( FT_CREATEDOCUMENTS )),
-    m_aCounting         (this, SW_RES( FT_COUNTING )),
-    m_aCancelButton     (this, SW_RES( PB_CANCELPRNMON  )),
-    m_sCountingPattern(),
-    m_sVariable_Total( OUString("%Y") ),
-    m_sVariable_Position( OUString("%X") ),
-    m_nTotalCount(0),
-    m_nCurrentPosition(0)
+    : ModelessDialog(pParent, "MMCreatingDialog",
+        "modules/swriter/ui/mmcreatingdialog.ui")
+    , m_sCountingPattern()
+    , m_sVariable_Total("%Y")
+    , m_sVariable_Position("%X")
+    , m_nTotalCount(0)
+    , m_nCurrentPosition(0)
 {
-    FreeResource();
-
-    m_sCountingPattern = m_aCounting.GetText();
-    m_aCounting.SetText(OUString("..."));
+    get(m_pCancelButton, "cancel");
+    get(m_pCounting, "progress");
+    m_sCountingPattern = m_pCounting->GetText();
+    m_pCounting->SetText("...");
 }
 
 void CreateMonitor::UpdateCountingText()
@@ -69,7 +65,7 @@ void CreateMonitor::UpdateCountingText()
     OUString sText(m_sCountingPattern);
     sText = sText.replaceAll( m_sVariable_Total, OUString::number( m_nTotalCount ) );
     sText = sText.replaceAll( m_sVariable_Position, OUString::number( m_nCurrentPosition ) );
-    m_aCounting.SetText(sText);
+    m_pCounting->SetText(sText);
 }
 
 void CreateMonitor::SetTotalCount( sal_Int32 nTotal )
@@ -86,7 +82,7 @@ void CreateMonitor::SetCurrentPosition( sal_Int32 nCurrent )
 
 void CreateMonitor::SetCancelHdl( const Link& rLink )
 {
-    m_aCancelButton.SetClickHdl( rLink );
+    m_pCancelButton->SetClickHdl( rLink );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src
index 51ee91a..5ff7097 100644
--- a/sw/source/ui/dbui/dbui.src
+++ b/sw/source/ui/dbui/dbui.src
@@ -85,87 +85,4 @@ String STR_FILTER_ACCDB
     Text [ en-US ] = "Microsoft Access 2007 (*.accdb)" ;
 };
 
- // DLG_MM_CREATIONMONITOR ------------------------------------------------------
-ModelessDialog DLG_MM_CREATIONMONITOR
-{
-    SVLOOK = TRUE ;
-    HIDE = TRUE ;
-    OUTPUTSIZE = TRUE ;
-    _WHMAPMODE = MAP_APPFONT ;
-    _WIDTH = 140 ;
-    _HEIGHT = 52 ;
-    MOVEABLE = TRUE ;
-    APP = FALSE ;
-
-    Text [ en-US ] = "Mail Merge" ;
-
-    FixedText FT_STATUS
-    {
-        HIDE = FALSE ;
-        _XYMAPMODE = MAP_APPFONT ;
-        _X = 6 ;
-        _Y = 6 ;
-        _WHMAPMODE = MAP_APPFONT ;
-        _WIDTH = 35 ;
-        _HEIGHT = 8 ;
-        Text [ en-US ] = "Status:" ;
-        LEFT = FALSE ;
-        CENTER = FALSE ;
-        RIGHT = TRUE ;
-    };
-    FixedText FT_PROGRESS
-    {
-        HIDE = FALSE ;
-        _XYMAPMODE = MAP_APPFONT ;
-        _X = 6 ;
-        _Y = 17 ;
-        _WHMAPMODE = MAP_APPFONT ;
-        _WIDTH = 35 ;
-        _HEIGHT = 8 ;
-        Text [ en-US ] = "Progress:" ;
-        LEFT = FALSE ;
-        CENTER = FALSE ;
-        RIGHT = TRUE ;
-    };
-    FixedText FT_CREATEDOCUMENTS
-    {
-        HIDE = FALSE ;
-        _XYMAPMODE = MAP_APPFONT ;
-        _X = 45 ;
-        _Y = 6 ;
-        _WHMAPMODE = MAP_APPFONT ;
-        _WIDTH = 91 ;
-        _HEIGHT = 8 ;
-        Text [ en-US ] = "Creating documents...";
-        LEFT = TRUE ;
-        CENTER = FALSE ;
-        RIGHT = FALSE ;
-    };
-    FixedText FT_COUNTING
-    {
-        HIDE = FALSE ;
-        _XYMAPMODE = MAP_APPFONT ;
-        _X = 45 ;
-        _Y = 17 ;
-        _WHMAPMODE = MAP_APPFONT ;
-        _WIDTH = 91 ;
-        _HEIGHT = 8 ;
-        Text [ en-US ] = "%X of %Y";
-        LEFT = TRUE ;
-        CENTER = FALSE ;
-        RIGHT = FALSE ;
-    };
-    CancelButton PB_CANCELPRNMON
-    {
-        HIDE = FALSE ;
-        _XYMAPMODE = MAP_APPFONT ;
-        _X = 74 ;
-        _Y = 32 ;
-        _WHMAPMODE = MAP_APPFONT ;
-        _WIDTH = 50 ;
-        _HEIGHT = 14 ;
-        TABSTOP = TRUE ;
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/dbui.hxx b/sw/source/ui/inc/dbui.hxx
index bfb9fb83..dbe3ca6 100644
--- a/sw/source/ui/inc/dbui.hxx
+++ b/sw/source/ui/inc/dbui.hxx
@@ -52,15 +52,12 @@ public:
 
     void SetCancelHdl( const Link& rLink );
 
-private: //methods
+private:
     void UpdateCountingText();
 
-private: //member
-    FixedText       m_aStatus;
-    FixedText       m_aProgress;
-    FixedText       m_aCreateDocuments;
-    FixedText       m_aCounting;
-    CancelButton    m_aCancelButton;
+private:
+    FixedText*      m_pCounting;
+    CancelButton*   m_pCancelButton;
 
     OUString        m_sCountingPattern;
     OUString        m_sVariable_Total;
diff --git a/sw/uiconfig/swriter/ui/mmcreatingdialog.ui b/sw/uiconfig/swriter/ui/mmcreatingdialog.ui
new file mode 100644
index 0000000..6572c8c
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/mmcreatingdialog.ui
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="MMCreatingDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Mail Merge</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="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>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">center</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">1</property>
+                <property name="label" translatable="yes">Status:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <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">Progress:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Creating documents...</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="progress">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">%X of %Y</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list