openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1516808 - in /openoffice/branches/AOO401: ./ main/desktop/source/app/ main/desktop/source/deployment/gui/ main/desktop/source/inc/ main/desktop/source/migration/services/
Date Fri, 23 Aug 2013 10:25:47 GMT
Author: orw
Date: Fri Aug 23 10:25:46 2013
New Revision: 1516808

URL: http://svn.apache.org/r1516808
Log:
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

        cherry-picked from trunk


Modified:
    openoffice/branches/AOO401/   (props changed)
    openoffice/branches/AOO401/main/desktop/source/app/app.cxx
    openoffice/branches/AOO401/main/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
    openoffice/branches/AOO401/main/desktop/source/inc/dp_gui_handleversionexception.hxx
    openoffice/branches/AOO401/main/desktop/source/migration/services/oo3extensionmigration.cxx

Propchange: openoffice/branches/AOO401/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1516794

Modified: openoffice/branches/AOO401/main/desktop/source/app/app.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/desktop/source/app/app.cxx?rev=1516808&r1=1516807&r2=1516808&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/desktop/source/app/app.cxx (original)
+++ openoffice/branches/AOO401/main/desktop/source/app/app.cxx Fri Aug 23 10:25:46 2013
@@ -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());

Modified: openoffice/branches/AOO401/main/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx?rev=1516808&r1=1516807&r2=1516808&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
(original)
+++ openoffice/branches/AOO401/main/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
Fri Aug 23 10:25:46 2013
@@ -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;

Modified: openoffice/branches/AOO401/main/desktop/source/inc/dp_gui_handleversionexception.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/desktop/source/inc/dp_gui_handleversionexception.hxx?rev=1516808&r1=1516807&r2=1516808&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/desktop/source/inc/dp_gui_handleversionexception.hxx (original)
+++ openoffice/branches/AOO401/main/desktop/source/inc/dp_gui_handleversionexception.hxx Fri
Aug 23 10:25:46 2013
@@ -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

Modified: openoffice/branches/AOO401/main/desktop/source/migration/services/oo3extensionmigration.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/desktop/source/migration/services/oo3extensionmigration.cxx?rev=1516808&r1=1516807&r2=1516808&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/desktop/source/migration/services/oo3extensionmigration.cxx
(original)
+++ openoffice/branches/AOO401/main/desktop/source/migration/services/oo3extensionmigration.cxx
Fri Aug 23 10:25:46 2013
@@ -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;
     }
 



Mime
View raw message