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

Caolán McNamara caolanm at redhat.com
Fri Apr 26 07:16:55 PDT 2013


 sw/AllLangResTarget_sw.mk                     |    1 
 sw/UIConfig_swriter.mk                        |    1 
 sw/inc/helpid.h                               |    1 
 sw/source/ui/misc/outline.cxx                 |   55 +++----
 sw/source/ui/misc/outline.hrc                 |   47 ------
 sw/source/ui/misc/outline.src                 |   90 ------------
 sw/uiconfig/swriter/ui/numberingnamedialog.ui |  189 ++++++++++++++++++++++++++
 7 files changed, 213 insertions(+), 171 deletions(-)

New commits:
commit 19e664a7be70616882ffdc8f261dff1f6c3984e6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 26 15:09:00 2013 +0100

    convert numbering name dialog to .ui
    
    Change-Id: I5992855dfda8d08913ab2b238f44af059c67ff73

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 922d85b..451a743 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -130,7 +130,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/misc/docfnote.src \
     sw/source/ui/misc/glossary.src \
     sw/source/ui/misc/numberingtypelistbox.src \
-    sw/source/ui/misc/outline.src \
     sw/source/ui/misc/redlndlg.src \
     sw/source/ui/misc/srtdlg.src \
     sw/source/ui/misc/swruler.src \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 92784ba..ab344ca 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -25,7 +25,6 @@
 #define HID_DOCINFO_EDT                                         "SW_HID_DOCINFO_EDT"
 #define HID_PASSWD                                              "SW_HID_PASSWD"
 #define HID_CONFIG_SAVE                                         "SW_HID_CONFIG_SAVE"
-#define HID_NUM_NAMES                                           "SW_HID_NUM_NAMES"
 
 #define HID_FORMEDT_CONTENT                                     "SW_HID_FORMEDT_CONTENT"
 #define HID_FORMEDT_USER                                        "SW_HID_FORMEDT_USER"
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index c2b5a9f..f80d0b9 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -44,7 +44,6 @@
 #include <helpid.h>
 #include <globals.hrc>      // for template name 'none'
 #include <misc.hrc>
-#include <outline.hrc>
 #include <paratr.hxx>
 
 #include <unomid.h>
@@ -58,14 +57,11 @@ using namespace ::com::sun::star;
 
 DBG_NAME(outlinehdl)
 
-class SwNumNamesDlg: public ModalDialog
+class SwNumNamesDlg : public ModalDialog
 {
-    FixedLine    aFormFL;
-    Edit         aFormEdit;
-    ListBox      aFormBox;
-    OKButton     aOKBtn;
-    CancelButton aCancelBtn;
-    HelpButton   aHelpBtn;
+    Edit*     m_pFormEdit;
+    ListBox*  m_pFormBox;
+    OKButton* m_pOKBtn;
 
     DECL_LINK( ModifyHdl, Edit * );
     DECL_LINK( SelectHdl, ListBox * );
@@ -73,10 +69,9 @@ class SwNumNamesDlg: public ModalDialog
 
 public:
     SwNumNamesDlg(Window *pParent);
-    ~SwNumNamesDlg();
     void SetUserNames(const String *pList[]);
-    String GetName() const { return aFormEdit.GetText(); }
-    sal_uInt16 GetCurEntryPos() const { return aFormBox.GetSelectEntryPos(); }
+    String GetName() const { return m_pFormEdit->GetText(); }
+    sal_uInt16 GetCurEntryPos() const { return m_pFormBox->GetSelectEntryPos(); }
 };
 
 /*------------------------------------------------------------------------
@@ -84,8 +79,8 @@ public:
 ------------------------------------------------------------------------*/
 IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
 {
-    aFormEdit.SetText(pBox->GetSelectEntry());
-    aFormEdit.SetSelection(Selection(0, SELECTION_MAX));
+    m_pFormEdit->SetText(pBox->GetSelectEntry());
+    m_pFormEdit->SetSelection(Selection(0, SELECTION_MAX));
     return 0;
 }
 IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
@@ -102,14 +97,14 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
     {
         if(pList[i])
         {
-            aFormBox.RemoveEntry(i);
-            aFormBox.InsertEntry(*pList[i], i);
+            m_pFormBox->RemoveEntry(i);
+            m_pFormBox->InsertEntry(*pList[i], i);
             if(i == nSelect && nSelect < SwBaseNumRules::nMaxRules)
                 nSelect++;
         }
     }
-    aFormBox.SelectEntryPos(nSelect);
-    SelectHdl(&aFormBox);
+    m_pFormBox->SelectEntryPos(nSelect);
+    SelectHdl(m_pFormBox);
 }
 
 /*------------------------------------------------------------------------
@@ -117,7 +112,7 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
 ------------------------------------------------------------------------*/
 IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
 {
-    aOKBtn.Enable(!pBox->GetText().isEmpty());
+    m_pOKBtn->Enable(!pBox->GetText().isEmpty());
     return 0;
 }
 IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
@@ -133,23 +128,19 @@ IMPL_LINK_NOARG_INLINE_START(SwNumNamesDlg, DoubleClickHdl)
 IMPL_LINK_NOARG_INLINE_END(SwNumNamesDlg, DoubleClickHdl)
 
 SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
-    : ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
-    aFormFL(this, SW_RES(FL_FORM)),
-    aFormEdit(this, SW_RES(ED_FORM)),
-    aFormBox(this, SW_RES(LB_FORM)),
-    aOKBtn(this, SW_RES(BT_OK)),
-    aCancelBtn(this, SW_RES(BT_CANCEL)),
-    aHelpBtn(this, SW_RES(BT_HELP))
+    : ModalDialog(pParent, "NumberingNameDialog",
+        "modules/swriter/ui/numberingnamedialog.ui")
 {
-    FreeResource();
-    aFormEdit.SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
-    aFormBox.SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
-    aFormBox.SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
-    SelectHdl(&aFormBox);
+    get(m_pFormEdit, "entry");
+    get(m_pFormBox, "form");
+    m_pFormBox->SetDropDownLineCount(5);
+    get(m_pOKBtn, "ok");
+    m_pFormEdit->SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
+    m_pFormBox->SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
+    m_pFormBox->SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
+    SelectHdl(m_pFormBox);
 }
 
-SwNumNamesDlg::~SwNumNamesDlg() {}
-
 static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
 {
     sal_uInt16 nTmp = nActLevel;
diff --git a/sw/source/ui/misc/outline.hrc b/sw/source/ui/misc/outline.hrc
deleted file mode 100644
index ad06adf..0000000
--- a/sw/source/ui/misc/outline.hrc
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#define FT_1            6
-#define FT_2            7
-#define FT_3            8
-#define FT_4            9
-
-#define FT_COLL         20
-#define LB_COLL         21
-#define FT_NUMBER       22
-#define LB_NUMBER       23
-#define FT_DELIM        24
-#define FL_NUMBER       30
-
-#define LB_ALIGN        31
-#define FL_ALIGN        33
-
-#define FT_START        40
-#define ED_START        41
-#define FL_START        42
-
-#define BT_OK           100
-#define BT_CANCEL       101
-#define BT_HELP         102
-#define FL_FORM         105
-#define LB_FORM         106
-#define ED_FORM         107
-#define FT_ALL_LEVEL    108
-#define NF_ALL_LEVEL    109
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src
deleted file mode 100644
index c2249fd..0000000
--- a/sw/source/ui/misc/outline.src
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "misc.hrc"
-#include "outline.hrc"
-#include "globals.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_NUM_NAMES
-{
-    HelpID = HID_NUM_NAMES ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 164 , 82 ) ;
-    Text [ en-US ] = "Save As";
-    Moveable = TRUE ;
-    OKButton BT_OK
-    {
-        Pos = MAP_APPFONT ( 108 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BT_CANCEL
-    {
-        Pos = MAP_APPFONT ( 108 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BT_HELP
-    {
-        Pos = MAP_APPFONT ( 108 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    FixedLine FL_FORM
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 96 , 8 ) ;
-        Text [ en-US ] = "Format" ;
-    };
-    ListBox LB_FORM
-    {
-        HelpID = "sw:ListBox:DLG_NUM_NAMES:LB_FORM";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 29 ) ;
-        Size = MAP_APPFONT ( 84 , 42 ) ;
-        TabStop = TRUE ;
-        CurPos = 0 ;
-        StringList [ en-US ] =
-        {
-            < "Untitled 1" ; > ;
-            < "Untitled 2" ; > ;
-            < "Untitled 3" ; > ;
-            < "Untitled 4" ; > ;
-            < "Untitled 5" ; > ;
-            < "Untitled 6" ; > ;
-            < "Untitled 7" ; > ;
-            < "Untitled 8" ; > ;
-            < "Untitled 9" ; > ;
-        };
-    };
-    Edit ED_FORM
-    {
-        HelpID = "sw:Edit:DLG_NUM_NAMES:ED_FORM";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 84 , 12 ) ;
-        TabStop = TRUE ;
-        Left = TRUE ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/swriter/ui/numberingnamedialog.ui b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
index 22f728d..12b2b0e 100644
--- a/sw/uiconfig/swriter/ui/numberingnamedialog.ui
+++ b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
@@ -1,6 +1,41 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkListStore" id="liststore1">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Untitled 1</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 2</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 3</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 4</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 5</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 6</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 7</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 8</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Untitled 9</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkDialog" id="NumberingNameDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -97,6 +132,7 @@
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
+                        <property name="model">liststore1</property>
                         <child internal-child="selection">
                           <object class="GtkTreeSelection" id="treeview-selection1"/>
                         </child>
commit 470b5a94b866218237e04165d577728b4a4f9e42
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 26 14:51:26 2013 +0100

    convert numbering naming dialog to .ui
    
    Change-Id: Iff1a782fdedccf9a4865a54cf92261e7ac4693aa

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 775a88c..2341919 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -89,6 +89,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/linenumbering \
 	sw/uiconfig/swriter/ui/mergetabledialog \
 	sw/uiconfig/swriter/ui/numparapage \
+	sw/uiconfig/swriter/ui/numberingnamedialog \
 	sw/uiconfig/swriter/ui/opttestpage \
 	sw/uiconfig/swriter/ui/outlinenumbering \
 	sw/uiconfig/swriter/ui/outlinenumberingpage \
diff --git a/sw/uiconfig/swriter/ui/numberingnamedialog.ui b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
new file mode 100644
index 0000000..22f728d
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="NumberingNameDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Save As</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="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="layout_style">start</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-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="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <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>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</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">2</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="GtkFrame" id="frame1">
+            <property name="visible">True</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>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <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="row_spacing">6</property>
+                    <property name="column_spacing">12</property>
+                    <child>
+                      <object class="GtkTreeView" id="form:border">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection" id="treeview-selection1"/>
+                        </child>
+                      </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="GtkEntry" id="entry">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">●</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>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Format</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </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">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list