diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-04 16:53:39 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-04 23:34:58 +0200 |
commit | b83719abf070626357646e77d96e61bd8d6cdce9 (patch) | |
tree | aa3dc69caf8d3aff2ff23bfd02b724b82ca96e41 | |
parent | 278f5da01fb5d84cde9e2109010fd2cb3e4da4b6 (diff) |
convert save label dialog to .ui
Change-Id: I103ddf69f61608a1dd7930a8c3046e8916dee171
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/envelp.hrc | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 43 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hrc | 9 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hxx | 22 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.src | 67 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/savelabeldialog.ui | 184 |
8 files changed, 211 insertions, 117 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 4b2c4229c570..b0105bc1983a 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -126,6 +126,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/rowheight \ sw/uiconfig/swriter/ui/saveashtmldialog \ + sw/uiconfig/swriter/ui/savelabeldialog \ sw/uiconfig/swriter/ui/sidebarpage \ sw/uiconfig/swriter/ui/sidebarwrap \ sw/uiconfig/swriter/ui/sortdialog \ diff --git a/sw/inc/envelp.hrc b/sw/inc/envelp.hrc index b33d5332f93d..6fb5624582bd 100644 --- a/sw/inc/envelp.hrc +++ b/sw/inc/envelp.hrc @@ -40,7 +40,6 @@ #define DLG_MAILMERGE (RC_ENVELP_BEGIN + 8) #define DLG_SYNC_BTN (RC_ENVELP_BEGIN + 9) -#define DLG_SAVE_LABEL (RC_ENVELP_BEGIN + 10) // Bereiche ------------------------------------------------------------------- diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 5fd9d4a09f50..d66894ce1185 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -402,7 +402,6 @@ #define HID_INSERT_INDEX_ENTRY_LEVEL_LB "SW_HID_INSERT_INDEX_ENTRY_LEVEL_LB" #define HID_BUSINESS_CARD_CONTENT "SW_HID_BUSINESS_CARD_CONTENT" -#define HID_SAVE_LABEL_DLG "SW_HID_SAVE_LABEL_DLG" #define HID_BUSINESS_FMT_PAGE "SW_HID_BUSINESS_FMT_PAGE" #define HID_BUSINESS_FMT_PAGE_CONT "SW_HID_BUSINESS_FMT_PAGE_CONT" #define HID_BUSINESS_FMT_PAGE_SHEET "SW_HID_BUSINESS_FMT_PAGE_SHEET" diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index cdba7edb4840..947ee594d128 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -589,42 +589,35 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl) return 0; } -SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) : - ModalDialog(pParent, SW_RES(DLG_SAVE_LABEL)), - aOptionsFL(this,SW_RES(FL_OPTIONS )), - aMakeFT(this, SW_RES(FT_MAKE )), - aMakeCB(this, SW_RES(CB_MAKE )), - aTypeFT(this, SW_RES(FT_TYPE )), - aTypeED(this, SW_RES(ED_TYPE )), - - aOKPB(this, SW_RES(PB_OK )), - aCancelPB(this, SW_RES(PB_CANCEL )), - aHelpPB(this, SW_RES(PB_HELP )), - - bSuccess(false), - pLabPage(pParent), - rLabRec(rRec) +SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) + : ModalDialog(pParent, "SaveLabelDialog", + "modules/swriter/ui/savelabeldialog.ui") + , bSuccess(false) + , pLabPage(pParent) + , rLabRec(rRec) { - FreeResource(); + get(m_pMakeCB, "brand"); + get(m_pTypeED, "type"); + get(m_pOKPB, "ok"); - aOKPB.SetClickHdl(LINK(this, SwSaveLabelDlg, OkHdl)); + m_pOKPB->SetClickHdl(LINK(this, SwSaveLabelDlg, OkHdl)); Link aLk(LINK(this, SwSaveLabelDlg, ModifyHdl)); - aMakeCB.SetModifyHdl(aLk); - aTypeED.SetModifyHdl(aLk); + m_pMakeCB->SetModifyHdl(aLk); + m_pTypeED->SetModifyHdl(aLk); SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); const std::vector<OUString>& rMan = rCfg.GetManufacturers(); for (sal_uInt16 i = 0; i < rMan.size(); i++) { - aMakeCB.InsertEntry(rMan[i]); + m_pMakeCB->InsertEntry(rMan[i]); } } IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) { SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); - String sMake(aMakeCB.GetText()); - String sType(aTypeED.GetText()); + String sMake(m_pMakeCB->GetText()); + String sType(m_pTypeED->GetText()); if(rCfg.HasLabel(sMake, sType)) { if ( rCfg.IsPredefinedLabel(sMake, sType) ) @@ -655,7 +648,7 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) IMPL_LINK_NOARG(SwSaveLabelDlg, ModifyHdl) { - aOKPB.Enable(!aMakeCB.GetText().isEmpty() && !aTypeED.GetText().isEmpty()); + m_pOKPB->Enable(!m_pMakeCB->GetText().isEmpty() && !m_pTypeED->GetText().isEmpty()); return 0; } @@ -663,8 +656,8 @@ bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) { if(bSuccess) { - rItem.aMake = aMakeCB.GetText(); - rItem.aType = aTypeED.GetText(); + rItem.aMake = m_pMakeCB->GetText(); + rItem.aType = m_pTypeED->GetText(); rItem.lHDist = rLabRec.lHDist; rItem.lVDist = rLabRec.lVDist; rItem.lWidth = rLabRec.lWidth; diff --git a/sw/source/ui/envelp/labfmt.hrc b/sw/source/ui/envelp/labfmt.hrc index dee534414357..f9b1d80e3853 100644 --- a/sw/source/ui/envelp/labfmt.hrc +++ b/sw/source/ui/envelp/labfmt.hrc @@ -50,15 +50,6 @@ #define FI_MAKE 24 #define FI_TYPE 25 -#define FL_OPTIONS 1 -#define FT_MAKE 2 -#define CB_MAKE 3 -#define FT_TYPE 4 -#define ED_TYPE 5 -#define PB_OK 6 -#define PB_CANCEL 7 -#define PB_HELP 8 - // global resources ******************************************************** #define STR_HDIST (RC_LABFMT_BEGIN + 1) diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index d6a0177f39d8..1359e0ffecd8 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -139,15 +139,9 @@ public: class SwSaveLabelDlg : public ModalDialog { - FixedLine aOptionsFL; - FixedText aMakeFT; - ComboBox aMakeCB; - FixedText aTypeFT; - Edit aTypeED; - - OKButton aOKPB; - CancelButton aCancelPB; - HelpButton aHelpPB; + ComboBox* m_pMakeCB; + Edit* m_pTypeED; + OKButton* m_pOKPB; bool bSuccess; SwLabFmtPage* pLabPage; @@ -159,11 +153,11 @@ class SwSaveLabelDlg : public ModalDialog public: SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec); - void SetLabel(const OUString& rMake, const OUString& rType) - { - aMakeCB.SetText(String(rMake)); - aTypeED.SetText(String(rType)); - } + void SetLabel(const OUString& rMake, const OUString& rType) + { + m_pMakeCB->SetText(rMake); + m_pTypeED->SetText(rType); + } bool GetLabel(SwLabItem& rItem); }; #endif diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src index aeabd0c21913..a18b61e7271c 100644 --- a/sw/source/ui/envelp/labfmt.src +++ b/sw/source/ui/envelp/labfmt.src @@ -303,71 +303,4 @@ String STR_PHEIGHT { Text [ en-US ] = "Page Height" ; }; -ModalDialog DLG_SAVE_LABEL -{ - HelpID = HID_SAVE_LABEL_DLG ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 230 , 60 ) ; - Moveable = TRUE ; - FixedText FT_MAKE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - Text [ en-US ] = "Brand" ; - Left = TRUE ; - }; - ComboBox CB_MAKE - { - HelpID = "sw:ComboBox:DLG_SAVE_LABEL:CB_MAKE"; - Pos = MAP_APPFONT ( 65 , 15 ) ; - Size = MAP_APPFONT ( 100 , 50 ) ; - Border = TRUE; - DropDown = TRUE; - }; - FixedText FT_TYPE - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - Text [ en-US ] = "T~ype" ; - Left = TRUE ; - }; - Edit ED_TYPE - { - HelpID = "sw:Edit:DLG_SAVE_LABEL:ED_TYPE"; - Pos = MAP_APPFONT ( 65 , 30 ) ; - Size = MAP_APPFONT ( 100 , 12 ) ; - Border = TRUE; - }; - FixedLine FL_OPTIONS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 165 , 8 ) ; - Text [ en-US ] = "Options"; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 174 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 174 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 174 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - }; - Text [ en-US ] = "Save Label Format"; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/savelabeldialog.ui b/sw/uiconfig/swriter/ui/savelabeldialog.ui new file mode 100644 index 000000000000..bd3bfd7eca18 --- /dev/null +++ b/sw/uiconfig/swriter/ui/savelabeldialog.ui @@ -0,0 +1,184 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="SaveLabelDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Save Label Format</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="hexpand">True</property> + <property name="vexpand">True</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="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Brand</property> + <property name="use_underline">True</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="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">T_ype</property> + <property name="use_underline">True</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="GtkEntry" id="type"> + <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">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="brand"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="has_entry">True</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + <child internal-child="entry"> + <object class="GtkEntry" id="comboboxtext-entry"> + <property name="can_focus">False</property> + </object> + </child> + </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> + </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">Options</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> |