summaryrefslogtreecommitdiffstats
path: root/sw/source/ui/misc/glossary.cxx
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/misc/glossary.cxx
parenttdf#68889: Fix the weight reported by the system for the problematic font (diff)
downloadcore-6a4c464b49dbfa2801818ead1b50bc9580824d00.tar.gz
core-6a4c464b49dbfa2801818ead1b50bc9580824d00.zip
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/misc/glossary.cxx')
-rw-r--r--sw/source/ui/misc/glossary.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index e69802781349..53eade41ba0c 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -21,7 +21,7 @@
#include <o3tl/any.hxx>
#include <vcl/menu.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
#include <vcl/help.hxx>
#include <vcl/builderfactory.hxx>
#include <svl/stritem.hxx>
@@ -461,7 +461,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool )
const OUString aShortName(m_pShortNameEdit->GetText());
if(pGlossaryHdl->HasShortName(aShortName))
{
- ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_DOUBLE_SHORTNAME), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_DOUBLE_SHORTNAME)));
+ xInfoBox->run();
m_pShortNameEdit->SetSelection(Selection(0, SELECTION_MAX));
m_pShortNameEdit->GrabFocus();
return true;
@@ -589,7 +592,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool )
Init();
else
{
- ScopedVclPtrInstance<MessageDialog>(this, SwResId( STR_NO_GLOSSARIES ), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_NO_GLOSSARIES)));
+ xInfoBox->run();
}
}
}
@@ -668,9 +674,10 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, Button*, void)
}
else
{
- ScopedVclPtrInstance< MessageDialog > aBox(this, sReadonlyPath, VclMessageType::Question, VclButtonsType::YesNo);
-
- if(RET_YES == aBox->Execute())
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ sReadonlyPath));
+ if (RET_YES == xBox->run())
PathHdl(m_pPathBtn);
}
}
@@ -802,7 +809,10 @@ IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename, Button*, void)
if( pDlg->pGlossaryHdl->HasShortName(m_pNewShort->GetText())
&& sNew != m_pOldShort->GetText() )
{
- ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_DOUBLE_SHORTNAME), VclMessageType::Info)->Execute();
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ SwResId(STR_DOUBLE_SHORTNAME)));
+ xBox->run();
m_pNewShort->GrabFocus();
}
else
@@ -1138,8 +1148,10 @@ void SwGlossaryDlg::DeleteEntry()
const bool bExists = nullptr != pChild;
const bool bIsGroup = pEntry && !pParent;
- ScopedVclPtrInstance< MessageDialog > aQuery(this, SwResId(STR_QUERY_DELETE), VclMessageType::Question, VclButtonsType::YesNo);
- if (bExists && !bIsGroup && RET_YES == aQuery->Execute())
+ std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(GetFrameWeld(),
+ VclMessageType::Question, VclButtonsType::YesNo,
+ SwResId(STR_QUERY_DELETE)));
+ if (bExists && !bIsGroup && RET_YES == xQuery->run())
{
if (!aTitle.isEmpty() && pGlossaryHdl->DelGlossary(aShortName))
{