Kaydet (Commit) 57488f2a authored tarafından Caolán McNamara's avatar Caolán McNamara

convert RID_WARNINGBOX_* to MessageDialog + string

Change-Id: Ic6031faa475e22ee23a6c8888987127b3caf92de
üst fd345ccf
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
#include "deployment.hrc" #include "deployment.hrc"
#include "helpid.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_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_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_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_NORMALALERT (RID_DEPLOYMENT_GUI_START + 11)
#define RID_DLG_UPDATE_ERROR (RID_DEPLOYMENT_GUI_START + 12) #define RID_DLG_UPDATE_ERROR (RID_DEPLOYMENT_GUI_START + 12)
...@@ -84,12 +84,11 @@ ...@@ -84,12 +84,11 @@
#define RID_STR_ERROR_MISSING_LICENSE (RID_DEPLOYMENT_GUI_START+97) #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_SHOW_LICENSE_CMD (RID_DEPLOYMENT_GUI_START+98)
#define RID_STR_UNSUPPORTED_PLATFORM (RID_DEPLOYMENT_GUI_START+101) #define RID_STR_UNSUPPORTED_PLATFORM (RID_DEPLOYMENT_GUI_START+101)
#define RID_WARNINGBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+102) #define RID_STR_WARNING_REMOVE_EXTENSION (RID_DEPLOYMENT_GUI_START+103)
#define RID_WARNINGBOX_REMOVE_EXTENSION (RID_DEPLOYMENT_GUI_START+103) #define RID_STR_WARNING_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104)
#define RID_WARNINGBOX_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104) #define RID_STR_WARNING_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105)
#define RID_WARNINGBOX_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105) #define RID_STR_WARNING_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106)
#define RID_WARNINGBOX_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106)
#endif #endif
......
...@@ -111,47 +111,39 @@ String RID_STR_SHOW_LICENSE_CMD ...@@ -111,47 +111,39 @@ String RID_STR_SHOW_LICENSE_CMD
Text [ en-US ] = "Show license"; Text [ en-US ] = "Show license";
}; };
WarningBox RID_WARNINGBOX_INSTALL_EXTENSION { String RID_STR_WARNING_INSTALL_EXTENSION
Buttons = WB_OK_CANCEL; {
DefButton = WB_DEF_OK; Text [en-US] = "You are about to install the extension '%NAME'.\n"
Message[en-US] = "You are about to install the extension '%NAME'.\n"
"Click 'OK' to proceed with the installation.\n" "Click 'OK' to proceed with the installation.\n"
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
}; };
WarningBox RID_WARNINGBOX_REMOVE_EXTENSION { String RID_STR_WARNING_REMOVE_EXTENSION
Buttons = WB_OK_CANCEL; {
DefButton = WB_DEF_CANCEL; Text [en-US] = "You are about to remove the extension '%NAME'.\n"
Message[en-US] = "You are about to remove the extension '%NAME'.\n"
"Click 'OK' to remove the extension.\n" "Click 'OK' to remove the extension.\n"
"Click 'Cancel' to stop removing the extension."; "Click 'Cancel' to stop removing the extension.";
}; };
WarningBox RID_WARNINGBOX_REMOVE_SHARED_EXTENSION String RID_STR_WARNING_REMOVE_SHARED_EXTENSION
{ {
Buttons = WB_OK_CANCEL; Text [en-US] = "Make sure that no further users are working with the same "
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" "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n"
"Click 'OK' to remove the extension.\n" "Click 'OK' to remove the extension.\n"
"Click 'Cancel' to stop removing the extension."; "Click 'Cancel' to stop removing the extension.";
}; };
WarningBox RID_WARNINGBOX_ENABLE_SHARED_EXTENSION String RID_STR_WARNING_ENABLE_SHARED_EXTENSION
{ {
Buttons = WB_OK_CANCEL; Text [en-US] = "Make sure that no further users are working with the same "
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" "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n"
"Click 'OK' to enable the extension.\n" "Click 'OK' to enable the extension.\n"
"Click 'Cancel' to stop enabling the extension."; "Click 'Cancel' to stop enabling the extension.";
}; };
WarningBox RID_WARNINGBOX_DISABLE_SHARED_EXTENSION String RID_STR_WARNING_DISABLE_SHARED_EXTENSION
{ {
Buttons = WB_OK_CANCEL; Text [en-US] = "Make sure that no further users are working with the same "
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" "%PRODUCTNAME, when changing shared extensions in a multi user environment.\n"
"Click 'OK' to disable the extension.\n" "Click 'OK' to disable the extension.\n"
"Click 'Cancel' to stop disabling the extension."; "Click 'Cancel' to stop disabling the extension.";
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <vcl/ctrl.hxx> #include <vcl/ctrl.hxx>
#include <vcl/menu.hxx> #include <vcl/menu.hxx>
#include <vcl/layout.hxx> #include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/scrbar.hxx> #include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -589,11 +588,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment:: ...@@ -589,11 +588,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
if ( !bHadWarning && IsSharedPkgMgr( xPackage ) ) if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
{ {
const SolarMutexGuard guard; const SolarMutexGuard guard;
WarningBox aInfoBox( pParent, getResId( nResID ) ); MessageDialog aInfoBox(pParent, getResId(nResID),
OUString aMsgText = aInfoBox.GetMessText(); VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
aMsgText = aMsgText.replaceAll(
"%PRODUCTNAME", utl::ConfigManager::getProductName());
aInfoBox.SetMessText( aMsgText );
bHadWarning = true; bHadWarning = true;
...@@ -630,15 +626,15 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle ...@@ -630,15 +626,15 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
} }
} }
bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{ {
const SolarMutexGuard guard; 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); sText = sText.replaceAll("%NAME", rExtensionName);
aInfo.SetMessText(sText); aInfo.set_primary_text(sText);
return ( RET_OK == aInfo.Execute() ); return ( RET_OK == aInfo.Execute() );
} }
...@@ -765,27 +761,25 @@ void ExtMgrDialog::prepareChecking() ...@@ -765,27 +761,25 @@ void ExtMgrDialog::prepareChecking()
m_pExtensionBox->prepareChecking(); m_pExtensionBox->prepareChecking();
} }
void ExtMgrDialog::checkEntries() void ExtMgrDialog::checkEntries()
{ {
const SolarMutexGuard guard; const SolarMutexGuard guard;
m_pExtensionBox->checkEntries(); m_pExtensionBox->checkEntries();
} }
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{ {
const SolarMutexGuard guard; 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); sText = sText.replaceAll("%NAME", rExtensionName);
aInfo.SetMessText(sText); aInfo.set_primary_text(sText);
return ( RET_OK == aInfo.Execute() ); return ( RET_OK == aInfo.Execute() );
} }
bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage, bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
bool bEnable ) bool bEnable )
{ {
...@@ -794,12 +788,12 @@ bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > & ...@@ -794,12 +788,12 @@ bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &
if ( bEnable ) 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; return false;
} }
else 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; return false;
} }
...@@ -820,7 +814,7 @@ bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > & ...@@ -820,7 +814,7 @@ bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > &
return false; 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; return false;
m_pManager->getCmdQueue()->removeExtension( xPackage ); m_pManager->getCmdQueue()->removeExtension( xPackage );
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <comphelper/anytostring.hxx> #include <comphelper/anytostring.hxx>
#include <vcl/layout.hxx> #include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include "dp_gui.h" #include "dp_gui.h"
...@@ -438,13 +437,13 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & ...@@ -438,13 +437,13 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.NewVersion, verExc.Deployed->getVersion() )) verExc.NewVersion, verExc.Deployed->getVersion() ))
{ {
case dp_misc::LESS: case dp_misc::LESS:
id = RID_WARNINGBOX_VERSION_LESS; id = RID_STR_WARNING_VERSION_LESS;
break; break;
case dp_misc::EQUAL: case dp_misc::EQUAL:
id = RID_WARNINGBOX_VERSION_EQUAL; id = RID_STR_WARNING_VERSION_EQUAL;
break; break;
default: // dp_misc::GREATER default: // dp_misc::GREATER
id = RID_WARNINGBOX_VERSION_GREATER; id = RID_STR_WARNING_VERSION_GREATER;
break; break;
} }
OSL_ASSERT( verExc.Deployed.is() ); OSL_ASSERT( verExc.Deployed.is() );
...@@ -452,24 +451,25 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & ...@@ -452,24 +451,25 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.Deployed->getDisplayName()); verExc.Deployed->getDisplayName());
{ {
SolarMutexGuard guard; 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; OUString s;
if (bEqualNames) 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 //hypothetical: requires two instances of an extension with the same
//version to have different display names. Probably the developer forgot //version to have different display names. Probably the developer forgot
//to change the version. //to change the version.
s = ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString(); 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(); 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(); s = ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
} }
...@@ -477,7 +477,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & ...@@ -477,7 +477,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName()); s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
s = s.replaceAll("$NEW", getVersion(verExc.NewVersion)); s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed)); s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
box.SetMessText(s); box.set_primary_text(s);
approve = box.Execute() == RET_OK; approve = box.Execute() == RET_OK;
abort = !approve; abort = !approve;
} }
......
...@@ -87,14 +87,4 @@ String RID_DLG_UPDATE_IGNORED_UPDATE { ...@@ -87,14 +87,4 @@ String RID_DLG_UPDATE_IGNORED_UPDATE {
Text[en-US] = "This update will be ignored.\n"; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
#include "dp_gui.hrc" #include "dp_gui.hrc"
WarningBox RID_WARNINGBOX_VERSION_LESS { String RID_STR_WARNING_VERSION_LESS
Buttons = WB_OK_CANCEL; {
DefButton = WB_DEF_CANCEL; Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
"The newer version $DEPLOYED is already installed.\n" "The newer version $DEPLOYED is already installed.\n"
"Click 'OK' to replace the installed extension.\n" "Click 'OK' to replace the installed extension.\n"
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
...@@ -35,10 +34,9 @@ String RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES { ...@@ -35,10 +34,9 @@ String RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES {
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
}; };
WarningBox RID_WARNINGBOX_VERSION_EQUAL { String RID_STR_WARNING_VERSION_EQUAL
Buttons = WB_OK_CANCEL; {
DefButton = WB_DEF_CANCEL; Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
"That version is already installed.\n" "That version is already installed.\n"
"Click 'OK' to replace the installed extension.\n" "Click 'OK' to replace the installed extension.\n"
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
...@@ -51,17 +49,17 @@ String RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES { ...@@ -51,17 +49,17 @@ String RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES {
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
}; };
WarningBox RID_WARNINGBOX_VERSION_GREATER { String RID_STR_WARNING_VERSION_GREATER
Buttons = WB_OK_CANCEL; {
DefButton = WB_DEF_OK; Text [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
Message[en-US] = "You are about to install version $NEW of the extension '$NAME'.\n"
"The older version $DEPLOYED is already installed.\n" "The older version $DEPLOYED is already installed.\n"
"Click 'OK' to replace the installed extension.\n" "Click 'OK' to replace the installed extension.\n"
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
}; };
String RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES { String RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES
TEXT [en-US] = "You are about to install version $NEW of the extension '$NAME'.\n" {
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" "The older version $DEPLOYED, named '$OLDNAME', is already installed.\n"
"Click 'OK' to replace the installed extension.\n" "Click 'OK' to replace the installed extension.\n"
"Click 'Cancel' to stop the installation."; "Click 'Cancel' to stop the installation.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment