diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-15 09:14:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-15 13:45:20 +0200 |
commit | 9aff7f3c491da9e3016e5a3cb9737f8bb7c3d0d9 (patch) | |
tree | bed8eb41dbbc07099e1c3be7354493e4d5fc99e0 /sc | |
parent | 932c96e158517bc1369d78e8180da4c04c214cff (diff) |
weld ScSolverNoSolutionDialog
Change-Id: I403e39e0f5cd642c5996a49f50cc7ee7bbdfbd02
Reviewed-on: https://gerrit.libreoffice.org/54354
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 'sc')
-rw-r--r-- | sc/source/ui/inc/optsolver.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/optsolver.cxx | 19 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/nosolutiondialog.ui | 8 |
3 files changed, 16 insertions, 18 deletions
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index 66b7132440dc..49a4e18e7021 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -214,14 +214,13 @@ public: void SetTimeLimit( sal_Int32 nSeconds ); }; -class ScSolverNoSolutionDialog : public ModalDialog +class ScSolverNoSolutionDialog : public weld::GenericDialogController { - VclPtr<FixedText> m_pFtErrorText; + std::unique_ptr<weld::Label> m_xFtErrorText; public: - ScSolverNoSolutionDialog(vcl::Window* pParent, const OUString& rErrorText); + ScSolverNoSolutionDialog(weld::Window* pParent, const OUString& rErrorText); virtual ~ScSolverNoSolutionDialog() override; - virtual void dispose() override; }; class ScSolverSuccessDialog : public weld::GenericDialogController diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 96eaf1fd8ccb..d3cfa487eb42 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -77,22 +77,15 @@ void ScSolverProgressDialog::SetTimeLimit( sal_Int32 nSeconds ) m_pFtTime->SetText( aNew ); } -ScSolverNoSolutionDialog::ScSolverNoSolutionDialog( vcl::Window* pParent, const OUString& rErrorText ) - : ModalDialog(pParent, "NoSolutionDialog", "modules/scalc/ui/nosolutiondialog.ui") +ScSolverNoSolutionDialog::ScSolverNoSolutionDialog(weld::Window* pParent, const OUString& rErrorText) + : GenericDialogController(pParent, "modules/scalc/ui/nosolutiondialog.ui", "NoSolutionDialog") + , m_xFtErrorText(m_xBuilder->weld_label("error")) { - get(m_pFtErrorText, "error"); - m_pFtErrorText->SetText(rErrorText); + m_xFtErrorText->set_label(rErrorText); } ScSolverNoSolutionDialog::~ScSolverNoSolutionDialog() { - disposeOnce(); -} - -void ScSolverNoSolutionDialog::dispose() -{ - m_pFtErrorText.clear(); - ModalDialog::dispose(); } ScSolverSuccessDialog::ScSolverSuccessDialog(weld::Window* pParent, const OUString& rSolution) @@ -1059,8 +1052,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY ); if ( xDesc.is() ) aError = xDesc->getStatusDescription(); // error description from component - ScopedVclPtrInstance< ScSolverNoSolutionDialog > aDialog( this, aError ); - aDialog->Execute(); + ScSolverNoSolutionDialog aDialog(GetFrameWeld(), aError); + aDialog.run(); } if ( bRestore ) // restore old values diff --git a/sc/uiconfig/scalc/ui/nosolutiondialog.ui b/sc/uiconfig/scalc/ui/nosolutiondialog.ui index ad2b97a37d47..8c98b07959b2 100644 --- a/sc/uiconfig/scalc/ui/nosolutiondialog.ui +++ b/sc/uiconfig/scalc/ui/nosolutiondialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sc"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="NoSolutionDialog"> @@ -7,7 +7,13 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="nosolutiondialog|NoSolutionDialog">No Solution</property> <property name="resizable">False</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> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> |