diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-08 09:49:36 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-09 13:47:52 +0100 |
commit | 48bca65f1cf381cba7cb7a4c3916155a1bca0955 (patch) | |
tree | df461652450b3e095e37a3290cbe54ab20cedfae /cui/source | |
parent | c468b6910bf77e332647725da70e3cb248a9de0e (diff) |
inherit welded dialogs from a common ancestor
Change-Id: Ifa6c871a134cf89bfba71b1049a115cf7c953c42
Reviewed-on: https://gerrit.libreoffice.org/50936
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/source')
-rw-r--r-- | cui/source/dialogs/dlgname.cxx | 3 | ||||
-rw-r--r-- | cui/source/dialogs/insrc.cxx | 5 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 3 | ||||
-rw-r--r-- | cui/source/dialogs/splitcelldlg.cxx | 5 | ||||
-rw-r--r-- | cui/source/inc/dlgname.hxx | 8 | ||||
-rw-r--r-- | cui/source/inc/insrc.hxx | 4 | ||||
-rw-r--r-- | cui/source/inc/scriptdlg.hxx | 5 | ||||
-rw-r--r-- | cui/source/inc/splitcelldlg.hxx | 4 | ||||
-rw-r--r-- | cui/source/options/securityoptions.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/securityoptions.hxx | 7 |
10 files changed, 12 insertions, 35 deletions
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx index e8873de17ebd..e3ad99d3497e 100644 --- a/cui/source/dialogs/dlgname.cxx +++ b/cui/source/dialogs/dlgname.cxx @@ -29,8 +29,7 @@ \************************************************************************/ SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, const OUString& rDesc) - : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/namedialog.ui")) - , m_xDialog(m_xBuilder->weld_dialog("NameDialog")) + : GenericDialogController(pParent, "cui/ui/namedialog.ui", "NameDialog") , m_xEdtName(m_xBuilder->weld_entry("name_entry")) , m_xFtDescription(m_xBuilder->weld_label("description_label")) , m_xBtnOK(m_xBuilder->weld_button("ok")) diff --git a/cui/source/dialogs/insrc.cxx b/cui/source/dialogs/insrc.cxx index 01e2335e6c8f..9e29733e7486 100644 --- a/cui/source/dialogs/insrc.cxx +++ b/cui/source/dialogs/insrc.cxx @@ -34,8 +34,7 @@ sal_uInt16 SvxInsRowColDlg::getInsertCount() const } SvxInsRowColDlg::SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) - : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/insertrowcolumn.ui")) - , m_xDialog(m_xBuilder->weld_dialog("InsertRowColumnDialog")) + : GenericDialogController(pParent, "cui/ui/insertrowcolumn.ui", "InsertRowColumnDialog") , m_xCountEdit(m_xBuilder->weld_spin_button("insert_number")) , m_xBeforeBtn(m_xBuilder->weld_radio_button("insert_before")) , m_xAfterBtn(m_xBuilder->weld_radio_button("insert_after")) @@ -49,7 +48,7 @@ SvxInsRowColDlg::SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString short SvxInsRowColDlg::Execute() { - return m_xDialog->run(); + return run(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index f52317edec7c..1657140def76 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -405,8 +405,7 @@ void SFTreeListBox::ExpandedHdl() // CuiInputDialog ------------------------------------------------------------ CuiInputDialog::CuiInputDialog(weld::Window * pParent, InputDialogMode nMode) - : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/newlibdialog.ui")) - , m_xDialog(m_xBuilder->weld_dialog("NewLibDialog")) + : GenericDialogController(pParent, "cui/ui/newlibdialog.ui", "NewLibDialog") , m_xEdit(m_xBuilder->weld_entry("entry")) { m_xEdit->grab_focus(); diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx index a465dafef186..4248f2fe3956 100644 --- a/cui/source/dialogs/splitcelldlg.cxx +++ b/cui/source/dialogs/splitcelldlg.cxx @@ -25,8 +25,7 @@ #include <splitcelldlg.hxx> SvxSplitTableDlg::SvxSplitTableDlg(weld::Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal) - : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/splitcellsdialog.ui")) - , m_xDialog(m_xBuilder->weld_dialog("SplitCellsDialog")) + : GenericDialogController(pParent, "cui/ui/splitcellsdialog.ui", "SplitCellsDialog") , m_xCountEdit(m_xBuilder->weld_spin_button("countnf")) , m_xHorzBox(!bIsTableVertical ? m_xBuilder->weld_radio_button("hori") : m_xBuilder->weld_radio_button("vert")) , m_xVertBox(!bIsTableVertical ? m_xBuilder->weld_radio_button("vert") : m_xBuilder->weld_radio_button("hori")) @@ -84,7 +83,7 @@ long SvxSplitTableDlg::GetCount() const short SvxSplitTableDlg::Execute() { - return m_xDialog->run(); + return run(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx index 6c960ce114da..5543d9cf1dea 100644 --- a/cui/source/inc/dlgname.hxx +++ b/cui/source/inc/dlgname.hxx @@ -28,11 +28,9 @@ #include <vcl/weld.hxx> /// Dialog for editing a name -class SvxNameDialog +class SvxNameDialog : public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::Entry> m_xEdtName; std::unique_ptr<weld::Label> m_xFtDescription; std::unique_ptr<weld::Button> m_xBtnOK; @@ -44,12 +42,8 @@ private: public: SvxNameDialog(weld::Window* pWindow, const OUString& rName, const OUString& rDesc); - void set_title(const OUString& rTitle) { m_xDialog->set_title(rTitle); } - void set_help_id(const OString& rHelpId) { m_xDialog->set_help_id(rHelpId); } OUString GetName() const { return m_xEdtName->get_text(); } - short run() { return m_xDialog->run(); } - /** add a callback Link that is called whenever the content of the edit field is changed. The Link result determines whether the OK Button is enabled (> 0) or disabled (== 0). diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx index b2e9cb96b70d..aed5617d8065 100644 --- a/cui/source/inc/insrc.hxx +++ b/cui/source/inc/insrc.hxx @@ -24,11 +24,9 @@ #include <svx/stddlg.hxx> #include <vcl/weld.hxx> -class SvxInsRowColDlg : public SvxAbstractInsRowColDlg +class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::SpinButton> m_xCountEdit; std::unique_ptr<weld::RadioButton> m_xBeforeBtn; std::unique_ptr<weld::RadioButton> m_xAfterBtn; diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx index 2b86a9ea515a..604c7a4c3f90 100644 --- a/cui/source/inc/scriptdlg.hxx +++ b/cui/source/inc/scriptdlg.hxx @@ -92,15 +92,12 @@ enum class InputDialogMode { RENAME = 3, }; -class CuiInputDialog +class CuiInputDialog : public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::Entry> m_xEdit; public: CuiInputDialog(weld::Window * pParent, InputDialogMode nMode); - short run() { return m_xDialog->run(); } OUString GetObjectName() const { return m_xEdit->get_text(); } void SetObjectName(const OUString& rName) { diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx index 868e6b7e72c5..02e7db683565 100644 --- a/cui/source/inc/splitcelldlg.hxx +++ b/cui/source/inc/splitcelldlg.hxx @@ -22,11 +22,9 @@ #include <svx/svxdlg.hxx> #include <vcl/weld.hxx> -class SvxSplitTableDlg : public SvxAbstractSplittTableDialog +class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::SpinButton> m_xCountEdit; std::unique_ptr<weld::RadioButton> m_xHorzBox; std::unique_ptr<weld::RadioButton> m_xVertBox; diff --git a/cui/source/options/securityoptions.cxx b/cui/source/options/securityoptions.cxx index ab4b1dd3d5a7..8273953cbe9c 100644 --- a/cui/source/options/securityoptions.cxx +++ b/cui/source/options/securityoptions.cxx @@ -40,8 +40,7 @@ namespace svx { SecurityOptionsDialog::SecurityOptionsDialog(weld::Window* pParent, SvtSecurityOptions const * pOptions) - : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/securityoptionsdialog.ui")) - , m_xDialog(m_xBuilder->weld_dialog("SecurityOptionsDialog")) + : GenericDialogController(pParent, "cui/ui/securityoptionsdialog.ui", "SecurityOptionsDialog") , m_xSaveOrSendDocsCB(m_xBuilder->weld_check_button("savesenddocs")) , m_xSaveOrSendDocsImg(m_xBuilder->weld_widget("locksavesenddocs")) , m_xSignDocsCB(m_xBuilder->weld_check_button("whensigning")) diff --git a/cui/source/options/securityoptions.hxx b/cui/source/options/securityoptions.hxx index f88e8164ca2e..1176bd7fe818 100644 --- a/cui/source/options/securityoptions.hxx +++ b/cui/source/options/securityoptions.hxx @@ -26,12 +26,9 @@ class SvtSecurityOptions; namespace svx { - class SecurityOptionsDialog + class SecurityOptionsDialog : public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; - std::unique_ptr<weld::CheckButton> m_xSaveOrSendDocsCB; std::unique_ptr<weld::Widget> m_xSaveOrSendDocsImg; std::unique_ptr<weld::CheckButton> m_xSignDocsCB; @@ -53,8 +50,6 @@ namespace svx public: SecurityOptionsDialog(weld::Window* pParent, SvtSecurityOptions const * pOptions); - short run() { return m_xDialog->run(); } - bool IsSaveOrSendDocsChecked() const { return m_xSaveOrSendDocsCB->get_active(); } bool IsSignDocsChecked() const { return m_xSignDocsCB->get_active(); } bool IsPrintDocsChecked() const { return m_xPrintDocsCB->get_active(); } |