Changeset 2527

Show
Ignore:
Timestamp:
11/14/08 14:58:00 (7 weeks ago)
Author:
ahodgkinson
Message:

digitalme: More Firefox launcher cleanup.

Location:
trunk/digitalme/launchers/firefox-addon
Files:
1 removed
4 modified
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/digitalme/launchers/firefox-addon/CMakeLists.txt

    r2526 r2527  
    107107        COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/IdentitySelectorPrefs.js ${PACKAGE_STAGE_DIR}/chrome/content 
    108108        COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/IdentitySelectorUtil.js ${PACKAGE_STAGE_DIR}/chrome/content 
    109         COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/NoIdentitySelector.js ${PACKAGE_STAGE_DIR}/chrome/content 
    110         COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/Intercept.js ${PACKAGE_STAGE_DIR}/chrome/content 
     109        COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/IdentitySelectorIntercept.js ${PACKAGE_STAGE_DIR}/chrome/content 
    111110 
    112111        COMMAND ${CMAKE_COMMAND} -E copy xul/chrome/content/DigitalMe.xul ${PACKAGE_STAGE_DIR}/chrome/content 
  • trunk/digitalme/launchers/firefox-addon/xul/chrome.manifest

    r1208 r2527  
    11overlay chrome://browser/content/browser.xul                                            chrome://identityselector/content/IdentitySelector.xul 
     2overlay chrome://browser/content/browser.xul                                            chrome://identityselector/content/DigitalMe.xul 
    23content identityselector                                                                                                        jar:chrome/identityselector.jar!/content/ 
  • trunk/digitalme/launchers/firefox-addon/xul/chrome/content/DigitalMe.js

    r2526 r2527  
    3737                                DigitalMeSelector.onInstall, false); 
    3838                                 
    39                         // Set the default selector class 
    40                          
    41 //                      if( IdentitySelectorPrefs.getStringPref(  
    42 //                              "identityselector", "selector_class") === null) 
    43 //                      { 
    44                                 IdentitySelectorPrefs.setStringPref(  
    45                                         "identityselector", "selector_class", "DigitalMeSelector"); 
    46 //                      } 
     39                        // Register with the selector service 
     40                         
     41                        IdentitySelector.registerSelector( DigitalMeSelector); 
    4742                } 
    4843                catch( e) 
     
    6762                        window.removeEventListener( "unload",  
    6863                                DigitalMeSelector.onUninstall, false); 
     64                                 
     65                        IdentitySelector.deregisterSelector( DigitalMeSelector); 
    6966                } 
    7067                catch( e) 
     
    7269                        IdentitySelectorDiag.throwError( "onUninstall", e); 
    7370                } 
     71        }, 
     72         
     73        // *********************************************************************** 
     74        // Method: guid 
     75        // *********************************************************************** 
     76         
     77        guid : function() 
     78        { 
     79                return( "C316F29C-BDB0-4CF7-A827-E73E453C7BB9"); 
    7480        }, 
    7581         
     
    202208                                        if( IdentitySelectorUtil.isMacPlatform()) 
    203209                                        { 
    204                                                 path = [ 
    205                                                         userHome + "/Desktop/DigitalMe.app/Contents/MacOS", 
     210                                                path = [ userHome +  
     211                                                        "/Desktop/DigitalMe.app/Contents/MacOS", 
    206212                                                        "/Applications/DigitalMe.app/Contents/MacOS", 
    207213                                                        "/Applications/Utilities/DigitalMe.app/Contents/MacOS"]; 
     
    338344                        // Debug log 
    339345                         
    340                         if( IdentitySelectorPrefs.hasPref( "digitalme", "debug.log.path")) 
    341                         { 
     346                        if( IdentitySelectorPrefs.getBooleanPref( "digitalme", 
     347                                "logging.enabled")) 
     348                        { 
     349                                args.push( "--loglevel=debug"); 
     350                                 
    342351                                debugLogPath = IdentitySelectorPrefs.getStringPref( "digitalme", 
    343352                                        "debug.log.path"); 
     
    345354                                if( debugLogPath !== null && debugLogPath !== "") 
    346355                                { 
    347                                         args.push( "--loglevel=debug"); 
    348356                                        args.push( "--logfile=\"" + debugLogPath + "\""); 
    349357                                } 
  • trunk/digitalme/launchers/firefox-addon/xul/chrome/content/DigitalMePrefs.js

    r2526 r2527  
    5151                        } 
    5252                         
     53                        // Logging 
     54                         
     55                        element = document.getElementById(  
     56                                                                "digitalme.logging.enabled"); 
     57                         
     58                        try 
     59                        {  
     60                                element.checked = gPrefService.getBoolPref(  
     61                                        "extensions.digitalme.logging.enabled");  
     62                        } 
     63                        catch( e2) 
     64                        {  
     65                                element.checked = false; 
     66                        } 
     67 
    5368                        // Debug log path 
    5469 
     
    6075                                        "extensions.digitalme.debug.log.path");  
    6176                        } 
    62                         catch( e2) 
     77                        catch( e3) 
    6378                        {  
    6479                                element.value = ""; 
     
    7590                                        "extensions.digitalme.security.securedesktop");  
    7691                        } 
    77                         catch( e3) 
     92                        catch( e4) 
    7893                        {  
    7994                                element.checked = true; 
     
    93108                        // EXE path 
    94109                         
    95                         element = document.getElementById( "digitalme.exe.path"); 
    96                         gPrefService.setCharPref( "extensions.digitalme.exe.path", element.value); 
     110                        element = document.getElementById(  
     111                                                        "digitalme.exe.path"); 
     112                        gPrefService.setCharPref(  
     113                                                        "extensions.digitalme.exe.path",  
     114                                                        element.value); 
     115                         
     116                        // Logging 
     117                         
     118                        element = document.getElementById(  
     119                                                        "digitalme.logging.enabled"); 
     120                        gPrefService.setBoolPref(  
     121                                                        "extensions.digitalme.logging.enabled", 
     122                                                        element.checked); 
    97123                         
    98124                        // Debug log path 
    99125                         
    100                         element = document.getElementById( "digitalme.debug.log.path"); 
    101                         gPrefService.setCharPref( "extensions.digitalme.debug.log.path", element.value); 
     126                        element = document.getElementById(  
     127                                                        "digitalme.debug.log.path"); 
     128                        gPrefService.setCharPref(  
     129                                                        "extensions.digitalme.debug.log.path", 
     130                                                        element.value); 
    102131                         
    103132                        // Secure desktop 
  • trunk/digitalme/launchers/firefox-addon/xul/chrome/content/DigitalMePrefs.xul

    r2526 r2527  
    44<dialog id="digitalme-pref"  
    55        buttons="accept,cancel" 
    6         ondialogaccept="digitalmePrefs.save();" 
    7         onload="digitalmePrefs.init();"  
     6        ondialogaccept="DigitalMePrefs.save();" 
     7        onload="DigitalMePrefs.init();"  
    88                  persist="screenX screenY" 
    99        style="width:640px;" 
     
    1212                   
    1313   <script type="application/x-javascript"  
    14                 src="chrome://identityselector/content/digitalmePrefs.js" /> 
     14                src="chrome://identityselector/content/DigitalMePrefs.js" /> 
    1515 
    1616   <groupbox> 
     
    4242         <textbox id="digitalme.debug.log.path"  
    4343                                 flex="1"/> 
     44                                                 
     45      <checkbox id="digitalme.logging.enabled"  
     46                                         class="indent" 
     47                                         label="Logging Enabled" 
     48                                         type="checkbox" 
     49                                         checked="false" 
     50                                         disabled="false"/> 
    4451      </hbox> 
    4552   </groupbox> 
  • trunk/digitalme/launchers/firefox-addon/xul/chrome/content/IdentitySelector.js

    r2526 r2527  
    4848var gDisableStartTime = null; 
    4949var gDebugMode = false; 
     50var gSelectorRegistry = []; 
    5051 
    5152// ************************************************************************** 
     
    210211         
    211212        // *********************************************************************** 
     213        // Method: registerSelector 
     214        // *********************************************************************** 
     215         
     216        registerSelector : function( selector) 
     217        { 
     218                var     bFound = false; 
     219                 
     220                for( var iLoop = 0; iLoop < gSelectorRegistry.length; iLoop++) 
     221                { 
     222                        if( gSelectorRegistry[ iLoop].guid() === selector.guid()) 
     223                        { 
     224                                bFound = true; 
     225                                break; 
     226                        } 
     227                } 
     228                 
     229                if( !bFound) 
     230                { 
     231                        gSelectorRegistry.push( selector); 
     232                } 
     233        }, 
     234 
     235        // *********************************************************************** 
     236        // Method: deregisterSelector 
     237        // *********************************************************************** 
     238         
     239        deregisterSelector : function( selector) 
     240        { 
     241                for( var iLoop = 0; iLoop < gSelectorRegistry.length; iLoop++) 
     242                { 
     243                        if( gSelectorRegistry[ iLoop].guid() === selector.guid()) 
     244                        { 
     245                                gSelectorRegistry.splice( iLoop, 1); 
     246                                break; 
     247                        } 
     248                } 
     249        }, 
     250         
     251        // *********************************************************************** 
    212252        // Method: runInterceptScript 
    213253        // *********************************************************************** 
     
    227267                                "@mozilla.org/moz/jssubscript-loader;1"].getService( 
    228268                                Components.interfaces.mozIJSSubScriptLoader).loadSubScript( 
    229                                 "chrome://identityselector/content/Intercept.js", doc); 
     269                                "chrome://identityselector/content/IdentitySelectorIntercept.js", 
     270                                doc); 
    230271                         
    231272                        IdentitySelectorDiag.logMessage( "runInterceptScript",  
     
    11391180                        } 
    11401181                         
    1141                         // Get the selector class 
    1142                          
    1143                         if( (selectorClass = IdentitySelectorPrefs.getStringPref(  
    1144                                 "identityselector", "selector_class")) === null) 
    1145                         { 
    1146                                 selectorClass = "NoIdentitySelector"; 
    1147                         } 
    1148                          
    1149                         getSecurityToken = eval( selectorClass).getSecurityToken; 
    1150                          
    1151                         if( typeof getSecurityToken != "function") 
    1152                         { 
    1153                                 selectorClass = "NoIdentitySelector"; 
    1154                                 getSecurityToken = eval( selectorClass).getSecurityToken; 
     1182                        // Get the selector 
     1183                         
     1184                        getSecurityToken = null; 
     1185                         
     1186                        if( gSelectorRegistry.length > 1) 
     1187                        { 
     1188                                if( (selectorGuid = IdentitySelectorPrefs.getStringPref(  
     1189                                        "identityselector", "selector_guid")) !== null) 
     1190                                { 
     1191                                        for( iLoop = 0; iLoop < gSelectorRegistry.length; iLoop++) 
     1192                                        { 
     1193                                                if( gSelectorRegistry[ iLoop].guid() === selectorGuid) 
     1194                                                { 
     1195                                                        getSecurityToken = gSelectorRegistry[ 
     1196                                                                iLoop].getSecurityToken; 
     1197                                                        break; 
     1198                                                } 
     1199                                        } 
     1200                                } 
     1201                        } 
     1202                         
     1203                        if( getSecurityToken === null) 
     1204                        { 
     1205                                if( gSelectorRegistry.length >= 1) 
     1206                                { 
     1207                                        getSecurityToken = gSelectorRegistry[ 0].getSecurityToken; 
     1208                                } 
     1209                                else 
     1210                                { 
     1211                                        IdentitySelectorDiag.reportError( "onCallIdentitySelector", 
     1212                                                "Unable to locate an identity selector.  " +  
     1213                                                "Please make sure one is installed."); 
     1214                                } 
    11551215                        } 
    11561216                         
  • trunk/digitalme/launchers/firefox-addon/xul/chrome/content/IdentitySelector.xul

    r2526 r2527  
    77        <script type="application/x-javascript" src="chrome://identityselector/content/IdentitySelectorPrefs.js"/> 
    88        <script type="application/x-javascript" src="chrome://identityselector/content/IdentitySelectorUtil.js"/> 
    9         <script type="application/x-javascript" src="chrome://identityselector/content/NoIdentitySelector.js"/> 
    109</overlay>