summaryrefslogtreecommitdiff
blob: 29c5f6ce19e29f2faad2ecdc6de86d0915f16995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
diff -dupr gestikk-old/gestikk/start_main.py gestikk-0.6/gestikk/start_main.py
--- gestikk-old/gestikk/start_main.py	2008-11-23 00:31:14.519650800 +0100
+++ gestikk-0.6/gestikk/start_main.py	2008-11-23 00:31:55.924650920 +0100
@@ -31,9 +31,6 @@ import subprocess
 import signal
 import gtk
 import gobject
-import pynotify
-if not pynotify.init("gestikk"):
-    print "Libnotify daemon error!"
 
 import osd
 from gestikk.tools import *
@@ -102,26 +99,6 @@ class StatusIcon:
             subprocess.Popen([get_file('gestikk', 'executable'), '-c', '-q'])
 
 
-class Notifier:
-    """ class for notifying the user when a gesture started """
-    def __init__(self, logic, statusicon):
-        self.logic = logic
-        self.statusicon = statusicon
-
-    def notify(self, s, gesture):
-        """ Notify and display `s`
-            :type s: String
-        """
-        notify = pynotify.Notification(_("Notification"), s.replace('<', '&lt;').replace('>', '&gt;'))
-        screen, rect, orient = self.statusicon.icon.get_geometry()
-        notify.set_hint("x", rect.x + (rect.width / 2))
-        notify.set_hint("y", rect.y + (rect.height / 2))
-        notify.set_timeout(3000) # timeout in ms
-        color = self.logic.config_get_option('OSD', 'color', '#0000FF')
-        pb = pixmap_to_pixbuf(gesture_to_pixmap(gesture2py(gesture), 40, color), (255, 255, 255))
-        notify.set_icon_from_pixbuf(pb)
-        notify.show()
-
 class Listener:
     """ class for listening the mouse positions """
     def __init__(self, logic, notifier, debugger):
@@ -224,9 +201,8 @@ class Listener:
                         if action.check_condition():
                             action.do()
                             self.debugger.debug(self.notify_string(gesture_repr))
-                            if self.notify_method == 'balloon' or self.notify_method == 'osd':
-                                self.notifier.notify(action.get_formatted(), action.gesture)
                             if self.notify_method == 'osd':
+                                self.notifier.notify(action.get_formatted(), action.gesture)
                                 gobject.timeout_add(3000, self._osd_clear) # show it 2 sec
         return self.running
 
@@ -248,9 +224,7 @@ class Listener:
         self.notify_method = self.logic.config_get_option('Notification', 'type')
         if isinstance(self.notifier, osd.OSDNotifier):
             self.notifier.destroy()
-        if self.notify_method == 'balloon':
-            self.notifier = Notifier(self.logic, self.logic.status_icon)
-        elif self.notify_method == 'osd':
+        if self.notify_method == 'osd':
             notify_colorstr = self.logic.config_get_option('Notification', 'color', 'red')
             notify_font = self.logic.config_get_option('Notification', 'font', 'Sans')
             notify_fontsize = self.logic.config_get_option('Notification' , 'font_size', '20')
@@ -269,11 +243,7 @@ def main(debug):
     logic.status_icon = status # Not clean... TODO?
     # get notifiers
     notify_m = logic.config_get_option('Notification', 'type')
-    if notify_m == 'balloon':
-        debugger.debug("Using balloontip notification")
-        notifier = Notifier(logic, status)
-        osd_obj = False
-    elif notify_m == 'osd':
+    if notify_m == 'osd':
         debugger.debug("Using OSD notification")
         notify_colorstr = logic.config_get_option('Notification', 'color', 'red')
         notify_font = logic.config_get_option('Notification', 'font', 'Sans')
diff -dupr gestikk-old/gestikk/tools.py gestikk-0.6/gestikk/tools.py
--- gestikk-old/gestikk/tools.py	2008-11-23 00:31:14.519650800 +0100
+++ gestikk-0.6/gestikk/tools.py	2008-11-23 00:31:07.654525360 +0100
@@ -679,7 +679,7 @@ class Logic():
             print 'You have chosen a gesture switcher which is not supported anymore. I\'ll reset it.'
             self.current_switcher = 'rightdown'
             self.current_switcher_txt = dict_rev(self.gesture_switchers_txt)[self.gesture_switchers.index(self.current_switcher)]
-        self.notifiers = {"0":_("None"), "balloon":_("Balloontip"), "osd":_("OSD")}
+        self.notifiers = {"0":_("None"), "osd":_("OSD")}
 
         self.enable_conditions = True