diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 16:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-22 22:07:38 +0100 |
commit | 6a4c464b49dbfa2801818ead1b50bc9580824d00 (patch) | |
tree | 3d6381b6b13576bc536670992b36784436486e95 /svx/source/dialog/_contdlg.cxx | |
parent | f7733528e88a6619f82b54b59e92a9bca72c0a89 (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 'svx/source/dialog/_contdlg.cxx')
-rw-r--r-- | svx/source/dialog/_contdlg.cxx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 25e8045e64f8..5cdae19699bc 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -44,7 +44,7 @@ #include <vcl/settings.hxx> #include <vcl/virdev.hxx> #include "dlgunit.hxx" -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> SFX_IMPL_FLOATINGWINDOW_WITHID( SvxContourDlgChildWindow, SID_CONTOUR_DLG ); @@ -317,8 +317,9 @@ bool SvxSuperContourDlg::Close() if (m_pTbx1->IsItemEnabled(mnApplyId)) { - ScopedVclPtrInstance< MessageDialog > aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui"); - const long nRet = aQBox->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/querysavecontchangesdialog.ui")); + std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QuerySaveContourChangesDialog")); + const short nRet = xQBox->run(); if ( nRet == RET_YES ) { @@ -438,9 +439,10 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx, void ) { if (m_pTbx1->IsItemChecked(mnWorkSpaceId)) { - ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui" ); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/querydeletecontourdialog.ui")); + std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QueryDeleteContourDialog")); - if ( !m_pContourWnd->IsContourChanged() || ( aQBox->Execute() == RET_YES ) ) + if (!m_pContourWnd->IsContourChanged() || (xQBox->run() == RET_YES)) m_pContourWnd->SetWorkplaceMode( true ); else m_pTbx1->CheckItem(mnWorkSpaceId, false); @@ -512,9 +514,10 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx, void ) m_pStbStatus->Invalidate(); else if ( bGraphicLinked ) { - ScopedVclPtrInstance<MessageDialog> aQBox(this, "QueryUnlinkGraphicsDialog", - "svx/ui/queryunlinkgraphicsdialog.ui"); - if (aQBox->Execute() != RET_YES) + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/queryunlinkgraphicsdialog.ui")); + std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QueryUnlinkGraphicsDialog")); + + if (xQBox->run() != RET_YES) { bPipette = false; m_pTbx1->CheckItem(mnPipetteId, bPipette); @@ -694,7 +697,9 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) if( !!aMask ) { - ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui" ); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "svx/ui/querynewcontourdialog.ui")); + std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QueryNewContourDialog")); + bool bNewContour; aRedoGraphic = Graphic(); @@ -702,7 +707,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) aGraphic = Graphic( BitmapEx( aBmp, aMask ) ); mnGrfChanged++; - bNewContour = ( aQBox->Execute() == RET_YES ); + bNewContour = (xQBox->run() == RET_YES); rWnd.SetGraphic( aGraphic, bNewContour ); if( bNewContour ) |