diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-04 16:16:15 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-04 23:34:58 +0200 |
commit | 278f5da01fb5d84cde9e2109010fd2cb3e4da4b6 (patch) | |
tree | 0aaaf3789004e4a7b51c45109f4460620c3ad3aa | |
parent | 0cbfa8f97d0c6abdec829718eaf97486447a96cf (diff) |
convert query overwrite label dialog to .ui
Change-Id: I1c558b965cfee8cd49061d86661bb4251214b76d
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hrc | 1 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.src | 6 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/querysavelabeldialog.ui | 34 |
6 files changed, 46 insertions, 20 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index d25983085bb8..4b2c4229c570 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -116,6 +116,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/outlinenumbering \ sw/uiconfig/swriter/ui/outlinenumberingpage \ sw/uiconfig/swriter/ui/outlinepositionpage \ + sw/uiconfig/swriter/ui/querysavelabeldialog \ sw/uiconfig/swriter/ui/queryshowchangesdialog \ sw/uiconfig/swriter/ui/paradialog \ sw/uiconfig/swriter/ui/previewzoomdialog \ diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 89d12f4bbf9f..cdba7edb4840 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -601,8 +601,6 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) : aCancelPB(this, SW_RES(PB_CANCEL )), aHelpPB(this, SW_RES(PB_HELP )), - aQueryMB(this, SW_RES(MB_QUERY )), - bSuccess(false), pLabPage(pParent), rLabRec(rRec) @@ -635,15 +633,17 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) MessageDialog(this, "CannotSaveLabelDialog", "modules/swriter/ui/cannotsavelabeldialog.ui").Execute(); return 0; } - String sTmp(aQueryMB.GetMessText()); - String sQuery(sTmp); - sQuery.SearchAndReplace(OUString("%1"), sMake); - sQuery.SearchAndReplace(OUString("%2"), sType); - aQueryMB.SetMessText(sQuery); - - short eRet = aQueryMB.Execute(); - aQueryMB.SetMessText(sTmp); - if(RET_YES != eRet) + + MessageDialog aQuery(this, "QuerySaveLabelDialog", + "modules/swriter/ui/querysavelabeldialog.ui"); + + aQuery.set_primary_text(aQuery.get_primary_text(). + replaceAll("%1", sMake).replaceAll("%2", sType)); + aQuery.set_secondary_text(aQuery.get_secondary_text(). + replaceAll("%1", sMake).replaceAll("%2", sType)); + sal_uInt16 eRet = aQuery.Execute(); + + if (RET_YES != eRet) return 0; } rLabRec.aType = sType; diff --git a/sw/source/ui/envelp/labfmt.hrc b/sw/source/ui/envelp/labfmt.hrc index 00c5eca9bf6f..dee534414357 100644 --- a/sw/source/ui/envelp/labfmt.hrc +++ b/sw/source/ui/envelp/labfmt.hrc @@ -58,7 +58,6 @@ #define PB_OK 6 #define PB_CANCEL 7 #define PB_HELP 8 -#define MB_QUERY 9 // global resources ******************************************************** diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 2ecf0676c1f7..d6a0177f39d8 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -149,8 +149,6 @@ class SwSaveLabelDlg : public ModalDialog CancelButton aCancelPB; HelpButton aHelpPB; - QueryBox aQueryMB; - bool bSuccess; SwLabFmtPage* pLabPage; SwLabRec& rLabRec; diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src index 2be92d747b01..aeabd0c21913 100644 --- a/sw/source/ui/envelp/labfmt.src +++ b/sw/source/ui/envelp/labfmt.src @@ -367,12 +367,6 @@ ModalDialog DLG_SAVE_LABEL TabStop = TRUE ; Group = TRUE ; }; - QueryBox MB_QUERY - { - Buttons = WB_YES_NO ; - DefButton = WB_DEF_CANCEL ; - Message [ en-US ] = "The label \"%1 / %2\" already exists.\nDo you want to overwrite it?"; - }; Text [ en-US ] = "Save Label Format"; }; diff --git a/sw/uiconfig/swriter/ui/querysavelabeldialog.ui b/sw/uiconfig/swriter/ui/querysavelabeldialog.ui new file mode 100644 index 000000000000..af409c09e01b --- /dev/null +++ b/sw/uiconfig/swriter/ui/querysavelabeldialog.ui @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.6 --> + <object class="GtkMessageDialog" id="QuerySaveLabelDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Save label?</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">question</property> + <property name="buttons">yes-no</property> + <property name="text" translatable="yes">A label named "%1 / %2" already exists. Do you want to replace it?</property> + <property name="secondary_text" translatable="yes">A label already exists with brand "%1" and type "%2". Replacing it will overwrite its contents.</property> + <child internal-child="vbox"> + <object class="GtkBox" id="messagedialog-vbox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="messagedialog-action_area"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </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> + </object> + </child> + </object> +</interface> |