diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-17 16:57:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-17 17:06:16 +0100 |
commit | 2bbdf5c72254a70c43894eb907f23f78557f709a (patch) | |
tree | ce6801d3e1425fafd03243adea1ac21c4999e64e /cui | |
parent | 6c648e3dca9b3f8beceb877a461d2118d473c20d (diff) |
convert autocorrect dialog to .ui format
Just the outmost dialog itself, not the individual pages.
We have to go top down in this case to incrementally convert the pages because
of the non-standard additional widgets outside the tabcontrol area.
So this dialog is set to non-resizable until its contents are
converted over.
Change-Id: I92014a44b4cab8d345666295b052635d4b57a496
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 14 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 68 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.src | 71 | ||||
-rw-r--r-- | cui/uiconfig/ui/autocorrectdialog.ui | 255 |
6 files changed, 295 insertions, 115 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index d8e94ba6266d..7afa2dfae932 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -12,6 +12,7 @@ $(eval $(call gb_UIConfig_UIConfig,cui)) $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/aboutdialog \ cui/uiconfig/ui/asiantypography \ + cui/uiconfig/ui/autocorrectdialog \ cui/uiconfig/ui/backgroundpage \ cui/uiconfig/ui/borderpage \ cui/uiconfig/ui/cellalignment \ diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 1190ffe6aa1e..91062f1f8f70 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -38,18 +38,18 @@ namespace editeng { class SortedAutoCompleteStrings; } class OfaAutoCorrDlg : public SfxTabDialog { - FixedText aLanguageFT; - SvxLanguageBox aLanguageLB; + VclContainer* m_pLanguageBox; + SvxLanguageBox* m_pLanguageLB; + + sal_uInt16 m_nReplacePageId; + sal_uInt16 m_nExceptionsPageId; DECL_LINK(SelectLanguageHdl, ListBox*); public: - OfaAutoCorrDlg(Window* pParent, const SfxItemSet *pSet ); - - void EnableLanguage(sal_Bool bEnable) - { aLanguageFT.Enable(bEnable); - aLanguageLB.Enable(bEnable);} + OfaAutoCorrDlg(Window* pParent, const SfxItemSet *pSet); + void EnableLanguage(bool bEnable); }; #ifdef _OFA_AUTOCDLG_CXX diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index 0f4a5a1eec7a..5c6819282729 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -229,7 +229,6 @@ #define HID_SEARCHSIMILARITY "CUI_HID_SEARCHSIMILARITY" #define UID_SEARCH_RECORDSTATUS "CUI_UID_SEARCH_RECORDSTATUS" #define HID_OFAPAGE_AUTOCORR_CLB "CUI_HID_OFAPAGE_AUTOCORR_CLB" -#define HID_AUTOCORR_LANGUAGE "CUI_HID_AUTOCORR_LANGUAGE" #define HID_OFAPAGE_AUTOFORMAT_CLB "CUI_HID_OFAPAGE_AUTOFORMAT_CLB" #define HID_TPCOLOR_RGB_1 "CUI_HID_TPCOLOR_RGB_1" #define HID_TPCOLOR_RGB_2 "CUI_HID_TPCOLOR_RGB_2" diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 2f11b4c86164..75fa160df0e3 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -59,11 +59,12 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star; using namespace ::rtl; -OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) : - SfxTabDialog( pParent, CUI_RES( RID_OFA_AUTOCORR_DLG ), _pSet ), - aLanguageFT ( this, CUI_RES( FT_LANG ) ), - aLanguageLB ( this, CUI_RES( LB_LANG ) ) +OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) + : SfxTabDialog(pParent, "AutoCorrectDialog", "cui/ui/autocorrectdialog.ui", _pSet) { + get(m_pLanguageBox, "langbox"); + get(m_pLanguageLB, "lang"); + sal_Bool bShowSWOptions = sal_False; sal_Bool bOpenSmartTagOptions = sal_False; @@ -78,21 +79,16 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) : bOpenSmartTagOptions = sal_True; } - aLanguageFT.SetZOrder(0, WINDOW_ZORDER_FIRST); - aLanguageLB.SetZOrder(&aLanguageFT, WINDOW_ZORDER_BEHIND); - aLanguageLB.SetHelpId(HID_AUTOCORR_LANGUAGE); - FreeResource(); - - AddTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS, OfaAutocorrOptionsPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOFMT_APPLY, OfaSwAutoFmtOptionsPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS, OfaAutoCompleteTabPage::Create, 0); - AddTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS, OfaSmartTagOptionsTabPage::Create, 0); + AddTabPage("options", OfaAutocorrOptionsPage::Create, 0); + AddTabPage("apply", OfaSwAutoFmtOptionsPage::Create, 0); + AddTabPage("wordcompletion", OfaAutoCompleteTabPage::Create, 0); + AddTabPage("smarttags", OfaSmartTagOptionsTabPage::Create, 0); if (!bShowSWOptions) { - RemoveTabPage(RID_OFAPAGE_AUTOFMT_APPLY); - RemoveTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS); - RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS); + RemoveTabPage("apply"); + RemoveTabPage("wordcompletion"); + RemoveTabPage("smarttags"); } else { @@ -100,14 +96,14 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) : SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); if ( !pOpt || !pOpt->pSmartTagMgr || 0 == pOpt->pSmartTagMgr->NumberOfRecognizers() ) - RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS); + RemoveTabPage("smarttags"); - RemoveTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS); + RemoveTabPage("options"); } - AddTabPage(RID_OFAPAGE_AUTOCORR_REPLACE, OfaAutocorrReplacePage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCORR_EXCEPT, OfaAutocorrExceptPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCORR_QUOTE, OfaQuoteTabPage::Create, 0); + m_nReplacePageId = AddTabPage("replace", OfaAutocorrReplacePage::Create, 0); + m_nExceptionsPageId = AddTabPage("exceptions", OfaAutocorrExceptPage::Create, 0); + AddTabPage("localized", OfaQuoteTabPage::Create, 0); // initialize languages //! LANGUAGE_NONE is displayed as '[All]' and the LanguageType @@ -116,31 +112,31 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) : if( SvtLanguageOptions().IsCTLFontEnabled() ) nLangList |= LANG_LIST_CTL; - aLanguageLB.SetLanguageList( nLangList, sal_True, sal_True ); - aLanguageLB.SelectLanguage( LANGUAGE_NONE ); - sal_uInt16 nPos = aLanguageLB.GetSelectEntryPos(); + m_pLanguageLB->SetLanguageList( nLangList, sal_True, sal_True ); + m_pLanguageLB->SelectLanguage( LANGUAGE_NONE ); + sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos(); DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" ); - aLanguageLB.SetEntryData( nPos, (void*)(long) LANGUAGE_UNDETERMINED ); + m_pLanguageLB->SetEntryData( nPos, (void*)(long) LANGUAGE_UNDETERMINED ); // Initializing doesn't work for static on linux - therefore here if( LANGUAGE_SYSTEM == eLastDialogLanguage ) eLastDialogLanguage = Application::GetSettings().GetLanguageTag().getLanguageType(); LanguageType nSelectLang = LANGUAGE_UNDETERMINED; - nPos = aLanguageLB.GetEntryPos( (void*)(long) eLastDialogLanguage ); + nPos = m_pLanguageLB->GetEntryPos( (void*)(long) eLastDialogLanguage ); if (LISTBOX_ENTRY_NOTFOUND != nPos) nSelectLang = eLastDialogLanguage; - aLanguageLB.SelectLanguage( nSelectLang ); - - aLanguageLB.SetSelectHdl(LINK(this, OfaAutoCorrDlg, SelectLanguageHdl)); + m_pLanguageLB->SelectLanguage( nSelectLang ); - Size aMinSize(aLanguageFT.CalcMinimumSize()); - //reserve some extra space for CJK accelerators that are possible inserted - //later (like '(A)') - aLanguageFT.setPosSizePixel( 0, 0, aMinSize.Width() + 20, 0, WINDOW_POSSIZE_WIDTH ); + m_pLanguageLB->SetSelectHdl(LINK(this, OfaAutoCorrDlg, SelectLanguageHdl)); if ( bOpenSmartTagOptions ) - SetCurPageId( RID_OFAPAGE_SMARTTAG_OPTIONS ); + SetCurPageId("smarttags"); +} + +void OfaAutoCorrDlg::EnableLanguage(bool bEnable) +{ + m_pLanguageBox->Enable(bEnable); } static sal_Bool lcl_FindEntry( ListBox& rLB, const String& rEntry, @@ -171,9 +167,9 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) if(eNewLang != eLastDialogLanguage) { sal_uInt16 nPageId = GetCurPageId(); - if(RID_OFAPAGE_AUTOCORR_REPLACE == nPageId) + if (m_nReplacePageId == nPageId) ((OfaAutocorrReplacePage*)GetTabPage( nPageId ))->SetLanguage(eNewLang); - else if(RID_OFAPAGE_AUTOCORR_EXCEPT == nPageId) + else if (m_nExceptionsPageId == nPageId) ((OfaAutocorrExceptPage*)GetTabPage( nPageId ))->SetLanguage(eNewLang); } return 0; diff --git a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src index cf48712d1d8a..b33cce728ef1 100644 --- a/cui/source/tabpages/autocdlg.src +++ b/cui/source/tabpages/autocdlg.src @@ -22,77 +22,6 @@ #include "helpid.hrc" #include <svx/svxids.hrc> // SID_AUTOFORMAT -/**************************************************************************/ -/* */ -/* TabDialog RID_OFA_AUTOCORR_DLG */ -/* */ -/**************************************************************************/ -TabDialog RID_OFA_AUTOCORR_DLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "AutoCorrect" ; - Moveable = TRUE ; - Closeable = TRUE ; - TabControl 1 - { - SVLook = TRUE ; - PageList = - { - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_REPLACE ; - Text [ en-US ] = "Replace" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_EXCEPT ; - Text [ en-US ] = "Exceptions" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_OPTIONS ; - Text [ en-US ] = "Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOFMT_APPLY ; - Text [ en-US ] = "Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_QUOTE ; - Text [ en-US ] = "Localized Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCOMPLETE_OPTIONS ; - Text [ en-US ] = "Word Completion"; - }; - PageItem - { - Identifier = RID_OFAPAGE_SMARTTAG_OPTIONS ; - Text [ en-US ] = "Smart Tags"; - }; - }; - }; - FixedText FT_LANG - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 140 , 8 ) ; - - Left = TRUE ; - Text [ en-US ] = "Replacements and exceptions for language:"; - }; - ListBox LB_LANG - { - Pos = MAP_APPFONT ( 150 , 3 ) ; - Size = MAP_APPFONT ( 80 , 100 ) ; - DropDown = TRUE; - TabStop = TRUE ; - Border = TRUE ; - }; -}; #define COMMON_CLB_ENTRIES \ String ST_USE_REPLACE \ { \ diff --git a/cui/uiconfig/ui/autocorrectdialog.ui b/cui/uiconfig/ui/autocorrectdialog.ui new file mode 100644 index 000000000000..e5051b67f584 --- /dev/null +++ b/cui/uiconfig/ui/autocorrectdialog.ui @@ -0,0 +1,255 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkDialog" id="AutoCorrectDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">AutoCorrect</property> + <property name="resizable">False</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">3</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">4</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="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="langbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="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">Replacements and exceptions for language:</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="svxcorelo-SvxLanguageBox" id="lang"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="replace"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Replace</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="exceptions"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Exceptions</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="options"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</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="apply"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="localized"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Localized Options</property> + </object> + <packing> + <property name="position">4</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="wordcompletion"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Word Completion</property> + </object> + <packing> + <property name="position">5</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="smarttags"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Smart Tags</property> + </object> + <packing> + <property name="position">6</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> + <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> |