summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-23 09:35:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-26 15:27:09 +0000
commit942f05996bc287923cdbcae12c64e57adf8ec975 (patch)
tree7005380763a9ecb93f5f27c28174633b9774abb7 /basctl
parentc410a3dcfeb68ba2247c0d879727afe4ca8ed3da (diff)
convert remaining ErrorBox to weld::MessageDialog
and convert remaining QueryBox to weld::MessageDialog Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2b.cxx7
-rw-r--r--basctl/source/basicide/baside3.cxx5
-rw-r--r--basctl/source/basicide/basides1.cxx21
3 files changed, 24 insertions, 9 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index f25e60c91a23..b7e0fbe518ad 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -37,7 +37,7 @@
#include <comphelper/string.hxx>
#include <officecfg/Office/Common.hxx>
#include <sfx2/dispatch.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
#include <svl/urihelper.hxx>
#include <svx/svxids.hrc>
#include <vcl/xtextedt.hxx>
@@ -479,7 +479,10 @@ bool EditorWindow::ImpCanModify()
{
// If in Trace-mode, abort the trace or refuse input
// Remove markers in the modules in Notify at Basic::Stopped
- if (ScopedVclPtrInstance<QueryBox>(nullptr, MessBoxStyle::OkCancel, IDEResId(RID_STR_WILLSTOPPRG))->Execute() == RET_OK)
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Question, VclButtonsType::OkCancel,
+ IDEResId(RID_STR_WILLSTOPPRG)));
+ if (xQueryBox->run() == RET_OK)
{
rModulWindow.GetBasicStatus().bIsRunning = false;
StopBasic();
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index fa23eca1a822..322097b38105 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -803,7 +803,7 @@ NameClashQueryBox::NameClashQueryBox( vcl::Window* pParent,
AddButton( IDEResId(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO );
AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
- SetImage( QueryBox::GetStandardImage() );
+ SetImage(GetStandardQueryBoxImage());
}
@@ -828,10 +828,9 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( vcl::Window* pParent,
AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel );
AddButton( StandardButtonType::Help, RET_HELP, ButtonDialogFlags::Help, 4 );
- SetImage( QueryBox::GetStandardImage() );
+ SetImage(GetStandardQueryBoxImage() );
}
-
bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& aLibName )
{
bool bDone = false;
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 5fce14ec5114..a1f4f07f18cf 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -49,7 +49,6 @@
#include <svl/whiter.hxx>
#include <vcl/xtextedt.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
namespace basctl
@@ -102,7 +101,17 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
nActModWindows++;
}
- if ( nActModWindows <= 1 || ( !rSearchItem.GetSelection() && ScopedVclPtrInstance<QueryBox>(pCurWin, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, IDEResId(RID_STR_SEARCHALLMODULES))->Execute() == RET_YES ) )
+ bool bAllModules = nActModWindows <= 1;
+ if (!bAllModules)
+ {
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pCurWin ? pCurWin->GetFrameWeld() : nullptr,
+ VclMessageType::Question, VclButtonsType::YesNo,
+ IDEResId(RID_STR_SEARCHALLMODULES)));
+ xQueryBox->set_default_response(RET_YES);
+ bAllModules = xQueryBox->run() == RET_YES;
+ }
+
+ if (bAllModules)
{
for (auto const& window : aWindowTable)
{
@@ -145,8 +154,12 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
SfxViewFrame* pViewFrame = GetViewFrame();
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : nullptr;
vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : nullptr;
- ScopedVclPtrInstance< QueryBox > aQuery(pParent, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, IDEResId(RID_STR_SEARCHFROMSTART));
- if ( aQuery->Execute() == RET_YES )
+
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+ VclMessageType::Question, VclButtonsType::YesNo,
+ IDEResId(RID_STR_SEARCHFROMSTART)));
+ xQueryBox->set_default_response(RET_YES);
+ if (xQueryBox->run() == RET_YES)
{
it = aWindowTable.begin();
if ( it != aWindowTable.end() )