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

Caolán McNamara caolanm at redhat.com
Tue Mar 11 09:34:32 PDT 2014


 cui/UIConfig_cui.mk                   |    1 
 cui/source/dialogs/cuigaldlg.cxx      |   59 +++------
 cui/source/dialogs/gallery.src        |   80 -------------
 cui/source/inc/cuigaldlg.hxx          |   18 --
 cui/source/inc/gallery.hrc            |   14 --
 cui/source/inc/helpid.hrc             |    2 
 cui/uiconfig/ui/gallerygeneralpage.ui |  207 ++++++++++++++++++++++++++++++++++
 include/svx/dialogs.hrc               |    2 
 svx/source/dialog/sdstring.src        |    5 
 9 files changed, 235 insertions(+), 153 deletions(-)

New commits:
commit 7c8bdd561c0b6474201f821e5341b8669d577827
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 11 14:44:27 2014 +0000

    convert gallery general page to .ui
    
    Change-Id: I329f8bdea6206f48cd3834126869584b9057253f

diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 1ca257a..bc0f070 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/effectspage \
 	cui/uiconfig/ui/eventsconfigpage \
 	cui/uiconfig/ui/formatcellsdialog \
+	cui/uiconfig/ui/gallerygeneralpage \
 	cui/uiconfig/ui/gallerysearchprogress \
 	cui/uiconfig/ui/gallerythemedialog \
 	cui/uiconfig/ui/gallerythemeiddialog \
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index b176f40..d7f09cd 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -614,8 +614,6 @@ GalleryThemeProperties::GalleryThemeProperties(Window* pParent,
     SetText( aText );
 }
 
-
-
 void GalleryThemeProperties::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 {
     if (nId == m_nGeneralPageId)
@@ -624,36 +622,20 @@ void GalleryThemeProperties::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         ( (TPGalleryThemeProperties&) rPage ).SetXChgData( pData );
 }
 
-
 // - TPGalleryThemeGeneral -
-
-
-TPGalleryThemeGeneral::TPGalleryThemeGeneral( Window* pParent, const SfxItemSet& rSet ) :
-            SfxTabPage              ( pParent, CUI_RES( RID_SVXTABPAGE_GALLERY_GENERAL ), rSet ),
-            aFiMSImage              ( this, CUI_RES( FI_MS_IMAGE ) ),
-            aEdtMSName              ( this, CUI_RES( EDT_MS_NAME ) ),
-            aFlMSGeneralFirst       ( this, CUI_RES( FL_MS_GENERAL_FIRST ) ),
-            aFtMSType               ( this, CUI_RES( FT_MS_TYPE ) ),
-            aFtMSShowType           ( this, CUI_RES( FT_MS_SHOW_TYPE ) ),
-            aFtMSPath               ( this, CUI_RES( FT_MS_PATH ) ),
-            aFtMSShowPath           ( this, CUI_RES( FT_MS_SHOW_PATH ) ),
-            aFtMSContent            ( this, CUI_RES( FT_MS_CONTENT ) ),
-            aFtMSShowContent        ( this, CUI_RES( FT_MS_SHOW_CONTENT ) ),
-            aFlMSGeneralSecond      ( this, CUI_RES( FL_MS_GENERAL_SECOND ) ),
-            aFtMSChangeDate         ( this, CUI_RES( FT_MS_CHANGEDATE ) ),
-            aFtMSShowChangeDate     ( this, CUI_RES( FT_MS_SHOW_CHANGEDATE ) ),
-            pData(NULL)
+TPGalleryThemeGeneral::TPGalleryThemeGeneral(Window* pParent, const SfxItemSet& rSet)
+    : SfxTabPage(pParent, "GalleryGeneralPage",
+        "cui/ui/gallerygeneralpage.ui", rSet)
+    , pData(NULL)
 {
-    FreeResource();
-
-    OUString aAccName(SVX_RES(RID_SVXSTR_GALLERY_THEMENAME));
-    aEdtMSName.SetAccessibleName(aAccName);
-    aFiMSImage.SetAccessibleName(aAccName);
-    aEdtMSName.SetAccessibleRelationLabeledBy( &aFiMSImage );
+    get(m_pFiMSImage, "image");
+    get(m_pEdtMSName, "name");
+    get(m_pFtMSShowType, "type");
+    get(m_pFtMSShowPath, "location");
+    get(m_pFtMSShowContent, "contents");
+    get(m_pFtMSShowChangeDate, "modified");
 }
 
-
-
 void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
 {
     pData = _pData;
@@ -665,20 +647,19 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
     OUString            aType( SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) );
     sal_Bool            bReadOnly = pThm->IsReadOnly();
 
-    aEdtMSName.SetHelpId( HID_GALLERY_EDIT_MSNAME );
-    aEdtMSName.SetText( pThm->GetName() );
-    aEdtMSName.SetReadOnly( bReadOnly );
+    m_pEdtMSName->SetText( pThm->GetName() );
+    m_pEdtMSName->SetReadOnly( bReadOnly );
 
     if( bReadOnly )
-        aEdtMSName.Disable();
+        m_pEdtMSName->Disable();
     else
-        aEdtMSName.Enable();
+        m_pEdtMSName->Enable();
 
     if( pThm->IsReadOnly() )
         aType += CUI_RES( RID_SVXSTR_GALLERY_READONLY );
 
-    aFtMSShowType.SetText( aType );
-    aFtMSShowPath.SetText( pThm->GetSdgURL().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
+    m_pFtMSShowType->SetText( aType );
+    m_pFtMSShowPath->SetText( pThm->GetSdgURL().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
 
     // singular or plural?
     if ( 1 == pThm->GetObjectCount() )
@@ -688,7 +669,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
 
     aOutStr += " " + aObjStr;
 
-    aFtMSShowContent.SetText( aOutStr );
+    m_pFtMSShowContent->SetText( aOutStr );
 
     // get locale wrapper (singleton)
     const SvtSysLocale aSysLocale;
@@ -696,7 +677,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
 
     // ChangeDate/Time
     aAccess = aLocaleData.getDate( pData->aThemeChangeDate ) + ", " + aLocaleData.getTime( pData->aThemeChangeTime );
-    aFtMSShowChangeDate.SetText( aAccess );
+    m_pFtMSShowChangeDate->SetText( aAccess );
 
     // set image
     sal_uInt16 nId;
@@ -708,14 +689,14 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
     else
         nId = RID_SVXBMP_THEME_NORMAL_BIG;
 
-    aFiMSImage.SetImage( Image( Bitmap( CUI_RES( nId ) ), COL_LIGHTMAGENTA ) );
+    m_pFiMSImage->SetImage( Image( Bitmap( CUI_RES( nId ) ), COL_LIGHTMAGENTA ) );
 }
 
 
 
 sal_Bool TPGalleryThemeGeneral::FillItemSet( SfxItemSet& /*rSet*/ )
 {
-    pData->aEditedTitle = aEdtMSName.GetText();
+    pData->aEditedTitle = m_pEdtMSName->GetText();
     return sal_True;
 }
 
diff --git a/cui/source/dialogs/gallery.src b/cui/source/dialogs/gallery.src
index 076b949..b7cc83c 100644
--- a/cui/source/dialogs/gallery.src
+++ b/cui/source/dialogs/gallery.src
@@ -27,86 +27,6 @@
 
 /******************************************************************************/
 
-TabPage RID_SVXTABPAGE_GALLERY_GENERAL
-{
-    HelpId = HID_GALLERY_PROPERTIES_GENERAL;
-    SVLook = TRUE ;
-    Hide = TRUE ;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    FixedImage FI_MS_IMAGE
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 20 , 20 ) ;
-    };
-    Edit EDT_MS_NAME
-    {
-        HelpID = "cui:Edit:RID_SVXTABPAGE_GALLERY_GENERAL:EDT_MS_NAME";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 60 , 10 ) ;
-        Size = MAP_APPFONT ( 194 , 12 ) ;
-    };
-    FixedLine FL_MS_GENERAL_FIRST
-    {
-        Pos = MAP_APPFONT ( 6 , 36 ) ;
-        Size = MAP_APPFONT ( 248 , 1 ) ;
-    };
-    FixedText FT_MS_TYPE
-    {
-        Pos = MAP_APPFONT ( 6 , 43 ) ;
-        Size = MAP_APPFONT ( 51 , 10 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "Type:" ;
-    };
-    FixedText FT_MS_SHOW_TYPE
-    {
-        Pos = MAP_APPFONT ( 60 , 43 ) ;
-        Size = MAP_APPFONT ( 194 , 10 ) ;
-    };
-    FixedText FT_MS_PATH
-    {
-        Pos = MAP_APPFONT ( 6 , 57 ) ;
-        Size = MAP_APPFONT ( 51 , 10 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "Location:" ;
-    };
-    FixedText FT_MS_SHOW_PATH
-    {
-        Pos = MAP_APPFONT ( 60 , 57 ) ;
-        Size = MAP_APPFONT ( 194 , 10 ) ;
-    };
-    FixedText FT_MS_CONTENT
-    {
-        Pos = MAP_APPFONT ( 6 , 71 ) ;
-        Size = MAP_APPFONT ( 51 , 10 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "Contents:" ;
-    };
-    FixedText FT_MS_SHOW_CONTENT
-    {
-        Pos = MAP_APPFONT ( 60 , 71 ) ;
-        Size = MAP_APPFONT ( 194 , 10 ) ;
-    };
-    FixedLine FL_MS_GENERAL_SECOND
-    {
-        Pos = MAP_APPFONT ( 6 , 91 ) ;
-        Size = MAP_APPFONT ( 248 , 1 ) ;
-    };
-    FixedText FT_MS_CHANGEDATE
-    {
-        Pos = MAP_APPFONT ( 6 , 98 ) ;
-        Size = MAP_APPFONT ( 51 , 10 ) ;
-        LeftLabel = TRUE ;
-        Text [ en-US ] = "Modified:" ;
-    };
-    FixedText FT_MS_SHOW_CHANGEDATE
-    {
-        Pos = MAP_APPFONT ( 60 , 98 ) ;
-        Size = MAP_APPFONT ( 194 , 10 ) ;
-    };
-};
-
-/******************************************************************************/
-
 TabPage RID_SVXTABPAGE_GALLERYTHEME_FILES
 {
     HelpId = HID_GALLERY_BROWSER ;
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index eb242ef..969ce2b 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -210,18 +210,12 @@ class TPGalleryThemeGeneral : public SfxTabPage
 {
 private:
 
-    FixedImage          aFiMSImage;
-    Edit                aEdtMSName;
-    FixedLine           aFlMSGeneralFirst;
-    FixedText           aFtMSType;
-    FixedText           aFtMSShowType;
-    FixedText           aFtMSPath;
-    FixedText           aFtMSShowPath;
-    FixedText           aFtMSContent;
-    FixedText           aFtMSShowContent;
-    FixedLine           aFlMSGeneralSecond;
-    FixedText           aFtMSChangeDate;
-    FixedText           aFtMSShowChangeDate;
+    FixedImage*         m_pFiMSImage;
+    Edit*               m_pEdtMSName;
+    FixedText*          m_pFtMSShowType;
+    FixedText*          m_pFtMSShowPath;
+    FixedText*          m_pFtMSShowContent;
+    FixedText*          m_pFtMSShowChangeDate;
     ExchangeData*       pData;
 
     virtual void        Reset( const SfxItemSet& ) {}
diff --git a/cui/source/inc/gallery.hrc b/cui/source/inc/gallery.hrc
index d142711..74cf43c 100644
--- a/cui/source/inc/gallery.hrc
+++ b/cui/source/inc/gallery.hrc
@@ -59,18 +59,4 @@
 #define FL_ACTUALIZE_PROGRESS 1
 #define FT_ACTUALIZE_FILE 1
 
-// Gallery-TabDialog
-#define FI_MS_IMAGE 1
-#define EDT_MS_NAME 1
-#define FL_MS_GENERAL_FIRST 1
-#define FT_MS_TYPE 2
-#define FT_MS_SHOW_TYPE 3
-#define FT_MS_PATH 4
-#define FT_MS_SHOW_PATH 5
-#define FT_MS_CONTENT 6
-#define FT_MS_SHOW_CONTENT 7
-#define FL_MS_GENERAL_SECOND 2
-#define FT_MS_CHANGEDATE 10
-#define FT_MS_SHOW_CHANGEDATE 11
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index e2917dc..6181d49 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -132,7 +132,6 @@
 #define HID_CONFIG_EVENT_DOCUMENT_BASED "CUI_HID_CONFIG_EVENT_DOCUMENT_BASED"
 #define HID_SVX_CONFIG_TOOLBAR "CUI_HID_SVX_CONFIG_TOOLBAR"
 #define HID_SVX_CONFIG_TOOLBAR_CONTENTS "CUI_HID_SVX_CONFIG_TOOLBAR_CONTENTS"
-#define HID_GALLERY_EDIT_MSNAME "CUI_HID_GALLERY_EDIT_MSNAME"
 #define HID_SVX_CONFIG_MENU_CONTENTS "CUI_HID_SVX_CONFIG_MENU_CONTENTS"
 #define HID_GALLERY_NEWTHEME_FINDFILES "CUI_HID_GALLERY_NEWTHEME_FINDFILES"
 #define HID_GALLERY_NEWTHEME_ADDFILES "CUI_HID_GALLERY_NEWTHEME_ADDFILES"
@@ -166,7 +165,6 @@
 #define HID_FM_DLG_SEARCH "CUI_HID_FM_DLG_SEARCH"
 #define HID_SEARCH_TEXT "CUI_HID_SEARCH_TEXT"
 #define HID_SEARCH_ALLFIELDS "CUI_HID_SEARCH_ALLFIELDS"
-#define HID_GALLERY_PROPERTIES_GENERAL "CUI_HID_GALLERY_PROPERTIES_GENERAL"
 #define HID_SEARCH_FIELDSELECTION "CUI_HID_SEARCH_FIELDSELECTION"
 #define HID_SEARCH_POSITION "CUI_HID_SEARCH_POSITION"
 #define HID_SEARCH_FORMATTER "CUI_HID_SEARCH_FORMATTER"
diff --git a/cui/uiconfig/ui/gallerygeneralpage.ui b/cui/uiconfig/ui/gallerygeneralpage.ui
new file mode 100644
index 0000000..4d82153
--- /dev/null
+++ b/cui/uiconfig/ui/gallerygeneralpage.ui
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkGrid" id="GalleryGeneralPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
+    <property name="row_spacing">24</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</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">0</property>
+            <property name="label" translatable="yes">Modified:</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="modified">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</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>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <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>
+        <child>
+          <object class="GtkLabel" id="label2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Type:</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="type">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</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="label3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Location:</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="label4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Contents:</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="location">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</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>
+        <child>
+          <object class="GtkLabel" id="contents">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </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="GtkGrid" id="grid3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="column_spacing">12</property>
+        <child>
+          <object class="GtkImage" id="image">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <accessibility>
+              <relation type="label-for" target="name"/>
+            </accessibility>
+            <child internal-child="accessible">
+              <object class="AtkObject" id="image-atkobject">
+                <property name="AtkObject::accessible-name" translatable="yes">Theme Name</property>
+              </object>
+            </child>
+          </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="GtkEntry" id="name">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <accessibility>
+              <relation type="labelled-by" target="image"/>
+            </accessibility>
+          </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>
+      </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>
+  <object class="GtkSizeGroup" id="sizegroup1">
+    <widgets>
+      <widget name="label1"/>
+      <widget name="label2"/>
+      <widget name="label3"/>
+      <widget name="label4"/>
+      <widget name="image"/>
+    </widgets>
+  </object>
+</interface>
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 6871f8f..d7b252d 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -45,7 +45,7 @@
 #define RID_SVXSTR_COLOR_USER               (RID_SVX_START + 250)
 #define RID_SVXSTR_GALLERYPROPS_GALTHEME    (RID_SVX_START + 251)
 #define RID_SVXSTR_GALLERY_THEMEITEMS       (RID_SVX_START + 252)
-#define RID_SVXSTR_GALLERY_THEMENAME        (RID_SVX_START + 253)
+
 #define RID_SVXSTR_GALLERY_FILESFOUND       (RID_SVX_START + 254)
 #define RID_SVXSTR_GALLERY_PREVIEW          (RID_SVX_START + 255)
 
diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src
index 2e6c2a3..6c3dad3 100644
--- a/svx/source/dialog/sdstring.src
+++ b/svx/source/dialog/sdstring.src
@@ -2103,11 +2103,6 @@ String RID_SVXSTR_GALLERY_THEMEITEMS
     Text [ en-US ] = "Theme Items";
 };
 
-String RID_SVXSTR_GALLERY_THEMENAME
-{
-    Text [ en-US ] = "Theme Name";
-};
-
 String RID_SVXSTR_GALLERY_FILESFOUND
 {
     Text [ en-US ] = "Files Found";


More information about the Libreoffice-commits mailing list