Changeset 9e925d


Ignore:
Timestamp:
Jul 22, 2008, 1:16:34 PM (12 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
055153
Parents:
4019d2
Message:

enabled quick-upgrade for small upgrade-steps (one version upwards)

Location:
chrome/content/v_identity
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_upgrade.js

    r4019d2 r9e925d  
    3232
    3333    init : function() {
     34        vI_upgrade.__initRequirements();
    3435        document.documentElement.getButton("cancel").setAttribute("hidden", "true")
     36        vI_upgrade.skipUpgradePages(); // skip obsolete upgrade Pages
     37    },
     38
     39    __initRequirements : function() {
    3540        vI_notificationBar.dump("") // this initialises the debug-area
    3641        vI_rdfDatasource.init(); // just to be sure that Datasource is initialised
    37         vI_upgrade.skipUpgradePages(); // skip obsolete upgrade Pages
    38     },
    39        
     42    },
     43   
     44    // this function checks for the chance to ugrade without shoing the complete wizard
     45    // if so, perform the upgrade and return true
     46    // by default the wizard is not shown if it is a one-version-forward upgrade
     47    quick_upgrade : function() {
     48        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
     49        var currentVersion = vI_rdfDatasource.getCurrentExtFileVersion().split(/\./);
     50        var nextVersion = currentVersion[0] + "." + currentVersion[1] + "."
     51        if (currentVersion[2].match(/pre/))
     52            nextVersion += parseInt(currentVersion[2])
     53        else nextVersion += eval(parseInt(currentVersion[2])+1)
     54        var extVersion = document.getElementById("extVersion").getAttribute("value");
     55               
     56        // don't show the dialog if we do a one-step upgrade
     57        if (vI_upgrade.versionChecker.compare(extVersion, nextVersion) <= 0) {
     58            vI_notificationBar.dump("starting quick_upgrade.\n")
     59            vI_upgrade.__initRequirements();
     60            vI_upgrade.__upgrade();
     61            return true;
     62        }
     63        return false;
     64    },
     65
    4066    skipUpgradePages : function() {
    4167        var preUpdateWizardPage = document.getElementById("license")       
     
    5076    },
    5177   
     78    __upgrade : function() {
     79        if (vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();
     80        if (vI_rdfDatasource.rdfUpgradeRequired()) vI_upgrade.rdfUpgrade();
     81       
     82        vI_account.cleanupSystem();
     83    },         
     84
    5285    upgrade : function() {
    5386        vI_notificationBar.dump("starting upgrade.\n\n")
     
    5588        document.documentElement.getButton('next').setAttribute('disabled','true');
    5689       
    57         if (vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();
    58         if (vI_rdfDatasource.rdfUpgradeRequired()) vI_upgrade.rdfUpgrade();
    59        
    60         vI_account.cleanupSystem();
    61        
     90        vI_upgrade.__upgrade();
     91   
    6292        vI_notificationBar.dump("\n\nupgrade finished.\n");
    6393       
     
    233263        }
    234264}
    235 window.addEventListener('load', vI_upgrade.init, true);
     265// start init only if wizard is shown, so it is done in vI_upgrade.xul
     266// window.addEventListener('load', vI_upgrade.init, true);
  • chrome/content/v_identity/vI_upgrade.xul

    r4019d2 r9e925d  
    3838<wizard id="upgradeWizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    3939        title="&vident.upgrade.dlgTitle.label;"
    40     zlevel="6" >
     40    zlevel="6" onload="vI_upgrade.init();">
    4141
    4242<script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
  • chrome/content/v_identity/vI_upgradeOverlay.js

    r4019d2 r9e925d  
    2626    init: function() {
    2727        vI_rdfDatasource.init() // just to be sure that Datasource is available
    28         if (vI_rdfDatasource.rdfUpgradeRequired() || vI_rdfDatasource.extUpgradeRequired())     
    29             window.openDialog("chrome://v_identity/content/vI_upgrade.xul",0, // give the Dialog a unique id
     28        if (vI_rdfDatasource.rdfUpgradeRequired() || vI_rdfDatasource.extUpgradeRequired()) {
     29            if (!vI_upgrade.quick_upgrade())
     30                window.openDialog("chrome://v_identity/content/vI_upgrade.xul",0, // give the Dialog a unique id
    3031                "chrome, dialog, modal, alwaysRaised, resizable=yes").focus();
     32        }
    3133        else {
    3234            vI_account.cleanupSystem(); // always clean leftover accounts and directories
  • chrome/content/v_identity/vI_upgradeOverlay.xul

    r4019d2 r9e925d  
    3737    <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
    3838    <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" />
     39   
     40    // include following scripts to enable quick_upgrade
     41    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
     42    <script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
     43    <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
     44    <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
     45    <script type="application/x-javascript" src="chrome://v_identity/content/vI_htmlTextBox.js" />
     46
    3947    <!-- following element just stores the Ext-Version, seamonkey has no extensionmanager -->
    4048    <vbox id="messagepanebox" >
Note: See TracChangeset for help on using the changeset viewer.