[Libreoffice-commits] .: 9 commits - svx/source svx/uiconfig svx/UI_svx.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 08:58:06 PST 2013


 svx/UI_svx.mk                                                          |    1 
 svx/source/unodialogs/textconversiondlgs/chinese_dialogs.src           |   81 ---
 svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx |   45 -
 svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hrc |   34 -
 svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx |   18 
 svx/source/unodialogs/textconversiondlgs/resids.hrc                    |    1 
 svx/uiconfig/ui/chineseconversiondialog.ui                             |  251 ++++++++++
 7 files changed, 276 insertions(+), 155 deletions(-)

New commits:
commit 805433ed483b62dbb1bef3301e26bd28ca544c35
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 14:19:34 2013 +0000

    Tutorial step #8 clean unused .src|.hrc remainders
    
    1.   Remove the DLG_CHINESETRANSLATION dialog from the .src
    1.1. Remove the .src from AllLangResTarget_<module>.mk if that
         that .src is now empty.
    1.2. Remove from any .hrc files any defines which are now
         unused due to removing that .src hunk
    1.3. Remove any .hrc files which are now empty and remove
         any #includes of those
    
    Change-Id: I872f97e4d3ec7404f4d8978c32e397bb20e96783

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dialogs.src b/svx/source/unodialogs/textconversiondlgs/chinese_dialogs.src
index 288208f..1ca4753 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dialogs.src
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dialogs.src
@@ -17,7 +17,6 @@
  */
 
 #include "chinese_dictionarydialog.hrc"
-#include "chinese_translationdialog.hrc"
 
 #include <svtools/controldims.hrc>
 
@@ -193,83 +192,3 @@ ModalDialog DLG_CHINESEDICTIONARY
 
     BUTTONS_OK_CANCEL_HELP_ABREAST( FULL_WIDTH - RSC_SP_DLG_INNERBORDER_RIGHT, ROW_8 )
 };
-
-//-----------------------------------------------------------------------------
-//defines for positions and sizes:
-
-#define T_FULL_WIDTH (220)
-#define T_FULL_HEIGHT (120)
-#define T_EDITBUTTON_WIDTH (75)
-
-#define T_COL_1 (RSC_SP_DLG_INNERBORDER_LEFT)
-#define T_COL_2 (T_COL_1+RSC_SP_FLGR_SPACE_X)
-#define T_COL_3 (T_COL_2+RSC_SP_CHK_TEXTINDENT)
-#define T_COL_4 (T_FULL_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT-T_EDITBUTTON_WIDTH)
-
-#define T_ROW_1 (RSC_SP_DLG_INNERBORDER_TOP)
-#define T_ROW_2 (T_ROW_1+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_CTRL_GROUP_Y)
-#define T_ROW_3 (T_ROW_2+RSC_CD_RADIOBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y)
-#define T_ROW_4 (T_ROW_3+RSC_CD_RADIOBUTTON_HEIGHT+RSC_SP_CTRL_DESC_Y)
-#define T_ROW_5 (T_ROW_4+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_CTRL_Y)
-#define T_ROW_6 (T_ROW_5+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_CTRL_GROUP_Y)
-
-#define T_ROW_8 (T_FULL_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM-RSC_CD_PUSHBUTTON_HEIGHT)
-#define T_ROW_7 (T_ROW_8-RSC_CD_FIXEDLINE_HEIGHT-2)
-
-//-----------------------------------------------------------------------------
-
-ModalDialog DLG_CHINESETRANSLATION
-{
-    HelpID = "svx:ModalDialog:DLG_CHINESETRANSLATION";
-    //HelpId = ;
-    Size = MAP_APPFONT( T_FULL_WIDTH, T_FULL_HEIGHT );
-    OutputSize = TRUE;
-    Closeable = TRUE ;
-    Moveable = TRUE ;
-    SVLook = TRUE;
-
-    Text [ en-US ] = "Chinese Conversion";
-
-    FixedLine FL_DIRECTION
-    {
-        Pos = MAP_APPFONT ( T_COL_1 , T_ROW_1 ) ;
-        Size = MAP_APPFONT ( T_FULL_WIDTH - T_COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ;
-        Text [ en-US ] = "Conversion direction";
-    };
-
-    DIRECTION_RADIOBUTTONS( T_COL_2, T_ROW_2, (T_FULL_WIDTH - T_COL_2 - RSC_SP_DLG_INNERBORDER_RIGHT) )
-
-    FixedLine FL_COMMONTERMS
-    {
-        Pos = MAP_APPFONT ( T_COL_1 , T_ROW_5 ) ;
-        Size = MAP_APPFONT ( T_FULL_WIDTH - T_COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ;
-        Text [ en-US ] = "Common terms";
-    };
-
-    CheckBox CB_TRANSLATE_COMMONTERMS
-    {
-        HelpID = "svx:CheckBox:DLG_CHINESETRANSLATION:CB_TRANSLATE_COMMONTERMS";
-        Pos = MAP_APPFONT( T_COL_2, T_ROW_6 );
-        Size = MAP_APPFONT ( T_COL_4 - T_COL_2, RSC_CD_CHECKBOX_HEIGHT ) ;
-
-        Text [ en-US ] = "Translate ~common terms";
-    };
-
-    PushButton PB_EDITTERMS
-    {
-        HelpID = "svx:PushButton:DLG_CHINESETRANSLATION:PB_EDITTERMS";
-        Pos = MAP_APPFONT( T_COL_4, T_ROW_6-(RSC_CD_PUSHBUTTON_HEIGHT-RSC_CD_CHECKBOX_HEIGHT)/2 );
-        Size = MAP_APPFONT( T_EDITBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
-
-        Text [ en-US ] = "~Edit Terms...";
-    };
-
-    FixedLine T_FL_BOTTOMLINE
-    {
-        Pos = MAP_APPFONT ( 0 , T_ROW_7 ) ;
-        Size = MAP_APPFONT ( T_FULL_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ) ;
-    };
-
-    BUTTONS_OK_CANCEL_HELP_ABREAST( T_FULL_WIDTH - RSC_SP_DLG_INNERBORDER_RIGHT, T_ROW_8 )
-};
-
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 34c11fa..d38eab3 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -19,7 +19,6 @@
 
 
 #include "chinese_translationdialog.hxx"
-#include "chinese_translationdialog.hrc"
 #include "resid.hxx"
 #include "chinese_dictionarydialog.hxx"
 #include <com/sun/star/i18n/TextConversionOption.hpp>
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hrc b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hrc
deleted file mode 100644
index 336cc4c..0000000
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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 .
- */
-#ifndef _TEXTCONVERSIONDLGS_CHINESE_TRANSLATIONDLG_HRC
-#define _TEXTCONVERSIONDLGS_CHINESE_TRANSLATIONDLG_HRC
-
-#include "resids.hrc"
-#include "buttongroup.hrc"
-#include "chinese_direction_ids.hrc"
-
-#define PB_EDITTERMS        1
-
-#define CB_USE_VARIANTS             1
-#define CB_TRANSLATE_COMMONTERMS    2
-
-#define FL_DIRECTION        1
-#define FL_COMMONTERMS      2
-#define T_FL_BOTTOMLINE       3
-
-#endif
diff --git a/svx/source/unodialogs/textconversiondlgs/resids.hrc b/svx/source/unodialogs/textconversiondlgs/resids.hrc
index 14f1141..ade936f 100644
--- a/svx/source/unodialogs/textconversiondlgs/resids.hrc
+++ b/svx/source/unodialogs/textconversiondlgs/resids.hrc
@@ -18,7 +18,6 @@
 #ifndef _TEXTCONVERSIONDLGS_RESID_HRC
 #define _TEXTCONVERSIONDLGS_RESID_HRC
 
-#define DLG_CHINESETRANSLATION  300
 #define DLG_CHINESEDICTIONARY   301
 
 #endif
commit 125ff276ae727ef5c1283e364693064a57c4f4b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 16:56:36 2013 +0000

    Tutorial step #7 remove FreeResource
    
    1. Remove the call to FreeResource, the dialog is no
       long resource based, so it will crash otherwise
    2. make dev-install, cross fingers, launch app
       and dialog
    3. launch under gdb if it crashes, typically asserts indicate
       typos in widget names or mismatched widget types
    
    Change-Id: I50df1b5d73e904c8d64feb06f23a9331340e40af

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 9f3462d..34c11fa 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -45,7 +45,6 @@ using namespace ::com::sun::star::uno;
 
 ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui")
-
     , m_pDictionaryDialog(0)
 {
     get(m_pBP_OK, "ok");
@@ -53,7 +52,6 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     get(m_pRB_To_Simplified, "tosimplified");
     get(m_pRB_To_Traditional, "totraditional");
     get(m_pCB_Translate_Commonterms, "commonterms");
-    FreeResource();
 
     m_pRB_To_Simplified->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
     m_pRB_To_Traditional->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL );
commit c22bdc3cc47c769dd1e1c59103e59b5f6762a065
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 16:55:40 2013 +0000

    Tutorial step #6 convert remaining widgets
    
    1. repeat step #5 for each remaining widget, this time making up more memorable
       names for the widgets we want to access and updating the .ui with them in
       parallel with adapting the code
    
    Change-Id: I29eba9fd0f8680d170412d45a39ff1e562261267

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 825a5af..9f3462d 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -46,32 +46,32 @@ using namespace ::com::sun::star::uno;
 ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui")
 
-    , m_aRB_To_Simplified( this, TextConversionDlgs_ResId( RB_TO_SIMPLIFIED ) )
-    , m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) )
-    , m_aCB_Translate_Commonterms( this, TextConversionDlgs_ResId( CB_TRANSLATE_COMMONTERMS ) )
-    , m_aPB_Editterms( this, TextConversionDlgs_ResId( PB_EDITTERMS ) )
     , m_pDictionaryDialog(0)
 {
     get(m_pBP_OK, "ok");
+    get(m_pPB_Editterms, "editterms");
+    get(m_pRB_To_Simplified, "tosimplified");
+    get(m_pRB_To_Traditional, "totraditional");
+    get(m_pCB_Translate_Commonterms, "commonterms");
     FreeResource();
 
-    m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
-    m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL );
+    m_pRB_To_Simplified->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
+    m_pRB_To_Traditional->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL );
 
     SvtLinguConfig  aLngCfg;
     sal_Bool bValue = sal_Bool();
     Any aAny( aLngCfg.GetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ) ) );
     aAny >>= bValue;
     if( bValue )
-        m_aRB_To_Simplified.Check();
+        m_pRB_To_Simplified->Check();
     else
-        m_aRB_To_Traditional.Check();
+        m_pRB_To_Traditional->Check();
 
     aAny = aLngCfg.GetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ) );
     if( aAny >>= bValue )
-        m_aCB_Translate_Commonterms.Check( bValue );
+        m_pCB_Translate_Commonterms->Check( bValue );
 
-    m_aPB_Editterms.SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) );
+    m_pPB_Editterms->SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) );
     m_pBP_OK->SetClickHdl( LINK( this, ChineseTranslationDialog, OkHdl ) );
 }
 
@@ -88,8 +88,8 @@ ChineseTranslationDialog::~ChineseTranslationDialog()
 void ChineseTranslationDialog::getSettings( sal_Bool& rbDirectionToSimplified
                                           , sal_Bool& rbTranslateCommonTerms ) const
 {
-    rbDirectionToSimplified = m_aRB_To_Simplified.IsChecked();
-    rbTranslateCommonTerms = m_aCB_Translate_Commonterms.IsChecked();
+    rbDirectionToSimplified = m_pRB_To_Simplified->IsChecked();
+    rbTranslateCommonTerms = m_pCB_Translate_Commonterms->IsChecked();
 }
 
 IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl)
@@ -97,9 +97,9 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl)
     //save settings to configuration
     SvtLinguConfig  aLngCfg;
     Any aAny;
-    aAny <<= sal_Bool( !!m_aRB_To_Simplified.IsChecked() );
+    aAny <<= sal_Bool( !!m_pRB_To_Simplified->IsChecked() );
     aLngCfg.SetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ), aAny );
-    aAny <<= sal_Bool( !!m_aCB_Translate_Commonterms.IsChecked() );
+    aAny <<= sal_Bool( !!m_pCB_Translate_Commonterms->IsChecked() );
     aLngCfg.SetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ), aAny );
 
     EndDialog( RET_OK );
@@ -125,9 +125,9 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, DictionaryHdl)
         else
         {
             sal_Int32 nTextConversionOptions = i18n::TextConversionOption::NONE;
-            if( !m_aCB_Translate_Commonterms.IsChecked() )
+            if( !m_pCB_Translate_Commonterms->IsChecked() )
                 nTextConversionOptions = nTextConversionOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
-            m_pDictionaryDialog->setDirectionAndTextConversionOptions( m_aRB_To_Simplified.IsChecked(), nTextConversionOptions );
+            m_pDictionaryDialog->setDirectionAndTextConversionOptions( m_pRB_To_Simplified->IsChecked(), nTextConversionOptions );
             m_pDictionaryDialog->Execute();
         }
     }
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index f9c9b83..d9ff8b9 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -52,11 +52,11 @@ private:
     void impl_UpdateVariantsCheckBox();
 
 private:
-    RadioButton m_aRB_To_Simplified;
-    RadioButton m_aRB_To_Traditional;
+    RadioButton* m_pRB_To_Simplified;
+    RadioButton* m_pRB_To_Traditional;
 
-    CheckBox    m_aCB_Translate_Commonterms;
-    PushButton  m_aPB_Editterms;
+    CheckBox*   m_pCB_Translate_Commonterms;
+    PushButton* m_pPB_Editterms;
 
     OKButton*   m_pBP_OK;
 
diff --git a/svx/uiconfig/ui/chineseconversiondialog.ui b/svx/uiconfig/ui/chineseconversiondialog.ui
index 25bd8f1..0d57438 100644
--- a/svx/uiconfig/ui/chineseconversiondialog.ui
+++ b/svx/uiconfig/ui/chineseconversiondialog.ui
@@ -97,7 +97,7 @@
                         <property name="hexpand">True</property>
                         <property name="row_spacing">6</property>
                         <child>
-                          <object class="GtkRadioButton" id="radiobutton1">
+                          <object class="GtkRadioButton" id="tosimplified">
                             <property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -106,7 +106,7 @@
                             <property name="xalign">0</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton2</property>
+                            <property name="group">totraditional</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -116,7 +116,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkRadioButton" id="radiobutton2">
+                          <object class="GtkRadioButton" id="totraditional">
                             <property name="label" translatable="yes">_Simplified Chinese to traditional Chinese</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -124,7 +124,7 @@
                             <property name="use_underline">True</property>
                             <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton1</property>
+                            <property name="group">tosimplified</property>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -179,7 +179,7 @@
                         <property name="row_spacing">6</property>
                         <property name="column_spacing">6</property>
                         <child>
-                          <object class="GtkCheckButton" id="checkbutton1">
+                          <object class="GtkCheckButton" id="commonterms">
                             <property name="label" translatable="yes">Translate _common terms</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -197,7 +197,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="button1">
+                          <object class="GtkButton" id="editterms">
                             <property name="label" translatable="yes">_Edit Terms...</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
commit c892615bfcfe1e6412c026d810c2bb411c3bbd30
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 16:53:17 2013 +0000

    Tutorial step #5 convert first remaining widget
    
    taking m_aBP_OK as a standalone example:
    
    1.   Change OKButton m_aBP_OK in header to OKButton* m_pBP_OK;
    1.1. Remove m_aBP_OK ctor call and change to
         get(<pointer>, "name in .ui file"), e.g.
         get(m_aBP_OK, "ok");
    1.1. Mass-convert calls from "m_aBP_OK." to "m_pBP_OK->"
         e.g. :%s/m_aBP_OK./m_pBP_OK->/g
    1.2. Search for anyremaining m_aBP_OK instances and adapt
    
    Change-Id: Iadb3ed674413c0b8eca3ba7a00bafaab112d8ff5

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 1293d40..825a5af 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -50,9 +50,9 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     , m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) )
     , m_aCB_Translate_Commonterms( this, TextConversionDlgs_ResId( CB_TRANSLATE_COMMONTERMS ) )
     , m_aPB_Editterms( this, TextConversionDlgs_ResId( PB_EDITTERMS ) )
-    , m_aBP_OK( this, TextConversionDlgs_ResId( PB_OK ) )
     , m_pDictionaryDialog(0)
 {
+    get(m_pBP_OK, "ok");
     FreeResource();
 
     m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
@@ -72,7 +72,7 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
         m_aCB_Translate_Commonterms.Check( bValue );
 
     m_aPB_Editterms.SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) );
-    m_aBP_OK.SetClickHdl( LINK( this, ChineseTranslationDialog, OkHdl ) );
+    m_pBP_OK->SetClickHdl( LINK( this, ChineseTranslationDialog, OkHdl ) );
 }
 
 ChineseTranslationDialog::~ChineseTranslationDialog()
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index a91a966..f9c9b83 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -58,7 +58,7 @@ private:
     CheckBox    m_aCB_Translate_Commonterms;
     PushButton  m_aPB_Editterms;
 
-    OKButton        m_aBP_OK;
+    OKButton*   m_pBP_OK;
 
     ChineseDictionaryDialog* m_pDictionaryDialog;
 };
commit 1b995cd4a6af8e8be60419ce76b7463ded72af8d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 16:51:42 2013 +0000

    Tutorial step #4 remove redundant FixedLine/FixedText constructors
    
    1.   It's nearly always the case that the FixedLine can
         be elided entirely as its only a visual effect with
         no methods called on it except its ctor, so
         explicit mention of it can be removed.
    2.   Thats's often the case for FixedText labels as well.
    
    Change-Id: Icd7434ee28d044d169f1d1ea230fbe9df9156bdc

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 7b08a50..1293d40 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -46,13 +46,10 @@ using namespace ::com::sun::star::uno;
 ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui")
 
-    , m_aFL_Direction( this, TextConversionDlgs_ResId( FL_DIRECTION ) )
     , m_aRB_To_Simplified( this, TextConversionDlgs_ResId( RB_TO_SIMPLIFIED ) )
     , m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) )
-    , m_aFL_Commonterms( this, TextConversionDlgs_ResId( FL_COMMONTERMS ) )
     , m_aCB_Translate_Commonterms( this, TextConversionDlgs_ResId( CB_TRANSLATE_COMMONTERMS ) )
     , m_aPB_Editterms( this, TextConversionDlgs_ResId( PB_EDITTERMS ) )
-    , m_aFL_Bottomline( this, TextConversionDlgs_ResId( T_FL_BOTTOMLINE ) )
     , m_aBP_OK( this, TextConversionDlgs_ResId( PB_OK ) )
     , m_pDictionaryDialog(0)
 {
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index 92c920c..a91a966 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -52,18 +52,12 @@ private:
     void impl_UpdateVariantsCheckBox();
 
 private:
-    FixedLine   m_aFL_Direction;
-
     RadioButton m_aRB_To_Simplified;
     RadioButton m_aRB_To_Traditional;
 
-    FixedLine   m_aFL_Commonterms;
-
     CheckBox    m_aCB_Translate_Commonterms;
     PushButton  m_aPB_Editterms;
 
-    FixedLine   m_aFL_Bottomline;
-
     OKButton        m_aBP_OK;
 
     ChineseDictionaryDialog* m_pDictionaryDialog;
commit b12527bf0ec4964a16240f9535b6fcab53ed1cf7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 13:53:26 2013 +0000

    Tutorial step #3 remove redundant button widget constructors
    
    1.   It's nearly always the case that the Help button has
         no methods called on it except its ctor, i.e.
         no changes to its default behaviour, so explicit
         mention of it can be removed.
    2.   Thats's often the case for the Cancel button
    3.   That's occasionally the case for the OK button
    
    Change-Id: Ic192962b2e55546cd448d7a69394ae13a743299e

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 298a927..7b08a50 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -54,8 +54,6 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
     , m_aPB_Editterms( this, TextConversionDlgs_ResId( PB_EDITTERMS ) )
     , m_aFL_Bottomline( this, TextConversionDlgs_ResId( T_FL_BOTTOMLINE ) )
     , m_aBP_OK( this, TextConversionDlgs_ResId( PB_OK ) )
-    , m_aBP_Cancel( this, TextConversionDlgs_ResId( PB_CANCEL ) )
-    , m_aBP_Help( this, TextConversionDlgs_ResId( PB_HELP ) )
     , m_pDictionaryDialog(0)
 {
     FreeResource();
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index a1b3217..92c920c 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -65,8 +65,6 @@ private:
     FixedLine   m_aFL_Bottomline;
 
     OKButton        m_aBP_OK;
-    CancelButton    m_aBP_Cancel;
-    HelpButton      m_aBP_Help;
 
     ChineseDictionaryDialog* m_pDictionaryDialog;
 };
commit 63065fa781d2568f22a5cc70d9390a2407f40ad8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 13:51:39 2013 +0000

    Tutorial step #3 change Dialog constructor
    
    Change-Id: Ibdd805d568da2006caaa2d0b756e809e48786f0c

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index f50679c..298a927 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -44,7 +44,8 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
 ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
-    : ModalDialog( pParent, TextConversionDlgs_ResId( DLG_CHINESETRANSLATION ) )
+    : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui")
+
     , m_aFL_Direction( this, TextConversionDlgs_ResId( FL_DIRECTION ) )
     , m_aRB_To_Simplified( this, TextConversionDlgs_ResId( RB_TO_SIMPLIFIED ) )
     , m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) )
commit 0a28e23be70d1e61dd176259b12e63bb128972f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 13:41:40 2013 +0000

    Tutorial step #2 improve .ui prototype
    
    1.   Pick a button to be the default button
    1.1. Select can-default and has-default
    2.   Pretty it up a little
    2.1. Set 12 pixel row spacing to toplevel grid
    2.2. Set 6 pixel row spacing on second level grids
    2.3. Set 6 pixel col spacing on second level grid
    2.4. Add 6 pixel top spacing to alignments
    3.   Resize behaviour
    3.1. Select "translate common terms" to horizontally expand
    3.2. Select frame1 and frame2 to vertically expand
    3.3. Resize dialog in glade and confirm behaviour is
         as desired
    3.4. confirm with glade-previewer
    3.5. confirm with ui-previewer
    
    Change-Id: I3a77f92394afdc849b45c38e16aab6e0349165e8

diff --git a/svx/uiconfig/ui/chineseconversiondialog.ui b/svx/uiconfig/ui/chineseconversiondialog.ui
index ee1ae16..25bd8f1 100644
--- a/svx/uiconfig/ui/chineseconversiondialog.ui
+++ b/svx/uiconfig/ui/chineseconversiondialog.ui
@@ -20,6 +20,8 @@
                 <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>
@@ -69,21 +71,31 @@
           <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">12</property>
             <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="grid2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="row_spacing">6</property>
                         <child>
                           <object class="GtkRadioButton" id="radiobutton1">
                             <property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</property>
@@ -147,23 +159,32 @@
               <object class="GtkFrame" id="frame2">
                 <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="alignment2">
                     <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="grid3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="row_spacing">6</property>
+                        <property name="column_spacing">6</property>
                         <child>
                           <object class="GtkCheckButton" id="checkbutton1">
                             <property name="label" translatable="yes">Translate _common terms</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
+                            <property name="hexpand">True</property>
                             <property name="use_underline">True</property>
                             <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
commit 230b9c2b37ad9f2726d74780716a5f654cc9b0f6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 22 13:04:51 2013 +0000

    Tutorial step #1 initial .ui prototype
    
    1.   Give the dialog the right title, "Chinese Conversion"
    2.   save as chineseconversiondialog.ui to <module>/uiconfig/ui
    3.   add to <module/UI_<module>.mk
    4.   Add the dialog action area buttons
    5.1. use stock gtk-ok, gtk-cancel, gtk-help, etc. for standard buttons
    5.2. call them "ok", "cancel", "help" for consistency
    6.   Visually the old dialog has two frames, "Conversion direction"
         and "Common terms"
    6.1. Add a GtkGrid, one column, two rows
    6.2. Add a GtkFrame to each
    6.3. Copy and paste in the frame titles from the .src
    6.4. Format the frame labels to use bold text and not bold markup
         as per https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
    7.   Conversion direction has two radio buttons
    7.1. Add a GtkGrid, one column, two rows to Conversion direction frame
    7.2. Add two radiobuttons, cut and paste in text from .src
    7.3. Convert vcl "~" mnemonic indication to .ui "_" and click use underline
    7.4. Group radiobutton1 with radiobutton2 and radiobutton2 with radiobutton1
    7.5. Set the radiobuttons that are not to be default selected as inactive
    8.   Common terms has one checkbox and a pushbutton
    8.1. Add a GtkGrid, two columns, one row
    8.2. Add a checkbox and button, copy and paste in text from .src
    8.3. do the ~ to _ + underscore conversion
    
    Change-Id: I49af68b8280876d8687fe9ecad4d80d12c9607c4

diff --git a/svx/UI_svx.mk b/svx/UI_svx.mk
index bba32ab..4abcd55 100644
--- a/svx/UI_svx.mk
+++ b/svx/UI_svx.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,svx))
 
 $(eval $(call gb_UI_add_uifiles,svx,\
 	svx/uiconfig/ui/asianphoneticguidedialog \
+	svx/uiconfig/ui/chineseconversiondialog \
 	svx/uiconfig/ui/compressgraphicdialog \
 ))
 
diff --git a/svx/uiconfig/ui/chineseconversiondialog.ui b/svx/uiconfig/ui/chineseconversiondialog.ui
new file mode 100644
index 0000000..ee1ae16
--- /dev/null
+++ b/svx/uiconfig/ui/chineseconversiondialog.ui
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="ChineseConversionDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Chinese Conversion</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">2</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="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="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkFrame" id="frame1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</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="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkRadioButton" id="radiobutton1">
+                            <property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radiobutton2</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="GtkRadioButton" id="radiobutton2">
+                            <property name="label" translatable="yes">_Simplified Chinese to traditional Chinese</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radiobutton1</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>
+                      </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">Conversion direction</property>
+                    <attributes>
+                      <attribute name="weight" value="semibold"/>
+                    </attributes>
+                  </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="GtkFrame" id="frame2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkCheckButton" id="checkbutton1">
+                            <property name="label" translatable="yes">Translate _common terms</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</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="GtkButton" id="button1">
+                            <property name="label" translatable="yes">_Edit Terms...</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_underline">True</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>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Common terms</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </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>
+          </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