[Libreoffice-commits] core.git: cui/source cui/uiconfig cui/UIConfig_cui.mk
Csikós Tamás
csks.tomi at gmail.com
Mon Jul 15 09:14:16 PDT 2013
cui/UIConfig_cui.mk | 1
cui/source/inc/optdict.hxx | 15 --
cui/source/options/optdict.cxx | 46 ++-----
cui/source/options/optdict.hrc | 8 -
cui/source/options/optdict.src | 71 ----------
cui/uiconfig/ui/optnewdictionarydialog.ui | 194 ++++++++++++++++++++++++++++++
6 files changed, 218 insertions(+), 117 deletions(-)
New commits:
commit 766458eafb855a44b1c4c9a5342bbb3748b7ef23
Author: Csikós Tamás <csks.tomi at gmail.com>
Date: Mon Jul 15 14:16:42 2013 +0200
modern .ui widgetlayout for optdict/newdictdlg
Change-Id: I8bd0a334bffee9adcf23fe2f597b66924b57ce30
Reviewed-on: https://gerrit.libreoffice.org/4917
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 5f51232..0908fef 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -55,6 +55,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/optjsearchpage \
cui/uiconfig/ui/optlanguagespage \
cui/uiconfig/ui/optmemorypage \
+ cui/uiconfig/ui/optnewdictionarydialog \
cui/uiconfig/ui/optonlineupdatepage \
cui/uiconfig/ui/optpathspage \
cui/uiconfig/ui/optproxypage \
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index 2251a2b..246b091 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -50,15 +50,12 @@ namespace linguistic2{
class SvxNewDictionaryDialog : public ModalDialog
{
private:
- FixedLine aNewDictBox;
- FixedText aNameText;
- Edit aNameEdit;
- FixedText aLanguageText;
- SvxLanguageBox aLanguageLB;
- CheckBox aExceptBtn;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
+ Edit* pNameEdit;
+ SvxLanguageBox* pLanguageLB;
+ CheckBox* pExceptBtn;
+ OKButton* pOKBtn;
+ CancelButton* pCancelBtn;
+ HelpButton* pHelpBtn;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
::com::sun::star::uno::Reference<
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 36af1fb..020cb17 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -82,41 +82,29 @@ static CDE_RESULT cmpDicEntry_Impl( const String &rText1, const String &rText2 )
SvxNewDictionaryDialog::SvxNewDictionaryDialog( Window* pParent,
Reference< XSpellChecker1 > &xSpl ) :
- ModalDialog( pParent, CUI_RES( RID_SFXDLG_NEWDICT ) ),
-
- aNewDictBox ( this, CUI_RES( GB_NEWDICT ) ),
- aNameText ( this, CUI_RES( FT_DICTNAME ) ),
- aNameEdit ( this, CUI_RES( ED_DICTNAME ) ),
- aLanguageText ( this, CUI_RES( FT_DICTLANG ) ),
- aLanguageLB ( this, CUI_RES( LB_DICTLANG ) ),
- aExceptBtn ( this, CUI_RES( BTN_EXCEPT ) ),
- aOKBtn ( this, CUI_RES( BTN_NEWDICT_OK ) ),
- aCancelBtn ( this, CUI_RES( BTN_NEWDICT_ESC ) ),
- aHelpBtn ( this, CUI_RES( BTN_NEWDICT_HLP ) ),
+ ModalDialog( pParent, "OptNewDictionaryDialog" , "cui/ui/optnewdictionarydialog.ui" ),
+
xSpell( xSpl )
{
+ get(pNameEdit,"nameedit");
+ get(pLanguageLB,"language");
+ get(pExceptBtn,"except");
+ get(pOKBtn,"ok");
// install handler
- aNameEdit.SetModifyHdl(
+ pNameEdit->SetModifyHdl(
LINK( this, SvxNewDictionaryDialog, ModifyHdl_Impl ) );
- aOKBtn.SetClickHdl( LINK( this, SvxNewDictionaryDialog, OKHdl_Impl ) );
+ pOKBtn->SetClickHdl( LINK( this, SvxNewDictionaryDialog, OKHdl_Impl ) );
// display languages
- aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_True );
- aLanguageLB.SelectEntryPos(0);
-
- aNameText.SetAccessibleRelationMemberOf( &aNewDictBox );
- aNameEdit.SetAccessibleRelationMemberOf( &aNewDictBox );
- aLanguageText.SetAccessibleRelationMemberOf( &aNewDictBox );
- aLanguageLB.SetAccessibleRelationMemberOf( &aNewDictBox );
-
- FreeResource();
+ pLanguageLB->SetLanguageList( LANG_LIST_ALL, sal_True, sal_True );
+ pLanguageLB->SelectEntryPos(0);
}
// -----------------------------------------------------------------------
IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
{
- OUString sDict = comphelper::string::stripEnd(aNameEdit.GetText(), ' ');
+ OUString sDict = comphelper::string::stripEnd(pNameEdit->GetText(), ' ');
// add extension for personal dictionaries
sDict += ".dic";
@@ -138,16 +126,16 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
{
// duplicate names?
InfoBox( this, CUI_RESSTR( RID_SVXSTR_OPT_DOUBLE_DICTS ) ).Execute();
- aNameEdit.GrabFocus();
+ pNameEdit->GrabFocus();
return 0;
}
// create and add
- sal_uInt16 nLang = aLanguageLB.GetSelectLanguage();
+ sal_uInt16 nLang = pLanguageLB->GetSelectLanguage();
try
{
// create new dictionary
- DictionaryType eType = aExceptBtn.IsChecked() ?
+ DictionaryType eType = pExceptBtn->IsChecked() ?
DictionaryType_NEGATIVE : DictionaryType_POSITIVE;
if (xDicList.is())
{
@@ -192,10 +180,10 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
IMPL_LINK_NOARG_INLINE_START(SvxNewDictionaryDialog, ModifyHdl_Impl)
{
- if ( !aNameEdit.GetText().isEmpty() )
- aOKBtn.Enable();
+ if ( !pNameEdit->GetText().isEmpty() )
+ pOKBtn->Enable();
else
- aOKBtn.Disable();
+ pOKBtn->Disable();
return 0;
}
IMPL_LINK_NOARG_INLINE_END(SvxNewDictionaryDialog, ModifyHdl_Impl)
diff --git a/cui/source/options/optdict.hrc b/cui/source/options/optdict.hrc
index 4ba73e4..c9bdade 100644
--- a/cui/source/options/optdict.hrc
+++ b/cui/source/options/optdict.hrc
@@ -21,16 +21,8 @@
// defines ------------------------------------------------------------------
-#define FT_DICTNAME 10
-#define ED_DICTNAME 11
#define FT_DICTLANG 12
#define LB_DICTLANG 13
-#define BTN_EXCEPT 14
-#define GB_NEWDICT 15
-
-#define BTN_NEWDICT_OK 20
-#define BTN_NEWDICT_ESC 21
-#define BTN_NEWDICT_HLP 22
#define FT_BOOK 30
#define FT_CONTENT 31
diff --git a/cui/source/options/optdict.src b/cui/source/options/optdict.src
index 7bea61a..f8bb852f 100644
--- a/cui/source/options/optdict.src
+++ b/cui/source/options/optdict.src
@@ -22,77 +22,6 @@
#include <cuires.hrc>
#include "optdict.hrc"
- // RID_SFXDLG_NEWDICT ----------------------------------------------------
-ModalDialog RID_SFXDLG_NEWDICT
-{
- HelpId = HID_OPTIONS_DICT_NEW ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 213 , 66 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "New Dictionary" ;
- FixedText FT_DICTNAME
- {
- Pos = MAP_APPFONT ( 11 , 15 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- LeftLabel = TRUE ;
- };
- Edit ED_DICTNAME
- {
- HelpID = "cui:Edit:RID_SFXDLG_NEWDICT:ED_DICTNAME";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 14 ) ;
- Size = MAP_APPFONT ( 90 , 12 ) ;
- MaxTextLength = 32 ;
- };
- FixedText FT_DICTLANG
- {
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Language" ;
- LeftLabel = TRUE ;
- };
- ListBox LB_DICTLANG
- {
- HelpID = "cui:ListBox:RID_SFXDLG_NEWDICT:LB_DICTLANG";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 30 ) ;
- Size = MAP_APPFONT ( 90 , 66 ) ;
- DropDown = TRUE ;
- };
- CheckBox BTN_EXCEPT
- {
- HelpID = "cui:CheckBox:RID_SFXDLG_NEWDICT:BTN_EXCEPT";
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
- Text [ en-US ] = "~Exception (-)" ;
- };
- FixedLine GB_NEWDICT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 145 , 8 ) ;
- Text [ en-US ] = "Dictionary" ;
- };
- OKButton BTN_NEWDICT_OK
- {
- Pos = MAP_APPFONT ( 157 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_NEWDICT_ESC
- {
- Pos = MAP_APPFONT ( 157 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_NEWDICT_HLP
- {
- Pos = MAP_APPFONT ( 157 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
// RID_SFXDLG_EDITDICT ---------------------------------------------------
ModalDialog RID_SFXDLG_EDITDICT
{
diff --git a/cui/uiconfig/ui/optnewdictionarydialog.ui b/cui/uiconfig/ui/optnewdictionarydialog.ui
new file mode 100644
index 0000000..7649acf
--- /dev/null
+++ b/cui/uiconfig/ui/optnewdictionarydialog.ui
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="OptNewDictionaryDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">New Dictionary</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="hexpand">True</property>
+ <property name="vexpand">True</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="has_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="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="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <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="GtkEntry" id="nameedit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
+ <property name="invisible_char_set">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>
+ <child>
+ <object class="svxcorelo-SvxLanguageBox" id="language">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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="name_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">nameedit</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="language_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Language:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">language</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="GtkCheckButton" id="except">
+ <property name="label" translatable="yes">_Exception (-)</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>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</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">Dictionary</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </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