~george-edison55/stackapplet/stackapplet-1.4

« back to all changes in this revision

Viewing changes to other/windows/appindicator.py

  • Committer: Nathan Osman
  • Date: 2010-10-26 23:30:17 UTC
  • Revision ID: admin@quickmediasolutions.com-20101026233017-dq1xeihptgek808p
Added initial support for Windows. Added action for clicking on item in menu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#=========================
 
2
#
 
3
# AppIndicator for Windows
 
4
#  drop-in replacement
 
5
#
 
6
#    Copyright 2010
 
7
#     Nathan Osman
 
8
#
 
9
#=========================
 
10
 
 
11
# We require PyGTK
 
12
import gtk
 
13
 
 
14
# The definitions needed
 
15
 
 
16
# Types
 
17
CATEGORY_APPLICATION_STATUS = 0
 
18
 
 
19
# Status
 
20
STATUS_ACTIVE = 0
 
21
 
 
22
# The main class
 
23
class Indicator:
 
24
        
 
25
        # Constructor
 
26
        
 
27
        def __init__ (self,unknown,icon,category):
 
28
                
 
29
                # Create the icon
 
30
                self.icon = gtk.StatusIcon()
 
31
                self.icon.set_from_file(icon)
 
32
                
 
33
                # Set the rest of the vars
 
34
                self.menu = None
 
35
        
 
36
        def set_menu(self,menu):
 
37
                
 
38
                # Save a copy of the menu
 
39
                self.menu = menu
 
40
                
 
41
                # Now attach the icon's signal
 
42
                # to the menu
 
43
                self.icon.connect("activate", self.show_menu)
 
44
        
 
45
        def set_status(self,status):
 
46
                
 
47
                # Do nothing
 
48
                pass
 
49
        
 
50
        def set_icon(self,icon):
 
51
                
 
52
                # Do nothing
 
53
                pass
 
54
        
 
55
        def set_attention_icon(self,icon):
 
56
                
 
57
                # Do nothing
 
58
                pass
 
59
        
 
60
        def show_menu(self,widget):
 
61
                
 
62
                # Show the menu
 
63
                self.menu.popup(None,None,None,0,0)
 
64