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 @@
#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)
......@@ -85,11 +85,10 @@
#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_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
......
......@@ -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.";
......
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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: */
......@@ -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.";
......
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