summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-08-23 09:51:25 +0000
committerOliver-Rainer Wittmann <orw@apache.org>2013-08-23 09:51:25 +0000
commited13d17d8849705ba9f629cb813deaa8db7d5419 (patch)
tree2a74d446c2f95297d0d5bbe143ac6828b50f543f /desktop
parentc68c57a1e021ebef7fb79fd0b4d3ab21dcaf41b2 (diff)
122976: suppress user interaction on install of already installed extension during the 'silent' installation of the so-called bundled extensions and during the migration of extensions from a former user profile
Notes
Notes: ignore: obsolete
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_handleversionexception.cxx67
-rwxr-xr-xdesktop/source/inc/dp_gui_handleversionexception.hxx5
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx5
4 files changed, 48 insertions, 34 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index bd2cb86e0aa6..6689f0498c18 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -801,8 +801,9 @@ void MinimalCommandEnv::handle(
css::deployment::VersionException verExc;
if ( xRequest->getRequest() >>= verExc )
{
- // user interaction, if an extension is already been installed.
- bApprove = handleVersionException( verExc );
+ // choose newest version, if an extension is already been installed.
+ const bool bChooseNewestVersion = true;
+ bApprove = handleVersionException( verExc, 0, bChooseNewestVersion );
}
const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > conts( xRequest->getContinuations());
diff --git a/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx b/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
index 624ab45123b3..56d00f320884 100644
--- a/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
+++ b/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
@@ -53,7 +53,8 @@ extern "C" {
bool handleVersionException(
com::sun::star::deployment::VersionException verExc,
- DialogHelper* pDialogHelper )
+ DialogHelper* pDialogHelper,
+ const bool bChooseNewestVersion )
{
bool bApprove = false;
@@ -72,37 +73,45 @@ bool handleVersionException(
break;
}
OSL_ASSERT( verExc.Deployed.is() );
- const bool bEqualNames = verExc.NewDisplayName.equals(
- verExc.Deployed->getDisplayName());
+
+ if ( bChooseNewestVersion )
{
- vos::OGuard guard(Application::GetSolarMutex());
- WarningBox box( pDialogHelper ? pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
- String s;
- if (bEqualNames)
- {
- s = box.GetMessText();
- }
- else if (id == RID_WARNINGBOX_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 = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
- }
- else if (id == RID_WARNINGBOX_VERSION_LESS)
- {
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
- }
- else if (id == RID_WARNINGBOX_VERSION_GREATER)
+ bApprove = id == RID_WARNINGBOX_VERSION_GREATER;
+ }
+ else
+ {
+ const bool bEqualNames = verExc.NewDisplayName.equals(
+ verExc.Deployed->getDisplayName());
{
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ vos::OGuard guard(Application::GetSolarMutex());
+ WarningBox box( pDialogHelper ? pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
+ String s;
+ if (bEqualNames)
+ {
+ s = box.GetMessText();
+ }
+ else if (id == RID_WARNINGBOX_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 = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ else if (id == RID_WARNINGBOX_VERSION_LESS)
+ {
+ s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ else if (id == RID_WARNINGBOX_VERSION_GREATER)
+ {
+ s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
+ s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
+ s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
+ s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
+ box.SetMessText(s);
+ bApprove = box.Execute() == RET_OK;
}
- s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
- s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
- s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
- s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
- box.SetMessText(s);
- bApprove = box.Execute() == RET_OK;
}
return bApprove;
diff --git a/desktop/source/inc/dp_gui_handleversionexception.hxx b/desktop/source/inc/dp_gui_handleversionexception.hxx
index 32272aaeaef4..2a4fd50cc7e4 100755
--- a/desktop/source/inc/dp_gui_handleversionexception.hxx
+++ b/desktop/source/inc/dp_gui_handleversionexception.hxx
@@ -30,10 +30,13 @@ namespace dp_gui{ class DialogHelper; }
extern "C" {
+ // optional parameter <bChooseNewestVersion> indicates, if
+ // the newest version is chosen without user interaction.
DESKTOP_DEPLOYMENTGUI_DLLPUBLIC
bool handleVersionException(
com::sun::star::deployment::VersionException verExc,
- dp_gui::DialogHelper* pDialogHelper = 0 );
+ dp_gui::DialogHelper* pDialogHelper = 0,
+ const bool bChooseNewestVersion = false );
}
#endif
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 03dd9515a463..795d01fcc1b7 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -530,8 +530,9 @@ void TmpRepositoryCommandEnv::handle(
deployment::VersionException verExc;
if ( xRequest->getRequest() >>= verExc )
{
- // user interaction, if an extension is already been installed.
- approve = handleVersionException( verExc );
+ // choose newest version, if an extension is already been installed.
+ const bool bChooseNewestVersion = true;
+ approve = handleVersionException( verExc, 0, bChooseNewestVersion );
abort = !approve;
}