summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-19 16:33:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-22 22:07:38 +0100
commit6a4c464b49dbfa2801818ead1b50bc9580824d00 (patch)
tree3d6381b6b13576bc536670992b36784436486e95 /starmath
parentf7733528e88a6619f82b54b59e92a9bca72c0a89 (diff)
weld native message dialogs
just the straight-forward MessageDialog cases first a) remove border_width from message dialog .ui so as to take the default border width b) retain 12 as default message dialog border for vcl widget case c) remove layour_style from message dialog button boxes so as to take the default mode (a no-op for vcl widget case) d) use gtk response ids (vcl builder will converts to vcl ones) Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154 Reviewed-on: https://gerrit.libreoffice.org/50143 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/dialog.cxx26
-rw-r--r--starmath/uiconfig/smath/ui/savedefaultsdialog.ui2
2 files changed, 17 insertions, 11 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 5da957ec7650..1fad0b099758 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -26,7 +26,7 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <vcl/builderfactory.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <svtools/ctrltool.hxx>
#include <vcl/waitobj.hxx>
#include <vcl/settings.hxx>
@@ -394,19 +394,24 @@ void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt )
ModalDialog::DataChanged( rDCEvt );
}
-class SaveDefaultsQuery : public MessageDialog
+class SaveDefaultsQuery
{
+private:
+ std::unique_ptr<weld::Builder> m_xBuilder;
+ std::unique_ptr<weld::MessageDialog> m_xBox;
public:
- explicit SaveDefaultsQuery(vcl::Window *pParent)
- : MessageDialog(pParent, "SaveDefaultsDialog",
- "modules/smath/ui/savedefaultsdialog.ui")
+ explicit SaveDefaultsQuery(weld::Widget* pParent)
+ : m_xBuilder(Application::CreateBuilder(pParent, "modules/smath/ui/savedefaultsdialog.ui"))
+ , m_xBox(m_xBuilder->weld_message_dialog("SaveDefaultsDialog"))
{
}
+ short run() { return m_xBox->run(); }
};
IMPL_LINK_NOARG( SmFontSizeDialog, DefaultButtonClickHdl, Button *, void )
{
- if (ScopedVclPtrInstance<SaveDefaultsQuery>(this)->Execute() == RET_YES)
+ SaveDefaultsQuery aQuery(GetFrameWeld());
+ if (aQuery.run() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -508,7 +513,8 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu, bool )
IMPL_LINK_NOARG( SmFontTypeDialog, DefaultButtonClickHdl, Button *, void )
{
- if (ScopedVclPtrInstance<SaveDefaultsQuery>(this)->Execute() == RET_YES)
+ SaveDefaultsQuery aQuery(GetFrameWeld());
+ if (aQuery.run() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -704,7 +710,8 @@ IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu, bool )
IMPL_LINK_NOARG( SmDistanceDialog, DefaultButtonClickHdl, Button *, void )
{
- if (ScopedVclPtrInstance<SaveDefaultsQuery>(this)->Execute() == RET_YES)
+ SaveDefaultsQuery aQuery(GetFrameWeld());
+ if (aQuery.run() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -996,7 +1003,8 @@ void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/
IMPL_LINK_NOARG( SmAlignDialog, DefaultButtonClickHdl, Button *, void )
{
- if (ScopedVclPtrInstance<SaveDefaultsQuery>(this)->Execute() == RET_YES)
+ SaveDefaultsQuery aQuery(GetFrameWeld());
+ if (aQuery.run() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
diff --git a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
index 8fe8f882162f..c4128f71e133 100644
--- a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
+++ b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui
@@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.0"/>
<object class="GtkMessageDialog" id="SaveDefaultsDialog">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
<property name="title" translatable="yes" context="savedefaultsdialog|SaveDefaultsDialog">Save defaults?</property>
<property name="resizable">False</property>
<property name="modal">True</property>
@@ -22,7 +21,6 @@
<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>