summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-22 16:55:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-22 16:57:44 +0000
commitc22bdc3cc47c769dd1e1c59103e59b5f6762a065 (patch)
tree6c64f4e5dfa5b452c99d84d89f7f5cd9b0c61bf2
parentc892615bfcfe1e6412c026d810c2bb411c3bbd30 (diff)
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
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx32
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx8
-rw-r--r--svx/uiconfig/ui/chineseconversiondialog.ui12
3 files changed, 26 insertions, 26 deletions
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 825a5afe5548..9f3462da1565 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;
46ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent ) 46ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
47 : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui") 47 : ModalDialog(pParent, "ChineseConversionDialog", "svx/ui/chineseconversiondialog.ui")
48 48
49 , m_aRB_To_Simplified( this, TextConversionDlgs_ResId( RB_TO_SIMPLIFIED ) )
50 , m_aRB_To_Traditional( this, TextConversionDlgs_ResId( RB_TO_TRADITIONAL ) )
51 , m_aCB_Translate_Commonterms( this, TextConversionDlgs_ResId( CB_TRANSLATE_COMMONTERMS ) )
52 , m_aPB_Editterms( this, TextConversionDlgs_ResId( PB_EDITTERMS ) )
53 , m_pDictionaryDialog(0) 49 , m_pDictionaryDialog(0)
54{ 50{
55 get(m_pBP_OK, "ok"); 51 get(m_pBP_OK, "ok");
52 get(m_pPB_Editterms, "editterms");
53 get(m_pRB_To_Simplified, "tosimplified");
54 get(m_pRB_To_Traditional, "totraditional");
55 get(m_pCB_Translate_Commonterms, "commonterms");
56 FreeResource(); 56 FreeResource();
57 57
58 m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED ); 58 m_pRB_To_Simplified->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED );
59 m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL ); 59 m_pRB_To_Traditional->SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL );
60 60
61 SvtLinguConfig aLngCfg; 61 SvtLinguConfig aLngCfg;
62 sal_Bool bValue = sal_Bool(); 62 sal_Bool bValue = sal_Bool();
63 Any aAny( aLngCfg.GetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ) ) ); 63 Any aAny( aLngCfg.GetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ) ) );
64 aAny >>= bValue; 64 aAny >>= bValue;
65 if( bValue ) 65 if( bValue )
66 m_aRB_To_Simplified.Check(); 66 m_pRB_To_Simplified->Check();
67 else 67 else
68 m_aRB_To_Traditional.Check(); 68 m_pRB_To_Traditional->Check();
69 69
70 aAny = aLngCfg.GetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ) ); 70 aAny = aLngCfg.GetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ) );
71 if( aAny >>= bValue ) 71 if( aAny >>= bValue )
72 m_aCB_Translate_Commonterms.Check( bValue ); 72 m_pCB_Translate_Commonterms->Check( bValue );
73 73
74 m_aPB_Editterms.SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) ); 74 m_pPB_Editterms->SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) );
75 m_pBP_OK->SetClickHdl( LINK( this, ChineseTranslationDialog, OkHdl ) ); 75 m_pBP_OK->SetClickHdl( LINK( this, ChineseTranslationDialog, OkHdl ) );
76} 76}
77 77
@@ -88,8 +88,8 @@ ChineseTranslationDialog::~ChineseTranslationDialog()
88void ChineseTranslationDialog::getSettings( sal_Bool& rbDirectionToSimplified 88void ChineseTranslationDialog::getSettings( sal_Bool& rbDirectionToSimplified
89 , sal_Bool& rbTranslateCommonTerms ) const 89 , sal_Bool& rbTranslateCommonTerms ) const
90{ 90{
91 rbDirectionToSimplified = m_aRB_To_Simplified.IsChecked(); 91 rbDirectionToSimplified = m_pRB_To_Simplified->IsChecked();
92 rbTranslateCommonTerms = m_aCB_Translate_Commonterms.IsChecked(); 92 rbTranslateCommonTerms = m_pCB_Translate_Commonterms->IsChecked();
93} 93}
94 94
95IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl) 95IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl)
@@ -97,9 +97,9 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl)
97 //save settings to configuration 97 //save settings to configuration
98 SvtLinguConfig aLngCfg; 98 SvtLinguConfig aLngCfg;
99 Any aAny; 99 Any aAny;
100 aAny <<= sal_Bool( !!m_aRB_To_Simplified.IsChecked() ); 100 aAny <<= sal_Bool( !!m_pRB_To_Simplified->IsChecked() );
101 aLngCfg.SetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ), aAny ); 101 aLngCfg.SetProperty( rtl::OUString( UPN_IS_DIRECTION_TO_SIMPLIFIED ), aAny );
102 aAny <<= sal_Bool( !!m_aCB_Translate_Commonterms.IsChecked() ); 102 aAny <<= sal_Bool( !!m_pCB_Translate_Commonterms->IsChecked() );
103 aLngCfg.SetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ), aAny ); 103 aLngCfg.SetProperty( rtl::OUString( UPN_IS_TRANSLATE_COMMON_TERMS ), aAny );
104 104
105 EndDialog( RET_OK ); 105 EndDialog( RET_OK );
@@ -125,9 +125,9 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, DictionaryHdl)
125 else 125 else
126 { 126 {
127 sal_Int32 nTextConversionOptions = i18n::TextConversionOption::NONE; 127 sal_Int32 nTextConversionOptions = i18n::TextConversionOption::NONE;
128 if( !m_aCB_Translate_Commonterms.IsChecked() ) 128 if( !m_pCB_Translate_Commonterms->IsChecked() )
129 nTextConversionOptions = nTextConversionOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER; 129 nTextConversionOptions = nTextConversionOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
130 m_pDictionaryDialog->setDirectionAndTextConversionOptions( m_aRB_To_Simplified.IsChecked(), nTextConversionOptions ); 130 m_pDictionaryDialog->setDirectionAndTextConversionOptions( m_pRB_To_Simplified->IsChecked(), nTextConversionOptions );
131 m_pDictionaryDialog->Execute(); 131 m_pDictionaryDialog->Execute();
132 } 132 }
133 } 133 }
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index f9c9b83fc3e6..d9ff8b97d10d 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -52,11 +52,11 @@ private:
52 void impl_UpdateVariantsCheckBox(); 52 void impl_UpdateVariantsCheckBox();
53 53
54private: 54private:
55 RadioButton m_aRB_To_Simplified; 55 RadioButton* m_pRB_To_Simplified;
56 RadioButton m_aRB_To_Traditional; 56 RadioButton* m_pRB_To_Traditional;
57 57
58 CheckBox m_aCB_Translate_Commonterms; 58 CheckBox* m_pCB_Translate_Commonterms;
59 PushButton m_aPB_Editterms; 59 PushButton* m_pPB_Editterms;
60 60
61 OKButton* m_pBP_OK; 61 OKButton* m_pBP_OK;
62 62
diff --git a/svx/uiconfig/ui/chineseconversiondialog.ui b/svx/uiconfig/ui/chineseconversiondialog.ui
index 25bd8f1c54f0..0d574383ab49 100644
--- a/svx/uiconfig/ui/chineseconversiondialog.ui
+++ b/svx/uiconfig/ui/chineseconversiondialog.ui
@@ -97,7 +97,7 @@
97 <property name="hexpand">True</property> 97 <property name="hexpand">True</property>
98 <property name="row_spacing">6</property> 98 <property name="row_spacing">6</property>
99 <child> 99 <child>
100 <object class="GtkRadioButton" id="radiobutton1"> 100 <object class="GtkRadioButton" id="tosimplified">
101 <property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</property> 101 <property name="label" translatable="yes">_Traditional Chinese to simplified Chinese</property>
102 <property name="visible">True</property> 102 <property name="visible">True</property>
103 <property name="can_focus">True</property> 103 <property name="can_focus">True</property>
@@ -106,7 +106,7 @@
106 <property name="xalign">0</property> 106 <property name="xalign">0</property>
107 <property name="active">True</property> 107 <property name="active">True</property>
108 <property name="draw_indicator">True</property> 108 <property name="draw_indicator">True</property>
109 <property name="group">radiobutton2</property> 109 <property name="group">totraditional</property>
110 </object> 110 </object>
111 <packing> 111 <packing>
112 <property name="left_attach">0</property> 112 <property name="left_attach">0</property>
@@ -116,7 +116,7 @@
116 </packing> 116 </packing>
117 </child> 117 </child>
118 <child> 118 <child>
119 <object class="GtkRadioButton" id="radiobutton2"> 119 <object class="GtkRadioButton" id="totraditional">
120 <property name="label" translatable="yes">_Simplified Chinese to traditional Chinese</property> 120 <property name="label" translatable="yes">_Simplified Chinese to traditional Chinese</property>
121 <property name="visible">True</property> 121 <property name="visible">True</property>
122 <property name="can_focus">True</property> 122 <property name="can_focus">True</property>
@@ -124,7 +124,7 @@
124 <property name="use_underline">True</property> 124 <property name="use_underline">True</property>
125 <property name="xalign">0</property> 125 <property name="xalign">0</property>
126 <property name="draw_indicator">True</property> 126 <property name="draw_indicator">True</property>
127 <property name="group">radiobutton1</property> 127 <property name="group">tosimplified</property>
128 </object> 128 </object>
129 <packing> 129 <packing>
130 <property name="left_attach">0</property> 130 <property name="left_attach">0</property>
@@ -179,7 +179,7 @@
179 <property name="row_spacing">6</property> 179 <property name="row_spacing">6</property>
180 <property name="column_spacing">6</property> 180 <property name="column_spacing">6</property>
181 <child> 181 <child>
182 <object class="GtkCheckButton" id="checkbutton1"> 182 <object class="GtkCheckButton" id="commonterms">
183 <property name="label" translatable="yes">Translate _common terms</property> 183 <property name="label" translatable="yes">Translate _common terms</property>
184 <property name="visible">True</property> 184 <property name="visible">True</property>
185 <property name="can_focus">True</property> 185 <property name="can_focus">True</property>
@@ -197,7 +197,7 @@
197 </packing> 197 </packing>
198 </child> 198 </child>
199 <child> 199 <child>
200 <object class="GtkButton" id="button1"> 200 <object class="GtkButton" id="editterms">
201 <property name="label" translatable="yes">_Edit Terms...</property> 201 <property name="label" translatable="yes">_Edit Terms...</property>
202 <property name="visible">True</property> 202 <property name="visible">True</property>
203 <property name="can_focus">True</property> 203 <property name="can_focus">True</property>