public
Description: A Last.fm scrobbling addon for Songbird
Homepage: http://getsongbird.com/
Clone URL: git://github.com/ianloic/songbird-lastfm.git
Search Repo:
start wiring up logout into the menu
ianloic (author)
Wed Jul 02 13:25:53 -0700 2008
commit  e88dc2fc1a39949023849014b7ffffcd68478cb4
tree    ee218e20d810b7ca38a88d67f55d4cf233d8a7e0
parent  660945ce24c33324db802ef78643e94f97659943
...
13
14
15
 
 
16
17
18
...
13
14
15
16
17
18
19
20
0
@@ -13,6 +13,8 @@
0
 
0
   <menupopup id="menu_ToolsPopup">
0
     <menuseparator id="lastfmMenuSeparator" insertbefore="devToolsSeparator"/>
0
+ <menuitem id="lastfmMenuLogout" label="Log out of Last.fm"
0
+ insertbefore="devToolsSeparator"/>
0
     <menuitem id="lastfmMenuLogin" label="Log into Last.fm..."
0
               insertbefore="devToolsSeparator"/>
0
     <menuitem id="lastfmMenuEnableScrobbling" label="Enable scrobbling"
...
24
25
26
 
27
28
29
...
130
131
132
 
 
133
134
135
...
215
216
217
218
 
 
 
 
 
 
219
220
221
...
24
25
26
27
28
29
30
...
131
132
133
134
135
136
137
138
...
218
219
220
 
221
222
223
224
225
226
227
228
229
0
@@ -24,6 +24,7 @@ Lastfm.onLoad = function() {
0
 
0
   // menu items
0
   this._menuLogin = document.getElementById('lastfmMenuLogin');
0
+ this._menuLogout = document.getElementById('lastfmMenuLogout');
0
   this._menuEnableScrobbling =
0
     document.getElementById('lastfmMenuEnableScrobbling');
0
 
0
@@ -130,6 +131,8 @@ Lastfm.onLoad = function() {
0
   this.onShouldScrobbleChanged(this._service.shouldScrobble);
0
   // disable the scrobbling menu item
0
   this._menuEnableScrobbling.setAttribute('disabled', 'true');
0
+ // disable the logout menu item
0
+ this._menuLogout.style.visibility = 'collapse';
0
 
0
   // if we have a username & password and we're scrobbling, try to log in
0
   if (this._service.username && this._service.password) {
0
@@ -215,7 +218,12 @@ Lastfm.onLoginSucceeded = function Lastfm_onLoginSucceeded() {
0
 
0
   // set the status icon
0
   this.setStatusIcon(ICON_LOGGED_IN);
0
- this.setStatusTextId('lastfm.status.logged_in')
0
+ this.setStatusTextId('lastfm.status.logged_in');
0
+
0
+ // enable the logout menu item
0
+ this._menuLogout.style.visibility = 'visible';
0
+ // disable the login menu item
0
+ this._menuLogin.style.visibility = 'collapse';
0
 }
0
 Lastfm.onOnline = function Lastfm_onOnline() {
0
   // main screen turn on

Comments

    No one has commented yet.