Merge lp:~lfaraone/ubuntu/lucid/autokey/merge0.61.5-1ubuntu1 into lp:ubuntu/lucid/autokey
- Lucid (10.04)
- merge0.61.5-1ubuntu1
- Merge into lucid
Proposed by
Luke Faraone
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~lfaraone/ubuntu/lucid/autokey/merge0.61.5-1ubuntu1 | ||||
Merge into: | lp:ubuntu/lucid/autokey | ||||
Diff against target: |
15122 lines (+10561/-3781) 116 files modified
PKG-INFO (+1/-1) autokey (+0/-13) autokey-gtk (+13/-0) autokey-qt (+13/-0) config/autokey-gtk.desktop (+10/-0) config/autokey-qt.desktop (+10/-0) config/autokey.desktop (+0/-10) debian/autokey-common.init (+150/-0) debian/autokey-common.install (+13/-0) debian/autokey-common.lintian-overrides (+1/-0) debian/autokey-common.postinst (+41/-0) debian/autokey-common.prerm (+34/-0) debian/autokey-gtk.install (+6/-0) debian/autokey-gtk.postinst (+9/-0) debian/autokey-gtk.prerm (+12/-0) debian/autokey-qt.install (+5/-0) debian/autokey-qt.postinst (+9/-0) debian/autokey-qt.prerm (+12/-0) debian/autokey.1 (+0/-54) debian/autokey.init (+0/-145) debian/autokey.lintian-overrides (+0/-1) debian/changelog (+45/-0) debian/compat (+1/-1) debian/control (+59/-14) debian/copyright (+1/-1) debian/patches/00list (+0/-1) debian/patches/README (+4/-0) debian/postinst (+0/-37) debian/prerm (+0/-34) debian/rules (+3/-6) doc/man/autokey-gtk.1 (+54/-0) doc/man/autokey-qt.1 (+54/-0) glade/abbrselector.glade (+45/-0) glade/abbrsettings.glade (+189/-0) glade/folderpage.glade (+70/-0) glade/hotkeysettings.glade (+151/-0) glade/mainwindow.glade (+124/-0) glade/phrasepage-old.glade (+118/-0) glade/phrasepage.glade (+106/-0) glade/recorddialog.glade (+145/-0) glade/scriptpage.glade (+106/-0) glade/settingsdialog.glade (+762/-0) glade/settingswidget.glade (+197/-0) glade/windowfiltersettings.glade (+87/-0) setup.py (+8/-6) src/lib/autokey.py (+0/-280) src/lib/common.py (+48/-0) src/lib/configmanager.py (+1/-1) src/lib/daemon.py (+19/-15) src/lib/gtkapp.py (+262/-0) src/lib/gtkui/abbrselector.py (+93/-0) src/lib/gtkui/configwindow.py (+1120/-0) src/lib/gtkui/data/abbrselector.xml (+42/-0) src/lib/gtkui/data/abbrsettings.xml (+208/-0) src/lib/gtkui/data/folderpage.xml (+63/-0) src/lib/gtkui/data/hotkeysettings.xml (+148/-0) src/lib/gtkui/data/mainwindow.xml (+124/-0) src/lib/gtkui/data/menus.xml (+71/-0) src/lib/gtkui/data/phrasepage.xml (+99/-0) src/lib/gtkui/data/recorddialog.xml (+154/-0) src/lib/gtkui/data/scriptpage.xml (+99/-0) src/lib/gtkui/data/settingsdialog.xml (+725/-0) src/lib/gtkui/data/settingswidget.xml (+190/-0) src/lib/gtkui/data/windowfiltersettings.xml (+88/-0) src/lib/gtkui/dialogs.py (+376/-0) src/lib/gtkui/notifier.py (+163/-0) src/lib/gtkui/popupmenu.py (+125/-0) src/lib/gtkui/settingsdialog.py (+222/-0) src/lib/interface.py (+47/-37) src/lib/plugin/manager.py (+0/-52) src/lib/plugin/plugins.py (+0/-197) src/lib/qtapp.py (+273/-0) src/lib/qtui/abbrsettings.py (+70/-0) src/lib/qtui/centralwidget.py (+79/-0) src/lib/qtui/configwindow.py (+1083/-0) src/lib/qtui/data/.directory (+2/-0) src/lib/qtui/data/api.txt (+36/-0) src/lib/qtui/data/gui.xml (+71/-0) src/lib/qtui/dialogs.py (+379/-0) src/lib/qtui/enginesettings.py (+52/-0) src/lib/qtui/folderpage.py (+43/-0) src/lib/qtui/generalsettings.py (+63/-0) src/lib/qtui/hotkeysettings.py (+71/-0) src/lib/qtui/interfacesettings.py (+63/-0) src/lib/qtui/notifier.py (+96/-0) src/lib/qtui/phrasepage.py (+51/-0) src/lib/qtui/popupmenu.py (+187/-0) src/lib/qtui/recorddialog.py (+51/-0) src/lib/qtui/scriptpage.py (+49/-0) src/lib/qtui/settingsdialog.py (+224/-0) src/lib/qtui/settingswidget.py (+74/-0) src/lib/qtui/specialhotkeysettings.py (+74/-0) src/lib/qtui/windowfiltersettings.py (+38/-0) src/lib/scripting.py (+262/-6) src/lib/service.py (+15/-9) src/lib/ui/abbrsettings.py (+0/-70) src/lib/ui/centralwidget.py (+0/-79) src/lib/ui/configwindow.py (+0/-1086) src/lib/ui/data/.directory (+0/-2) src/lib/ui/data/api.txt (+0/-36) src/lib/ui/data/gui.xml (+0/-71) src/lib/ui/dialogs.py (+0/-379) src/lib/ui/enginesettings.py (+0/-52) src/lib/ui/folderpage.py (+0/-43) src/lib/ui/generalsettings.py (+0/-63) src/lib/ui/hotkeysettings.py (+0/-71) src/lib/ui/interfacesettings.py (+0/-63) src/lib/ui/notifier.py (+0/-97) src/lib/ui/phrasepage.py (+0/-51) src/lib/ui/popupmenu.py (+0/-187) src/lib/ui/recorddialog.py (+0/-51) src/lib/ui/scriptpage.py (+0/-49) src/lib/ui/settingsdialog.py (+0/-224) src/lib/ui/settingswidget.py (+0/-74) src/lib/ui/specialhotkeysettings.py (+0/-74) src/lib/ui/windowfiltersettings.py (+0/-38) |
||||
To merge this branch: | bzr merge lp:~lfaraone/ubuntu/lucid/autokey/merge0.61.5-1ubuntu1 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Sponsors | Pending | ||
Review via email: mp+22227@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'PKG-INFO' | |||
2 | --- PKG-INFO 2010-01-08 08:52:58 +0000 | |||
3 | +++ PKG-INFO 2010-03-26 15:01:22 +0000 | |||
4 | @@ -1,6 +1,6 @@ | |||
5 | 1 | Metadata-Version: 1.0 | 1 | Metadata-Version: 1.0 |
6 | 2 | Name: autokey | 2 | Name: autokey |
8 | 3 | Version: 0.61.2 | 3 | Version: 0.61.5 |
9 | 4 | Summary: Desktop automation utility | 4 | Summary: Desktop automation utility |
10 | 5 | Home-page: http://autokey.googlecode.com/ | 5 | Home-page: http://autokey.googlecode.com/ |
11 | 6 | Author: Chris Dekter | 6 | Author: Chris Dekter |
12 | 7 | 7 | ||
13 | === removed file 'autokey' | |||
14 | --- autokey 2009-09-27 15:08:28 +0000 | |||
15 | +++ autokey 1970-01-01 00:00:00 +0000 | |||
16 | @@ -1,13 +0,0 @@ | |||
17 | 1 | #!/usr/bin/env python | ||
18 | 2 | # -*- coding: utf-8 -*- | ||
19 | 3 | |||
20 | 4 | import sys | ||
21 | 5 | from autokey.autokey import Application | ||
22 | 6 | |||
23 | 7 | a = Application() | ||
24 | 8 | try: | ||
25 | 9 | a.main() | ||
26 | 10 | except KeyboardInterrupt: | ||
27 | 11 | a.shutdown() | ||
28 | 12 | sys.exit(0) | ||
29 | 13 | |||
30 | 14 | 0 | ||
31 | === added file 'autokey-gtk' | |||
32 | --- autokey-gtk 1970-01-01 00:00:00 +0000 | |||
33 | +++ autokey-gtk 2010-03-26 15:01:22 +0000 | |||
34 | @@ -0,0 +1,13 @@ | |||
35 | 1 | #!/usr/bin/env python | ||
36 | 2 | # -*- coding: utf-8 -*- | ||
37 | 3 | |||
38 | 4 | import sys | ||
39 | 5 | from autokey.gtkapp import Application | ||
40 | 6 | |||
41 | 7 | a = Application() | ||
42 | 8 | try: | ||
43 | 9 | a.main() | ||
44 | 10 | except KeyboardInterrupt: | ||
45 | 11 | a.shutdown() | ||
46 | 12 | sys.exit(0) | ||
47 | 13 | |||
48 | 0 | 14 | ||
49 | === added file 'autokey-qt' | |||
50 | --- autokey-qt 1970-01-01 00:00:00 +0000 | |||
51 | +++ autokey-qt 2010-03-26 15:01:22 +0000 | |||
52 | @@ -0,0 +1,13 @@ | |||
53 | 1 | #!/usr/bin/env python | ||
54 | 2 | # -*- coding: utf-8 -*- | ||
55 | 3 | |||
56 | 4 | import sys | ||
57 | 5 | from autokey.qtapp import Application | ||
58 | 6 | |||
59 | 7 | a = Application() | ||
60 | 8 | try: | ||
61 | 9 | a.main() | ||
62 | 10 | except KeyboardInterrupt: | ||
63 | 11 | a.shutdown() | ||
64 | 12 | sys.exit(0) | ||
65 | 13 | |||
66 | 0 | 14 | ||
67 | === added file 'config/akicon-status.png' | |||
68 | 1 | Binary files config/akicon-status.png 1970-01-01 00:00:00 +0000 and config/akicon-status.png 2010-03-26 15:01:22 +0000 differ | 15 | Binary files config/akicon-status.png 1970-01-01 00:00:00 +0000 and config/akicon-status.png 2010-03-26 15:01:22 +0000 differ |
69 | === added file 'config/autokey-gtk.desktop' | |||
70 | --- config/autokey-gtk.desktop 1970-01-01 00:00:00 +0000 | |||
71 | +++ config/autokey-gtk.desktop 2010-03-26 15:01:22 +0000 | |||
72 | @@ -0,0 +1,10 @@ | |||
73 | 1 | # $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $ | ||
74 | 2 | [Desktop Entry] | ||
75 | 3 | Name=AutoKey (GTK) | ||
76 | 4 | GenericName=Keyboard Automation | ||
77 | 5 | Comment=Program keyboard shortcuts | ||
78 | 6 | Exec=autokey-gtk | ||
79 | 7 | Terminal=false | ||
80 | 8 | Type=Application | ||
81 | 9 | Icon=/usr/share/pixmaps/akicon.png | ||
82 | 10 | Categories=GNOME;Utility; | ||
83 | 0 | 11 | ||
84 | === added file 'config/autokey-qt.desktop' | |||
85 | --- config/autokey-qt.desktop 1970-01-01 00:00:00 +0000 | |||
86 | +++ config/autokey-qt.desktop 2010-03-26 15:01:22 +0000 | |||
87 | @@ -0,0 +1,10 @@ | |||
88 | 1 | # $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $ | ||
89 | 2 | [Desktop Entry] | ||
90 | 3 | Name=AutoKey (QT) | ||
91 | 4 | GenericName=Keyboard Automation | ||
92 | 5 | Comment=Program keyboard shortcuts | ||
93 | 6 | Exec=autokey-qt | ||
94 | 7 | Terminal=false | ||
95 | 8 | Type=Application | ||
96 | 9 | Icon=/usr/share/pixmaps/akicon.png | ||
97 | 10 | Categories=KDE;Utility; | ||
98 | 0 | 11 | ||
99 | === removed file 'config/autokey.desktop' | |||
100 | --- config/autokey.desktop 2009-09-27 15:08:28 +0000 | |||
101 | +++ config/autokey.desktop 1970-01-01 00:00:00 +0000 | |||
102 | @@ -1,10 +0,0 @@ | |||
103 | 1 | # $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $ | ||
104 | 2 | [Desktop Entry] | ||
105 | 3 | Name=AutoKey | ||
106 | 4 | GenericName=Keyboard Automation | ||
107 | 5 | Comment=Program keyboard shortcuts | ||
108 | 6 | Exec=autokey | ||
109 | 7 | Terminal=false | ||
110 | 8 | Type=Application | ||
111 | 9 | Icon=/usr/share/pixmaps/akicon.png | ||
112 | 10 | Categories=GNOME;KDE;Utility | ||
113 | 11 | 0 | ||
114 | === added file 'debian/autokey-common.init' | |||
115 | --- debian/autokey-common.init 1970-01-01 00:00:00 +0000 | |||
116 | +++ debian/autokey-common.init 2010-03-26 15:01:22 +0000 | |||
117 | @@ -0,0 +1,150 @@ | |||
118 | 1 | #!/usr/bin/env python | ||
119 | 2 | # -*- coding: utf-8 -*- | ||
120 | 3 | |||
121 | 4 | ### BEGIN INIT INFO | ||
122 | 5 | # Provides: autokey | ||
123 | 6 | # Required-Start: $local_fs | ||
124 | 7 | # Required-Stop: $local_fs | ||
125 | 8 | # Default-Start: 2 3 4 5 | ||
126 | 9 | # Default-Stop: 0 1 6 | ||
127 | 10 | # Short-Description: Start AutoKey daemon. | ||
128 | 11 | # Description: Enable AutoKey's EvDev interface daemon. | ||
129 | 12 | ### END INIT INFO | ||
130 | 13 | |||
131 | 14 | import sys, os, socket, glob, shutil, time | ||
132 | 15 | try: | ||
133 | 16 | from autokey import evdev, daemon | ||
134 | 17 | from autokey.common import DOMAIN_SOCKET_PATH, PACKET_SIZE | ||
135 | 18 | except ImportError: | ||
136 | 19 | # Per DPM ยง 9.3.2 script should fail gracefully if not installed. | ||
137 | 20 | print "It does not seem Autokey is installed. Exiting..." | ||
138 | 21 | sys.exit(0) | ||
139 | 22 | |||
140 | 23 | PACKET_STRING = "%s,%s,%s" | ||
141 | 24 | |||
142 | 25 | BUTTON_MAP = { | ||
143 | 26 | "BTN_LEFT" : '1', | ||
144 | 27 | "BTN_MIDDLE": '2', | ||
145 | 28 | "BTN_RIGHT" : '3' | ||
146 | 29 | } | ||
147 | 30 | |||
148 | 31 | class AutoKeyDaemon(daemon.Daemon): | ||
149 | 32 | |||
150 | 33 | def __init__(self): | ||
151 | 34 | logFile = "/var/log/autokey-daemon.log" | ||
152 | 35 | if os.path.exists(logFile): | ||
153 | 36 | shutil.move(logFile, logFile + '.old') | ||
154 | 37 | daemon.Daemon.__init__(self, '/var/run/autokey-daemon.pid', stdout=logFile, stderr=logFile) | ||
155 | 38 | |||
156 | 39 | def get_device_paths(self): | ||
157 | 40 | keyboardLocations = glob.glob("/dev/input/by-path/*-event-kbd") | ||
158 | 41 | mouseLocations = glob.glob("/dev/input/by-path/*-event-mouse") | ||
159 | 42 | |||
160 | 43 | sys.stdout.write("Keyboards: %s\nMice: %s\n" % (repr(keyboardLocations), repr(mouseLocations))) | ||
161 | 44 | return keyboardLocations + mouseLocations | ||
162 | 45 | |||
163 | 46 | def run(self): | ||
164 | 47 | print "AutoKey daemon starting" | ||
165 | 48 | if os.path.exists(DOMAIN_SOCKET_PATH): | ||
166 | 49 | os.remove(DOMAIN_SOCKET_PATH) | ||
167 | 50 | s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | ||
168 | 51 | s.bind(DOMAIN_SOCKET_PATH) | ||
169 | 52 | os.chmod(DOMAIN_SOCKET_PATH, 0777) | ||
170 | 53 | print "Created domain socket" | ||
171 | 54 | |||
172 | 55 | while True: | ||
173 | 56 | time.sleep(5) # sleep 5 seconds, waiting for devices to appear after resume from S3 | ||
174 | 57 | s.listen(1) | ||
175 | 58 | try: | ||
176 | 59 | conn, addr = s.accept() | ||
177 | 60 | print "Accepted connection" | ||
178 | 61 | except Exception, e: | ||
179 | 62 | print "Fatal error while accepting connections - daemon shutting down" | ||
180 | 63 | print str(e) | ||
181 | 64 | break | ||
182 | 65 | |||
183 | 66 | devices = evdev.DeviceGroup(self.get_device_paths()) | ||
184 | 67 | sys.stdout.flush() | ||
185 | 68 | sys.stderr.flush() | ||
186 | 69 | |||
187 | 70 | while True: | ||
188 | 71 | try: | ||
189 | 72 | event = devices.next_event() | ||
190 | 73 | except OSError: | ||
191 | 74 | print "Unable to read from device(s). Connection will be closed and restarted" | ||
192 | 75 | break | ||
193 | 76 | |||
194 | 77 | if event is not None: | ||
195 | 78 | if event.type == "EV_KEY" and isinstance(event.code, str): | ||
196 | 79 | if event.code.startswith("KEY"): | ||
197 | 80 | # Keyboard event | ||
198 | 81 | code = event.scanCode | ||
199 | 82 | button = '' | ||
200 | 83 | state = event.value | ||
201 | 84 | |||
202 | 85 | try: | ||
203 | 86 | self.send_packet(conn, code, button, state) | ||
204 | 87 | except: | ||
205 | 88 | break | ||
206 | 89 | |||
207 | 90 | elif event.code.startswith("BTN") and event.value == 1: | ||
208 | 91 | # Mouse event - only care about button press, not release | ||
209 | 92 | code = '' | ||
210 | 93 | if event.code in BUTTON_MAP: | ||
211 | 94 | button = BUTTON_MAP[event.code] | ||
212 | 95 | else: | ||
213 | 96 | button = -1 | ||
214 | 97 | state = event.value | ||
215 | 98 | |||
216 | 99 | try: | ||
217 | 100 | self.send_packet(conn, code, button, state) | ||
218 | 101 | except: | ||
219 | 102 | break | ||
220 | 103 | |||
221 | 104 | conn.close() | ||
222 | 105 | devices.close() | ||
223 | 106 | print "Connection closed" | ||
224 | 107 | sys.stdout.flush() | ||
225 | 108 | sys.stderr.flush() | ||
226 | 109 | |||
227 | 110 | def send_packet(self, conn, code, button, state): | ||
228 | 111 | if code: | ||
229 | 112 | code = self.translate_keycode(code) | ||
230 | 113 | sendData = PACKET_STRING % (code, button, state) | ||
231 | 114 | sendData += (PACKET_SIZE - len(sendData)) * ' ' | ||
232 | 115 | conn.send(sendData) | ||
233 | 116 | |||
234 | 117 | def translate_keycode(self, keyCode): | ||
235 | 118 | if keyCode < 151: | ||
236 | 119 | keyCode += 8 | ||
237 | 120 | else: | ||
238 | 121 | print "Got untranslatable evdev keycode: %d\n" % keyCode | ||
239 | 122 | keyCode = 0 | ||
240 | 123 | return keyCode | ||
241 | 124 | |||
242 | 125 | |||
243 | 126 | if __name__ == "__main__": | ||
244 | 127 | #daemon = AutoKeyDaemon('/tmp/autokey-daemon.pid', stdout=sys.__stdout__, stderr=sys.__stderr__) | ||
245 | 128 | daemon = AutoKeyDaemon() | ||
246 | 129 | if len(sys.argv) == 2: | ||
247 | 130 | if 'start' == sys.argv[1]: | ||
248 | 131 | daemon.start() | ||
249 | 132 | elif 'stop' == sys.argv[1]: | ||
250 | 133 | daemon.stop() | ||
251 | 134 | elif 'restart' == sys.argv[1]: | ||
252 | 135 | daemon.restart() | ||
253 | 136 | elif 'force-reload' == sys.argv[1]: | ||
254 | 137 | # we don't support on-the-fly reloading, | ||
255 | 138 | # so just restart the daemon per DPM 9.3.2 | ||
256 | 139 | daemon.restart() | ||
257 | 140 | else: | ||
258 | 141 | print "Unknown command" | ||
259 | 142 | sys.exit(2) | ||
260 | 143 | sys.exit(0) | ||
261 | 144 | else: | ||
262 | 145 | print "usage: %s {start|stop|restart|force-reload}" % sys.argv[0] | ||
263 | 146 | sys.exit(2) | ||
264 | 147 | |||
265 | 148 | sys.exit(0) | ||
266 | 149 | |||
267 | 150 | |||
268 | 0 | 151 | ||
269 | === added file 'debian/autokey-common.install' | |||
270 | --- debian/autokey-common.install 1970-01-01 00:00:00 +0000 | |||
271 | +++ debian/autokey-common.install 2010-03-26 15:01:22 +0000 | |||
272 | @@ -0,0 +1,13 @@ | |||
273 | 1 | usr/lib/python*/*-packages/autokey/common.py | ||
274 | 2 | usr/lib/python*/*-packages/autokey/configmanager.py | ||
275 | 3 | usr/lib/python*/*-packages/autokey/daemon.py | ||
276 | 4 | usr/lib/python*/*-packages/autokey/evdev.py | ||
277 | 5 | usr/lib/python*/*-packages/autokey/__init__.py | ||
278 | 6 | usr/lib/python*/*-packages/autokey/interface.py | ||
279 | 7 | usr/lib/python*/*-packages/autokey/iomediator.py | ||
280 | 8 | usr/lib/python*/*-packages/autokey/model.py | ||
281 | 9 | usr/lib/python*/*-packages/autokey/nogui.py | ||
282 | 10 | usr/lib/python*/*-packages/autokey/scripting.py | ||
283 | 11 | usr/lib/python*/*-packages/autokey/service.py | ||
284 | 12 | usr/lib/python*/*-packages/autokey-*.egg-info | ||
285 | 13 | usr/share/pixmaps/akicon.png | ||
286 | 0 | 14 | ||
287 | === added file 'debian/autokey-common.lintian-overrides' | |||
288 | --- debian/autokey-common.lintian-overrides 1970-01-01 00:00:00 +0000 | |||
289 | +++ debian/autokey-common.lintian-overrides 2010-03-26 15:01:22 +0000 | |||
290 | @@ -0,0 +1,1 @@ | |||
291 | 1 | autokey-common binary: init.d-script-uses-usr-interpreter | ||
292 | 0 | 2 | ||
293 | === added file 'debian/autokey-common.postinst' | |||
294 | --- debian/autokey-common.postinst 1970-01-01 00:00:00 +0000 | |||
295 | +++ debian/autokey-common.postinst 2010-03-26 15:01:22 +0000 | |||
296 | @@ -0,0 +1,41 @@ | |||
297 | 1 | #!/bin/sh | ||
298 | 2 | # postinst script for test | ||
299 | 3 | # | ||
300 | 4 | # see: dh_installdeb(1) | ||
301 | 5 | |||
302 | 6 | set -e | ||
303 | 7 | |||
304 | 8 | |||
305 | 9 | # We need python-support triggers activated before we start the daemon. | ||
306 | 10 | update-python-modules -p | ||
307 | 11 | |||
308 | 12 | # summary of how this script can be called: | ||
309 | 13 | # * <postinst> `configure' <most-recently-configured-version> | ||
310 | 14 | # * <old-postinst> `abort-upgrade' <new version> | ||
311 | 15 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> | ||
312 | 16 | # <new-version> | ||
313 | 17 | # * <postinst> `abort-remove' | ||
314 | 18 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | ||
315 | 19 | # <failed-install-package> <version> `removing' | ||
316 | 20 | # <conflicting-package> <version> | ||
317 | 21 | # for details, see http://www.debian.org/doc/debian-policy/ or | ||
318 | 22 | # the debian-policy package | ||
319 | 23 | |||
320 | 24 | |||
321 | 25 | # dh_installdeb will replace this with shell code automatically | ||
322 | 26 | # generated by other debhelper scripts. | ||
323 | 27 | |||
324 | 28 | #DEBHELPER# | ||
325 | 29 | |||
326 | 30 | # Automatically added by dh_installinit | ||
327 | 31 | if [ -x "/etc/init.d/autokey" ]; then | ||
328 | 32 | if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then | ||
329 | 33 | invoke-rc.d autokey start || exit $? | ||
330 | 34 | else | ||
331 | 35 | /etc/init.d/autokey start || exit $? | ||
332 | 36 | fi | ||
333 | 37 | fi | ||
334 | 38 | # End automatically added section | ||
335 | 39 | |||
336 | 40 | |||
337 | 41 | exit 0 | ||
338 | 0 | 42 | ||
339 | === added file 'debian/autokey-common.prerm' | |||
340 | --- debian/autokey-common.prerm 1970-01-01 00:00:00 +0000 | |||
341 | +++ debian/autokey-common.prerm 2010-03-26 15:01:22 +0000 | |||
342 | @@ -0,0 +1,34 @@ | |||
343 | 1 | #!/bin/sh | ||
344 | 2 | # prerm script for test | ||
345 | 3 | # | ||
346 | 4 | # see: dh_installdeb(1) | ||
347 | 5 | |||
348 | 6 | set -e | ||
349 | 7 | |||
350 | 8 | # summary of how this script can be called: | ||
351 | 9 | # * <prerm> `remove' | ||
352 | 10 | # * <old-prerm> `upgrade' <new-version> | ||
353 | 11 | # * <new-prerm> `failed-upgrade' <old-version> | ||
354 | 12 | # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> | ||
355 | 13 | # * <deconfigured's-prerm> `deconfigure' `in-favour' | ||
356 | 14 | # <package-being-installed> <version> `removing' | ||
357 | 15 | # <conflicting-package> <version> | ||
358 | 16 | # for details, see http://www.debian.org/doc/debian-policy/ or | ||
359 | 17 | # the debian-policy package | ||
360 | 18 | |||
361 | 19 | # Automatically added by dh_installinit | ||
362 | 20 | if [ -x "/etc/init.d/autokey" ]; then | ||
363 | 21 | if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then | ||
364 | 22 | invoke-rc.d autokey stop || exit $? | ||
365 | 23 | else | ||
366 | 24 | /etc/init.d/autokey stop || exit $? | ||
367 | 25 | fi | ||
368 | 26 | fi | ||
369 | 27 | # End automatically added section | ||
370 | 28 | |||
371 | 29 | # dh_installdeb will replace this with shell code automatically | ||
372 | 30 | # generated by other debhelper scripts. | ||
373 | 31 | |||
374 | 32 | #DEBHELPER# | ||
375 | 33 | |||
376 | 34 | exit 0 | ||
377 | 0 | 35 | ||
378 | === added file 'debian/autokey-gtk.install' | |||
379 | --- debian/autokey-gtk.install 1970-01-01 00:00:00 +0000 | |||
380 | +++ debian/autokey-gtk.install 2010-03-26 15:01:22 +0000 | |||
381 | @@ -0,0 +1,6 @@ | |||
382 | 1 | usr/lib/python*/*-packages/autokey/gtkui/ | ||
383 | 2 | usr/lib/python*/*-packages/autokey/gtkapp.py | ||
384 | 3 | usr/bin/autokey-gtk | ||
385 | 4 | usr/share/applications/autokey-gtk.desktop | ||
386 | 5 | usr/share/man/man1/autokey-gtk.1 | ||
387 | 6 | usr/share/pixmaps/akicon-status.png | ||
388 | 0 | \ No newline at end of file | 7 | \ No newline at end of file |
389 | 1 | 8 | ||
390 | === added file 'debian/autokey-gtk.postinst' | |||
391 | --- debian/autokey-gtk.postinst 1970-01-01 00:00:00 +0000 | |||
392 | +++ debian/autokey-gtk.postinst 2010-03-26 15:01:22 +0000 | |||
393 | @@ -0,0 +1,9 @@ | |||
394 | 1 | #!/bin/sh -e | ||
395 | 2 | |||
396 | 3 | update-alternatives --install /usr/bin/autokey autokey \ | ||
397 | 4 | /usr/bin/autokey-gtk 50 \ | ||
398 | 5 | --slave /usr/share/man/man1/autokey.1.gz autokey.1.gz \ | ||
399 | 6 | /usr/share/man/man1/autokey-gtk.1.gz | ||
400 | 7 | |||
401 | 8 | #DEBHELPER# | ||
402 | 9 | |||
403 | 0 | 10 | ||
404 | === added file 'debian/autokey-gtk.prerm' | |||
405 | --- debian/autokey-gtk.prerm 1970-01-01 00:00:00 +0000 | |||
406 | +++ debian/autokey-gtk.prerm 2010-03-26 15:01:22 +0000 | |||
407 | @@ -0,0 +1,12 @@ | |||
408 | 1 | #!/bin/sh -e | ||
409 | 2 | |||
410 | 3 | case "$1" in | ||
411 | 4 | remove|deconfigure) | ||
412 | 5 | update-alternatives --remove autokey /usr/bin/autokey-gtk | ||
413 | 6 | ;; | ||
414 | 7 | esac | ||
415 | 8 | |||
416 | 9 | #DEBHELPER# | ||
417 | 10 | |||
418 | 11 | exit 0 | ||
419 | 12 | |||
420 | 0 | 13 | ||
421 | === added file 'debian/autokey-qt.install' | |||
422 | --- debian/autokey-qt.install 1970-01-01 00:00:00 +0000 | |||
423 | +++ debian/autokey-qt.install 2010-03-26 15:01:22 +0000 | |||
424 | @@ -0,0 +1,5 @@ | |||
425 | 1 | usr/lib/python*/*-packages/autokey/qtui/ | ||
426 | 2 | usr/lib/python*/*-packages/autokey/qtapp.py | ||
427 | 3 | usr/bin/autokey-qt | ||
428 | 4 | usr/share/applications/autokey-qt.desktop | ||
429 | 5 | usr/share/man/man1/autokey-qt.1 | ||
430 | 0 | 6 | ||
431 | === added file 'debian/autokey-qt.postinst' | |||
432 | --- debian/autokey-qt.postinst 1970-01-01 00:00:00 +0000 | |||
433 | +++ debian/autokey-qt.postinst 2010-03-26 15:01:22 +0000 | |||
434 | @@ -0,0 +1,9 @@ | |||
435 | 1 | #!/bin/sh -e | ||
436 | 2 | |||
437 | 3 | update-alternatives --install /usr/bin/autokey autokey \ | ||
438 | 4 | /usr/bin/autokey-qt 60 \ | ||
439 | 5 | --slave /usr/share/man/man1/autokey.1.gz autokey.1.gz \ | ||
440 | 6 | /usr/share/man/man1/autokey-qt.1.gz | ||
441 | 7 | |||
442 | 8 | #DEBHELPER# | ||
443 | 9 | |||
444 | 0 | 10 | ||
445 | === added file 'debian/autokey-qt.prerm' | |||
446 | --- debian/autokey-qt.prerm 1970-01-01 00:00:00 +0000 | |||
447 | +++ debian/autokey-qt.prerm 2010-03-26 15:01:22 +0000 | |||
448 | @@ -0,0 +1,12 @@ | |||
449 | 1 | #!/bin/sh -e | ||
450 | 2 | |||
451 | 3 | case "$1" in | ||
452 | 4 | remove|deconfigure) | ||
453 | 5 | update-alternatives --remove autokey /usr/bin/autokey-qt | ||
454 | 6 | ;; | ||
455 | 7 | esac | ||
456 | 8 | |||
457 | 9 | #DEBHELPER# | ||
458 | 10 | |||
459 | 11 | exit 0 | ||
460 | 12 | |||
461 | 0 | 13 | ||
462 | === removed file 'debian/autokey.1' | |||
463 | --- debian/autokey.1 2009-09-27 15:08:28 +0000 | |||
464 | +++ debian/autokey.1 1970-01-01 00:00:00 +0000 | |||
465 | @@ -1,54 +0,0 @@ | |||
466 | 1 | .\" Hey, EMACS: -*- nroff -*- | ||
467 | 2 | .\" First parameter, NAME, should be all caps | ||
468 | 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection | ||
469 | 4 | .\" other parameters are allowed: see man(7), man(1) | ||
470 | 5 | .TH AUTOKEY "1" "August 19, 2009" | ||
471 | 6 | .\" Please adjust this date whenever revising the manpage. | ||
472 | 7 | .\" | ||
473 | 8 | .\" Some roff macros, for reference: | ||
474 | 9 | .\" .nh disable hyphenation | ||
475 | 10 | .\" .hy enable hyphenation | ||
476 | 11 | .\" .ad l left justify | ||
477 | 12 | .\" .ad b justify to both left and right margins | ||
478 | 13 | .\" .nf disable filling | ||
479 | 14 | .\" .fi enable filling | ||
480 | 15 | .\" .br insert line break | ||
481 | 16 | .\" .sp <n> insert n+1 empty lines | ||
482 | 17 | .\" for manpage-specific macros, see man(7) | ||
483 | 18 | .SH NAME | ||
484 | 19 | autokey \- keyboard automation utility | ||
485 | 20 | .SH SYNOPSIS | ||
486 | 21 | .B autokey | ||
487 | 22 | .RI [ options ] | ||
488 | 23 | .SH DESCRIPTION | ||
489 | 24 | This manual page briefly documents the | ||
490 | 25 | .B autokey | ||
491 | 26 | command. | ||
492 | 27 | .PP | ||
493 | 28 | .\" TeX users may be more comfortable with the \fB<whatever>\fP and | ||
494 | 29 | .\" \fI<whatever>\fP escape sequences to invode bold face and italics, | ||
495 | 30 | .\" respectively. | ||
496 | 31 | \fBautokey\fP AutoKey is a desktop automation utility for Linux and X11. It allows | ||
497 | 32 | the automation of virtually any task by responding to typed abbreviations and hotkeys. It | ||
498 | 33 | offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting | ||
499 | 34 | interface offering the full flexibility and power of the Python language. | ||
500 | 35 | .br | ||
501 | 36 | For more information refer to the online wiki at: | ||
502 | 37 | http://code.google.com/p/autokey/w/list | ||
503 | 38 | .SH OPTIONS | ||
504 | 39 | This program follows the usual GNU command line syntax, with long | ||
505 | 40 | options starting with two dashes (`-'). | ||
506 | 41 | A summary of options is included below. | ||
507 | 42 | .TP | ||
508 | 43 | .B \-\-help | ||
509 | 44 | Show summary of options. | ||
510 | 45 | .TP | ||
511 | 46 | .B \-l, \-\-verbose | ||
512 | 47 | Enable verbose (debug) logging. | ||
513 | 48 | .TP | ||
514 | 49 | .B \-c, \-\-configure | ||
515 | 50 | Show the configuration window on startup, even if this is not the first run. | ||
516 | 51 | .SH AUTHOR | ||
517 | 52 | AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson. | ||
518 | 53 | .PP | ||
519 | 54 | This manual page was written by Chris Dekter <cdekter@gmail.com>. | ||
520 | 55 | 0 | ||
521 | === removed file 'debian/autokey.init' | |||
522 | --- debian/autokey.init 2010-01-08 08:52:58 +0000 | |||
523 | +++ debian/autokey.init 1970-01-01 00:00:00 +0000 | |||
524 | @@ -1,145 +0,0 @@ | |||
525 | 1 | #!/usr/bin/env python | ||
526 | 2 | # -*- coding: utf-8 -*- | ||
527 | 3 | |||
528 | 4 | ### BEGIN INIT INFO | ||
529 | 5 | # Provides: autokey | ||
530 | 6 | # Required-Start: $local_fs | ||
531 | 7 | # Required-Stop: $local_fs | ||
532 | 8 | # Default-Start: 2 3 4 5 | ||
533 | 9 | # Default-Stop: 0 1 6 | ||
534 | 10 | # Short-Description: Start AutoKey daemon. | ||
535 | 11 | # Description: Enable AutoKey's EvDev interface daemon. | ||
536 | 12 | ### END INIT INFO | ||
537 | 13 | |||
538 | 14 | import sys, os, socket, glob, shutil, time | ||
539 | 15 | from autokey import evdev, daemon | ||
540 | 16 | from autokey.interface import DOMAIN_SOCKET_PATH, PACKET_SIZE | ||
541 | 17 | |||
542 | 18 | PACKET_STRING = "%s,%s,%s" | ||
543 | 19 | |||
544 | 20 | BUTTON_MAP = { | ||
545 | 21 | "BTN_LEFT" : '1', | ||
546 | 22 | "BTN_MIDDLE": '2', | ||
547 | 23 | "BTN_RIGHT" : '3' | ||
548 | 24 | } | ||
549 | 25 | |||
550 | 26 | class AutoKeyDaemon(daemon.Daemon): | ||
551 | 27 | |||
552 | 28 | def __init__(self): | ||
553 | 29 | logFile = "/var/log/autokey-daemon.log" | ||
554 | 30 | if os.path.exists(logFile): | ||
555 | 31 | shutil.move(logFile, logFile + '.old') | ||
556 | 32 | daemon.Daemon.__init__(self, '/tmp/autokey-daemon.pid', stdout=logFile, stderr=logFile) | ||
557 | 33 | |||
558 | 34 | def get_device_paths(self): | ||
559 | 35 | keyboardLocations = glob.glob("/dev/input/by-path/*-event-kbd") | ||
560 | 36 | mouseLocations = glob.glob("/dev/input/by-path/*-event-mouse") | ||
561 | 37 | |||
562 | 38 | sys.stdout.write("Keyboards: %s\nMice: %s\n" % (repr(keyboardLocations), repr(mouseLocations))) | ||
563 | 39 | return keyboardLocations + mouseLocations | ||
564 | 40 | |||
565 | 41 | def run(self): | ||
566 | 42 | print "AutoKey daemon starting" | ||
567 | 43 | if os.path.exists(DOMAIN_SOCKET_PATH): | ||
568 | 44 | os.remove(DOMAIN_SOCKET_PATH) | ||
569 | 45 | s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | ||
570 | 46 | s.bind(DOMAIN_SOCKET_PATH) | ||
571 | 47 | os.chmod(DOMAIN_SOCKET_PATH, 0777) | ||
572 | 48 | print "Created domain socket" | ||
573 | 49 | |||
574 | 50 | while True: | ||
575 | 51 | time.sleep(5) # sleep 5 seconds, waiting for devices to appear after resume from S3 | ||
576 | 52 | s.listen(1) | ||
577 | 53 | try: | ||
578 | 54 | conn, addr = s.accept() | ||
579 | 55 | print "Accepted connection" | ||
580 | 56 | except Exception, e: | ||
581 | 57 | print "Fatal error while accepting connections - daemon shutting down" | ||
582 | 58 | print str(e) | ||
583 | 59 | break | ||
584 | 60 | |||
585 | 61 | devices = evdev.DeviceGroup(self.get_device_paths()) | ||
586 | 62 | sys.stdout.flush() | ||
587 | 63 | sys.stderr.flush() | ||
588 | 64 | |||
589 | 65 | while True: | ||
590 | 66 | try: | ||
591 | 67 | event = devices.next_event() | ||
592 | 68 | except OSError: | ||
593 | 69 | print "Unable to read from device(s). Connection will be closed and restarted" | ||
594 | 70 | break | ||
595 | 71 | |||
596 | 72 | if event is not None: | ||
597 | 73 | if event.type == "EV_KEY" and isinstance(event.code, str): | ||
598 | 74 | if event.code.startswith("KEY"): | ||
599 | 75 | # Keyboard event | ||
600 | 76 | code = event.scanCode | ||
601 | 77 | button = '' | ||
602 | 78 | state = event.value | ||
603 | 79 | |||
604 | 80 | try: | ||
605 | 81 | self.send_packet(conn, code, button, state) | ||
606 | 82 | except: | ||
607 | 83 | break | ||
608 | 84 | |||
609 | 85 | elif event.code.startswith("BTN") and event.value == 1: | ||
610 | 86 | # Mouse event - only care about button press, not release | ||
611 | 87 | code = '' | ||
612 | 88 | if event.code in BUTTON_MAP: | ||
613 | 89 | button = BUTTON_MAP[event.code] | ||
614 | 90 | else: | ||
615 | 91 | button = -1 | ||
616 | 92 | state = event.value | ||
617 | 93 | |||
618 | 94 | try: | ||
619 | 95 | self.send_packet(conn, code, button, state) | ||
620 | 96 | except: | ||
621 | 97 | break | ||
622 | 98 | |||
623 | 99 | conn.close() | ||
624 | 100 | devices.close() | ||
625 | 101 | print "Connection closed" | ||
626 | 102 | sys.stdout.flush() | ||
627 | 103 | sys.stderr.flush() | ||
628 | 104 | |||
629 | 105 | def send_packet(self, conn, code, button, state): | ||
630 | 106 | if code: | ||
631 | 107 | code = self.translate_keycode(code) | ||
632 | 108 | sendData = PACKET_STRING % (code, button, state) | ||
633 | 109 | sendData += (PACKET_SIZE - len(sendData)) * ' ' | ||
634 | 110 | conn.send(sendData) | ||
635 | 111 | |||
636 | 112 | def translate_keycode(self, keyCode): | ||
637 | 113 | if keyCode < 151: | ||
638 | 114 | keyCode += 8 | ||
639 | 115 | else: | ||
640 | 116 | print "Got untranslatable evdev keycode: %d\n" % keyCode | ||
641 | 117 | keyCode = 0 | ||
642 | 118 | return keyCode | ||
643 | 119 | |||
644 | 120 | |||
645 | 121 | if __name__ == "__main__": | ||
646 | 122 | #daemon = AutoKeyDaemon('/tmp/autokey-daemon.pid', stdout=sys.__stdout__, stderr=sys.__stderr__) | ||
647 | 123 | daemon = AutoKeyDaemon() | ||
648 | 124 | if len(sys.argv) == 2: | ||
649 | 125 | if 'start' == sys.argv[1]: | ||
650 | 126 | daemon.start() | ||
651 | 127 | elif 'stop' == sys.argv[1]: | ||
652 | 128 | daemon.stop() | ||
653 | 129 | elif 'restart' == sys.argv[1]: | ||
654 | 130 | daemon.restart() | ||
655 | 131 | elif 'force-reload' == sys.argv[1]: | ||
656 | 132 | # we don't support on-the-fly reloading, | ||
657 | 133 | # so just restart the daemon per DPM 9.3.2 | ||
658 | 134 | daemon.restart() | ||
659 | 135 | else: | ||
660 | 136 | print "Unknown command" | ||
661 | 137 | sys.exit(2) | ||
662 | 138 | sys.exit(0) | ||
663 | 139 | else: | ||
664 | 140 | print "usage: %s {start|stop|restart|force-reload}" % sys.argv[0] | ||
665 | 141 | sys.exit(2) | ||
666 | 142 | |||
667 | 143 | sys.exit(0) | ||
668 | 144 | |||
669 | 145 | |||
670 | 146 | 0 | ||
671 | === removed file 'debian/autokey.lintian-overrides' | |||
672 | --- debian/autokey.lintian-overrides 2009-07-20 23:19:40 +0000 | |||
673 | +++ debian/autokey.lintian-overrides 1970-01-01 00:00:00 +0000 | |||
674 | @@ -1,1 +0,0 @@ | |||
675 | 1 | autokey binary: init.d-script-uses-usr-interpreter | ||
676 | 2 | 0 | ||
677 | === modified file 'debian/changelog' | |||
678 | --- debian/changelog 2010-01-08 08:52:58 +0000 | |||
679 | +++ debian/changelog 2010-03-26 15:01:22 +0000 | |||
680 | @@ -1,3 +1,48 @@ | |||
681 | 1 | autokey (0.61.5-1ubuntu1) lucid; urgency=low | ||
682 | 2 | |||
683 | 3 | * Make "autokey" a transitional package for autokey-gtk rather than -qt. | ||
684 | 4 | |||
685 | 5 | -- Luke Faraone <luke@faraone.cc> Wed, 24 Mar 2010 22:06:35 -0400 | ||
686 | 6 | |||
687 | 7 | autokey (0.61.5-1) unstable; urgency=low | ||
688 | 8 | |||
689 | 9 | * New upstream version: | ||
690 | 10 | - Combine GTK and QT versions into single source tree | ||
691 | 11 | * Provide "autokey" as a transitional package to autokey-common and autokey-qt | ||
692 | 12 | * debian/autokey-common.postinst: call `update-python-modules -p` so that | ||
693 | 13 | starting the daemon does not fail if qt4 was not fully configured. | ||
694 | 14 | (LP: #543654) | ||
695 | 15 | |||
696 | 16 | -- Luke Faraone <luke@faraone.cc> Tue, 23 Mar 2010 10:19:47 -0400 | ||
697 | 17 | |||
698 | 18 | autokey (0.61.3-2) unstable; urgency=high | ||
699 | 19 | |||
700 | 20 | * SECURITY UPDATE: arbitrary file overwriting via symlinks (LP: #538471) | ||
701 | 21 | - Store files for the EvDev daamon in FHS-specified locations | ||
702 | 22 | - debian/autokey.init: Set pidfile path to '/var/run/autokey-daemon.pid' | ||
703 | 23 | - src/lib/interface.py: Set DOMAIN_SOCKET_PATH to "/var/run/autokey-daemon" | ||
704 | 24 | - CVE-2010-0398 | ||
705 | 25 | |||
706 | 26 | -- Luke Faraone <luke@faraone.cc> Sat, 13 Mar 2010 22:25:44 -0500 | ||
707 | 27 | |||
708 | 28 | autokey (0.61.3-1) unstable; urgency=low | ||
709 | 29 | |||
710 | 30 | * debian/rules: call dh_installinit with --error-handler so that install | ||
711 | 31 | doesn't fail if Autokey cannot be restarted during configure (LP: #479131) | ||
712 | 32 | * New upstream version: | ||
713 | 33 | - Merge changes to interface.py from GTK branch that were missed | ||
714 | 34 | |||
715 | 35 | -- Luke Faraone <luke@faraone.cc> Sat, 27 Feb 2010 11:05:08 -0500 | ||
716 | 36 | |||
717 | 37 | autokey (0.61.2-2) unstable; urgency=low | ||
718 | 38 | |||
719 | 39 | * Set DM-Upload-Allowed to Yes in control | ||
720 | 40 | * Patch src/lib/daemon.py to handle empty or invalid PIDs (closes: #568070) | ||
721 | 41 | * Fix typo in Vcs-Browser | ||
722 | 42 | * Bump standards version | ||
723 | 43 | |||
724 | 44 | -- Luke Faraone <luke@faraone.cc> Wed, 03 Feb 2010 09:16:24 -0500 | ||
725 | 45 | |||
726 | 1 | autokey (0.61.2-1) unstable; urgency=low | 46 | autokey (0.61.2-1) unstable; urgency=low |
727 | 2 | 47 | ||
728 | 3 | * New upstream version: | 48 | * New upstream version: |
729 | 4 | 49 | ||
730 | === modified file 'debian/compat' | |||
731 | --- debian/compat 2009-07-20 23:19:40 +0000 | |||
732 | +++ debian/compat 2010-03-26 15:01:22 +0000 | |||
733 | @@ -1,1 +1,1 @@ | |||
735 | 1 | 6 | 1 | 7 |
736 | 2 | 2 | ||
737 | === modified file 'debian/control' | |||
738 | --- debian/control 2009-12-16 08:46:43 +0000 | |||
739 | +++ debian/control 2010-03-26 15:01:22 +0000 | |||
740 | @@ -1,23 +1,68 @@ | |||
741 | 1 | Source: autokey | 1 | Source: autokey |
742 | 2 | Section: kde | ||
743 | 3 | Priority: optional | 2 | Priority: optional |
745 | 4 | Maintainer: Luke Faraone <luke@faraone.cc> | 3 | Section: utils |
746 | 4 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | ||
747 | 5 | XSBC-Original-Maintainer: Luke Faraone <luke@faraone.cc> | ||
748 | 5 | Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> | 6 | Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> |
752 | 6 | Build-Depends: python (>= 2.5), cdbs (>= 0.4.49), debhelper (>= 6), dpatch | 7 | Build-Depends: python (>= 2.5), cdbs (>= 0.4.49), debhelper (>= 7) |
753 | 7 | Build-Depends-indep: python-central (>= 0.6.0) | 8 | Build-Depends-indep: python-central, dpatch |
754 | 8 | Standards-Version: 3.8.3 | 9 | Standards-Version: 3.8.4 |
755 | 10 | DM-Upload-Allowed: yes | ||
756 | 9 | XS-Python-Version: >= 2.5 | 11 | XS-Python-Version: >= 2.5 |
757 | 10 | Homepage: http://code.google.com/p/autokey/ | 12 | Homepage: http://code.google.com/p/autokey/ |
758 | 11 | Vcs-Svn: svn://svn.debian.org/python-apps/packages/autokey/trunk | 13 | Vcs-Svn: svn://svn.debian.org/python-apps/packages/autokey/trunk |
760 | 12 | Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/autokeyp/trunk/ | 14 | Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/autokey/trunk/ |
761 | 13 | 15 | ||
762 | 14 | Package: autokey | 16 | Package: autokey |
763 | 15 | Architecture: all | 17 | Architecture: all |
772 | 16 | Depends: ${python:Depends}, ${misc:Depends}, python-kde4, python-qt4, python-qscintilla2, python-xlib, wmctrl | 18 | Depends: ${misc:Depends}, autokey-gtk, autokey-common |
773 | 17 | XB-Python-Version: ${python:Versions} | 19 | Description: dummy transitional package for autokey-gtk |
774 | 18 | Description: desktop automation utility | 20 | This transitional package helps users transition to the autokey-gtk package. |
775 | 19 | AutoKey is a desktop automation utility for Linux and X11. It allows the | 21 | Once this package and its dependencies are installed you can safely remove it. |
776 | 20 | automation of virtually any task by responding to typed abbreviations and | 22 | |
777 | 21 | hotkeys. It offers a full-featured GUI that makes it highly accessible for | 23 | Package: autokey-common |
778 | 22 | novices, as well as a scripting interface offering the full flexibility and | 24 | Architecture: all |
779 | 23 | power of the Python language. | 25 | Depends: ${python:Depends}, ${misc:Depends}, python-xlib, wmctrl |
780 | 26 | Replaces: autokey (<<0.61.4-0~0) | ||
781 | 27 | Breaks: autokey (<<0.61.4-0~0) | ||
782 | 28 | XB-Python-Version: ${python:Versions} | ||
783 | 29 | Description: desktop automation utility - common data | ||
784 | 30 | AutoKey is a desktop automation utility for Linux and X11. It allows the | ||
785 | 31 | automation of virtually any task by responding to typed abbreviations and | ||
786 | 32 | hotkeys. It offers a full-featured GUI that makes it highly accessible for | ||
787 | 33 | novices, as well as a scripting interface offering the full flexibility and | ||
788 | 34 | power of the Python language. | ||
789 | 35 | . | ||
790 | 36 | This package contains the common data shared between the various frontends. | ||
791 | 37 | |||
792 | 38 | Package: autokey-qt | ||
793 | 39 | Section: kde | ||
794 | 40 | Architecture: all | ||
795 | 41 | Depends: ${python:Depends}, ${misc:Depends}, python-kde4, python-qt4, python-qscintilla2, python-xlib, wmctrl, autokey-common | ||
796 | 42 | Replaces: autokey (<<0.61.4-0~0) | ||
797 | 43 | Breaks: autokey (<<0.61.4-0~0) | ||
798 | 44 | XB-Python-Version: ${python:Versions} | ||
799 | 45 | Description: desktop automation utility - QT version | ||
800 | 46 | AutoKey is a desktop automation utility for Linux and X11. It allows the | ||
801 | 47 | automation of virtually any task by responding to typed abbreviations and | ||
802 | 48 | hotkeys. It offers a full-featured GUI that makes it highly accessible for | ||
803 | 49 | novices, as well as a scripting interface offering the full flexibility and | ||
804 | 50 | power of the Python language. | ||
805 | 51 | . | ||
806 | 52 | This package contains the QT frontend. | ||
807 | 53 | |||
808 | 54 | Package: autokey-gtk | ||
809 | 55 | Section: gnome | ||
810 | 56 | Architecture: all | ||
811 | 57 | Depends: ${python:Depends}, ${misc:Depends}, python-gtk2, python-gtksourceview2, python-glade2, python-xlib, python-notify, wmctrl, autokey-common | ||
812 | 58 | Replaces: autokey (<<0.61.4-0~0) | ||
813 | 59 | Breaks: autokey (<<0.61.4-0~0) | ||
814 | 60 | XB-Python-Version: ${python:Versions} | ||
815 | 61 | Description: desktop automation utility - GTK+ version | ||
816 | 62 | AutoKey is a desktop automation utility for Linux and X11. It allows the | ||
817 | 63 | automation of virtually any task by responding to typed abbreviations and | ||
818 | 64 | hotkeys. It offers a full-featured GUI that makes it highly accessible for | ||
819 | 65 | novices, as well as a scripting interface offering the full flexibility and | ||
820 | 66 | power of the Python language. | ||
821 | 67 | . | ||
822 | 68 | This package contains the GTK+ frontend. | ||
823 | 24 | 69 | ||
824 | === modified file 'debian/copyright' | |||
825 | --- debian/copyright 2009-09-27 15:08:28 +0000 | |||
826 | +++ debian/copyright 2010-03-26 15:01:22 +0000 | |||
827 | @@ -34,6 +34,6 @@ | |||
828 | 34 | The Debian packaging is | 34 | The Debian packaging is |
829 | 35 | 35 | ||
830 | 36 | Copyright ยฉ 2009, Chris Dekter <cdekter@gmail.com> | 36 | Copyright ยฉ 2009, Chris Dekter <cdekter@gmail.com> |
832 | 37 | Copyright ยฉ 2009, Luke Faraone <luke@faraone.cc> | 37 | Copyright ยฉ 2009 - 2010, Luke Faraone <luke@faraone.cc> |
833 | 38 | 38 | ||
834 | 39 | and is licensed under the GPL, see above. | 39 | and is licensed under the GPL, see above. |
835 | 40 | 40 | ||
836 | === modified file 'debian/patches/00list' | |||
837 | --- debian/patches/00list 2009-12-16 08:46:43 +0000 | |||
838 | +++ debian/patches/00list 2010-03-26 15:01:22 +0000 | |||
839 | @@ -1,2 +1,1 @@ | |||
840 | 1 | # no comment | 1 | # no comment |
841 | 2 | |||
842 | 3 | 2 | ||
843 | === added file 'debian/patches/README' | |||
844 | --- debian/patches/README 1970-01-01 00:00:00 +0000 | |||
845 | +++ debian/patches/README 2010-03-26 15:01:22 +0000 | |||
846 | @@ -0,0 +1,4 @@ | |||
847 | 1 | 0xxx: Grabbed from upstream development. | ||
848 | 2 | 1xxx: Possibly relevant for upstream adoption. | ||
849 | 3 | 2xxx: Only relevant for official Debian release. | ||
850 | 4 | |||
851 | 0 | 5 | ||
852 | === removed file 'debian/postinst' | |||
853 | --- debian/postinst 2009-07-20 23:19:40 +0000 | |||
854 | +++ debian/postinst 1970-01-01 00:00:00 +0000 | |||
855 | @@ -1,37 +0,0 @@ | |||
856 | 1 | #!/bin/sh | ||
857 | 2 | # postinst script for test | ||
858 | 3 | # | ||
859 | 4 | # see: dh_installdeb(1) | ||
860 | 5 | |||
861 | 6 | set -e | ||
862 | 7 | |||
863 | 8 | # summary of how this script can be called: | ||
864 | 9 | # * <postinst> `configure' <most-recently-configured-version> | ||
865 | 10 | # * <old-postinst> `abort-upgrade' <new version> | ||
866 | 11 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> | ||
867 | 12 | # <new-version> | ||
868 | 13 | # * <postinst> `abort-remove' | ||
869 | 14 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | ||
870 | 15 | # <failed-install-package> <version> `removing' | ||
871 | 16 | # <conflicting-package> <version> | ||
872 | 17 | # for details, see http://www.debian.org/doc/debian-policy/ or | ||
873 | 18 | # the debian-policy package | ||
874 | 19 | |||
875 | 20 | |||
876 | 21 | # dh_installdeb will replace this with shell code automatically | ||
877 | 22 | # generated by other debhelper scripts. | ||
878 | 23 | |||
879 | 24 | #DEBHELPER# | ||
880 | 25 | |||
881 | 26 | # Automatically added by dh_installinit | ||
882 | 27 | if [ -x "/etc/init.d/autokey" ]; then | ||
883 | 28 | if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then | ||
884 | 29 | invoke-rc.d autokey start || exit $? | ||
885 | 30 | else | ||
886 | 31 | /etc/init.d/autokey start || exit $? | ||
887 | 32 | fi | ||
888 | 33 | fi | ||
889 | 34 | # End automatically added section | ||
890 | 35 | |||
891 | 36 | |||
892 | 37 | exit 0 | ||
893 | 38 | 0 | ||
894 | === removed file 'debian/prerm' | |||
895 | --- debian/prerm 2009-07-20 23:19:40 +0000 | |||
896 | +++ debian/prerm 1970-01-01 00:00:00 +0000 | |||
897 | @@ -1,34 +0,0 @@ | |||
898 | 1 | #!/bin/sh | ||
899 | 2 | # prerm script for test | ||
900 | 3 | # | ||
901 | 4 | # see: dh_installdeb(1) | ||
902 | 5 | |||
903 | 6 | set -e | ||
904 | 7 | |||
905 | 8 | # summary of how this script can be called: | ||
906 | 9 | # * <prerm> `remove' | ||
907 | 10 | # * <old-prerm> `upgrade' <new-version> | ||
908 | 11 | # * <new-prerm> `failed-upgrade' <old-version> | ||
909 | 12 | # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> | ||
910 | 13 | # * <deconfigured's-prerm> `deconfigure' `in-favour' | ||
911 | 14 | # <package-being-installed> <version> `removing' | ||
912 | 15 | # <conflicting-package> <version> | ||
913 | 16 | # for details, see http://www.debian.org/doc/debian-policy/ or | ||
914 | 17 | # the debian-policy package | ||
915 | 18 | |||
916 | 19 | # Automatically added by dh_installinit | ||
917 | 20 | if [ -x "/etc/init.d/autokey" ]; then | ||
918 | 21 | if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then | ||
919 | 22 | invoke-rc.d autokey stop || exit $? | ||
920 | 23 | else | ||
921 | 24 | /etc/init.d/autokey stop || exit $? | ||
922 | 25 | fi | ||
923 | 26 | fi | ||
924 | 27 | # End automatically added section | ||
925 | 28 | |||
926 | 29 | # dh_installdeb will replace this with shell code automatically | ||
927 | 30 | # generated by other debhelper scripts. | ||
928 | 31 | |||
929 | 32 | #DEBHELPER# | ||
930 | 33 | |||
931 | 34 | exit 0 | ||
932 | 35 | 0 | ||
933 | === modified file 'debian/rules' | |||
934 | --- debian/rules 2009-12-06 14:21:22 +0000 | |||
935 | +++ debian/rules 2010-03-26 15:01:22 +0000 | |||
936 | @@ -5,11 +5,8 @@ | |||
937 | 5 | include /usr/share/cdbs/1/rules/debhelper.mk | 5 | include /usr/share/cdbs/1/rules/debhelper.mk |
938 | 6 | include /usr/share/cdbs/1/class/python-distutils.mk | 6 | include /usr/share/cdbs/1/class/python-distutils.mk |
939 | 7 | 7 | ||
940 | 8 | include /usr/share/cdbs/1/rules/dpatch.mk | ||
941 | 9 | # needed to use the dpatch tools (like dpatch-edit-patch) | ||
942 | 10 | include /usr/share/dpatch/dpatch.make | ||
943 | 11 | 8 | ||
944 | 12 | # Add here any variable or target overrides you need. | 9 | # Add here any variable or target overrides you need. |
948 | 13 | DEB_INSTALL_MANPAGES_autokey = debian/autokey.1 | 10 | DEB_INSTALL_MANPAGES_autokey_qt = debian/autokey-qt.1 |
949 | 14 | DEB_DH_INSTALLINIT_ARGS := --no-start | 11 | DEB_INSTALL_MANPAGES_autokey_gtk = debian/autokey-gtk.1 |
950 | 15 | 12 | DEB_DH_INSTALLINIT_ARGS := --no-start --init-script=autokey --error-handler=true | |
951 | 16 | 13 | ||
952 | === added directory 'doc/man' | |||
953 | === added file 'doc/man/autokey-gtk.1' | |||
954 | --- doc/man/autokey-gtk.1 1970-01-01 00:00:00 +0000 | |||
955 | +++ doc/man/autokey-gtk.1 2010-03-26 15:01:22 +0000 | |||
956 | @@ -0,0 +1,54 @@ | |||
957 | 1 | .\" Hey, EMACS: -*- nroff -*- | ||
958 | 2 | .\" First parameter, NAME, should be all caps | ||
959 | 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection | ||
960 | 4 | .\" other parameters are allowed: see man(7), man(1) | ||
961 | 5 | .TH AUTOKEY-GTK "1" "August 19, 2009" | ||
962 | 6 | .\" Please adjust this date whenever revising the manpage. | ||
963 | 7 | .\" | ||
964 | 8 | .\" Some roff macros, for reference: | ||
965 | 9 | .\" .nh disable hyphenation | ||
966 | 10 | .\" .hy enable hyphenation | ||
967 | 11 | .\" .ad l left justify | ||
968 | 12 | .\" .ad b justify to both left and right margins | ||
969 | 13 | .\" .nf disable filling | ||
970 | 14 | .\" .fi enable filling | ||
971 | 15 | .\" .br insert line break | ||
972 | 16 | .\" .sp <n> insert n+1 empty lines | ||
973 | 17 | .\" for manpage-specific macros, see man(7) | ||
974 | 18 | .SH NAME | ||
975 | 19 | autokey-gtk \- keyboard automation utility for GNOME and GTK | ||
976 | 20 | .SH SYNOPSIS | ||
977 | 21 | .B autokey-gtk | ||
978 | 22 | .RI [ options ] | ||
979 | 23 | .SH DESCRIPTION | ||
980 | 24 | This manual page briefly documents the | ||
981 | 25 | .B autokey-gtk | ||
982 | 26 | command. | ||
983 | 27 | .PP | ||
984 | 28 | .\" TeX users may be more comfortable with the \fB<whatever>\fP and | ||
985 | 29 | .\" \fI<whatever>\fP escape sequences to invode bold face and italics, | ||
986 | 30 | .\" respectively. | ||
987 | 31 | \fBautokey-gtk\fP AutoKey is a desktop automation utility for Linux and X11. It allows | ||
988 | 32 | the automation of virtually any task by responding to typed abbreviations and hotkeys. It | ||
989 | 33 | offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting | ||
990 | 34 | interface offering the full flexibility and power of the Python language. | ||
991 | 35 | .br | ||
992 | 36 | For more information refer to the online wiki at: | ||
993 | 37 | http://code.google.com/p/autokey/w/list | ||
994 | 38 | .SH OPTIONS | ||
995 | 39 | This program follows the usual GNU command line syntax, with long | ||
996 | 40 | options starting with two dashes (`-'). | ||
997 | 41 | A summary of options is included below. | ||
998 | 42 | .TP | ||
999 | 43 | .B \-\-help | ||
1000 | 44 | Show summary of options. | ||
1001 | 45 | .TP | ||
1002 | 46 | .B \-l, \-\-verbose | ||
1003 | 47 | Enable verbose (debug) logging. | ||
1004 | 48 | .TP | ||
1005 | 49 | .B \-c, \-\-configure | ||
1006 | 50 | Show the configuration window on startup, even if this is not the first run. | ||
1007 | 51 | .SH AUTHOR | ||
1008 | 52 | AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson. | ||
1009 | 53 | .PP | ||
1010 | 54 | This manual page was written by Chris Dekter <cdekter@gmail.com>. | ||
1011 | 0 | 55 | ||
1012 | === added file 'doc/man/autokey-qt.1' | |||
1013 | --- doc/man/autokey-qt.1 1970-01-01 00:00:00 +0000 | |||
1014 | +++ doc/man/autokey-qt.1 2010-03-26 15:01:22 +0000 | |||
1015 | @@ -0,0 +1,54 @@ | |||
1016 | 1 | .\" Hey, EMACS: -*- nroff -*- | ||
1017 | 2 | .\" First parameter, NAME, should be all caps | ||
1018 | 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection | ||
1019 | 4 | .\" other parameters are allowed: see man(7), man(1) | ||
1020 | 5 | .TH AUTOKEY-QT "1" "August 19, 2009" | ||
1021 | 6 | .\" Please adjust this date whenever revising the manpage. | ||
1022 | 7 | .\" | ||
1023 | 8 | .\" Some roff macros, for reference: | ||
1024 | 9 | .\" .nh disable hyphenation | ||
1025 | 10 | .\" .hy enable hyphenation | ||
1026 | 11 | .\" .ad l left justify | ||
1027 | 12 | .\" .ad b justify to both left and right margins | ||
1028 | 13 | .\" .nf disable filling | ||
1029 | 14 | .\" .fi enable filling | ||
1030 | 15 | .\" .br insert line break | ||
1031 | 16 | .\" .sp <n> insert n+1 empty lines | ||
1032 | 17 | .\" for manpage-specific macros, see man(7) | ||
1033 | 18 | .SH NAME | ||
1034 | 19 | autokey-qt \- keyboard automation utility for KDE and QT | ||
1035 | 20 | .SH SYNOPSIS | ||
1036 | 21 | .B autokey-qt | ||
1037 | 22 | .RI [ options ] | ||
1038 | 23 | .SH DESCRIPTION | ||
1039 | 24 | This manual page briefly documents the | ||
1040 | 25 | .B autokey-qt | ||
1041 | 26 | command. | ||
1042 | 27 | .PP | ||
1043 | 28 | .\" TeX users may be more comfortable with the \fB<whatever>\fP and | ||
1044 | 29 | .\" \fI<whatever>\fP escape sequences to invode bold face and italics, | ||
1045 | 30 | .\" respectively. | ||
1046 | 31 | \fBautokey-qt\fP AutoKey is a desktop automation utility for Linux and X11. It allows | ||
1047 | 32 | the automation of virtually any task by responding to typed abbreviations and hotkeys. It | ||
1048 | 33 | offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting | ||
1049 | 34 | interface offering the full flexibility and power of the Python language. | ||
1050 | 35 | .br | ||
1051 | 36 | For more information refer to the online wiki at: | ||
1052 | 37 | http://code.google.com/p/autokey/w/list | ||
1053 | 38 | .SH OPTIONS | ||
1054 | 39 | This program follows the usual GNU command line syntax, with long | ||
1055 | 40 | options starting with two dashes (`-'). | ||
1056 | 41 | A summary of options is included below. | ||
1057 | 42 | .TP | ||
1058 | 43 | .B \-\-help | ||
1059 | 44 | Show summary of options. | ||
1060 | 45 | .TP | ||
1061 | 46 | .B \-l, \-\-verbose | ||
1062 | 47 | Enable verbose (debug) logging. | ||
1063 | 48 | .TP | ||
1064 | 49 | .B \-c, \-\-configure | ||
1065 | 50 | Show the configuration window on startup, even if this is not the first run. | ||
1066 | 51 | .SH AUTHOR | ||
1067 | 52 | AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson. | ||
1068 | 53 | .PP | ||
1069 | 54 | This manual page was written by Chris Dekter <cdekter@gmail.com>. | ||
1070 | 0 | 55 | ||
1071 | === added directory 'glade' | |||
1072 | === added file 'glade/abbrselector.glade' | |||
1073 | --- glade/abbrselector.glade 1970-01-01 00:00:00 +0000 | |||
1074 | +++ glade/abbrselector.glade 2010-03-26 15:01:22 +0000 | |||
1075 | @@ -0,0 +1,45 @@ | |||
1076 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1077 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
1078 | 3 | <!--Generated with glade3 3.4.5 on Wed Sep 2 16:40:47 2009 --> | ||
1079 | 4 | <glade-interface> | ||
1080 | 5 | <widget class="GtkDialog" id="abbrselector"> | ||
1081 | 6 | <property name="border_width">5</property> | ||
1082 | 7 | <property name="title" translatable="yes">Enter Abbreviation</property> | ||
1083 | 8 | <property name="resizable">False</property> | ||
1084 | 9 | <property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property> | ||
1085 | 10 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | ||
1086 | 11 | <property name="has_separator">False</property> | ||
1087 | 12 | <signal name="hide" handler="on_close"/> | ||
1088 | 13 | <child internal-child="vbox"> | ||
1089 | 14 | <widget class="GtkVBox" id="dialog-vbox1"> | ||
1090 | 15 | <property name="visible">True</property> | ||
1091 | 16 | <property name="spacing">2</property> | ||
1092 | 17 | <child> | ||
1093 | 18 | <widget class="GtkVBox" id="vbox1"> | ||
1094 | 19 | <property name="visible">True</property> | ||
1095 | 20 | <child> | ||
1096 | 21 | <widget class="GtkEntry" id="entry"> | ||
1097 | 22 | <property name="visible">True</property> | ||
1098 | 23 | <property name="can_focus">True</property> | ||
1099 | 24 | <signal name="activate" handler="on_entry_activated"/> | ||
1100 | 25 | </widget> | ||
1101 | 26 | </child> | ||
1102 | 27 | </widget> | ||
1103 | 28 | <packing> | ||
1104 | 29 | <property name="position">1</property> | ||
1105 | 30 | </packing> | ||
1106 | 31 | </child> | ||
1107 | 32 | <child internal-child="action_area"> | ||
1108 | 33 | <widget class="GtkHButtonBox" id="dialog-action_area1"> | ||
1109 | 34 | <property name="visible">True</property> | ||
1110 | 35 | <property name="layout_style">GTK_BUTTONBOX_END</property> | ||
1111 | 36 | </widget> | ||
1112 | 37 | <packing> | ||
1113 | 38 | <property name="expand">False</property> | ||
1114 | 39 | <property name="pack_type">GTK_PACK_END</property> | ||
1115 | 40 | </packing> | ||
1116 | 41 | </child> | ||
1117 | 42 | </widget> | ||
1118 | 43 | </child> | ||
1119 | 44 | </widget> | ||
1120 | 45 | </glade-interface> | ||
1121 | 0 | 46 | ||
1122 | === added file 'glade/abbrsettings.glade' | |||
1123 | --- glade/abbrsettings.glade 1970-01-01 00:00:00 +0000 | |||
1124 | +++ glade/abbrsettings.glade 2010-03-26 15:01:22 +0000 | |||
1125 | @@ -0,0 +1,189 @@ | |||
1126 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1127 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
1128 | 3 | <!--Generated with glade3 3.4.5 on Fri Oct 2 11:21:20 2009 --> | ||
1129 | 4 | <glade-interface> | ||
1130 | 5 | <widget class="GtkDialog" id="abbrsettings"> | ||
1131 | 6 | <property name="border_width">5</property> | ||
1132 | 7 | <property name="title" translatable="yes">Set Abbreviation</property> | ||
1133 | 8 | <property name="resizable">False</property> | ||
1134 | 9 | <property name="modal">True</property> | ||
1135 | 10 | <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> | ||
1136 | 11 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | ||
1137 | 12 | <signal name="response" handler="on_response"/> | ||
1138 | 13 | <child internal-child="vbox"> | ||
1139 | 14 | <widget class="GtkVBox" id="dialog-vbox1"> | ||
1140 | 15 | <property name="visible">True</property> | ||
1141 | 16 | <property name="spacing">2</property> | ||
1142 | 17 | <child> | ||
1143 | 18 | <widget class="GtkVBox" id="vbox1"> | ||
1144 | 19 | <property name="visible">True</property> | ||
1145 | 20 | <child> | ||
1146 | 21 | <widget class="GtkHBox" id="hbox1"> | ||
1147 | 22 | <property name="visible">True</property> | ||
1148 | 23 | <child> | ||
1149 | 24 | <widget class="GtkLabel" id="label1"> | ||
1150 | 25 | <property name="visible">True</property> | ||
1151 | 26 | <property name="label" translatable="yes">Abbreviation:</property> | ||
1152 | 27 | </widget> | ||
1153 | 28 | <packing> | ||
1154 | 29 | <property name="padding">5</property> | ||
1155 | 30 | </packing> | ||
1156 | 31 | </child> | ||
1157 | 32 | <child> | ||
1158 | 33 | <widget class="GtkEntry" id="abbrEntry"> | ||
1159 | 34 | <property name="visible">True</property> | ||
1160 | 35 | <property name="can_focus">True</property> | ||
1161 | 36 | <property name="is_focus">True</property> | ||
1162 | 37 | <property name="activates_default">True</property> | ||
1163 | 38 | </widget> | ||
1164 | 39 | <packing> | ||
1165 | 40 | <property name="padding">5</property> | ||
1166 | 41 | <property name="position">1</property> | ||
1167 | 42 | </packing> | ||
1168 | 43 | </child> | ||
1169 | 44 | <child> | ||
1170 | 45 | <widget class="GtkLabel" id="label2"> | ||
1171 | 46 | <property name="visible">True</property> | ||
1172 | 47 | <property name="label" translatable="yes">Trigger on:</property> | ||
1173 | 48 | </widget> | ||
1174 | 49 | <packing> | ||
1175 | 50 | <property name="padding">5</property> | ||
1176 | 51 | <property name="position">2</property> | ||
1177 | 52 | </packing> | ||
1178 | 53 | </child> | ||
1179 | 54 | <child> | ||
1180 | 55 | <widget class="GtkComboBox" id="wordCharCombo"> | ||
1181 | 56 | <property name="visible">True</property> | ||
1182 | 57 | <property name="active">1</property> | ||
1183 | 58 | <property name="items" translatable="yes">Default | ||
1184 | 59 | Space and Enter</property> | ||
1185 | 60 | </widget> | ||
1186 | 61 | <packing> | ||
1187 | 62 | <property name="fill">False</property> | ||
1188 | 63 | <property name="padding">5</property> | ||
1189 | 64 | <property name="position">3</property> | ||
1190 | 65 | </packing> | ||
1191 | 66 | </child> | ||
1192 | 67 | </widget> | ||
1193 | 68 | </child> | ||
1194 | 69 | <child> | ||
1195 | 70 | <widget class="GtkCheckButton" id="removeTypedCheckbox"> | ||
1196 | 71 | <property name="visible">True</property> | ||
1197 | 72 | <property name="can_focus">True</property> | ||
1198 | 73 | <property name="label" translatable="yes">Remove typed abbreviation</property> | ||
1199 | 74 | <property name="response_id">0</property> | ||
1200 | 75 | <property name="draw_indicator">True</property> | ||
1201 | 76 | </widget> | ||
1202 | 77 | <packing> | ||
1203 | 78 | <property name="position">1</property> | ||
1204 | 79 | </packing> | ||
1205 | 80 | </child> | ||
1206 | 81 | <child> | ||
1207 | 82 | <widget class="GtkCheckButton" id="omitTriggerCheckbox"> | ||
1208 | 83 | <property name="visible">True</property> | ||
1209 | 84 | <property name="can_focus">True</property> | ||
1210 | 85 | <property name="label" translatable="yes">Omit trigger character</property> | ||
1211 | 86 | <property name="response_id">0</property> | ||
1212 | 87 | <property name="draw_indicator">True</property> | ||
1213 | 88 | </widget> | ||
1214 | 89 | <packing> | ||
1215 | 90 | <property name="position">2</property> | ||
1216 | 91 | </packing> | ||
1217 | 92 | </child> | ||
1218 | 93 | <child> | ||
1219 | 94 | <widget class="GtkCheckButton" id="matchCaseCheckbox"> | ||
1220 | 95 | <property name="visible">True</property> | ||
1221 | 96 | <property name="can_focus">True</property> | ||
1222 | 97 | <property name="label" translatable="yes">Match phrase case to typed abbreviation</property> | ||
1223 | 98 | <property name="response_id">0</property> | ||
1224 | 99 | <property name="draw_indicator">True</property> | ||
1225 | 100 | <signal name="toggled" handler="on_matchCaseCheckbox_stateChanged"/> | ||
1226 | 101 | </widget> | ||
1227 | 102 | <packing> | ||
1228 | 103 | <property name="position">3</property> | ||
1229 | 104 | </packing> | ||
1230 | 105 | </child> | ||
1231 | 106 | <child> | ||
1232 | 107 | <widget class="GtkCheckButton" id="ignoreCaseCheckbox"> | ||
1233 | 108 | <property name="visible">True</property> | ||
1234 | 109 | <property name="can_focus">True</property> | ||
1235 | 110 | <property name="label" translatable="yes">Ignore case of typed abbreviation</property> | ||
1236 | 111 | <property name="response_id">0</property> | ||
1237 | 112 | <property name="draw_indicator">True</property> | ||
1238 | 113 | <signal name="toggled" handler="on_ignoreCaseCheckbox_stateChanged"/> | ||
1239 | 114 | </widget> | ||
1240 | 115 | <packing> | ||
1241 | 116 | <property name="position">4</property> | ||
1242 | 117 | </packing> | ||
1243 | 118 | </child> | ||
1244 | 119 | <child> | ||
1245 | 120 | <widget class="GtkCheckButton" id="triggerInsideCheckbox"> | ||
1246 | 121 | <property name="visible">True</property> | ||
1247 | 122 | <property name="can_focus">True</property> | ||
1248 | 123 | <property name="label" translatable="yes">Trigger when typed as part of a word</property> | ||
1249 | 124 | <property name="response_id">0</property> | ||
1250 | 125 | <property name="draw_indicator">True</property> | ||
1251 | 126 | </widget> | ||
1252 | 127 | <packing> | ||
1253 | 128 | <property name="position">5</property> | ||
1254 | 129 | </packing> | ||
1255 | 130 | </child> | ||
1256 | 131 | <child> | ||
1257 | 132 | <widget class="GtkCheckButton" id="immediateCheckbox"> | ||
1258 | 133 | <property name="visible">True</property> | ||
1259 | 134 | <property name="can_focus">True</property> | ||
1260 | 135 | <property name="label" translatable="yes">Trigger immediately (don't require a trigger character)</property> | ||
1261 | 136 | <property name="response_id">0</property> | ||
1262 | 137 | <property name="draw_indicator">True</property> | ||
1263 | 138 | <signal name="toggled" handler="on_immediateCheckbox_stateChanged"/> | ||
1264 | 139 | </widget> | ||
1265 | 140 | <packing> | ||
1266 | 141 | <property name="position">6</property> | ||
1267 | 142 | </packing> | ||
1268 | 143 | </child> | ||
1269 | 144 | </widget> | ||
1270 | 145 | <packing> | ||
1271 | 146 | <property name="position">2</property> | ||
1272 | 147 | </packing> | ||
1273 | 148 | </child> | ||
1274 | 149 | <child internal-child="action_area"> | ||
1275 | 150 | <widget class="GtkHButtonBox" id="dialog-action_area1"> | ||
1276 | 151 | <property name="visible">True</property> | ||
1277 | 152 | <property name="layout_style">GTK_BUTTONBOX_END</property> | ||
1278 | 153 | <child> | ||
1279 | 154 | <widget class="GtkButton" id="cancelButton"> | ||
1280 | 155 | <property name="visible">True</property> | ||
1281 | 156 | <property name="can_focus">True</property> | ||
1282 | 157 | <property name="receives_default">True</property> | ||
1283 | 158 | <property name="label" translatable="yes">gtk-cancel</property> | ||
1284 | 159 | <property name="use_stock">True</property> | ||
1285 | 160 | <property name="response_id">0</property> | ||
1286 | 161 | <signal name="clicked" handler="on_cancel"/> | ||
1287 | 162 | </widget> | ||
1288 | 163 | </child> | ||
1289 | 164 | <child> | ||
1290 | 165 | <widget class="GtkButton" id="okButton"> | ||
1291 | 166 | <property name="visible">True</property> | ||
1292 | 167 | <property name="can_focus">True</property> | ||
1293 | 168 | <property name="can_default">True</property> | ||
1294 | 169 | <property name="has_default">True</property> | ||
1295 | 170 | <property name="receives_default">True</property> | ||
1296 | 171 | <property name="label" translatable="yes">gtk-ok</property> | ||
1297 | 172 | <property name="use_stock">True</property> | ||
1298 | 173 | <property name="response_id">0</property> | ||
1299 | 174 | <signal name="clicked" handler="on_ok"/> | ||
1300 | 175 | </widget> | ||
1301 | 176 | <packing> | ||
1302 | 177 | <property name="position">1</property> | ||
1303 | 178 | </packing> | ||
1304 | 179 | </child> | ||
1305 | 180 | </widget> | ||
1306 | 181 | <packing> | ||
1307 | 182 | <property name="expand">False</property> | ||
1308 | 183 | <property name="pack_type">GTK_PACK_END</property> | ||
1309 | 184 | </packing> | ||
1310 | 185 | </child> | ||
1311 | 186 | </widget> | ||
1312 | 187 | </child> | ||
1313 | 188 | </widget> | ||
1314 | 189 | </glade-interface> | ||
1315 | 0 | 190 | ||
1316 | === added file 'glade/akicon.png' | |||
1317 | 1 | Binary files glade/akicon.png 1970-01-01 00:00:00 +0000 and glade/akicon.png 2010-03-26 15:01:22 +0000 differ | 191 | Binary files glade/akicon.png 1970-01-01 00:00:00 +0000 and glade/akicon.png 2010-03-26 15:01:22 +0000 differ |
1318 | === added file 'glade/folderpage.glade' | |||
1319 | --- glade/folderpage.glade 1970-01-01 00:00:00 +0000 | |||
1320 | +++ glade/folderpage.glade 2010-03-26 15:01:22 +0000 | |||
1321 | @@ -0,0 +1,70 @@ | |||
1322 | 1 | <?xml version="1.0"?> | ||
1323 | 2 | <glade-interface> | ||
1324 | 3 | <!-- interface-requires gtk+ 2.6 --> | ||
1325 | 4 | <!-- interface-naming-policy toplevel-contextual --> | ||
1326 | 5 | <widget class="GtkWindow" id="window1"> | ||
1327 | 6 | <child> | ||
1328 | 7 | <widget class="GtkAlignment" id="folderpage"> | ||
1329 | 8 | <property name="visible">True</property> | ||
1330 | 9 | <property name="yalign">0</property> | ||
1331 | 10 | <property name="yscale">0</property> | ||
1332 | 11 | <property name="top_padding">5</property> | ||
1333 | 12 | <property name="bottom_padding">5</property> | ||
1334 | 13 | <child> | ||
1335 | 14 | <widget class="GtkFrame" id="frame1"> | ||
1336 | 15 | <property name="visible">True</property> | ||
1337 | 16 | <property name="label_xalign">0</property> | ||
1338 | 17 | <property name="shadow_type">none</property> | ||
1339 | 18 | <child> | ||
1340 | 19 | <widget class="GtkAlignment" id="alignment2"> | ||
1341 | 20 | <property name="visible">True</property> | ||
1342 | 21 | <property name="top_padding">5</property> | ||
1343 | 22 | <property name="bottom_padding">5</property> | ||
1344 | 23 | <property name="left_padding">10</property> | ||
1345 | 24 | <child> | ||
1346 | 25 | <widget class="GtkVBox" id="settingsVbox"> | ||
1347 | 26 | <property name="visible">True</property> | ||
1348 | 27 | <property name="orientation">vertical</property> | ||
1349 | 28 | <property name="spacing">5</property> | ||
1350 | 29 | <child> | ||
1351 | 30 | <widget class="GtkCheckButton" id="showInTrayCheckbox"> | ||
1352 | 31 | <property name="label" translatable="yes">Show in tray menu </property> | ||
1353 | 32 | <property name="visible">True</property> | ||
1354 | 33 | <property name="can_focus">True</property> | ||
1355 | 34 | <property name="receives_default">False</property> | ||
1356 | 35 | <property name="draw_indicator">True</property> | ||
1357 | 36 | <signal name="toggled" handler="on_modified"/> | ||
1358 | 37 | </widget> | ||
1359 | 38 | <packing> | ||
1360 | 39 | <property name="position">0</property> | ||
1361 | 40 | </packing> | ||
1362 | 41 | </child> | ||
1363 | 42 | <child> | ||
1364 | 43 | <widget class="GtkHSeparator" id="hseparator1"> | ||
1365 | 44 | <property name="visible">True</property> | ||
1366 | 45 | </widget> | ||
1367 | 46 | <packing> | ||
1368 | 47 | <property name="expand">False</property> | ||
1369 | 48 | <property name="position">1</property> | ||
1370 | 49 | </packing> | ||
1371 | 50 | </child> | ||
1372 | 51 | </widget> | ||
1373 | 52 | </child> | ||
1374 | 53 | </widget> | ||
1375 | 54 | </child> | ||
1376 | 55 | <child> | ||
1377 | 56 | <widget class="GtkLabel" id="label2"> | ||
1378 | 57 | <property name="visible">True</property> | ||
1379 | 58 | <property name="label" translatable="yes"><b>Folder Settings</b></property> | ||
1380 | 59 | <property name="use_markup">True</property> | ||
1381 | 60 | </widget> | ||
1382 | 61 | <packing> | ||
1383 | 62 | <property name="type">label_item</property> | ||
1384 | 63 | </packing> | ||
1385 | 64 | </child> | ||
1386 | 65 | </widget> | ||
1387 | 66 | </child> | ||
1388 | 67 | </widget> | ||
1389 | 68 | </child> | ||
1390 | 69 | </widget> | ||
1391 | 70 | </glade-interface> | ||
1392 | 0 | 71 | ||
1393 | === added file 'glade/hotkeysettings.glade' | |||
1394 | --- glade/hotkeysettings.glade 1970-01-01 00:00:00 +0000 | |||
1395 | +++ glade/hotkeysettings.glade 2010-03-26 15:01:22 +0000 | |||
1396 | @@ -0,0 +1,151 @@ | |||
1397 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1398 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
1399 | 3 | <!--Generated with glade3 3.4.5 on Wed Sep 2 10:54:51 2009 --> | ||
1400 | 4 | <glade-interface> | ||
1401 | 5 | <widget class="GtkDialog" id="hotkeysettings"> | ||
1402 | 6 | <property name="border_width">5</property> | ||
1403 | 7 | <property name="title" translatable="yes">Set Hotkey</property> | ||
1404 | 8 | <property name="resizable">False</property> | ||
1405 | 9 | <property name="modal">True</property> | ||
1406 | 10 | <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> | ||
1407 | 11 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | ||
1408 | 12 | <signal name="response" handler="on_response"/> | ||
1409 | 13 | <child internal-child="vbox"> | ||
1410 | 14 | <widget class="GtkVBox" id="dialog-vbox2"> | ||
1411 | 15 | <property name="visible">True</property> | ||
1412 | 16 | <property name="spacing">5</property> | ||
1413 | 17 | <child> | ||
1414 | 18 | <widget class="GtkVBox" id="vbox2"> | ||
1415 | 19 | <property name="visible">True</property> | ||
1416 | 20 | <property name="border_width">5</property> | ||
1417 | 21 | <property name="spacing">10</property> | ||
1418 | 22 | <child> | ||
1419 | 23 | <widget class="GtkHBox" id="hbox2"> | ||
1420 | 24 | <property name="visible">True</property> | ||
1421 | 25 | <property name="homogeneous">True</property> | ||
1422 | 26 | <child> | ||
1423 | 27 | <widget class="GtkToggleButton" id="controlButton"> | ||
1424 | 28 | <property name="visible">True</property> | ||
1425 | 29 | <property name="can_focus">True</property> | ||
1426 | 30 | <property name="label" translatable="yes">Control</property> | ||
1427 | 31 | <property name="response_id">0</property> | ||
1428 | 32 | </widget> | ||
1429 | 33 | <packing> | ||
1430 | 34 | <property name="expand">False</property> | ||
1431 | 35 | <property name="padding">5</property> | ||
1432 | 36 | </packing> | ||
1433 | 37 | </child> | ||
1434 | 38 | <child> | ||
1435 | 39 | <widget class="GtkToggleButton" id="altButton"> | ||
1436 | 40 | <property name="visible">True</property> | ||
1437 | 41 | <property name="can_focus">True</property> | ||
1438 | 42 | <property name="label" translatable="yes">Alt</property> | ||
1439 | 43 | <property name="response_id">0</property> | ||
1440 | 44 | </widget> | ||
1441 | 45 | <packing> | ||
1442 | 46 | <property name="expand">False</property> | ||
1443 | 47 | <property name="padding">5</property> | ||
1444 | 48 | <property name="position">1</property> | ||
1445 | 49 | </packing> | ||
1446 | 50 | </child> | ||
1447 | 51 | <child> | ||
1448 | 52 | <widget class="GtkToggleButton" id="shiftButton"> | ||
1449 | 53 | <property name="visible">True</property> | ||
1450 | 54 | <property name="can_focus">True</property> | ||
1451 | 55 | <property name="label" translatable="yes">Shift</property> | ||
1452 | 56 | <property name="response_id">0</property> | ||
1453 | 57 | </widget> | ||
1454 | 58 | <packing> | ||
1455 | 59 | <property name="expand">False</property> | ||
1456 | 60 | <property name="padding">5</property> | ||
1457 | 61 | <property name="position">2</property> | ||
1458 | 62 | </packing> | ||
1459 | 63 | </child> | ||
1460 | 64 | <child> | ||
1461 | 65 | <widget class="GtkToggleButton" id="superButton"> | ||
1462 | 66 | <property name="visible">True</property> | ||
1463 | 67 | <property name="can_focus">True</property> | ||
1464 | 68 | <property name="label" translatable="yes">Super</property> | ||
1465 | 69 | <property name="response_id">0</property> | ||
1466 | 70 | </widget> | ||
1467 | 71 | <packing> | ||
1468 | 72 | <property name="expand">False</property> | ||
1469 | 73 | <property name="padding">5</property> | ||
1470 | 74 | <property name="position">3</property> | ||
1471 | 75 | </packing> | ||
1472 | 76 | </child> | ||
1473 | 77 | </widget> | ||
1474 | 78 | </child> | ||
1475 | 79 | <child> | ||
1476 | 80 | <widget class="GtkHBox" id="hbox3"> | ||
1477 | 81 | <property name="visible">True</property> | ||
1478 | 82 | <child> | ||
1479 | 83 | <widget class="GtkLabel" id="keyLabel"> | ||
1480 | 84 | <property name="visible">True</property> | ||
1481 | 85 | <property name="xalign">0</property> | ||
1482 | 86 | <property name="label" translatable="yes">Key: %s</property> | ||
1483 | 87 | </widget> | ||
1484 | 88 | </child> | ||
1485 | 89 | <child> | ||
1486 | 90 | <widget class="GtkButton" id="setButton"> | ||
1487 | 91 | <property name="visible">True</property> | ||
1488 | 92 | <property name="can_focus">True</property> | ||
1489 | 93 | <property name="label" translatable="yes">Press to Set</property> | ||
1490 | 94 | <property name="response_id">0</property> | ||
1491 | 95 | <signal name="clicked" handler="on_setButton_pressed"/> | ||
1492 | 96 | </widget> | ||
1493 | 97 | <packing> | ||
1494 | 98 | <property name="expand">False</property> | ||
1495 | 99 | <property name="position">1</property> | ||
1496 | 100 | </packing> | ||
1497 | 101 | </child> | ||
1498 | 102 | </widget> | ||
1499 | 103 | <packing> | ||
1500 | 104 | <property name="position">1</property> | ||
1501 | 105 | </packing> | ||
1502 | 106 | </child> | ||
1503 | 107 | </widget> | ||
1504 | 108 | <packing> | ||
1505 | 109 | <property name="fill">False</property> | ||
1506 | 110 | <property name="position">2</property> | ||
1507 | 111 | </packing> | ||
1508 | 112 | </child> | ||
1509 | 113 | <child internal-child="action_area"> | ||
1510 | 114 | <widget class="GtkHButtonBox" id="dialog-action_area2"> | ||
1511 | 115 | <property name="visible">True</property> | ||
1512 | 116 | <property name="layout_style">GTK_BUTTONBOX_END</property> | ||
1513 | 117 | <child> | ||
1514 | 118 | <widget class="GtkButton" id="cancelButton"> | ||
1515 | 119 | <property name="visible">True</property> | ||
1516 | 120 | <property name="can_focus">True</property> | ||
1517 | 121 | <property name="receives_default">True</property> | ||
1518 | 122 | <property name="label" translatable="yes">gtk-cancel</property> | ||
1519 | 123 | <property name="use_stock">True</property> | ||
1520 | 124 | <property name="response_id">0</property> | ||
1521 | 125 | <signal name="clicked" handler="on_cancel"/> | ||
1522 | 126 | </widget> | ||
1523 | 127 | </child> | ||
1524 | 128 | <child> | ||
1525 | 129 | <widget class="GtkButton" id="okButton"> | ||
1526 | 130 | <property name="visible">True</property> | ||
1527 | 131 | <property name="can_focus">True</property> | ||
1528 | 132 | <property name="receives_default">True</property> | ||
1529 | 133 | <property name="label" translatable="yes">gtk-ok</property> | ||
1530 | 134 | <property name="use_stock">True</property> | ||
1531 | 135 | <property name="response_id">0</property> | ||
1532 | 136 | <signal name="clicked" handler="on_ok"/> | ||
1533 | 137 | </widget> | ||
1534 | 138 | <packing> | ||
1535 | 139 | <property name="position">1</property> | ||
1536 | 140 | </packing> | ||
1537 | 141 | </child> | ||
1538 | 142 | </widget> | ||
1539 | 143 | <packing> | ||
1540 | 144 | <property name="expand">False</property> | ||
1541 | 145 | <property name="pack_type">GTK_PACK_END</property> | ||
1542 | 146 | </packing> | ||
1543 | 147 | </child> | ||
1544 | 148 | </widget> | ||
1545 | 149 | </child> | ||
1546 | 150 | </widget> | ||
1547 | 151 | </glade-interface> | ||
1548 | 0 | 152 | ||
1549 | === added file 'glade/mainwindow.glade' | |||
1550 | --- glade/mainwindow.glade 1970-01-01 00:00:00 +0000 | |||
1551 | +++ glade/mainwindow.glade 2010-03-26 15:01:22 +0000 | |||
1552 | @@ -0,0 +1,124 @@ | |||
1553 | 1 | <?xml version="1.0"?> | ||
1554 | 2 | <glade-interface> | ||
1555 | 3 | <!-- interface-requires gtk+ 2.6 --> | ||
1556 | 4 | <!-- interface-naming-policy toplevel-contextual --> | ||
1557 | 5 | <widget class="GtkWindow" id="mainwindow"> | ||
1558 | 6 | <property name="title" translatable="yes">AutoKey - Configuration</property> | ||
1559 | 7 | <property name="default_width">600</property> | ||
1560 | 8 | <property name="default_height">400</property> | ||
1561 | 9 | <property name="icon">akicon.png</property> | ||
1562 | 10 | <signal name="delete_event" handler="on_close"/> | ||
1563 | 11 | <child> | ||
1564 | 12 | <widget class="GtkVBox" id="vbox"> | ||
1565 | 13 | <property name="visible">True</property> | ||
1566 | 14 | <child> | ||
1567 | 15 | <widget class="GtkHPaned" id="hpaned"> | ||
1568 | 16 | <property name="visible">True</property> | ||
1569 | 17 | <property name="can_focus">True</property> | ||
1570 | 18 | <property name="position">150</property> | ||
1571 | 19 | <property name="position_set">True</property> | ||
1572 | 20 | <child> | ||
1573 | 21 | <widget class="GtkScrolledWindow" id="scrolledwindow1"> | ||
1574 | 22 | <property name="visible">True</property> | ||
1575 | 23 | <property name="can_focus">True</property> | ||
1576 | 24 | <property name="hscrollbar_policy">automatic</property> | ||
1577 | 25 | <property name="vscrollbar_policy">automatic</property> | ||
1578 | 26 | <property name="shadow_type">in</property> | ||
1579 | 27 | <child> | ||
1580 | 28 | <widget class="GtkTreeView" id="treeWidget"> | ||
1581 | 29 | <property name="visible">True</property> | ||
1582 | 30 | <property name="can_focus">True</property> | ||
1583 | 31 | <signal name="button_press_event" handler="on_treeview_buttonpress"/> | ||
1584 | 32 | <signal name="row_activated" handler="on_treeWidget_row_activated"/> | ||
1585 | 33 | <signal name="drag_drop" handler="on_drag_drop"/> | ||
1586 | 34 | <signal name="button_release_event" handler="on_treeview_buttonrelease"/> | ||
1587 | 35 | <signal name="drag_data_received" handler="on_drag_data_received"/> | ||
1588 | 36 | <signal name="cursor_changed" handler="on_tree_selection_changed"/> | ||
1589 | 37 | </widget> | ||
1590 | 38 | </child> | ||
1591 | 39 | </widget> | ||
1592 | 40 | <packing> | ||
1593 | 41 | <property name="resize">True</property> | ||
1594 | 42 | <property name="shrink">True</property> | ||
1595 | 43 | </packing> | ||
1596 | 44 | </child> | ||
1597 | 45 | <child> | ||
1598 | 46 | <widget class="GtkAlignment" id="alignment1"> | ||
1599 | 47 | <property name="visible">True</property> | ||
1600 | 48 | <property name="bottom_padding">5</property> | ||
1601 | 49 | <property name="right_padding">5</property> | ||
1602 | 50 | <child> | ||
1603 | 51 | <widget class="GtkVBox" id="vbox2"> | ||
1604 | 52 | <property name="visible">True</property> | ||
1605 | 53 | <property name="spacing">5</property> | ||
1606 | 54 | <child> | ||
1607 | 55 | <widget class="GtkNotebook" id="stack"> | ||
1608 | 56 | <property name="visible">True</property> | ||
1609 | 57 | <property name="can_focus">True</property> | ||
1610 | 58 | <property name="show_tabs">False</property> | ||
1611 | 59 | <property name="show_border">False</property> | ||
1612 | 60 | </widget> | ||
1613 | 61 | <packing> | ||
1614 | 62 | <property name="position">0</property> | ||
1615 | 63 | </packing> | ||
1616 | 64 | </child> | ||
1617 | 65 | <child> | ||
1618 | 66 | <widget class="GtkHButtonBox" id="hbuttonbox1"> | ||
1619 | 67 | <property name="visible">True</property> | ||
1620 | 68 | <property name="spacing">5</property> | ||
1621 | 69 | <property name="homogeneous">True</property> | ||
1622 | 70 | <property name="layout_style">end</property> | ||
1623 | 71 | <child> | ||
1624 | 72 | <widget class="GtkButton" id="saveButton"> | ||
1625 | 73 | <property name="label">gtk-save</property> | ||
1626 | 74 | <property name="visible">True</property> | ||
1627 | 75 | <property name="can_focus">True</property> | ||
1628 | 76 | <property name="receives_default">True</property> | ||
1629 | 77 | <property name="use_stock">True</property> | ||
1630 | 78 | <signal name="clicked" handler="on_save"/> | ||
1631 | 79 | </widget> | ||
1632 | 80 | <packing> | ||
1633 | 81 | <property name="expand">False</property> | ||
1634 | 82 | <property name="fill">False</property> | ||
1635 | 83 | <property name="position">0</property> | ||
1636 | 84 | </packing> | ||
1637 | 85 | </child> | ||
1638 | 86 | <child> | ||
1639 | 87 | <widget class="GtkButton" id="revertButton"> | ||
1640 | 88 | <property name="label">gtk-revert-to-saved</property> | ||
1641 | 89 | <property name="visible">True</property> | ||
1642 | 90 | <property name="can_focus">True</property> | ||
1643 | 91 | <property name="receives_default">True</property> | ||
1644 | 92 | <property name="use_stock">True</property> | ||
1645 | 93 | <signal name="clicked" handler="on_reset"/> | ||
1646 | 94 | </widget> | ||
1647 | 95 | <packing> | ||
1648 | 96 | <property name="expand">False</property> | ||
1649 | 97 | <property name="fill">False</property> | ||
1650 | 98 | <property name="position">1</property> | ||
1651 | 99 | </packing> | ||
1652 | 100 | </child> | ||
1653 | 101 | </widget> | ||
1654 | 102 | <packing> | ||
1655 | 103 | <property name="expand">False</property> | ||
1656 | 104 | <property name="position">1</property> | ||
1657 | 105 | </packing> | ||
1658 | 106 | </child> | ||
1659 | 107 | </widget> | ||
1660 | 108 | </child> | ||
1661 | 109 | </widget> | ||
1662 | 110 | <packing> | ||
1663 | 111 | <property name="resize">True</property> | ||
1664 | 112 | <property name="shrink">True</property> | ||
1665 | 113 | </packing> | ||
1666 | 114 | </child> | ||
1667 | 115 | </widget> | ||
1668 | 116 | <packing> | ||
1669 | 117 | <property name="pack_type">end</property> | ||
1670 | 118 | <property name="position">0</property> | ||
1671 | 119 | </packing> | ||
1672 | 120 | </child> | ||
1673 | 121 | </widget> | ||
1674 | 122 | </child> | ||
1675 | 123 | </widget> | ||
1676 | 124 | </glade-interface> | ||
1677 | 0 | 125 | ||
1678 | === added file 'glade/phrasepage-old.glade' | |||
1679 | --- glade/phrasepage-old.glade 1970-01-01 00:00:00 +0000 | |||
1680 | +++ glade/phrasepage-old.glade 2010-03-26 15:01:22 +0000 | |||
1681 | @@ -0,0 +1,118 @@ | |||
1682 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1683 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
1684 | 3 | <!--Generated with glade3 3.4.5 on Wed Sep 2 11:38:57 2009 --> | ||
1685 | 4 | <glade-interface> | ||
1686 | 5 | <widget class="GtkWindow" id="window1"> | ||
1687 | 6 | <child> | ||
1688 | 7 | <widget class="GtkAlignment" id="phrasepage"> | ||
1689 | 8 | <property name="visible">True</property> | ||
1690 | 9 | <property name="top_padding">5</property> | ||
1691 | 10 | <property name="bottom_padding">5</property> | ||
1692 | 11 | <child> | ||
1693 | 12 | <widget class="GtkVBox" id="vbox1"> | ||
1694 | 13 | <property name="visible">True</property> | ||
1695 | 14 | <property name="spacing">5</property> | ||
1696 | 15 | <child> | ||
1697 | 16 | <widget class="GtkLabel" id="label1"> | ||
1698 | 17 | <property name="visible">True</property> | ||
1699 | 18 | <property name="xalign">0</property> | ||
1700 | 19 | <property name="label" translatable="yes">Description</property> | ||
1701 | 20 | </widget> | ||
1702 | 21 | <packing> | ||
1703 | 22 | <property name="expand">False</property> | ||
1704 | 23 | </packing> | ||
1705 | 24 | </child> | ||
1706 | 25 | <child> | ||
1707 | 26 | <widget class="GtkEntry" id="descriptionEntry"> | ||
1708 | 27 | <property name="visible">True</property> | ||
1709 | 28 | <property name="can_focus">True</property> | ||
1710 | 29 | <signal name="changed" handler="on_modified"/> | ||
1711 | 30 | </widget> | ||
1712 | 31 | <packing> | ||
1713 | 32 | <property name="expand">False</property> | ||
1714 | 33 | <property name="position">1</property> | ||
1715 | 34 | </packing> | ||
1716 | 35 | </child> | ||
1717 | 36 | <child> | ||
1718 | 37 | <widget class="GtkScrolledWindow" id="scrolledwindow1"> | ||
1719 | 38 | <property name="visible">True</property> | ||
1720 | 39 | <property name="can_focus">True</property> | ||
1721 | 40 | <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> | ||
1722 | 41 | <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> | ||
1723 | 42 | <property name="shadow_type">GTK_SHADOW_IN</property> | ||
1724 | 43 | <child> | ||
1725 | 44 | <widget class="GtkTextView" id="phraseText"> | ||
1726 | 45 | <property name="visible">True</property> | ||
1727 | 46 | <property name="can_focus">True</property> | ||
1728 | 47 | <property name="accepts_tab">False</property> | ||
1729 | 48 | </widget> | ||
1730 | 49 | </child> | ||
1731 | 50 | </widget> | ||
1732 | 51 | <packing> | ||
1733 | 52 | <property name="position">2</property> | ||
1734 | 53 | </packing> | ||
1735 | 54 | </child> | ||
1736 | 55 | <child> | ||
1737 | 56 | <widget class="GtkFrame" id="frame1"> | ||
1738 | 57 | <property name="visible">True</property> | ||
1739 | 58 | <property name="label_xalign">0</property> | ||
1740 | 59 | <property name="shadow_type">GTK_SHADOW_NONE</property> | ||
1741 | 60 | <child> | ||
1742 | 61 | <widget class="GtkAlignment" id="alignment2"> | ||
1743 | 62 | <property name="visible">True</property> | ||
1744 | 63 | <property name="top_padding">5</property> | ||
1745 | 64 | <property name="bottom_padding">5</property> | ||
1746 | 65 | <property name="left_padding">10</property> | ||
1747 | 66 | <child> | ||
1748 | 67 | <widget class="GtkVBox" id="settingsVbox"> | ||
1749 | 68 | <property name="visible">True</property> | ||
1750 | 69 | <property name="spacing">5</property> | ||
1751 | 70 | <child> | ||
1752 | 71 | <widget class="GtkCheckButton" id="promptCheckbox"> | ||
1753 | 72 | <property name="visible">True</property> | ||
1754 | 73 | <property name="can_focus">True</property> | ||
1755 | 74 | <property name="label" translatable="yes">Always prompt before pasting this phrase</property> | ||
1756 | 75 | <property name="response_id">0</property> | ||
1757 | 76 | <property name="draw_indicator">True</property> | ||
1758 | 77 | <signal name="toggled" handler="on_modified"/> | ||
1759 | 78 | </widget> | ||
1760 | 79 | </child> | ||
1761 | 80 | <child> | ||
1762 | 81 | <widget class="GtkCheckButton" id="showInTrayCheckbox"> | ||
1763 | 82 | <property name="visible">True</property> | ||
1764 | 83 | <property name="can_focus">True</property> | ||
1765 | 84 | <property name="label" translatable="yes">Show in tray menu </property> | ||
1766 | 85 | <property name="response_id">0</property> | ||
1767 | 86 | <property name="draw_indicator">True</property> | ||
1768 | 87 | <signal name="toggled" handler="on_modified"/> | ||
1769 | 88 | </widget> | ||
1770 | 89 | <packing> | ||
1771 | 90 | <property name="position">1</property> | ||
1772 | 91 | </packing> | ||
1773 | 92 | </child> | ||
1774 | 93 | </widget> | ||
1775 | 94 | </child> | ||
1776 | 95 | </widget> | ||
1777 | 96 | </child> | ||
1778 | 97 | <child> | ||
1779 | 98 | <widget class="GtkLabel" id="label2"> | ||
1780 | 99 | <property name="visible">True</property> | ||
1781 | 100 | <property name="label" translatable="yes"><b>Settings</b></property> | ||
1782 | 101 | <property name="use_markup">True</property> | ||
1783 | 102 | </widget> | ||
1784 | 103 | <packing> | ||
1785 | 104 | <property name="type">label_item</property> | ||
1786 | 105 | </packing> | ||
1787 | 106 | </child> | ||
1788 | 107 | </widget> | ||
1789 | 108 | <packing> | ||
1790 | 109 | <property name="expand">False</property> | ||
1791 | 110 | <property name="position">3</property> | ||
1792 | 111 | </packing> | ||
1793 | 112 | </child> | ||
1794 | 113 | </widget> | ||
1795 | 114 | </child> | ||
1796 | 115 | </widget> | ||
1797 | 116 | </child> | ||
1798 | 117 | </widget> | ||
1799 | 118 | </glade-interface> | ||
1800 | 0 | 119 | ||
1801 | === added file 'glade/phrasepage.glade' | |||
1802 | --- glade/phrasepage.glade 1970-01-01 00:00:00 +0000 | |||
1803 | +++ glade/phrasepage.glade 2010-03-26 15:01:22 +0000 | |||
1804 | @@ -0,0 +1,106 @@ | |||
1805 | 1 | <?xml version="1.0"?> | ||
1806 | 2 | <glade-interface> | ||
1807 | 3 | <!-- interface-requires gtk+ 2.6 --> | ||
1808 | 4 | <!-- interface-naming-policy toplevel-contextual --> | ||
1809 | 5 | <widget class="GtkWindow" id="window1"> | ||
1810 | 6 | <child> | ||
1811 | 7 | <widget class="GtkAlignment" id="phrasepage"> | ||
1812 | 8 | <property name="visible">True</property> | ||
1813 | 9 | <property name="top_padding">5</property> | ||
1814 | 10 | <property name="bottom_padding">5</property> | ||
1815 | 11 | <child> | ||
1816 | 12 | <widget class="GtkVBox" id="vbox1"> | ||
1817 | 13 | <property name="visible">True</property> | ||
1818 | 14 | <property name="orientation">vertical</property> | ||
1819 | 15 | <property name="spacing">5</property> | ||
1820 | 16 | <child> | ||
1821 | 17 | <widget class="GtkScrolledWindow" id="scrolledWindow"> | ||
1822 | 18 | <property name="visible">True</property> | ||
1823 | 19 | <property name="can_focus">True</property> | ||
1824 | 20 | <property name="hscrollbar_policy">automatic</property> | ||
1825 | 21 | <property name="vscrollbar_policy">automatic</property> | ||
1826 | 22 | <property name="shadow_type">in</property> | ||
1827 | 23 | <child> | ||
1828 | 24 | <placeholder/> | ||
1829 | 25 | </child> | ||
1830 | 26 | </widget> | ||
1831 | 27 | <packing> | ||
1832 | 28 | <property name="position">0</property> | ||
1833 | 29 | </packing> | ||
1834 | 30 | </child> | ||
1835 | 31 | <child> | ||
1836 | 32 | <widget class="GtkFrame" id="frame1"> | ||
1837 | 33 | <property name="visible">True</property> | ||
1838 | 34 | <property name="label_xalign">0</property> | ||
1839 | 35 | <property name="shadow_type">none</property> | ||
1840 | 36 | <child> | ||
1841 | 37 | <widget class="GtkAlignment" id="alignment2"> | ||
1842 | 38 | <property name="visible">True</property> | ||
1843 | 39 | <property name="top_padding">5</property> | ||
1844 | 40 | <property name="bottom_padding">5</property> | ||
1845 | 41 | <property name="left_padding">10</property> | ||
1846 | 42 | <child> | ||
1847 | 43 | <widget class="GtkVBox" id="settingsVbox"> | ||
1848 | 44 | <property name="visible">True</property> | ||
1849 | 45 | <property name="orientation">vertical</property> | ||
1850 | 46 | <child> | ||
1851 | 47 | <widget class="GtkCheckButton" id="promptCheckbox"> | ||
1852 | 48 | <property name="label" translatable="yes">Always prompt before pasting this phrase</property> | ||
1853 | 49 | <property name="visible">True</property> | ||
1854 | 50 | <property name="can_focus">True</property> | ||
1855 | 51 | <property name="receives_default">False</property> | ||
1856 | 52 | <property name="draw_indicator">True</property> | ||
1857 | 53 | <signal name="toggled" handler="on_modified"/> | ||
1858 | 54 | </widget> | ||
1859 | 55 | <packing> | ||
1860 | 56 | <property name="position">0</property> | ||
1861 | 57 | </packing> | ||
1862 | 58 | </child> | ||
1863 | 59 | <child> | ||
1864 | 60 | <widget class="GtkCheckButton" id="showInTrayCheckbox"> | ||
1865 | 61 | <property name="label" translatable="yes">Show in tray menu </property> | ||
1866 | 62 | <property name="visible">True</property> | ||
1867 | 63 | <property name="can_focus">True</property> | ||
1868 | 64 | <property name="receives_default">False</property> | ||
1869 | 65 | <property name="draw_indicator">True</property> | ||
1870 | 66 | <signal name="toggled" handler="on_modified"/> | ||
1871 | 67 | </widget> | ||
1872 | 68 | <packing> | ||
1873 | 69 | <property name="position">1</property> | ||
1874 | 70 | </packing> | ||
1875 | 71 | </child> | ||
1876 | 72 | <child> | ||
1877 | 73 | <widget class="GtkHSeparator" id="hseparator1"> | ||
1878 | 74 | <property name="visible">True</property> | ||
1879 | 75 | </widget> | ||
1880 | 76 | <packing> | ||
1881 | 77 | <property name="expand">False</property> | ||
1882 | 78 | <property name="position">2</property> | ||
1883 | 79 | </packing> | ||
1884 | 80 | </child> | ||
1885 | 81 | </widget> | ||
1886 | 82 | </child> | ||
1887 | 83 | </widget> | ||
1888 | 84 | </child> | ||
1889 | 85 | <child> | ||
1890 | 86 | <widget class="GtkLabel" id="label2"> | ||
1891 | 87 | <property name="visible">True</property> | ||
1892 | 88 | <property name="label" translatable="yes"><b>Phrase Settings</b></property> | ||
1893 | 89 | <property name="use_markup">True</property> | ||
1894 | 90 | </widget> | ||
1895 | 91 | <packing> | ||
1896 | 92 | <property name="type">label_item</property> | ||
1897 | 93 | </packing> | ||
1898 | 94 | </child> | ||
1899 | 95 | </widget> | ||
1900 | 96 | <packing> | ||
1901 | 97 | <property name="expand">False</property> | ||
1902 | 98 | <property name="position">1</property> | ||
1903 | 99 | </packing> | ||
1904 | 100 | </child> | ||
1905 | 101 | </widget> | ||
1906 | 102 | </child> | ||
1907 | 103 | </widget> | ||
1908 | 104 | </child> | ||
1909 | 105 | </widget> | ||
1910 | 106 | </glade-interface> | ||
1911 | 0 | 107 | ||
1912 | === added file 'glade/recorddialog.glade' | |||
1913 | --- glade/recorddialog.glade 1970-01-01 00:00:00 +0000 | |||
1914 | +++ glade/recorddialog.glade 2010-03-26 15:01:22 +0000 | |||
1915 | @@ -0,0 +1,145 @@ | |||
1916 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1917 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
1918 | 3 | <!--Generated with glade3 3.4.5 on Fri Oct 30 16:24:33 2009 --> | ||
1919 | 4 | <glade-interface> | ||
1920 | 5 | <widget class="GtkDialog" id="recorddialog"> | ||
1921 | 6 | <property name="border_width">5</property> | ||
1922 | 7 | <property name="title" translatable="yes">Record Macro</property> | ||
1923 | 8 | <property name="resizable">False</property> | ||
1924 | 9 | <property name="modal">True</property> | ||
1925 | 10 | <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> | ||
1926 | 11 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | ||
1927 | 12 | <signal name="response" handler="on_response"/> | ||
1928 | 13 | <child internal-child="vbox"> | ||
1929 | 14 | <widget class="GtkVBox" id="dialog-vbox1"> | ||
1930 | 15 | <property name="visible">True</property> | ||
1931 | 16 | <property name="spacing">2</property> | ||
1932 | 17 | <child> | ||
1933 | 18 | <widget class="GtkVBox" id="vbox1"> | ||
1934 | 19 | <property name="visible">True</property> | ||
1935 | 20 | <child> | ||
1936 | 21 | <widget class="GtkLabel" id="label1"> | ||
1937 | 22 | <property name="visible">True</property> | ||
1938 | 23 | <property name="xalign">0</property> | ||
1939 | 24 | <property name="label" translatable="yes"><b>Record a keyboard/mouse macro</b></property> | ||
1940 | 25 | <property name="use_markup">True</property> | ||
1941 | 26 | </widget> | ||
1942 | 27 | <packing> | ||
1943 | 28 | <property name="padding">5</property> | ||
1944 | 29 | </packing> | ||
1945 | 30 | </child> | ||
1946 | 31 | <child> | ||
1947 | 32 | <widget class="GtkCheckButton" id="keyboardButton"> | ||
1948 | 33 | <property name="visible">True</property> | ||
1949 | 34 | <property name="can_focus">True</property> | ||
1950 | 35 | <property name="label" translatable="yes">Record keyboard events</property> | ||
1951 | 36 | <property name="response_id">0</property> | ||
1952 | 37 | <property name="active">True</property> | ||
1953 | 38 | <property name="draw_indicator">True</property> | ||
1954 | 39 | </widget> | ||
1955 | 40 | <packing> | ||
1956 | 41 | <property name="padding">3</property> | ||
1957 | 42 | <property name="position">1</property> | ||
1958 | 43 | </packing> | ||
1959 | 44 | </child> | ||
1960 | 45 | <child> | ||
1961 | 46 | <widget class="GtkCheckButton" id="mouseButton"> | ||
1962 | 47 | <property name="visible">True</property> | ||
1963 | 48 | <property name="can_focus">True</property> | ||
1964 | 49 | <property name="label" translatable="yes">Record mouse events (experimental)</property> | ||
1965 | 50 | <property name="response_id">0</property> | ||
1966 | 51 | <property name="draw_indicator">True</property> | ||
1967 | 52 | </widget> | ||
1968 | 53 | <packing> | ||
1969 | 54 | <property name="padding">3</property> | ||
1970 | 55 | <property name="position">2</property> | ||
1971 | 56 | </packing> | ||
1972 | 57 | </child> | ||
1973 | 58 | <child> | ||
1974 | 59 | <widget class="GtkHBox" id="hbox1"> | ||
1975 | 60 | <property name="visible">True</property> | ||
1976 | 61 | <property name="spacing">5</property> | ||
1977 | 62 | <child> | ||
1978 | 63 | <widget class="GtkLabel" id="label2"> | ||
1979 | 64 | <property name="visible">True</property> | ||
1980 | 65 | <property name="label" translatable="yes">Start recording after</property> | ||
1981 | 66 | </widget> | ||
1982 | 67 | <packing> | ||
1983 | 68 | <property name="expand">False</property> | ||
1984 | 69 | </packing> | ||
1985 | 70 | </child> | ||
1986 | 71 | <child> | ||
1987 | 72 | <widget class="GtkSpinButton" id="spinButton"> | ||
1988 | 73 | <property name="visible">True</property> | ||
1989 | 74 | <property name="can_focus">True</property> | ||
1990 | 75 | <property name="adjustment">5 1 20 1 10 10</property> | ||
1991 | 76 | </widget> | ||
1992 | 77 | <packing> | ||
1993 | 78 | <property name="expand">False</property> | ||
1994 | 79 | <property name="fill">False</property> | ||
1995 | 80 | <property name="position">1</property> | ||
1996 | 81 | </packing> | ||
1997 | 82 | </child> | ||
1998 | 83 | <child> | ||
1999 | 84 | <widget class="GtkLabel" id="label3"> | ||
2000 | 85 | <property name="visible">True</property> | ||
2001 | 86 | <property name="label" translatable="yes">seconds</property> | ||
2002 | 87 | </widget> | ||
2003 | 88 | <packing> | ||
2004 | 89 | <property name="expand">False</property> | ||
2005 | 90 | <property name="position">2</property> | ||
2006 | 91 | </packing> | ||
2007 | 92 | </child> | ||
2008 | 93 | </widget> | ||
2009 | 94 | <packing> | ||
2010 | 95 | <property name="expand">False</property> | ||
2011 | 96 | <property name="padding">5</property> | ||
2012 | 97 | <property name="position">3</property> | ||
2013 | 98 | </packing> | ||
2014 | 99 | </child> | ||
2015 | 100 | </widget> | ||
2016 | 101 | <packing> | ||
2017 | 102 | <property name="position">2</property> | ||
2018 | 103 | </packing> | ||
2019 | 104 | </child> | ||
2020 | 105 | <child internal-child="action_area"> | ||
2021 | 106 | <widget class="GtkHButtonBox" id="dialog-action_area1"> | ||
2022 | 107 | <property name="visible">True</property> | ||
2023 | 108 | <property name="layout_style">GTK_BUTTONBOX_END</property> | ||
2024 | 109 | <child> | ||
2025 | 110 | <widget class="GtkButton" id="cancelButton"> | ||
2026 | 111 | <property name="visible">True</property> | ||
2027 | 112 | <property name="can_focus">True</property> | ||
2028 | 113 | <property name="receives_default">True</property> | ||
2029 | 114 | <property name="label" translatable="yes">gtk-cancel</property> | ||
2030 | 115 | <property name="use_stock">True</property> | ||
2031 | 116 | <property name="response_id">0</property> | ||
2032 | 117 | <signal name="clicked" handler="on_cancel"/> | ||
2033 | 118 | </widget> | ||
2034 | 119 | </child> | ||
2035 | 120 | <child> | ||
2036 | 121 | <widget class="GtkButton" id="okButton"> | ||
2037 | 122 | <property name="visible">True</property> | ||
2038 | 123 | <property name="can_focus">True</property> | ||
2039 | 124 | <property name="can_default">True</property> | ||
2040 | 125 | <property name="has_default">True</property> | ||
2041 | 126 | <property name="receives_default">True</property> | ||
2042 | 127 | <property name="label" translatable="yes">gtk-ok</property> | ||
2043 | 128 | <property name="use_stock">True</property> | ||
2044 | 129 | <property name="response_id">0</property> | ||
2045 | 130 | <signal name="clicked" handler="on_ok"/> | ||
2046 | 131 | </widget> | ||
2047 | 132 | <packing> | ||
2048 | 133 | <property name="position">1</property> | ||
2049 | 134 | </packing> | ||
2050 | 135 | </child> | ||
2051 | 136 | </widget> | ||
2052 | 137 | <packing> | ||
2053 | 138 | <property name="expand">False</property> | ||
2054 | 139 | <property name="pack_type">GTK_PACK_END</property> | ||
2055 | 140 | </packing> | ||
2056 | 141 | </child> | ||
2057 | 142 | </widget> | ||
2058 | 143 | </child> | ||
2059 | 144 | </widget> | ||
2060 | 145 | </glade-interface> | ||
2061 | 0 | 146 | ||
2062 | === added file 'glade/scriptpage.glade' | |||
2063 | --- glade/scriptpage.glade 1970-01-01 00:00:00 +0000 | |||
2064 | +++ glade/scriptpage.glade 2010-03-26 15:01:22 +0000 | |||
2065 | @@ -0,0 +1,106 @@ | |||
2066 | 1 | <?xml version="1.0"?> | ||
2067 | 2 | <glade-interface> | ||
2068 | 3 | <!-- interface-requires gtk+ 2.6 --> | ||
2069 | 4 | <!-- interface-naming-policy toplevel-contextual --> | ||
2070 | 5 | <widget class="GtkWindow" id="window1"> | ||
2071 | 6 | <child> | ||
2072 | 7 | <widget class="GtkAlignment" id="scriptpage"> | ||
2073 | 8 | <property name="visible">True</property> | ||
2074 | 9 | <property name="top_padding">5</property> | ||
2075 | 10 | <property name="bottom_padding">5</property> | ||
2076 | 11 | <child> | ||
2077 | 12 | <widget class="GtkVBox" id="vbox1"> | ||
2078 | 13 | <property name="visible">True</property> | ||
2079 | 14 | <property name="orientation">vertical</property> | ||
2080 | 15 | <property name="spacing">5</property> | ||
2081 | 16 | <child> | ||
2082 | 17 | <widget class="GtkScrolledWindow" id="scrolledWindow"> | ||
2083 | 18 | <property name="visible">True</property> | ||
2084 | 19 | <property name="can_focus">True</property> | ||
2085 | 20 | <property name="hscrollbar_policy">automatic</property> | ||
2086 | 21 | <property name="vscrollbar_policy">automatic</property> | ||
2087 | 22 | <property name="shadow_type">in</property> | ||
2088 | 23 | <child> | ||
2089 | 24 | <placeholder/> | ||
2090 | 25 | </child> | ||
2091 | 26 | </widget> | ||
2092 | 27 | <packing> | ||
2093 | 28 | <property name="position">0</property> | ||
2094 | 29 | </packing> | ||
2095 | 30 | </child> | ||
2096 | 31 | <child> | ||
2097 | 32 | <widget class="GtkFrame" id="frame1"> | ||
2098 | 33 | <property name="visible">True</property> | ||
2099 | 34 | <property name="label_xalign">0</property> | ||
2100 | 35 | <property name="shadow_type">none</property> | ||
2101 | 36 | <child> | ||
2102 | 37 | <widget class="GtkAlignment" id="alignment2"> | ||
2103 | 38 | <property name="visible">True</property> | ||
2104 | 39 | <property name="top_padding">5</property> | ||
2105 | 40 | <property name="bottom_padding">5</property> | ||
2106 | 41 | <property name="left_padding">10</property> | ||
2107 | 42 | <child> | ||
2108 | 43 | <widget class="GtkVBox" id="settingsVbox"> | ||
2109 | 44 | <property name="visible">True</property> | ||
2110 | 45 | <property name="orientation">vertical</property> | ||
2111 | 46 | <child> | ||
2112 | 47 | <widget class="GtkCheckButton" id="promptCheckbox"> | ||
2113 | 48 | <property name="label" translatable="yes">Always prompt before executing this script</property> | ||
2114 | 49 | <property name="visible">True</property> | ||
2115 | 50 | <property name="can_focus">True</property> | ||
2116 | 51 | <property name="receives_default">False</property> | ||
2117 | 52 | <property name="draw_indicator">True</property> | ||
2118 | 53 | <signal name="toggled" handler="on_modified"/> | ||
2119 | 54 | </widget> | ||
2120 | 55 | <packing> | ||
2121 | 56 | <property name="position">0</property> | ||
2122 | 57 | </packing> | ||
2123 | 58 | </child> | ||
2124 | 59 | <child> | ||
2125 | 60 | <widget class="GtkCheckButton" id="showInTrayCheckbox"> | ||
2126 | 61 | <property name="label" translatable="yes">Show in tray menu </property> | ||
2127 | 62 | <property name="visible">True</property> | ||
2128 | 63 | <property name="can_focus">True</property> | ||
2129 | 64 | <property name="receives_default">False</property> | ||
2130 | 65 | <property name="draw_indicator">True</property> | ||
2131 | 66 | <signal name="toggled" handler="on_modified"/> | ||
2132 | 67 | </widget> | ||
2133 | 68 | <packing> | ||
2134 | 69 | <property name="position">1</property> | ||
2135 | 70 | </packing> | ||
2136 | 71 | </child> | ||
2137 | 72 | <child> | ||
2138 | 73 | <widget class="GtkHSeparator" id="hseparator1"> | ||
2139 | 74 | <property name="visible">True</property> | ||
2140 | 75 | </widget> | ||
2141 | 76 | <packing> | ||
2142 | 77 | <property name="expand">False</property> | ||
2143 | 78 | <property name="position">2</property> | ||
2144 | 79 | </packing> | ||
2145 | 80 | </child> | ||
2146 | 81 | </widget> | ||
2147 | 82 | </child> | ||
2148 | 83 | </widget> | ||
2149 | 84 | </child> | ||
2150 | 85 | <child> | ||
2151 | 86 | <widget class="GtkLabel" id="label2"> | ||
2152 | 87 | <property name="visible">True</property> | ||
2153 | 88 | <property name="label" translatable="yes"><b>Script Settings</b></property> | ||
2154 | 89 | <property name="use_markup">True</property> | ||
2155 | 90 | </widget> | ||
2156 | 91 | <packing> | ||
2157 | 92 | <property name="type">label_item</property> | ||
2158 | 93 | </packing> | ||
2159 | 94 | </child> | ||
2160 | 95 | </widget> | ||
2161 | 96 | <packing> | ||
2162 | 97 | <property name="expand">False</property> | ||
2163 | 98 | <property name="position">1</property> | ||
2164 | 99 | </packing> | ||
2165 | 100 | </child> | ||
2166 | 101 | </widget> | ||
2167 | 102 | </child> | ||
2168 | 103 | </widget> | ||
2169 | 104 | </child> | ||
2170 | 105 | </widget> | ||
2171 | 106 | </glade-interface> | ||
2172 | 0 | 107 | ||
2173 | === added file 'glade/settingsdialog.glade' | |||
2174 | --- glade/settingsdialog.glade 1970-01-01 00:00:00 +0000 | |||
2175 | +++ glade/settingsdialog.glade 2010-03-26 15:01:22 +0000 | |||
2176 | @@ -0,0 +1,762 @@ | |||
2177 | 1 | <?xml version="1.0"?> | ||
2178 | 2 | <glade-interface> | ||
2179 | 3 | <!-- interface-requires gtk+ 2.16 --> | ||
2180 | 4 | <!-- interface-naming-policy project-wide --> | ||
2181 | 5 | <widget class="GtkDialog" id="settingsdialog"> | ||
2182 | 6 | <property name="border_width">5</property> | ||
2183 | 7 | <property name="title" translatable="yes">AutoKey - Preferences</property> | ||
2184 | 8 | <property name="modal">True</property> | ||
2185 | 9 | <property name="window_position">center-on-parent</property> | ||
2186 | 10 | <property name="type_hint">dialog</property> | ||
2187 | 11 | <property name="has_separator">False</property> | ||
2188 | 12 | <child internal-child="vbox"> | ||
2189 | 13 | <widget class="GtkVBox" id="dialog-vbox1"> | ||
2190 | 14 | <property name="visible">True</property> | ||
2191 | 15 | <property name="orientation">vertical</property> | ||
2192 | 16 | <property name="spacing">2</property> | ||
2193 | 17 | <child> | ||
2194 | 18 | <widget class="GtkNotebook" id="notebook1"> | ||
2195 | 19 | <property name="visible">True</property> | ||
2196 | 20 | <property name="can_focus">True</property> | ||
2197 | 21 | <child> | ||
2198 | 22 | <widget class="GtkAlignment" id="alignment1"> | ||
2199 | 23 | <property name="visible">True</property> | ||
2200 | 24 | <property name="yalign">0</property> | ||
2201 | 25 | <property name="yscale">0</property> | ||
2202 | 26 | <property name="top_padding">5</property> | ||
2203 | 27 | <property name="bottom_padding">5</property> | ||
2204 | 28 | <property name="left_padding">5</property> | ||
2205 | 29 | <property name="right_padding">5</property> | ||
2206 | 30 | <child> | ||
2207 | 31 | <widget class="GtkVBox" id="vbox1"> | ||
2208 | 32 | <property name="visible">True</property> | ||
2209 | 33 | <property name="orientation">vertical</property> | ||
2210 | 34 | <property name="spacing">5</property> | ||
2211 | 35 | <child> | ||
2212 | 36 | <widget class="GtkFrame" id="frame8"> | ||
2213 | 37 | <property name="visible">True</property> | ||
2214 | 38 | <property name="label_xalign">0</property> | ||
2215 | 39 | <property name="shadow_type">none</property> | ||
2216 | 40 | <child> | ||
2217 | 41 | <widget class="GtkAlignment" id="alignment11"> | ||
2218 | 42 | <property name="visible">True</property> | ||
2219 | 43 | <property name="left_padding">12</property> | ||
2220 | 44 | <child> | ||
2221 | 45 | <widget class="GtkVBox" id="vbox7"> | ||
2222 | 46 | <property name="visible">True</property> | ||
2223 | 47 | <property name="orientation">vertical</property> | ||
2224 | 48 | <child> | ||
2225 | 49 | <widget class="GtkCheckButton" id="autoStartCheckbox"> | ||
2226 | 50 | <property name="label" translatable="yes">Automatically start AutoKey at login</property> | ||
2227 | 51 | <property name="visible">True</property> | ||
2228 | 52 | <property name="can_focus">True</property> | ||
2229 | 53 | <property name="receives_default">False</property> | ||
2230 | 54 | <property name="draw_indicator">True</property> | ||
2231 | 55 | </widget> | ||
2232 | 56 | <packing> | ||
2233 | 57 | <property name="position">0</property> | ||
2234 | 58 | </packing> | ||
2235 | 59 | </child> | ||
2236 | 60 | <child> | ||
2237 | 61 | <widget class="GtkCheckButton" id="promptToSaveCheckbox"> | ||
2238 | 62 | <property name="label" translatable="yes">Prompt for unsaved changes</property> | ||
2239 | 63 | <property name="visible">True</property> | ||
2240 | 64 | <property name="can_focus">True</property> | ||
2241 | 65 | <property name="receives_default">False</property> | ||
2242 | 66 | <property name="draw_indicator">True</property> | ||
2243 | 67 | </widget> | ||
2244 | 68 | <packing> | ||
2245 | 69 | <property name="position">1</property> | ||
2246 | 70 | </packing> | ||
2247 | 71 | </child> | ||
2248 | 72 | <child> | ||
2249 | 73 | <widget class="GtkCheckButton" id="showTrayCheckbox"> | ||
2250 | 74 | <property name="label" translatable="yes">Show a tray icon (requires restart)</property> | ||
2251 | 75 | <property name="visible">True</property> | ||
2252 | 76 | <property name="can_focus">True</property> | ||
2253 | 77 | <property name="receives_default">False</property> | ||
2254 | 78 | <property name="draw_indicator">True</property> | ||
2255 | 79 | </widget> | ||
2256 | 80 | <packing> | ||
2257 | 81 | <property name="position">2</property> | ||
2258 | 82 | </packing> | ||
2259 | 83 | </child> | ||
2260 | 84 | </widget> | ||
2261 | 85 | </child> | ||
2262 | 86 | </widget> | ||
2263 | 87 | </child> | ||
2264 | 88 | <child> | ||
2265 | 89 | <widget class="GtkLabel" id="label"> | ||
2266 | 90 | <property name="visible">True</property> | ||
2267 | 91 | <property name="label" translatable="yes"><b>Application</b></property> | ||
2268 | 92 | <property name="use_markup">True</property> | ||
2269 | 93 | </widget> | ||
2270 | 94 | <packing> | ||
2271 | 95 | <property name="type">label_item</property> | ||
2272 | 96 | </packing> | ||
2273 | 97 | </child> | ||
2274 | 98 | </widget> | ||
2275 | 99 | <packing> | ||
2276 | 100 | <property name="position">0</property> | ||
2277 | 101 | </packing> | ||
2278 | 102 | </child> | ||
2279 | 103 | <child> | ||
2280 | 104 | <widget class="GtkFrame" id="frame2"> | ||
2281 | 105 | <property name="visible">True</property> | ||
2282 | 106 | <property name="label_xalign">0</property> | ||
2283 | 107 | <property name="shadow_type">none</property> | ||
2284 | 108 | <child> | ||
2285 | 109 | <widget class="GtkAlignment" id="alignment3"> | ||
2286 | 110 | <property name="visible">True</property> | ||
2287 | 111 | <property name="left_padding">12</property> | ||
2288 | 112 | <child> | ||
2289 | 113 | <widget class="GtkVBox" id="vbox3"> | ||
2290 | 114 | <property name="visible">True</property> | ||
2291 | 115 | <property name="orientation">vertical</property> | ||
2292 | 116 | <child> | ||
2293 | 117 | <widget class="GtkCheckButton" id="allowKbNavCheckbox"> | ||
2294 | 118 | <property name="label" translatable="yes">Allow keyboard navigation of popup menu</property> | ||
2295 | 119 | <property name="visible">True</property> | ||
2296 | 120 | <property name="can_focus">True</property> | ||
2297 | 121 | <property name="receives_default">False</property> | ||
2298 | 122 | <property name="draw_indicator">True</property> | ||
2299 | 123 | </widget> | ||
2300 | 124 | <packing> | ||
2301 | 125 | <property name="position">0</property> | ||
2302 | 126 | </packing> | ||
2303 | 127 | </child> | ||
2304 | 128 | <child> | ||
2305 | 129 | <widget class="GtkCheckButton" id="sortByUsageCheckbox"> | ||
2306 | 130 | <property name="label" translatable="yes">Sort menu items with most frequently used first</property> | ||
2307 | 131 | <property name="visible">True</property> | ||
2308 | 132 | <property name="can_focus">True</property> | ||
2309 | 133 | <property name="receives_default">False</property> | ||
2310 | 134 | <property name="draw_indicator">True</property> | ||
2311 | 135 | </widget> | ||
2312 | 136 | <packing> | ||
2313 | 137 | <property name="position">1</property> | ||
2314 | 138 | </packing> | ||
2315 | 139 | </child> | ||
2316 | 140 | </widget> | ||
2317 | 141 | </child> | ||
2318 | 142 | </widget> | ||
2319 | 143 | </child> | ||
2320 | 144 | <child> | ||
2321 | 145 | <widget class="GtkLabel" id="label5"> | ||
2322 | 146 | <property name="visible">True</property> | ||
2323 | 147 | <property name="label" translatable="yes"><b>Popup Menu</b></property> | ||
2324 | 148 | <property name="use_markup">True</property> | ||
2325 | 149 | </widget> | ||
2326 | 150 | <packing> | ||
2327 | 151 | <property name="type">label_item</property> | ||
2328 | 152 | </packing> | ||
2329 | 153 | </child> | ||
2330 | 154 | </widget> | ||
2331 | 155 | <packing> | ||
2332 | 156 | <property name="position">1</property> | ||
2333 | 157 | </packing> | ||
2334 | 158 | </child> | ||
2335 | 159 | <child> | ||
2336 | 160 | <widget class="GtkFrame" id="frame3"> | ||
2337 | 161 | <property name="visible">True</property> | ||
2338 | 162 | <property name="label_xalign">0</property> | ||
2339 | 163 | <property name="shadow_type">none</property> | ||
2340 | 164 | <child> | ||
2341 | 165 | <widget class="GtkAlignment" id="alignment4"> | ||
2342 | 166 | <property name="visible">True</property> | ||
2343 | 167 | <property name="left_padding">12</property> | ||
2344 | 168 | <child> | ||
2345 | 169 | <widget class="GtkCheckButton" id="enableUndoCheckbox"> | ||
2346 | 170 | <property name="label" translatable="yes">Enable undo by pressing backspace</property> | ||
2347 | 171 | <property name="visible">True</property> | ||
2348 | 172 | <property name="can_focus">True</property> | ||
2349 | 173 | <property name="receives_default">False</property> | ||
2350 | 174 | <property name="draw_indicator">True</property> | ||
2351 | 175 | </widget> | ||
2352 | 176 | </child> | ||
2353 | 177 | </widget> | ||
2354 | 178 | </child> | ||
2355 | 179 | <child> | ||
2356 | 180 | <widget class="GtkLabel" id="label6"> | ||
2357 | 181 | <property name="visible">True</property> | ||
2358 | 182 | <property name="label" translatable="yes"><b>Expansions</b></property> | ||
2359 | 183 | <property name="use_markup">True</property> | ||
2360 | 184 | </widget> | ||
2361 | 185 | <packing> | ||
2362 | 186 | <property name="type">label_item</property> | ||
2363 | 187 | </packing> | ||
2364 | 188 | </child> | ||
2365 | 189 | </widget> | ||
2366 | 190 | <packing> | ||
2367 | 191 | <property name="position">2</property> | ||
2368 | 192 | </packing> | ||
2369 | 193 | </child> | ||
2370 | 194 | </widget> | ||
2371 | 195 | </child> | ||
2372 | 196 | </widget> | ||
2373 | 197 | </child> | ||
2374 | 198 | <child> | ||
2375 | 199 | <widget class="GtkLabel" id="label1"> | ||
2376 | 200 | <property name="visible">True</property> | ||
2377 | 201 | <property name="label" translatable="yes">General</property> | ||
2378 | 202 | </widget> | ||
2379 | 203 | <packing> | ||
2380 | 204 | <property name="tab_fill">False</property> | ||
2381 | 205 | <property name="type">tab</property> | ||
2382 | 206 | </packing> | ||
2383 | 207 | </child> | ||
2384 | 208 | <child> | ||
2385 | 209 | <widget class="GtkAlignment" id="alignment5"> | ||
2386 | 210 | <property name="visible">True</property> | ||
2387 | 211 | <property name="yalign">0</property> | ||
2388 | 212 | <property name="yscale">0</property> | ||
2389 | 213 | <property name="top_padding">5</property> | ||
2390 | 214 | <property name="bottom_padding">5</property> | ||
2391 | 215 | <property name="left_padding">5</property> | ||
2392 | 216 | <property name="right_padding">5</property> | ||
2393 | 217 | <child> | ||
2394 | 218 | <widget class="GtkVBox" id="vbox4"> | ||
2395 | 219 | <property name="visible">True</property> | ||
2396 | 220 | <property name="orientation">vertical</property> | ||
2397 | 221 | <property name="spacing">10</property> | ||
2398 | 222 | <child> | ||
2399 | 223 | <widget class="GtkFrame" id="frame4"> | ||
2400 | 224 | <property name="visible">True</property> | ||
2401 | 225 | <property name="label_xalign">0</property> | ||
2402 | 226 | <property name="shadow_type">none</property> | ||
2403 | 227 | <child> | ||
2404 | 228 | <widget class="GtkAlignment" id="alignment6"> | ||
2405 | 229 | <property name="visible">True</property> | ||
2406 | 230 | <property name="top_padding">5</property> | ||
2407 | 231 | <property name="bottom_padding">5</property> | ||
2408 | 232 | <property name="left_padding">12</property> | ||
2409 | 233 | <child> | ||
2410 | 234 | <widget class="GtkHBox" id="hbox1"> | ||
2411 | 235 | <property name="visible">True</property> | ||
2412 | 236 | <property name="spacing">5</property> | ||
2413 | 237 | <child> | ||
2414 | 238 | <widget class="GtkLabel" id="label10"> | ||
2415 | 239 | <property name="visible">True</property> | ||
2416 | 240 | <property name="xalign">0</property> | ||
2417 | 241 | <property name="label" translatable="yes">Hotkey:</property> | ||
2418 | 242 | </widget> | ||
2419 | 243 | <packing> | ||
2420 | 244 | <property name="expand">False</property> | ||
2421 | 245 | <property name="position">0</property> | ||
2422 | 246 | </packing> | ||
2423 | 247 | </child> | ||
2424 | 248 | <child> | ||
2425 | 249 | <widget class="GtkLabel" id="monitorKeyLabel"> | ||
2426 | 250 | <property name="visible">True</property> | ||
2427 | 251 | <property name="xalign">0</property> | ||
2428 | 252 | <property name="label" translatable="yes">$hotkey</property> | ||
2429 | 253 | </widget> | ||
2430 | 254 | <packing> | ||
2431 | 255 | <property name="position">1</property> | ||
2432 | 256 | </packing> | ||
2433 | 257 | </child> | ||
2434 | 258 | <child> | ||
2435 | 259 | <widget class="GtkButton" id="setMonitorButton"> | ||
2436 | 260 | <property name="label" translatable="yes">Set</property> | ||
2437 | 261 | <property name="width_request">80</property> | ||
2438 | 262 | <property name="visible">True</property> | ||
2439 | 263 | <property name="can_focus">True</property> | ||
2440 | 264 | <property name="receives_default">True</property> | ||
2441 | 265 | <signal name="clicked" handler="on_setMonitorButton_pressed"/> | ||
2442 | 266 | </widget> | ||
2443 | 267 | <packing> | ||
2444 | 268 | <property name="expand">False</property> | ||
2445 | 269 | <property name="position">2</property> | ||
2446 | 270 | </packing> | ||
2447 | 271 | </child> | ||
2448 | 272 | <child> | ||
2449 | 273 | <widget class="GtkButton" id="clearMonitorButton"> | ||
2450 | 274 | <property name="label">gtk-clear</property> | ||
2451 | 275 | <property name="width_request">80</property> | ||
2452 | 276 | <property name="visible">True</property> | ||
2453 | 277 | <property name="can_focus">True</property> | ||
2454 | 278 | <property name="receives_default">True</property> | ||
2455 | 279 | <property name="use_stock">True</property> | ||
2456 | 280 | <signal name="clicked" handler="on_clearMonitorButton_pressed"/> | ||
2457 | 281 | </widget> | ||
2458 | 282 | <packing> | ||
2459 | 283 | <property name="expand">False</property> | ||
2460 | 284 | <property name="position">3</property> | ||
2461 | 285 | </packing> | ||
2462 | 286 | </child> | ||
2463 | 287 | </widget> | ||
2464 | 288 | </child> | ||
2465 | 289 | </widget> | ||
2466 | 290 | </child> | ||
2467 | 291 | <child> | ||
2468 | 292 | <widget class="GtkLabel" id="label7"> | ||
2469 | 293 | <property name="visible">True</property> | ||
2470 | 294 | <property name="label" translatable="yes"><b>Toggle monitoring using a hotkey</b></property> | ||
2471 | 295 | <property name="use_markup">True</property> | ||
2472 | 296 | </widget> | ||
2473 | 297 | <packing> | ||
2474 | 298 | <property name="type">label_item</property> | ||
2475 | 299 | </packing> | ||
2476 | 300 | </child> | ||
2477 | 301 | </widget> | ||
2478 | 302 | <packing> | ||
2479 | 303 | <property name="position">0</property> | ||
2480 | 304 | </packing> | ||
2481 | 305 | </child> | ||
2482 | 306 | <child> | ||
2483 | 307 | <widget class="GtkFrame" id="frame5"> | ||
2484 | 308 | <property name="visible">True</property> | ||
2485 | 309 | <property name="label_xalign">0</property> | ||
2486 | 310 | <property name="shadow_type">none</property> | ||
2487 | 311 | <child> | ||
2488 | 312 | <widget class="GtkAlignment" id="alignment7"> | ||
2489 | 313 | <property name="visible">True</property> | ||
2490 | 314 | <property name="top_padding">5</property> | ||
2491 | 315 | <property name="bottom_padding">5</property> | ||
2492 | 316 | <property name="left_padding">12</property> | ||
2493 | 317 | <child> | ||
2494 | 318 | <widget class="GtkHBox" id="hbox2"> | ||
2495 | 319 | <property name="visible">True</property> | ||
2496 | 320 | <property name="spacing">5</property> | ||
2497 | 321 | <child> | ||
2498 | 322 | <widget class="GtkLabel" id="label12"> | ||
2499 | 323 | <property name="visible">True</property> | ||
2500 | 324 | <property name="xalign">0</property> | ||
2501 | 325 | <property name="label" translatable="yes">Hotkey:</property> | ||
2502 | 326 | </widget> | ||
2503 | 327 | <packing> | ||
2504 | 328 | <property name="expand">False</property> | ||
2505 | 329 | <property name="position">0</property> | ||
2506 | 330 | </packing> | ||
2507 | 331 | </child> | ||
2508 | 332 | <child> | ||
2509 | 333 | <widget class="GtkLabel" id="configKeyLabel"> | ||
2510 | 334 | <property name="visible">True</property> | ||
2511 | 335 | <property name="xalign">0</property> | ||
2512 | 336 | <property name="label" translatable="yes">$hotkey</property> | ||
2513 | 337 | </widget> | ||
2514 | 338 | <packing> | ||
2515 | 339 | <property name="position">1</property> | ||
2516 | 340 | </packing> | ||
2517 | 341 | </child> | ||
2518 | 342 | <child> | ||
2519 | 343 | <widget class="GtkButton" id="setConfigButton"> | ||
2520 | 344 | <property name="label" translatable="yes">Set</property> | ||
2521 | 345 | <property name="width_request">80</property> | ||
2522 | 346 | <property name="visible">True</property> | ||
2523 | 347 | <property name="can_focus">True</property> | ||
2524 | 348 | <property name="receives_default">True</property> | ||
2525 | 349 | <signal name="clicked" handler="on_setConfigButton_pressed"/> | ||
2526 | 350 | </widget> | ||
2527 | 351 | <packing> | ||
2528 | 352 | <property name="expand">False</property> | ||
2529 | 353 | <property name="position">2</property> | ||
2530 | 354 | </packing> | ||
2531 | 355 | </child> | ||
2532 | 356 | <child> | ||
2533 | 357 | <widget class="GtkButton" id="clearConfigButton"> | ||
2534 | 358 | <property name="label">gtk-clear</property> | ||
2535 | 359 | <property name="width_request">80</property> | ||
2536 | 360 | <property name="visible">True</property> | ||
2537 | 361 | <property name="can_focus">True</property> | ||
2538 | 362 | <property name="receives_default">True</property> | ||
2539 | 363 | <property name="use_stock">True</property> | ||
2540 | 364 | <signal name="clicked" handler="on_clearConfigButton_pressed"/> | ||
2541 | 365 | </widget> | ||
2542 | 366 | <packing> | ||
2543 | 367 | <property name="expand">False</property> | ||
2544 | 368 | <property name="position">3</property> | ||
2545 | 369 | </packing> | ||
2546 | 370 | </child> | ||
2547 | 371 | </widget> | ||
2548 | 372 | </child> | ||
2549 | 373 | </widget> | ||
2550 | 374 | </child> | ||
2551 | 375 | <child> | ||
2552 | 376 | <widget class="GtkLabel" id="label8"> | ||
2553 | 377 | <property name="visible">True</property> | ||
2554 | 378 | <property name="label" translatable="yes"><b>Show configuration window using a hotkey</b></property> | ||
2555 | 379 | <property name="use_markup">True</property> | ||
2556 | 380 | </widget> | ||
2557 | 381 | <packing> | ||
2558 | 382 | <property name="type">label_item</property> | ||
2559 | 383 | </packing> | ||
2560 | 384 | </child> | ||
2561 | 385 | </widget> | ||
2562 | 386 | <packing> | ||
2563 | 387 | <property name="position">1</property> | ||
2564 | 388 | </packing> | ||
2565 | 389 | </child> | ||
2566 | 390 | <child> | ||
2567 | 391 | <widget class="GtkFrame" id="frame6"> | ||
2568 | 392 | <property name="visible">True</property> | ||
2569 | 393 | <property name="label_xalign">0</property> | ||
2570 | 394 | <property name="shadow_type">none</property> | ||
2571 | 395 | <child> | ||
2572 | 396 | <widget class="GtkAlignment" id="alignment8"> | ||
2573 | 397 | <property name="visible">True</property> | ||
2574 | 398 | <property name="top_padding">5</property> | ||
2575 | 399 | <property name="bottom_padding">5</property> | ||
2576 | 400 | <property name="left_padding">12</property> | ||
2577 | 401 | <child> | ||
2578 | 402 | <widget class="GtkHBox" id="hbox3"> | ||
2579 | 403 | <property name="visible">True</property> | ||
2580 | 404 | <property name="spacing">5</property> | ||
2581 | 405 | <child> | ||
2582 | 406 | <widget class="GtkLabel" id="label14"> | ||
2583 | 407 | <property name="visible">True</property> | ||
2584 | 408 | <property name="xalign">0</property> | ||
2585 | 409 | <property name="label" translatable="yes">Hotkey:</property> | ||
2586 | 410 | </widget> | ||
2587 | 411 | <packing> | ||
2588 | 412 | <property name="expand">False</property> | ||
2589 | 413 | <property name="position">0</property> | ||
2590 | 414 | </packing> | ||
2591 | 415 | </child> | ||
2592 | 416 | <child> | ||
2593 | 417 | <widget class="GtkLabel" id="popupKeyLabel"> | ||
2594 | 418 | <property name="visible">True</property> | ||
2595 | 419 | <property name="xalign">0</property> | ||
2596 | 420 | <property name="label" translatable="yes">$hotkey</property> | ||
2597 | 421 | </widget> | ||
2598 | 422 | <packing> | ||
2599 | 423 | <property name="position">1</property> | ||
2600 | 424 | </packing> | ||
2601 | 425 | </child> | ||
2602 | 426 | <child> | ||
2603 | 427 | <widget class="GtkButton" id="setPopupButton"> | ||
2604 | 428 | <property name="label" translatable="yes">Set</property> | ||
2605 | 429 | <property name="width_request">80</property> | ||
2606 | 430 | <property name="visible">True</property> | ||
2607 | 431 | <property name="can_focus">True</property> | ||
2608 | 432 | <property name="receives_default">True</property> | ||
2609 | 433 | <signal name="clicked" handler="on_setPopupButton_pressed"/> | ||
2610 | 434 | </widget> | ||
2611 | 435 | <packing> | ||
2612 | 436 | <property name="expand">False</property> | ||
2613 | 437 | <property name="position">2</property> | ||
2614 | 438 | </packing> | ||
2615 | 439 | </child> | ||
2616 | 440 | <child> | ||
2617 | 441 | <widget class="GtkButton" id="clearPopupButton"> | ||
2618 | 442 | <property name="label">gtk-clear</property> | ||
2619 | 443 | <property name="width_request">80</property> | ||
2620 | 444 | <property name="visible">True</property> | ||
2621 | 445 | <property name="can_focus">True</property> | ||
2622 | 446 | <property name="receives_default">True</property> | ||
2623 | 447 | <property name="use_stock">True</property> | ||
2624 | 448 | <signal name="clicked" handler="on_clearPopupButton_pressed"/> | ||
2625 | 449 | </widget> | ||
2626 | 450 | <packing> | ||
2627 | 451 | <property name="expand">False</property> | ||
2628 | 452 | <property name="position">3</property> | ||
2629 | 453 | </packing> | ||
2630 | 454 | </child> | ||
2631 | 455 | </widget> | ||
2632 | 456 | </child> | ||
2633 | 457 | </widget> | ||
2634 | 458 | </child> | ||
2635 | 459 | <child> | ||
2636 | 460 | <widget class="GtkLabel" id="label9"> | ||
2637 | 461 | <property name="visible">True</property> | ||
2638 | 462 | <property name="label" translatable="yes"><b>Show abbreviation popup using a hotkey</b></property> | ||
2639 | 463 | <property name="use_markup">True</property> | ||
2640 | 464 | </widget> | ||
2641 | 465 | <packing> | ||
2642 | 466 | <property name="type">label_item</property> | ||
2643 | 467 | </packing> | ||
2644 | 468 | </child> | ||
2645 | 469 | </widget> | ||
2646 | 470 | <packing> | ||
2647 | 471 | <property name="position">2</property> | ||
2648 | 472 | </packing> | ||
2649 | 473 | </child> | ||
2650 | 474 | </widget> | ||
2651 | 475 | </child> | ||
2652 | 476 | </widget> | ||
2653 | 477 | <packing> | ||
2654 | 478 | <property name="position">1</property> | ||
2655 | 479 | </packing> | ||
2656 | 480 | </child> | ||
2657 | 481 | <child> | ||
2658 | 482 | <widget class="GtkLabel" id="label2"> | ||
2659 | 483 | <property name="visible">True</property> | ||
2660 | 484 | <property name="label" translatable="yes">Special Hotkeys</property> | ||
2661 | 485 | </widget> | ||
2662 | 486 | <packing> | ||
2663 | 487 | <property name="position">1</property> | ||
2664 | 488 | <property name="tab_fill">False</property> | ||
2665 | 489 | <property name="type">tab</property> | ||
2666 | 490 | </packing> | ||
2667 | 491 | </child> | ||
2668 | 492 | <child> | ||
2669 | 493 | <widget class="GtkAlignment" id="alignment2"> | ||
2670 | 494 | <property name="visible">True</property> | ||
2671 | 495 | <property name="top_padding">5</property> | ||
2672 | 496 | <property name="bottom_padding">5</property> | ||
2673 | 497 | <property name="left_padding">5</property> | ||
2674 | 498 | <property name="right_padding">5</property> | ||
2675 | 499 | <child> | ||
2676 | 500 | <widget class="GtkFrame" id="frame1"> | ||
2677 | 501 | <property name="visible">True</property> | ||
2678 | 502 | <property name="label_xalign">0</property> | ||
2679 | 503 | <property name="shadow_type">none</property> | ||
2680 | 504 | <child> | ||
2681 | 505 | <widget class="GtkAlignment" id="alignment12"> | ||
2682 | 506 | <property name="visible">True</property> | ||
2683 | 507 | <property name="left_padding">12</property> | ||
2684 | 508 | <child> | ||
2685 | 509 | <widget class="GtkVBox" id="vbox2"> | ||
2686 | 510 | <property name="visible">True</property> | ||
2687 | 511 | <property name="orientation">vertical</property> | ||
2688 | 512 | <child> | ||
2689 | 513 | <widget class="GtkLabel" id="label17"> | ||
2690 | 514 | <property name="visible">True</property> | ||
2691 | 515 | <property name="xalign">0</property> | ||
2692 | 516 | <property name="ypad">5</property> | ||
2693 | 517 | <property name="label" translatable="yes">Any Python modules placed in this folder will be available for | ||
2694 | 518 | import by scripts.</property> | ||
2695 | 519 | </widget> | ||
2696 | 520 | <packing> | ||
2697 | 521 | <property name="expand">False</property> | ||
2698 | 522 | <property name="position">0</property> | ||
2699 | 523 | </packing> | ||
2700 | 524 | </child> | ||
2701 | 525 | <child> | ||
2702 | 526 | <widget class="GtkFileChooserButton" id="userModuleChooserButton"> | ||
2703 | 527 | <property name="visible">True</property> | ||
2704 | 528 | <property name="action">select-folder</property> | ||
2705 | 529 | <property name="title" translatable="yes">Select A Folder</property> | ||
2706 | 530 | </widget> | ||
2707 | 531 | <packing> | ||
2708 | 532 | <property name="expand">False</property> | ||
2709 | 533 | <property name="position">1</property> | ||
2710 | 534 | </packing> | ||
2711 | 535 | </child> | ||
2712 | 536 | </widget> | ||
2713 | 537 | </child> | ||
2714 | 538 | </widget> | ||
2715 | 539 | </child> | ||
2716 | 540 | <child> | ||
2717 | 541 | <widget class="GtkLabel" id="label16"> | ||
2718 | 542 | <property name="visible">True</property> | ||
2719 | 543 | <property name="label" translatable="yes"><b>User Module Folder</b></property> | ||
2720 | 544 | <property name="use_markup">True</property> | ||
2721 | 545 | </widget> | ||
2722 | 546 | <packing> | ||
2723 | 547 | <property name="type">label_item</property> | ||
2724 | 548 | </packing> | ||
2725 | 549 | </child> | ||
2726 | 550 | </widget> | ||
2727 | 551 | </child> | ||
2728 | 552 | </widget> | ||
2729 | 553 | <packing> | ||
2730 | 554 | <property name="position">2</property> | ||
2731 | 555 | </packing> | ||
2732 | 556 | </child> | ||
2733 | 557 | <child> | ||
2734 | 558 | <widget class="GtkLabel" id="label4"> | ||
2735 | 559 | <property name="visible">True</property> | ||
2736 | 560 | <property name="label" translatable="yes">Script Engine</property> | ||
2737 | 561 | </widget> | ||
2738 | 562 | <packing> | ||
2739 | 563 | <property name="position">3</property> | ||
2740 | 564 | <property name="tab_fill">False</property> | ||
2741 | 565 | <property name="type">tab</property> | ||
2742 | 566 | </packing> | ||
2743 | 567 | </child> | ||
2744 | 568 | <child> | ||
2745 | 569 | <widget class="GtkAlignment" id="alignment9"> | ||
2746 | 570 | <property name="visible">True</property> | ||
2747 | 571 | <property name="yalign">0</property> | ||
2748 | 572 | <property name="yscale">0</property> | ||
2749 | 573 | <property name="top_padding">5</property> | ||
2750 | 574 | <property name="bottom_padding">5</property> | ||
2751 | 575 | <property name="left_padding">5</property> | ||
2752 | 576 | <property name="right_padding">5</property> | ||
2753 | 577 | <child> | ||
2754 | 578 | <widget class="GtkVBox" id="vbox5"> | ||
2755 | 579 | <property name="visible">True</property> | ||
2756 | 580 | <property name="orientation">vertical</property> | ||
2757 | 581 | <property name="spacing">5</property> | ||
2758 | 582 | <child> | ||
2759 | 583 | <widget class="GtkFrame" id="frame7"> | ||
2760 | 584 | <property name="visible">True</property> | ||
2761 | 585 | <property name="label_xalign">0</property> | ||
2762 | 586 | <property name="shadow_type">none</property> | ||
2763 | 587 | <child> | ||
2764 | 588 | <widget class="GtkAlignment" id="alignment10"> | ||
2765 | 589 | <property name="visible">True</property> | ||
2766 | 590 | <property name="top_padding">5</property> | ||
2767 | 591 | <property name="bottom_padding">5</property> | ||
2768 | 592 | <property name="right_padding">5</property> | ||
2769 | 593 | <child> | ||
2770 | 594 | <widget class="GtkVBox" id="vbox6"> | ||
2771 | 595 | <property name="visible">True</property> | ||
2772 | 596 | <property name="orientation">vertical</property> | ||
2773 | 597 | <property name="spacing">5</property> | ||
2774 | 598 | <child> | ||
2775 | 599 | <widget class="GtkLabel" id="label15"> | ||
2776 | 600 | <property name="visible">True</property> | ||
2777 | 601 | <property name="xalign">0</property> | ||
2778 | 602 | <property name="label" translatable="yes">Configure the method AutoKey uses to receive keyboard and | ||
2779 | 603 | mouse events. Only change this option if AutoKey is not | ||
2780 | 604 | responding to abbreviations and hotkeys. | ||
2781 | 605 | |||
2782 | 606 | After changing this option, you will need to restart AutoKey for | ||
2783 | 607 | it to take effect.</property> | ||
2784 | 608 | </widget> | ||
2785 | 609 | <packing> | ||
2786 | 610 | <property name="position">0</property> | ||
2787 | 611 | </packing> | ||
2788 | 612 | </child> | ||
2789 | 613 | <child> | ||
2790 | 614 | <widget class="GtkRadioButton" id="xRecordButton"> | ||
2791 | 615 | <property name="label" translatable="yes">X Record - Preferred option when using X.org server v1.5 or older</property> | ||
2792 | 616 | <property name="visible">True</property> | ||
2793 | 617 | <property name="can_focus">True</property> | ||
2794 | 618 | <property name="receives_default">False</property> | ||
2795 | 619 | <property name="active">True</property> | ||
2796 | 620 | <property name="draw_indicator">True</property> | ||
2797 | 621 | <property name="group">xEvdevButton</property> | ||
2798 | 622 | </widget> | ||
2799 | 623 | <packing> | ||
2800 | 624 | <property name="position">1</property> | ||
2801 | 625 | </packing> | ||
2802 | 626 | </child> | ||
2803 | 627 | <child> | ||
2804 | 628 | <widget class="GtkRadioButton" id="xEvdevButton"> | ||
2805 | 629 | <property name="label" translatable="yes">X EvDev - Preferred option when using X.org server v1.6 or newer</property> | ||
2806 | 630 | <property name="visible">True</property> | ||
2807 | 631 | <property name="can_focus">True</property> | ||
2808 | 632 | <property name="receives_default">False</property> | ||
2809 | 633 | <property name="active">True</property> | ||
2810 | 634 | <property name="draw_indicator">True</property> | ||
2811 | 635 | </widget> | ||
2812 | 636 | <packing> | ||
2813 | 637 | <property name="position">2</property> | ||
2814 | 638 | </packing> | ||
2815 | 639 | </child> | ||
2816 | 640 | <child> | ||
2817 | 641 | <widget class="GtkRadioButton" id="atspiButton"> | ||
2818 | 642 | <property name="label" translatable="yes">AT-SPI - Fallback option for Gnome users when other methods fail</property> | ||
2819 | 643 | <property name="visible">True</property> | ||
2820 | 644 | <property name="can_focus">True</property> | ||
2821 | 645 | <property name="receives_default">False</property> | ||
2822 | 646 | <property name="active">True</property> | ||
2823 | 647 | <property name="draw_indicator">True</property> | ||
2824 | 648 | <property name="group">xEvdevButton</property> | ||
2825 | 649 | </widget> | ||
2826 | 650 | <packing> | ||
2827 | 651 | <property name="position">3</property> | ||
2828 | 652 | </packing> | ||
2829 | 653 | </child> | ||
2830 | 654 | </widget> | ||
2831 | 655 | </child> | ||
2832 | 656 | </widget> | ||
2833 | 657 | </child> | ||
2834 | 658 | <child> | ||
2835 | 659 | <widget class="GtkLabel" id="label13"> | ||
2836 | 660 | <property name="visible">True</property> | ||
2837 | 661 | <property name="label" translatable="yes"><b>Interface Type</b></property> | ||
2838 | 662 | <property name="use_markup">True</property> | ||
2839 | 663 | </widget> | ||
2840 | 664 | <packing> | ||
2841 | 665 | <property name="type">label_item</property> | ||
2842 | 666 | </packing> | ||
2843 | 667 | </child> | ||
2844 | 668 | </widget> | ||
2845 | 669 | <packing> | ||
2846 | 670 | <property name="position">0</property> | ||
2847 | 671 | </packing> | ||
2848 | 672 | </child> | ||
2849 | 673 | <child> | ||
2850 | 674 | <widget class="GtkLabel" id="label11"> | ||
2851 | 675 | <property name="xalign">0</property> | ||
2852 | 676 | <property name="label" translatable="yes">Enable this option only if you experience randomly garbled text in KDE4</property> | ||
2853 | 677 | </widget> | ||
2854 | 678 | <packing> | ||
2855 | 679 | <property name="position">1</property> | ||
2856 | 680 | </packing> | ||
2857 | 681 | </child> | ||
2858 | 682 | <child> | ||
2859 | 683 | <widget class="GtkCheckButton" id="checkBox"> | ||
2860 | 684 | <property name="label" translatable="yes">Enable QT4 workaround</property> | ||
2861 | 685 | <property name="can_focus">True</property> | ||
2862 | 686 | <property name="receives_default">False</property> | ||
2863 | 687 | <property name="draw_indicator">True</property> | ||
2864 | 688 | </widget> | ||
2865 | 689 | <packing> | ||
2866 | 690 | <property name="position">2</property> | ||
2867 | 691 | </packing> | ||
2868 | 692 | </child> | ||
2869 | 693 | </widget> | ||
2870 | 694 | </child> | ||
2871 | 695 | </widget> | ||
2872 | 696 | <packing> | ||
2873 | 697 | <property name="position">3</property> | ||
2874 | 698 | </packing> | ||
2875 | 699 | </child> | ||
2876 | 700 | <child> | ||
2877 | 701 | <widget class="GtkLabel" id="label3"> | ||
2878 | 702 | <property name="visible">True</property> | ||
2879 | 703 | <property name="label" translatable="yes">Interface</property> | ||
2880 | 704 | </widget> | ||
2881 | 705 | <packing> | ||
2882 | 706 | <property name="position">3</property> | ||
2883 | 707 | <property name="tab_fill">False</property> | ||
2884 | 708 | <property name="type">tab</property> | ||
2885 | 709 | </packing> | ||
2886 | 710 | </child> | ||
2887 | 711 | </widget> | ||
2888 | 712 | <packing> | ||
2889 | 713 | <property name="position">2</property> | ||
2890 | 714 | </packing> | ||
2891 | 715 | </child> | ||
2892 | 716 | <child internal-child="action_area"> | ||
2893 | 717 | <widget class="GtkHButtonBox" id="dialog-action_area1"> | ||
2894 | 718 | <property name="visible">True</property> | ||
2895 | 719 | <property name="layout_style">end</property> | ||
2896 | 720 | <child> | ||
2897 | 721 | <widget class="GtkButton" id="button1"> | ||
2898 | 722 | <property name="label">gtk-cancel</property> | ||
2899 | 723 | <property name="visible">True</property> | ||
2900 | 724 | <property name="can_focus">True</property> | ||
2901 | 725 | <property name="receives_default">True</property> | ||
2902 | 726 | <property name="use_stock">True</property> | ||
2903 | 727 | <signal name="clicked" handler="on_cancel"/> | ||
2904 | 728 | </widget> | ||
2905 | 729 | <packing> | ||
2906 | 730 | <property name="expand">False</property> | ||
2907 | 731 | <property name="fill">False</property> | ||
2908 | 732 | <property name="position">0</property> | ||
2909 | 733 | </packing> | ||
2910 | 734 | </child> | ||
2911 | 735 | <child> | ||
2912 | 736 | <widget class="GtkButton" id="button2"> | ||
2913 | 737 | <property name="label">gtk-ok</property> | ||
2914 | 738 | <property name="visible">True</property> | ||
2915 | 739 | <property name="can_focus">True</property> | ||
2916 | 740 | <property name="can_default">True</property> | ||
2917 | 741 | <property name="has_default">True</property> | ||
2918 | 742 | <property name="receives_default">True</property> | ||
2919 | 743 | <property name="use_stock">True</property> | ||
2920 | 744 | <signal name="clicked" handler="on_save"/> | ||
2921 | 745 | </widget> | ||
2922 | 746 | <packing> | ||
2923 | 747 | <property name="expand">False</property> | ||
2924 | 748 | <property name="fill">False</property> | ||
2925 | 749 | <property name="position">1</property> | ||
2926 | 750 | </packing> | ||
2927 | 751 | </child> | ||
2928 | 752 | </widget> | ||
2929 | 753 | <packing> | ||
2930 | 754 | <property name="expand">False</property> | ||
2931 | 755 | <property name="pack_type">end</property> | ||
2932 | 756 | <property name="position">0</property> | ||
2933 | 757 | </packing> | ||
2934 | 758 | </child> | ||
2935 | 759 | </widget> | ||
2936 | 760 | </child> | ||
2937 | 761 | </widget> | ||
2938 | 762 | </glade-interface> | ||
2939 | 0 | 763 | ||
2940 | === added file 'glade/settingswidget.glade' | |||
2941 | --- glade/settingswidget.glade 1970-01-01 00:00:00 +0000 | |||
2942 | +++ glade/settingswidget.glade 2010-03-26 15:01:22 +0000 | |||
2943 | @@ -0,0 +1,197 @@ | |||
2944 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2945 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
2946 | 3 | <!--Generated with glade3 3.4.5 on Tue Sep 1 17:30:47 2009 --> | ||
2947 | 4 | <glade-interface> | ||
2948 | 5 | <widget class="GtkWindow" id="window1"> | ||
2949 | 6 | <child> | ||
2950 | 7 | <widget class="GtkAlignment" id="settingswidget"> | ||
2951 | 8 | <property name="visible">True</property> | ||
2952 | 9 | <property name="top_padding">5</property> | ||
2953 | 10 | <property name="bottom_padding">5</property> | ||
2954 | 11 | <child> | ||
2955 | 12 | <widget class="GtkTable" id="table1"> | ||
2956 | 13 | <property name="visible">True</property> | ||
2957 | 14 | <property name="n_rows">3</property> | ||
2958 | 15 | <property name="n_columns">4</property> | ||
2959 | 16 | <property name="column_spacing">5</property> | ||
2960 | 17 | <property name="row_spacing">5</property> | ||
2961 | 18 | <child> | ||
2962 | 19 | <widget class="GtkLabel" id="label1"> | ||
2963 | 20 | <property name="visible">True</property> | ||
2964 | 21 | <property name="xalign">0</property> | ||
2965 | 22 | <property name="label" translatable="yes">Abbreviation:</property> | ||
2966 | 23 | </widget> | ||
2967 | 24 | <packing> | ||
2968 | 25 | <property name="x_options">GTK_FILL</property> | ||
2969 | 26 | </packing> | ||
2970 | 27 | </child> | ||
2971 | 28 | <child> | ||
2972 | 29 | <widget class="GtkLabel" id="label2"> | ||
2973 | 30 | <property name="visible">True</property> | ||
2974 | 31 | <property name="xalign">0</property> | ||
2975 | 32 | <property name="label" translatable="yes">Hotkey:</property> | ||
2976 | 33 | </widget> | ||
2977 | 34 | <packing> | ||
2978 | 35 | <property name="top_attach">1</property> | ||
2979 | 36 | <property name="bottom_attach">2</property> | ||
2980 | 37 | <property name="x_options">GTK_FILL</property> | ||
2981 | 38 | </packing> | ||
2982 | 39 | </child> | ||
2983 | 40 | <child> | ||
2984 | 41 | <widget class="GtkLabel" id="label3"> | ||
2985 | 42 | <property name="visible">True</property> | ||
2986 | 43 | <property name="xalign">0</property> | ||
2987 | 44 | <property name="label" translatable="yes">Window Filter:</property> | ||
2988 | 45 | </widget> | ||
2989 | 46 | <packing> | ||
2990 | 47 | <property name="top_attach">2</property> | ||
2991 | 48 | <property name="bottom_attach">3</property> | ||
2992 | 49 | <property name="x_options">GTK_FILL</property> | ||
2993 | 50 | </packing> | ||
2994 | 51 | </child> | ||
2995 | 52 | <child> | ||
2996 | 53 | <widget class="GtkLabel" id="abbrLabel"> | ||
2997 | 54 | <property name="visible">True</property> | ||
2998 | 55 | <property name="xalign">0</property> | ||
2999 | 56 | <property name="label" translatable="yes">$abbr</property> | ||
3000 | 57 | </widget> | ||
3001 | 58 | <packing> | ||
3002 | 59 | <property name="left_attach">1</property> | ||
3003 | 60 | <property name="right_attach">2</property> | ||
3004 | 61 | </packing> | ||
3005 | 62 | </child> | ||
3006 | 63 | <child> | ||
3007 | 64 | <widget class="GtkLabel" id="hotkeyLabel"> | ||
3008 | 65 | <property name="visible">True</property> | ||
3009 | 66 | <property name="xalign">0</property> | ||
3010 | 67 | <property name="label" translatable="yes">$hotkey</property> | ||
3011 | 68 | </widget> | ||
3012 | 69 | <packing> | ||
3013 | 70 | <property name="left_attach">1</property> | ||
3014 | 71 | <property name="right_attach">2</property> | ||
3015 | 72 | <property name="top_attach">1</property> | ||
3016 | 73 | <property name="bottom_attach">2</property> | ||
3017 | 74 | </packing> | ||
3018 | 75 | </child> | ||
3019 | 76 | <child> | ||
3020 | 77 | <widget class="GtkLabel" id="windowFilterLabel"> | ||
3021 | 78 | <property name="visible">True</property> | ||
3022 | 79 | <property name="xalign">0</property> | ||
3023 | 80 | <property name="label" translatable="yes">$filter</property> | ||
3024 | 81 | </widget> | ||
3025 | 82 | <packing> | ||
3026 | 83 | <property name="left_attach">1</property> | ||
3027 | 84 | <property name="right_attach">2</property> | ||
3028 | 85 | <property name="top_attach">2</property> | ||
3029 | 86 | <property name="bottom_attach">3</property> | ||
3030 | 87 | </packing> | ||
3031 | 88 | </child> | ||
3032 | 89 | <child> | ||
3033 | 90 | <widget class="GtkButton" id="setAbbrButton"> | ||
3034 | 91 | <property name="width_request">80</property> | ||
3035 | 92 | <property name="visible">True</property> | ||
3036 | 93 | <property name="can_focus">True</property> | ||
3037 | 94 | <property name="receives_default">True</property> | ||
3038 | 95 | <property name="label" translatable="yes">Set</property> | ||
3039 | 96 | <property name="response_id">0</property> | ||
3040 | 97 | <signal name="clicked" handler="on_setAbbrButton_clicked"/> | ||
3041 | 98 | </widget> | ||
3042 | 99 | <packing> | ||
3043 | 100 | <property name="left_attach">2</property> | ||
3044 | 101 | <property name="right_attach">3</property> | ||
3045 | 102 | <property name="x_options">GTK_FILL</property> | ||
3046 | 103 | </packing> | ||
3047 | 104 | </child> | ||
3048 | 105 | <child> | ||
3049 | 106 | <widget class="GtkButton" id="clearAbbrButton"> | ||
3050 | 107 | <property name="width_request">80</property> | ||
3051 | 108 | <property name="visible">True</property> | ||
3052 | 109 | <property name="can_focus">True</property> | ||
3053 | 110 | <property name="receives_default">True</property> | ||
3054 | 111 | <property name="label" translatable="yes">gtk-clear</property> | ||
3055 | 112 | <property name="use_stock">True</property> | ||
3056 | 113 | <property name="response_id">0</property> | ||
3057 | 114 | <signal name="clicked" handler="on_clearAbbrButton_clicked"/> | ||
3058 | 115 | </widget> | ||
3059 | 116 | <packing> | ||
3060 | 117 | <property name="left_attach">3</property> | ||
3061 | 118 | <property name="right_attach">4</property> | ||
3062 | 119 | <property name="x_options">GTK_FILL</property> | ||
3063 | 120 | </packing> | ||
3064 | 121 | </child> | ||
3065 | 122 | <child> | ||
3066 | 123 | <widget class="GtkButton" id="setHotkeyButton"> | ||
3067 | 124 | <property name="visible">True</property> | ||
3068 | 125 | <property name="can_focus">True</property> | ||
3069 | 126 | <property name="receives_default">True</property> | ||
3070 | 127 | <property name="label" translatable="yes">Set</property> | ||
3071 | 128 | <property name="response_id">0</property> | ||
3072 | 129 | <signal name="clicked" handler="on_setHotkeyButton_clicked"/> | ||
3073 | 130 | </widget> | ||
3074 | 131 | <packing> | ||
3075 | 132 | <property name="left_attach">2</property> | ||
3076 | 133 | <property name="right_attach">3</property> | ||
3077 | 134 | <property name="top_attach">1</property> | ||
3078 | 135 | <property name="bottom_attach">2</property> | ||
3079 | 136 | <property name="x_options">GTK_FILL</property> | ||
3080 | 137 | </packing> | ||
3081 | 138 | </child> | ||
3082 | 139 | <child> | ||
3083 | 140 | <widget class="GtkButton" id="setFilterButton"> | ||
3084 | 141 | <property name="visible">True</property> | ||
3085 | 142 | <property name="can_focus">True</property> | ||
3086 | 143 | <property name="receives_default">True</property> | ||
3087 | 144 | <property name="label" translatable="yes">Set</property> | ||
3088 | 145 | <property name="response_id">0</property> | ||
3089 | 146 | <signal name="clicked" handler="on_setFilterButton_clicked"/> | ||
3090 | 147 | </widget> | ||
3091 | 148 | <packing> | ||
3092 | 149 | <property name="left_attach">2</property> | ||
3093 | 150 | <property name="right_attach">3</property> | ||
3094 | 151 | <property name="top_attach">2</property> | ||
3095 | 152 | <property name="bottom_attach">3</property> | ||
3096 | 153 | <property name="x_options">GTK_FILL</property> | ||
3097 | 154 | </packing> | ||
3098 | 155 | </child> | ||
3099 | 156 | <child> | ||
3100 | 157 | <widget class="GtkButton" id="clearHotkeyButton"> | ||
3101 | 158 | <property name="visible">True</property> | ||
3102 | 159 | <property name="can_focus">True</property> | ||
3103 | 160 | <property name="receives_default">True</property> | ||
3104 | 161 | <property name="label" translatable="yes">gtk-clear</property> | ||
3105 | 162 | <property name="use_stock">True</property> | ||
3106 | 163 | <property name="response_id">0</property> | ||
3107 | 164 | <signal name="clicked" handler="on_clearHotkeyButton_clicked"/> | ||
3108 | 165 | </widget> | ||
3109 | 166 | <packing> | ||
3110 | 167 | <property name="left_attach">3</property> | ||
3111 | 168 | <property name="right_attach">4</property> | ||
3112 | 169 | <property name="top_attach">1</property> | ||
3113 | 170 | <property name="bottom_attach">2</property> | ||
3114 | 171 | <property name="x_options">GTK_FILL</property> | ||
3115 | 172 | </packing> | ||
3116 | 173 | </child> | ||
3117 | 174 | <child> | ||
3118 | 175 | <widget class="GtkButton" id="clearFilterButton"> | ||
3119 | 176 | <property name="visible">True</property> | ||
3120 | 177 | <property name="can_focus">True</property> | ||
3121 | 178 | <property name="receives_default">True</property> | ||
3122 | 179 | <property name="label" translatable="yes">gtk-clear</property> | ||
3123 | 180 | <property name="use_stock">True</property> | ||
3124 | 181 | <property name="response_id">0</property> | ||
3125 | 182 | <signal name="clicked" handler="on_clearFilterButton_clicked"/> | ||
3126 | 183 | </widget> | ||
3127 | 184 | <packing> | ||
3128 | 185 | <property name="left_attach">3</property> | ||
3129 | 186 | <property name="right_attach">4</property> | ||
3130 | 187 | <property name="top_attach">2</property> | ||
3131 | 188 | <property name="bottom_attach">3</property> | ||
3132 | 189 | <property name="x_options">GTK_FILL</property> | ||
3133 | 190 | </packing> | ||
3134 | 191 | </child> | ||
3135 | 192 | </widget> | ||
3136 | 193 | </child> | ||
3137 | 194 | </widget> | ||
3138 | 195 | </child> | ||
3139 | 196 | </widget> | ||
3140 | 197 | </glade-interface> | ||
3141 | 0 | 198 | ||
3142 | === added file 'glade/windowfiltersettings.glade' | |||
3143 | --- glade/windowfiltersettings.glade 1970-01-01 00:00:00 +0000 | |||
3144 | +++ glade/windowfiltersettings.glade 2010-03-26 15:01:22 +0000 | |||
3145 | @@ -0,0 +1,87 @@ | |||
3146 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
3147 | 2 | <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> | ||
3148 | 3 | <!--Generated with glade3 3.4.5 on Fri Oct 2 11:17:13 2009 --> | ||
3149 | 4 | <glade-interface> | ||
3150 | 5 | <widget class="GtkDialog" id="windowfiltersettings"> | ||
3151 | 6 | <property name="border_width">5</property> | ||
3152 | 7 | <property name="title" translatable="yes">Set Window Filter</property> | ||
3153 | 8 | <property name="resizable">False</property> | ||
3154 | 9 | <property name="modal">True</property> | ||
3155 | 10 | <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> | ||
3156 | 11 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | ||
3157 | 12 | <child internal-child="vbox"> | ||
3158 | 13 | <widget class="GtkVBox" id="dialog-vbox2"> | ||
3159 | 14 | <property name="visible">True</property> | ||
3160 | 15 | <property name="spacing">5</property> | ||
3161 | 16 | <child> | ||
3162 | 17 | <widget class="GtkVBox" id="vbox2"> | ||
3163 | 18 | <property name="visible">True</property> | ||
3164 | 19 | <property name="spacing">5</property> | ||
3165 | 20 | <child> | ||
3166 | 21 | <widget class="GtkLabel" id="label1"> | ||
3167 | 22 | <property name="visible">True</property> | ||
3168 | 23 | <property name="xalign">0</property> | ||
3169 | 24 | <property name="label" translatable="yes">Only trigger in windows with title matching:</property> | ||
3170 | 25 | </widget> | ||
3171 | 26 | </child> | ||
3172 | 27 | <child> | ||
3173 | 28 | <widget class="GtkEntry" id="triggerRegexEntry"> | ||
3174 | 29 | <property name="visible">True</property> | ||
3175 | 30 | <property name="can_focus">True</property> | ||
3176 | 31 | <property name="is_focus">True</property> | ||
3177 | 32 | <property name="tooltip" translatable="yes">Enter a regular expression that matches the title of windows in which you want this item to trigger.</property> | ||
3178 | 33 | <property name="activates_default">True</property> | ||
3179 | 34 | <property name="truncate_multiline">True</property> | ||
3180 | 35 | </widget> | ||
3181 | 36 | <packing> | ||
3182 | 37 | <property name="position">1</property> | ||
3183 | 38 | </packing> | ||
3184 | 39 | </child> | ||
3185 | 40 | </widget> | ||
3186 | 41 | <packing> | ||
3187 | 42 | <property name="fill">False</property> | ||
3188 | 43 | <property name="padding">5</property> | ||
3189 | 44 | <property name="position">2</property> | ||
3190 | 45 | </packing> | ||
3191 | 46 | </child> | ||
3192 | 47 | <child internal-child="action_area"> | ||
3193 | 48 | <widget class="GtkHButtonBox" id="dialog-action_area2"> | ||
3194 | 49 | <property name="visible">True</property> | ||
3195 | 50 | <property name="layout_style">GTK_BUTTONBOX_END</property> | ||
3196 | 51 | <child> | ||
3197 | 52 | <widget class="GtkButton" id="cancelButton"> | ||
3198 | 53 | <property name="visible">True</property> | ||
3199 | 54 | <property name="can_focus">True</property> | ||
3200 | 55 | <property name="receives_default">True</property> | ||
3201 | 56 | <property name="label" translatable="yes">gtk-cancel</property> | ||
3202 | 57 | <property name="use_stock">True</property> | ||
3203 | 58 | <property name="response_id">0</property> | ||
3204 | 59 | <signal name="clicked" handler="on_cancel"/> | ||
3205 | 60 | </widget> | ||
3206 | 61 | </child> | ||
3207 | 62 | <child> | ||
3208 | 63 | <widget class="GtkButton" id="okButton"> | ||
3209 | 64 | <property name="visible">True</property> | ||
3210 | 65 | <property name="can_focus">True</property> | ||
3211 | 66 | <property name="can_default">True</property> | ||
3212 | 67 | <property name="has_default">True</property> | ||
3213 | 68 | <property name="receives_default">True</property> | ||
3214 | 69 | <property name="label" translatable="yes">gtk-ok</property> | ||
3215 | 70 | <property name="use_stock">True</property> | ||
3216 | 71 | <property name="response_id">0</property> | ||
3217 | 72 | <signal name="clicked" handler="on_ok"/> | ||
3218 | 73 | </widget> | ||
3219 | 74 | <packing> | ||
3220 | 75 | <property name="position">1</property> | ||
3221 | 76 | </packing> | ||
3222 | 77 | </child> | ||
3223 | 78 | </widget> | ||
3224 | 79 | <packing> | ||
3225 | 80 | <property name="expand">False</property> | ||
3226 | 81 | <property name="pack_type">GTK_PACK_END</property> | ||
3227 | 82 | </packing> | ||
3228 | 83 | </child> | ||
3229 | 84 | </widget> | ||
3230 | 85 | </child> | ||
3231 | 86 | </widget> | ||
3232 | 87 | </glade-interface> | ||
3233 | 0 | 88 | ||
3234 | === modified file 'setup.py' | |||
3235 | --- setup.py 2010-01-08 08:52:58 +0000 | |||
3236 | +++ setup.py 2010-03-26 15:01:22 +0000 | |||
3237 | @@ -20,7 +20,7 @@ | |||
3238 | 20 | 20 | ||
3239 | 21 | setup( | 21 | setup( |
3240 | 22 | name="autokey", | 22 | name="autokey", |
3242 | 23 | version="0.61.2", | 23 | version="0.61.5", |
3243 | 24 | author="Chris Dekter", | 24 | author="Chris Dekter", |
3244 | 25 | author_email="cdekter@gmail.com", | 25 | author_email="cdekter@gmail.com", |
3245 | 26 | url="http://autokey.googlecode.com/", | 26 | url="http://autokey.googlecode.com/", |
3246 | @@ -33,10 +33,12 @@ | |||
3247 | 33 | #py_modules=["autokey", "configurationmanager", "expansionservice", "interface", | 33 | #py_modules=["autokey", "configurationmanager", "expansionservice", "interface", |
3248 | 34 | # "iomediator", "phrase", "phrasemenu", "ui"], | 34 | # "iomediator", "phrase", "phrasemenu", "ui"], |
3249 | 35 | package_dir={"autokey": "src/lib"}, | 35 | package_dir={"autokey": "src/lib"}, |
3255 | 36 | packages=["autokey", "autokey.ui"], | 36 | packages=["autokey", "autokey.gtkui", "autokey.qtui"], |
3256 | 37 | package_data={"autokey.ui" : ["data/gui.xml", "data/api.txt"]}, | 37 | package_data={"autokey.qtui" : ["data/*"], |
3257 | 38 | data_files=[("/usr/share/pixmaps", ["config/akicon.png"]), | 38 | "autokey.gtkui" : ["data/*"]}, |
3258 | 39 | ("/usr/share/applications", ["config/autokey.desktop"])], | 39 | data_files=[("/usr/share/pixmaps", ["config/akicon.png", "config/akicon-status.png"]), |
3259 | 40 | scripts=['autokey'] | 40 | ("/usr/share/applications", ["config/autokey-qt.desktop", "config/autokey-gtk.desktop"]), |
3260 | 41 | ('share/man/man1/', ['doc/man/autokey-qt.1', 'doc/man/autokey-gtk.1'])], | ||
3261 | 42 | scripts=['autokey-qt', 'autokey-gtk'] | ||
3262 | 41 | #packages=["plugin"] | 43 | #packages=["plugin"] |
3263 | 42 | ) | 44 | ) |
3264 | 43 | 45 | ||
3265 | === removed file 'src/lib/autokey.py' | |||
3266 | --- src/lib/autokey.py 2010-01-08 08:52:58 +0000 | |||
3267 | +++ src/lib/autokey.py 1970-01-01 00:00:00 +0000 | |||
3268 | @@ -1,280 +0,0 @@ | |||
3269 | 1 | #!/usr/bin/env python | ||
3270 | 2 | # -*- coding: utf-8 -*- | ||
3271 | 3 | |||
3272 | 4 | # Copyright (C) 2008 Chris Dekter | ||
3273 | 5 | |||
3274 | 6 | # This program is free software; you can redistribute it and/or modify | ||
3275 | 7 | # it under the terms of the GNU General Public License as published by | ||
3276 | 8 | # the Free Software Foundation; either version 2 of the License, or | ||
3277 | 9 | # (at your option) any later version. | ||
3278 | 10 | # | ||
3279 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3280 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3281 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3282 | 14 | # General Public License for more details. | ||
3283 | 15 | # | ||
3284 | 16 | # You should have received a copy of the GNU General Public License | ||
3285 | 17 | # along with this program; if not, write to the Free Software | ||
3286 | 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
3287 | 19 | |||
3288 | 20 | |||
3289 | 21 | import sys, traceback, os.path, signal, logging, logging.handlers, subprocess, Queue | ||
3290 | 22 | from PyKDE4.kdecore import KCmdLineArgs, KCmdLineOptions, KAboutData, ki18n, i18n | ||
3291 | 23 | from PyKDE4.kdeui import KMessageBox, KApplication | ||
3292 | 24 | from PyQt4.QtCore import SIGNAL, Qt, QObject, QEvent | ||
3293 | 25 | from PyQt4.QtGui import QCursor | ||
3294 | 26 | |||
3295 | 27 | import service, ui.notifier, ui.popupmenu | ||
3296 | 28 | from configmanager import * | ||
3297 | 29 | |||
3298 | 30 | CONFIG_DIR = os.path.expanduser("~/.config/autokey") | ||
3299 | 31 | LOCK_FILE = CONFIG_DIR + "/autokey.pid" | ||
3300 | 32 | LOG_FILE = CONFIG_DIR + "/autokey.log" | ||
3301 | 33 | MAX_LOG_SIZE = 5 * 1024 * 1024 # 5 megabytes | ||
3302 | 34 | MAX_LOG_COUNT = 3 | ||
3303 | 35 | LOG_FORMAT = "%(levelname)s - %(name)s - %(message)s" | ||
3304 | 36 | |||
3305 | 37 | APP_NAME = "AutoKey" | ||
3306 | 38 | CATALOG = "" | ||
3307 | 39 | PROGRAM_NAME = ki18n("AutoKey") | ||
3308 | 40 | VERSION = "0.61.2" | ||
3309 | 41 | DESCRIPTION = ki18n("Desktop automation utility") | ||
3310 | 42 | LICENSE = KAboutData.License_GPL_V3 | ||
3311 | 43 | COPYRIGHT = ki18n("(c) 2009 Chris Dekter") | ||
3312 | 44 | TEXT = ki18n("") | ||
3313 | 45 | HOMEPAGE = "http://autokey.sourceforge.net/" | ||
3314 | 46 | BUG_EMAIL = "cdekter@gmail.com" | ||
3315 | 47 | |||
3316 | 48 | |||
3317 | 49 | |||
3318 | 50 | class Application: | ||
3319 | 51 | """ | ||
3320 | 52 | Main application class; starting and stopping of the application is controlled | ||
3321 | 53 | from here, together with some interactions from the tray icon. | ||
3322 | 54 | """ | ||
3323 | 55 | |||
3324 | 56 | def __init__(self): | ||
3325 | 57 | |||
3326 | 58 | aboutData = KAboutData(APP_NAME, CATALOG, PROGRAM_NAME, VERSION, DESCRIPTION, | ||
3327 | 59 | LICENSE, COPYRIGHT, TEXT, HOMEPAGE, BUG_EMAIL) | ||
3328 | 60 | |||
3329 | 61 | aboutData.addAuthor(ki18n("Chris Dekter"), ki18n("Developer"), "cdekter@gmail.com", "") | ||
3330 | 62 | aboutData.addAuthor(ki18n("Sam Peterson"), ki18n("Original developer"), "peabodyenator@gmail.com", "") | ||
3331 | 63 | aboutData.setProgramIconName(ui.notifier.ICON_FILE) | ||
3332 | 64 | |||
3333 | 65 | KCmdLineArgs.init(sys.argv, aboutData) | ||
3334 | 66 | options = KCmdLineOptions() | ||
3335 | 67 | options.add("l").add("verbose", ki18n("Enable verbose logging")) | ||
3336 | 68 | options.add("c").add("configure", ki18n("Show the configuration window on startup")) | ||
3337 | 69 | KCmdLineArgs.addCmdLineOptions(options) | ||
3338 | 70 | args = KCmdLineArgs.parsedArgs() | ||
3339 | 71 | |||
3340 | 72 | |||
3341 | 73 | self.app = KApplication() | ||
3342 | 74 | |||
3343 | 75 | try: | ||
3344 | 76 | # Create configuration directory | ||
3345 | 77 | if not os.path.exists(CONFIG_DIR): | ||
3346 | 78 | os.makedirs(CONFIG_DIR) | ||
3347 | 79 | # Initialise logger | ||
3348 | 80 | rootLogger = logging.getLogger() | ||
3349 | 81 | |||
3350 | 82 | if args.isSet("verbose"): | ||
3351 | 83 | rootLogger.setLevel(logging.DEBUG) | ||
3352 | 84 | handler = logging.StreamHandler(sys.stdout) | ||
3353 | 85 | else: | ||
3354 | 86 | rootLogger.setLevel(logging.INFO) | ||
3355 | 87 | handler = logging.handlers.RotatingFileHandler(LOG_FILE, | ||
3356 | 88 | maxBytes=MAX_LOG_SIZE, backupCount=MAX_LOG_COUNT) | ||
3357 | 89 | |||
3358 | 90 | handler.setFormatter(logging.Formatter(LOG_FORMAT)) | ||
3359 | 91 | rootLogger.addHandler(handler) | ||
3360 | 92 | |||
3361 | 93 | |||
3362 | 94 | if self.__verifyNotRunning(): | ||
3363 | 95 | self.__createLockFile() | ||
3364 | 96 | |||
3365 | 97 | self.initialise(args.isSet("configure")) | ||
3366 | 98 | |||
3367 | 99 | except Exception, e: | ||
3368 | 100 | self.show_error_dialog(i18n("Fatal error starting AutoKey.\n") + str(e)) | ||
3369 | 101 | logging.exception("Fatal error starting AutoKey: " + str(e)) | ||
3370 | 102 | sys.exit(1) | ||
3371 | 103 | |||
3372 | 104 | |||
3373 | 105 | def __createLockFile(self): | ||
3374 | 106 | f = open(LOCK_FILE, 'w') | ||
3375 | 107 | f.write(str(os.getpid())) | ||
3376 | 108 | f.close() | ||
3377 | 109 | |||
3378 | 110 | def __verifyNotRunning(self): | ||
3379 | 111 | if os.path.exists(LOCK_FILE): | ||
3380 | 112 | f = open(LOCK_FILE, 'r') | ||
3381 | 113 | pid = f.read() | ||
3382 | 114 | f.close() | ||
3383 | 115 | |||
3384 | 116 | # Check that the found PID is running and is autokey | ||
3385 | 117 | p = subprocess.Popen(["ps", "-p", pid, "-o", "command"], stdout=subprocess.PIPE) | ||
3386 | 118 | p.wait() | ||
3387 | 119 | output = p.stdout.readlines() | ||
3388 | 120 | if len(output) > 1: | ||
3389 | 121 | # process exists | ||
3390 | 122 | if "autokey" in output[1]: | ||
3391 | 123 | logging.error("AutoKey is already running - exiting") | ||
3392 | 124 | self.show_error_dialog(i18n("AutoKey is already running as pid: ") + pid) | ||
3393 | 125 | sys.exit(1) | ||
3394 | 126 | |||
3395 | 127 | return True | ||
3396 | 128 | |||
3397 | 129 | def main(self): | ||
3398 | 130 | self.app.exec_() | ||
3399 | 131 | |||
3400 | 132 | def initialise(self, configure): | ||
3401 | 133 | logging.info("Initialising application") | ||
3402 | 134 | self.configManager = get_config_manager(self) | ||
3403 | 135 | self.service = service.Service(self) | ||
3404 | 136 | self.serviceDisabled = False | ||
3405 | 137 | |||
3406 | 138 | # Initialise user code dir | ||
3407 | 139 | if self.configManager.userCodeDir is not None: | ||
3408 | 140 | sys.path.append(self.configManager.userCodeDir) | ||
3409 | 141 | |||
3410 | 142 | try: | ||
3411 | 143 | self.service.start() | ||
3412 | 144 | except Exception, e: | ||
3413 | 145 | logging.exception("Error starting interface: " + str(e)) | ||
3414 | 146 | self.serviceDisabled = True | ||
3415 | 147 | self.show_error_dialog(i18n("Error starting interface. Keyboard monitoring will be disabled.\n" + | ||
3416 | 148 | "Check your system/configuration."), str(e)) | ||
3417 | 149 | |||
3418 | 150 | self.notifier = ui.notifier.Notifier(self) | ||
3419 | 151 | self.configWindow = None | ||
3420 | 152 | |||
3421 | 153 | if ConfigManager.SETTINGS[IS_FIRST_RUN] or configure: | ||
3422 | 154 | ConfigManager.SETTINGS[IS_FIRST_RUN] = False | ||
3423 | 155 | self.show_configure() | ||
3424 | 156 | |||
3425 | 157 | self.handler = CallbackEventHandler() | ||
3426 | 158 | |||
3427 | 159 | def init_global_hotkeys(self, configManager): | ||
3428 | 160 | logging.info("Initialise global hotkeys") | ||
3429 | 161 | configManager.toggleServiceHotkey.set_closure(self.toggle_service) | ||
3430 | 162 | configManager.configHotkey.set_closure(self.show_configure_async) | ||
3431 | 163 | |||
3432 | 164 | def config_altered(self): | ||
3433 | 165 | self.configManager.config_altered() | ||
3434 | 166 | self.notifier.build_menu() | ||
3435 | 167 | |||
3436 | 168 | def unpause_service(self): | ||
3437 | 169 | """ | ||
3438 | 170 | Unpause the expansion service (start responding to keyboard and mouse events). | ||
3439 | 171 | """ | ||
3440 | 172 | self.service.unpause() | ||
3441 | 173 | self.notifier.update_tool_tip() | ||
3442 | 174 | |||
3443 | 175 | def pause_service(self): | ||
3444 | 176 | """ | ||
3445 | 177 | Pause the expansion service (stop responding to keyboard and mouse events). | ||
3446 | 178 | """ | ||
3447 | 179 | self.service.pause() | ||
3448 | 180 | self.notifier.update_tool_tip() | ||
3449 | 181 | |||
3450 | 182 | def toggle_service(self): | ||
3451 | 183 | """ | ||
3452 | 184 | Convenience method for toggling the expansion service on or off. | ||
3453 | 185 | """ | ||
3454 | 186 | if self.service.is_running(): | ||
3455 | 187 | self.pause_service() | ||
3456 | 188 | else: | ||
3457 | 189 | self.unpause_service() | ||
3458 | 190 | |||
3459 | 191 | def shutdown(self): | ||
3460 | 192 | """ | ||
3461 | 193 | Shut down the entire application. | ||
3462 | 194 | """ | ||
3463 | 195 | logging.info("Shutting down") | ||
3464 | 196 | self.app.closeAllWindows() | ||
3465 | 197 | self.service.shutdown() | ||
3466 | 198 | self.app.quit() | ||
3467 | 199 | os.remove(LOCK_FILE) | ||
3468 | 200 | |||
3469 | 201 | def show_notify(self, message, isError=False, details=''): | ||
3470 | 202 | """ | ||
3471 | 203 | Show a notification popup. | ||
3472 | 204 | |||
3473 | 205 | @param message: Message to show in the popup | ||
3474 | 206 | @param isError: Whether the message is an error (shows with an error icon) | ||
3475 | 207 | @param details: Error details, which the user can view in a dialog by clicking | ||
3476 | 208 | the "View Details" button. | ||
3477 | 209 | """ | ||
3478 | 210 | self.notifier.show_notify(message, isError, details) | ||
3479 | 211 | |||
3480 | 212 | def show_configure(self): | ||
3481 | 213 | """ | ||
3482 | 214 | Show the configuration window, or deiconify (un-minimise) it if it's already open. | ||
3483 | 215 | """ | ||
3484 | 216 | logging.info("Displaying configuration window") | ||
3485 | 217 | try: | ||
3486 | 218 | self.configWindow.showNormal() | ||
3487 | 219 | self.configWindow.activateWindow() | ||
3488 | 220 | except: | ||
3489 | 221 | self.configWindow = ui.configwindow.ConfigWindow(self) | ||
3490 | 222 | self.configWindow.show() | ||
3491 | 223 | |||
3492 | 224 | def show_configure_async(self): | ||
3493 | 225 | self.exec_in_main(self.show_configure) | ||
3494 | 226 | |||
3495 | 227 | def show_error_dialog(self, message, details=None): | ||
3496 | 228 | """ | ||
3497 | 229 | Convenience method for showing an error dialog. | ||
3498 | 230 | """ | ||
3499 | 231 | if details is None: | ||
3500 | 232 | KMessageBox.error(None, message) | ||
3501 | 233 | else: | ||
3502 | 234 | KMessageBox.detailedError(None, message, details) | ||
3503 | 235 | |||
3504 | 236 | def show_script_error(self): | ||
3505 | 237 | """ | ||
3506 | 238 | Show the last script error (if any) | ||
3507 | 239 | """ | ||
3508 | 240 | if self.service.scriptRunner.error != '': | ||
3509 | 241 | KMessageBox.information(None, self.service.scriptRunner.error, i18n("View Script Error Details")) | ||
3510 | 242 | self.service.scriptRunner.error = '' | ||
3511 | 243 | else: | ||
3512 | 244 | KMessageBox.information(None, i18n("No error information available"), i18n("View Script Error Details")) | ||
3513 | 245 | |||
3514 | 246 | def show_popup_menu(self, folders=[], items=[], onDesktop=True, title=None): | ||
3515 | 247 | self.exec_in_main(self.__createMenu, folders, items, onDesktop, title) | ||
3516 | 248 | |||
3517 | 249 | def hide_menu(self): | ||
3518 | 250 | self.exec_in_main(self.menu.hide) | ||
3519 | 251 | |||
3520 | 252 | def __createMenu(self, folders, items, onDesktop, title): | ||
3521 | 253 | self.menu = ui.popupmenu.PopupMenu(self.service, folders, items, onDesktop, title) | ||
3522 | 254 | self.menu.popup(QCursor.pos()) | ||
3523 | 255 | |||
3524 | 256 | def exec_in_main(self, callback, *args): | ||
3525 | 257 | self.handler.postEventWithCallback(callback, *args) | ||
3526 | 258 | |||
3527 | 259 | |||
3528 | 260 | class CallbackEventHandler(QObject): | ||
3529 | 261 | |||
3530 | 262 | def __init__(self): | ||
3531 | 263 | QObject.__init__(self) | ||
3532 | 264 | self.queue = Queue.Queue() | ||
3533 | 265 | |||
3534 | 266 | def customEvent(self, event): | ||
3535 | 267 | while True: | ||
3536 | 268 | try: | ||
3537 | 269 | callback, args = self.queue.get_nowait() | ||
3538 | 270 | except Queue.Empty: | ||
3539 | 271 | break | ||
3540 | 272 | try: | ||
3541 | 273 | callback(*args) | ||
3542 | 274 | except Exception: | ||
3543 | 275 | logging.warn("callback event failed: %r %r", callback, args, exc_info=True) | ||
3544 | 276 | |||
3545 | 277 | def postEventWithCallback(self, callback, *args): | ||
3546 | 278 | self.queue.put((callback, args)) | ||
3547 | 279 | app = KApplication.kApplication() | ||
3548 | 280 | app.postEvent(self, QEvent(QEvent.User)) | ||
3549 | 281 | 0 | ||
3550 | === added file 'src/lib/common.py' | |||
3551 | --- src/lib/common.py 1970-01-01 00:00:00 +0000 | |||
3552 | +++ src/lib/common.py 2010-03-26 15:01:22 +0000 | |||
3553 | @@ -0,0 +1,48 @@ | |||
3554 | 1 | #!/usr/bin/env python | ||
3555 | 2 | # -*- coding: utf-8 -*- | ||
3556 | 3 | |||
3557 | 4 | # Copyright (C) 2008 Chris Dekter | ||
3558 | 5 | |||
3559 | 6 | # This program is free software; you can redistribute it and/or modify | ||
3560 | 7 | # it under the terms of the GNU General Public License as published by | ||
3561 | 8 | # the Free Software Foundation; either version 2 of the License, or | ||
3562 | 9 | # (at your option) any later version. | ||
3563 | 10 | # | ||
3564 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3565 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3566 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3567 | 14 | # General Public License for more details. | ||
3568 | 15 | # | ||
3569 | 16 | # You should have received a copy of the GNU General Public License | ||
3570 | 17 | # along with this program; if not, write to the Free Software | ||
3571 | 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
3572 | 19 | |||
3573 | 20 | import os.path | ||
3574 | 21 | CONFIG_DIR = os.path.expanduser("~/.config/autokey") | ||
3575 | 22 | LOCK_FILE = CONFIG_DIR + "/autokey.pid" | ||
3576 | 23 | LOG_FILE = CONFIG_DIR + "/autokey.log" | ||
3577 | 24 | MAX_LOG_SIZE = 5 * 1024 * 1024 # 5 megabytes | ||
3578 | 25 | MAX_LOG_COUNT = 3 | ||
3579 | 26 | LOG_FORMAT = "%(levelname)s - %(name)s - %(message)s" | ||
3580 | 27 | |||
3581 | 28 | APP_NAME = "AutoKey" | ||
3582 | 29 | CATALOG = "" | ||
3583 | 30 | VERSION = "0.61.5" | ||
3584 | 31 | HOMEPAGE = "http://autokey.sourceforge.net/" | ||
3585 | 32 | BUG_EMAIL = "cdekter@gmail.com" | ||
3586 | 33 | |||
3587 | 34 | FAQ_URL = "http://code.google.com/p/autokey/wiki/FAQ" | ||
3588 | 35 | HELP_URL = "http://code.google.com/p/autokey/w/list" | ||
3589 | 36 | DONATE_URL = "https://sourceforge.net/donate/index.php?group_id=216191" | ||
3590 | 37 | |||
3591 | 38 | CONFIG_WINDOW_TITLE = "Configuration" | ||
3592 | 39 | |||
3593 | 40 | ICON_FILE = "/usr/share/pixmaps/akicon.png" | ||
3594 | 41 | |||
3595 | 42 | USING_QT = True | ||
3596 | 43 | |||
3597 | 44 | # Misc | ||
3598 | 45 | DOMAIN_SOCKET_PATH = "/var/run/autokey-daemon" | ||
3599 | 46 | PACKET_SIZE = 32 | ||
3600 | 47 | |||
3601 | 48 | |||
3602 | 0 | 49 | ||
3603 | === modified file 'src/lib/configmanager.py' | |||
3604 | --- src/lib/configmanager.py 2010-01-08 08:52:58 +0000 | |||
3605 | +++ src/lib/configmanager.py 2010-03-26 15:01:22 +0000 | |||
3606 | @@ -19,7 +19,7 @@ | |||
3607 | 19 | import os, os.path, shutil, logging, pickle | 19 | import os, os.path, shutil, logging, pickle |
3608 | 20 | import iomediator, interface | 20 | import iomediator, interface |
3609 | 21 | 21 | ||
3611 | 22 | APP_VERSION = "0.61.2" | 22 | APP_VERSION = "0.61.5" |
3612 | 23 | 23 | ||
3613 | 24 | _logger = logging.getLogger("config-manager") | 24 | _logger = logging.getLogger("config-manager") |
3614 | 25 | 25 | ||
3615 | 26 | 26 | ||
3616 | === modified file 'src/lib/daemon.py' | |||
3617 | --- src/lib/daemon.py 2009-12-16 08:46:43 +0000 | |||
3618 | +++ src/lib/daemon.py 2010-03-26 15:01:22 +0000 | |||
3619 | @@ -62,18 +62,27 @@ | |||
3620 | 62 | 62 | ||
3621 | 63 | def delpid(self): | 63 | def delpid(self): |
3622 | 64 | os.remove(self.pidfile) | 64 | os.remove(self.pidfile) |
3624 | 65 | 65 | def checkpid(self): | |
3625 | 66 | """Check for a pidfile to see if the daemon already runs | ||
3626 | 67 | |||
3627 | 68 | @references self.pidfile | ||
3628 | 69 | @returns pid, an int representing the running daemon or None""" | ||
3629 | 70 | try: | ||
3630 | 71 | pf = file(self.pidfile,'r') | ||
3631 | 72 | pid = int(pf.read().strip()) | ||
3632 | 73 | pf.close() | ||
3633 | 74 | except IOError: | ||
3634 | 75 | pid = None | ||
3635 | 76 | except ValueError: | ||
3636 | 77 | # the pidfile doesn't match our syntax, ignore it | ||
3637 | 78 | pid = None | ||
3638 | 79 | return pid | ||
3639 | 80 | |||
3640 | 66 | def start(self): | 81 | def start(self): |
3641 | 67 | """ | 82 | """ |
3642 | 68 | Start the daemon | 83 | Start the daemon |
3643 | 69 | """ | 84 | """ |
3651 | 70 | # Check for a pidfile to see if the daemon already runs | 85 | pid = self.checkpid() |
3645 | 71 | try: | ||
3646 | 72 | pf = file(self.pidfile,'r') | ||
3647 | 73 | pid = int(pf.read().strip()) | ||
3648 | 74 | pf.close() | ||
3649 | 75 | except IOError: | ||
3650 | 76 | pid = None | ||
3652 | 77 | 86 | ||
3653 | 78 | if pid: | 87 | if pid: |
3654 | 79 | message = "pidfile %s already exist. Daemon already running?\n" | 88 | message = "pidfile %s already exist. Daemon already running?\n" |
3655 | @@ -89,13 +98,8 @@ | |||
3656 | 89 | Stop the daemon | 98 | Stop the daemon |
3657 | 90 | """ | 99 | """ |
3658 | 91 | # Get the pid from the pidfile | 100 | # Get the pid from the pidfile |
3666 | 92 | try: | 101 | pid = self.checkpid() |
3667 | 93 | pf = file(self.pidfile,'r') | 102 | |
3661 | 94 | pid = int(pf.read().strip()) | ||
3662 | 95 | pf.close() | ||
3663 | 96 | except IOError: | ||
3664 | 97 | pid = None | ||
3665 | 98 | |||
3668 | 99 | if not pid: | 103 | if not pid: |
3669 | 100 | message = "pidfile %s does not exist. Daemon not running?\n" | 104 | message = "pidfile %s does not exist. Daemon not running?\n" |
3670 | 101 | sys.stderr.write(message % self.pidfile) | 105 | sys.stderr.write(message % self.pidfile) |
3671 | 102 | 106 | ||
3672 | === added file 'src/lib/gtkapp.py' | |||
3673 | --- src/lib/gtkapp.py 1970-01-01 00:00:00 +0000 | |||
3674 | +++ src/lib/gtkapp.py 2010-03-26 15:01:22 +0000 | |||
3675 | @@ -0,0 +1,262 @@ | |||
3676 | 1 | #!/usr/bin/env python | ||
3677 | 2 | # -*- coding: utf-8 -*- | ||
3678 | 3 | |||
3679 | 4 | # Copyright (C) 2008 Chris Dekter | ||
3680 | 5 | |||
3681 | 6 | # This program is free software; you can redistribute it and/or modify | ||
3682 | 7 | # it under the terms of the GNU General Public License as published by | ||
3683 | 8 | # the Free Software Foundation; either version 2 of the License, or | ||
3684 | 9 | # (at your option) any later version. | ||
3685 | 10 | # | ||
3686 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3687 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3688 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3689 | 14 | # General Public License for more details. | ||
3690 | 15 | # | ||
3691 | 16 | # You should have received a copy of the GNU General Public License | ||
3692 | 17 | # along with this program; if not, write to the Free Software | ||
3693 | 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
3694 | 19 | |||
3695 | 20 | import common | ||
3696 | 21 | common.USING_QT = False | ||
3697 | 22 | |||
3698 | 23 | import sys, traceback, os.path, signal, logging, logging.handlers, subprocess, Queue, optparse | ||
3699 | 24 | import gettext, gtk | ||
3700 | 25 | gettext.install("autokey") | ||
3701 | 26 | |||
3702 | 27 | import service | ||
3703 | 28 | from gtkui.notifier import Notifier | ||
3704 | 29 | from gtkui.popupmenu import PopupMenu | ||
3705 | 30 | from gtkui.configwindow import ConfigWindow | ||
3706 | 31 | from gtkui.abbrselector import AbbrSelectorDialog | ||
3707 | 32 | from configmanager import * | ||
3708 | 33 | from common import * | ||
3709 | 34 | |||
3710 | 35 | PROGRAM_NAME = _("AutoKey") | ||
3711 | 36 | DESCRIPTION = _("Desktop automation utility") | ||
3712 | 37 | #LICENSE = KAboutData.License_GPL_V3 | ||
3713 | 38 | COPYRIGHT = _("(c) 2009 Chris Dekter") | ||
3714 | 39 | #TEXT = _("") | ||
3715 | 40 | |||
3716 | 41 | |||
3717 | 42 | class Application: | ||
3718 | 43 | """ | ||
3719 | 44 | Main application class; starting and stopping of the application is controlled | ||
3720 | 45 | from here, together with some interactions from the tray icon. | ||
3721 | 46 | """ | ||
3722 | 47 | |||
3723 | 48 | def __init__(self): | ||
3724 | 49 | gtk.gdk.threads_init() | ||
3725 | 50 | |||
3726 | 51 | p = optparse.OptionParser() | ||
3727 | 52 | p.add_option("-l", "--verbose", help="Enable verbose logging", action="store_true", default=False) | ||
3728 | 53 | p.add_option("-c", "--configure", help="Show the configuration window on startup", action="store_true", default=False) | ||
3729 | 54 | options, args = p.parse_args() | ||
3730 | 55 | |||
3731 | 56 | try: | ||
3732 | 57 | # Create configuration directory | ||
3733 | 58 | if not os.path.exists(CONFIG_DIR): | ||
3734 | 59 | os.makedirs(CONFIG_DIR) | ||
3735 | 60 | |||
3736 | 61 | # Initialise logger | ||
3737 | 62 | rootLogger = logging.getLogger() | ||
3738 | 63 | |||
3739 | 64 | if options.verbose: | ||
3740 | 65 | rootLogger.setLevel(logging.DEBUG) | ||
3741 | 66 | handler = logging.StreamHandler(sys.stdout) | ||
3742 | 67 | else: | ||
3743 | 68 | rootLogger.setLevel(logging.INFO) | ||
3744 | 69 | handler = logging.handlers.RotatingFileHandler(LOG_FILE, | ||
3745 | 70 | maxBytes=MAX_LOG_SIZE, backupCount=MAX_LOG_COUNT) | ||
3746 | 71 | |||
3747 | 72 | handler.setFormatter(logging.Formatter(LOG_FORMAT)) | ||
3748 | 73 | rootLogger.addHandler(handler) | ||
3749 | 74 | |||
3750 | 75 | |||
3751 | 76 | if self.__verifyNotRunning(): | ||
3752 | 77 | self.__createLockFile() | ||
3753 | 78 | |||
3754 | 79 | self.initialise(options.configure) | ||
3755 | 80 | |||
3756 | 81 | except Exception, e: | ||
3757 | 82 | self.show_error_dialog(_("Fatal error starting AutoKey.\n") + str(e)) | ||
3758 | 83 | logging.exception("Fatal error starting AutoKey: " + str(e)) | ||
3759 | 84 | sys.exit(1) | ||
3760 | 85 | |||
3761 | 86 | |||
3762 | 87 | def __createLockFile(self): | ||
3763 | 88 | f = open(LOCK_FILE, 'w') | ||
3764 | 89 | f.write(str(os.getpid())) | ||
3765 | 90 | f.close() | ||
3766 | 91 | |||
3767 | 92 | def __verifyNotRunning(self): | ||
3768 | 93 | if os.path.exists(LOCK_FILE): | ||
3769 | 94 | f = open(LOCK_FILE, 'r') | ||
3770 | 95 | pid = f.read() | ||
3771 | 96 | f.close() | ||
3772 | 97 | |||
3773 | 98 | # Check that the found PID is running and is autokey | ||
3774 | 99 | p = subprocess.Popen(["ps", "-p", pid, "-o", "command"], stdout=subprocess.PIPE) | ||
3775 | 100 | p.wait() | ||
3776 | 101 | output = p.stdout.readlines() | ||
3777 | 102 | if len(output) > 1: | ||
3778 | 103 | # process exists | ||
3779 | 104 | if "autokey" in output[1]: | ||
3780 | 105 | logging.error("AutoKey is already running - exiting") | ||
3781 | 106 | self.show_error_dialog(_("AutoKey is already running as pid: ") + pid) | ||
3782 | 107 | sys.exit(1) | ||
3783 | 108 | |||
3784 | 109 | return True | ||
3785 | 110 | |||
3786 | 111 | def main(self): | ||
3787 | 112 | gtk.main() | ||
3788 | 113 | |||
3789 | 114 | def initialise(self, configure): | ||
3790 | 115 | logging.info("Initialising application") | ||
3791 | 116 | self.configManager = get_config_manager(self) | ||
3792 | 117 | self.service = service.Service(self) | ||
3793 | 118 | self.serviceDisabled = False | ||
3794 | 119 | |||
3795 | 120 | # Initialise user code dir | ||
3796 | 121 | if self.configManager.userCodeDir is not None: | ||
3797 | 122 | sys.path.append(self.configManager.userCodeDir) | ||
3798 | 123 | |||
3799 | 124 | try: | ||
3800 | 125 | self.service.start() | ||
3801 | 126 | except Exception, e: | ||
3802 | 127 | logging.exception("Error starting interface: " + str(e)) | ||
3803 | 128 | self.serviceDisabled = True | ||
3804 | 129 | self.show_error_dialog(_("Error starting interface. Keyboard monitoring will be disabled.\n" + | ||
3805 | 130 | "Check your system/configuration."), str(e)) | ||
3806 | 131 | |||
3807 | 132 | self.notifier = Notifier(self) | ||
3808 | 133 | self.configWindow = None | ||
3809 | 134 | self.abbrPopup = None | ||
3810 | 135 | |||
3811 | 136 | if ConfigManager.SETTINGS[IS_FIRST_RUN] or configure: | ||
3812 | 137 | ConfigManager.SETTINGS[IS_FIRST_RUN] = False | ||
3813 | 138 | self.show_configure() | ||
3814 | 139 | |||
3815 | 140 | def init_global_hotkeys(self, configManager): | ||
3816 | 141 | logging.info("Initialise global hotkeys") | ||
3817 | 142 | configManager.toggleServiceHotkey.set_closure(self.toggle_service) | ||
3818 | 143 | configManager.configHotkey.set_closure(self.show_configure_async) | ||
3819 | 144 | configManager.showPopupHotkey.set_closure(self.show_abbr_async) | ||
3820 | 145 | |||
3821 | 146 | def config_altered(self): | ||
3822 | 147 | self.configManager.config_altered() | ||
3823 | 148 | #self.notifier.build_menu() | ||
3824 | 149 | |||
3825 | 150 | def unpause_service(self): | ||
3826 | 151 | """ | ||
3827 | 152 | Unpause the expansion service (start responding to keyboard and mouse events). | ||
3828 | 153 | """ | ||
3829 | 154 | self.service.unpause() | ||
3830 | 155 | self.notifier.update_tool_tip() | ||
3831 | 156 | |||
3832 | 157 | def pause_service(self): | ||
3833 | 158 | """ | ||
3834 | 159 | Pause the expansion service (stop responding to keyboard and mouse events). | ||
3835 | 160 | """ | ||
3836 | 161 | self.service.pause() | ||
3837 | 162 | self.notifier.update_tool_tip() | ||
3838 | 163 | |||
3839 | 164 | def toggle_service(self): | ||
3840 | 165 | """ | ||
3841 | 166 | Convenience method for toggling the expansion service on or off. | ||
3842 | 167 | """ | ||
3843 | 168 | if self.service.is_running(): | ||
3844 | 169 | self.pause_service() | ||
3845 | 170 | else: | ||
3846 | 171 | self.unpause_service() | ||
3847 | 172 | |||
3848 | 173 | def shutdown(self): | ||
3849 | 174 | """ | ||
3850 | 175 | Shut down the entire application. | ||
3851 | 176 | """ | ||
3852 | 177 | if self.configWindow is not None: | ||
3853 | 178 | if self.configWindow.promptToSave(): | ||
3854 | 179 | return | ||
3855 | 180 | |||
3856 | 181 | logging.info("Shutting down") | ||
3857 | 182 | self.service.shutdown() | ||
3858 | 183 | gtk.main_quit() | ||
3859 | 184 | os.remove(LOCK_FILE) | ||
3860 | 185 | |||
3861 | 186 | def show_notify(self, message, isError=False, details=''): | ||
3862 | 187 | """ | ||
3863 | 188 | Show a notification popup. | ||
3864 | 189 | |||
3865 | 190 | @param message: Message to show in the popup | ||
3866 | 191 | @param isError: Whether the message is an error (shows with an error icon) | ||
3867 | 192 | @param details: Error details, which the user can view in a dialog by clicking | ||
3868 | 193 | the "View Details" button. | ||
3869 | 194 | """ | ||
3870 | 195 | self.notifier.show_notify(message, isError, details) | ||
3871 | 196 | |||
3872 | 197 | def show_configure(self): | ||
3873 | 198 | """ | ||
3874 | 199 | Show the configuration window, or deiconify (un-minimise) it if it's already open. | ||
3875 | 200 | """ | ||
3876 | 201 | logging.info("Displaying configuration window") | ||
3877 | 202 | if self.configWindow is None: | ||
3878 | 203 | self.configWindow = ConfigWindow(self) | ||
3879 | 204 | self.configWindow.show() | ||
3880 | 205 | else: | ||
3881 | 206 | self.configWindow.deiconify() | ||
3882 | 207 | |||
3883 | 208 | def show_configure_async(self): | ||
3884 | 209 | gtk.gdk.threads_enter() | ||
3885 | 210 | self.show_configure() | ||
3886 | 211 | gtk.gdk.threads_leave() | ||
3887 | 212 | |||
3888 | 213 | def show_abbr_selector(self): | ||
3889 | 214 | """ | ||
3890 | 215 | Show the abbreviation autocompletion popup. | ||
3891 | 216 | """ | ||
3892 | 217 | if self.abbrPopup is None: | ||
3893 | 218 | logging.info("Displaying abbreviation popup") | ||
3894 | 219 | self.abbrPopup = AbbrSelectorDialog(self) | ||
3895 | 220 | self.abbrPopup.present() | ||
3896 | 221 | |||
3897 | 222 | def show_abbr_async(self): | ||
3898 | 223 | gtk.gdk.threads_enter() | ||
3899 | 224 | self.show_abbr_selector() | ||
3900 | 225 | gtk.gdk.threads_leave() | ||
3901 | 226 | |||
3902 | 227 | def main(self): | ||
3903 | 228 | logging.info("Entering main()") | ||
3904 | 229 | gtk.main() | ||
3905 | 230 | |||
3906 | 231 | def show_error_dialog(self, message, details=None): | ||
3907 | 232 | """ | ||
3908 | 233 | Convenience method for showing an error dialog. | ||
3909 | 234 | """ | ||
3910 | 235 | dlg = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, | ||
3911 | 236 | message_format=message) | ||
3912 | 237 | if details is not None: | ||
3913 | 238 | dlg.format_secondary_text(details) | ||
3914 | 239 | dlg.run() | ||
3915 | 240 | dlg.destroy() | ||
3916 | 241 | |||
3917 | 242 | def show_script_error(self): | ||
3918 | 243 | """ | ||
3919 | 244 | Show the last script error (if any) | ||
3920 | 245 | """ | ||
3921 | 246 | if self.service.scriptRunner.error != '': | ||
3922 | 247 | dlg = gtk.MessageDialog(type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK, | ||
3923 | 248 | message_format=self.service.scriptRunner.error) | ||
3924 | 249 | self.service.scriptRunner.error = '' | ||
3925 | 250 | else: | ||
3926 | 251 | dlg = gtk.MessageDialog(type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK, | ||
3927 | 252 | message_format=_("No error information available")) | ||
3928 | 253 | |||
3929 | 254 | dlg.run() | ||
3930 | 255 | dlg.destroy() | ||
3931 | 256 | |||
3932 | 257 | def show_popup_menu(self, folders=[], items=[], onDesktop=True, title=None): | ||
3933 | 258 | self.menu = PopupMenu(self.service, folders, items, onDesktop, title) | ||
3934 | 259 | self.menu.show_on_desktop() | ||
3935 | 260 | |||
3936 | 261 | def hide_menu(self): | ||
3937 | 262 | self.menu.remove_from_desktop() | ||
3938 | 0 | 263 | ||
3939 | === added directory 'src/lib/gtkui' | |||
3940 | === added file 'src/lib/gtkui/__init__.py' | |||
3941 | === added file 'src/lib/gtkui/abbrselector.py' | |||
3942 | --- src/lib/gtkui/abbrselector.py 1970-01-01 00:00:00 +0000 | |||
3943 | +++ src/lib/gtkui/abbrselector.py 2010-03-26 15:01:22 +0000 | |||
3944 | @@ -0,0 +1,93 @@ | |||
3945 | 1 | # -*- coding: utf-8 -*- | ||
3946 | 2 | |||
3947 | 3 | # Copyright (C) 2008 Chris Dekter | ||
3948 | 4 | |||
3949 | 5 | # This program is free software; you can redistribute it and/or modify | ||
3950 | 6 | # it under the terms of the GNU General Public License as published by | ||
3951 | 7 | # the Free Software Foundation; either version 2 of the License, or | ||
3952 | 8 | # (at your option) any later version. | ||
3953 | 9 | # | ||
3954 | 10 | # This program is distributed in the hope that it will be useful, but | ||
3955 | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3956 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3957 | 13 | # General Public License for more details. | ||
3958 | 14 | # | ||
3959 | 15 | # You should have received a copy of the GNU General Public License | ||
3960 | 16 | # along with this program; if not, write to the Free Software | ||
3961 | 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
3962 | 18 | |||
3963 | 19 | import gtk | ||
3964 | 20 | |||
3965 | 21 | from autokey.configmanager import * | ||
3966 | 22 | import configwindow | ||
3967 | 23 | |||
3968 | 24 | |||
3969 | 25 | class AbbrSelectorDialog: | ||
3970 | 26 | |||
3971 | 27 | def __init__(self, app): | ||
3972 | 28 | builder = configwindow.get_ui("abbrselector.xml") | ||
3973 | 29 | self.ui = builder.get_object("abbrselector") | ||
3974 | 30 | builder.connect_signals(self) | ||
3975 | 31 | self.entry = builder.get_object("entry") | ||
3976 | 32 | |||
3977 | 33 | self.service = app.service | ||
3978 | 34 | self.app = app | ||
3979 | 35 | self.abbreviations = self.service.configManager.abbreviations | ||
3980 | 36 | |||
3981 | 37 | self.completion = gtk.EntryCompletion() | ||
3982 | 38 | self.entry.set_completion(self.completion) | ||
3983 | 39 | model = AbbreviationModel(self.abbreviations) | ||
3984 | 40 | self.completion.set_model(model) | ||
3985 | 41 | self.completion.set_text_column(0) | ||
3986 | 42 | |||
3987 | 43 | descriptionCell = gtk.CellRendererText() | ||
3988 | 44 | self.completion.pack_start(descriptionCell) | ||
3989 | 45 | self.completion.add_attribute(descriptionCell, "text", 1) | ||
3990 | 46 | self.completion.set_inline_completion(True) | ||
3991 | 47 | self.completion.set_inline_selection(True) | ||
3992 | 48 | self.completion.connect("match-selected", self.on_match_selected) | ||
3993 | 49 | |||
3994 | 50 | self.set_keep_above(True) | ||
3995 | 51 | |||
3996 | 52 | |||
3997 | 53 | def on_match_selected(self, completion, model, iter, data=None): | ||
3998 | 54 | theItem = model.get_value(iter, AbbreviationModel.OBJECT_COLUMN) | ||
3999 | 55 | self.service.item_selected(theItem) | ||
4000 | 56 | self.hide() | ||
4001 | 57 | |||
4002 | 58 | def on_entry_activated(self, widget, data=None): | ||
4003 | 59 | entered = self.entry.get_text() | ||
4004 | 60 | for thePhrase in self.abbreviations: | ||
4005 | 61 | if theItem.abbreviation == entered: | ||
4006 | 62 | self.service.phrase_selected(None, theItem) | ||
4007 | 63 | self.hide() | ||
4008 | 64 | |||
4009 | 65 | def on_close(self, widget, data=None): | ||
4010 | 66 | self.destroy() | ||
4011 | 67 | self.app.abbrPopup = None | ||
4012 | 68 | |||
4013 | 69 | def __getattr__(self, attr): | ||
4014 | 70 | # Magic fudge to allow us to pretend to be the ui class we encapsulate | ||
4015 | 71 | return getattr(self.ui, attr) | ||
4016 | 72 | |||
4017 | 73 | |||
4018 | 74 | class AbbreviationModel(gtk.ListStore): | ||
4019 | 75 | |||
4020 | 76 | OBJECT_COLUMN = 2 | ||
4021 | 77 | |||
4022 | 78 | def __init__(self, abbreviations): | ||
4023 | 79 | gtk.ListStore.__init__(self, str, str, object) | ||
4024 | 80 | |||
4025 | 81 | for item in abbreviations: | ||
4026 | 82 | self.append((item.abbreviation, item.description, item)) | ||
4027 | 83 | |||
4028 | 84 | def match(self, completion, keyString, iter, data=None): | ||
4029 | 85 | abbreviation = self.get_value(iter, 0) | ||
4030 | 86 | description = self.get_value(iter, 1) | ||
4031 | 87 | if abbreviation.startswith(keyString): | ||
4032 | 88 | return True | ||
4033 | 89 | elif len(keyString) > 1: | ||
4034 | 90 | if keyString in description: | ||
4035 | 91 | return True | ||
4036 | 92 | |||
4037 | 93 | return False | ||
4038 | 0 | 94 | ||
4039 | === added file 'src/lib/gtkui/configwindow.py' | |||
4040 | --- src/lib/gtkui/configwindow.py 1970-01-01 00:00:00 +0000 | |||
4041 | +++ src/lib/gtkui/configwindow.py 2010-03-26 15:01:22 +0000 | |||
4042 | @@ -0,0 +1,1120 @@ | |||
4043 | 1 | # -*- coding: utf-8 -*- | ||
4044 | 2 | |||
4045 | 3 | # Copyright (C) 2009 Chris Dekter | ||
4046 | 4 | |||
4047 | 5 | # This program is free software; you can redistribute it and/or modify | ||
4048 | 6 | # it under the terms of the GNU General Public License as published by | ||
4049 | 7 | # the Free Software Foundation; either version 2 of the License, or | ||
4050 | 8 | # (at your option) any later version. | ||
4051 | 9 | # | ||
4052 | 10 | # This program is distributed in the hope that it will be useful, but | ||
4053 | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4054 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
4055 | 13 | # General Public License for more details. | ||
4056 | 14 | # | ||
4057 | 15 | # You should have received a copy of the GNU General Public License | ||
4058 | 16 | # along with this program; if not, write to the Free Software | ||
4059 | 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
4060 | 18 | |||
4061 | 19 | import logging, sys, os, webbrowser, re | ||
4062 | 20 | import gtk, gtk.glade, gtksourceview2 | ||
4063 | 21 | |||
4064 | 22 | from dialogs import * | ||
4065 | 23 | from settingsdialog import SettingsDialog | ||
4066 | 24 | from autokey.configmanager import * | ||
4067 | 25 | from autokey.iomediator import Recorder | ||
4068 | 26 | from autokey import model, common | ||
4069 | 27 | |||
4070 | 28 | CONFIG_WINDOW_TITLE = _(common.CONFIG_WINDOW_TITLE + " - AutoKey") | ||
4071 | 29 | |||
4072 | 30 | |||
4073 | 31 | WEBSITE = "http://code.google.com/p/autokey" | ||
4074 | 32 | |||
4075 | 33 | UI_DESCRIPTION_FILE = os.path.join(os.path.dirname(__file__), "data/menus.xml") | ||
4076 | 34 | |||
4077 | 35 | def get_ui(fileName): | ||
4078 | 36 | builder = gtk.Builder() | ||
4079 | 37 | uiFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data/" + fileName) | ||
4080 | 38 | builder.add_from_file(uiFile) | ||
4081 | 39 | return builder | ||
4082 | 40 | |||
4083 | 41 | class SettingsWidget: | ||
4084 | 42 | |||
4085 | 43 | KEY_MAP = HotkeySettingsDialog.KEY_MAP | ||
4086 | 44 | REVERSE_KEY_MAP = HotkeySettingsDialog.REVERSE_KEY_MAP | ||
4087 | 45 | |||
4088 | 46 | def __init__(self, parentWindow): | ||
4089 | 47 | self.parentWindow = parentWindow | ||
4090 | 48 | builder = get_ui("settingswidget.xml") | ||
4091 | 49 | self.ui = builder.get_object("settingswidget") | ||
4092 | 50 | builder.connect_signals(self) | ||
4093 | 51 | |||
4094 | 52 | self.abbrDialog = AbbrSettingsDialog(parentWindow.ui, parentWindow.app.configManager, self.on_abbr_response) | ||
4095 | 53 | self.hotkeyDialog = HotkeySettingsDialog(parentWindow.ui, parentWindow.app.configManager, self.on_hotkey_response) | ||
4096 | 54 | self.filterDialog = WindowFilterSettingsDialog(parentWindow.ui) | ||
4097 | 55 | |||
4098 | 56 | self.abbrLabel = builder.get_object("abbrLabel") | ||
4099 | 57 | self.clearAbbrButton = builder.get_object("clearAbbrButton") | ||
4100 | 58 | self.hotkeyLabel = builder.get_object("hotkeyLabel") | ||
4101 | 59 | self.clearHotkeyButton = builder.get_object("clearHotkeyButton") | ||
4102 | 60 | self.windowFilterLabel = builder.get_object("windowFilterLabel") | ||
4103 | 61 | self.clearFilterButton = builder.get_object("clearFilterButton") | ||
4104 | 62 | |||
4105 | 63 | def load(self, item): | ||
4106 | 64 | self.currentItem = item | ||
4107 | 65 | |||
4108 | 66 | self.abbrDialog.load(self.currentItem) | ||
4109 | 67 | if model.TriggerMode.ABBREVIATION in item.modes: | ||
4110 | 68 | self.abbrLabel.set_text(item.abbreviation) | ||
4111 | 69 | self.clearAbbrButton.set_sensitive(True) | ||
4112 | 70 | self.abbrEnabled = True | ||
4113 | 71 | else: | ||
4114 | 72 | self.abbrLabel.set_text(_("(None configured)")) | ||
4115 | 73 | self.clearAbbrButton.set_sensitive(False) | ||
4116 | 74 | self.abbrEnabled = False | ||
4117 | 75 | |||
4118 | 76 | self.hotkeyDialog.load(self.currentItem) | ||
4119 | 77 | if model.TriggerMode.HOTKEY in item.modes: | ||
4120 | 78 | key = item.hotKey | ||
4121 | 79 | self.hotkeyLabel.set_text(self.build_hotkey_string(key, item.modifiers)) | ||
4122 | 80 | self.clearHotkeyButton.set_sensitive(True) | ||
4123 | 81 | self.hotkeyEnabled = True | ||
4124 | 82 | else: | ||
4125 | 83 | self.hotkeyLabel.set_text(_("(None configured)")) | ||
4126 | 84 | self.clearHotkeyButton.set_sensitive(False) | ||
4127 | 85 | self.hotkeyEnabled = False | ||
4128 | 86 | |||
4129 | 87 | self.filterDialog.load(self.currentItem) | ||
4130 | 88 | if item.uses_default_filter(): | ||
4131 | 89 | self.windowFilterLabel.set_text(_("(None configured)")) | ||
4132 | 90 | self.clearFilterButton.set_sensitive(False) | ||
4133 | 91 | self.filterEnabled = False | ||
4134 | 92 | else: | ||
4135 | 93 | self.windowFilterLabel.set_text(item.get_filter_regex()) | ||
4136 | 94 | self.clearFilterButton.set_sensitive(True) | ||
4137 | 95 | self.filterEnabled = True | ||
4138 | 96 | |||
4139 | 97 | def save(self): | ||
4140 | 98 | self.currentItem.set_modes([]) | ||
4141 | 99 | if self.abbrEnabled: | ||
4142 | 100 | self.abbrDialog.save(self.currentItem) | ||
4143 | 101 | if self.hotkeyEnabled: | ||
4144 | 102 | self.hotkeyDialog.save(self.currentItem) | ||
4145 | 103 | if self.filterEnabled: | ||
4146 | 104 | self.filterDialog.save(self.currentItem) | ||
4147 | 105 | else: | ||
4148 | 106 | self.currentItem.set_window_titles(None) | ||
4149 | 107 | |||
4150 | 108 | def set_dirty(self): | ||
4151 | 109 | self.parentWindow.set_dirty(True) | ||
4152 | 110 | |||
4153 | 111 | # ---- Signal handlers | ||
4154 | 112 | |||
4155 | 113 | def on_setAbbrButton_clicked(self, widget, data=None): | ||
4156 | 114 | self.abbrDialog.run() | ||
4157 | 115 | |||
4158 | 116 | def on_abbr_response(self, res): | ||
4159 | 117 | if res == gtk.RESPONSE_OK: | ||
4160 | 118 | self.set_dirty() | ||
4161 | 119 | self.abbrEnabled = True | ||
4162 | 120 | self.abbrLabel.set_text(self.abbrDialog.get_abbr()) | ||
4163 | 121 | self.clearAbbrButton.set_sensitive(True) | ||
4164 | 122 | |||
4165 | 123 | def on_clearAbbrButton_clicked(self, widget, data=None): | ||
4166 | 124 | self.set_dirty() | ||
4167 | 125 | self.abbrEnabled = False | ||
4168 | 126 | self.clearAbbrButton.set_sensitive(False) | ||
4169 | 127 | self.abbrLabel.set_text(_("(None configured)")) | ||
4170 | 128 | self.abbrDialog.reset() | ||
4171 | 129 | |||
4172 | 130 | def on_setHotkeyButton_clicked(self, widget, data=None): | ||
4173 | 131 | self.hotkeyDialog.run() | ||
4174 | 132 | |||
4175 | 133 | def on_hotkey_response(self, res): | ||
4176 | 134 | if res == gtk.RESPONSE_OK: | ||
4177 | 135 | self.set_dirty() | ||
4178 | 136 | self.hotkeyEnabled = True | ||
4179 | 137 | key = self.hotkeyDialog.key | ||
4180 | 138 | modifiers = self.hotkeyDialog.build_modifiers() | ||
4181 | 139 | self.hotkeyLabel.set_text(self.build_hotkey_string(key, modifiers)) | ||
4182 | 140 | self.clearHotkeyButton.set_sensitive(True) | ||
4183 | 141 | |||
4184 | 142 | def on_clearHotkeyButton_clicked(self, widget, data=None): | ||
4185 | 143 | self.set_dirty() | ||
4186 | 144 | self.hotkeyEnabled = False | ||
4187 | 145 | self.clearHotkeyButton.set_sensitive(False) | ||
4188 | 146 | self.hotkeyLabel.set_text(_("(None configured)")) | ||
4189 | 147 | self.hotkeyDialog.reset() | ||
4190 | 148 | |||
4191 | 149 | def on_setFilterButton_clicked(self, widget, data=None): | ||
4192 | 150 | if self.filterDialog.run() == gtk.RESPONSE_OK: | ||
4193 | 151 | self.set_dirty() | ||
4194 | 152 | filterText = self.filterDialog.get_filter_text() | ||
4195 | 153 | if filterText != "": | ||
4196 | 154 | self.filterEnabled = True | ||
4197 | 155 | self.clearFilterButton.set_sensitive(True) | ||
4198 | 156 | self.windowFilterLabel.set_text(filterText) | ||
4199 | 157 | else: | ||
4200 | 158 | self.filterEnabled = False | ||
4201 | 159 | self.clearFilterButton.set_sensitive(False) | ||
4202 | 160 | self.windowFilterLabel.set_text(_("(None configured)")) | ||
4203 | 161 | |||
4204 | 162 | def on_clearFilterButton_clicked(self, widget, data=None): | ||
4205 | 163 | self.set_dirty() | ||
4206 | 164 | self.filterEnabled = False | ||
4207 | 165 | self.clearFilterButton.set_sensitive(False) | ||
4208 | 166 | self.windowFilterLabel.set_text(_("(None configured)")) | ||
4209 | 167 | self.filterDialog.reset() | ||
4210 | 168 | |||
4211 | 169 | def build_hotkey_string(self, key, modifiers): | ||
4212 | 170 | hotkey = "" | ||
4213 | 171 | |||
4214 | 172 | for modifier in modifiers: | ||
4215 | 173 | hotkey += modifier | ||
4216 | 174 | hotkey += "+" | ||
4217 | 175 | |||
4218 | 176 | if key in self.KEY_MAP: | ||
4219 | 177 | keyText = self.KEY_MAP[key] | ||
4220 | 178 | else: | ||
4221 | 179 | keyText = key | ||
4222 | 180 | hotkey += keyText | ||
4223 | 181 | |||
4224 | 182 | return hotkey | ||
4225 | 183 | |||
4226 | 184 | def __getattr__(self, attr): | ||
4227 | 185 | # Magic fudge to allow us to pretend to be the ui class we encapsulate | ||
4228 | 186 | return getattr(self.ui, attr) | ||
4229 | 187 | |||
4230 | 188 | |||
4231 | 189 | class FolderPage: | ||
4232 | 190 | |||
4233 | 191 | def __init__(self, parentWindow): | ||
4234 | 192 | self.parentWindow = parentWindow | ||
4235 | 193 | builder = get_ui("folderpage.xml") | ||
4236 | 194 | self.ui = builder.get_object("folderpage") | ||
4237 | 195 | builder.connect_signals(self) | ||
4238 | 196 | |||
4239 | 197 | self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox") | ||
4240 | 198 | |||
4241 | 199 | vbox = builder.get_object("settingsVbox") | ||
4242 | 200 | self.settingsWidget = SettingsWidget(parentWindow) | ||
4243 | 201 | vbox.pack_start(self.settingsWidget.ui) | ||
4244 | 202 | |||
4245 | 203 | def load(self, theFolder): | ||
4246 | 204 | self.currentFolder = theFolder | ||
4247 | 205 | self.showInTrayCheckbox.set_active(theFolder.showInTrayMenu) | ||
4248 | 206 | self.settingsWidget.load(theFolder) | ||
4249 | 207 | |||
4250 | 208 | def save(self): | ||
4251 | 209 | self.currentFolder.showInTrayMenu = self.showInTrayCheckbox.get_active() | ||
4252 | 210 | self.settingsWidget.save() | ||
4253 | 211 | |||
4254 | 212 | def set_item_title(self, newTitle): | ||
4255 | 213 | self.currentFolder.title = newTitle.decode("utf-8") | ||
4256 | 214 | #self.titleEntry.set_text(newTitle) # TODO testing remove me later | ||
4257 | 215 | |||
4258 | 216 | def reset(self): | ||
4259 | 217 | self.load(self.currentFolder) | ||
4260 | 218 | |||
4261 | 219 | def validate(self): | ||
4262 | 220 | return True | ||
4263 | 221 | |||
4264 | 222 | def on_modified(self, widget, data=None): | ||
4265 | 223 | self.set_dirty() | ||
4266 | 224 | |||
4267 | 225 | def set_dirty(self): | ||
4268 | 226 | self.parentWindow.set_dirty(True) | ||
4269 | 227 | |||
4270 | 228 | |||
4271 | 229 | class OldPhrasePage: | ||
4272 | 230 | |||
4273 | 231 | def __init__(self, parentWindow): | ||
4274 | 232 | self.parentWindow = parentWindow | ||
4275 | 233 | builder = get_ui("phrasepage.xml") | ||
4276 | 234 | self.ui = builder.get_object("phrasepage") | ||
4277 | 235 | builder.connect_signals(self) | ||
4278 | 236 | |||
4279 | 237 | self.descriptionEntry = builder.get_object("descriptionEntry") | ||
4280 | 238 | self.phraseText = builder.get_object("phraseText") | ||
4281 | 239 | self.promptCheckbox = builder.get_object("promptCheckbox") | ||
4282 | 240 | self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox") | ||
4283 | 241 | |||
4284 | 242 | vbox = builder.get_object("settingsVbox") | ||
4285 | 243 | self.settingsWidget = SettingsWidget(parentWindow) | ||
4286 | 244 | vbox.pack_start(self.settingsWidget.ui) | ||
4287 | 245 | |||
4288 | 246 | def load(self, thePhrase): | ||
4289 | 247 | self.currentPhrase = thePhrase | ||
4290 | 248 | self.descriptionEntry.set_text(thePhrase.description.encode("utf-8")) | ||
4291 | 249 | buffer = gtk.TextBuffer() | ||
4292 | 250 | buffer.set_text(thePhrase.phrase.encode("utf-8")) | ||
4293 | 251 | buffer.connect("changed", self.on_modified) | ||
4294 | 252 | self.phraseText.set_buffer(buffer) | ||
4295 | 253 | self.promptCheckbox.set_active(thePhrase.prompt) | ||
4296 | 254 | self.showInTrayCheckbox.set_active(thePhrase.showInTrayMenu) | ||
4297 | 255 | self.settingsWidget.load(thePhrase) | ||
4298 | 256 | |||
4299 | 257 | def save(self): | ||
4300 | 258 | self.currentPhrase.description = self.descriptionEntry.get_text().decode("utf-8") | ||
4301 | 259 | |||
4302 | 260 | buffer = self.phraseText.get_buffer() | ||
4303 | 261 | self.currentPhrase.phrase = buffer.get_text(buffer.get_start_iter(), | ||
4304 | 262 | buffer.get_end_iter()).decode("utf-8") | ||
4305 | 263 | |||
4306 | 264 | self.currentPhrase.prompt = self.promptCheckbox.get_active() | ||
4307 | 265 | self.currentPhrase.showInTrayMenu = self.showInTrayCheckbox.get_active() | ||
4308 | 266 | |||
4309 | 267 | self.settingsWidget.save() | ||
4310 | 268 | |||
4311 | 269 | def reset(self): | ||
4312 | 270 | self.load(self.currentPhrase) | ||
4313 | 271 | |||
4314 | 272 | def validate(self): | ||
4315 | 273 | if not validate(not EMPTY_FIELD_REGEX.match(self.descriptionEntry.get_text()), | ||
4316 | 274 | _("The phrase description can't be empty"), self.descriptionEntry, self.parentWindow.ui): | ||
4317 | 275 | return False | ||
4318 | 276 | |||
4319 | 277 | buffer = self.phraseText.get_buffer() | ||
4320 | 278 | text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter()) | ||
4321 | 279 | if not validate(not EMPTY_FIELD_REGEX.match(text), _("The phrase content can't be empty"), self.phraseText, | ||
4322 | 280 | self.parentWindow.ui): | ||
4323 | 281 | return False | ||
4324 | 282 | |||
4325 | 283 | return True | ||
4326 | 284 | |||
4327 | 285 | def on_modified(self, widget, data=None): | ||
4328 | 286 | self.set_dirty() | ||
4329 | 287 | |||
4330 | 288 | def set_dirty(self): | ||
4331 | 289 | self.parentWindow.set_dirty(True) | ||
4332 | 290 | |||
4333 | 291 | |||
4334 | 292 | class ScriptPage: | ||
4335 | 293 | |||
4336 | 294 | def __init__(self, parentWindow): | ||
4337 | 295 | self.parentWindow = parentWindow | ||
4338 | 296 | builder = get_ui("scriptpage.xml") | ||
4339 | 297 | self.ui = builder.get_object("scriptpage") | ||
4340 | 298 | builder.connect_signals(self) | ||
4341 | 299 | |||
4342 | 300 | self.buffer = gtksourceview2.Buffer() | ||
4343 | 301 | self.buffer.connect("changed", self.on_modified) | ||
4344 | 302 | self.editor = gtksourceview2.View(self.buffer) | ||
4345 | 303 | scrolledWindow = builder.get_object("scrolledWindow") | ||
4346 | 304 | scrolledWindow.add(self.editor) | ||
4347 | 305 | self.promptCheckbox = builder.get_object("promptCheckbox") | ||
4348 | 306 | self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox") | ||
4349 | 307 | |||
4350 | 308 | vbox = builder.get_object("settingsVbox") | ||
4351 | 309 | self.settingsWidget = SettingsWidget(parentWindow) | ||
4352 | 310 | vbox.pack_start(self.settingsWidget.ui) | ||
4353 | 311 | |||
4354 | 312 | # Configure script editor | ||
4355 | 313 | self.__m = gtksourceview2.LanguageManager() | ||
4356 | 314 | self.__sm = gtksourceview2.StyleSchemeManager() | ||
4357 | 315 | self.buffer.set_language(self.__m.get_language("python")) | ||
4358 | 316 | self.buffer.set_style_scheme(self.__sm.get_scheme("kate")) | ||
4359 | 317 | self.editor.set_auto_indent(True) | ||
4360 | 318 | self.editor.set_smart_home_end(True) | ||
4361 | 319 | self.editor.set_insert_spaces_instead_of_tabs(True) | ||
4362 | 320 | self.editor.set_tab_width(4) | ||
4363 | 321 | |||
4364 | 322 | self.ui.show_all() | ||
4365 | 323 | |||
4366 | 324 | def load(self, theScript): | ||
4367 | 325 | self.currentItem = theScript | ||
4368 | 326 | |||
4369 | 327 | self.buffer.begin_not_undoable_action() | ||
4370 | 328 | self.buffer.set_text(theScript.code.encode("utf-8")) | ||
4371 | 329 | self.buffer.end_not_undoable_action() | ||
4372 | 330 | self.buffer.place_cursor(self.buffer.get_start_iter()) | ||
4373 | 331 | |||
4374 | 332 | self.promptCheckbox.set_active(theScript.prompt) | ||
4375 | 333 | self.showInTrayCheckbox.set_active(theScript.showInTrayMenu) | ||
4376 | 334 | self.settingsWidget.load(theScript) | ||
4377 | 335 | |||
4378 | 336 | def save(self): | ||
4379 | 337 | self.currentItem.code = self.buffer.get_text(self.buffer.get_start_iter(), | ||
4380 | 338 | self.buffer.get_end_iter()).decode("utf-8") | ||
4381 | 339 | |||
4382 | 340 | self.currentItem.prompt = self.promptCheckbox.get_active() | ||
4383 | 341 | self.currentItem.showInTrayMenu = self.showInTrayCheckbox.get_active() | ||
4384 | 342 | |||
4385 | 343 | self.settingsWidget.save() | ||
4386 | 344 | |||
4387 | 345 | def set_item_title(self, newTitle): | ||
4388 | 346 | self.currentItem.description = newTitle.decode("utf-8") | ||
4389 | 347 | |||
4390 | 348 | |||
4391 | 349 | def reset(self): | ||
4392 | 350 | self.load(self.currentItem) | ||
4393 | 351 | self.parentWindow.set_undo_available(False) | ||
4394 | 352 | self.parentWindow.set_redo_available(False) | ||
4395 | 353 | |||
4396 | 354 | def validate(self): | ||
4397 | 355 | text = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter()) | ||
4398 | 356 | if not validate(not EMPTY_FIELD_REGEX.match(text), _("The script code can't be empty"), self.editor, | ||
4399 | 357 | self.parentWindow.ui): | ||
4400 | 358 | return False | ||
4401 | 359 | |||
4402 | 360 | return True | ||
4403 | 361 | |||
4404 | 362 | def start_record(self): | ||
4405 | 363 | self.buffer.insert(self.buffer.get_end_iter(), "\n") | ||
4406 | 364 | |||
4407 | 365 | def start_key_sequence(self): | ||
4408 | 366 | self.buffer.insert(self.buffer.get_end_iter(), "keyboard.send_keys(\"") | ||
4409 | 367 | |||
4410 | 368 | def end_key_sequence(self): | ||
4411 | 369 | self.buffer.insert(self.buffer.get_end_iter(), "\")\n") | ||
4412 | 370 | |||
4413 | 371 | def append_key(self, key): | ||
4414 | 372 | #line, pos = self.buffer.getCursorPosition() | ||
4415 | 373 | self.buffer.insert(self.buffer.get_end_iter(), key) | ||
4416 | 374 | #self.scriptCodeEditor.setCursorPosition(line, pos + len(key)) | ||
4417 | 375 | |||
4418 | 376 | def append_hotkey(self, key, modifiers): | ||
4419 | 377 | #line, pos = self.scriptCodeEditor.getCursorPosition() | ||
4420 | 378 | keyString = self.settingsWidget.build_hotkey_string(key, modifiers) | ||
4421 | 379 | self.buffer.insert(self.buffer.get_end_iter(), keyString) | ||
4422 | 380 | #self.scriptCodeEditor.setCursorPosition(line, pos + len(keyString)) | ||
4423 | 381 | |||
4424 | 382 | def append_mouseclick(self, xCoord, yCoord, button, windowTitle): | ||
4425 | 383 | self.buffer.insert(self.buffer.get_end_iter(), "mouse.click_relative(%d, %d, %d) # %s\n" % (xCoord, yCoord, int(button), windowTitle)) | ||
4426 | 384 | |||
4427 | 385 | def undo(self): | ||
4428 | 386 | self.buffer.undo() | ||
4429 | 387 | self.parentWindow.set_undo_available(self.buffer.can_undo()) | ||
4430 | 388 | self.parentWindow.set_redo_available(self.buffer.can_redo()) | ||
4431 | 389 | |||
4432 | 390 | def redo(self): | ||
4433 | 391 | self.buffer.redo() | ||
4434 | 392 | self.parentWindow.set_undo_available(self.buffer.can_undo()) | ||
4435 | 393 | self.parentWindow.set_redo_available(self.buffer.can_redo()) | ||
4436 | 394 | |||
4437 | 395 | def on_modified(self, widget, data=None): | ||
4438 | 396 | self.set_dirty() | ||
4439 | 397 | self.parentWindow.set_undo_available(self.buffer.can_undo()) | ||
4440 | 398 | self.parentWindow.set_redo_available(self.buffer.can_redo()) | ||
4441 | 399 | |||
4442 | 400 | def set_dirty(self): | ||
4443 | 401 | self.parentWindow.set_dirty(True) | ||
4444 | 402 | |||
4445 | 403 | |||
4446 | 404 | class PhrasePage(ScriptPage): | ||
4447 | 405 | |||
4448 | 406 | def __init__(self, parentWindow): | ||
4449 | 407 | self.parentWindow = parentWindow | ||
4450 | 408 | builder = get_ui("phrasepage.xml") | ||
4451 | 409 | self.ui = builder.get_object("phrasepage") | ||
4452 | 410 | builder.connect_signals(self) | ||
4453 | 411 | |||
4454 | 412 | self.buffer = gtksourceview2.Buffer() | ||
4455 | 413 | self.buffer.connect("changed", self.on_modified) | ||
4456 | 414 | self.editor = gtksourceview2.View(self.buffer) | ||
4457 | 415 | scrolledWindow = builder.get_object("scrolledWindow") | ||
4458 | 416 | scrolledWindow.add(self.editor) | ||
4459 | 417 | self.promptCheckbox = builder.get_object("promptCheckbox") | ||
4460 | 418 | self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox") | ||
4461 | 419 | |||
4462 | 420 | vbox = builder.get_object("settingsVbox") | ||
4463 | 421 | self.settingsWidget = SettingsWidget(parentWindow) | ||
4464 | 422 | vbox.pack_start(self.settingsWidget.ui) | ||
4465 | 423 | |||
4466 | 424 | # Configure script editor | ||
4467 | 425 | #self.__m = gtksourceview2.LanguageManager() | ||
4468 | 426 | self.__sm = gtksourceview2.StyleSchemeManager() | ||
4469 | 427 | self.buffer.set_language(None) | ||
4470 | 428 | self.buffer.set_style_scheme(self.__sm.get_scheme("kate")) | ||
4471 | 429 | self.buffer.set_highlight_matching_brackets(False) | ||
4472 | 430 | self.editor.set_auto_indent(False) | ||
4473 | 431 | self.editor.set_smart_home_end(False) | ||
4474 | 432 | self.editor.set_insert_spaces_instead_of_tabs(True) | ||
4475 | 433 | self.editor.set_tab_width(4) | ||
4476 | 434 | |||
4477 | 435 | self.ui.show_all() | ||
4478 | 436 | |||
4479 | 437 | def load(self, thePhrase): | ||
4480 | 438 | self.currentItem = thePhrase | ||
4481 | 439 | |||
4482 | 440 | self.buffer.begin_not_undoable_action() | ||
4483 | 441 | self.buffer.set_text(thePhrase.phrase.encode("utf-8")) | ||
4484 | 442 | self.buffer.end_not_undoable_action() | ||
4485 | 443 | self.buffer.place_cursor(self.buffer.get_start_iter()) | ||
4486 | 444 | |||
4487 | 445 | self.promptCheckbox.set_active(thePhrase.prompt) | ||
4488 | 446 | self.showInTrayCheckbox.set_active(thePhrase.showInTrayMenu) | ||
4489 | 447 | self.settingsWidget.load(thePhrase) | ||
4490 | 448 | |||
4491 | 449 | def save(self): | ||
4492 | 450 | self.currentItem.phrase = self.buffer.get_text(self.buffer.get_start_iter(), | ||
4493 | 451 | self.buffer.get_end_iter()).decode("utf-8") | ||
4494 | 452 | |||
4495 | 453 | self.currentItem.prompt = self.promptCheckbox.get_active() | ||
4496 | 454 | self.currentItem.showInTrayMenu = self.showInTrayCheckbox.get_active() | ||
4497 | 455 | |||
4498 | 456 | self.settingsWidget.save() | ||
4499 | 457 | |||
4500 | 458 | class ConfigWindow: | ||
4501 | 459 | |||
4502 | 460 | def __init__(self, app): | ||
4503 | 461 | self.app = app | ||
4504 | 462 | self.cutCopiedItems = [] | ||
4505 | 463 | |||
4506 | 464 | builder = get_ui("mainwindow.xml") | ||
4507 | 465 | self.ui = builder.get_object("mainwindow") | ||
4508 | 466 | builder.connect_signals(self) | ||
4509 | 467 | |||
4510 | 468 | # Menus and Actions | ||
4511 | 469 | self.uiManager = gtk.UIManager() | ||
4512 | 470 | self.add_accel_group(self.uiManager.get_accel_group()) | ||
4513 | 471 | |||
4514 | 472 | # Menu Bar | ||
4515 | 473 | actionGroup = gtk.ActionGroup("menu") | ||
4516 | 474 | actions = [ | ||
4517 | 475 | ("File", None, "_File"), | ||
4518 | 476 | ("create", None, "Create..."), | ||
4519 | 477 | ("new-top-folder", "folder-new", "New _Top-Level Folder", "", "Create a new top-level phrase folder", self.on_new_topfolder), | ||
4520 | 478 | ("new-folder", "folder-new", "New _Folder", "", "Create a new phrase folder in the current folder", self.on_new_folder), | ||
4521 | 479 | ("new-phrase", gtk.STOCK_NEW, "New _Phrase", "<control>n", "Create a new phrase in the current folder", self.on_new_phrase), | ||
4522 | 480 | ("new-script", gtk.STOCK_NEW, "New _Script", "<control><shift>n", "Create a new script in the current folder", self.on_new_script), | ||
4523 | 481 | ("save", gtk.STOCK_SAVE, "_Save", None, "Save changes to current item", self.on_save), | ||
4524 | 482 | ("close-window", gtk.STOCK_CLOSE, "_Close window", None, "Close the configuration window", self.on_close), | ||
4525 | 483 | ("quit", gtk.STOCK_QUIT, "_Quit", None, "Completely exit AutoKey", self.on_quit), | ||
4526 | 484 | ("Edit", None, "_Edit"), | ||
4527 | 485 | ("cut-item", gtk.STOCK_CUT, "Cu_t Item(s)", "<control><shift>x", "Cut the selected item", self.on_cut_item), | ||
4528 | 486 | ("copy-item", gtk.STOCK_COPY, "_Copy Item(s)", "<control><shift>c", "Copy the selected item", self.on_copy_item), | ||
4529 | 487 | ("paste-item", gtk.STOCK_PASTE, "_Paste Item(s)", "<control><shift>v", "Paste the last cut/copied item", self.on_paste_item), | ||
4530 | 488 | ("delete-item", gtk.STOCK_DELETE, "_Delete Item(s)", "<control>d", "Delete the selected item", self.on_delete_item), | ||
4531 | 489 | ("rename", None, "_Rename", "", "Rename the selected item", self.on_rename), | ||
4532 | 490 | ("undo", gtk.STOCK_UNDO, "_Undo", "<control>z", "Undo the last edit", self.on_undo), | ||
4533 | 491 | ("redo", gtk.STOCK_REDO, "_Redo", "<control><shift>z", "Redo the last undone edit", self.on_redo), | ||
4534 | 492 | ("preferences", gtk.STOCK_PREFERENCES, "_Preferences", "", "Additional options", self.on_advanced_settings), | ||
4535 | 493 | ("View", None, "_View"), | ||
4536 | 494 | ("script-error", gtk.STOCK_DIALOG_ERROR, "Vie_w script error", None, "View script error information", self.on_show_error), | ||
4537 | 495 | #("Settings", None, "_Settings", None, None, None), | ||
4538 | 496 | #("advanced", gtk.STOCK_PREFERENCES, "_Advanced Settings", "", "Advanced configuration options", self.on_advanced_settings), | ||
4539 | 497 | ("Help", None, "_Help"), | ||
4540 | 498 | ("faq", None, "_F.A.Q.", None, "Display Frequently Asked Questions", self.on_show_faq), | ||
4541 | 499 | ("help", gtk.STOCK_HELP, "Online _Help", None, "Display Online Help", self.on_show_help), | ||
4542 | 500 | ("donate", gtk.STOCK_YES, "Donate", "", "Make A Donation", self.on_donate), | ||
4543 | 501 | ("about", gtk.STOCK_ABOUT, "About AutoKey", None, "Show program information", self.on_show_about) | ||
4544 | 502 | ] | ||
4545 | 503 | actionGroup.add_actions(actions) | ||
4546 | 504 | |||
4547 | 505 | toggleActions = [ | ||
4548 | 506 | #("enable-monitoring", None, "_Enable Monitoring", None, "Toggle monitoring on/off", self.on_enable_toggled), | ||
4549 | 507 | ("toolbar", None, "_Show Toolbar", None, "Show/hide the toolbar", self.on_toggle_toolbar), | ||
4550 | 508 | ("record", gtk.STOCK_MEDIA_RECORD, "R_ecord Macro", None, "Record a keyboard/mouse macro", self.on_record_keystrokes), | ||
4551 | 509 | ] | ||
4552 | 510 | actionGroup.add_toggle_actions(toggleActions) | ||
4553 | 511 | |||
4554 | 512 | self.uiManager.insert_action_group(actionGroup, 0) | ||
4555 | 513 | self.uiManager.add_ui_from_file(UI_DESCRIPTION_FILE) | ||
4556 | 514 | self.vbox = builder.get_object("vbox") | ||
4557 | 515 | self.vbox.pack_end(self.uiManager.get_widget("/MenuBar"), False, False) | ||
4558 | 516 | |||
4559 | 517 | # Toolbar 'create' button | ||
4560 | 518 | create = gtk.MenuToolButton(gtk.STOCK_NEW) | ||
4561 | 519 | create.show() | ||
4562 | 520 | menu = self.uiManager.get_widget('/MenuBar/File/create').get_submenu() | ||
4563 | 521 | create.set_menu(menu) | ||
4564 | 522 | toolbar = self.uiManager.get_widget('/Toolbar') | ||
4565 | 523 | s = gtk.SeparatorToolItem() | ||
4566 | 524 | s.show() | ||
4567 | 525 | toolbar.insert(s, 0) | ||
4568 | 526 | toolbar.insert(create, 0) | ||
4569 | 527 | #if ConfigManager.SETTINGS[SHOW_TOOLBAR]: | ||
4570 | 528 | # self.__addToolbar() | ||
4571 | 529 | self.uiManager.get_action("/MenuBar/View/toolbar").set_active(ConfigManager.SETTINGS[SHOW_TOOLBAR]) | ||
4572 | 530 | |||
4573 | 531 | self.treeView = builder.get_object("treeWidget") | ||
4574 | 532 | self.__initTreeWidget() | ||
4575 | 533 | |||
4576 | 534 | self.stack = builder.get_object("stack") | ||
4577 | 535 | self.__initStack() | ||
4578 | 536 | |||
4579 | 537 | self.saveButton = builder.get_object("saveButton") | ||
4580 | 538 | self.revertButton = builder.get_object("revertButton") | ||
4581 | 539 | self.hpaned = builder.get_object("hpaned") | ||
4582 | 540 | |||
4583 | 541 | #self.uiManager.get_action("/MenuBar/Settings/enable-monitoring").set_active(app.service.is_running()) | ||
4584 | 542 | #self.uiManager.get_action("/MenuBar/Settings/enable-monitoring").set_sensitive(not app.serviceDisabled) | ||
4585 | 543 | |||
4586 | 544 | rootIter = self.treeView.get_model().get_iter_root() | ||
4587 | 545 | self.treeView.get_selection().select_iter(rootIter) | ||
4588 | 546 | self.on_tree_selection_changed(self.treeView) | ||
4589 | 547 | |||
4590 | 548 | width, height = ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE] | ||
4591 | 549 | self.set_default_size(width, height) | ||
4592 | 550 | self.hpaned.set_position(ConfigManager.SETTINGS[HPANE_POSITION]) | ||
4593 | 551 | |||
4594 | 552 | self.recorder = Recorder(self.scriptPage) | ||
4595 | 553 | |||
4596 | 554 | def __addToolbar(self): | ||
4597 | 555 | toolbar = self.uiManager.get_widget('/Toolbar') | ||
4598 | 556 | self.vbox.pack_end(toolbar, False, False) | ||
4599 | 557 | self.vbox.reorder_child(toolbar, 1) | ||
4600 | 558 | |||
4601 | 559 | def cancel_record(self): | ||
4602 | 560 | if self.uiManager.get_widget("/MenuBar/Edit/record").get_active(): | ||
4603 | 561 | self.uiManager.get_widget("/MenuBar/Edit/record").set_active(False) | ||
4604 | 562 | self.recorder.stop() | ||
4605 | 563 | |||
4606 | 564 | def save_completed(self): | ||
4607 | 565 | self.saveButton.set_sensitive(False) | ||
4608 | 566 | self.uiManager.get_action("/MenuBar/File/save").set_sensitive(False) | ||
4609 | 567 | self.app.config_altered() | ||
4610 | 568 | |||
4611 | 569 | def set_dirty(self, dirty): | ||
4612 | 570 | self.dirty = dirty | ||
4613 | 571 | self.uiManager.get_action("/MenuBar/File/save").set_sensitive(dirty) | ||
4614 | 572 | self.saveButton.set_sensitive(dirty) | ||
4615 | 573 | self.revertButton.set_sensitive(dirty) | ||
4616 | 574 | |||
4617 | 575 | def update_actions(self, items, changed): | ||
4618 | 576 | canCreate = isinstance(items[0], model.Folder) and len(items) == 1 | ||
4619 | 577 | canCopy = True | ||
4620 | 578 | for item in items: | ||
4621 | 579 | if isinstance(item, model.Folder): | ||
4622 | 580 | canCopy = False | ||
4623 | 581 | break | ||
4624 | 582 | |||
4625 | 583 | self.uiManager.get_action("/MenuBar/File/create").set_sensitive(True) | ||
4626 | 584 | self.uiManager.get_action("/MenuBar/File/create/new-top-folder").set_sensitive(True) | ||
4627 | 585 | self.uiManager.get_action("/MenuBar/File/create/new-folder").set_sensitive(canCreate) | ||
4628 | 586 | self.uiManager.get_action("/MenuBar/File/create/new-phrase").set_sensitive(canCreate) | ||
4629 | 587 | self.uiManager.get_action("/MenuBar/File/create/new-script").set_sensitive(canCreate) | ||
4630 | 588 | |||
4631 | 589 | self.uiManager.get_action("/MenuBar/Edit/copy-item").set_sensitive(canCopy) | ||
4632 | 590 | self.uiManager.get_action("/MenuBar/Edit/paste-item").set_sensitive(canCreate and len(self.cutCopiedItems) > 0) | ||
4633 | 591 | self.uiManager.get_action("/MenuBar/Edit/record").set_sensitive(isinstance(items[0], model.Script) and len(items) == 1) | ||
4634 | 592 | |||
4635 | 593 | if changed: | ||
4636 | 594 | self.uiManager.get_action("/MenuBar/File/save").set_sensitive(False) | ||
4637 | 595 | self.saveButton.set_sensitive(False) | ||
4638 | 596 | self.uiManager.get_action("/MenuBar/Edit/undo").set_sensitive(False) | ||
4639 | 597 | self.uiManager.get_action("/MenuBar/Edit/redo").set_sensitive(False) | ||
4640 | 598 | |||
4641 | 599 | def set_undo_available(self, state): | ||
4642 | 600 | self.uiManager.get_action("/MenuBar/Edit/undo").set_sensitive(state) | ||
4643 | 601 | |||
4644 | 602 | def set_redo_available(self, state): | ||
4645 | 603 | self.uiManager.get_action("/MenuBar/Edit/redo").set_sensitive(state) | ||
4646 | 604 | |||
4647 | 605 | def refresh_tree(self): | ||
4648 | 606 | model, selectedPaths = self.treeView.get_selection().get_selected_rows() | ||
4649 | 607 | for path in selectedPaths: | ||
4650 | 608 | model.update_item(model[path].iter, self.__getTreeSelection()) | ||
4651 | 609 | |||
4652 | 610 | # ---- Signal handlers ---- | ||
4653 | 611 | |||
4654 | 612 | def on_save(self, widget, data=None): | ||
4655 | 613 | if self.__getCurrentPage().validate(): | ||
4656 | 614 | self.__getCurrentPage().save() | ||
4657 | 615 | self.save_completed() | ||
4658 | 616 | self.set_dirty(False) | ||
4659 | 617 | |||
4660 | 618 | self.refresh_tree() | ||
4661 | 619 | |||
4662 | 620 | def on_reset(self, widget, data=None): | ||
4663 | 621 | self.__getCurrentPage().reset() | ||
4664 | 622 | self.set_dirty(False) | ||
4665 | 623 | self.cancel_record() | ||
4666 | 624 | |||
4667 | 625 | def queryClose(self): | ||
4668 | 626 | if self.dirty: | ||
4669 | 627 | return self.promptToSave() | ||
4670 | 628 | |||
4671 | 629 | return False | ||
4672 | 630 | |||
4673 | 631 | def on_close(self, widget, data=None): | ||
4674 | 632 | ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE] = self.get_size() | ||
4675 | 633 | ConfigManager.SETTINGS[HPANE_POSITION] = self.hpaned.get_position() | ||
4676 | 634 | self.cancel_record() | ||
4677 | 635 | if self.queryClose(): | ||
4678 | 636 | return True | ||
4679 | 637 | else: | ||
4680 | 638 | self.hide() | ||
4681 | 639 | self.destroy() | ||
4682 | 640 | self.app.configWindow = None | ||
4683 | 641 | self.app.config_altered() | ||
4684 | 642 | |||
4685 | 643 | def on_quit(self, widget, data=None): | ||
4686 | 644 | #if not self.queryClose(): | ||
4687 | 645 | ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE] = self.get_size() | ||
4688 | 646 | ConfigManager.SETTINGS[HPANE_POSITION] = self.hpaned.get_position() | ||
4689 | 647 | self.app.shutdown() | ||
4690 | 648 | |||
4691 | 649 | # File Menu | ||
4692 | 650 | |||
4693 | 651 | def on_new_topfolder(self, widget, data=None): | ||
4694 | 652 | self.__createFolder(None) | ||
4695 | 653 | |||
4696 | 654 | def on_new_folder(self, widget, data=None): | ||
4697 | 655 | theModel, selectedPaths = self.treeView.get_selection().get_selected_rows() | ||
4698 | 656 | parentIter = theModel[selectedPaths[0]].iter | ||
4699 | 657 | self.__createFolder(parentIter) | ||
4700 | 658 | |||
4701 | 659 | def __createFolder(self, parentIter): | ||
4702 | 660 | theModel = self.treeView.get_model() | ||
4703 | 661 | newFolder = model.Folder("New Folder") | ||
4704 | 662 | newIter = theModel.append_item(newFolder, parentIter) | ||
4705 | 663 | self.treeView.expand_to_path(theModel.get_path(newIter)) | ||
4706 | 664 | self.treeView.get_selection().unselect_all() | ||
4707 | 665 | self.treeView.get_selection().select_iter(newIter) | ||
4708 | 666 | self.on_tree_selection_changed(self.treeView) | ||
4709 | 667 | self.on_rename(self.treeView) | ||
4710 | 668 | |||
4711 | 669 | def on_new_phrase(self, widget, data=None): | ||
4712 | 670 | theModel, selectedPaths = self.treeView.get_selection().get_selected_rows() | ||
4713 | 671 | parentIter = theModel[selectedPaths[0]].iter | ||
4714 | 672 | newPhrase = model.Phrase("New Phrase", "Enter phrase contents") | ||
4715 | 673 | newIter = theModel.append_item(newPhrase, parentIter) | ||
4716 | 674 | self.treeView.expand_to_path(theModel.get_path(newIter)) | ||
4717 | 675 | self.treeView.get_selection().unselect_all() | ||
4718 | 676 | self.treeView.get_selection().select_iter(newIter) | ||
4719 | 677 | self.on_tree_selection_changed(self.treeView) | ||
4720 | 678 | self.on_rename(self.treeView) | ||
4721 | 679 | |||
4722 | 680 | def on_new_script(self, widget, data=None): | ||
4723 | 681 | theModel, selectedPaths = self.treeView.get_selection().get_selected_rows() | ||
4724 | 682 | parentIter = theModel[selectedPaths[0]].iter | ||
4725 | 683 | newScript = model.Script("New Script", "# Enter script code") | ||
4726 | 684 | newIter = theModel.append_item(newScript, parentIter) | ||
4727 | 685 | self.treeView.expand_to_path(theModel.get_path(newIter)) | ||
4728 | 686 | self.treeView.get_selection().unselect_all() | ||
4729 | 687 | self.treeView.get_selection().select_iter(newIter) | ||
4730 | 688 | self.on_tree_selection_changed(self.treeView) | ||
4731 | 689 | self.on_rename(self.treeView) | ||
4732 | 690 | |||
4733 | 691 | # Edit Menu | ||
4734 | 692 | |||
4735 | 693 | def on_cut_item(self, widget, data=None): | ||
4736 | 694 | self.cutCopiedItems = self.__getTreeSelection() | ||
4737 | 695 | selection = self.treeView.get_selection() | ||
4738 | 696 | model, selectedPaths = selection.get_selected_rows() | ||
4739 | 697 | refs = [] | ||
4740 | 698 | for path in selectedPaths: | ||
4741 | 699 | refs.append(gtk.TreeRowReference(model, path)) | ||
4742 | 700 | |||
4743 | 701 | for ref in refs: | ||
4744 | 702 | if ref.valid(): | ||
4745 | 703 | self.__removeItem(model, model[ref.get_path()].iter) | ||
4746 | 704 | |||
4747 | 705 | if len(selectedPaths) > 1: | ||
4748 | 706 | self.treeView.get_selection().unselect_all() | ||
4749 | 707 | self.treeView.get_selection().select_iter(model.get_iter_root()) | ||
4750 | 708 | self.on_tree_selection_changed(self.treeView) | ||
4751 | 709 | |||
4752 | 710 | self.app.config_altered() | ||
4753 | 711 | |||
4754 | 712 | def on_copy_item(self, widget, data=None): | ||
4755 | 713 | sourceObjects = self.__getTreeSelection() | ||
4756 | 714 | |||
4757 | 715 | for source in sourceObjects: | ||
4758 | 716 | if isinstance(source, model.Phrase): | ||
4759 | 717 | newObj = model.Phrase('', '') | ||
4760 | 718 | else: | ||
4761 | 719 | newObj = model.Script('', '') | ||
4762 | 720 | newObj.copy(source) | ||
4763 | 721 | self.cutCopiedItems.append(newObj) | ||
4764 | 722 | |||
4765 | 723 | def on_paste_item(self, widget, data=None): | ||
4766 | 724 | theModel, selectedPaths = self.treeView.get_selection().get_selected_rows() | ||
4767 | 725 | parentIter = theModel[selectedPaths[0]].iter | ||
4768 | 726 | |||
4769 | 727 | newIters = [] | ||
4770 | 728 | for item in self.cutCopiedItems: | ||
4771 | 729 | newIter = theModel.append_item(item, parentIter) | ||
4772 | 730 | if isinstance(item, model.Folder): | ||
4773 | 731 | theModel.populate_store(newIter, item) | ||
4774 | 732 | newIters.append(newIter) | ||
4775 | 733 | |||
4776 | 734 | self.treeView.expand_to_path(theModel.get_path(newIters[-1])) | ||
4777 | 735 | self.treeView.get_selection().unselect_all() | ||
4778 | 736 | self.treeView.get_selection().select_iter(newIters[0]) | ||
4779 | 737 | self.cutCopiedItems = [] | ||
4780 | 738 | self.on_tree_selection_changed(self.treeView) | ||
4781 | 739 | for iter in newIters: | ||
4782 | 740 | self.treeView.get_selection().select_iter(iter) | ||
4783 | 741 | self.app.config_altered() | ||
4784 | 742 | |||
4785 | 743 | def on_delete_item(self, widget, data=None): | ||
4786 | 744 | selection = self.treeView.get_selection() | ||
4787 | 745 | model, selectedPaths = selection.get_selected_rows() | ||
4788 | 746 | refs = [] | ||
4789 | 747 | for path in selectedPaths: | ||
4790 | 748 | refs.append(gtk.TreeRowReference(model, path)) | ||
4791 | 749 | |||
4792 | 750 | for ref in refs: | ||
4793 | 751 | if ref.valid(): | ||
4794 | 752 | # Prompt for removal of a folder with phrases | ||
4795 | 753 | item = model[ref.get_path()].iter | ||
4796 | 754 | |||
4797 | 755 | if model.iter_n_children(item) > 0: | ||
4798 | 756 | title = model.get_value(item, AkTreeModel.OBJECT_COLUMN).title | ||
4799 | 757 | dlg = gtk.MessageDialog(self.ui, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, | ||
4800 | 758 | _("Are you sure you want to delete the %s folder and all the items in it?") % title) | ||
4801 | 759 | if dlg.run() == gtk.RESPONSE_YES: | ||
4802 | 760 | self.__removeItem(model, item) | ||
4803 | 761 | dlg.destroy() | ||
4804 | 762 | |||
4805 | 763 | else: | ||
4806 | 764 | self.__removeItem(model, item) | ||
4807 | 765 | |||
4808 | 766 | if len(selectedPaths) > 1: | ||
4809 | 767 | self.treeView.get_selection().unselect_all() | ||
4810 | 768 | self.treeView.get_selection().select_iter(model.get_iter_root()) | ||
4811 | 769 | self.on_tree_selection_changed(self.treeView) | ||
4812 | 770 | |||
4813 | 771 | self.app.config_altered() | ||
4814 | 772 | |||
4815 | 773 | def __removeItem(self, model, item): | ||
4816 | 774 | selection = self.treeView.get_selection() | ||
4817 | 775 | model, selectedPaths = selection.get_selected_rows() | ||
4818 | 776 | newSelectionIter = model.iter_parent(model[selectedPaths[0]].iter) | ||
4819 | 777 | if newSelectionIter is None: | ||
4820 | 778 | newSelectionIter = model.get_iter_root() | ||
4821 | 779 | |||
4822 | 780 | model.remove_item(item) | ||
4823 | 781 | self.treeView.get_selection().select_iter(newSelectionIter) | ||
4824 | 782 | self.on_tree_selection_changed(self.treeView) | ||
4825 | 783 | |||
4826 | 784 | def on_undo(self, widget, data=None): | ||
4827 | 785 | self.__getCurrentPage().undo() | ||
4828 | 786 | |||
4829 | 787 | def on_redo(self, widget, data=None): | ||
4830 | 788 | self.__getCurrentPage().redo() | ||
4831 | 789 | |||
4832 | 790 | def on_record_keystrokes(self, widget, data=None): | ||
4833 | 791 | if widget.get_active(): | ||
4834 | 792 | dlg = RecordDialog(self.ui, self.on_rec_response) | ||
4835 | 793 | dlg.run() | ||
4836 | 794 | else: | ||
4837 | 795 | self.recorder.stop() | ||
4838 | 796 | |||
4839 | 797 | def on_rec_response(self, response, recKb, recMouse, delay): | ||
4840 | 798 | if response == gtk.RESPONSE_OK: | ||
4841 | 799 | self.recorder.set_record_keyboard(recKb) | ||
4842 | 800 | self.recorder.set_record_mouse(recMouse) | ||
4843 | 801 | self.recorder.start(delay) | ||
4844 | 802 | elif response == gtk.RESPONSE_CANCEL: | ||
4845 | 803 | self.uiManager.get_widget("/MenuBar/Edit/record").set_active(False) | ||
4846 | 804 | |||
4847 | 805 | # View Menu | ||
4848 | 806 | |||
4849 | 807 | def on_toggle_toolbar(self, widget, data=None): | ||
4850 | 808 | if widget.get_active(): | ||
4851 | 809 | self.__addToolbar() | ||
4852 | 810 | else: | ||
4853 | 811 | self.vbox.remove(self.uiManager.get_widget('/Toolbar')) | ||
4854 | 812 | |||
4855 | 813 | ConfigManager.SETTINGS[SHOW_TOOLBAR] = widget.get_active() | ||
4856 | 814 | |||
4857 | 815 | def on_show_error(self, widget, data=None): | ||
4858 | 816 | self.app.show_script_error() | ||
4859 | 817 | |||
4860 | 818 | # Settings Menu | ||
4861 | 819 | |||
4862 | 820 | def on_enable_toggled(self, widget, data=None): | ||
4863 | 821 | if widget.get_active(): | ||
4864 | 822 | self.app.unpause_service() | ||
4865 | 823 | else: | ||
4866 | 824 | self.app.pause_service() | ||
4867 | 825 | |||
4868 | 826 | def on_advanced_settings(self, widget, data=None): | ||
4869 | 827 | s = SettingsDialog(self.ui, self.app.configManager) | ||
4870 | 828 | s.show() | ||
4871 | 829 | |||
4872 | 830 | # Help Menu | ||
4873 | 831 | |||
4874 | 832 | def on_show_faq(self, widget, data=None): | ||
4875 | 833 | webbrowser.open(common.FAQ_URL, False, True) | ||
4876 | 834 | |||
4877 | 835 | def on_show_help(self, widget, data=None): | ||
4878 | 836 | webbrowser.open(common.HELP_URL, False, True) | ||
4879 | 837 | |||
4880 | 838 | def on_donate(self, widget, data=None): | ||
4881 | 839 | webbrowser.open(common.DONATE_URL, False, True) | ||
4882 | 840 | |||
4883 | 841 | def on_show_about(self, widget, data=None): | ||
4884 | 842 | dlg = gtk.AboutDialog() | ||
4885 | 843 | dlg.set_name("AutoKey (GTK UI)") | ||
4886 | 844 | dlg.set_comments("A desktop automation utility for Linux and X11.") | ||
4887 | 845 | dlg.set_version(common.VERSION) | ||
4888 | 846 | p = gtk.gdk.pixbuf_new_from_file(common.ICON_FILE) | ||
4889 | 847 | p = p.scale_simple(100, 100, gtk.gdk.INTERP_BILINEAR) | ||
4890 | 848 | dlg.set_logo(p) | ||
4891 | 849 | dlg.set_website(WEBSITE) | ||
4892 | 850 | dlg.set_authors(["Chris Dekter (Developer) <cdekter@gmail.com>", | ||
4893 | 851 | "Sam Peterson (Original developer) <peabodyenator@gmail.com>"]) | ||
4894 | 852 | dlg.run() | ||
4895 | 853 | dlg.destroy() | ||
4896 | 854 | |||
4897 | 855 | # Tree widget | ||
4898 | 856 | |||
4899 | 857 | def on_rename(self, widget, data=None): | ||
4900 | 858 | selection = self.treeView.get_selection() | ||
4901 | 859 | theModel, selectedPaths = selection.get_selected_rows() | ||
4902 | 860 | self.treeView.set_cursor(selectedPaths[0], self.treeView.get_column(0), True) | ||
4903 | 861 | |||
4904 | 862 | def on_treeWidget_row_activated(self, widget, path, viewColumn, data=None): | ||
4905 | 863 | widget.expand_row(path, False) | ||
4906 | 864 | |||
4907 | 865 | def on_treeview_buttonpress(self, widget, event, data=None): | ||
4908 | 866 | return self.dirty | ||
4909 | 867 | |||
4910 | 868 | def on_treeview_buttonrelease(self, widget, event, data=None): | ||
4911 | 869 | if self.promptToSave(): | ||
4912 | 870 | # True result indicates user selected Cancel. Stop event propagation | ||
4913 | 871 | return True | ||
4914 | 872 | else: | ||
4915 | 873 | x = int(event.x) | ||
4916 | 874 | y = int(event.y) | ||
4917 | 875 | time = event.time | ||
4918 | 876 | pthinfo = widget.get_path_at_pos(x, y) | ||
4919 | 877 | if pthinfo is not None: | ||
4920 | 878 | path, col, cellx, celly = pthinfo | ||
4921 | 879 | currentPath, currentCol = widget.get_cursor() | ||
4922 | 880 | if currentPath != path and currentCol != col: | ||
4923 | 881 | widget.set_cursor(path, col, 0) | ||
4924 | 882 | if event.button == 3: | ||
4925 | 883 | self.__popupMenu(event) | ||
4926 | 884 | return False | ||
4927 | 885 | |||
4928 | 886 | def on_tree_selection_changed(self, widget, data=None): | ||
4929 | 887 | selectedObjects = self.__getTreeSelection() | ||
4930 | 888 | if len(selectedObjects) == 1: | ||
4931 | 889 | selectedObject = selectedObjects[0] | ||
4932 | 890 | |||
4933 | 891 | if isinstance(selectedObject, model.Folder): | ||
4934 | 892 | self.stack.set_current_page(0) | ||
4935 | 893 | self.folderPage.load(selectedObject) | ||
4936 | 894 | elif isinstance(selectedObject, model.Phrase): | ||
4937 | 895 | self.stack.set_current_page(1) | ||
4938 | 896 | self.phrasePage.load(selectedObject) | ||
4939 | 897 | else: | ||
4940 | 898 | self.stack.set_current_page(2) | ||
4941 | 899 | self.scriptPage.load(selectedObject) | ||
4942 | 900 | |||
4943 | 901 | self.set_dirty(False) | ||
4944 | 902 | self.cancel_record() | ||
4945 | 903 | self.update_actions(selectedObjects, True) | ||
4946 | 904 | self.selectedObject = selectedObject | ||
4947 | 905 | |||
4948 | 906 | else: | ||
4949 | 907 | self.update_actions(selectedObjects, False) | ||
4950 | 908 | |||
4951 | 909 | def on_drag_data_received(self, treeview, context, x, y, selection, info, etime): | ||
4952 | 910 | selection = self.treeView.get_selection() | ||
4953 | 911 | theModel, sourcePaths = selection.get_selected_rows() | ||
4954 | 912 | drop_info = treeview.get_dest_row_at_pos(x, y) | ||
4955 | 913 | if drop_info: | ||
4956 | 914 | path, position = drop_info | ||
4957 | 915 | targetIter = theModel.get_iter(path) | ||
4958 | 916 | |||
4959 | 917 | sourceModelItems = self.__getTreeSelection() | ||
4960 | 918 | #sourceModelItem = theModel.get_value(sourceIter, AkTreeModel.OBJECT_COLUMN) | ||
4961 | 919 | targetModelItem = theModel.get_value(targetIter, AkTreeModel.OBJECT_COLUMN) | ||
4962 | 920 | |||
4963 | 921 | for path in sourcePaths: | ||
4964 | 922 | self.__removeItem(theModel, theModel[path].iter) | ||
4965 | 923 | |||
4966 | 924 | newIters = [] | ||
4967 | 925 | for item in sourceModelItems: | ||
4968 | 926 | newIter = theModel.append_item(item, targetIter) | ||
4969 | 927 | if isinstance(item, model.Folder): | ||
4970 | 928 | theModel.populate_store(newIter, item) | ||
4971 | 929 | newIters.append(newIter) | ||
4972 | 930 | |||
4973 | 931 | self.treeView.expand_to_path(theModel.get_path(newIters[-1])) | ||
4974 | 932 | selection.unselect_all() | ||
4975 | 933 | for iter in newIters: | ||
4976 | 934 | selection.select_iter(iter) | ||
4977 | 935 | self.on_tree_selection_changed(self.treeView) | ||
4978 | 936 | self.app.config_altered() | ||
4979 | 937 | |||
4980 | 938 | def on_drag_drop(self, widget, drag_context, x, y, timestamp): | ||
4981 | 939 | drop_info = widget.get_dest_row_at_pos(x, y) | ||
4982 | 940 | if drop_info: | ||
4983 | 941 | selection = widget.get_selection() | ||
4984 | 942 | theModel, sourcePaths = selection.get_selected_rows() | ||
4985 | 943 | path, position = drop_info | ||
4986 | 944 | |||
4987 | 945 | if position not in (gtk.TREE_VIEW_DROP_INTO_OR_BEFORE, gtk.TREE_VIEW_DROP_INTO_OR_AFTER): | ||
4988 | 946 | return True | ||
4989 | 947 | |||
4990 | 948 | targetIter = theModel.get_iter(path) | ||
4991 | 949 | targetModelItem = theModel.get_value(targetIter, AkTreeModel.OBJECT_COLUMN) | ||
4992 | 950 | if isinstance(targetModelItem, model.Folder) and path not in sourcePaths: | ||
4993 | 951 | # checking path prevents dropping a folder onto itself | ||
4994 | 952 | return False | ||
4995 | 953 | else: | ||
4996 | 954 | return True | ||
4997 | 955 | |||
4998 | 956 | return True | ||
4999 | 957 | |||
5000 | 958 | def on_cell_modified(self, renderer, path, newText, data=None): |
The diff has been truncated for viewing.