diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-18 08:50:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-18 10:57:21 +0100 |
commit | a107bdfdfc1baf73f14055262d64bf616fc0a889 (patch) | |
tree | 2e4cbadd538f5e8d495fb8953a5a7939c8ab2bb5 /sfx2 | |
parent | 3b6091ca42cd2d9f230e7d81648c34f3d7085107 (diff) |
ErrorBox->MessageDialog
Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 32 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 10 |
5 files changed, 32 insertions, 33 deletions
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 6da226519c48..81f960b6040d 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -#include <vcl/msgbox.hxx> +#include <vcl/layout.hxx> #include <sfx2/linkmgr.hxx> #include <vcl/svapp.hxx> #include "app.hrc" @@ -505,7 +505,7 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName ) else return false; - ErrorBox( pImpl->m_pParentWin, WB_OK, sError ).Execute(); + MessageDialog(pImpl->m_pParentWin, sError).Execute(); } } else if( !pImpl->m_bIsConnect ) diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7a1f1756a0a6..94ed20d45e3b 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -53,7 +53,7 @@ #include <osl/file.hxx> #include <unotools/bootstrap.hxx> #include <rtl/uri.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/layout.hxx> #include <svtools/ehdl.hxx> #include <svtools/sfxecode.hxx> @@ -76,7 +76,7 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::system; -class NoHelpErrorBox : public ErrorBox +class NoHelpErrorBox : public MessageDialog { public: NoHelpErrorBox( Window* _pParent ); @@ -84,9 +84,8 @@ public: virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; }; -NoHelpErrorBox::NoHelpErrorBox( Window* _pParent ) : - - ErrorBox( _pParent, WB_OK, SfxResId( RID_STR_HLPFILENOTEXIST ).toString() ) +NoHelpErrorBox::NoHelpErrorBox( Window* _pParent ) + : MessageDialog(_pParent, SfxResId(RID_STR_HLPFILENOTEXIST)) { // Error message: "No help available" } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 3dcfd32be36f..20395ea87b68 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -333,7 +333,7 @@ void SfxObjectShell::CheckOut( ) } catch ( const uno::RuntimeException& e ) { - ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + MessageDialog* pErrorBox = new MessageDialog( &GetFrame()->GetWindow(), e.Message ); pErrorBox->Execute( ); delete pErrorBox; } @@ -352,7 +352,7 @@ void SfxObjectShell::CancelCheckOut( ) } catch ( const uno::RuntimeException& e ) { - ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); delete pErrorBox; } @@ -377,7 +377,7 @@ void SfxObjectShell::CheckIn( ) } catch ( const uno::RuntimeException& e ) { - ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); delete pErrorBox; } @@ -392,7 +392,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( ) } catch ( const uno::RuntimeException& e ) { - ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + MessageDialog* pErrorBox = new MessageDialog(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); delete pErrorBox; } @@ -1465,7 +1465,7 @@ void SfxObjectShell::ImplSign( bool bScriptingContent ) } else { - ErrorBox( NULL, WB_OK, SfxResId(STR_XMLSEC_ODF12_EXPECTED).toString() ).Execute(); + MessageDialog(NULL, SfxResId(STR_XMLSEC_ODF12_EXPECTED)).Execute(); return; } diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 019fa7e9a81d..2cf0516d5dee 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -38,7 +38,7 @@ #include <unotools/pathoptions.hxx> #include <unotools/viewoptions.hxx> #include <vcl/edit.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/layout.hxx> #include <vcl/toolbox.hxx> #include <com/sun/star/beans/PropertyValue.hpp> @@ -622,7 +622,7 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu) { OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString()); aMsg = aMsg.replaceFirst("$1",pPlace->GetName()); - ErrorBox(this,WB_OK,aMsg).Execute(); + MessageDialog(this, aMsg).Execute(); } } } @@ -933,7 +933,7 @@ void SfxTemplateManagerDlg::OnTemplateImport () { OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString()); aMsg = aMsg.replaceFirst("$1",pFolder->maTitle); - ErrorBox(this,WB_OK,aMsg.replaceFirst("$2",aTemplateList)); + MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList)); } } } @@ -956,7 +956,7 @@ void SfxTemplateManagerDlg::OnTemplateImport () { OUString aMsg(SfxResId(STR_MSG_ERROR_IMPORT).toString()); aMsg = aMsg.replaceFirst("$1",mpLocalView->getCurRegionName()); - ErrorBox(this,WB_OK,aMsg.replaceFirst("$2",aTemplateList)); + MessageDialog(this, aMsg.replaceFirst("$2",aTemplateList)); } } @@ -1045,7 +1045,7 @@ void SfxTemplateManagerDlg::OnTemplateExport() if (!aTemplateList.isEmpty()) { OUString aText( SfxResId(STR_MSG_ERROR_EXPORT).toString() ); - ErrorBox(this, WB_OK,aText.replaceFirst("$1",aTemplateList)).Execute(); + MessageDialog(this, aText.replaceFirst("$1",aTemplateList)).Execute(); } } } @@ -1158,7 +1158,7 @@ void SfxTemplateManagerDlg::OnTemplateProperties () void SfxTemplateManagerDlg::OnTemplateDelete () { - QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE).toString()); + MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( aQueryDlg.Execute() == RET_NO ) return; @@ -1207,7 +1207,7 @@ void SfxTemplateManagerDlg::OnTemplateDelete () if (!aTemplateList.isEmpty()) { OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_TEMPLATE).toString() ); - ErrorBox(this, WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute(); + MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute(); } } @@ -1243,7 +1243,7 @@ void SfxTemplateManagerDlg::OnFolderNew() void SfxTemplateManagerDlg::OnFolderDelete() { - QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, SfxResId(STR_QMSG_SEL_FOLDER_DELETE).toString()); + MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( aQueryDlg.Execute() == RET_NO ) return; @@ -1271,7 +1271,7 @@ void SfxTemplateManagerDlg::OnFolderDelete() if (!aFolderList.isEmpty()) { OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_FOLDER).toString() ); - ErrorBox(this, WB_OK,aMsg.replaceFirst("$1",aFolderList)).Execute(); + MessageDialog(this, aMsg.replaceFirst("$1",aFolderList)).Execute(); } } @@ -1292,7 +1292,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() if (!mpLocalView->isNonRootRegionVisible() && maSelFolders.empty()) { - ErrorBox(this, WB_OK,SfxResId(STR_MSG_ERROR_SELECT_FOLDER).toString()).Execute(); + MessageDialog(this, SfxResId(STR_MSG_ERROR_SELECT_FOLDER)).Execute(); return; } @@ -1306,7 +1306,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() { OUString aFolderList; OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString()); - QueryBox aQueryDlg(this,WB_YES_NO | WB_DEF_YES, OUString()); + MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if (mpLocalView->isNonRootRegionVisible()) { @@ -1315,7 +1315,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName)) { aQMsg = aQMsg.replaceFirst("$1",aName); - aQueryDlg.SetMessText(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName())); + aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName())); if (aQueryDlg.Execute() == RET_NO) return; @@ -1334,7 +1334,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName)) { OUString aDQMsg = aQMsg.replaceFirst("$1",aName); - aQueryDlg.SetMessText(aDQMsg.replaceFirst("$2",pItem->maTitle)); + aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle)); if (aQueryDlg.Execute() == RET_NO) continue; @@ -1471,7 +1471,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId) OUString aDst = mpLocalView->getRegionItemName(nItemId); OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",aDst); - ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute(); + MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute(); } } } @@ -1525,7 +1525,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId) OUString aMsg(SfxResId(STR_MSG_ERROR_REMOTE_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",mpRemoteView->getCurRegionName()); aMsg = aMsg.replaceFirst("$2",mpLocalView->getRegionItemName(nItemId)); - ErrorBox(this,WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute(); + MessageDialog(this, aMsg.replaceFirst("$1",aTemplateList)).Execute(); } } } @@ -1581,7 +1581,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId) OUString aDst = mpLocalView->getRegionItemName(nItemId); OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",aDst); - ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute(); + MessageDialog(this, aMsg.replaceFirst( "$2",aTemplateList)).Execute(); } } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 7ef21f9582cc..362c8199e5d4 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/view/XRenderable.hpp> #include <svl/itempool.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/layout.hxx> #include <svtools/prnsetup.hxx> #include <svl/flagitem.hxx> #include <svl/stritem.hxx> @@ -345,7 +345,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt // "real" problem (not simply printing cancelled by user) OUString aMsg( SfxResId(STR_NOSTARTPRINTER).toString() ); if ( !m_bApi ) - ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK, aMsg ).Execute(); + MessageDialog(mpViewShell->GetWindow(), aMsg).Execute(); // intentionally no break } case view::PrintableState_JOB_ABORTED : @@ -524,7 +524,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) // Ask if possible, if page format should be taken over from printer. if ( ( bOriChg || bPgSzChg ) && - RET_YES == QueryBox(0, WB_YES_NO | WB_DEF_OK, aMsg).Execute() ) + RET_YES == MessageDialog(NULL, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() ) { // Flags with changes for <SetPrinter(SfxPrinter*)> are maintained nChangedFlags |= nNewOpt; @@ -786,7 +786,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { // no valid printer either in ItemSet or at the document if ( !bSilent ) - ErrorBox( NULL, WB_OK | WB_DEF_OK, SfxResId(STR_NODEFPRINTER).toString() ).Execute(); + MessageDialog(NULL, SfxResId(STR_NODEFPRINTER)).Execute(); rReq.SetReturnValue(SfxBoolItem(0,false)); @@ -798,7 +798,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { // if printer is busy, abort configuration if ( !bSilent ) - InfoBox( NULL, SfxResId(STR_ERROR_PRINTER_BUSY).toString() ).Execute(); + MessageDialog(NULL, SfxResId(STR_ERROR_PRINTER_BUSY), VCL_MESSAGE_INFO).Execute(); rReq.SetReturnValue(SfxBoolItem(0,false)); return; |