Logo Search packages:      
Sourcecode: viridian version File versions  Download package

def AmpacheTools::AmpacheGUI::AmpacheGUI::status_icon_popup_menu (   self,
  icon,
  button,
  activate_time 
)
Create a menu when the user right clicks the sys tray icon.

Definition at line 1708 of file AmpacheGUI.py.

                                                                   :
            """Create a menu when the user right clicks the sys tray icon."""
            menu = gtk.Menu()
            
            show_window = gtk.MenuItem(_("Show Window"))
            show_window.connect('activate', self.status_icon_activate)
            menu.append(show_window)
            
            ### Display Song Info is song is playing ###
            if self.audio_engine.get_state() != "stopped" and self.audio_engine.get_state() != None:
                  menu.append(gtk.SeparatorMenuItem())
                  np = gtk.MenuItem(_("- Now Playing -"))
                  if self.audio_engine.get_state() == "paused":
                        np = gtk.MenuItem(_("- Now Playing (paused) -"))
                  np.set_sensitive(False)
                  menu.append(np)

                  title  = gtk.MenuItem(self.current_song_info['song_title'])
                  artist = gtk.MenuItem(self.current_song_info['artist_name'])
                  album  = gtk.MenuItem(self.current_song_info['album_name'])

                  title.set_sensitive(False)
                  artist.set_sensitive(False)
                  album.set_sensitive(False)

                  menu.append(title)
                  menu.append(artist)
                  menu.append(album)

            menu.append(gtk.SeparatorMenuItem())
            
            prev_track = gtk.ImageMenuItem(gtk.STOCK_MEDIA_PREVIOUS)
            prev_track.connect('activate', self.button_prev_clicked, None)
            menu.append(prev_track)
            
            play_pause = gtk.MenuItem("")
            if self.audio_engine.get_state() != "playing":
                  play_pause = gtk.ImageMenuItem(gtk.STOCK_MEDIA_PLAY)
            else:
                  play_pause = gtk.ImageMenuItem(gtk.STOCK_MEDIA_PAUSE)
            play_pause.connect('activate', self.button_play_pause_clicked, None)
            menu.append(play_pause)

            next_track = gtk.ImageMenuItem(gtk.STOCK_MEDIA_NEXT)
            next_track.connect('activate', self.button_next_clicked, None)
            menu.append(next_track)
            
            menu.append(gtk.SeparatorMenuItem())
            
            pref = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES)
            pref.connect('activate', self.show_settings, None)
            menu.append(pref)
            
            quit_ = gtk.ImageMenuItem(gtk.STOCK_QUIT)
            quit_.connect('activate', self.destroy, None)
            menu.append(quit_)
            
            menu.show_all()
            menu.popup(None, None, gtk.status_icon_position_menu, button, activate_time, icon)



Generated by  Doxygen 1.6.0   Back to index