Kaydet (Commit) b83719ab authored tarafından Caolán McNamara's avatar Caolán McNamara

convert save label dialog to .ui

Change-Id: I103ddf69f61608a1dd7930a8c3046e8916dee171
üst 278f5da0
...@@ -126,6 +126,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -126,6 +126,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/renameobjectdialog \
sw/uiconfig/swriter/ui/rowheight \ sw/uiconfig/swriter/ui/rowheight \
sw/uiconfig/swriter/ui/saveashtmldialog \ sw/uiconfig/swriter/ui/saveashtmldialog \
sw/uiconfig/swriter/ui/savelabeldialog \
sw/uiconfig/swriter/ui/sidebarpage \ sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sidebarwrap \ sw/uiconfig/swriter/ui/sidebarwrap \
sw/uiconfig/swriter/ui/sortdialog \ sw/uiconfig/swriter/ui/sortdialog \
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#define DLG_MAILMERGE (RC_ENVELP_BEGIN + 8) #define DLG_MAILMERGE (RC_ENVELP_BEGIN + 8)
#define DLG_SYNC_BTN (RC_ENVELP_BEGIN + 9) #define DLG_SYNC_BTN (RC_ENVELP_BEGIN + 9)
#define DLG_SAVE_LABEL (RC_ENVELP_BEGIN + 10)
// Bereiche ------------------------------------------------------------------- // Bereiche -------------------------------------------------------------------
......
...@@ -402,7 +402,6 @@ ...@@ -402,7 +402,6 @@
#define HID_INSERT_INDEX_ENTRY_LEVEL_LB "SW_HID_INSERT_INDEX_ENTRY_LEVEL_LB" #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_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 "SW_HID_BUSINESS_FMT_PAGE"
#define HID_BUSINESS_FMT_PAGE_CONT "SW_HID_BUSINESS_FMT_PAGE_CONT" #define HID_BUSINESS_FMT_PAGE_CONT "SW_HID_BUSINESS_FMT_PAGE_CONT"
#define HID_BUSINESS_FMT_PAGE_SHEET "SW_HID_BUSINESS_FMT_PAGE_SHEET" #define HID_BUSINESS_FMT_PAGE_SHEET "SW_HID_BUSINESS_FMT_PAGE_SHEET"
......
...@@ -589,42 +589,35 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl) ...@@ -589,42 +589,35 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
return 0; return 0;
} }
SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) : SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec)
ModalDialog(pParent, SW_RES(DLG_SAVE_LABEL)), : ModalDialog(pParent, "SaveLabelDialog",
aOptionsFL(this,SW_RES(FL_OPTIONS )), "modules/swriter/ui/savelabeldialog.ui")
aMakeFT(this, SW_RES(FT_MAKE )), , bSuccess(false)
aMakeCB(this, SW_RES(CB_MAKE )), , pLabPage(pParent)
aTypeFT(this, SW_RES(FT_TYPE )), , rLabRec(rRec)
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)
{ {
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)); Link aLk(LINK(this, SwSaveLabelDlg, ModifyHdl));
aMakeCB.SetModifyHdl(aLk); m_pMakeCB->SetModifyHdl(aLk);
aTypeED.SetModifyHdl(aLk); m_pTypeED->SetModifyHdl(aLk);
SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig();
const std::vector<OUString>& rMan = rCfg.GetManufacturers(); const std::vector<OUString>& rMan = rCfg.GetManufacturers();
for (sal_uInt16 i = 0; i < rMan.size(); i++) for (sal_uInt16 i = 0; i < rMan.size(); i++)
{ {
aMakeCB.InsertEntry(rMan[i]); m_pMakeCB->InsertEntry(rMan[i]);
} }
} }
IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
{ {
SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig();
String sMake(aMakeCB.GetText()); String sMake(m_pMakeCB->GetText());
String sType(aTypeED.GetText()); String sType(m_pTypeED->GetText());
if(rCfg.HasLabel(sMake, sType)) if(rCfg.HasLabel(sMake, sType))
{ {
if ( rCfg.IsPredefinedLabel(sMake, sType) ) if ( rCfg.IsPredefinedLabel(sMake, sType) )
...@@ -655,7 +648,7 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) ...@@ -655,7 +648,7 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl)
IMPL_LINK_NOARG(SwSaveLabelDlg, ModifyHdl) 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; return 0;
} }
...@@ -663,8 +656,8 @@ bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) ...@@ -663,8 +656,8 @@ bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem)
{ {
if(bSuccess) if(bSuccess)
{ {
rItem.aMake = aMakeCB.GetText(); rItem.aMake = m_pMakeCB->GetText();
rItem.aType = aTypeED.GetText(); rItem.aType = m_pTypeED->GetText();
rItem.lHDist = rLabRec.lHDist; rItem.lHDist = rLabRec.lHDist;
rItem.lVDist = rLabRec.lVDist; rItem.lVDist = rLabRec.lVDist;
rItem.lWidth = rLabRec.lWidth; rItem.lWidth = rLabRec.lWidth;
......
...@@ -50,15 +50,6 @@ ...@@ -50,15 +50,6 @@
#define FI_MAKE 24 #define FI_MAKE 24
#define FI_TYPE 25 #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 ******************************************************** // global resources ********************************************************
#define STR_HDIST (RC_LABFMT_BEGIN + 1) #define STR_HDIST (RC_LABFMT_BEGIN + 1)
......
...@@ -139,15 +139,9 @@ public: ...@@ -139,15 +139,9 @@ public:
class SwSaveLabelDlg : public ModalDialog class SwSaveLabelDlg : public ModalDialog
{ {
FixedLine aOptionsFL; ComboBox* m_pMakeCB;
FixedText aMakeFT; Edit* m_pTypeED;
ComboBox aMakeCB; OKButton* m_pOKPB;
FixedText aTypeFT;
Edit aTypeED;
OKButton aOKPB;
CancelButton aCancelPB;
HelpButton aHelpPB;
bool bSuccess; bool bSuccess;
SwLabFmtPage* pLabPage; SwLabFmtPage* pLabPage;
...@@ -159,11 +153,11 @@ class SwSaveLabelDlg : public ModalDialog ...@@ -159,11 +153,11 @@ class SwSaveLabelDlg : public ModalDialog
public: public:
SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec); SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec);
void SetLabel(const OUString& rMake, const OUString& rType) void SetLabel(const OUString& rMake, const OUString& rType)
{ {
aMakeCB.SetText(String(rMake)); m_pMakeCB->SetText(rMake);
aTypeED.SetText(String(rType)); m_pTypeED->SetText(rType);
} }
bool GetLabel(SwLabItem& rItem); bool GetLabel(SwLabItem& rItem);
}; };
#endif #endif
......
...@@ -303,71 +303,4 @@ String STR_PHEIGHT ...@@ -303,71 +303,4 @@ String STR_PHEIGHT
{ {
Text [ en-US ] = "Page Height" ; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment