diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-27 11:43:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-27 11:52:23 +0000 |
commit | 8f6a574d4f0fdf9d113aaa073daf948a7ec1df52 (patch) | |
tree | 7e2a7b37c9eb7a6f416477df771c259f2102abdf | |
parent | c98ce687901bb2e9f423f6cdf5fb5650ffe86b5b (diff) |
convert add instance dialog to .ui
Change-Id: I92a82fb25b8b9d9cbedefb6fcebc7a4d167649bf
-rw-r--r-- | include/svx/fmresids.hrc | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/inc/fmhelp.hrc | 1 | ||||
-rw-r--r-- | svx/source/form/datanavi.cxx | 38 | ||||
-rw-r--r-- | svx/source/form/datanavi.src | 89 | ||||
-rw-r--r-- | svx/source/inc/datanavi.hrc | 11 | ||||
-rw-r--r-- | svx/source/inc/datanavi.hxx | 47 | ||||
-rw-r--r-- | svx/uiconfig/ui/addinstancedialog.ui | 223 |
8 files changed, 255 insertions, 156 deletions
diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc index fdeed412799e..c44ae4b41abf 100644 --- a/include/svx/fmresids.hrc +++ b/include/svx/fmresids.hrc @@ -67,7 +67,6 @@ #define RID_SVXDLG_ADD_SUBMISSION (RID_FORMS_START + 16) -#define RID_SVXDLG_ADD_INSTANCE (RID_FORMS_START + 18) #define RID_SVXWIN_DATANAVIGATOR (RID_FORMS_START + 19) #define RID_SVX_XFORMS_TABPAGES (RID_FORMS_START + 20) diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index b3a0ed72cf28..41fb585cc641 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,svx)) $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/acceptrejectchangesdialog \ + svx/uiconfig/ui/addinstancedialog \ svx/uiconfig/ui/addmodeldialog \ svx/uiconfig/ui/addnamespacedialog \ svx/uiconfig/ui/asianphoneticguidedialog \ diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index 424576919e1f..fbe9c7c8a952 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -75,7 +75,6 @@ #define HID_XFORMS_MODELS_MENUBTN "SVX_HID_XFORMS_MODELS_MENUBTN" #define HID_XFORMS_INSTANCES_MENUBTN "SVX_HID_XFORMS_INSTANCES_MENUBTN" #define HID_XFORMS_ADDSUBMISSION_DLG "SVX_HID_XFORMS_ADDSUBMISSION_DLG" -#define HID_XFORMS_ADDINSTANCE_DLG "SVX_HID_XFORMS_ADDINSTANCE_DLG" #define HID_XFORMS_MID_INSERT_CONTROL "SVX_HID_XFORMS_MID_INSERT_CONTROL" #define HID_XFORMS_TAB_CONTROL "SVX_HID_XFORMS_TAB_CONTROL" #define HID_FM_DELETEROWS "SVX_HID_FM_DELETEROWS" diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 9820a0b3fba7..656f85479f9d 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -3597,39 +3597,25 @@ namespace svxform // class AddInstanceDialog //======================================================================== - AddInstanceDialog::AddInstanceDialog( Window* pParent, bool _bEdit ) : - - ModalDialog( pParent, SVX_RES( RID_SVXDLG_ADD_INSTANCE ) ), - - m_aInstanceFL ( this, SVX_RES( FL_INSTANCE ) ), - m_aNameFT ( this, SVX_RES( FT_INST_NAME ) ), - m_aNameED ( this, SVX_RES( ED_INST_NAME ) ), - m_aURLFT ( this, SVX_RES( FT_INST_URL ) ), - m_aURLED ( this, SVX_RES( ED_INST_URL ) ), - m_aFilePickerBtn ( this, SVX_RES( PB_FILEPICKER ) ), - m_aLinkInstanceCB ( this, SVX_RES( CB_INST_LINKINST ) ), - m_aButtonsFL ( this, SVX_RES( FL_DATANAV_BTN ) ), - m_aOKBtn ( this, SVX_RES( BTN_DATANAV_OK ) ), - m_aEscBtn ( this, SVX_RES( BTN_DATANAV_ESC ) ), - m_aHelpBtn ( this, SVX_RES( BTN_DATANAV_HELP ) ) - + AddInstanceDialog::AddInstanceDialog(Window* pParent, bool _bEdit) + : ModalDialog(pParent, "AddInstanceDialog" , "svx/ui/addinstancedialog.ui") { - if ( _bEdit ) - SetText(SVX_RESSTR(STR_EDIT_TEXT)); + get(m_pNameED, "name"); + get(m_pURLFT, "urlft"); + get(m_pURLED, "url"); + get(m_pFilePickerBtn, "browse"); + get(m_pLinkInstanceCB, "link"); - FreeResource(); + if ( _bEdit ) + SetText(get<FixedText>("alttitle")->GetText()); - m_aURLED.DisableHistory(); - m_aFilePickerBtn.SetClickHdl( LINK( this, AddInstanceDialog, FilePickerHdl ) ); + m_pURLED->DisableHistory(); + m_pFilePickerBtn->SetClickHdl( LINK( this, AddInstanceDialog, FilePickerHdl ) ); // load the filter name from fps_office resource m_sAllFilterName = ResId(STR_FILTERNAME_ALL, *ResMgr::CreateResMgr("fps_office")).toString(); } - AddInstanceDialog::~AddInstanceDialog() - { - } - //------------------------------------------------------------------------ IMPL_LINK_NOARG(AddInstanceDialog, FilePickerHdl) { @@ -3644,7 +3630,7 @@ namespace svxform aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if( aDlg.Execute() == ERRCODE_NONE ) - m_aURLED.SetText( aDlg.GetPath() ); + m_pURLED->SetText( aDlg.GetPath() ); return 0; } diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src index 882b93a6d31a..21b4b94f0682 100644 --- a/svx/source/form/datanavi.src +++ b/svx/source/form/datanavi.src @@ -868,95 +868,6 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; }; -ModalDialog RID_SVXDLG_ADD_INSTANCE -{ - HelpID = HID_XFORMS_ADDINSTANCE_DLG ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 210 , 88 ) ; - Text [ en-US ] = "Add Instance" ; - Moveable = TRUE ; - FixedLine FL_INSTANCE - { - Pos = MAP_APPFONT ( 4 , 3 ) ; - Size = MAP_APPFONT ( 202 , 8 ) ; - Text [ en-US ] = "Instance" ; - }; - FixedText FT_INST_NAME - { - Pos = MAP_APPFONT ( 6 , 15 ) ; - Size = MAP_APPFONT ( 51 , 8 ) ; - LeftLabel = TRUE ; - Text [ en-US ] = "~Name" ; - }; - Edit ED_INST_NAME - { - HelpID = "svx:Edit:RID_SVXDLG_ADD_INSTANCE:ED_INST_NAME"; - Pos = MAP_APPFONT ( 60 , 14 ) ; - Size = MAP_APPFONT ( 144 , 12 ) ; - Border = TRUE ; - }; - FixedText FT_INST_URL - { - Pos = MAP_APPFONT ( 6 , 30 ) ; - Size = MAP_APPFONT ( 51 , 8 ) ; - LeftLabel = TRUE ; - Text [ en-US ] = "~URL" ; - }; - ComboBox ED_INST_URL - { - HelpID = "svx:ComboBox:RID_SVXDLG_ADD_INSTANCE:ED_INST_URL"; - Pos = MAP_APPFONT ( 60 , 29 ) ; - Size = MAP_APPFONT ( 127 , 48 ) ; - DropDown = TRUE ; - Border = TRUE ; - }; - PushButton PB_FILEPICKER - { - HelpID = "svx:PushButton:RID_SVXDLG_ADD_INSTANCE:PB_FILEPICKER"; - Pos = MAP_APPFONT ( 190 , 28 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TabStop = TRUE ; - Text = "~..." ; - }; - CheckBox CB_INST_LINKINST - { - HelpID = "svx:CheckBox:RID_SVXDLG_ADD_INSTANCE:CB_INST_LINKINST"; - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 198 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Link instance" ; - }; - FixedLine FL_DATANAV_BTN - { - Pos = MAP_APPFONT ( 4 , 57 ) ; - Size = MAP_APPFONT ( 202 , 8 ) ; - }; - OKButton BTN_DATANAV_OK - { - Pos = MAP_APPFONT ( 45 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_DATANAV_ESC - { - Pos = MAP_APPFONT ( 98 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_DATANAV_HELP - { - Pos = MAP_APPFONT ( 154 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String STR_EDIT_TEXT - { - Text [ en-US ] = "Edit Instance" ; - }; -}; - String RID_STR_DATANAV_SUBM_PARENT { Text [ en-US ] = "Submission: " ; diff --git a/svx/source/inc/datanavi.hrc b/svx/source/inc/datanavi.hrc index ac19bde65517..b49e704498f6 100644 --- a/svx/source/inc/datanavi.hrc +++ b/svx/source/inc/datanavi.hrc @@ -126,8 +126,6 @@ #define STR_HEADER_PREFIX 10 #define STR_HEADER_URL 11 -#define STR_EDIT_TEXT 10 - // class AddSubmissionDialog #define FL_SUBMISSION 10 #define FT_SUBMIT_NAME 11 @@ -156,15 +154,6 @@ #define FT_MODEL_NAME 11 #define ED_MODEL_NAME 12 -// class AddInstanceDialog -#define FL_INSTANCE 10 -#define FT_INST_NAME 11 -#define ED_INST_NAME 12 -#define FT_INST_URL 13 -#define ED_INST_URL 14 -#define PB_FILEPICKER 15 -#define CB_INST_LINKINST 16 - // class AddModelDialog #define CB_MODIFIES_DOCUMENT 1 diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index 36132cfe9df5..517b03009ef8 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -526,17 +526,11 @@ namespace svxform class AddInstanceDialog : public ModalDialog { private: - FixedLine m_aInstanceFL; - FixedText m_aNameFT; - Edit m_aNameED; - FixedText m_aURLFT; - SvtURLBox m_aURLED; - PushButton m_aFilePickerBtn; - CheckBox m_aLinkInstanceCB; - FixedLine m_aButtonsFL; - OKButton m_aOKBtn; - CancelButton m_aEscBtn; - HelpButton m_aHelpBtn; + Edit* m_pNameED; + FixedText* m_pURLFT; + SvtURLBox* m_pURLED; + PushButton* m_pFilePickerBtn; + CheckBox* m_pLinkInstanceCB; OUString m_sAllFilterName; @@ -544,24 +538,21 @@ namespace svxform public: AddInstanceDialog( Window* pParent, bool _bEdit ); - ~AddInstanceDialog(); - - inline void SetRenameMode(); - inline OUString GetName() const { return m_aNameED.GetText(); } - inline void SetName( const OUString& _rName ) { m_aNameED.SetText( _rName );} - inline OUString GetURL() const { return m_aURLED.GetText(); } - inline void SetURL( const OUString& _rURL ) { m_aURLED.SetText( _rURL );} - inline bool IsLinkInstance() const { return ( m_aLinkInstanceCB.IsChecked() != sal_False ); } - inline void SetLinkInstance( bool _bLink ) { m_aLinkInstanceCB.Check( _bLink != false ); } - }; - inline void AddInstanceDialog::SetRenameMode() - { - m_aURLFT.Disable(); - m_aURLED.Disable(); - m_aFilePickerBtn.Disable(); - m_aLinkInstanceCB.Disable(); - } + void SetRenameMode() + { + m_pURLFT->Disable(); + m_pURLED->Disable(); + m_pFilePickerBtn->Disable(); + m_pLinkInstanceCB->Disable(); + } + OUString GetName() const { return m_pNameED->GetText(); } + void SetName( const OUString& _rName ) { m_pNameED->SetText( _rName );} + OUString GetURL() const { return m_pURLED->GetText(); } + void SetURL( const OUString& _rURL ) { m_pURLED->SetText( _rURL );} + bool IsLinkInstance() const { return ( m_pLinkInstanceCB->IsChecked() != sal_False ); } + void SetLinkInstance( bool _bLink ) { m_pLinkInstanceCB->Check( _bLink != false ); } + }; //======================================================================== class LinkedInstanceWarningBox : public MessBox diff --git a/svx/uiconfig/ui/addinstancedialog.ui b/svx/uiconfig/ui/addinstancedialog.ui new file mode 100644 index 000000000000..d584a2d4ca63 --- /dev/null +++ b/svx/uiconfig/ui/addinstancedialog.ui @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkDialog" id="AddInstanceDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Add Instance</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">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="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">12</property> + <child> + <object class="GtkEntry" id="name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + <property name="width_chars">46</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <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">_Name</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">name</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="alttitle"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Edit Instance</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="urlft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_URL</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">name</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="svtlo-SvtURLBox" id="url"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</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="GtkButton" id="browse"> + <property name="label" translatable="yes">_...</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">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="link"> + <property name="label" translatable="yes">_Link instance</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">2</property> + <property name="width">3</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">Instance</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> |