summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog
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 /sw/source/ui/dialog
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 'sw/source/ui/dialog')
-rw-r--r--sw/source/ui/dialog/swmessdialog.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx33
2 files changed, 26 insertions, 9 deletions
diff --git a/sw/source/ui/dialog/swmessdialog.cxx b/sw/source/ui/dialog/swmessdialog.cxx
index 79aba4459af6..c57f23534eb8 100644
--- a/sw/source/ui/dialog/swmessdialog.cxx
+++ b/sw/source/ui/dialog/swmessdialog.cxx
@@ -11,7 +11,7 @@
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/messagedialog.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/vclmedit.hxx>
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index aac5e2c1dfd1..1096103092da 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -22,7 +22,7 @@
#include <svl/urihelper.hxx>
#include <svl/PasswordHelper.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
#include <sfx2/passwd.hxx>
@@ -422,7 +422,10 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
}
else
{
- ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_WRONG_PASSWORD), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_WRONG_PASSWORD)));
+ xInfoBox->run();
}
}
}
@@ -989,7 +992,10 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, Button *, pButton, void )
bool bContent = pSectRepr->IsContent();
if( pBox->IsChecked() && bContent && rSh.HasSelection() )
{
- if (RET_NO == ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_QUERY_CONNECT), VclMessageType::Question, VclButtonsType::YesNo)->Execute())
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ SwResId(STR_QUERY_CONNECT)));
+ if (RET_NO == xQueryBox->run())
pBox->Check( false );
}
if( bFile )
@@ -1265,7 +1271,10 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox, void )
}
else
{
- ScopedVclPtrInstance<MessageDialog>(pBox, SwResId(STR_WRONG_PASSWD_REPEAT), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pBox->GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_WRONG_PASSWD_REPEAT)));
+ xInfoBox->run();
ChangePasswdHdl(pBox);
break;
}
@@ -1702,7 +1711,10 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton, void )
}
else
{
- ScopedVclPtrInstance<MessageDialog>(pButton, SwResId(STR_WRONG_PASSWD_REPEAT), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_WRONG_PASSWD_REPEAT)));
+ xInfoBox->run();
}
}
else if(!bChange)
@@ -1725,9 +1737,14 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, Button *, pButton, void )
CheckBox* pBox = static_cast<CheckBox*>(pButton);
if( pBox->IsChecked() )
{
- if( m_pWrtSh->HasSelection() &&
- RET_NO == ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_QUERY_CONNECT), VclMessageType::Question, VclButtonsType::YesNo)->Execute())
- pBox->Check( false );
+ if (m_pWrtSh->HasSelection())
+ {
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ SwResId(STR_QUERY_CONNECT)));
+ if (RET_NO == xQueryBox->run())
+ pBox->Check( false );
+ }
}
bool bFile = pBox->IsChecked();