[Libreoffice-commits] core.git: cui/source cui/uiconfig cui/UIConfig_cui.mk

Caolán McNamara caolanm at redhat.com
Mon Jan 6 07:07:25 PST 2014


 cui/UIConfig_cui.mk                |    1 
 cui/source/customize/cfg.cxx       |   61 ++++---------
 cui/source/customize/cfg.src       |   39 --------
 cui/source/inc/cfg.hxx             |    7 -
 cui/uiconfig/ui/customizedialog.ui |  162 +++++++++++++++++++++++++++++++++++++
 5 files changed, 188 insertions(+), 82 deletions(-)

New commits:
commit 0194b9f5eb6ce5384a706c750f1412bd2470206e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 6 15:06:16 2014 +0000

    convert customize tab dialog to .ui
    
    Change-Id: I95463021b388e936e8982454b91e58036e3920b5

diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 07a669d..3f1ba6d 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/gradientpage \
 	cui/uiconfig/ui/colorconfigwin \
 	cui/uiconfig/ui/connpooloptions \
+	cui/uiconfig/ui/customizedialog \
 	cui/uiconfig/ui/dbregisterpage \
 	cui/uiconfig/ui/effectspage \
 	cui/uiconfig/ui/formatcellsdialog \
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index fc817d6..590d9de 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -782,23 +782,23 @@ sal_Bool impl_showKeyConfigTabPage( const css::uno::Reference< css::frame::XFram
  * key bindings.
  *
  *****************************************************************************/
-SvxConfigDialog::SvxConfigDialog(
-    Window * pParent, const SfxItemSet* pSet_ )
-    :
-        SfxTabDialog( pParent,
-            CUI_RES( RID_SVXDLG_CUSTOMIZE ), pSet_ )
+SvxConfigDialog::SvxConfigDialog(Window * pParent, const SfxItemSet* pInSet)
+    : SfxTabDialog(pParent, "CustomizeDialog",
+        "cui/ui/customizedialog.ui", pInSet)
+    , m_nMenusPageId(0)
+    , m_nKeyboardPageId(0)
+    , m_nToolbarsPageId(0)
+    , m_nEventsPageId(0)
 {
-    FreeResource();
-
     InitImageType();
 
-    AddTabPage( RID_SVXPAGE_MENUS, CreateSvxMenuConfigPage, NULL );
-    AddTabPage( RID_SVXPAGE_KEYBOARD, CreateKeyboardConfigPage, NULL );
-    AddTabPage( RID_SVXPAGE_TOOLBARS, CreateSvxToolbarConfigPage, NULL );
-    AddTabPage( RID_SVXPAGE_EVENTS, CreateSvxEventConfigPage, NULL );
+    m_nMenusPageId = AddTabPage("menus", CreateSvxMenuConfigPage, NULL);
+    m_nKeyboardPageId = AddTabPage("keyboard", CreateKeyboardConfigPage, NULL);
+    m_nToolbarsPageId = AddTabPage("toolbars", CreateSvxToolbarConfigPage, NULL);
+    m_nEventsPageId = AddTabPage("events", CreateSvxEventConfigPage, NULL);
 
     const SfxPoolItem* pItem =
-        pSet_->GetItem( pSet_->GetPool()->GetWhich( SID_CONFIG ) );
+        pInSet->GetItem( pInSet->GetPool()->GetWhich( SID_CONFIG ) );
 
     if ( pItem )
     {
@@ -806,7 +806,7 @@ SvxConfigDialog::SvxConfigDialog(
 
         if (text.startsWith( ITEM_TOOLBAR_URL ) )
         {
-            SetCurPageId( RID_SVXPAGE_TOOLBARS );
+            SetCurPageId(m_nToolbarsPageId);
         }
     }
 }
@@ -816,38 +816,19 @@ void SvxConfigDialog::SetFrame(const ::com::sun::star::uno::Reference< ::com::su
     m_xFrame = xFrame;
 
     if (!impl_showKeyConfigTabPage( xFrame ))
-        RemoveTabPage( RID_SVXPAGE_KEYBOARD );
-}
-
-SvxConfigDialog::~SvxConfigDialog()
-{
-}
-
-short SvxConfigDialog::Ok()
-{
-    return SfxTabDialog::Ok();
+        RemoveTabPage(m_nKeyboardPageId);
 }
 
 void SvxConfigDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
 {
-    (void)rPage;
-
-    switch ( nId )
+    if (nId == m_nMenusPageId || nId == m_nKeyboardPageId ||
+        nId == m_nToolbarsPageId)
     {
-        case RID_SVXPAGE_MENUS:
-        case RID_SVXPAGE_TOOLBARS:
-        case RID_SVXPAGE_KEYBOARD:
-            {
-                rPage.SetFrame(m_xFrame);
-            }
-            break;
-        case RID_SVXPAGE_EVENTS:
-            {
-                dynamic_cast< SvxEventConfigPage& >( rPage ).LateInit( m_xFrame );
-            };
-            break;
-        default:
-            break;
+        rPage.SetFrame(m_xFrame);
+    }
+    else if (nId == m_nEventsPageId)
+    {
+        dynamic_cast< SvxEventConfigPage& >( rPage ).LateInit( m_xFrame );
     }
 }
 
diff --git a/cui/source/customize/cfg.src b/cui/source/customize/cfg.src
index 6ba7277..35d2aeb 100644
--- a/cui/source/customize/cfg.src
+++ b/cui/source/customize/cfg.src
@@ -20,45 +20,6 @@
 #include "cfg.hrc"
 #include "helpid.hrc"
 
-TabDialog RID_SVXDLG_CUSTOMIZE
-{
-    OutputSize = TRUE ;
-    Text [ en-US ] = "Customize" ;
-    Moveable = TRUE ;
-    SvLook = TRUE ;
-    TabControl 1
-    {
-        OutputSize = TRUE ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_MENUS ;
-                Text [ en-US ] = "Menus" ;
-                PageResID = 300 ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_KEYBOARD ;
-                Text [ en-US ] = "Keyboard" ;
-                PageResID = 301 ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TOOLBARS ;
-                Text [ en-US ] = "Toolbars" ;
-                PageResID = 302 ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_EVENTS ;
-                Text [ en-US ] = "Events" ;
-                PageResID = 303 ;
-            };
-        };
-    };
-};
-
 #define TEXT_MENU \
     Text [ en-US ] = "Menu" ;\
 
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index d4027f1..d0c1a33 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -58,14 +58,15 @@ class SvxConfigDialog : public SfxTabDialog
 {
 private:
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+    sal_uInt16 m_nMenusPageId;
+    sal_uInt16 m_nKeyboardPageId;
+    sal_uInt16 m_nToolbarsPageId;
+    sal_uInt16 m_nEventsPageId;
 
 public:
     SvxConfigDialog( Window*, const SfxItemSet* );
-    ~SvxConfigDialog();
 
     virtual void                PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
-    virtual short               Ok();
-
     void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
 };
 
diff --git a/cui/uiconfig/ui/customizedialog.ui b/cui/uiconfig/ui/customizedialog.ui
new file mode 100644
index 0000000..57dd0f3
--- /dev/null
+++ b/cui/uiconfig/ui/customizedialog.ui
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Mon Jan  6 14:53:29 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="CustomizeDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Customize</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="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>
+            <child>
+              <object class="GtkButton" id="reset">
+                <property name="label">gtk-revert-to-saved</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">3</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="GtkNotebook" id="tabcontrol">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="menus">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Menus</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="keyboard">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Keyboard</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="toolbars">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Toolbars</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="events">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Events</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</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">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+      <action-widget response="0">reset</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list