diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-05 16:45:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-05 16:52:06 +0000 |
commit | e5d35be267c4f4c7dd745fc8864df805e6675126 (patch) | |
tree | 1a2a254d347bb18bd563fd214fdfe4d0aa39075e /svx | |
parent | 0c3211b1f20383b4fbee8978e88c21e498e35047 (diff) |
convert add model dialog to .ui
Change-Id: I20d10d0e9c311bcfb1386d481ae4832f463b931a
Diffstat (limited to 'svx')
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/inc/fmhelp.hrc | 1 | ||||
-rw-r--r-- | svx/source/form/datanavi.cxx | 26 | ||||
-rw-r--r-- | svx/source/form/datanavi.src | 69 | ||||
-rw-r--r-- | svx/source/inc/datanavi.hxx | 19 | ||||
-rw-r--r-- | svx/uiconfig/ui/addmodeldialog.ui | 178 |
6 files changed, 191 insertions, 103 deletions
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 2cd38890986e..a031a2d5821c 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/addmodeldialog \ svx/uiconfig/ui/addnamespacedialog \ svx/uiconfig/ui/asianphoneticguidedialog \ svx/uiconfig/ui/chineseconversiondialog \ diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index 4a95afb6757c..424576919e1f 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_ADDMODEL_DLG "SVX_HID_XFORMS_ADDMODEL_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" diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index bd2e530a1237..9820a0b3fba7 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -3583,28 +3583,14 @@ namespace svxform // class AddModelDialog //======================================================================== - AddModelDialog::AddModelDialog( Window* pParent, bool _bEdit ) : - - ModalDialog( pParent, SVX_RES( RID_SVXDLG_ADD_MODEL ) ), - - m_aModelFL ( this, SVX_RES( FL_MODEL ) ), - m_aNameFT ( this, SVX_RES( FT_MODEL_NAME ) ), - m_aNameED ( this, SVX_RES( ED_MODEL_NAME ) ), - m_aModifyCB ( this, SVX_RES( CB_MODIFIES_DOCUMENT ) ), - 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 ) ) - + AddModelDialog::AddModelDialog(Window* pParent, bool bIsEdit) + : ModalDialog(pParent, "AddModelDialog", "svx/ui/addmodeldialog.ui") { - if ( _bEdit ) - SetText(SVX_RESSTR(STR_EDIT_TEXT)); - - FreeResource(); - } + get(m_pNameED, "name"); + get(m_pModifyCB, "modify"); - AddModelDialog::~AddModelDialog() - { + if (bIsEdit) + SetText(get<FixedText>("alttitle")->GetText()); } //======================================================================== diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src index 974924d07dbe..882b93a6d31a 100644 --- a/svx/source/form/datanavi.src +++ b/svx/source/form/datanavi.src @@ -868,75 +868,6 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; }; -ModalDialog RID_SVXDLG_ADD_MODEL -{ - HelpID = HID_XFORMS_ADDMODEL_DLG ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 180 , 82 ) ; - Text [ en-US ] = "Add Model" ; - Moveable = TRUE ; - FixedLine FL_INSTANCE - { - Pos = MAP_APPFONT ( 4 , 3 ) ; - Size = MAP_APPFONT ( 172 , 8 ) ; - Text [ en-US ] = "Model" ; - }; - FixedText FT_INST_NAME - { - Pos = MAP_APPFONT ( 6 , 14 ) ; - Size = MAP_APPFONT ( 51 , 12 ) ; - LeftLabel = TRUE ; - VCenter = TRUE; - Text [ en-US ] = "~Name" ; - }; - Edit ED_INST_NAME - { - HelpID = "svx:Edit:RID_SVXDLG_ADD_MODEL:ED_INST_NAME"; - Pos = MAP_APPFONT ( 60 , 14 ) ; - Size = MAP_APPFONT ( 114 , 12 ) ; - Border = TRUE ; - }; - CheckBox CB_MODIFIES_DOCUMENT - { - HelpID = "svx:CheckBox:RID_SVXDLG_ADD_MODEL:CB_MODIFIES_DOCUMENT"; - Pos = MAP_APPFONT( 6, 32 ); - Size = MAP_APPFONT( 168, 16 ); - Top = TRUE; - WordBreak = TRUE; - - Text [ en-US ] = "Model data updates change document's modification status"; - }; - FixedLine FL_DATANAV_BTN - { - Pos = MAP_APPFONT ( 4 , 51 ) ; - Size = MAP_APPFONT ( 172 , 8 ) ; - }; - OKButton BTN_DATANAV_OK - { - Pos = MAP_APPFONT ( 15 , 62 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_DATANAV_ESC - { - Pos = MAP_APPFONT ( 68 , 62 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_DATANAV_HELP - { - Pos = MAP_APPFONT ( 124 , 62 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String STR_EDIT_TEXT - { - Text [ en-US ] = "Edit Model" ; - }; -}; - ModalDialog RID_SVXDLG_ADD_INSTANCE { HelpID = HID_XFORMS_ADDINSTANCE_DLG ; diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index 2015fcb73253..36132cfe9df5 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -509,24 +509,17 @@ namespace svxform class AddModelDialog : public ModalDialog { private: - FixedLine m_aModelFL; - FixedText m_aNameFT; - Edit m_aNameED; - CheckBox m_aModifyCB; - FixedLine m_aButtonsFL; - OKButton m_aOKBtn; - CancelButton m_aEscBtn; - HelpButton m_aHelpBtn; + Edit* m_pNameED; + CheckBox* m_pModifyCB; public: AddModelDialog( Window* pParent, bool _bEdit ); - ~AddModelDialog(); - inline OUString GetName() const { return m_aNameED.GetText(); } - inline void SetName( const OUString& _rName ) { m_aNameED.SetText( _rName );} + OUString GetName() const { return m_pNameED->GetText(); } + void SetName( const OUString& _rName ) { m_pNameED->SetText( _rName );} - inline bool GetModifyDoc() const { return bool( m_aModifyCB.IsChecked() ); } - inline void SetModifyDoc( const bool _bModify ) { m_aModifyCB.Check( _bModify ); } + bool GetModifyDoc() const { return bool( m_pModifyCB->IsChecked() ); } + void SetModifyDoc( const bool bModify ) { m_pModifyCB->Check( bModify ); } }; //======================================================================== diff --git a/svx/uiconfig/ui/addmodeldialog.ui b/svx/uiconfig/ui/addmodeldialog.ui new file mode 100644 index 000000000000..d3691aa12755 --- /dev/null +++ b/svx/uiconfig/ui/addmodeldialog.ui @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="AddModelDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Add Model</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="GtkCheckButton" id="modify"> + <property name="label" translatable="yes">Model data updates change document's modification status</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">1</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</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="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 Model</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">Model</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> |