Kaydet (Commit) 942f0599 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert remaining ErrorBox to weld::MessageDialog

and

convert remaining QueryBox to weld::MessageDialog

Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
üst c410a3dc
......@@ -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();
......
......@@ -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;
......
......@@ -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() )
......
......@@ -37,6 +37,7 @@
#include <vcl/image.hxx>
#include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <vcl/settings.hxx>
#include <rtl/math.hxx>
......@@ -757,9 +758,10 @@ void DataBrowser::ShowWarningBox()
bool DataBrowser::ShowQueryBox()
{
ScopedVclPtrInstance<QueryBox> pQueryBox(this, MessBoxStyle::YesNo, SchResId(STR_DATA_EDITOR_INCORRECT_INPUT));
return pQueryBox->Execute() == RET_YES;
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
SchResId(STR_DATA_EDITOR_INCORRECT_INPUT)));
return xQueryBox->run() == RET_YES;
}
bool DataBrowser::IsDataValid()
......
......@@ -27,7 +27,6 @@
#include <vcl/commandinfoprovider.hxx>
#include <vcl/help.hxx>
#include <vcl/weld.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/decoview.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/scrbar.hxx>
......@@ -286,9 +285,10 @@ short SvxMenuConfigPage::QueryReset()
OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName );
ScopedVclPtrInstance<QueryBox> qbox( this, MessBoxStyle::YesNo, label );
return qbox->Execute();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
label));
return xQueryBox->run();
}
IMPL_LINK_NOARG( SvxMenuConfigPage, SelectMenu, ListBox&, void )
......
......@@ -723,9 +723,10 @@ short SvxToolbarConfigPage::QueryReset()
OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName );
ScopedVclPtrInstance< QueryBox > qbox( this, MessBoxStyle::YesNo, label );
return qbox->Execute();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
label));
return xQueryBox->run();
}
IMPL_LINK_NOARG( SvxToolbarConfigPage, SelectToolbar, ListBox&, void )
......
......@@ -27,7 +27,7 @@
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <svtools/svtabbx.hxx>
......@@ -416,9 +416,12 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void )
if( !xLink.is() )
return;
ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsg );
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
aStrCloselinkmsg));
xQueryBox->set_default_response(RET_YES);
if( RET_YES == aBox->Execute() )
if (RET_YES == xQueryBox->run())
{
m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) );
......@@ -447,9 +450,12 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void )
}
else
{
ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsgMulti );
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
aStrCloselinkmsgMulti));
xQueryBox->set_default_response(RET_YES);
if( RET_YES == aBox->Execute() )
if (RET_YES == xQueryBox->run())
{
SvBaseLinkMemberList aLinkList;
......
......@@ -23,7 +23,7 @@
#include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Security.hxx>
#include <tools/config.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
......@@ -663,8 +663,12 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl, Button*, void)
}
else
{
ScopedVclPtrInstance< QueryBox > aQuery( this, MessBoxStyle::YesNo|MessBoxStyle::DefaultNo, m_sPasswordStoringDeactivateStr );
sal_uInt16 nRet = aQuery->Execute();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
m_sPasswordStoringDeactivateStr));
xQueryBox->set_default_response(RET_NO);
sal_uInt16 nRet = xQueryBox->run();
if( RET_YES == nRet )
{
......
......@@ -21,7 +21,7 @@
#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <vcl/edit.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
......@@ -709,8 +709,11 @@ void SearchAndParseThread::execute()
sError = CuiResId(RID_SVXSTR_SEARCHERROR);
sError = sError.replaceAll("%1", m_aURL);
m_pPersonaDialog->SetProgress( OUString() );
ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError);
aBox->Execute();
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Error, VclButtonsType::Ok,
sError));
xBox->run();
return;
}
}
......@@ -722,8 +725,10 @@ void SearchAndParseThread::execute()
sError = CuiResId(RID_SVXSTR_SEARCHERROR);
sError = sError.replaceAll("%1", m_aURL);
m_pPersonaDialog->SetProgress( OUString() );
ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError );
aBox->Execute();
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Error, VclButtonsType::Ok,
sError));
xBox->run();
return;
}
......@@ -763,8 +768,10 @@ void SearchAndParseThread::execute()
sError = CuiResId(RID_SVXSTR_SEARCHERROR);
sError = sError.replaceAll("%1", m_aURL);
m_pPersonaDialog->SetProgress( OUString() );
ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError);
aBox->Execute();
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Error, VclButtonsType::Ok,
sError));
xBox->run();
return;
}
continue;
......@@ -847,8 +854,10 @@ void SearchAndParseThread::execute()
sError = CuiResId( RID_SVXSTR_SEARCHERROR );
sError = sError.replaceAll("%1", m_aURL);
m_pPersonaDialog->SetProgress( OUString() );
ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError);
aBox->Execute();
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Error, VclButtonsType::Ok,
sError));
xBox->run();
return;
}
......
......@@ -25,7 +25,7 @@
#include <sfx2/viewsh.hxx>
#include <svl/itemiter.hxx>
#include <svl/languageoptions.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <unotools/configitem.hxx>
#include <sfx2/htmlmode.hxx>
#include <sal/macros.h>
......@@ -1375,7 +1375,11 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() )
{
if (ScopedVclPtrInstance<QueryBox>(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, m_pPrintRangeQueryText->GetText())->Execute() == RET_NO)
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
m_pPrintRangeQueryText->GetText()));
xQueryBox->set_default_response(RET_NO);
if (xQueryBox->run() == RET_NO)
{
MetricField* pField = nullptr;
if ( IsPrinterRangeOverflow( *m_pLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) )
......
......@@ -32,7 +32,8 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <stringconstants.hxx>
#include <bitmaps.hlst>
#include <UITools.hxx>
......@@ -175,8 +176,10 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, Button*, void)
{
if ( xNameContainer->hasByName(sName) )
{
ScopedVclPtrInstance< QueryBox > aBox(this, MessBoxStyle::YesNo, DBA_RES(STR_ALREADYEXISTOVERWRITE));
if ( aBox->Execute() != RET_YES )
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
DBA_RES(STR_ALREADYEXISTOVERWRITE)));
if (xQueryBox->run() != RET_YES)
return;
}
m_pName->SetText(sName);
......
......@@ -33,6 +33,7 @@
#include <osl/process.h>
#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <sfx2/filedlghelper.hxx>
#include <dbadmin.hxx>
#include <comphelper/types.hxx>
......@@ -475,8 +476,12 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, sQuery);
sal_Int32 nQueryResult = aQuery->Execute();
vcl::Window* pWin = GetParent();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Question, VclButtonsType::YesNo,
sQuery));
xQueryBox->set_default_response(RET_YES);
sal_Int32 nQueryResult = xQueryBox->run();
m_bUserGrabFocus = true;
switch (nQueryResult)
......@@ -492,8 +497,14 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
ScopedVclPtrInstance< QueryBox > aWhatToDo(GetParent(), MessBoxStyle::RetryCancel | MessBoxStyle::DefaultRetry, sQuery);
nQueryResult = aWhatToDo->Execute();
std::unique_ptr<weld::MessageDialog> xWhatToDo(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Question, VclButtonsType::NONE,
sQuery));
xWhatToDo->add_button(Button::GetStandardText(StandardButtonType::Retry), RET_RETRY);
xWhatToDo->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
xWhatToDo->set_default_response(RET_RETRY);
nQueryResult = xWhatToDo->run();
m_bUserGrabFocus = true;
if (RET_RETRY == nQueryResult)
......
......@@ -628,10 +628,10 @@ void OSQLMessageBox::Construct( MessBoxStyle _nStyle, MessageType _eImage )
m_aInfoImage->SetImage(WarningBox::GetStandardImage());
break;
case Error:
m_aInfoImage->SetImage(ErrorBox::GetStandardImage());
m_aInfoImage->SetImage(GetStandardErrorBoxImage());
break;
case Query:
m_aInfoImage->SetImage(QueryBox::GetStandardImage());
m_aInfoImage->SetImage(GetStandardQueryBoxImage());
break;
}
......
......@@ -80,6 +80,7 @@
#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <osl/mutex.hxx>
#include <rtl/strbuf.hxx>
#include <memory>
......@@ -1738,9 +1739,14 @@ short OQueryController::saveModified()
)
{
OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) );
ScopedVclPtrInstance< QueryBox > aQry( getView(), MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, sMessageText );
nRet = aQry->Execute();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(getFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
sMessageText));
xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
xQueryBox->set_default_response(RET_YES);
nRet = xQueryBox->run();
if ( ( nRet == RET_YES )
&& !doSaveAsDoc( false )
)
......
......@@ -16,6 +16,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sbibliography,\
$(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\
extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \
extensions/uiconfig/sbibliography/ui/generalpage \
extensions/uiconfig/sbibliography/ui/querydialog \
extensions/uiconfig/sbibliography/ui/mappingdialog \
extensions/uiconfig/sbibliography/ui/toolbar \
))
......
......@@ -32,7 +32,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/form/XLoadable.hpp>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <tools/debug.hxx>
using namespace ::com::sun::star;
......@@ -138,11 +138,26 @@ namespace bib
{
sErrorString += "\n";
sErrorString += BibResId(RID_MAP_QUESTION);
ScopedVclPtrInstance< QueryBox > aQuery(this, MessBoxStyle::YesNo, sErrorString);
aQuery->SetDefaultCheckBoxText();
short nResult = aQuery->Execute();
BibModul::GetConfig()->SetShowColumnAssignmentWarning(
!aQuery->GetCheckBoxState());
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/sbibliography/ui/querydialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryDialog"));
xQueryBox->set_primary_text(sErrorString);
std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
//fdo#75121, a bit tricky because the widgets we want to align with
//don't actually exist in the ui description, they're implied
std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
std::unique_ptr<weld::Container> xContentArea(xQueryBox->weld_message_area());
xOrigParent->remove(xWarningOnBox.get());
xContentArea->add(xWarningOnBox.get());
short nResult = xQueryBox->run();
BibModul::GetConfig()->SetShowColumnAssignmentWarning(!xWarningOnBox->get_active());
//put them back as they were
xContentArea->remove(xWarningOnBox.get());
xOrigParent->add(xWarningOnBox.get());
if( RET_YES != nResult )
{
bExecute = false;
......
......@@ -40,7 +40,8 @@
#include <com/sun/star/beans/Optional.hpp>
#include <com/sun/star/inspection/XObjectInspectorUI.hpp>
#include <com/sun/star/inspection/PropertyLineElement.hpp>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <tools/debug.hxx>
#include <sal/macros.h>
......@@ -510,7 +511,6 @@ namespace pcr
m_pHelper->setValidatingDataTypeByName( _rNewName );
}
bool XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType()
{
OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType: this will crash!" );
......@@ -525,14 +525,16 @@ namespace pcr
// confirmation message
OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ) );
sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
ScopedVclPtrInstance<QueryBox> aQuery( nullptr, MessBoxStyle::YesNo, sConfirmation ); // TODO/eForms: proper parent
if ( aQuery->Execute() != RET_YES )
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, // TODO/eForms: proper parent
VclMessageType::Question, VclButtonsType::YesNo,
sConfirmation));
if (xQueryBox->run() != RET_YES)
return false;
return true;
}
bool XSDValidationPropertyHandler::implDoRemoveCurrentDataType()
{
OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implDoRemoveCurrentDataType: this will crash!" );
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.2 -->
<interface domain="pcr">
<requires lib="gtk+" version="3.20"/>
<object class="GtkMessageDialog" id="QueryDialog">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<property name="message_type">question</property>
<property name="buttons">yes-no</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ask">
<property name="label" translatable="yes" context="querydialog|ask">Do not show this question again.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -1655,6 +1655,8 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
}
m_pErrors->SetSelectHdl( LINK( this, ImplErrorDialog, SelectHdl ) );
create_message_area();
}
......
......@@ -50,7 +50,8 @@
#include <connectivity/dbexception.hxx>
#include <vcl/svapp.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/button.hxx>
#include <vcl/weld.hxx>
#include <vcl/waitobj.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/container.hxx>
......@@ -434,17 +435,22 @@ namespace frm
if(needConfirmation)
{
// TODO: shouldn't this be done with an interaction handler?
ScopedVclPtrInstance< QueryBox > aQuery( nullptr, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) );
switch ( aQuery->Execute() )
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Question, VclButtonsType::YesNo,
FRM_RES_STRING(RID_STR_QUERY_SAVE_MODIFIED_ROW)));
xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
xQueryBox->set_default_response(RET_YES);
switch (xQueryBox->run())
{
case RET_NO:
shouldCommit = false;
SAL_FALLTHROUGH; // don't ask again!
case RET_YES:
needConfirmation = false;
return true;
case RET_CANCEL:
return false;
case RET_NO:
shouldCommit = false;
SAL_FALLTHROUGH; // don't ask again!
case RET_YES:
needConfirmation = false;
return true;
case RET_CANCEL:
return false;
}
}
return true;
......
......@@ -88,7 +88,7 @@
#include <ucbhelper/content.hxx>
#include <osl/time.h>
#include <vcl/msgbox.hxx>
#include <vcl/weld.hxx>
#include <osl/file.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/configmgr.hxx>
......@@ -4087,11 +4087,11 @@ void AutoRecovery::impl_showFullDiscError()
if (sBackupPath.getLength() < 1)
sBackupPath = sBackupURL;
ScopedVclPtrInstance<ErrorBox> dlgError(
nullptr, MessBoxStyle::Ok,
sMsg.replaceAll("%PATH", sBackupPath));
dlgError->SetButtonText(dlgError->GetButtonId(0), sBtn);
dlgError->Execute();
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
VclMessageType::Error, VclButtonsType::NONE,
sMsg.replaceAll("%PATH", sBackupPath)));
xBox->add_button(sBtn, RET_OK);
xBox->run();
}
void AutoRecovery::impl_establishProgress(const AutoRecovery::TDocumentInfo& rInfo ,
......
......@@ -37,6 +37,8 @@ namespace com { namespace sun { namespace star {
}
}}}
namespace weld { class Window; }
namespace sfx2
{
// For the link to receive information about the status of graphics that
......@@ -126,9 +128,9 @@ public:
static SvLinkSourceRef CreateObj( SvBaseLink const * );
void UpdateAllLinks( bool bAskUpdate,
bool bUpdateGrfLinks,
vcl::Window* pParentWin );
void UpdateAllLinks(bool bAskUpdate,
bool bUpdateGrfLinks,
weld::Window* pParentWin);
// Call for list of links (eg for link-dialog)
const SvBaseLinks& GetLinks() const { return aLinkTbl; }
......
......@@ -36,6 +36,7 @@
class Button;
class ListBox;
class MessageDialog;
class NumericFormatter;
class PopupMenu;
class SalInstanceBuilder;
......@@ -276,6 +277,8 @@ private:
std::vector< VclPtr<VclExpander> > m_aExpanderWidgets;
std::vector< VclPtr<MessageDialog> > m_aMessageDialogs;
sal_uInt16 m_nLastToolbarId;
sal_uInt16 m_nLastMenuItemId;
......
......@@ -23,6 +23,7 @@ private:
VclPtr<VclBox> m_pOwnedContentArea;
VclPtr<VclButtonBox> m_pOwnedActionArea;
VclPtr<VclGrid> m_pGrid;
VclPtr<VclVBox> m_pMessageBox;
VclPtr<FixedImage> m_pImage;
VclPtr<VclMultiLineEdit> m_pPrimaryMessage;
VclPtr<VclMultiLineEdit> m_pSecondaryMessage;
......@@ -39,7 +40,6 @@ public:
VclButtonsType eButtonsType = VclButtonsType::Ok);
MessageDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription);
virtual bool set_property(const OString& rKey, const OUString& rValue) override;
virtual short Execute() override;
OUString const& get_primary_text() const;
OUString const& get_secondary_text() const;
void set_primary_text(const OUString& rPrimaryString);
......@@ -47,6 +47,9 @@ public:
virtual ~MessageDialog() override;
virtual void dispose() override;
void create_message_area();
VclContainer* get_message_area() const { return m_pMessageBox.get(); }