diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-30 10:41:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-30 15:17:50 +0200 |
commit | 5fb3b6b925db2989ce61bb954d7156f2a3b84b4c (patch) | |
tree | 13ed09384bdae6b1186bb1bc3b995775909908e2 /cui | |
parent | 809d59534f519b55d8d55bc03ef35264a2ffe329 (diff) |
weld SvxNewTableDialog
Change-Id: I33189708a2f1b63080cbafc94fe288f8abe60830
Reviewed-on: https://gerrit.libreoffice.org/53652
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/newtabledlg.cxx | 22 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 4 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/newtabledlg.hxx | 15 | ||||
-rw-r--r-- | cui/uiconfig/ui/newtabledialog.ui | 21 |
5 files changed, 25 insertions, 39 deletions
diff --git a/cui/source/dialogs/newtabledlg.cxx b/cui/source/dialogs/newtabledlg.cxx index bf5d320c9627..af4d91f1b1c5 100644 --- a/cui/source/dialogs/newtabledlg.cxx +++ b/cui/source/dialogs/newtabledlg.cxx @@ -19,11 +19,11 @@ #include <newtabledlg.hxx> -SvxNewTableDialog::SvxNewTableDialog() - : m_pDialog( VclPtr<ModalDialog>::Create( nullptr, "NewTableDialog", "cui/ui/newtabledialog.ui" ) ) +SvxNewTableDialog::SvxNewTableDialog(weld::Window* pWindow) + : GenericDialogController(pWindow, "cui/ui/newtabledialog.ui", "NewTableDialog") + , mxNumColumns(m_xBuilder->weld_spin_button("columns")) + , mxNumRows(m_xBuilder->weld_spin_button("rows")) { - m_pDialog->get(mpNumRows, "rows"); - m_pDialog->get(mpNumColumns, "columns"); } SvxNewTableDialog::~SvxNewTableDialog() @@ -31,27 +31,19 @@ SvxNewTableDialog::~SvxNewTableDialog() disposeOnce(); } -void SvxNewTableDialog::dispose() -{ - mpNumColumns.clear(); - mpNumRows.clear(); - m_pDialog.disposeAndClear(); - SvxAbstractNewTableDialog::dispose(); -} - short SvxNewTableDialog::Execute() { - return m_pDialog->Execute(); + return m_xDialog->run(); } sal_Int32 SvxNewTableDialog::getRows() const { - return sal::static_int_cast< sal_Int32 >( mpNumRows->GetValue() ); + return sal::static_int_cast< sal_Int32 >( mxNumRows->get_value() ); } sal_Int32 SvxNewTableDialog::getColumns() const { - return sal::static_int_cast< sal_Int32 >( mpNumColumns->GetValue() ); + return sal::static_int_cast< sal_Int32 >( mxNumColumns->get_value() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index e5a3cfac7114..85b2d1504c37 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1545,9 +1545,9 @@ VclPtr<SvxAbstractSplitTableDialog> AbstractDialogFactory_Impl::CreateSvxSplitTa return VclPtr<SvxSplitTableDlg>::Create( pParent, bIsTableVertical, nMaxVertical, 99 ); } -VclPtr<SvxAbstractNewTableDialog> AbstractDialogFactory_Impl::CreateSvxNewTableDialog() +VclPtr<SvxAbstractNewTableDialog> AbstractDialogFactory_Impl::CreateSvxNewTableDialog(weld::Window* pParent) { - return VclPtr<SvxNewTableDialog>::Create(); + return VclPtr<SvxNewTableDialog>::Create(pParent); } VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateOptionsDialog( diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 2012658cbc9a..9de13861ee17 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -732,7 +732,7 @@ public: virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) override; - virtual VclPtr<SvxAbstractNewTableDialog> CreateSvxNewTableDialog() override ; + virtual VclPtr<SvxAbstractNewTableDialog> CreateSvxNewTableDialog(weld::Window* pParent) override ; virtual VclPtr<VclAbstractDialog> CreateOptionsDialog( vcl::Window* pParent, const OUString& rExtensionId ) override; diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx index 91de08ff6f23..88b7f61c5ec9 100644 --- a/cui/source/inc/newtabledlg.hxx +++ b/cui/source/inc/newtabledlg.hxx @@ -19,24 +19,19 @@ #ifndef INCLUDED_CUI_SOURCE_INC_NEWTABLEDLG_HXX #define INCLUDED_CUI_SOURCE_INC_NEWTABLEDLG_HXX -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/button.hxx> - #include <svx/stddlg.hxx> #include <svx/svxdlg.hxx> +#include <vcl/weld.hxx> -class SvxNewTableDialog : public SvxAbstractNewTableDialog +class SvxNewTableDialog : public SvxAbstractNewTableDialog, public weld::GenericDialogController { private: - VclPtr<ModalDialog> m_pDialog; - VclPtr<NumericField> mpNumColumns; - VclPtr<NumericField> mpNumRows; + std::unique_ptr<weld::SpinButton> mxNumColumns; + std::unique_ptr<weld::SpinButton> mxNumRows; public: - SvxNewTableDialog(); + SvxNewTableDialog(weld::Window* pParent); virtual ~SvxNewTableDialog() override; - virtual void dispose() override; virtual short Execute() override; diff --git a/cui/uiconfig/ui/newtabledialog.ui b/cui/uiconfig/ui/newtabledialog.ui index d9814256f856..d44a22aa470e 100644 --- a/cui/uiconfig/ui/newtabledialog.ui +++ b/cui/uiconfig/ui/newtabledialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.20.4 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> <object class="GtkAdjustment" id="columns_value"> @@ -20,6 +20,9 @@ <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="newtabledialog|NewTableDialog">Insert Table</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> @@ -95,16 +98,14 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="newtabledialog|columns_label">_Number of columns:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">columns</property> + <property name="xalign">0</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> @@ -112,16 +113,14 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="newtabledialog|rows_label">_Number of rows:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">rows</property> + <property name="xalign">0</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> @@ -137,14 +136,13 @@ <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> <child> <object class="GtkSpinButton" id="rows"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="activates_default">True</property> <property name="adjustment">rows_value</property> <property name="snap_to_ticks">True</property> <property name="numeric">True</property> @@ -152,8 +150,6 @@ <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> </object> @@ -170,5 +166,8 @@ <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> |