diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-25 15:11:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-25 16:45:29 +0100 |
commit | 57488f2a10ad7a40bfed6e02024aea8d3d1bf493 (patch) | |
tree | ca8826ce0dd1e2e5ee930a4123d659f2409088c2 /desktop | |
parent | fd345ccfafcc0deb3c2840f03f4cea839886f23c (diff) |
convert RID_WARNINGBOX_* to MessageDialog + string
Change-Id: Ic6031faa475e22ee23a6c8888987127b3caf92de
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui.hrc | 19 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog.src | 32 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 32 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 20 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updatedialog.src | 10 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_versionboxes.src | 26 |
6 files changed, 56 insertions, 83 deletions
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc index a9e469dc67d9..7ccd459ad380 100644 --- a/desktop/source/deployment/gui/dp_gui.hrc +++ b/desktop/source/deployment/gui/dp_gui.hrc @@ -23,13 +23,13 @@ #include "deployment.hrc" #include "helpid.hrc" -#define RID_WARNINGBOX_VERSION_LESS (RID_DEPLOYMENT_GUI_START + 3) +#define RID_STR_WARNING_VERSION_LESS (RID_DEPLOYMENT_GUI_START + 3) #define RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES (RID_DEPLOYMENT_GUI_START + 4) -#define RID_WARNINGBOX_VERSION_EQUAL (RID_DEPLOYMENT_GUI_START + 5) +#define RID_STR_WARNING_VERSION_EQUAL (RID_DEPLOYMENT_GUI_START + 5) #define RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES (RID_DEPLOYMENT_GUI_START + 6) -#define RID_WARNINGBOX_VERSION_GREATER (RID_DEPLOYMENT_GUI_START + 7) +#define RID_STR_WARNING_VERSION_GREATER (RID_DEPLOYMENT_GUI_START + 7) #define RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES (RID_DEPLOYMENT_GUI_START + 8) -#define RID_WARNINGBOX_INSTALL_EXTENSION (RID_DEPLOYMENT_GUI_START + 9) +#define RID_STR_WARNING_INSTALL_EXTENSION (RID_DEPLOYMENT_GUI_START + 9) #define RID_DLG_UPDATE_NORMALALERT (RID_DEPLOYMENT_GUI_START + 11) #define RID_DLG_UPDATE_ERROR (RID_DEPLOYMENT_GUI_START + 12) @@ -84,12 +84,11 @@ #define RID_STR_ERROR_MISSING_LICENSE (RID_DEPLOYMENT_GUI_START+97) #define RID_STR_SHOW_LICENSE_CMD (RID_DEPLOYMENT_GUI_START+98) -#define RID_STR_UNSUPPORTED_PLATFORM (RID_DEPLOYMENT_GUI_START+101) -#define RID_WARNINGBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+102) -#define RID_WARNINGBOX_REMOVE_EXTENSION (RID_DEPLOYMENT_GUI_START+103) -#define RID_WARNINGBOX_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104) -#define RID_WARNINGBOX_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105) -#define RID_WARNINGBOX_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106) +#define RID_STR_UNSUPPORTED_PLATFORM (RID_DEPLOYMENT_GUI_START+101) +#define RID_STR_WARNING_REMOVE_EXTENSION (RID_DEPLOYMENT_GUI_START+103) +#define RID_STR_WARNING_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104) +#define RID_STR_WARNING_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105) +#define RID_STR_WARNING_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106) #endif diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src index e328acee0de7..ae85a1d247d5 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog.src +++ b/desktop/source/deployment/gui/dp_gui_dialog.src @@ -111,47 +111,39 @@ String RID_STR_SHOW_LICENSE_CMD Text [ en-US ] = "Show license"; }; -WarningBox RID_WARNINGBOX_INSTALL_EXTENSION { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_OK; - Message[en-US] = "You are about to install the extension '%NAME'.\n" +String RID_STR_WARNING_INSTALL_EXTENSION +{ + Text [en-US] = "You are about to install the extension '%NAME'.\n" "Click 'OK' to proceed with the installation.\n" "Click 'Cancel' to stop the installation."; }; -WarningBox RID_WARNINGBOX_REMOVE_EXTENSION { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "You are about to remove the extension '%NAME'.\n" +String RID_STR_WARNING_REMOVE_EXTENSION +{ + Text [en-US] = "You are about to remove the extension '%NAME'.\n" "Click 'OK' to remove the extension.\n" "Click 'Cancel' to stop removing the extension."; }; -WarningBox RID_WARNINGBOX_REMOVE_SHARED_EXTENSION +String RID_STR_WARNING_REMOVE_SHARED_EXTENSION { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "Make sure that no further users are working with the same " + Text [en-US] = "Make sure that no further users are working with the same " "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n" "Click 'OK' to remove the extension.\n" "Click 'Cancel' to stop removing the extension."; }; -WarningBox RID_WARNINGBOX_ENABLE_SHARED_EXTENSION +String RID_STR_WARNING_ENABLE_SHARED_EXTENSION { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "Make sure that no further users are working with the same " + Text [en-US] = "Make sure that no further users are working with the same " "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n" "Click 'OK' to enable the extension.\n" "Click 'Cancel' to stop enabling the extension."; }; -WarningBox RID_WARNINGBOX_DISABLE_SHARED_EXTENSION +String RID_STR_WARNING_DISABLE_SHARED_EXTENSION { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "Make sure that no further users are working with the same " + Text [en-US] = "Make sure that no further users are working with the same " "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n" "Click 'OK' to disable the extension.\n" "Click 'Cancel' to stop disabling the extension."; diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 37769f9b93e9..e5ba333ff85d 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -36,7 +36,6 @@ #include <vcl/ctrl.hxx> #include <vcl/menu.hxx> #include <vcl/layout.hxx> -#include <vcl/msgbox.hxx> #include <vcl/scrbar.hxx> #include <vcl/svapp.hxx> @@ -589,11 +588,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment:: if ( !bHadWarning && IsSharedPkgMgr( xPackage ) ) { const SolarMutexGuard guard; - WarningBox aInfoBox( pParent, getResId( nResID ) ); - OUString aMsgText = aInfoBox.GetMessText(); - aMsgText = aMsgText.replaceAll( - "%PRODUCTNAME", utl::ConfigManager::getProductName()); - aInfoBox.SetMessText( aMsgText ); + MessageDialog aInfoBox(pParent, getResId(nResID), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); bHadWarning = true; @@ -630,15 +626,15 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle } } - bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) ); + MessageDialog aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); - OUString sText(aInfo.GetMessText()); + OUString sText(aInfo.get_primary_text()); sText = sText.replaceAll("%NAME", rExtensionName); - aInfo.SetMessText(sText); + aInfo.set_primary_text(sText); return ( RET_OK == aInfo.Execute() ); } @@ -765,27 +761,25 @@ void ExtMgrDialog::prepareChecking() m_pExtensionBox->prepareChecking(); } - void ExtMgrDialog::checkEntries() { const SolarMutexGuard guard; m_pExtensionBox->checkEntries(); } - bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_REMOVE_EXTENSION ) ); + MessageDialog aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); - OUString sText(aInfo.GetMessText()); + OUString sText(aInfo.get_primary_text()); sText = sText.replaceAll("%NAME", rExtensionName); - aInfo.SetMessText(sText); + aInfo.set_primary_text(sText); return ( RET_OK == aInfo.Execute() ); } - bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage, bool bEnable ) { @@ -794,12 +788,12 @@ bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > & if ( bEnable ) { - if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) ) + if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) ) return false; } else { - if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) ) + if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) ) return false; } @@ -820,7 +814,7 @@ bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > & return false; } - if ( ! continueOnSharedExtension( xPackage, this, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) ) + if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) ) return false; m_pManager->getCmdQueue()->removeExtension( xPackage ); diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index 51dfdb47d4c6..86a3056ef666 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -62,7 +62,6 @@ #include <cppuhelper/implbase3.hxx> #include <comphelper/anytostring.hxx> #include <vcl/layout.hxx> -#include <vcl/msgbox.hxx> #include <toolkit/helper/vclunohelper.hxx> #include "dp_gui.h" @@ -438,13 +437,13 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & verExc.NewVersion, verExc.Deployed->getVersion() )) { case dp_misc::LESS: - id = RID_WARNINGBOX_VERSION_LESS; + id = RID_STR_WARNING_VERSION_LESS; break; case dp_misc::EQUAL: - id = RID_WARNINGBOX_VERSION_EQUAL; + id = RID_STR_WARNING_VERSION_EQUAL; break; default: // dp_misc::GREATER - id = RID_WARNINGBOX_VERSION_GREATER; + id = RID_STR_WARNING_VERSION_GREATER; break; } OSL_ASSERT( verExc.Deployed.is() ); @@ -452,24 +451,25 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & verExc.Deployed->getDisplayName()); { SolarMutexGuard guard; - WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get())); + MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, + ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); OUString s; if (bEqualNames) { - s = box.GetMessText(); + s = box.get_primary_text(); } - else if (id == RID_WARNINGBOX_VERSION_EQUAL) + else if (id == RID_STR_WARNING_VERSION_EQUAL) { //hypothetical: requires two instances of an extension with the same //version to have different display names. Probably the developer forgot //to change the version. s = ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString(); } - else if (id == RID_WARNINGBOX_VERSION_LESS) + else if (id == RID_STR_WARNING_VERSION_LESS) { s = ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString(); } - else if (id == RID_WARNINGBOX_VERSION_GREATER) + else if (id == RID_STR_WARNING_VERSION_GREATER) { s = ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString(); } @@ -477,7 +477,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName()); s = s.replaceAll("$NEW", getVersion(verExc.NewVersion)); s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed)); - box.SetMessText(s); + box.set_primary_text(s); approve = box.Execute() == RET_OK; abort = !approve; } diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src index aac2f888fbd4..6cead510c54b 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.src +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src @@ -87,14 +87,4 @@ String RID_DLG_UPDATE_IGNORED_UPDATE { Text[en-US] = "This update will be ignored.\n"; }; -WarningBox RID_WARNINGBOX_UPDATE_SHARED_EXTENSION -{ - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "Make sure that no further users are working with the same " - "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n" - "Click 'OK' to update the extensions.\n" - "Click 'Cancel' to stop updating the extensions."; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/deployment/gui/dp_gui_versionboxes.src b/desktop/source/deployment/gui/dp_gui_versionboxes.src index 8ef810c99322..7e18fa6ae53d 100644 --- a/desktop/source/deployment/gui/dp_gui_versionboxes.src +++ b/desktop/source/deployment/gui/dp_gui_versionboxes.src @@ -19,10 +19,9 @@ #include "dp_gui.hrc" -WarningBox RID_WARNINGBOX_VERSION_LESS { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" +String RID_STR_WARNING_VERSION_LESS +{ + Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" "The newer version $DEPLOYED is already installed.\n" "Click 'OK' to replace the installed extension.\n" "Click 'Cancel' to stop the installation."; @@ -35,10 +34,9 @@ String RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES { "Click 'Cancel' to stop the installation."; }; -WarningBox RID_WARNINGBOX_VERSION_EQUAL { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_CANCEL; - Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" +String RID_STR_WARNING_VERSION_EQUAL +{ + Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" "That version is already installed.\n" "Click 'OK' to replace the installed extension.\n" "Click 'Cancel' to stop the installation."; @@ -51,17 +49,17 @@ String RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES { "Click 'Cancel' to stop the installation."; }; -WarningBox RID_WARNINGBOX_VERSION_GREATER { - Buttons = WB_OK_CANCEL; - DefButton = WB_DEF_OK; - Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" +String RID_STR_WARNING_VERSION_GREATER +{ + Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" "The older version $DEPLOYED is already installed.\n" "Click 'OK' to replace the installed extension.\n" "Click 'Cancel' to stop the installation."; }; -String RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES { - TEXT [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" +String RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES +{ + Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" "The older version $DEPLOYED, named '$OLDNAME', is already installed.\n" "Click 'OK' to replace the installed extension.\n" "Click 'Cancel' to stop the installation."; |