diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-29 16:13:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-29 20:09:49 +0100 |
commit | 1d53996334db8850ff7a1bbfa8fa22b230b1c40e (patch) | |
tree | f2bd80700f5d07cccfcfaa3a1f7d97884c5e2151 /starmath | |
parent | Resolves: #i121609# Made conversion to bitmap more direct (diff) | |
download | core-1d53996334db8850ff7a1bbfa8fa22b230b1c40e.tar.gz core-1d53996334db8850ff7a1bbfa8fa22b230b1c40e.zip |
convert save defaults to .ui format
Change-Id: I7843598761cf95b04d9c3741cd8b0612b9b059ce
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/UIConfig_smath.mk | 1 | ||||
-rw-r--r-- | starmath/inc/starmath.hrc | 1 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 39 | ||||
-rw-r--r-- | starmath/source/smres.src | 7 | ||||
-rw-r--r-- | starmath/uiconfig/smath/ui/savedefaultsdialog.ui | 34 |
5 files changed, 49 insertions, 33 deletions
diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk index d72ae83e9f77..d64abe8a1e37 100644 --- a/starmath/UIConfig_smath.mk +++ b/starmath/UIConfig_smath.mk @@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/smath,\ starmath/uiconfig/smath/ui/alignmentdialog \ starmath/uiconfig/smath/ui/catalogdialog \ starmath/uiconfig/smath/ui/printeroptions \ + starmath/uiconfig/smath/ui/savedefaultsdialog \ starmath/uiconfig/smath/ui/spacingdialog \ )) diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 7cb9f4f188b9..f233fa4b1b53 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -90,7 +90,6 @@ #define RID_MATH_TOOLBOX (RID_APP_START + 50) -#define RID_DEFAULTSAVEQUERY (RID_APP_START + 102) #define RID_NOMATHTYPEFACEWARNING (RID_APP_START + 204) #define RID_OBJECTNAME (RID_APP_START + 501) // free diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 149cf100f7d2..86e23408929a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -24,6 +24,7 @@ #include <svl/stritem.hxx> #include <sfx2/app.hxx> #include <vcl/builder.hxx> +#include <vcl/layout.hxx> #include <vcl/msgbox.hxx> #include <svtools/ctrltool.hxx> #include <sfx2/printer.hxx> @@ -421,22 +422,25 @@ void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt ) ModalDialog::DataChanged( rDCEvt ); } -/**************************************************************************/ - +class SaveDefaultsQuery : public MessageDialog +{ +public: + SaveDefaultsQuery(Window *pParent) + : MessageDialog(pParent, "SaveDefaultsDialog", + "modules/smath/ui/savedefaultsdialog.ui") + { + } +}; IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - - delete pQueryBox; return 0; } @@ -546,16 +550,13 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt, true ); } - - delete pQueryBox; return 0; } IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) @@ -755,16 +756,13 @@ IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu ) IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - delete pQueryBox; return 0; } @@ -1044,27 +1042,18 @@ void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ rFormat.RequestApplyChanges(); } - -/**************************************************************************/ - - IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - - delete pQueryBox; return 0; } - SmAlignDialog::SmAlignDialog(Window * pParent) : ModalDialog(pParent, "AlignmentDialog", "modules/smath/ui/alignmentdialog.ui") diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 805b2905e4ef..f5c36b4cd36c 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -793,13 +793,6 @@ WarningBox RID_NOMATHTYPEFACEWARNING Message [ en-US ] = "The 'StarMath' font has not been installed.\nWithout this font %PRODUCTNAME Math cannot function correctly.\nPlease install this font and restart %PRODUCTNAME Math." ; }; -QueryBox RID_DEFAULTSAVEQUERY -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_YES ; - Message [ en-US ] = "Should the changes be saved as defaults?\n\nThese changes will apply for all new formulas." ; -}; - String RID_FONTREGULAR { Text [ en-US ] = "Standard" ; diff --git a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui new file mode 100644 index 000000000000..bcf710850e66 --- /dev/null +++ b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="SaveDefaultsDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">Save defaults</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">Should the changes be saved as defaults?</property> + <property name="secondary_text" translatable="yes">These changes will apply for all new formulas.</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">24</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> |