updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / fluxgui / fluxgui.patch
blob908474e111c03bc063090032f328cd37490dba55
1 --- fluxgui.orig/src/fluxgui/fluxgui.py 2010-09-08 12:13:14.000000000 +0200
2 +++ fluxgui/src/fluxgui/fluxgui.py 2010-09-28 21:15:06.000000000 +0200
3 @@ -1,7 +1,7 @@
4 -#!/usr/bin/python
5 +#!/usr/bin/python2
6 -import appindicator
7 import gtk
8 import gtk.glade
9 +import pygtk
10 import gconf
11 import sys
12 import pexpect
13 @@ -14,7 +14,7 @@ VERSION = "1.1.8"
14 class Fluxgui:
15 def __init__(self):
16 self.check_pid()
17 - self.indicator = Indicator(self)
18 + self.statusIcon = StatIco(self)
20 self.color = None;
21 self.settings = Settings(self)
22 @@ -56,8 +56,8 @@ class Fluxgui:
23 self.xflux = None
25 def stop_xflux(self, item):
26 - self.indicator.item_turn_off.hide()
27 - self.indicator.item_turn_on.show()
28 + self.statusIcon.item_turn_off.hide()
29 + self.statusIcon.item_turn_on.show()
31 if self.xflux:
32 # xflux is not running
33 @@ -68,13 +68,13 @@ class Fluxgui:
34 pass
36 def pause_xflux(self, item):
37 - self.indicator.item_turn_off.hide()
38 - self.indicator.item_turn_on.show()
39 + self.statusIcon.item_turn_off.hide()
40 + self.statusIcon.item_turn_on.show()
41 self.update_xflux("k=" + self.settings.get_color("4"))
43 def unpause_xflux(self, item):
44 - self.indicator.item_turn_off.show()
45 - self.indicator.item_turn_on.hide()
46 + self.statusIcon.item_turn_off.show()
47 + self.statusIcon.item_turn_on.hide()
48 self.update_xflux("k=" + self.settings.color)
50 def update_xflux(self, command):
51 @@ -142,31 +142,11 @@ class Fluxgui:
52 gtk.main_quit()
53 sys.exit(0)
55 -class Indicator:
57 +class StatIco:
58 def __init__(self, main):
59 self.main = main
60 - self.setup_indicator()
62 - def setup_indicator(self):
63 - self.indicator = appindicator.Indicator(
64 - "fluxgui-indicator",
65 - "fluxgui",
66 - appindicator.CATEGORY_APPLICATION_STATUS)
67 - self.indicator.set_status(appindicator.STATUS_ACTIVE)
69 - # Check for special Ubuntu themes. copied from lookit
70 - self.indicator.set_icon('fluxgui')
71 - if gtk.gdk.screen_get_default():
72 - theme = gtk.gdk.screen_get_default().get_setting(
73 - 'gtk-icon-theme-name')
74 - if theme == 'ubuntu-mono-dark':
75 - self.indicator.set_icon('fluxgui-dark')
76 - elif theme == 'ubuntu-mono-light':
77 - self.indicator.set_icon('fluxgui-light')
79 - self.indicator.set_menu(self.setup_menu())
81 + self.create_icon()
83 def setup_menu(self):
84 menu = gtk.Menu()
86 @@ -195,10 +175,25 @@ class Indicator:
87 menu.append(item)
89 return menu
92 + def popup_menu_cb(self, widget, button, time, data = None):
93 + if button == 3:
94 + if data:
95 + data.show_all()
96 + data.popup(None, None, gtk.status_icon_position_menu,3, time, self.staticon)
99 + def create_icon(self):
100 + # create a new Status Icon
101 + self.staticon = gtk.StatusIcon()
102 + self.staticon.set_from_icon_name('fluxgui')
103 + self.staticon.set_tooltip("fluxgui")
104 + self.staticon.connect('popup-menu', self.popup_menu_cb, self.setup_menu())
105 + self.staticon.set_visible(True)
107 def main(self):
108 - gtk.main()
110 + # invoking the main()
111 + gtk.main()
113 class Preferences: