Author: hdu
Date: Tue Mar  6 12:49:02 2012
New Revision: 1297453

URL: http://svn.apache.org/viewvc?rev=1297453&view=rev
Log:
fix FirstStart without its WizardUI

Modified:
    incubator/ooo/trunk/main/desktop/inc/app.hxx
    incubator/ooo/trunk/main/desktop/source/app/app.cxx
    incubator/ooo/trunk/main/desktop/source/app/appfirststart.cxx
    incubator/ooo/trunk/main/desktop/source/migration/wizard.cxx
    incubator/ooo/trunk/main/desktop/source/migration/wizard.hxx

Modified: incubator/ooo/trunk/main/desktop/inc/app.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/inc/app.hxx?rev=1297453&r1=1297452&r2=1297453&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/inc/app.hxx (original)
+++ incubator/ooo/trunk/main/desktop/inc/app.hxx Tue Mar  6 12:49:02 2012
@@ -131,6 +131,8 @@ class Desktop : public Application
         static sal_Bool         LicenseNeedsAcceptance();
         static sal_Bool         IsFirstStartWizardNeeded();
         static sal_Bool         CheckExtensionDependencies();
+        static void             EnableQuickstart();
+        static void             FinishFirstStart();
 
         static void             DoRestartActionsIfNecessary( sal_Bool 
bQuickStart );
         static void             SetRestartState();

Modified: incubator/ooo/trunk/main/desktop/source/app/app.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/app.cxx?rev=1297453&r1=1297452&r2=1297453&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/app.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/app.cxx Tue Mar  6 12:49:02 2012
@@ -1838,9 +1838,6 @@ void Desktop::Main()
         tools::InitTestToolLib();
         RTL_LOGFILE_CONTEXT_TRACE( aLog, "} tools::InitTestToolLib" );
 
-        // process non-pre-registered extensions
-        installBundledExtensionBlobs();
-
         // Check if bundled or shared extensions were added /removed
         // and process those extensions (has to be done before checking
         // the extension dependencies!
@@ -1882,6 +1879,12 @@ void Desktop::Main()
                         return;
                     }
 #endif // license acceptance is not needed for ASL
+
+                   // process non-pre-registered extensions
+                   installBundledExtensionBlobs();
+
+                   // mark first start as done
+                   FinishFirstStart();
                 }
             }
 

Modified: incubator/ooo/trunk/main/desktop/source/app/appfirststart.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/appfirststart.cxx?rev=1297453&r1=1297452&r2=1297453&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/appfirststart.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/appfirststart.cxx Tue Mar  6 
12:49:02 2012
@@ -106,24 +106,8 @@ OUString Desktop::GetLicensePath()
 /* Check if we need to accept license. */
 sal_Bool Desktop::LicenseNeedsAcceptance()
 {
-    // Don't show a license
+    // permissive licences like ALv2 don't need end user license approval
     return sal_False;
-/*
-    sal_Bool bShowLicense = sal_True;
-    sal_Int32 nOpenSourceContext = 0;
-    try
-    {
-        ::utl::ConfigManager::GetDirectConfigProperty(
-            ::utl::ConfigManager::OPENSOURCECONTEXT ) >>= nOpenSourceContext;
-    }
-    catch( const ::com::sun::star::uno::Exception& ) {}
-
-    // open source needs no license
-    if ( nOpenSourceContext > 0 )
-        bShowLicense = sal_False;
-
-    return bShowLicense;
-*/
 }
 
 /* Local function - get access to the configuration */
@@ -264,6 +248,46 @@ sal_Bool Desktop::IsFirstStartWizardNeed
     return impl_isFirstStart() || !impl_isLicenseAccepted();
 }
 
+void Desktop::FinishFirstStart()
+{
+#if 0 // most platforms no longer benefit from the quickstarter, TODO: are the 
other benefits worth it?
+#ifndef OS2 // cannot enable quickstart on first startup, see shutdownicon.cxx 
comments.
+        EnableQuickstart();
+#endif
+#endif
+
+    try {
+        Reference < XMultiServiceFactory > xFactory = 
::comphelper::getProcessServiceFactory();
+        // get configuration provider
+        Reference< XMultiServiceFactory > theConfigProvider = Reference< 
XMultiServiceFactory >(
+        xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+        Sequence< Any > theArgs(1);
+        NamedValue v(OUString::createFromAscii("NodePath"), 
+            makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
+        theArgs[0] <<= v;
+        Reference< XPropertySet > pset = Reference< XPropertySet >(
+            theConfigProvider->createInstanceWithArguments(sAccessSrvc, 
theArgs), UNO_QUERY_THROW);
+        pset->setPropertyValue( OUString( 
RTL_CONSTASCII_USTRINGPARAM("FirstStartWizardCompleted")), makeAny(sal_True));
+        Reference< util::XChangesBatch >(pset, 
UNO_QUERY_THROW)->commitChanges();
+    } catch (const uno::Exception&) {
+        // ignore the exception as it is not critical enough to prevent office 
from starting
+    }
+}
+
+void Desktop::EnableQuickstart()
+{
+    sal_Bool bQuickstart( sal_True );
+    sal_Bool bAutostart( sal_True );
+    Sequence< Any > aSeq( 2 );
+    aSeq[0] <<= bQuickstart;
+    aSeq[1] <<= bAutostart;
+
+    Reference < XInitialization > xQuickstart( 
::comphelper::getProcessServiceFactory()->createInstance(
+        OUString( 
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.Quickstart"))), UNO_QUERY );
+    if ( xQuickstart.is() )
+        xQuickstart->initialize( aSeq );
+}
+
 void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
 {
     if ( bQuickStart )
@@ -311,4 +335,3 @@ void Desktop::SetRestartState()
     }
 
 }
-

Modified: incubator/ooo/trunk/main/desktop/source/migration/wizard.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/migration/wizard.cxx?rev=1297453&r1=1297452&r2=1297453&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/migration/wizard.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/migration/wizard.cxx Tue Mar  6 
12:49:02 2012
@@ -360,17 +360,7 @@ sal_Bool FirstStartWizard::leaveState(Wi
 
 sal_Bool FirstStartWizard::onFinish()
 {
-    // return sal_True;
-    if ( svt::RoadmapWizard::onFinish() )
-    {
-#ifndef OS2 // cannot enable quickstart on first startup, see shutdownicon.cxx 
comments.
-        enableQuickstart();
-#endif
-        disableWizard();
-        return sal_True;
-    } 
-    else
-        return sal_False;
+    return svt::RoadmapWizard::onFinish();
 }
 
 short FirstStartWizard::Execute()
@@ -512,44 +502,6 @@ void FirstStartWizard::cleanOldOfficeReg
 #endif
 }
 
-void FirstStartWizard::disableWizard()
-{
-
-    try {
-        Reference < XMultiServiceFactory > xFactory = 
::comphelper::getProcessServiceFactory();
-        // get configuration provider
-        Reference< XMultiServiceFactory > theConfigProvider = Reference< 
XMultiServiceFactory >(
-        xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
-        Sequence< Any > theArgs(1);
-        NamedValue v(OUString::createFromAscii("NodePath"), 
-            makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
-        theArgs[0] <<= v;
-        Reference< XPropertySet > pset = Reference< XPropertySet >(
-            theConfigProvider->createInstanceWithArguments(sAccessSrvc, 
theArgs), UNO_QUERY_THROW);
-        
pset->setPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"), 
makeAny(sal_True));
-        Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges();
-    } catch (const Exception&)
-    {
-    }
-
-}
-
-
-void FirstStartWizard::enableQuickstart()
-{
-    sal_Bool bQuickstart( sal_True );
-    sal_Bool bAutostart( sal_True );
-    Sequence< Any > aSeq( 2 );
-    aSeq[0] <<= bQuickstart;
-    aSeq[1] <<= bAutostart;
-
-    Reference < XInitialization > xQuickstart( 
::comphelper::getProcessServiceFactory()->createInstance(
-        OUString::createFromAscii( "com.sun.star.office.Quickstart" 
)),UNO_QUERY );
-    if ( xQuickstart.is() )
-        xQuickstart->initialize( aSeq );
-
-}
-
 sal_Bool FirstStartWizard::showOnlineUpdatePage()
 {
     try {

Modified: incubator/ooo/trunk/main/desktop/source/migration/wizard.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/migration/wizard.hxx?rev=1297453&r1=1297452&r2=1297453&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/migration/wizard.hxx (original)
+++ incubator/ooo/trunk/main/desktop/source/migration/wizard.hxx Tue Mar  6 
12:49:02 2012
@@ -77,8 +77,6 @@ private:
 
     void storeAcceptDate();
     void setPatchLevel();
-    void disableWizard();
-    void enableQuickstart();
 
     DECL_LINK(DeclineHdl, PushButton*);
 


Reply via email to