Merge lp:~lfaraone/ubuntu/lucid/autokey/merge0.61.5-1ubuntu1 into lp:ubuntu/lucid/autokey

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
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Review via email: mp+22227@code.launchpad.net
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
=== modified file 'PKG-INFO'
--- PKG-INFO 2010-01-08 08:52:58 +0000
+++ PKG-INFO 2010-03-26 15:01:22 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.01Metadata-Version: 1.0
2Name: autokey2Name: autokey
3Version: 0.61.23Version: 0.61.5
4Summary: Desktop automation utility4Summary: Desktop automation utility
5Home-page: http://autokey.googlecode.com/5Home-page: http://autokey.googlecode.com/
6Author: Chris Dekter6Author: Chris Dekter
77
=== removed file 'autokey'
--- autokey 2009-09-27 15:08:28 +0000
+++ autokey 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import sys
5from autokey.autokey import Application
6
7a = Application()
8try:
9 a.main()
10except KeyboardInterrupt:
11 a.shutdown()
12sys.exit(0)
13
140
=== added file 'autokey-gtk'
--- autokey-gtk 1970-01-01 00:00:00 +0000
+++ autokey-gtk 2010-03-26 15:01:22 +0000
@@ -0,0 +1,13 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import sys
5from autokey.gtkapp import Application
6
7a = Application()
8try:
9 a.main()
10except KeyboardInterrupt:
11 a.shutdown()
12sys.exit(0)
13
014
=== added file 'autokey-qt'
--- autokey-qt 1970-01-01 00:00:00 +0000
+++ autokey-qt 2010-03-26 15:01:22 +0000
@@ -0,0 +1,13 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import sys
5from autokey.qtapp import Application
6
7a = Application()
8try:
9 a.main()
10except KeyboardInterrupt:
11 a.shutdown()
12sys.exit(0)
13
014
=== added file 'config/akicon-status.png'
1Binary files config/akicon-status.png 1970-01-01 00:00:00 +0000 and config/akicon-status.png 2010-03-26 15:01:22 +0000 differ15Binary 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
=== added file 'config/autokey-gtk.desktop'
--- config/autokey-gtk.desktop 1970-01-01 00:00:00 +0000
+++ config/autokey-gtk.desktop 2010-03-26 15:01:22 +0000
@@ -0,0 +1,10 @@
1# $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $
2[Desktop Entry]
3Name=AutoKey (GTK)
4GenericName=Keyboard Automation
5Comment=Program keyboard shortcuts
6Exec=autokey-gtk
7Terminal=false
8Type=Application
9Icon=/usr/share/pixmaps/akicon.png
10Categories=GNOME;Utility;
011
=== added file 'config/autokey-qt.desktop'
--- config/autokey-qt.desktop 1970-01-01 00:00:00 +0000
+++ config/autokey-qt.desktop 2010-03-26 15:01:22 +0000
@@ -0,0 +1,10 @@
1# $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $
2[Desktop Entry]
3Name=AutoKey (QT)
4GenericName=Keyboard Automation
5Comment=Program keyboard shortcuts
6Exec=autokey-qt
7Terminal=false
8Type=Application
9Icon=/usr/share/pixmaps/akicon.png
10Categories=KDE;Utility;
011
=== removed file 'config/autokey.desktop'
--- config/autokey.desktop 2009-09-27 15:08:28 +0000
+++ config/autokey.desktop 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1# $Id: autokey.desktop 22 2008-01-29 11:29:13Z peabody $
2[Desktop Entry]
3Name=AutoKey
4GenericName=Keyboard Automation
5Comment=Program keyboard shortcuts
6Exec=autokey
7Terminal=false
8Type=Application
9Icon=/usr/share/pixmaps/akicon.png
10Categories=GNOME;KDE;Utility
110
=== added file 'debian/autokey-common.init'
--- debian/autokey-common.init 1970-01-01 00:00:00 +0000
+++ debian/autokey-common.init 2010-03-26 15:01:22 +0000
@@ -0,0 +1,150 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4### BEGIN INIT INFO
5# Provides: autokey
6# Required-Start: $local_fs
7# Required-Stop: $local_fs
8# Default-Start: 2 3 4 5
9# Default-Stop: 0 1 6
10# Short-Description: Start AutoKey daemon.
11# Description: Enable AutoKey's EvDev interface daemon.
12### END INIT INFO
13
14import sys, os, socket, glob, shutil, time
15try:
16 from autokey import evdev, daemon
17 from autokey.common import DOMAIN_SOCKET_PATH, PACKET_SIZE
18except ImportError:
19 # Per DPM ยง 9.3.2 script should fail gracefully if not installed.
20 print "It does not seem Autokey is installed. Exiting..."
21 sys.exit(0)
22
23PACKET_STRING = "%s,%s,%s"
24
25BUTTON_MAP = {
26 "BTN_LEFT" : '1',
27 "BTN_MIDDLE": '2',
28 "BTN_RIGHT" : '3'
29 }
30
31class AutoKeyDaemon(daemon.Daemon):
32
33 def __init__(self):
34 logFile = "/var/log/autokey-daemon.log"
35 if os.path.exists(logFile):
36 shutil.move(logFile, logFile + '.old')
37 daemon.Daemon.__init__(self, '/var/run/autokey-daemon.pid', stdout=logFile, stderr=logFile)
38
39 def get_device_paths(self):
40 keyboardLocations = glob.glob("/dev/input/by-path/*-event-kbd")
41 mouseLocations = glob.glob("/dev/input/by-path/*-event-mouse")
42
43 sys.stdout.write("Keyboards: %s\nMice: %s\n" % (repr(keyboardLocations), repr(mouseLocations)))
44 return keyboardLocations + mouseLocations
45
46 def run(self):
47 print "AutoKey daemon starting"
48 if os.path.exists(DOMAIN_SOCKET_PATH):
49 os.remove(DOMAIN_SOCKET_PATH)
50 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
51 s.bind(DOMAIN_SOCKET_PATH)
52 os.chmod(DOMAIN_SOCKET_PATH, 0777)
53 print "Created domain socket"
54
55 while True:
56 time.sleep(5) # sleep 5 seconds, waiting for devices to appear after resume from S3
57 s.listen(1)
58 try:
59 conn, addr = s.accept()
60 print "Accepted connection"
61 except Exception, e:
62 print "Fatal error while accepting connections - daemon shutting down"
63 print str(e)
64 break
65
66 devices = evdev.DeviceGroup(self.get_device_paths())
67 sys.stdout.flush()
68 sys.stderr.flush()
69
70 while True:
71 try:
72 event = devices.next_event()
73 except OSError:
74 print "Unable to read from device(s). Connection will be closed and restarted"
75 break
76
77 if event is not None:
78 if event.type == "EV_KEY" and isinstance(event.code, str):
79 if event.code.startswith("KEY"):
80 # Keyboard event
81 code = event.scanCode
82 button = ''
83 state = event.value
84
85 try:
86 self.send_packet(conn, code, button, state)
87 except:
88 break
89
90 elif event.code.startswith("BTN") and event.value == 1:
91 # Mouse event - only care about button press, not release
92 code = ''
93 if event.code in BUTTON_MAP:
94 button = BUTTON_MAP[event.code]
95 else:
96 button = -1
97 state = event.value
98
99 try:
100 self.send_packet(conn, code, button, state)
101 except:
102 break
103
104 conn.close()
105 devices.close()
106 print "Connection closed"
107 sys.stdout.flush()
108 sys.stderr.flush()
109
110 def send_packet(self, conn, code, button, state):
111 if code:
112 code = self.translate_keycode(code)
113 sendData = PACKET_STRING % (code, button, state)
114 sendData += (PACKET_SIZE - len(sendData)) * ' '
115 conn.send(sendData)
116
117 def translate_keycode(self, keyCode):
118 if keyCode < 151:
119 keyCode += 8
120 else:
121 print "Got untranslatable evdev keycode: %d\n" % keyCode
122 keyCode = 0
123 return keyCode
124
125
126if __name__ == "__main__":
127 #daemon = AutoKeyDaemon('/tmp/autokey-daemon.pid', stdout=sys.__stdout__, stderr=sys.__stderr__)
128 daemon = AutoKeyDaemon()
129 if len(sys.argv) == 2:
130 if 'start' == sys.argv[1]:
131 daemon.start()
132 elif 'stop' == sys.argv[1]:
133 daemon.stop()
134 elif 'restart' == sys.argv[1]:
135 daemon.restart()
136 elif 'force-reload' == sys.argv[1]:
137 # we don't support on-the-fly reloading,
138 # so just restart the daemon per DPM 9.3.2
139 daemon.restart()
140 else:
141 print "Unknown command"
142 sys.exit(2)
143 sys.exit(0)
144 else:
145 print "usage: %s {start|stop|restart|force-reload}" % sys.argv[0]
146 sys.exit(2)
147
148 sys.exit(0)
149
150
0151
=== added file 'debian/autokey-common.install'
--- debian/autokey-common.install 1970-01-01 00:00:00 +0000
+++ debian/autokey-common.install 2010-03-26 15:01:22 +0000
@@ -0,0 +1,13 @@
1usr/lib/python*/*-packages/autokey/common.py
2usr/lib/python*/*-packages/autokey/configmanager.py
3usr/lib/python*/*-packages/autokey/daemon.py
4usr/lib/python*/*-packages/autokey/evdev.py
5usr/lib/python*/*-packages/autokey/__init__.py
6usr/lib/python*/*-packages/autokey/interface.py
7usr/lib/python*/*-packages/autokey/iomediator.py
8usr/lib/python*/*-packages/autokey/model.py
9usr/lib/python*/*-packages/autokey/nogui.py
10usr/lib/python*/*-packages/autokey/scripting.py
11usr/lib/python*/*-packages/autokey/service.py
12usr/lib/python*/*-packages/autokey-*.egg-info
13usr/share/pixmaps/akicon.png
014
=== added file 'debian/autokey-common.lintian-overrides'
--- debian/autokey-common.lintian-overrides 1970-01-01 00:00:00 +0000
+++ debian/autokey-common.lintian-overrides 2010-03-26 15:01:22 +0000
@@ -0,0 +1,1 @@
1autokey-common binary: init.d-script-uses-usr-interpreter
02
=== added file 'debian/autokey-common.postinst'
--- debian/autokey-common.postinst 1970-01-01 00:00:00 +0000
+++ debian/autokey-common.postinst 2010-03-26 15:01:22 +0000
@@ -0,0 +1,41 @@
1#!/bin/sh
2# postinst script for test
3#
4# see: dh_installdeb(1)
5
6set -e
7
8
9# We need python-support triggers activated before we start the daemon.
10update-python-modules -p
11
12# summary of how this script can be called:
13# * <postinst> `configure' <most-recently-configured-version>
14# * <old-postinst> `abort-upgrade' <new version>
15# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
16# <new-version>
17# * <postinst> `abort-remove'
18# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
19# <failed-install-package> <version> `removing'
20# <conflicting-package> <version>
21# for details, see http://www.debian.org/doc/debian-policy/ or
22# the debian-policy package
23
24
25# dh_installdeb will replace this with shell code automatically
26# generated by other debhelper scripts.
27
28#DEBHELPER#
29
30# Automatically added by dh_installinit
31if [ -x "/etc/init.d/autokey" ]; then
32 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
33 invoke-rc.d autokey start || exit $?
34 else
35 /etc/init.d/autokey start || exit $?
36 fi
37fi
38# End automatically added section
39
40
41exit 0
042
=== added file 'debian/autokey-common.prerm'
--- debian/autokey-common.prerm 1970-01-01 00:00:00 +0000
+++ debian/autokey-common.prerm 2010-03-26 15:01:22 +0000
@@ -0,0 +1,34 @@
1#!/bin/sh
2# prerm script for test
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <prerm> `remove'
10# * <old-prerm> `upgrade' <new-version>
11# * <new-prerm> `failed-upgrade' <old-version>
12# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
13# * <deconfigured's-prerm> `deconfigure' `in-favour'
14# <package-being-installed> <version> `removing'
15# <conflicting-package> <version>
16# for details, see http://www.debian.org/doc/debian-policy/ or
17# the debian-policy package
18
19# Automatically added by dh_installinit
20if [ -x "/etc/init.d/autokey" ]; then
21 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
22 invoke-rc.d autokey stop || exit $?
23 else
24 /etc/init.d/autokey stop || exit $?
25 fi
26fi
27# End automatically added section
28
29# dh_installdeb will replace this with shell code automatically
30# generated by other debhelper scripts.
31
32#DEBHELPER#
33
34exit 0
035
=== added file 'debian/autokey-gtk.install'
--- debian/autokey-gtk.install 1970-01-01 00:00:00 +0000
+++ debian/autokey-gtk.install 2010-03-26 15:01:22 +0000
@@ -0,0 +1,6 @@
1usr/lib/python*/*-packages/autokey/gtkui/
2usr/lib/python*/*-packages/autokey/gtkapp.py
3usr/bin/autokey-gtk
4usr/share/applications/autokey-gtk.desktop
5usr/share/man/man1/autokey-gtk.1
6usr/share/pixmaps/akicon-status.png
0\ No newline at end of file7\ No newline at end of file
18
=== added file 'debian/autokey-gtk.postinst'
--- debian/autokey-gtk.postinst 1970-01-01 00:00:00 +0000
+++ debian/autokey-gtk.postinst 2010-03-26 15:01:22 +0000
@@ -0,0 +1,9 @@
1#!/bin/sh -e
2
3update-alternatives --install /usr/bin/autokey autokey \
4 /usr/bin/autokey-gtk 50 \
5 --slave /usr/share/man/man1/autokey.1.gz autokey.1.gz \
6 /usr/share/man/man1/autokey-gtk.1.gz
7
8#DEBHELPER#
9
010
=== added file 'debian/autokey-gtk.prerm'
--- debian/autokey-gtk.prerm 1970-01-01 00:00:00 +0000
+++ debian/autokey-gtk.prerm 2010-03-26 15:01:22 +0000
@@ -0,0 +1,12 @@
1#!/bin/sh -e
2
3case "$1" in
4 remove|deconfigure)
5 update-alternatives --remove autokey /usr/bin/autokey-gtk
6 ;;
7esac
8
9#DEBHELPER#
10
11exit 0
12
013
=== added file 'debian/autokey-qt.install'
--- debian/autokey-qt.install 1970-01-01 00:00:00 +0000
+++ debian/autokey-qt.install 2010-03-26 15:01:22 +0000
@@ -0,0 +1,5 @@
1usr/lib/python*/*-packages/autokey/qtui/
2usr/lib/python*/*-packages/autokey/qtapp.py
3usr/bin/autokey-qt
4usr/share/applications/autokey-qt.desktop
5usr/share/man/man1/autokey-qt.1
06
=== added file 'debian/autokey-qt.postinst'
--- debian/autokey-qt.postinst 1970-01-01 00:00:00 +0000
+++ debian/autokey-qt.postinst 2010-03-26 15:01:22 +0000
@@ -0,0 +1,9 @@
1#!/bin/sh -e
2
3update-alternatives --install /usr/bin/autokey autokey \
4 /usr/bin/autokey-qt 60 \
5 --slave /usr/share/man/man1/autokey.1.gz autokey.1.gz \
6 /usr/share/man/man1/autokey-qt.1.gz
7
8#DEBHELPER#
9
010
=== added file 'debian/autokey-qt.prerm'
--- debian/autokey-qt.prerm 1970-01-01 00:00:00 +0000
+++ debian/autokey-qt.prerm 2010-03-26 15:01:22 +0000
@@ -0,0 +1,12 @@
1#!/bin/sh -e
2
3case "$1" in
4 remove|deconfigure)
5 update-alternatives --remove autokey /usr/bin/autokey-qt
6 ;;
7esac
8
9#DEBHELPER#
10
11exit 0
12
013
=== removed file 'debian/autokey.1'
--- debian/autokey.1 2009-09-27 15:08:28 +0000
+++ debian/autokey.1 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1.\" Hey, EMACS: -*- nroff -*-
2.\" First parameter, NAME, should be all caps
3.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4.\" other parameters are allowed: see man(7), man(1)
5.TH AUTOKEY "1" "August 19, 2009"
6.\" Please adjust this date whenever revising the manpage.
7.\"
8.\" Some roff macros, for reference:
9.\" .nh disable hyphenation
10.\" .hy enable hyphenation
11.\" .ad l left justify
12.\" .ad b justify to both left and right margins
13.\" .nf disable filling
14.\" .fi enable filling
15.\" .br insert line break
16.\" .sp <n> insert n+1 empty lines
17.\" for manpage-specific macros, see man(7)
18.SH NAME
19autokey \- keyboard automation utility
20.SH SYNOPSIS
21.B autokey
22.RI [ options ]
23.SH DESCRIPTION
24This manual page briefly documents the
25.B autokey
26command.
27.PP
28.\" TeX users may be more comfortable with the \fB<whatever>\fP and
29.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
30.\" respectively.
31\fBautokey\fP AutoKey is a desktop automation utility for Linux and X11. It allows
32the automation of virtually any task by responding to typed abbreviations and hotkeys. It
33offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting
34interface offering the full flexibility and power of the Python language.
35.br
36For more information refer to the online wiki at:
37 http://code.google.com/p/autokey/w/list
38.SH OPTIONS
39This program follows the usual GNU command line syntax, with long
40options starting with two dashes (`-').
41A summary of options is included below.
42.TP
43.B \-\-help
44Show summary of options.
45.TP
46.B \-l, \-\-verbose
47Enable verbose (debug) logging.
48.TP
49.B \-c, \-\-configure
50Show the configuration window on startup, even if this is not the first run.
51.SH AUTHOR
52AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson.
53.PP
54This manual page was written by Chris Dekter <cdekter@gmail.com>.
550
=== removed file 'debian/autokey.init'
--- debian/autokey.init 2010-01-08 08:52:58 +0000
+++ debian/autokey.init 1970-01-01 00:00:00 +0000
@@ -1,145 +0,0 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4### BEGIN INIT INFO
5# Provides: autokey
6# Required-Start: $local_fs
7# Required-Stop: $local_fs
8# Default-Start: 2 3 4 5
9# Default-Stop: 0 1 6
10# Short-Description: Start AutoKey daemon.
11# Description: Enable AutoKey's EvDev interface daemon.
12### END INIT INFO
13
14import sys, os, socket, glob, shutil, time
15from autokey import evdev, daemon
16from autokey.interface import DOMAIN_SOCKET_PATH, PACKET_SIZE
17
18PACKET_STRING = "%s,%s,%s"
19
20BUTTON_MAP = {
21 "BTN_LEFT" : '1',
22 "BTN_MIDDLE": '2',
23 "BTN_RIGHT" : '3'
24 }
25
26class AutoKeyDaemon(daemon.Daemon):
27
28 def __init__(self):
29 logFile = "/var/log/autokey-daemon.log"
30 if os.path.exists(logFile):
31 shutil.move(logFile, logFile + '.old')
32 daemon.Daemon.__init__(self, '/tmp/autokey-daemon.pid', stdout=logFile, stderr=logFile)
33
34 def get_device_paths(self):
35 keyboardLocations = glob.glob("/dev/input/by-path/*-event-kbd")
36 mouseLocations = glob.glob("/dev/input/by-path/*-event-mouse")
37
38 sys.stdout.write("Keyboards: %s\nMice: %s\n" % (repr(keyboardLocations), repr(mouseLocations)))
39 return keyboardLocations + mouseLocations
40
41 def run(self):
42 print "AutoKey daemon starting"
43 if os.path.exists(DOMAIN_SOCKET_PATH):
44 os.remove(DOMAIN_SOCKET_PATH)
45 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
46 s.bind(DOMAIN_SOCKET_PATH)
47 os.chmod(DOMAIN_SOCKET_PATH, 0777)
48 print "Created domain socket"
49
50 while True:
51 time.sleep(5) # sleep 5 seconds, waiting for devices to appear after resume from S3
52 s.listen(1)
53 try:
54 conn, addr = s.accept()
55 print "Accepted connection"
56 except Exception, e:
57 print "Fatal error while accepting connections - daemon shutting down"
58 print str(e)
59 break
60
61 devices = evdev.DeviceGroup(self.get_device_paths())
62 sys.stdout.flush()
63 sys.stderr.flush()
64
65 while True:
66 try:
67 event = devices.next_event()
68 except OSError:
69 print "Unable to read from device(s). Connection will be closed and restarted"
70 break
71
72 if event is not None:
73 if event.type == "EV_KEY" and isinstance(event.code, str):
74 if event.code.startswith("KEY"):
75 # Keyboard event
76 code = event.scanCode
77 button = ''
78 state = event.value
79
80 try:
81 self.send_packet(conn, code, button, state)
82 except:
83 break
84
85 elif event.code.startswith("BTN") and event.value == 1:
86 # Mouse event - only care about button press, not release
87 code = ''
88 if event.code in BUTTON_MAP:
89 button = BUTTON_MAP[event.code]
90 else:
91 button = -1
92 state = event.value
93
94 try:
95 self.send_packet(conn, code, button, state)
96 except:
97 break
98
99 conn.close()
100 devices.close()
101 print "Connection closed"
102 sys.stdout.flush()
103 sys.stderr.flush()
104
105 def send_packet(self, conn, code, button, state):
106 if code:
107 code = self.translate_keycode(code)
108 sendData = PACKET_STRING % (code, button, state)
109 sendData += (PACKET_SIZE - len(sendData)) * ' '
110 conn.send(sendData)
111
112 def translate_keycode(self, keyCode):
113 if keyCode < 151:
114 keyCode += 8
115 else:
116 print "Got untranslatable evdev keycode: %d\n" % keyCode
117 keyCode = 0
118 return keyCode
119
120
121if __name__ == "__main__":
122 #daemon = AutoKeyDaemon('/tmp/autokey-daemon.pid', stdout=sys.__stdout__, stderr=sys.__stderr__)
123 daemon = AutoKeyDaemon()
124 if len(sys.argv) == 2:
125 if 'start' == sys.argv[1]:
126 daemon.start()
127 elif 'stop' == sys.argv[1]:
128 daemon.stop()
129 elif 'restart' == sys.argv[1]:
130 daemon.restart()
131 elif 'force-reload' == sys.argv[1]:
132 # we don't support on-the-fly reloading,
133 # so just restart the daemon per DPM 9.3.2
134 daemon.restart()
135 else:
136 print "Unknown command"
137 sys.exit(2)
138 sys.exit(0)
139 else:
140 print "usage: %s {start|stop|restart|force-reload}" % sys.argv[0]
141 sys.exit(2)
142
143 sys.exit(0)
144
145
1460
=== removed file 'debian/autokey.lintian-overrides'
--- debian/autokey.lintian-overrides 2009-07-20 23:19:40 +0000
+++ debian/autokey.lintian-overrides 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1autokey binary: init.d-script-uses-usr-interpreter
20
=== modified file 'debian/changelog'
--- debian/changelog 2010-01-08 08:52:58 +0000
+++ debian/changelog 2010-03-26 15:01:22 +0000
@@ -1,3 +1,48 @@
1autokey (0.61.5-1ubuntu1) lucid; urgency=low
2
3 * Make "autokey" a transitional package for autokey-gtk rather than -qt.
4
5 -- Luke Faraone <luke@faraone.cc> Wed, 24 Mar 2010 22:06:35 -0400
6
7autokey (0.61.5-1) unstable; urgency=low
8
9 * New upstream version:
10 - Combine GTK and QT versions into single source tree
11 * Provide "autokey" as a transitional package to autokey-common and autokey-qt
12 * debian/autokey-common.postinst: call `update-python-modules -p` so that
13 starting the daemon does not fail if qt4 was not fully configured.
14 (LP: #543654)
15
16 -- Luke Faraone <luke@faraone.cc> Tue, 23 Mar 2010 10:19:47 -0400
17
18autokey (0.61.3-2) unstable; urgency=high
19
20 * SECURITY UPDATE: arbitrary file overwriting via symlinks (LP: #538471)
21 - Store files for the EvDev daamon in FHS-specified locations
22 - debian/autokey.init: Set pidfile path to '/var/run/autokey-daemon.pid'
23 - src/lib/interface.py: Set DOMAIN_SOCKET_PATH to "/var/run/autokey-daemon"
24 - CVE-2010-0398
25
26 -- Luke Faraone <luke@faraone.cc> Sat, 13 Mar 2010 22:25:44 -0500
27
28autokey (0.61.3-1) unstable; urgency=low
29
30 * debian/rules: call dh_installinit with --error-handler so that install
31 doesn't fail if Autokey cannot be restarted during configure (LP: #479131)
32 * New upstream version:
33 - Merge changes to interface.py from GTK branch that were missed
34
35 -- Luke Faraone <luke@faraone.cc> Sat, 27 Feb 2010 11:05:08 -0500
36
37autokey (0.61.2-2) unstable; urgency=low
38
39 * Set DM-Upload-Allowed to Yes in control
40 * Patch src/lib/daemon.py to handle empty or invalid PIDs (closes: #568070)
41 * Fix typo in Vcs-Browser
42 * Bump standards version
43
44 -- Luke Faraone <luke@faraone.cc> Wed, 03 Feb 2010 09:16:24 -0500
45
1autokey (0.61.2-1) unstable; urgency=low46autokey (0.61.2-1) unstable; urgency=low
247
3 * New upstream version: 48 * New upstream version:
449
=== modified file 'debian/compat'
--- debian/compat 2009-07-20 23:19:40 +0000
+++ debian/compat 2010-03-26 15:01:22 +0000
@@ -1,1 +1,1 @@
1617
22
=== modified file 'debian/control'
--- debian/control 2009-12-16 08:46:43 +0000
+++ debian/control 2010-03-26 15:01:22 +0000
@@ -1,23 +1,68 @@
1Source: autokey1Source: autokey
2Section: kde
3Priority: optional2Priority: optional
4Maintainer: Luke Faraone <luke@faraone.cc>3Section: utils
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Luke Faraone <luke@faraone.cc>
5Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>6Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
6Build-Depends: python (>= 2.5), cdbs (>= 0.4.49), debhelper (>= 6), dpatch7Build-Depends: python (>= 2.5), cdbs (>= 0.4.49), debhelper (>= 7)
7Build-Depends-indep: python-central (>= 0.6.0)8Build-Depends-indep: python-central, dpatch
8Standards-Version: 3.8.39Standards-Version: 3.8.4
10DM-Upload-Allowed: yes
9XS-Python-Version: >= 2.511XS-Python-Version: >= 2.5
10Homepage: http://code.google.com/p/autokey/12Homepage: http://code.google.com/p/autokey/
11Vcs-Svn: svn://svn.debian.org/python-apps/packages/autokey/trunk13Vcs-Svn: svn://svn.debian.org/python-apps/packages/autokey/trunk
12Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/autokeyp/trunk/14Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/autokey/trunk/
1315
14Package: autokey16Package: autokey
15Architecture: all17Architecture: all
16Depends: ${python:Depends}, ${misc:Depends}, python-kde4, python-qt4, python-qscintilla2, python-xlib, wmctrl18Depends: ${misc:Depends}, autokey-gtk, autokey-common
17XB-Python-Version: ${python:Versions}19Description: dummy transitional package for autokey-gtk
18Description: desktop automation utility20 This transitional package helps users transition to the autokey-gtk package.
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.
20 automation of virtually any task by responding to typed abbreviations and 22
21 hotkeys. It offers a full-featured GUI that makes it highly accessible for 23Package: autokey-common
22 novices, as well as a scripting interface offering the full flexibility and 24Architecture: all
23 power of the Python language.25Depends: ${python:Depends}, ${misc:Depends}, python-xlib, wmctrl
26Replaces: autokey (<<0.61.4-0~0)
27Breaks: autokey (<<0.61.4-0~0)
28XB-Python-Version: ${python:Versions}
29Description: desktop automation utility - common data
30 AutoKey is a desktop automation utility for Linux and X11. It allows the
31 automation of virtually any task by responding to typed abbreviations and
32 hotkeys. It offers a full-featured GUI that makes it highly accessible for
33 novices, as well as a scripting interface offering the full flexibility and
34 power of the Python language.
35 .
36 This package contains the common data shared between the various frontends.
37
38Package: autokey-qt
39Section: kde
40Architecture: all
41Depends: ${python:Depends}, ${misc:Depends}, python-kde4, python-qt4, python-qscintilla2, python-xlib, wmctrl, autokey-common
42Replaces: autokey (<<0.61.4-0~0)
43Breaks: autokey (<<0.61.4-0~0)
44XB-Python-Version: ${python:Versions}
45Description: desktop automation utility - QT version
46 AutoKey is a desktop automation utility for Linux and X11. It allows the
47 automation of virtually any task by responding to typed abbreviations and
48 hotkeys. It offers a full-featured GUI that makes it highly accessible for
49 novices, as well as a scripting interface offering the full flexibility and
50 power of the Python language.
51 .
52 This package contains the QT frontend.
53
54Package: autokey-gtk
55Section: gnome
56Architecture: all
57Depends: ${python:Depends}, ${misc:Depends}, python-gtk2, python-gtksourceview2, python-glade2, python-xlib, python-notify, wmctrl, autokey-common
58Replaces: autokey (<<0.61.4-0~0)
59Breaks: autokey (<<0.61.4-0~0)
60XB-Python-Version: ${python:Versions}
61Description: desktop automation utility - GTK+ version
62 AutoKey is a desktop automation utility for Linux and X11. It allows the
63 automation of virtually any task by responding to typed abbreviations and
64 hotkeys. It offers a full-featured GUI that makes it highly accessible for
65 novices, as well as a scripting interface offering the full flexibility and
66 power of the Python language.
67 .
68 This package contains the GTK+ frontend.
2469
=== modified file 'debian/copyright'
--- debian/copyright 2009-09-27 15:08:28 +0000
+++ debian/copyright 2010-03-26 15:01:22 +0000
@@ -34,6 +34,6 @@
34The Debian packaging is 34The Debian packaging is
3535
36 Copyright ยฉ 2009, Chris Dekter <cdekter@gmail.com> 36 Copyright ยฉ 2009, Chris Dekter <cdekter@gmail.com>
37 Copyright ยฉ 2009, Luke Faraone <luke@faraone.cc>37 Copyright ยฉ 2009 - 2010, Luke Faraone <luke@faraone.cc>
3838
39and is licensed under the GPL, see above.39and is licensed under the GPL, see above.
4040
=== modified file 'debian/patches/00list'
--- debian/patches/00list 2009-12-16 08:46:43 +0000
+++ debian/patches/00list 2010-03-26 15:01:22 +0000
@@ -1,2 +1,1 @@
1# no comment1# no comment
2
32
=== added file 'debian/patches/README'
--- debian/patches/README 1970-01-01 00:00:00 +0000
+++ debian/patches/README 2010-03-26 15:01:22 +0000
@@ -0,0 +1,4 @@
10xxx: Grabbed from upstream development.
21xxx: Possibly relevant for upstream adoption.
32xxx: Only relevant for official Debian release.
4
05
=== removed file 'debian/postinst'
--- debian/postinst 2009-07-20 23:19:40 +0000
+++ debian/postinst 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1#!/bin/sh
2# postinst script for test
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <postinst> `configure' <most-recently-configured-version>
10# * <old-postinst> `abort-upgrade' <new version>
11# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12# <new-version>
13# * <postinst> `abort-remove'
14# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15# <failed-install-package> <version> `removing'
16# <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20
21# dh_installdeb will replace this with shell code automatically
22# generated by other debhelper scripts.
23
24#DEBHELPER#
25
26# Automatically added by dh_installinit
27if [ -x "/etc/init.d/autokey" ]; then
28 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
29 invoke-rc.d autokey start || exit $?
30 else
31 /etc/init.d/autokey start || exit $?
32 fi
33fi
34# End automatically added section
35
36
37exit 0
380
=== removed file 'debian/prerm'
--- debian/prerm 2009-07-20 23:19:40 +0000
+++ debian/prerm 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1#!/bin/sh
2# prerm script for test
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <prerm> `remove'
10# * <old-prerm> `upgrade' <new-version>
11# * <new-prerm> `failed-upgrade' <old-version>
12# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
13# * <deconfigured's-prerm> `deconfigure' `in-favour'
14# <package-being-installed> <version> `removing'
15# <conflicting-package> <version>
16# for details, see http://www.debian.org/doc/debian-policy/ or
17# the debian-policy package
18
19# Automatically added by dh_installinit
20if [ -x "/etc/init.d/autokey" ]; then
21 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
22 invoke-rc.d autokey stop || exit $?
23 else
24 /etc/init.d/autokey stop || exit $?
25 fi
26fi
27# End automatically added section
28
29# dh_installdeb will replace this with shell code automatically
30# generated by other debhelper scripts.
31
32#DEBHELPER#
33
34exit 0
350
=== modified file 'debian/rules'
--- debian/rules 2009-12-06 14:21:22 +0000
+++ debian/rules 2010-03-26 15:01:22 +0000
@@ -5,11 +5,8 @@
5include /usr/share/cdbs/1/rules/debhelper.mk5include /usr/share/cdbs/1/rules/debhelper.mk
6include /usr/share/cdbs/1/class/python-distutils.mk6include /usr/share/cdbs/1/class/python-distutils.mk
77
8include /usr/share/cdbs/1/rules/dpatch.mk
9# needed to use the dpatch tools (like dpatch-edit-patch)
10include /usr/share/dpatch/dpatch.make
118
12# Add here any variable or target overrides you need.9# Add here any variable or target overrides you need.
13DEB_INSTALL_MANPAGES_autokey = debian/autokey.110DEB_INSTALL_MANPAGES_autokey_qt = debian/autokey-qt.1
14DEB_DH_INSTALLINIT_ARGS := --no-start11DEB_INSTALL_MANPAGES_autokey_gtk = debian/autokey-gtk.1
1512DEB_DH_INSTALLINIT_ARGS := --no-start --init-script=autokey --error-handler=true
1613
=== added directory 'doc/man'
=== added file 'doc/man/autokey-gtk.1'
--- doc/man/autokey-gtk.1 1970-01-01 00:00:00 +0000
+++ doc/man/autokey-gtk.1 2010-03-26 15:01:22 +0000
@@ -0,0 +1,54 @@
1.\" Hey, EMACS: -*- nroff -*-
2.\" First parameter, NAME, should be all caps
3.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4.\" other parameters are allowed: see man(7), man(1)
5.TH AUTOKEY-GTK "1" "August 19, 2009"
6.\" Please adjust this date whenever revising the manpage.
7.\"
8.\" Some roff macros, for reference:
9.\" .nh disable hyphenation
10.\" .hy enable hyphenation
11.\" .ad l left justify
12.\" .ad b justify to both left and right margins
13.\" .nf disable filling
14.\" .fi enable filling
15.\" .br insert line break
16.\" .sp <n> insert n+1 empty lines
17.\" for manpage-specific macros, see man(7)
18.SH NAME
19autokey-gtk \- keyboard automation utility for GNOME and GTK
20.SH SYNOPSIS
21.B autokey-gtk
22.RI [ options ]
23.SH DESCRIPTION
24This manual page briefly documents the
25.B autokey-gtk
26command.
27.PP
28.\" TeX users may be more comfortable with the \fB<whatever>\fP and
29.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
30.\" respectively.
31\fBautokey-gtk\fP AutoKey is a desktop automation utility for Linux and X11. It allows
32the automation of virtually any task by responding to typed abbreviations and hotkeys. It
33offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting
34interface offering the full flexibility and power of the Python language.
35.br
36For more information refer to the online wiki at:
37 http://code.google.com/p/autokey/w/list
38.SH OPTIONS
39This program follows the usual GNU command line syntax, with long
40options starting with two dashes (`-').
41A summary of options is included below.
42.TP
43.B \-\-help
44Show summary of options.
45.TP
46.B \-l, \-\-verbose
47Enable verbose (debug) logging.
48.TP
49.B \-c, \-\-configure
50Show the configuration window on startup, even if this is not the first run.
51.SH AUTHOR
52AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson.
53.PP
54This manual page was written by Chris Dekter <cdekter@gmail.com>.
055
=== added file 'doc/man/autokey-qt.1'
--- doc/man/autokey-qt.1 1970-01-01 00:00:00 +0000
+++ doc/man/autokey-qt.1 2010-03-26 15:01:22 +0000
@@ -0,0 +1,54 @@
1.\" Hey, EMACS: -*- nroff -*-
2.\" First parameter, NAME, should be all caps
3.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4.\" other parameters are allowed: see man(7), man(1)
5.TH AUTOKEY-QT "1" "August 19, 2009"
6.\" Please adjust this date whenever revising the manpage.
7.\"
8.\" Some roff macros, for reference:
9.\" .nh disable hyphenation
10.\" .hy enable hyphenation
11.\" .ad l left justify
12.\" .ad b justify to both left and right margins
13.\" .nf disable filling
14.\" .fi enable filling
15.\" .br insert line break
16.\" .sp <n> insert n+1 empty lines
17.\" for manpage-specific macros, see man(7)
18.SH NAME
19autokey-qt \- keyboard automation utility for KDE and QT
20.SH SYNOPSIS
21.B autokey-qt
22.RI [ options ]
23.SH DESCRIPTION
24This manual page briefly documents the
25.B autokey-qt
26command.
27.PP
28.\" TeX users may be more comfortable with the \fB<whatever>\fP and
29.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
30.\" respectively.
31\fBautokey-qt\fP AutoKey is a desktop automation utility for Linux and X11. It allows
32the automation of virtually any task by responding to typed abbreviations and hotkeys. It
33offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting
34interface offering the full flexibility and power of the Python language.
35.br
36For more information refer to the online wiki at:
37 http://code.google.com/p/autokey/w/list
38.SH OPTIONS
39This program follows the usual GNU command line syntax, with long
40options starting with two dashes (`-').
41A summary of options is included below.
42.TP
43.B \-\-help
44Show summary of options.
45.TP
46.B \-l, \-\-verbose
47Enable verbose (debug) logging.
48.TP
49.B \-c, \-\-configure
50Show the configuration window on startup, even if this is not the first run.
51.SH AUTHOR
52AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson.
53.PP
54This manual page was written by Chris Dekter <cdekter@gmail.com>.
055
=== added directory 'glade'
=== added file 'glade/abbrselector.glade'
--- glade/abbrselector.glade 1970-01-01 00:00:00 +0000
+++ glade/abbrselector.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,45 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Wed Sep 2 16:40:47 2009 -->
4<glade-interface>
5 <widget class="GtkDialog" id="abbrselector">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">Enter Abbreviation</property>
8 <property name="resizable">False</property>
9 <property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
10 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
11 <property name="has_separator">False</property>
12 <signal name="hide" handler="on_close"/>
13 <child internal-child="vbox">
14 <widget class="GtkVBox" id="dialog-vbox1">
15 <property name="visible">True</property>
16 <property name="spacing">2</property>
17 <child>
18 <widget class="GtkVBox" id="vbox1">
19 <property name="visible">True</property>
20 <child>
21 <widget class="GtkEntry" id="entry">
22 <property name="visible">True</property>
23 <property name="can_focus">True</property>
24 <signal name="activate" handler="on_entry_activated"/>
25 </widget>
26 </child>
27 </widget>
28 <packing>
29 <property name="position">1</property>
30 </packing>
31 </child>
32 <child internal-child="action_area">
33 <widget class="GtkHButtonBox" id="dialog-action_area1">
34 <property name="visible">True</property>
35 <property name="layout_style">GTK_BUTTONBOX_END</property>
36 </widget>
37 <packing>
38 <property name="expand">False</property>
39 <property name="pack_type">GTK_PACK_END</property>
40 </packing>
41 </child>
42 </widget>
43 </child>
44 </widget>
45</glade-interface>
046
=== added file 'glade/abbrsettings.glade'
--- glade/abbrsettings.glade 1970-01-01 00:00:00 +0000
+++ glade/abbrsettings.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,189 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Fri Oct 2 11:21:20 2009 -->
4<glade-interface>
5 <widget class="GtkDialog" id="abbrsettings">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">Set Abbreviation</property>
8 <property name="resizable">False</property>
9 <property name="modal">True</property>
10 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12 <signal name="response" handler="on_response"/>
13 <child internal-child="vbox">
14 <widget class="GtkVBox" id="dialog-vbox1">
15 <property name="visible">True</property>
16 <property name="spacing">2</property>
17 <child>
18 <widget class="GtkVBox" id="vbox1">
19 <property name="visible">True</property>
20 <child>
21 <widget class="GtkHBox" id="hbox1">
22 <property name="visible">True</property>
23 <child>
24 <widget class="GtkLabel" id="label1">
25 <property name="visible">True</property>
26 <property name="label" translatable="yes">Abbreviation:</property>
27 </widget>
28 <packing>
29 <property name="padding">5</property>
30 </packing>
31 </child>
32 <child>
33 <widget class="GtkEntry" id="abbrEntry">
34 <property name="visible">True</property>
35 <property name="can_focus">True</property>
36 <property name="is_focus">True</property>
37 <property name="activates_default">True</property>
38 </widget>
39 <packing>
40 <property name="padding">5</property>
41 <property name="position">1</property>
42 </packing>
43 </child>
44 <child>
45 <widget class="GtkLabel" id="label2">
46 <property name="visible">True</property>
47 <property name="label" translatable="yes">Trigger on:</property>
48 </widget>
49 <packing>
50 <property name="padding">5</property>
51 <property name="position">2</property>
52 </packing>
53 </child>
54 <child>
55 <widget class="GtkComboBox" id="wordCharCombo">
56 <property name="visible">True</property>
57 <property name="active">1</property>
58 <property name="items" translatable="yes">Default
59Space and Enter</property>
60 </widget>
61 <packing>
62 <property name="fill">False</property>
63 <property name="padding">5</property>
64 <property name="position">3</property>
65 </packing>
66 </child>
67 </widget>
68 </child>
69 <child>
70 <widget class="GtkCheckButton" id="removeTypedCheckbox">
71 <property name="visible">True</property>
72 <property name="can_focus">True</property>
73 <property name="label" translatable="yes">Remove typed abbreviation</property>
74 <property name="response_id">0</property>
75 <property name="draw_indicator">True</property>
76 </widget>
77 <packing>
78 <property name="position">1</property>
79 </packing>
80 </child>
81 <child>
82 <widget class="GtkCheckButton" id="omitTriggerCheckbox">
83 <property name="visible">True</property>
84 <property name="can_focus">True</property>
85 <property name="label" translatable="yes">Omit trigger character</property>
86 <property name="response_id">0</property>
87 <property name="draw_indicator">True</property>
88 </widget>
89 <packing>
90 <property name="position">2</property>
91 </packing>
92 </child>
93 <child>
94 <widget class="GtkCheckButton" id="matchCaseCheckbox">
95 <property name="visible">True</property>
96 <property name="can_focus">True</property>
97 <property name="label" translatable="yes">Match phrase case to typed abbreviation</property>
98 <property name="response_id">0</property>
99 <property name="draw_indicator">True</property>
100 <signal name="toggled" handler="on_matchCaseCheckbox_stateChanged"/>
101 </widget>
102 <packing>
103 <property name="position">3</property>
104 </packing>
105 </child>
106 <child>
107 <widget class="GtkCheckButton" id="ignoreCaseCheckbox">
108 <property name="visible">True</property>
109 <property name="can_focus">True</property>
110 <property name="label" translatable="yes">Ignore case of typed abbreviation</property>
111 <property name="response_id">0</property>
112 <property name="draw_indicator">True</property>
113 <signal name="toggled" handler="on_ignoreCaseCheckbox_stateChanged"/>
114 </widget>
115 <packing>
116 <property name="position">4</property>
117 </packing>
118 </child>
119 <child>
120 <widget class="GtkCheckButton" id="triggerInsideCheckbox">
121 <property name="visible">True</property>
122 <property name="can_focus">True</property>
123 <property name="label" translatable="yes">Trigger when typed as part of a word</property>
124 <property name="response_id">0</property>
125 <property name="draw_indicator">True</property>
126 </widget>
127 <packing>
128 <property name="position">5</property>
129 </packing>
130 </child>
131 <child>
132 <widget class="GtkCheckButton" id="immediateCheckbox">
133 <property name="visible">True</property>
134 <property name="can_focus">True</property>
135 <property name="label" translatable="yes">Trigger immediately (don't require a trigger character)</property>
136 <property name="response_id">0</property>
137 <property name="draw_indicator">True</property>
138 <signal name="toggled" handler="on_immediateCheckbox_stateChanged"/>
139 </widget>
140 <packing>
141 <property name="position">6</property>
142 </packing>
143 </child>
144 </widget>
145 <packing>
146 <property name="position">2</property>
147 </packing>
148 </child>
149 <child internal-child="action_area">
150 <widget class="GtkHButtonBox" id="dialog-action_area1">
151 <property name="visible">True</property>
152 <property name="layout_style">GTK_BUTTONBOX_END</property>
153 <child>
154 <widget class="GtkButton" id="cancelButton">
155 <property name="visible">True</property>
156 <property name="can_focus">True</property>
157 <property name="receives_default">True</property>
158 <property name="label" translatable="yes">gtk-cancel</property>
159 <property name="use_stock">True</property>
160 <property name="response_id">0</property>
161 <signal name="clicked" handler="on_cancel"/>
162 </widget>
163 </child>
164 <child>
165 <widget class="GtkButton" id="okButton">
166 <property name="visible">True</property>
167 <property name="can_focus">True</property>
168 <property name="can_default">True</property>
169 <property name="has_default">True</property>
170 <property name="receives_default">True</property>
171 <property name="label" translatable="yes">gtk-ok</property>
172 <property name="use_stock">True</property>
173 <property name="response_id">0</property>
174 <signal name="clicked" handler="on_ok"/>
175 </widget>
176 <packing>
177 <property name="position">1</property>
178 </packing>
179 </child>
180 </widget>
181 <packing>
182 <property name="expand">False</property>
183 <property name="pack_type">GTK_PACK_END</property>
184 </packing>
185 </child>
186 </widget>
187 </child>
188 </widget>
189</glade-interface>
0190
=== added file 'glade/akicon.png'
1Binary files glade/akicon.png 1970-01-01 00:00:00 +0000 and glade/akicon.png 2010-03-26 15:01:22 +0000 differ191Binary files glade/akicon.png 1970-01-01 00:00:00 +0000 and glade/akicon.png 2010-03-26 15:01:22 +0000 differ
=== added file 'glade/folderpage.glade'
--- glade/folderpage.glade 1970-01-01 00:00:00 +0000
+++ glade/folderpage.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,70 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.6 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="window1">
6 <child>
7 <widget class="GtkAlignment" id="folderpage">
8 <property name="visible">True</property>
9 <property name="yalign">0</property>
10 <property name="yscale">0</property>
11 <property name="top_padding">5</property>
12 <property name="bottom_padding">5</property>
13 <child>
14 <widget class="GtkFrame" id="frame1">
15 <property name="visible">True</property>
16 <property name="label_xalign">0</property>
17 <property name="shadow_type">none</property>
18 <child>
19 <widget class="GtkAlignment" id="alignment2">
20 <property name="visible">True</property>
21 <property name="top_padding">5</property>
22 <property name="bottom_padding">5</property>
23 <property name="left_padding">10</property>
24 <child>
25 <widget class="GtkVBox" id="settingsVbox">
26 <property name="visible">True</property>
27 <property name="orientation">vertical</property>
28 <property name="spacing">5</property>
29 <child>
30 <widget class="GtkCheckButton" id="showInTrayCheckbox">
31 <property name="label" translatable="yes">Show in tray menu </property>
32 <property name="visible">True</property>
33 <property name="can_focus">True</property>
34 <property name="receives_default">False</property>
35 <property name="draw_indicator">True</property>
36 <signal name="toggled" handler="on_modified"/>
37 </widget>
38 <packing>
39 <property name="position">0</property>
40 </packing>
41 </child>
42 <child>
43 <widget class="GtkHSeparator" id="hseparator1">
44 <property name="visible">True</property>
45 </widget>
46 <packing>
47 <property name="expand">False</property>
48 <property name="position">1</property>
49 </packing>
50 </child>
51 </widget>
52 </child>
53 </widget>
54 </child>
55 <child>
56 <widget class="GtkLabel" id="label2">
57 <property name="visible">True</property>
58 <property name="label" translatable="yes">&lt;b&gt;Folder Settings&lt;/b&gt;</property>
59 <property name="use_markup">True</property>
60 </widget>
61 <packing>
62 <property name="type">label_item</property>
63 </packing>
64 </child>
65 </widget>
66 </child>
67 </widget>
68 </child>
69 </widget>
70</glade-interface>
071
=== added file 'glade/hotkeysettings.glade'
--- glade/hotkeysettings.glade 1970-01-01 00:00:00 +0000
+++ glade/hotkeysettings.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,151 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Wed Sep 2 10:54:51 2009 -->
4<glade-interface>
5 <widget class="GtkDialog" id="hotkeysettings">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">Set Hotkey</property>
8 <property name="resizable">False</property>
9 <property name="modal">True</property>
10 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12 <signal name="response" handler="on_response"/>
13 <child internal-child="vbox">
14 <widget class="GtkVBox" id="dialog-vbox2">
15 <property name="visible">True</property>
16 <property name="spacing">5</property>
17 <child>
18 <widget class="GtkVBox" id="vbox2">
19 <property name="visible">True</property>
20 <property name="border_width">5</property>
21 <property name="spacing">10</property>
22 <child>
23 <widget class="GtkHBox" id="hbox2">
24 <property name="visible">True</property>
25 <property name="homogeneous">True</property>
26 <child>
27 <widget class="GtkToggleButton" id="controlButton">
28 <property name="visible">True</property>
29 <property name="can_focus">True</property>
30 <property name="label" translatable="yes">Control</property>
31 <property name="response_id">0</property>
32 </widget>
33 <packing>
34 <property name="expand">False</property>
35 <property name="padding">5</property>
36 </packing>
37 </child>
38 <child>
39 <widget class="GtkToggleButton" id="altButton">
40 <property name="visible">True</property>
41 <property name="can_focus">True</property>
42 <property name="label" translatable="yes">Alt</property>
43 <property name="response_id">0</property>
44 </widget>
45 <packing>
46 <property name="expand">False</property>
47 <property name="padding">5</property>
48 <property name="position">1</property>
49 </packing>
50 </child>
51 <child>
52 <widget class="GtkToggleButton" id="shiftButton">
53 <property name="visible">True</property>
54 <property name="can_focus">True</property>
55 <property name="label" translatable="yes">Shift</property>
56 <property name="response_id">0</property>
57 </widget>
58 <packing>
59 <property name="expand">False</property>
60 <property name="padding">5</property>
61 <property name="position">2</property>
62 </packing>
63 </child>
64 <child>
65 <widget class="GtkToggleButton" id="superButton">
66 <property name="visible">True</property>
67 <property name="can_focus">True</property>
68 <property name="label" translatable="yes">Super</property>
69 <property name="response_id">0</property>
70 </widget>
71 <packing>
72 <property name="expand">False</property>
73 <property name="padding">5</property>
74 <property name="position">3</property>
75 </packing>
76 </child>
77 </widget>
78 </child>
79 <child>
80 <widget class="GtkHBox" id="hbox3">
81 <property name="visible">True</property>
82 <child>
83 <widget class="GtkLabel" id="keyLabel">
84 <property name="visible">True</property>
85 <property name="xalign">0</property>
86 <property name="label" translatable="yes">Key: %s</property>
87 </widget>
88 </child>
89 <child>
90 <widget class="GtkButton" id="setButton">
91 <property name="visible">True</property>
92 <property name="can_focus">True</property>
93 <property name="label" translatable="yes">Press to Set</property>
94 <property name="response_id">0</property>
95 <signal name="clicked" handler="on_setButton_pressed"/>
96 </widget>
97 <packing>
98 <property name="expand">False</property>
99 <property name="position">1</property>
100 </packing>
101 </child>
102 </widget>
103 <packing>
104 <property name="position">1</property>
105 </packing>
106 </child>
107 </widget>
108 <packing>
109 <property name="fill">False</property>
110 <property name="position">2</property>
111 </packing>
112 </child>
113 <child internal-child="action_area">
114 <widget class="GtkHButtonBox" id="dialog-action_area2">
115 <property name="visible">True</property>
116 <property name="layout_style">GTK_BUTTONBOX_END</property>
117 <child>
118 <widget class="GtkButton" id="cancelButton">
119 <property name="visible">True</property>
120 <property name="can_focus">True</property>
121 <property name="receives_default">True</property>
122 <property name="label" translatable="yes">gtk-cancel</property>
123 <property name="use_stock">True</property>
124 <property name="response_id">0</property>
125 <signal name="clicked" handler="on_cancel"/>
126 </widget>
127 </child>
128 <child>
129 <widget class="GtkButton" id="okButton">
130 <property name="visible">True</property>
131 <property name="can_focus">True</property>
132 <property name="receives_default">True</property>
133 <property name="label" translatable="yes">gtk-ok</property>
134 <property name="use_stock">True</property>
135 <property name="response_id">0</property>
136 <signal name="clicked" handler="on_ok"/>
137 </widget>
138 <packing>
139 <property name="position">1</property>
140 </packing>
141 </child>
142 </widget>
143 <packing>
144 <property name="expand">False</property>
145 <property name="pack_type">GTK_PACK_END</property>
146 </packing>
147 </child>
148 </widget>
149 </child>
150 </widget>
151</glade-interface>
0152
=== added file 'glade/mainwindow.glade'
--- glade/mainwindow.glade 1970-01-01 00:00:00 +0000
+++ glade/mainwindow.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,124 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.6 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="mainwindow">
6 <property name="title" translatable="yes">AutoKey - Configuration</property>
7 <property name="default_width">600</property>
8 <property name="default_height">400</property>
9 <property name="icon">akicon.png</property>
10 <signal name="delete_event" handler="on_close"/>
11 <child>
12 <widget class="GtkVBox" id="vbox">
13 <property name="visible">True</property>
14 <child>
15 <widget class="GtkHPaned" id="hpaned">
16 <property name="visible">True</property>
17 <property name="can_focus">True</property>
18 <property name="position">150</property>
19 <property name="position_set">True</property>
20 <child>
21 <widget class="GtkScrolledWindow" id="scrolledwindow1">
22 <property name="visible">True</property>
23 <property name="can_focus">True</property>
24 <property name="hscrollbar_policy">automatic</property>
25 <property name="vscrollbar_policy">automatic</property>
26 <property name="shadow_type">in</property>
27 <child>
28 <widget class="GtkTreeView" id="treeWidget">
29 <property name="visible">True</property>
30 <property name="can_focus">True</property>
31 <signal name="button_press_event" handler="on_treeview_buttonpress"/>
32 <signal name="row_activated" handler="on_treeWidget_row_activated"/>
33 <signal name="drag_drop" handler="on_drag_drop"/>
34 <signal name="button_release_event" handler="on_treeview_buttonrelease"/>
35 <signal name="drag_data_received" handler="on_drag_data_received"/>
36 <signal name="cursor_changed" handler="on_tree_selection_changed"/>
37 </widget>
38 </child>
39 </widget>
40 <packing>
41 <property name="resize">True</property>
42 <property name="shrink">True</property>
43 </packing>
44 </child>
45 <child>
46 <widget class="GtkAlignment" id="alignment1">
47 <property name="visible">True</property>
48 <property name="bottom_padding">5</property>
49 <property name="right_padding">5</property>
50 <child>
51 <widget class="GtkVBox" id="vbox2">
52 <property name="visible">True</property>
53 <property name="spacing">5</property>
54 <child>
55 <widget class="GtkNotebook" id="stack">
56 <property name="visible">True</property>
57 <property name="can_focus">True</property>
58 <property name="show_tabs">False</property>
59 <property name="show_border">False</property>
60 </widget>
61 <packing>
62 <property name="position">0</property>
63 </packing>
64 </child>
65 <child>
66 <widget class="GtkHButtonBox" id="hbuttonbox1">
67 <property name="visible">True</property>
68 <property name="spacing">5</property>
69 <property name="homogeneous">True</property>
70 <property name="layout_style">end</property>
71 <child>
72 <widget class="GtkButton" id="saveButton">
73 <property name="label">gtk-save</property>
74 <property name="visible">True</property>
75 <property name="can_focus">True</property>
76 <property name="receives_default">True</property>
77 <property name="use_stock">True</property>
78 <signal name="clicked" handler="on_save"/>
79 </widget>
80 <packing>
81 <property name="expand">False</property>
82 <property name="fill">False</property>
83 <property name="position">0</property>
84 </packing>
85 </child>
86 <child>
87 <widget class="GtkButton" id="revertButton">
88 <property name="label">gtk-revert-to-saved</property>
89 <property name="visible">True</property>
90 <property name="can_focus">True</property>
91 <property name="receives_default">True</property>
92 <property name="use_stock">True</property>
93 <signal name="clicked" handler="on_reset"/>
94 </widget>
95 <packing>
96 <property name="expand">False</property>
97 <property name="fill">False</property>
98 <property name="position">1</property>
99 </packing>
100 </child>
101 </widget>
102 <packing>
103 <property name="expand">False</property>
104 <property name="position">1</property>
105 </packing>
106 </child>
107 </widget>
108 </child>
109 </widget>
110 <packing>
111 <property name="resize">True</property>
112 <property name="shrink">True</property>
113 </packing>
114 </child>
115 </widget>
116 <packing>
117 <property name="pack_type">end</property>
118 <property name="position">0</property>
119 </packing>
120 </child>
121 </widget>
122 </child>
123 </widget>
124</glade-interface>
0125
=== added file 'glade/phrasepage-old.glade'
--- glade/phrasepage-old.glade 1970-01-01 00:00:00 +0000
+++ glade/phrasepage-old.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,118 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Wed Sep 2 11:38:57 2009 -->
4<glade-interface>
5 <widget class="GtkWindow" id="window1">
6 <child>
7 <widget class="GtkAlignment" id="phrasepage">
8 <property name="visible">True</property>
9 <property name="top_padding">5</property>
10 <property name="bottom_padding">5</property>
11 <child>
12 <widget class="GtkVBox" id="vbox1">
13 <property name="visible">True</property>
14 <property name="spacing">5</property>
15 <child>
16 <widget class="GtkLabel" id="label1">
17 <property name="visible">True</property>
18 <property name="xalign">0</property>
19 <property name="label" translatable="yes">Description</property>
20 </widget>
21 <packing>
22 <property name="expand">False</property>
23 </packing>
24 </child>
25 <child>
26 <widget class="GtkEntry" id="descriptionEntry">
27 <property name="visible">True</property>
28 <property name="can_focus">True</property>
29 <signal name="changed" handler="on_modified"/>
30 </widget>
31 <packing>
32 <property name="expand">False</property>
33 <property name="position">1</property>
34 </packing>
35 </child>
36 <child>
37 <widget class="GtkScrolledWindow" id="scrolledwindow1">
38 <property name="visible">True</property>
39 <property name="can_focus">True</property>
40 <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
41 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
42 <property name="shadow_type">GTK_SHADOW_IN</property>
43 <child>
44 <widget class="GtkTextView" id="phraseText">
45 <property name="visible">True</property>
46 <property name="can_focus">True</property>
47 <property name="accepts_tab">False</property>
48 </widget>
49 </child>
50 </widget>
51 <packing>
52 <property name="position">2</property>
53 </packing>
54 </child>
55 <child>
56 <widget class="GtkFrame" id="frame1">
57 <property name="visible">True</property>
58 <property name="label_xalign">0</property>
59 <property name="shadow_type">GTK_SHADOW_NONE</property>
60 <child>
61 <widget class="GtkAlignment" id="alignment2">
62 <property name="visible">True</property>
63 <property name="top_padding">5</property>
64 <property name="bottom_padding">5</property>
65 <property name="left_padding">10</property>
66 <child>
67 <widget class="GtkVBox" id="settingsVbox">
68 <property name="visible">True</property>
69 <property name="spacing">5</property>
70 <child>
71 <widget class="GtkCheckButton" id="promptCheckbox">
72 <property name="visible">True</property>
73 <property name="can_focus">True</property>
74 <property name="label" translatable="yes">Always prompt before pasting this phrase</property>
75 <property name="response_id">0</property>
76 <property name="draw_indicator">True</property>
77 <signal name="toggled" handler="on_modified"/>
78 </widget>
79 </child>
80 <child>
81 <widget class="GtkCheckButton" id="showInTrayCheckbox">
82 <property name="visible">True</property>
83 <property name="can_focus">True</property>
84 <property name="label" translatable="yes">Show in tray menu </property>
85 <property name="response_id">0</property>
86 <property name="draw_indicator">True</property>
87 <signal name="toggled" handler="on_modified"/>
88 </widget>
89 <packing>
90 <property name="position">1</property>
91 </packing>
92 </child>
93 </widget>
94 </child>
95 </widget>
96 </child>
97 <child>
98 <widget class="GtkLabel" id="label2">
99 <property name="visible">True</property>
100 <property name="label" translatable="yes">&lt;b&gt;Settings&lt;/b&gt;</property>
101 <property name="use_markup">True</property>
102 </widget>
103 <packing>
104 <property name="type">label_item</property>
105 </packing>
106 </child>
107 </widget>
108 <packing>
109 <property name="expand">False</property>
110 <property name="position">3</property>
111 </packing>
112 </child>
113 </widget>
114 </child>
115 </widget>
116 </child>
117 </widget>
118</glade-interface>
0119
=== added file 'glade/phrasepage.glade'
--- glade/phrasepage.glade 1970-01-01 00:00:00 +0000
+++ glade/phrasepage.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,106 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.6 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="window1">
6 <child>
7 <widget class="GtkAlignment" id="phrasepage">
8 <property name="visible">True</property>
9 <property name="top_padding">5</property>
10 <property name="bottom_padding">5</property>
11 <child>
12 <widget class="GtkVBox" id="vbox1">
13 <property name="visible">True</property>
14 <property name="orientation">vertical</property>
15 <property name="spacing">5</property>
16 <child>
17 <widget class="GtkScrolledWindow" id="scrolledWindow">
18 <property name="visible">True</property>
19 <property name="can_focus">True</property>
20 <property name="hscrollbar_policy">automatic</property>
21 <property name="vscrollbar_policy">automatic</property>
22 <property name="shadow_type">in</property>
23 <child>
24 <placeholder/>
25 </child>
26 </widget>
27 <packing>
28 <property name="position">0</property>
29 </packing>
30 </child>
31 <child>
32 <widget class="GtkFrame" id="frame1">
33 <property name="visible">True</property>
34 <property name="label_xalign">0</property>
35 <property name="shadow_type">none</property>
36 <child>
37 <widget class="GtkAlignment" id="alignment2">
38 <property name="visible">True</property>
39 <property name="top_padding">5</property>
40 <property name="bottom_padding">5</property>
41 <property name="left_padding">10</property>
42 <child>
43 <widget class="GtkVBox" id="settingsVbox">
44 <property name="visible">True</property>
45 <property name="orientation">vertical</property>
46 <child>
47 <widget class="GtkCheckButton" id="promptCheckbox">
48 <property name="label" translatable="yes">Always prompt before pasting this phrase</property>
49 <property name="visible">True</property>
50 <property name="can_focus">True</property>
51 <property name="receives_default">False</property>
52 <property name="draw_indicator">True</property>
53 <signal name="toggled" handler="on_modified"/>
54 </widget>
55 <packing>
56 <property name="position">0</property>
57 </packing>
58 </child>
59 <child>
60 <widget class="GtkCheckButton" id="showInTrayCheckbox">
61 <property name="label" translatable="yes">Show in tray menu </property>
62 <property name="visible">True</property>
63 <property name="can_focus">True</property>
64 <property name="receives_default">False</property>
65 <property name="draw_indicator">True</property>
66 <signal name="toggled" handler="on_modified"/>
67 </widget>
68 <packing>
69 <property name="position">1</property>
70 </packing>
71 </child>
72 <child>
73 <widget class="GtkHSeparator" id="hseparator1">
74 <property name="visible">True</property>
75 </widget>
76 <packing>
77 <property name="expand">False</property>
78 <property name="position">2</property>
79 </packing>
80 </child>
81 </widget>
82 </child>
83 </widget>
84 </child>
85 <child>
86 <widget class="GtkLabel" id="label2">
87 <property name="visible">True</property>
88 <property name="label" translatable="yes">&lt;b&gt;Phrase Settings&lt;/b&gt;</property>
89 <property name="use_markup">True</property>
90 </widget>
91 <packing>
92 <property name="type">label_item</property>
93 </packing>
94 </child>
95 </widget>
96 <packing>
97 <property name="expand">False</property>
98 <property name="position">1</property>
99 </packing>
100 </child>
101 </widget>
102 </child>
103 </widget>
104 </child>
105 </widget>
106</glade-interface>
0107
=== added file 'glade/recorddialog.glade'
--- glade/recorddialog.glade 1970-01-01 00:00:00 +0000
+++ glade/recorddialog.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,145 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Fri Oct 30 16:24:33 2009 -->
4<glade-interface>
5 <widget class="GtkDialog" id="recorddialog">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">Record Macro</property>
8 <property name="resizable">False</property>
9 <property name="modal">True</property>
10 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12 <signal name="response" handler="on_response"/>
13 <child internal-child="vbox">
14 <widget class="GtkVBox" id="dialog-vbox1">
15 <property name="visible">True</property>
16 <property name="spacing">2</property>
17 <child>
18 <widget class="GtkVBox" id="vbox1">
19 <property name="visible">True</property>
20 <child>
21 <widget class="GtkLabel" id="label1">
22 <property name="visible">True</property>
23 <property name="xalign">0</property>
24 <property name="label" translatable="yes">&lt;b&gt;Record a keyboard/mouse macro&lt;/b&gt;</property>
25 <property name="use_markup">True</property>
26 </widget>
27 <packing>
28 <property name="padding">5</property>
29 </packing>
30 </child>
31 <child>
32 <widget class="GtkCheckButton" id="keyboardButton">
33 <property name="visible">True</property>
34 <property name="can_focus">True</property>
35 <property name="label" translatable="yes">Record keyboard events</property>
36 <property name="response_id">0</property>
37 <property name="active">True</property>
38 <property name="draw_indicator">True</property>
39 </widget>
40 <packing>
41 <property name="padding">3</property>
42 <property name="position">1</property>
43 </packing>
44 </child>
45 <child>
46 <widget class="GtkCheckButton" id="mouseButton">
47 <property name="visible">True</property>
48 <property name="can_focus">True</property>
49 <property name="label" translatable="yes">Record mouse events (experimental)</property>
50 <property name="response_id">0</property>
51 <property name="draw_indicator">True</property>
52 </widget>
53 <packing>
54 <property name="padding">3</property>
55 <property name="position">2</property>
56 </packing>
57 </child>
58 <child>
59 <widget class="GtkHBox" id="hbox1">
60 <property name="visible">True</property>
61 <property name="spacing">5</property>
62 <child>
63 <widget class="GtkLabel" id="label2">
64 <property name="visible">True</property>
65 <property name="label" translatable="yes">Start recording after</property>
66 </widget>
67 <packing>
68 <property name="expand">False</property>
69 </packing>
70 </child>
71 <child>
72 <widget class="GtkSpinButton" id="spinButton">
73 <property name="visible">True</property>
74 <property name="can_focus">True</property>
75 <property name="adjustment">5 1 20 1 10 10</property>
76 </widget>
77 <packing>
78 <property name="expand">False</property>
79 <property name="fill">False</property>
80 <property name="position">1</property>
81 </packing>
82 </child>
83 <child>
84 <widget class="GtkLabel" id="label3">
85 <property name="visible">True</property>
86 <property name="label" translatable="yes">seconds</property>
87 </widget>
88 <packing>
89 <property name="expand">False</property>
90 <property name="position">2</property>
91 </packing>
92 </child>
93 </widget>
94 <packing>
95 <property name="expand">False</property>
96 <property name="padding">5</property>
97 <property name="position">3</property>
98 </packing>
99 </child>
100 </widget>
101 <packing>
102 <property name="position">2</property>
103 </packing>
104 </child>
105 <child internal-child="action_area">
106 <widget class="GtkHButtonBox" id="dialog-action_area1">
107 <property name="visible">True</property>
108 <property name="layout_style">GTK_BUTTONBOX_END</property>
109 <child>
110 <widget class="GtkButton" id="cancelButton">
111 <property name="visible">True</property>
112 <property name="can_focus">True</property>
113 <property name="receives_default">True</property>
114 <property name="label" translatable="yes">gtk-cancel</property>
115 <property name="use_stock">True</property>
116 <property name="response_id">0</property>
117 <signal name="clicked" handler="on_cancel"/>
118 </widget>
119 </child>
120 <child>
121 <widget class="GtkButton" id="okButton">
122 <property name="visible">True</property>
123 <property name="can_focus">True</property>
124 <property name="can_default">True</property>
125 <property name="has_default">True</property>
126 <property name="receives_default">True</property>
127 <property name="label" translatable="yes">gtk-ok</property>
128 <property name="use_stock">True</property>
129 <property name="response_id">0</property>
130 <signal name="clicked" handler="on_ok"/>
131 </widget>
132 <packing>
133 <property name="position">1</property>
134 </packing>
135 </child>
136 </widget>
137 <packing>
138 <property name="expand">False</property>
139 <property name="pack_type">GTK_PACK_END</property>
140 </packing>
141 </child>
142 </widget>
143 </child>
144 </widget>
145</glade-interface>
0146
=== added file 'glade/scriptpage.glade'
--- glade/scriptpage.glade 1970-01-01 00:00:00 +0000
+++ glade/scriptpage.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,106 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.6 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="window1">
6 <child>
7 <widget class="GtkAlignment" id="scriptpage">
8 <property name="visible">True</property>
9 <property name="top_padding">5</property>
10 <property name="bottom_padding">5</property>
11 <child>
12 <widget class="GtkVBox" id="vbox1">
13 <property name="visible">True</property>
14 <property name="orientation">vertical</property>
15 <property name="spacing">5</property>
16 <child>
17 <widget class="GtkScrolledWindow" id="scrolledWindow">
18 <property name="visible">True</property>
19 <property name="can_focus">True</property>
20 <property name="hscrollbar_policy">automatic</property>
21 <property name="vscrollbar_policy">automatic</property>
22 <property name="shadow_type">in</property>
23 <child>
24 <placeholder/>
25 </child>
26 </widget>
27 <packing>
28 <property name="position">0</property>
29 </packing>
30 </child>
31 <child>
32 <widget class="GtkFrame" id="frame1">
33 <property name="visible">True</property>
34 <property name="label_xalign">0</property>
35 <property name="shadow_type">none</property>
36 <child>
37 <widget class="GtkAlignment" id="alignment2">
38 <property name="visible">True</property>
39 <property name="top_padding">5</property>
40 <property name="bottom_padding">5</property>
41 <property name="left_padding">10</property>
42 <child>
43 <widget class="GtkVBox" id="settingsVbox">
44 <property name="visible">True</property>
45 <property name="orientation">vertical</property>
46 <child>
47 <widget class="GtkCheckButton" id="promptCheckbox">
48 <property name="label" translatable="yes">Always prompt before executing this script</property>
49 <property name="visible">True</property>
50 <property name="can_focus">True</property>
51 <property name="receives_default">False</property>
52 <property name="draw_indicator">True</property>
53 <signal name="toggled" handler="on_modified"/>
54 </widget>
55 <packing>
56 <property name="position">0</property>
57 </packing>
58 </child>
59 <child>
60 <widget class="GtkCheckButton" id="showInTrayCheckbox">
61 <property name="label" translatable="yes">Show in tray menu </property>
62 <property name="visible">True</property>
63 <property name="can_focus">True</property>
64 <property name="receives_default">False</property>
65 <property name="draw_indicator">True</property>
66 <signal name="toggled" handler="on_modified"/>
67 </widget>
68 <packing>
69 <property name="position">1</property>
70 </packing>
71 </child>
72 <child>
73 <widget class="GtkHSeparator" id="hseparator1">
74 <property name="visible">True</property>
75 </widget>
76 <packing>
77 <property name="expand">False</property>
78 <property name="position">2</property>
79 </packing>
80 </child>
81 </widget>
82 </child>
83 </widget>
84 </child>
85 <child>
86 <widget class="GtkLabel" id="label2">
87 <property name="visible">True</property>
88 <property name="label" translatable="yes">&lt;b&gt;Script Settings&lt;/b&gt;</property>
89 <property name="use_markup">True</property>
90 </widget>
91 <packing>
92 <property name="type">label_item</property>
93 </packing>
94 </child>
95 </widget>
96 <packing>
97 <property name="expand">False</property>
98 <property name="position">1</property>
99 </packing>
100 </child>
101 </widget>
102 </child>
103 </widget>
104 </child>
105 </widget>
106</glade-interface>
0107
=== added file 'glade/settingsdialog.glade'
--- glade/settingsdialog.glade 1970-01-01 00:00:00 +0000
+++ glade/settingsdialog.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,762 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.16 -->
4 <!-- interface-naming-policy project-wide -->
5 <widget class="GtkDialog" id="settingsdialog">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">AutoKey - Preferences</property>
8 <property name="modal">True</property>
9 <property name="window_position">center-on-parent</property>
10 <property name="type_hint">dialog</property>
11 <property name="has_separator">False</property>
12 <child internal-child="vbox">
13 <widget class="GtkVBox" id="dialog-vbox1">
14 <property name="visible">True</property>
15 <property name="orientation">vertical</property>
16 <property name="spacing">2</property>
17 <child>
18 <widget class="GtkNotebook" id="notebook1">
19 <property name="visible">True</property>
20 <property name="can_focus">True</property>
21 <child>
22 <widget class="GtkAlignment" id="alignment1">
23 <property name="visible">True</property>
24 <property name="yalign">0</property>
25 <property name="yscale">0</property>
26 <property name="top_padding">5</property>
27 <property name="bottom_padding">5</property>
28 <property name="left_padding">5</property>
29 <property name="right_padding">5</property>
30 <child>
31 <widget class="GtkVBox" id="vbox1">
32 <property name="visible">True</property>
33 <property name="orientation">vertical</property>
34 <property name="spacing">5</property>
35 <child>
36 <widget class="GtkFrame" id="frame8">
37 <property name="visible">True</property>
38 <property name="label_xalign">0</property>
39 <property name="shadow_type">none</property>
40 <child>
41 <widget class="GtkAlignment" id="alignment11">
42 <property name="visible">True</property>
43 <property name="left_padding">12</property>
44 <child>
45 <widget class="GtkVBox" id="vbox7">
46 <property name="visible">True</property>
47 <property name="orientation">vertical</property>
48 <child>
49 <widget class="GtkCheckButton" id="autoStartCheckbox">
50 <property name="label" translatable="yes">Automatically start AutoKey at login</property>
51 <property name="visible">True</property>
52 <property name="can_focus">True</property>
53 <property name="receives_default">False</property>
54 <property name="draw_indicator">True</property>
55 </widget>
56 <packing>
57 <property name="position">0</property>
58 </packing>
59 </child>
60 <child>
61 <widget class="GtkCheckButton" id="promptToSaveCheckbox">
62 <property name="label" translatable="yes">Prompt for unsaved changes</property>
63 <property name="visible">True</property>
64 <property name="can_focus">True</property>
65 <property name="receives_default">False</property>
66 <property name="draw_indicator">True</property>
67 </widget>
68 <packing>
69 <property name="position">1</property>
70 </packing>
71 </child>
72 <child>
73 <widget class="GtkCheckButton" id="showTrayCheckbox">
74 <property name="label" translatable="yes">Show a tray icon (requires restart)</property>
75 <property name="visible">True</property>
76 <property name="can_focus">True</property>
77 <property name="receives_default">False</property>
78 <property name="draw_indicator">True</property>
79 </widget>
80 <packing>
81 <property name="position">2</property>
82 </packing>
83 </child>
84 </widget>
85 </child>
86 </widget>
87 </child>
88 <child>
89 <widget class="GtkLabel" id="label">
90 <property name="visible">True</property>
91 <property name="label" translatable="yes">&lt;b&gt;Application&lt;/b&gt;</property>
92 <property name="use_markup">True</property>
93 </widget>
94 <packing>
95 <property name="type">label_item</property>
96 </packing>
97 </child>
98 </widget>
99 <packing>
100 <property name="position">0</property>
101 </packing>
102 </child>
103 <child>
104 <widget class="GtkFrame" id="frame2">
105 <property name="visible">True</property>
106 <property name="label_xalign">0</property>
107 <property name="shadow_type">none</property>
108 <child>
109 <widget class="GtkAlignment" id="alignment3">
110 <property name="visible">True</property>
111 <property name="left_padding">12</property>
112 <child>
113 <widget class="GtkVBox" id="vbox3">
114 <property name="visible">True</property>
115 <property name="orientation">vertical</property>
116 <child>
117 <widget class="GtkCheckButton" id="allowKbNavCheckbox">
118 <property name="label" translatable="yes">Allow keyboard navigation of popup menu</property>
119 <property name="visible">True</property>
120 <property name="can_focus">True</property>
121 <property name="receives_default">False</property>
122 <property name="draw_indicator">True</property>
123 </widget>
124 <packing>
125 <property name="position">0</property>
126 </packing>
127 </child>
128 <child>
129 <widget class="GtkCheckButton" id="sortByUsageCheckbox">
130 <property name="label" translatable="yes">Sort menu items with most frequently used first</property>
131 <property name="visible">True</property>
132 <property name="can_focus">True</property>
133 <property name="receives_default">False</property>
134 <property name="draw_indicator">True</property>
135 </widget>
136 <packing>
137 <property name="position">1</property>
138 </packing>
139 </child>
140 </widget>
141 </child>
142 </widget>
143 </child>
144 <child>
145 <widget class="GtkLabel" id="label5">
146 <property name="visible">True</property>
147 <property name="label" translatable="yes">&lt;b&gt;Popup Menu&lt;/b&gt;</property>
148 <property name="use_markup">True</property>
149 </widget>
150 <packing>
151 <property name="type">label_item</property>
152 </packing>
153 </child>
154 </widget>
155 <packing>
156 <property name="position">1</property>
157 </packing>
158 </child>
159 <child>
160 <widget class="GtkFrame" id="frame3">
161 <property name="visible">True</property>
162 <property name="label_xalign">0</property>
163 <property name="shadow_type">none</property>
164 <child>
165 <widget class="GtkAlignment" id="alignment4">
166 <property name="visible">True</property>
167 <property name="left_padding">12</property>
168 <child>
169 <widget class="GtkCheckButton" id="enableUndoCheckbox">
170 <property name="label" translatable="yes">Enable undo by pressing backspace</property>
171 <property name="visible">True</property>
172 <property name="can_focus">True</property>
173 <property name="receives_default">False</property>
174 <property name="draw_indicator">True</property>
175 </widget>
176 </child>
177 </widget>
178 </child>
179 <child>
180 <widget class="GtkLabel" id="label6">
181 <property name="visible">True</property>
182 <property name="label" translatable="yes">&lt;b&gt;Expansions&lt;/b&gt;</property>
183 <property name="use_markup">True</property>
184 </widget>
185 <packing>
186 <property name="type">label_item</property>
187 </packing>
188 </child>
189 </widget>
190 <packing>
191 <property name="position">2</property>
192 </packing>
193 </child>
194 </widget>
195 </child>
196 </widget>
197 </child>
198 <child>
199 <widget class="GtkLabel" id="label1">
200 <property name="visible">True</property>
201 <property name="label" translatable="yes">General</property>
202 </widget>
203 <packing>
204 <property name="tab_fill">False</property>
205 <property name="type">tab</property>
206 </packing>
207 </child>
208 <child>
209 <widget class="GtkAlignment" id="alignment5">
210 <property name="visible">True</property>
211 <property name="yalign">0</property>
212 <property name="yscale">0</property>
213 <property name="top_padding">5</property>
214 <property name="bottom_padding">5</property>
215 <property name="left_padding">5</property>
216 <property name="right_padding">5</property>
217 <child>
218 <widget class="GtkVBox" id="vbox4">
219 <property name="visible">True</property>
220 <property name="orientation">vertical</property>
221 <property name="spacing">10</property>
222 <child>
223 <widget class="GtkFrame" id="frame4">
224 <property name="visible">True</property>
225 <property name="label_xalign">0</property>
226 <property name="shadow_type">none</property>
227 <child>
228 <widget class="GtkAlignment" id="alignment6">
229 <property name="visible">True</property>
230 <property name="top_padding">5</property>
231 <property name="bottom_padding">5</property>
232 <property name="left_padding">12</property>
233 <child>
234 <widget class="GtkHBox" id="hbox1">
235 <property name="visible">True</property>
236 <property name="spacing">5</property>
237 <child>
238 <widget class="GtkLabel" id="label10">
239 <property name="visible">True</property>
240 <property name="xalign">0</property>
241 <property name="label" translatable="yes">Hotkey:</property>
242 </widget>
243 <packing>
244 <property name="expand">False</property>
245 <property name="position">0</property>
246 </packing>
247 </child>
248 <child>
249 <widget class="GtkLabel" id="monitorKeyLabel">
250 <property name="visible">True</property>
251 <property name="xalign">0</property>
252 <property name="label" translatable="yes">$hotkey</property>
253 </widget>
254 <packing>
255 <property name="position">1</property>
256 </packing>
257 </child>
258 <child>
259 <widget class="GtkButton" id="setMonitorButton">
260 <property name="label" translatable="yes">Set</property>
261 <property name="width_request">80</property>
262 <property name="visible">True</property>
263 <property name="can_focus">True</property>
264 <property name="receives_default">True</property>
265 <signal name="clicked" handler="on_setMonitorButton_pressed"/>
266 </widget>
267 <packing>
268 <property name="expand">False</property>
269 <property name="position">2</property>
270 </packing>
271 </child>
272 <child>
273 <widget class="GtkButton" id="clearMonitorButton">
274 <property name="label">gtk-clear</property>
275 <property name="width_request">80</property>
276 <property name="visible">True</property>
277 <property name="can_focus">True</property>
278 <property name="receives_default">True</property>
279 <property name="use_stock">True</property>
280 <signal name="clicked" handler="on_clearMonitorButton_pressed"/>
281 </widget>
282 <packing>
283 <property name="expand">False</property>
284 <property name="position">3</property>
285 </packing>
286 </child>
287 </widget>
288 </child>
289 </widget>
290 </child>
291 <child>
292 <widget class="GtkLabel" id="label7">
293 <property name="visible">True</property>
294 <property name="label" translatable="yes">&lt;b&gt;Toggle monitoring using a hotkey&lt;/b&gt;</property>
295 <property name="use_markup">True</property>
296 </widget>
297 <packing>
298 <property name="type">label_item</property>
299 </packing>
300 </child>
301 </widget>
302 <packing>
303 <property name="position">0</property>
304 </packing>
305 </child>
306 <child>
307 <widget class="GtkFrame" id="frame5">
308 <property name="visible">True</property>
309 <property name="label_xalign">0</property>
310 <property name="shadow_type">none</property>
311 <child>
312 <widget class="GtkAlignment" id="alignment7">
313 <property name="visible">True</property>
314 <property name="top_padding">5</property>
315 <property name="bottom_padding">5</property>
316 <property name="left_padding">12</property>
317 <child>
318 <widget class="GtkHBox" id="hbox2">
319 <property name="visible">True</property>
320 <property name="spacing">5</property>
321 <child>
322 <widget class="GtkLabel" id="label12">
323 <property name="visible">True</property>
324 <property name="xalign">0</property>
325 <property name="label" translatable="yes">Hotkey:</property>
326 </widget>
327 <packing>
328 <property name="expand">False</property>
329 <property name="position">0</property>
330 </packing>
331 </child>
332 <child>
333 <widget class="GtkLabel" id="configKeyLabel">
334 <property name="visible">True</property>
335 <property name="xalign">0</property>
336 <property name="label" translatable="yes">$hotkey</property>
337 </widget>
338 <packing>
339 <property name="position">1</property>
340 </packing>
341 </child>
342 <child>
343 <widget class="GtkButton" id="setConfigButton">
344 <property name="label" translatable="yes">Set</property>
345 <property name="width_request">80</property>
346 <property name="visible">True</property>
347 <property name="can_focus">True</property>
348 <property name="receives_default">True</property>
349 <signal name="clicked" handler="on_setConfigButton_pressed"/>
350 </widget>
351 <packing>
352 <property name="expand">False</property>
353 <property name="position">2</property>
354 </packing>
355 </child>
356 <child>
357 <widget class="GtkButton" id="clearConfigButton">
358 <property name="label">gtk-clear</property>
359 <property name="width_request">80</property>
360 <property name="visible">True</property>
361 <property name="can_focus">True</property>
362 <property name="receives_default">True</property>
363 <property name="use_stock">True</property>
364 <signal name="clicked" handler="on_clearConfigButton_pressed"/>
365 </widget>
366 <packing>
367 <property name="expand">False</property>
368 <property name="position">3</property>
369 </packing>
370 </child>
371 </widget>
372 </child>
373 </widget>
374 </child>
375 <child>
376 <widget class="GtkLabel" id="label8">
377 <property name="visible">True</property>
378 <property name="label" translatable="yes">&lt;b&gt;Show configuration window using a hotkey&lt;/b&gt;</property>
379 <property name="use_markup">True</property>
380 </widget>
381 <packing>
382 <property name="type">label_item</property>
383 </packing>
384 </child>
385 </widget>
386 <packing>
387 <property name="position">1</property>
388 </packing>
389 </child>
390 <child>
391 <widget class="GtkFrame" id="frame6">
392 <property name="visible">True</property>
393 <property name="label_xalign">0</property>
394 <property name="shadow_type">none</property>
395 <child>
396 <widget class="GtkAlignment" id="alignment8">
397 <property name="visible">True</property>
398 <property name="top_padding">5</property>
399 <property name="bottom_padding">5</property>
400 <property name="left_padding">12</property>
401 <child>
402 <widget class="GtkHBox" id="hbox3">
403 <property name="visible">True</property>
404 <property name="spacing">5</property>
405 <child>
406 <widget class="GtkLabel" id="label14">
407 <property name="visible">True</property>
408 <property name="xalign">0</property>
409 <property name="label" translatable="yes">Hotkey:</property>
410 </widget>
411 <packing>
412 <property name="expand">False</property>
413 <property name="position">0</property>
414 </packing>
415 </child>
416 <child>
417 <widget class="GtkLabel" id="popupKeyLabel">
418 <property name="visible">True</property>
419 <property name="xalign">0</property>
420 <property name="label" translatable="yes">$hotkey</property>
421 </widget>
422 <packing>
423 <property name="position">1</property>
424 </packing>
425 </child>
426 <child>
427 <widget class="GtkButton" id="setPopupButton">
428 <property name="label" translatable="yes">Set</property>
429 <property name="width_request">80</property>
430 <property name="visible">True</property>
431 <property name="can_focus">True</property>
432 <property name="receives_default">True</property>
433 <signal name="clicked" handler="on_setPopupButton_pressed"/>
434 </widget>
435 <packing>
436 <property name="expand">False</property>
437 <property name="position">2</property>
438 </packing>
439 </child>
440 <child>
441 <widget class="GtkButton" id="clearPopupButton">
442 <property name="label">gtk-clear</property>
443 <property name="width_request">80</property>
444 <property name="visible">True</property>
445 <property name="can_focus">True</property>
446 <property name="receives_default">True</property>
447 <property name="use_stock">True</property>
448 <signal name="clicked" handler="on_clearPopupButton_pressed"/>
449 </widget>
450 <packing>
451 <property name="expand">False</property>
452 <property name="position">3</property>
453 </packing>
454 </child>
455 </widget>
456 </child>
457 </widget>
458 </child>
459 <child>
460 <widget class="GtkLabel" id="label9">
461 <property name="visible">True</property>
462 <property name="label" translatable="yes">&lt;b&gt;Show abbreviation popup using a hotkey&lt;/b&gt;</property>
463 <property name="use_markup">True</property>
464 </widget>
465 <packing>
466 <property name="type">label_item</property>
467 </packing>
468 </child>
469 </widget>
470 <packing>
471 <property name="position">2</property>
472 </packing>
473 </child>
474 </widget>
475 </child>
476 </widget>
477 <packing>
478 <property name="position">1</property>
479 </packing>
480 </child>
481 <child>
482 <widget class="GtkLabel" id="label2">
483 <property name="visible">True</property>
484 <property name="label" translatable="yes">Special Hotkeys</property>
485 </widget>
486 <packing>
487 <property name="position">1</property>
488 <property name="tab_fill">False</property>
489 <property name="type">tab</property>
490 </packing>
491 </child>
492 <child>
493 <widget class="GtkAlignment" id="alignment2">
494 <property name="visible">True</property>
495 <property name="top_padding">5</property>
496 <property name="bottom_padding">5</property>
497 <property name="left_padding">5</property>
498 <property name="right_padding">5</property>
499 <child>
500 <widget class="GtkFrame" id="frame1">
501 <property name="visible">True</property>
502 <property name="label_xalign">0</property>
503 <property name="shadow_type">none</property>
504 <child>
505 <widget class="GtkAlignment" id="alignment12">
506 <property name="visible">True</property>
507 <property name="left_padding">12</property>
508 <child>
509 <widget class="GtkVBox" id="vbox2">
510 <property name="visible">True</property>
511 <property name="orientation">vertical</property>
512 <child>
513 <widget class="GtkLabel" id="label17">
514 <property name="visible">True</property>
515 <property name="xalign">0</property>
516 <property name="ypad">5</property>
517 <property name="label" translatable="yes">Any Python modules placed in this folder will be available for
518import by scripts.</property>
519 </widget>
520 <packing>
521 <property name="expand">False</property>
522 <property name="position">0</property>
523 </packing>
524 </child>
525 <child>
526 <widget class="GtkFileChooserButton" id="userModuleChooserButton">
527 <property name="visible">True</property>
528 <property name="action">select-folder</property>
529 <property name="title" translatable="yes">Select A Folder</property>
530 </widget>
531 <packing>
532 <property name="expand">False</property>
533 <property name="position">1</property>
534 </packing>
535 </child>
536 </widget>
537 </child>
538 </widget>
539 </child>
540 <child>
541 <widget class="GtkLabel" id="label16">
542 <property name="visible">True</property>
543 <property name="label" translatable="yes">&lt;b&gt;User Module Folder&lt;/b&gt;</property>
544 <property name="use_markup">True</property>
545 </widget>
546 <packing>
547 <property name="type">label_item</property>
548 </packing>
549 </child>
550 </widget>
551 </child>
552 </widget>
553 <packing>
554 <property name="position">2</property>
555 </packing>
556 </child>
557 <child>
558 <widget class="GtkLabel" id="label4">
559 <property name="visible">True</property>
560 <property name="label" translatable="yes">Script Engine</property>
561 </widget>
562 <packing>
563 <property name="position">3</property>
564 <property name="tab_fill">False</property>
565 <property name="type">tab</property>
566 </packing>
567 </child>
568 <child>
569 <widget class="GtkAlignment" id="alignment9">
570 <property name="visible">True</property>
571 <property name="yalign">0</property>
572 <property name="yscale">0</property>
573 <property name="top_padding">5</property>
574 <property name="bottom_padding">5</property>
575 <property name="left_padding">5</property>
576 <property name="right_padding">5</property>
577 <child>
578 <widget class="GtkVBox" id="vbox5">
579 <property name="visible">True</property>
580 <property name="orientation">vertical</property>
581 <property name="spacing">5</property>
582 <child>
583 <widget class="GtkFrame" id="frame7">
584 <property name="visible">True</property>
585 <property name="label_xalign">0</property>
586 <property name="shadow_type">none</property>
587 <child>
588 <widget class="GtkAlignment" id="alignment10">
589 <property name="visible">True</property>
590 <property name="top_padding">5</property>
591 <property name="bottom_padding">5</property>
592 <property name="right_padding">5</property>
593 <child>
594 <widget class="GtkVBox" id="vbox6">
595 <property name="visible">True</property>
596 <property name="orientation">vertical</property>
597 <property name="spacing">5</property>
598 <child>
599 <widget class="GtkLabel" id="label15">
600 <property name="visible">True</property>
601 <property name="xalign">0</property>
602 <property name="label" translatable="yes">Configure the method AutoKey uses to receive keyboard and
603mouse events. Only change this option if AutoKey is not
604responding to abbreviations and hotkeys.
605
606After changing this option, you will need to restart AutoKey for
607it to take effect.</property>
608 </widget>
609 <packing>
610 <property name="position">0</property>
611 </packing>
612 </child>
613 <child>
614 <widget class="GtkRadioButton" id="xRecordButton">
615 <property name="label" translatable="yes">X Record - Preferred option when using X.org server v1.5 or older</property>
616 <property name="visible">True</property>
617 <property name="can_focus">True</property>
618 <property name="receives_default">False</property>
619 <property name="active">True</property>
620 <property name="draw_indicator">True</property>
621 <property name="group">xEvdevButton</property>
622 </widget>
623 <packing>
624 <property name="position">1</property>
625 </packing>
626 </child>
627 <child>
628 <widget class="GtkRadioButton" id="xEvdevButton">
629 <property name="label" translatable="yes">X EvDev - Preferred option when using X.org server v1.6 or newer</property>
630 <property name="visible">True</property>
631 <property name="can_focus">True</property>
632 <property name="receives_default">False</property>
633 <property name="active">True</property>
634 <property name="draw_indicator">True</property>
635 </widget>
636 <packing>
637 <property name="position">2</property>
638 </packing>
639 </child>
640 <child>
641 <widget class="GtkRadioButton" id="atspiButton">
642 <property name="label" translatable="yes">AT-SPI - Fallback option for Gnome users when other methods fail</property>
643 <property name="visible">True</property>
644 <property name="can_focus">True</property>
645 <property name="receives_default">False</property>
646 <property name="active">True</property>
647 <property name="draw_indicator">True</property>
648 <property name="group">xEvdevButton</property>
649 </widget>
650 <packing>
651 <property name="position">3</property>
652 </packing>
653 </child>
654 </widget>
655 </child>
656 </widget>
657 </child>
658 <child>
659 <widget class="GtkLabel" id="label13">
660 <property name="visible">True</property>
661 <property name="label" translatable="yes">&lt;b&gt;Interface Type&lt;/b&gt;</property>
662 <property name="use_markup">True</property>
663 </widget>
664 <packing>
665 <property name="type">label_item</property>
666 </packing>
667 </child>
668 </widget>
669 <packing>
670 <property name="position">0</property>
671 </packing>
672 </child>
673 <child>
674 <widget class="GtkLabel" id="label11">
675 <property name="xalign">0</property>
676 <property name="label" translatable="yes">Enable this option only if you experience randomly garbled text in KDE4</property>
677 </widget>
678 <packing>
679 <property name="position">1</property>
680 </packing>
681 </child>
682 <child>
683 <widget class="GtkCheckButton" id="checkBox">
684 <property name="label" translatable="yes">Enable QT4 workaround</property>
685 <property name="can_focus">True</property>
686 <property name="receives_default">False</property>
687 <property name="draw_indicator">True</property>
688 </widget>
689 <packing>
690 <property name="position">2</property>
691 </packing>
692 </child>
693 </widget>
694 </child>
695 </widget>
696 <packing>
697 <property name="position">3</property>
698 </packing>
699 </child>
700 <child>
701 <widget class="GtkLabel" id="label3">
702 <property name="visible">True</property>
703 <property name="label" translatable="yes">Interface</property>
704 </widget>
705 <packing>
706 <property name="position">3</property>
707 <property name="tab_fill">False</property>
708 <property name="type">tab</property>
709 </packing>
710 </child>
711 </widget>
712 <packing>
713 <property name="position">2</property>
714 </packing>
715 </child>
716 <child internal-child="action_area">
717 <widget class="GtkHButtonBox" id="dialog-action_area1">
718 <property name="visible">True</property>
719 <property name="layout_style">end</property>
720 <child>
721 <widget class="GtkButton" id="button1">
722 <property name="label">gtk-cancel</property>
723 <property name="visible">True</property>
724 <property name="can_focus">True</property>
725 <property name="receives_default">True</property>
726 <property name="use_stock">True</property>
727 <signal name="clicked" handler="on_cancel"/>
728 </widget>
729 <packing>
730 <property name="expand">False</property>
731 <property name="fill">False</property>
732 <property name="position">0</property>
733 </packing>
734 </child>
735 <child>
736 <widget class="GtkButton" id="button2">
737 <property name="label">gtk-ok</property>
738 <property name="visible">True</property>
739 <property name="can_focus">True</property>
740 <property name="can_default">True</property>
741 <property name="has_default">True</property>
742 <property name="receives_default">True</property>
743 <property name="use_stock">True</property>
744 <signal name="clicked" handler="on_save"/>
745 </widget>
746 <packing>
747 <property name="expand">False</property>
748 <property name="fill">False</property>
749 <property name="position">1</property>
750 </packing>
751 </child>
752 </widget>
753 <packing>
754 <property name="expand">False</property>
755 <property name="pack_type">end</property>
756 <property name="position">0</property>
757 </packing>
758 </child>
759 </widget>
760 </child>
761 </widget>
762</glade-interface>
0763
=== added file 'glade/settingswidget.glade'
--- glade/settingswidget.glade 1970-01-01 00:00:00 +0000
+++ glade/settingswidget.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,197 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Tue Sep 1 17:30:47 2009 -->
4<glade-interface>
5 <widget class="GtkWindow" id="window1">
6 <child>
7 <widget class="GtkAlignment" id="settingswidget">
8 <property name="visible">True</property>
9 <property name="top_padding">5</property>
10 <property name="bottom_padding">5</property>
11 <child>
12 <widget class="GtkTable" id="table1">
13 <property name="visible">True</property>
14 <property name="n_rows">3</property>
15 <property name="n_columns">4</property>
16 <property name="column_spacing">5</property>
17 <property name="row_spacing">5</property>
18 <child>
19 <widget class="GtkLabel" id="label1">
20 <property name="visible">True</property>
21 <property name="xalign">0</property>
22 <property name="label" translatable="yes">Abbreviation:</property>
23 </widget>
24 <packing>
25 <property name="x_options">GTK_FILL</property>
26 </packing>
27 </child>
28 <child>
29 <widget class="GtkLabel" id="label2">
30 <property name="visible">True</property>
31 <property name="xalign">0</property>
32 <property name="label" translatable="yes">Hotkey:</property>
33 </widget>
34 <packing>
35 <property name="top_attach">1</property>
36 <property name="bottom_attach">2</property>
37 <property name="x_options">GTK_FILL</property>
38 </packing>
39 </child>
40 <child>
41 <widget class="GtkLabel" id="label3">
42 <property name="visible">True</property>
43 <property name="xalign">0</property>
44 <property name="label" translatable="yes">Window Filter:</property>
45 </widget>
46 <packing>
47 <property name="top_attach">2</property>
48 <property name="bottom_attach">3</property>
49 <property name="x_options">GTK_FILL</property>
50 </packing>
51 </child>
52 <child>
53 <widget class="GtkLabel" id="abbrLabel">
54 <property name="visible">True</property>
55 <property name="xalign">0</property>
56 <property name="label" translatable="yes">$abbr</property>
57 </widget>
58 <packing>
59 <property name="left_attach">1</property>
60 <property name="right_attach">2</property>
61 </packing>
62 </child>
63 <child>
64 <widget class="GtkLabel" id="hotkeyLabel">
65 <property name="visible">True</property>
66 <property name="xalign">0</property>
67 <property name="label" translatable="yes">$hotkey</property>
68 </widget>
69 <packing>
70 <property name="left_attach">1</property>
71 <property name="right_attach">2</property>
72 <property name="top_attach">1</property>
73 <property name="bottom_attach">2</property>
74 </packing>
75 </child>
76 <child>
77 <widget class="GtkLabel" id="windowFilterLabel">
78 <property name="visible">True</property>
79 <property name="xalign">0</property>
80 <property name="label" translatable="yes">$filter</property>
81 </widget>
82 <packing>
83 <property name="left_attach">1</property>
84 <property name="right_attach">2</property>
85 <property name="top_attach">2</property>
86 <property name="bottom_attach">3</property>
87 </packing>
88 </child>
89 <child>
90 <widget class="GtkButton" id="setAbbrButton">
91 <property name="width_request">80</property>
92 <property name="visible">True</property>
93 <property name="can_focus">True</property>
94 <property name="receives_default">True</property>
95 <property name="label" translatable="yes">Set</property>
96 <property name="response_id">0</property>
97 <signal name="clicked" handler="on_setAbbrButton_clicked"/>
98 </widget>
99 <packing>
100 <property name="left_attach">2</property>
101 <property name="right_attach">3</property>
102 <property name="x_options">GTK_FILL</property>
103 </packing>
104 </child>
105 <child>
106 <widget class="GtkButton" id="clearAbbrButton">
107 <property name="width_request">80</property>
108 <property name="visible">True</property>
109 <property name="can_focus">True</property>
110 <property name="receives_default">True</property>
111 <property name="label" translatable="yes">gtk-clear</property>
112 <property name="use_stock">True</property>
113 <property name="response_id">0</property>
114 <signal name="clicked" handler="on_clearAbbrButton_clicked"/>
115 </widget>
116 <packing>
117 <property name="left_attach">3</property>
118 <property name="right_attach">4</property>
119 <property name="x_options">GTK_FILL</property>
120 </packing>
121 </child>
122 <child>
123 <widget class="GtkButton" id="setHotkeyButton">
124 <property name="visible">True</property>
125 <property name="can_focus">True</property>
126 <property name="receives_default">True</property>
127 <property name="label" translatable="yes">Set</property>
128 <property name="response_id">0</property>
129 <signal name="clicked" handler="on_setHotkeyButton_clicked"/>
130 </widget>
131 <packing>
132 <property name="left_attach">2</property>
133 <property name="right_attach">3</property>
134 <property name="top_attach">1</property>
135 <property name="bottom_attach">2</property>
136 <property name="x_options">GTK_FILL</property>
137 </packing>
138 </child>
139 <child>
140 <widget class="GtkButton" id="setFilterButton">
141 <property name="visible">True</property>
142 <property name="can_focus">True</property>
143 <property name="receives_default">True</property>
144 <property name="label" translatable="yes">Set</property>
145 <property name="response_id">0</property>
146 <signal name="clicked" handler="on_setFilterButton_clicked"/>
147 </widget>
148 <packing>
149 <property name="left_attach">2</property>
150 <property name="right_attach">3</property>
151 <property name="top_attach">2</property>
152 <property name="bottom_attach">3</property>
153 <property name="x_options">GTK_FILL</property>
154 </packing>
155 </child>
156 <child>
157 <widget class="GtkButton" id="clearHotkeyButton">
158 <property name="visible">True</property>
159 <property name="can_focus">True</property>
160 <property name="receives_default">True</property>
161 <property name="label" translatable="yes">gtk-clear</property>
162 <property name="use_stock">True</property>
163 <property name="response_id">0</property>
164 <signal name="clicked" handler="on_clearHotkeyButton_clicked"/>
165 </widget>
166 <packing>
167 <property name="left_attach">3</property>
168 <property name="right_attach">4</property>
169 <property name="top_attach">1</property>
170 <property name="bottom_attach">2</property>
171 <property name="x_options">GTK_FILL</property>
172 </packing>
173 </child>
174 <child>
175 <widget class="GtkButton" id="clearFilterButton">
176 <property name="visible">True</property>
177 <property name="can_focus">True</property>
178 <property name="receives_default">True</property>
179 <property name="label" translatable="yes">gtk-clear</property>
180 <property name="use_stock">True</property>
181 <property name="response_id">0</property>
182 <signal name="clicked" handler="on_clearFilterButton_clicked"/>
183 </widget>
184 <packing>
185 <property name="left_attach">3</property>
186 <property name="right_attach">4</property>
187 <property name="top_attach">2</property>
188 <property name="bottom_attach">3</property>
189 <property name="x_options">GTK_FILL</property>
190 </packing>
191 </child>
192 </widget>
193 </child>
194 </widget>
195 </child>
196 </widget>
197</glade-interface>
0198
=== added file 'glade/windowfiltersettings.glade'
--- glade/windowfiltersettings.glade 1970-01-01 00:00:00 +0000
+++ glade/windowfiltersettings.glade 2010-03-26 15:01:22 +0000
@@ -0,0 +1,87 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3<!--Generated with glade3 3.4.5 on Fri Oct 2 11:17:13 2009 -->
4<glade-interface>
5 <widget class="GtkDialog" id="windowfiltersettings">
6 <property name="border_width">5</property>
7 <property name="title" translatable="yes">Set Window Filter</property>
8 <property name="resizable">False</property>
9 <property name="modal">True</property>
10 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12 <child internal-child="vbox">
13 <widget class="GtkVBox" id="dialog-vbox2">
14 <property name="visible">True</property>
15 <property name="spacing">5</property>
16 <child>
17 <widget class="GtkVBox" id="vbox2">
18 <property name="visible">True</property>
19 <property name="spacing">5</property>
20 <child>
21 <widget class="GtkLabel" id="label1">
22 <property name="visible">True</property>
23 <property name="xalign">0</property>
24 <property name="label" translatable="yes">Only trigger in windows with title matching:</property>
25 </widget>
26 </child>
27 <child>
28 <widget class="GtkEntry" id="triggerRegexEntry">
29 <property name="visible">True</property>
30 <property name="can_focus">True</property>
31 <property name="is_focus">True</property>
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>
33 <property name="activates_default">True</property>
34 <property name="truncate_multiline">True</property>
35 </widget>
36 <packing>
37 <property name="position">1</property>
38 </packing>
39 </child>
40 </widget>
41 <packing>
42 <property name="fill">False</property>
43 <property name="padding">5</property>
44 <property name="position">2</property>
45 </packing>
46 </child>
47 <child internal-child="action_area">
48 <widget class="GtkHButtonBox" id="dialog-action_area2">
49 <property name="visible">True</property>
50 <property name="layout_style">GTK_BUTTONBOX_END</property>
51 <child>
52 <widget class="GtkButton" id="cancelButton">
53 <property name="visible">True</property>
54 <property name="can_focus">True</property>
55 <property name="receives_default">True</property>
56 <property name="label" translatable="yes">gtk-cancel</property>
57 <property name="use_stock">True</property>
58 <property name="response_id">0</property>
59 <signal name="clicked" handler="on_cancel"/>
60 </widget>
61 </child>
62 <child>
63 <widget class="GtkButton" id="okButton">
64 <property name="visible">True</property>
65 <property name="can_focus">True</property>
66 <property name="can_default">True</property>
67 <property name="has_default">True</property>
68 <property name="receives_default">True</property>
69 <property name="label" translatable="yes">gtk-ok</property>
70 <property name="use_stock">True</property>
71 <property name="response_id">0</property>
72 <signal name="clicked" handler="on_ok"/>
73 </widget>
74 <packing>
75 <property name="position">1</property>
76 </packing>
77 </child>
78 </widget>
79 <packing>
80 <property name="expand">False</property>
81 <property name="pack_type">GTK_PACK_END</property>
82 </packing>
83 </child>
84 </widget>
85 </child>
86 </widget>
87</glade-interface>
088
=== modified file 'setup.py'
--- setup.py 2010-01-08 08:52:58 +0000
+++ setup.py 2010-03-26 15:01:22 +0000
@@ -20,7 +20,7 @@
2020
21setup(21setup(
22 name="autokey",22 name="autokey",
23 version="0.61.2", 23 version="0.61.5",
24 author="Chris Dekter",24 author="Chris Dekter",
25 author_email="cdekter@gmail.com",25 author_email="cdekter@gmail.com",
26 url="http://autokey.googlecode.com/",26 url="http://autokey.googlecode.com/",
@@ -33,10 +33,12 @@
33 #py_modules=["autokey", "configurationmanager", "expansionservice", "interface",33 #py_modules=["autokey", "configurationmanager", "expansionservice", "interface",
34 # "iomediator", "phrase", "phrasemenu", "ui"],34 # "iomediator", "phrase", "phrasemenu", "ui"],
35 package_dir={"autokey": "src/lib"},35 package_dir={"autokey": "src/lib"},
36 packages=["autokey", "autokey.ui"],36 packages=["autokey", "autokey.gtkui", "autokey.qtui"],
37 package_data={"autokey.ui" : ["data/gui.xml", "data/api.txt"]},37 package_data={"autokey.qtui" : ["data/*"],
38 data_files=[("/usr/share/pixmaps", ["config/akicon.png"]),38 "autokey.gtkui" : ["data/*"]},
39 ("/usr/share/applications", ["config/autokey.desktop"])],39 data_files=[("/usr/share/pixmaps", ["config/akicon.png", "config/akicon-status.png"]),
40 scripts=['autokey']40 ("/usr/share/applications", ["config/autokey-qt.desktop", "config/autokey-gtk.desktop"]),
41 ('share/man/man1/', ['doc/man/autokey-qt.1', 'doc/man/autokey-gtk.1'])],
42 scripts=['autokey-qt', 'autokey-gtk']
41 #packages=["plugin"]43 #packages=["plugin"]
42 )44 )
4345
=== removed file 'src/lib/autokey.py'
--- src/lib/autokey.py 2010-01-08 08:52:58 +0000
+++ src/lib/autokey.py 1970-01-01 00:00:00 +0000
@@ -1,280 +0,0 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2008 Chris Dekter
5
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20
21import sys, traceback, os.path, signal, logging, logging.handlers, subprocess, Queue
22from PyKDE4.kdecore import KCmdLineArgs, KCmdLineOptions, KAboutData, ki18n, i18n
23from PyKDE4.kdeui import KMessageBox, KApplication
24from PyQt4.QtCore import SIGNAL, Qt, QObject, QEvent
25from PyQt4.QtGui import QCursor
26
27import service, ui.notifier, ui.popupmenu
28from configmanager import *
29
30CONFIG_DIR = os.path.expanduser("~/.config/autokey")
31LOCK_FILE = CONFIG_DIR + "/autokey.pid"
32LOG_FILE = CONFIG_DIR + "/autokey.log"
33MAX_LOG_SIZE = 5 * 1024 * 1024 # 5 megabytes
34MAX_LOG_COUNT = 3
35LOG_FORMAT = "%(levelname)s - %(name)s - %(message)s"
36
37APP_NAME = "AutoKey"
38CATALOG = ""
39PROGRAM_NAME = ki18n("AutoKey")
40VERSION = "0.61.2"
41DESCRIPTION = ki18n("Desktop automation utility")
42LICENSE = KAboutData.License_GPL_V3
43COPYRIGHT = ki18n("(c) 2009 Chris Dekter")
44TEXT = ki18n("")
45HOMEPAGE = "http://autokey.sourceforge.net/"
46BUG_EMAIL = "cdekter@gmail.com"
47
48
49
50class Application:
51 """
52 Main application class; starting and stopping of the application is controlled
53 from here, together with some interactions from the tray icon.
54 """
55
56 def __init__(self):
57
58 aboutData = KAboutData(APP_NAME, CATALOG, PROGRAM_NAME, VERSION, DESCRIPTION,
59 LICENSE, COPYRIGHT, TEXT, HOMEPAGE, BUG_EMAIL)
60
61 aboutData.addAuthor(ki18n("Chris Dekter"), ki18n("Developer"), "cdekter@gmail.com", "")
62 aboutData.addAuthor(ki18n("Sam Peterson"), ki18n("Original developer"), "peabodyenator@gmail.com", "")
63 aboutData.setProgramIconName(ui.notifier.ICON_FILE)
64
65 KCmdLineArgs.init(sys.argv, aboutData)
66 options = KCmdLineOptions()
67 options.add("l").add("verbose", ki18n("Enable verbose logging"))
68 options.add("c").add("configure", ki18n("Show the configuration window on startup"))
69 KCmdLineArgs.addCmdLineOptions(options)
70 args = KCmdLineArgs.parsedArgs()
71
72
73 self.app = KApplication()
74
75 try:
76 # Create configuration directory
77 if not os.path.exists(CONFIG_DIR):
78 os.makedirs(CONFIG_DIR)
79 # Initialise logger
80 rootLogger = logging.getLogger()
81
82 if args.isSet("verbose"):
83 rootLogger.setLevel(logging.DEBUG)
84 handler = logging.StreamHandler(sys.stdout)
85 else:
86 rootLogger.setLevel(logging.INFO)
87 handler = logging.handlers.RotatingFileHandler(LOG_FILE,
88 maxBytes=MAX_LOG_SIZE, backupCount=MAX_LOG_COUNT)
89
90 handler.setFormatter(logging.Formatter(LOG_FORMAT))
91 rootLogger.addHandler(handler)
92
93
94 if self.__verifyNotRunning():
95 self.__createLockFile()
96
97 self.initialise(args.isSet("configure"))
98
99 except Exception, e:
100 self.show_error_dialog(i18n("Fatal error starting AutoKey.\n") + str(e))
101 logging.exception("Fatal error starting AutoKey: " + str(e))
102 sys.exit(1)
103
104
105 def __createLockFile(self):
106 f = open(LOCK_FILE, 'w')
107 f.write(str(os.getpid()))
108 f.close()
109
110 def __verifyNotRunning(self):
111 if os.path.exists(LOCK_FILE):
112 f = open(LOCK_FILE, 'r')
113 pid = f.read()
114 f.close()
115
116 # Check that the found PID is running and is autokey
117 p = subprocess.Popen(["ps", "-p", pid, "-o", "command"], stdout=subprocess.PIPE)
118 p.wait()
119 output = p.stdout.readlines()
120 if len(output) > 1:
121 # process exists
122 if "autokey" in output[1]:
123 logging.error("AutoKey is already running - exiting")
124 self.show_error_dialog(i18n("AutoKey is already running as pid: ") + pid)
125 sys.exit(1)
126
127 return True
128
129 def main(self):
130 self.app.exec_()
131
132 def initialise(self, configure):
133 logging.info("Initialising application")
134 self.configManager = get_config_manager(self)
135 self.service = service.Service(self)
136 self.serviceDisabled = False
137
138 # Initialise user code dir
139 if self.configManager.userCodeDir is not None:
140 sys.path.append(self.configManager.userCodeDir)
141
142 try:
143 self.service.start()
144 except Exception, e:
145 logging.exception("Error starting interface: " + str(e))
146 self.serviceDisabled = True
147 self.show_error_dialog(i18n("Error starting interface. Keyboard monitoring will be disabled.\n" +
148 "Check your system/configuration."), str(e))
149
150 self.notifier = ui.notifier.Notifier(self)
151 self.configWindow = None
152
153 if ConfigManager.SETTINGS[IS_FIRST_RUN] or configure:
154 ConfigManager.SETTINGS[IS_FIRST_RUN] = False
155 self.show_configure()
156
157 self.handler = CallbackEventHandler()
158
159 def init_global_hotkeys(self, configManager):
160 logging.info("Initialise global hotkeys")
161 configManager.toggleServiceHotkey.set_closure(self.toggle_service)
162 configManager.configHotkey.set_closure(self.show_configure_async)
163
164 def config_altered(self):
165 self.configManager.config_altered()
166 self.notifier.build_menu()
167
168 def unpause_service(self):
169 """
170 Unpause the expansion service (start responding to keyboard and mouse events).
171 """
172 self.service.unpause()
173 self.notifier.update_tool_tip()
174
175 def pause_service(self):
176 """
177 Pause the expansion service (stop responding to keyboard and mouse events).
178 """
179 self.service.pause()
180 self.notifier.update_tool_tip()
181
182 def toggle_service(self):
183 """
184 Convenience method for toggling the expansion service on or off.
185 """
186 if self.service.is_running():
187 self.pause_service()
188 else:
189 self.unpause_service()
190
191 def shutdown(self):
192 """
193 Shut down the entire application.
194 """
195 logging.info("Shutting down")
196 self.app.closeAllWindows()
197 self.service.shutdown()
198 self.app.quit()
199 os.remove(LOCK_FILE)
200
201 def show_notify(self, message, isError=False, details=''):
202 """
203 Show a notification popup.
204
205 @param message: Message to show in the popup
206 @param isError: Whether the message is an error (shows with an error icon)
207 @param details: Error details, which the user can view in a dialog by clicking
208 the "View Details" button.
209 """
210 self.notifier.show_notify(message, isError, details)
211
212 def show_configure(self):
213 """
214 Show the configuration window, or deiconify (un-minimise) it if it's already open.
215 """
216 logging.info("Displaying configuration window")
217 try:
218 self.configWindow.showNormal()
219 self.configWindow.activateWindow()
220 except:
221 self.configWindow = ui.configwindow.ConfigWindow(self)
222 self.configWindow.show()
223
224 def show_configure_async(self):
225 self.exec_in_main(self.show_configure)
226
227 def show_error_dialog(self, message, details=None):
228 """
229 Convenience method for showing an error dialog.
230 """
231 if details is None:
232 KMessageBox.error(None, message)
233 else:
234 KMessageBox.detailedError(None, message, details)
235
236 def show_script_error(self):
237 """
238 Show the last script error (if any)
239 """
240 if self.service.scriptRunner.error != '':
241 KMessageBox.information(None, self.service.scriptRunner.error, i18n("View Script Error Details"))
242 self.service.scriptRunner.error = ''
243 else:
244 KMessageBox.information(None, i18n("No error information available"), i18n("View Script Error Details"))
245
246 def show_popup_menu(self, folders=[], items=[], onDesktop=True, title=None):
247 self.exec_in_main(self.__createMenu, folders, items, onDesktop, title)
248
249 def hide_menu(self):
250 self.exec_in_main(self.menu.hide)
251
252 def __createMenu(self, folders, items, onDesktop, title):
253 self.menu = ui.popupmenu.PopupMenu(self.service, folders, items, onDesktop, title)
254 self.menu.popup(QCursor.pos())
255
256 def exec_in_main(self, callback, *args):
257 self.handler.postEventWithCallback(callback, *args)
258
259
260class CallbackEventHandler(QObject):
261
262 def __init__(self):
263 QObject.__init__(self)
264 self.queue = Queue.Queue()
265
266 def customEvent(self, event):
267 while True:
268 try:
269 callback, args = self.queue.get_nowait()
270 except Queue.Empty:
271 break
272 try:
273 callback(*args)
274 except Exception:
275 logging.warn("callback event failed: %r %r", callback, args, exc_info=True)
276
277 def postEventWithCallback(self, callback, *args):
278 self.queue.put((callback, args))
279 app = KApplication.kApplication()
280 app.postEvent(self, QEvent(QEvent.User))
2810
=== added file 'src/lib/common.py'
--- src/lib/common.py 1970-01-01 00:00:00 +0000
+++ src/lib/common.py 2010-03-26 15:01:22 +0000
@@ -0,0 +1,48 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2008 Chris Dekter
5
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20import os.path
21CONFIG_DIR = os.path.expanduser("~/.config/autokey")
22LOCK_FILE = CONFIG_DIR + "/autokey.pid"
23LOG_FILE = CONFIG_DIR + "/autokey.log"
24MAX_LOG_SIZE = 5 * 1024 * 1024 # 5 megabytes
25MAX_LOG_COUNT = 3
26LOG_FORMAT = "%(levelname)s - %(name)s - %(message)s"
27
28APP_NAME = "AutoKey"
29CATALOG = ""
30VERSION = "0.61.5"
31HOMEPAGE = "http://autokey.sourceforge.net/"
32BUG_EMAIL = "cdekter@gmail.com"
33
34FAQ_URL = "http://code.google.com/p/autokey/wiki/FAQ"
35HELP_URL = "http://code.google.com/p/autokey/w/list"
36DONATE_URL = "https://sourceforge.net/donate/index.php?group_id=216191"
37
38CONFIG_WINDOW_TITLE = "Configuration"
39
40ICON_FILE = "/usr/share/pixmaps/akicon.png"
41
42USING_QT = True
43
44# Misc
45DOMAIN_SOCKET_PATH = "/var/run/autokey-daemon"
46PACKET_SIZE = 32
47
48
049
=== modified file 'src/lib/configmanager.py'
--- src/lib/configmanager.py 2010-01-08 08:52:58 +0000
+++ src/lib/configmanager.py 2010-03-26 15:01:22 +0000
@@ -19,7 +19,7 @@
19import os, os.path, shutil, logging, pickle19import os, os.path, shutil, logging, pickle
20import iomediator, interface20import iomediator, interface
2121
22APP_VERSION = "0.61.2"22APP_VERSION = "0.61.5"
2323
24_logger = logging.getLogger("config-manager")24_logger = logging.getLogger("config-manager")
2525
2626
=== modified file 'src/lib/daemon.py'
--- src/lib/daemon.py 2009-12-16 08:46:43 +0000
+++ src/lib/daemon.py 2010-03-26 15:01:22 +0000
@@ -62,18 +62,27 @@
62 62
63 def delpid(self):63 def delpid(self):
64 os.remove(self.pidfile)64 os.remove(self.pidfile)
6565 def checkpid(self):
66 """Check for a pidfile to see if the daemon already runs
67
68 @references self.pidfile
69 @returns pid, an int representing the running daemon or None"""
70 try:
71 pf = file(self.pidfile,'r')
72 pid = int(pf.read().strip())
73 pf.close()
74 except IOError:
75 pid = None
76 except ValueError:
77 # the pidfile doesn't match our syntax, ignore it
78 pid = None
79 return pid
80
66 def start(self):81 def start(self):
67 """82 """
68 Start the daemon83 Start the daemon
69 """84 """
70 # Check for a pidfile to see if the daemon already runs85 pid = self.checkpid()
71 try:
72 pf = file(self.pidfile,'r')
73 pid = int(pf.read().strip())
74 pf.close()
75 except IOError:
76 pid = None
77 86
78 if pid:87 if pid:
79 message = "pidfile %s already exist. Daemon already running?\n"88 message = "pidfile %s already exist. Daemon already running?\n"
@@ -89,13 +98,8 @@
89 Stop the daemon98 Stop the daemon
90 """99 """
91 # Get the pid from the pidfile100 # Get the pid from the pidfile
92 try:101 pid = self.checkpid()
93 pf = file(self.pidfile,'r')102
94 pid = int(pf.read().strip())
95 pf.close()
96 except IOError:
97 pid = None
98
99 if not pid:103 if not pid:
100 message = "pidfile %s does not exist. Daemon not running?\n"104 message = "pidfile %s does not exist. Daemon not running?\n"
101 sys.stderr.write(message % self.pidfile)105 sys.stderr.write(message % self.pidfile)
102106
=== added file 'src/lib/gtkapp.py'
--- src/lib/gtkapp.py 1970-01-01 00:00:00 +0000
+++ src/lib/gtkapp.py 2010-03-26 15:01:22 +0000
@@ -0,0 +1,262 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2008 Chris Dekter
5
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20import common
21common.USING_QT = False
22
23import sys, traceback, os.path, signal, logging, logging.handlers, subprocess, Queue, optparse
24import gettext, gtk
25gettext.install("autokey")
26
27import service
28from gtkui.notifier import Notifier
29from gtkui.popupmenu import PopupMenu
30from gtkui.configwindow import ConfigWindow
31from gtkui.abbrselector import AbbrSelectorDialog
32from configmanager import *
33from common import *
34
35PROGRAM_NAME = _("AutoKey")
36DESCRIPTION = _("Desktop automation utility")
37#LICENSE = KAboutData.License_GPL_V3
38COPYRIGHT = _("(c) 2009 Chris Dekter")
39#TEXT = _("")
40
41
42class Application:
43 """
44 Main application class; starting and stopping of the application is controlled
45 from here, together with some interactions from the tray icon.
46 """
47
48 def __init__(self):
49 gtk.gdk.threads_init()
50
51 p = optparse.OptionParser()
52 p.add_option("-l", "--verbose", help="Enable verbose logging", action="store_true", default=False)
53 p.add_option("-c", "--configure", help="Show the configuration window on startup", action="store_true", default=False)
54 options, args = p.parse_args()
55
56 try:
57 # Create configuration directory
58 if not os.path.exists(CONFIG_DIR):
59 os.makedirs(CONFIG_DIR)
60
61 # Initialise logger
62 rootLogger = logging.getLogger()
63
64 if options.verbose:
65 rootLogger.setLevel(logging.DEBUG)
66 handler = logging.StreamHandler(sys.stdout)
67 else:
68 rootLogger.setLevel(logging.INFO)
69 handler = logging.handlers.RotatingFileHandler(LOG_FILE,
70 maxBytes=MAX_LOG_SIZE, backupCount=MAX_LOG_COUNT)
71
72 handler.setFormatter(logging.Formatter(LOG_FORMAT))
73 rootLogger.addHandler(handler)
74
75
76 if self.__verifyNotRunning():
77 self.__createLockFile()
78
79 self.initialise(options.configure)
80
81 except Exception, e:
82 self.show_error_dialog(_("Fatal error starting AutoKey.\n") + str(e))
83 logging.exception("Fatal error starting AutoKey: " + str(e))
84 sys.exit(1)
85
86
87 def __createLockFile(self):
88 f = open(LOCK_FILE, 'w')
89 f.write(str(os.getpid()))
90 f.close()
91
92 def __verifyNotRunning(self):
93 if os.path.exists(LOCK_FILE):
94 f = open(LOCK_FILE, 'r')
95 pid = f.read()
96 f.close()
97
98 # Check that the found PID is running and is autokey
99 p = subprocess.Popen(["ps", "-p", pid, "-o", "command"], stdout=subprocess.PIPE)
100 p.wait()
101 output = p.stdout.readlines()
102 if len(output) > 1:
103 # process exists
104 if "autokey" in output[1]:
105 logging.error("AutoKey is already running - exiting")
106 self.show_error_dialog(_("AutoKey is already running as pid: ") + pid)
107 sys.exit(1)
108
109 return True
110
111 def main(self):
112 gtk.main()
113
114 def initialise(self, configure):
115 logging.info("Initialising application")
116 self.configManager = get_config_manager(self)
117 self.service = service.Service(self)
118 self.serviceDisabled = False
119
120 # Initialise user code dir
121 if self.configManager.userCodeDir is not None:
122 sys.path.append(self.configManager.userCodeDir)
123
124 try:
125 self.service.start()
126 except Exception, e:
127 logging.exception("Error starting interface: " + str(e))
128 self.serviceDisabled = True
129 self.show_error_dialog(_("Error starting interface. Keyboard monitoring will be disabled.\n" +
130 "Check your system/configuration."), str(e))
131
132 self.notifier = Notifier(self)
133 self.configWindow = None
134 self.abbrPopup = None
135
136 if ConfigManager.SETTINGS[IS_FIRST_RUN] or configure:
137 ConfigManager.SETTINGS[IS_FIRST_RUN] = False
138 self.show_configure()
139
140 def init_global_hotkeys(self, configManager):
141 logging.info("Initialise global hotkeys")
142 configManager.toggleServiceHotkey.set_closure(self.toggle_service)
143 configManager.configHotkey.set_closure(self.show_configure_async)
144 configManager.showPopupHotkey.set_closure(self.show_abbr_async)
145
146 def config_altered(self):
147 self.configManager.config_altered()
148 #self.notifier.build_menu()
149
150 def unpause_service(self):
151 """
152 Unpause the expansion service (start responding to keyboard and mouse events).
153 """
154 self.service.unpause()
155 self.notifier.update_tool_tip()
156
157 def pause_service(self):
158 """
159 Pause the expansion service (stop responding to keyboard and mouse events).
160 """
161 self.service.pause()
162 self.notifier.update_tool_tip()
163
164 def toggle_service(self):
165 """
166 Convenience method for toggling the expansion service on or off.
167 """
168 if self.service.is_running():
169 self.pause_service()
170 else:
171 self.unpause_service()
172
173 def shutdown(self):
174 """
175 Shut down the entire application.
176 """
177 if self.configWindow is not None:
178 if self.configWindow.promptToSave():
179 return
180
181 logging.info("Shutting down")
182 self.service.shutdown()
183 gtk.main_quit()
184 os.remove(LOCK_FILE)
185
186 def show_notify(self, message, isError=False, details=''):
187 """
188 Show a notification popup.
189
190 @param message: Message to show in the popup
191 @param isError: Whether the message is an error (shows with an error icon)
192 @param details: Error details, which the user can view in a dialog by clicking
193 the "View Details" button.
194 """
195 self.notifier.show_notify(message, isError, details)
196
197 def show_configure(self):
198 """
199 Show the configuration window, or deiconify (un-minimise) it if it's already open.
200 """
201 logging.info("Displaying configuration window")
202 if self.configWindow is None:
203 self.configWindow = ConfigWindow(self)
204 self.configWindow.show()
205 else:
206 self.configWindow.deiconify()
207
208 def show_configure_async(self):
209 gtk.gdk.threads_enter()
210 self.show_configure()
211 gtk.gdk.threads_leave()
212
213 def show_abbr_selector(self):
214 """
215 Show the abbreviation autocompletion popup.
216 """
217 if self.abbrPopup is None:
218 logging.info("Displaying abbreviation popup")
219 self.abbrPopup = AbbrSelectorDialog(self)
220 self.abbrPopup.present()
221
222 def show_abbr_async(self):
223 gtk.gdk.threads_enter()
224 self.show_abbr_selector()
225 gtk.gdk.threads_leave()
226
227 def main(self):
228 logging.info("Entering main()")
229 gtk.main()
230
231 def show_error_dialog(self, message, details=None):
232 """
233 Convenience method for showing an error dialog.
234 """
235 dlg = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK,
236 message_format=message)
237 if details is not None:
238 dlg.format_secondary_text(details)
239 dlg.run()
240 dlg.destroy()
241
242 def show_script_error(self):
243 """
244 Show the last script error (if any)
245 """
246 if self.service.scriptRunner.error != '':
247 dlg = gtk.MessageDialog(type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK,
248 message_format=self.service.scriptRunner.error)
249 self.service.scriptRunner.error = ''
250 else:
251 dlg = gtk.MessageDialog(type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK,
252 message_format=_("No error information available"))
253
254 dlg.run()
255 dlg.destroy()
256
257 def show_popup_menu(self, folders=[], items=[], onDesktop=True, title=None):
258 self.menu = PopupMenu(self.service, folders, items, onDesktop, title)
259 self.menu.show_on_desktop()
260
261 def hide_menu(self):
262 self.menu.remove_from_desktop()
0263
=== added directory 'src/lib/gtkui'
=== added file 'src/lib/gtkui/__init__.py'
=== added file 'src/lib/gtkui/abbrselector.py'
--- src/lib/gtkui/abbrselector.py 1970-01-01 00:00:00 +0000
+++ src/lib/gtkui/abbrselector.py 2010-03-26 15:01:22 +0000
@@ -0,0 +1,93 @@
1# -*- coding: utf-8 -*-
2
3# Copyright (C) 2008 Chris Dekter
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19import gtk
20
21from autokey.configmanager import *
22import configwindow
23
24
25class AbbrSelectorDialog:
26
27 def __init__(self, app):
28 builder = configwindow.get_ui("abbrselector.xml")
29 self.ui = builder.get_object("abbrselector")
30 builder.connect_signals(self)
31 self.entry = builder.get_object("entry")
32
33 self.service = app.service
34 self.app = app
35 self.abbreviations = self.service.configManager.abbreviations
36
37 self.completion = gtk.EntryCompletion()
38 self.entry.set_completion(self.completion)
39 model = AbbreviationModel(self.abbreviations)
40 self.completion.set_model(model)
41 self.completion.set_text_column(0)
42
43 descriptionCell = gtk.CellRendererText()
44 self.completion.pack_start(descriptionCell)
45 self.completion.add_attribute(descriptionCell, "text", 1)
46 self.completion.set_inline_completion(True)
47 self.completion.set_inline_selection(True)
48 self.completion.connect("match-selected", self.on_match_selected)
49
50 self.set_keep_above(True)
51
52
53 def on_match_selected(self, completion, model, iter, data=None):
54 theItem = model.get_value(iter, AbbreviationModel.OBJECT_COLUMN)
55 self.service.item_selected(theItem)
56 self.hide()
57
58 def on_entry_activated(self, widget, data=None):
59 entered = self.entry.get_text()
60 for thePhrase in self.abbreviations:
61 if theItem.abbreviation == entered:
62 self.service.phrase_selected(None, theItem)
63 self.hide()
64
65 def on_close(self, widget, data=None):
66 self.destroy()
67 self.app.abbrPopup = None
68
69 def __getattr__(self, attr):
70 # Magic fudge to allow us to pretend to be the ui class we encapsulate
71 return getattr(self.ui, attr)
72
73
74class AbbreviationModel(gtk.ListStore):
75
76 OBJECT_COLUMN = 2
77
78 def __init__(self, abbreviations):
79 gtk.ListStore.__init__(self, str, str, object)
80
81 for item in abbreviations:
82 self.append((item.abbreviation, item.description, item))
83
84 def match(self, completion, keyString, iter, data=None):
85 abbreviation = self.get_value(iter, 0)
86 description = self.get_value(iter, 1)
87 if abbreviation.startswith(keyString):
88 return True
89 elif len(keyString) > 1:
90 if keyString in description:
91 return True
92
93 return False
094
=== added file 'src/lib/gtkui/configwindow.py'
--- src/lib/gtkui/configwindow.py 1970-01-01 00:00:00 +0000
+++ src/lib/gtkui/configwindow.py 2010-03-26 15:01:22 +0000
@@ -0,0 +1,1120 @@
1# -*- coding: utf-8 -*-
2
3# Copyright (C) 2009 Chris Dekter
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19import logging, sys, os, webbrowser, re
20import gtk, gtk.glade, gtksourceview2
21
22from dialogs import *
23from settingsdialog import SettingsDialog
24from autokey.configmanager import *
25from autokey.iomediator import Recorder
26from autokey import model, common
27
28CONFIG_WINDOW_TITLE = _(common.CONFIG_WINDOW_TITLE + " - AutoKey")
29
30
31WEBSITE = "http://code.google.com/p/autokey"
32
33UI_DESCRIPTION_FILE = os.path.join(os.path.dirname(__file__), "data/menus.xml")
34
35def get_ui(fileName):
36 builder = gtk.Builder()
37 uiFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data/" + fileName)
38 builder.add_from_file(uiFile)
39 return builder
40
41class SettingsWidget:
42
43 KEY_MAP = HotkeySettingsDialog.KEY_MAP
44 REVERSE_KEY_MAP = HotkeySettingsDialog.REVERSE_KEY_MAP
45
46 def __init__(self, parentWindow):
47 self.parentWindow = parentWindow
48 builder = get_ui("settingswidget.xml")
49 self.ui = builder.get_object("settingswidget")
50 builder.connect_signals(self)
51
52 self.abbrDialog = AbbrSettingsDialog(parentWindow.ui, parentWindow.app.configManager, self.on_abbr_response)
53 self.hotkeyDialog = HotkeySettingsDialog(parentWindow.ui, parentWindow.app.configManager, self.on_hotkey_response)
54 self.filterDialog = WindowFilterSettingsDialog(parentWindow.ui)
55
56 self.abbrLabel = builder.get_object("abbrLabel")
57 self.clearAbbrButton = builder.get_object("clearAbbrButton")
58 self.hotkeyLabel = builder.get_object("hotkeyLabel")
59 self.clearHotkeyButton = builder.get_object("clearHotkeyButton")
60 self.windowFilterLabel = builder.get_object("windowFilterLabel")
61 self.clearFilterButton = builder.get_object("clearFilterButton")
62
63 def load(self, item):
64 self.currentItem = item
65
66 self.abbrDialog.load(self.currentItem)
67 if model.TriggerMode.ABBREVIATION in item.modes:
68 self.abbrLabel.set_text(item.abbreviation)
69 self.clearAbbrButton.set_sensitive(True)
70 self.abbrEnabled = True
71 else:
72 self.abbrLabel.set_text(_("(None configured)"))
73 self.clearAbbrButton.set_sensitive(False)
74 self.abbrEnabled = False
75
76 self.hotkeyDialog.load(self.currentItem)
77 if model.TriggerMode.HOTKEY in item.modes:
78 key = item.hotKey
79 self.hotkeyLabel.set_text(self.build_hotkey_string(key, item.modifiers))
80 self.clearHotkeyButton.set_sensitive(True)
81 self.hotkeyEnabled = True
82 else:
83 self.hotkeyLabel.set_text(_("(None configured)"))
84 self.clearHotkeyButton.set_sensitive(False)
85 self.hotkeyEnabled = False
86
87 self.filterDialog.load(self.currentItem)
88 if item.uses_default_filter():
89 self.windowFilterLabel.set_text(_("(None configured)"))
90 self.clearFilterButton.set_sensitive(False)
91 self.filterEnabled = False
92 else:
93 self.windowFilterLabel.set_text(item.get_filter_regex())
94 self.clearFilterButton.set_sensitive(True)
95 self.filterEnabled = True
96
97 def save(self):
98 self.currentItem.set_modes([])
99 if self.abbrEnabled:
100 self.abbrDialog.save(self.currentItem)
101 if self.hotkeyEnabled:
102 self.hotkeyDialog.save(self.currentItem)
103 if self.filterEnabled:
104 self.filterDialog.save(self.currentItem)
105 else:
106 self.currentItem.set_window_titles(None)
107
108 def set_dirty(self):
109 self.parentWindow.set_dirty(True)
110
111 # ---- Signal handlers
112
113 def on_setAbbrButton_clicked(self, widget, data=None):
114 self.abbrDialog.run()
115
116 def on_abbr_response(self, res):
117 if res == gtk.RESPONSE_OK:
118 self.set_dirty()
119 self.abbrEnabled = True
120 self.abbrLabel.set_text(self.abbrDialog.get_abbr())
121 self.clearAbbrButton.set_sensitive(True)
122
123 def on_clearAbbrButton_clicked(self, widget, data=None):
124 self.set_dirty()
125 self.abbrEnabled = False
126 self.clearAbbrButton.set_sensitive(False)
127 self.abbrLabel.set_text(_("(None configured)"))
128 self.abbrDialog.reset()
129
130 def on_setHotkeyButton_clicked(self, widget, data=None):
131 self.hotkeyDialog.run()
132
133 def on_hotkey_response(self, res):
134 if res == gtk.RESPONSE_OK:
135 self.set_dirty()
136 self.hotkeyEnabled = True
137 key = self.hotkeyDialog.key
138 modifiers = self.hotkeyDialog.build_modifiers()
139 self.hotkeyLabel.set_text(self.build_hotkey_string(key, modifiers))
140 self.clearHotkeyButton.set_sensitive(True)
141
142 def on_clearHotkeyButton_clicked(self, widget, data=None):
143 self.set_dirty()
144 self.hotkeyEnabled = False
145 self.clearHotkeyButton.set_sensitive(False)
146 self.hotkeyLabel.set_text(_("(None configured)"))
147 self.hotkeyDialog.reset()
148
149 def on_setFilterButton_clicked(self, widget, data=None):
150 if self.filterDialog.run() == gtk.RESPONSE_OK:
151 self.set_dirty()
152 filterText = self.filterDialog.get_filter_text()
153 if filterText != "":
154 self.filterEnabled = True
155 self.clearFilterButton.set_sensitive(True)
156 self.windowFilterLabel.set_text(filterText)
157 else:
158 self.filterEnabled = False
159 self.clearFilterButton.set_sensitive(False)
160 self.windowFilterLabel.set_text(_("(None configured)"))
161
162 def on_clearFilterButton_clicked(self, widget, data=None):
163 self.set_dirty()
164 self.filterEnabled = False
165 self.clearFilterButton.set_sensitive(False)
166 self.windowFilterLabel.set_text(_("(None configured)"))
167 self.filterDialog.reset()
168
169 def build_hotkey_string(self, key, modifiers):
170 hotkey = ""
171
172 for modifier in modifiers:
173 hotkey += modifier
174 hotkey += "+"
175
176 if key in self.KEY_MAP:
177 keyText = self.KEY_MAP[key]
178 else:
179 keyText = key
180 hotkey += keyText
181
182 return hotkey
183
184 def __getattr__(self, attr):
185 # Magic fudge to allow us to pretend to be the ui class we encapsulate
186 return getattr(self.ui, attr)
187
188
189class FolderPage:
190
191 def __init__(self, parentWindow):
192 self.parentWindow = parentWindow
193 builder = get_ui("folderpage.xml")
194 self.ui = builder.get_object("folderpage")
195 builder.connect_signals(self)
196
197 self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox")
198
199 vbox = builder.get_object("settingsVbox")
200 self.settingsWidget = SettingsWidget(parentWindow)
201 vbox.pack_start(self.settingsWidget.ui)
202
203 def load(self, theFolder):
204 self.currentFolder = theFolder
205 self.showInTrayCheckbox.set_active(theFolder.showInTrayMenu)
206 self.settingsWidget.load(theFolder)
207
208 def save(self):
209 self.currentFolder.showInTrayMenu = self.showInTrayCheckbox.get_active()
210 self.settingsWidget.save()
211
212 def set_item_title(self, newTitle):
213 self.currentFolder.title = newTitle.decode("utf-8")
214 #self.titleEntry.set_text(newTitle) # TODO testing remove me later
215
216 def reset(self):
217 self.load(self.currentFolder)
218
219 def validate(self):
220 return True
221
222 def on_modified(self, widget, data=None):
223 self.set_dirty()
224
225 def set_dirty(self):
226 self.parentWindow.set_dirty(True)
227
228
229class OldPhrasePage:
230
231 def __init__(self, parentWindow):
232 self.parentWindow = parentWindow
233 builder = get_ui("phrasepage.xml")
234 self.ui = builder.get_object("phrasepage")
235 builder.connect_signals(self)
236
237 self.descriptionEntry = builder.get_object("descriptionEntry")
238 self.phraseText = builder.get_object("phraseText")
239 self.promptCheckbox = builder.get_object("promptCheckbox")
240 self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox")
241
242 vbox = builder.get_object("settingsVbox")
243 self.settingsWidget = SettingsWidget(parentWindow)
244 vbox.pack_start(self.settingsWidget.ui)
245
246 def load(self, thePhrase):
247 self.currentPhrase = thePhrase
248 self.descriptionEntry.set_text(thePhrase.description.encode("utf-8"))
249 buffer = gtk.TextBuffer()
250 buffer.set_text(thePhrase.phrase.encode("utf-8"))
251 buffer.connect("changed", self.on_modified)
252 self.phraseText.set_buffer(buffer)
253 self.promptCheckbox.set_active(thePhrase.prompt)
254 self.showInTrayCheckbox.set_active(thePhrase.showInTrayMenu)
255 self.settingsWidget.load(thePhrase)
256
257 def save(self):
258 self.currentPhrase.description = self.descriptionEntry.get_text().decode("utf-8")
259
260 buffer = self.phraseText.get_buffer()
261 self.currentPhrase.phrase = buffer.get_text(buffer.get_start_iter(),
262 buffer.get_end_iter()).decode("utf-8")
263
264 self.currentPhrase.prompt = self.promptCheckbox.get_active()
265 self.currentPhrase.showInTrayMenu = self.showInTrayCheckbox.get_active()
266
267 self.settingsWidget.save()
268
269 def reset(self):
270 self.load(self.currentPhrase)
271
272 def validate(self):
273 if not validate(not EMPTY_FIELD_REGEX.match(self.descriptionEntry.get_text()),
274 _("The phrase description can't be empty"), self.descriptionEntry, self.parentWindow.ui):
275 return False
276
277 buffer = self.phraseText.get_buffer()
278 text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())
279 if not validate(not EMPTY_FIELD_REGEX.match(text), _("The phrase content can't be empty"), self.phraseText,
280 self.parentWindow.ui):
281 return False
282
283 return True
284
285 def on_modified(self, widget, data=None):
286 self.set_dirty()
287
288 def set_dirty(self):
289 self.parentWindow.set_dirty(True)
290
291
292class ScriptPage:
293
294 def __init__(self, parentWindow):
295 self.parentWindow = parentWindow
296 builder = get_ui("scriptpage.xml")
297 self.ui = builder.get_object("scriptpage")
298 builder.connect_signals(self)
299
300 self.buffer = gtksourceview2.Buffer()
301 self.buffer.connect("changed", self.on_modified)
302 self.editor = gtksourceview2.View(self.buffer)
303 scrolledWindow = builder.get_object("scrolledWindow")
304 scrolledWindow.add(self.editor)
305 self.promptCheckbox = builder.get_object("promptCheckbox")
306 self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox")
307
308 vbox = builder.get_object("settingsVbox")
309 self.settingsWidget = SettingsWidget(parentWindow)
310 vbox.pack_start(self.settingsWidget.ui)
311
312 # Configure script editor
313 self.__m = gtksourceview2.LanguageManager()
314 self.__sm = gtksourceview2.StyleSchemeManager()
315 self.buffer.set_language(self.__m.get_language("python"))
316 self.buffer.set_style_scheme(self.__sm.get_scheme("kate"))
317 self.editor.set_auto_indent(True)
318 self.editor.set_smart_home_end(True)
319 self.editor.set_insert_spaces_instead_of_tabs(True)
320 self.editor.set_tab_width(4)
321
322 self.ui.show_all()
323
324 def load(self, theScript):
325 self.currentItem = theScript
326
327 self.buffer.begin_not_undoable_action()
328 self.buffer.set_text(theScript.code.encode("utf-8"))
329 self.buffer.end_not_undoable_action()
330 self.buffer.place_cursor(self.buffer.get_start_iter())
331
332 self.promptCheckbox.set_active(theScript.prompt)
333 self.showInTrayCheckbox.set_active(theScript.showInTrayMenu)
334 self.settingsWidget.load(theScript)
335
336 def save(self):
337 self.currentItem.code = self.buffer.get_text(self.buffer.get_start_iter(),
338 self.buffer.get_end_iter()).decode("utf-8")
339
340 self.currentItem.prompt = self.promptCheckbox.get_active()
341 self.currentItem.showInTrayMenu = self.showInTrayCheckbox.get_active()
342
343 self.settingsWidget.save()
344
345 def set_item_title(self, newTitle):
346 self.currentItem.description = newTitle.decode("utf-8")
347
348
349 def reset(self):
350 self.load(self.currentItem)
351 self.parentWindow.set_undo_available(False)
352 self.parentWindow.set_redo_available(False)
353
354 def validate(self):
355 text = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter())
356 if not validate(not EMPTY_FIELD_REGEX.match(text), _("The script code can't be empty"), self.editor,
357 self.parentWindow.ui):
358 return False
359
360 return True
361
362 def start_record(self):
363 self.buffer.insert(self.buffer.get_end_iter(), "\n")
364
365 def start_key_sequence(self):
366 self.buffer.insert(self.buffer.get_end_iter(), "keyboard.send_keys(\"")
367
368 def end_key_sequence(self):
369 self.buffer.insert(self.buffer.get_end_iter(), "\")\n")
370
371 def append_key(self, key):
372 #line, pos = self.buffer.getCursorPosition()
373 self.buffer.insert(self.buffer.get_end_iter(), key)
374 #self.scriptCodeEditor.setCursorPosition(line, pos + len(key))
375
376 def append_hotkey(self, key, modifiers):
377 #line, pos = self.scriptCodeEditor.getCursorPosition()
378 keyString = self.settingsWidget.build_hotkey_string(key, modifiers)
379 self.buffer.insert(self.buffer.get_end_iter(), keyString)
380 #self.scriptCodeEditor.setCursorPosition(line, pos + len(keyString))
381
382 def append_mouseclick(self, xCoord, yCoord, button, windowTitle):
383 self.buffer.insert(self.buffer.get_end_iter(), "mouse.click_relative(%d, %d, %d) # %s\n" % (xCoord, yCoord, int(button), windowTitle))
384
385 def undo(self):
386 self.buffer.undo()
387 self.parentWindow.set_undo_available(self.buffer.can_undo())
388 self.parentWindow.set_redo_available(self.buffer.can_redo())
389
390 def redo(self):
391 self.buffer.redo()
392 self.parentWindow.set_undo_available(self.buffer.can_undo())
393 self.parentWindow.set_redo_available(self.buffer.can_redo())
394
395 def on_modified(self, widget, data=None):
396 self.set_dirty()
397 self.parentWindow.set_undo_available(self.buffer.can_undo())
398 self.parentWindow.set_redo_available(self.buffer.can_redo())
399
400 def set_dirty(self):
401 self.parentWindow.set_dirty(True)
402
403
404class PhrasePage(ScriptPage):
405
406 def __init__(self, parentWindow):
407 self.parentWindow = parentWindow
408 builder = get_ui("phrasepage.xml")
409 self.ui = builder.get_object("phrasepage")
410 builder.connect_signals(self)
411
412 self.buffer = gtksourceview2.Buffer()
413 self.buffer.connect("changed", self.on_modified)
414 self.editor = gtksourceview2.View(self.buffer)
415 scrolledWindow = builder.get_object("scrolledWindow")
416 scrolledWindow.add(self.editor)
417 self.promptCheckbox = builder.get_object("promptCheckbox")
418 self.showInTrayCheckbox = builder.get_object("showInTrayCheckbox")
419
420 vbox = builder.get_object("settingsVbox")
421 self.settingsWidget = SettingsWidget(parentWindow)
422 vbox.pack_start(self.settingsWidget.ui)
423
424 # Configure script editor
425 #self.__m = gtksourceview2.LanguageManager()
426 self.__sm = gtksourceview2.StyleSchemeManager()
427 self.buffer.set_language(None)
428 self.buffer.set_style_scheme(self.__sm.get_scheme("kate"))
429 self.buffer.set_highlight_matching_brackets(False)
430 self.editor.set_auto_indent(False)
431 self.editor.set_smart_home_end(False)
432 self.editor.set_insert_spaces_instead_of_tabs(True)
433 self.editor.set_tab_width(4)
434
435 self.ui.show_all()
436
437 def load(self, thePhrase):
438 self.currentItem = thePhrase
439
440 self.buffer.begin_not_undoable_action()
441 self.buffer.set_text(thePhrase.phrase.encode("utf-8"))
442 self.buffer.end_not_undoable_action()
443 self.buffer.place_cursor(self.buffer.get_start_iter())
444
445 self.promptCheckbox.set_active(thePhrase.prompt)
446 self.showInTrayCheckbox.set_active(thePhrase.showInTrayMenu)
447 self.settingsWidget.load(thePhrase)
448
449 def save(self):
450 self.currentItem.phrase = self.buffer.get_text(self.buffer.get_start_iter(),
451 self.buffer.get_end_iter()).decode("utf-8")
452
453 self.currentItem.prompt = self.promptCheckbox.get_active()
454 self.currentItem.showInTrayMenu = self.showInTrayCheckbox.get_active()
455
456 self.settingsWidget.save()
457
458class ConfigWindow:
459
460 def __init__(self, app):
461 self.app = app
462 self.cutCopiedItems = []
463
464 builder = get_ui("mainwindow.xml")
465 self.ui = builder.get_object("mainwindow")
466 builder.connect_signals(self)
467
468 # Menus and Actions
469 self.uiManager = gtk.UIManager()
470 self.add_accel_group(self.uiManager.get_accel_group())
471
472 # Menu Bar
473 actionGroup = gtk.ActionGroup("menu")
474 actions = [
475 ("File", None, "_File"),
476 ("create", None, "Create..."),
477 ("new-top-folder", "folder-new", "New _Top-Level Folder", "", "Create a new top-level phrase folder", self.on_new_topfolder),
478 ("new-folder", "folder-new", "New _Folder", "", "Create a new phrase folder in the current folder", self.on_new_folder),
479 ("new-phrase", gtk.STOCK_NEW, "New _Phrase", "<control>n", "Create a new phrase in the current folder", self.on_new_phrase),
480 ("new-script", gtk.STOCK_NEW, "New _Script", "<control><shift>n", "Create a new script in the current folder", self.on_new_script),
481 ("save", gtk.STOCK_SAVE, "_Save", None, "Save changes to current item", self.on_save),
482 ("close-window", gtk.STOCK_CLOSE, "_Close window", None, "Close the configuration window", self.on_close),
483 ("quit", gtk.STOCK_QUIT, "_Quit", None, "Completely exit AutoKey", self.on_quit),
484 ("Edit", None, "_Edit"),
485 ("cut-item", gtk.STOCK_CUT, "Cu_t Item(s)", "<control><shift>x", "Cut the selected item", self.on_cut_item),
486 ("copy-item", gtk.STOCK_COPY, "_Copy Item(s)", "<control><shift>c", "Copy the selected item", self.on_copy_item),
487 ("paste-item", gtk.STOCK_PASTE, "_Paste Item(s)", "<control><shift>v", "Paste the last cut/copied item", self.on_paste_item),
488 ("delete-item", gtk.STOCK_DELETE, "_Delete Item(s)", "<control>d", "Delete the selected item", self.on_delete_item),
489 ("rename", None, "_Rename", "", "Rename the selected item", self.on_rename),
490 ("undo", gtk.STOCK_UNDO, "_Undo", "<control>z", "Undo the last edit", self.on_undo),
491 ("redo", gtk.STOCK_REDO, "_Redo", "<control><shift>z", "Redo the last undone edit", self.on_redo),
492 ("preferences", gtk.STOCK_PREFERENCES, "_Preferences", "", "Additional options", self.on_advanced_settings),
493 ("View", None, "_View"),
494 ("script-error", gtk.STOCK_DIALOG_ERROR, "Vie_w script error", None, "View script error information", self.on_show_error),
495 #("Settings", None, "_Settings", None, None, None),
496 #("advanced", gtk.STOCK_PREFERENCES, "_Advanced Settings", "", "Advanced configuration options", self.on_advanced_settings),
497 ("Help", None, "_Help"),
498 ("faq", None, "_F.A.Q.", None, "Display Frequently Asked Questions", self.on_show_faq),
499 ("help", gtk.STOCK_HELP, "Online _Help", None, "Display Online Help", self.on_show_help),
500 ("donate", gtk.STOCK_YES, "Donate", "", "Make A Donation", self.on_donate),
501 ("about", gtk.STOCK_ABOUT, "About AutoKey", None, "Show program information", self.on_show_about)
502 ]
503 actionGroup.add_actions(actions)
504
505 toggleActions = [
506 #("enable-monitoring", None, "_Enable Monitoring", None, "Toggle monitoring on/off", self.on_enable_toggled),
507 ("toolbar", None, "_Show Toolbar", None, "Show/hide the toolbar", self.on_toggle_toolbar),
508 ("record", gtk.STOCK_MEDIA_RECORD, "R_ecord Macro", None, "Record a keyboard/mouse macro", self.on_record_keystrokes),
509 ]
510 actionGroup.add_toggle_actions(toggleActions)
511
512 self.uiManager.insert_action_group(actionGroup, 0)
513 self.uiManager.add_ui_from_file(UI_DESCRIPTION_FILE)
514 self.vbox = builder.get_object("vbox")
515 self.vbox.pack_end(self.uiManager.get_widget("/MenuBar"), False, False)
516
517 # Toolbar 'create' button
518 create = gtk.MenuToolButton(gtk.STOCK_NEW)
519 create.show()
520 menu = self.uiManager.get_widget('/MenuBar/File/create').get_submenu()
521 create.set_menu(menu)
522 toolbar = self.uiManager.get_widget('/Toolbar')
523 s = gtk.SeparatorToolItem()
524 s.show()
525 toolbar.insert(s, 0)
526 toolbar.insert(create, 0)
527 #if ConfigManager.SETTINGS[SHOW_TOOLBAR]:
528 # self.__addToolbar()
529 self.uiManager.get_action("/MenuBar/View/toolbar").set_active(ConfigManager.SETTINGS[SHOW_TOOLBAR])
530
531 self.treeView = builder.get_object("treeWidget")
532 self.__initTreeWidget()
533
534 self.stack = builder.get_object("stack")
535 self.__initStack()
536
537 self.saveButton = builder.get_object("saveButton")
538 self.revertButton = builder.get_object("revertButton")
539 self.hpaned = builder.get_object("hpaned")
540
541 #self.uiManager.get_action("/MenuBar/Settings/enable-monitoring").set_active(app.service.is_running())
542 #self.uiManager.get_action("/MenuBar/Settings/enable-monitoring").set_sensitive(not app.serviceDisabled)
543
544 rootIter = self.treeView.get_model().get_iter_root()
545 self.treeView.get_selection().select_iter(rootIter)
546 self.on_tree_selection_changed(self.treeView)
547
548 width, height = ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE]
549 self.set_default_size(width, height)
550 self.hpaned.set_position(ConfigManager.SETTINGS[HPANE_POSITION])
551
552 self.recorder = Recorder(self.scriptPage)
553
554 def __addToolbar(self):
555 toolbar = self.uiManager.get_widget('/Toolbar')
556 self.vbox.pack_end(toolbar, False, False)
557 self.vbox.reorder_child(toolbar, 1)
558
559 def cancel_record(self):
560 if self.uiManager.get_widget("/MenuBar/Edit/record").get_active():
561 self.uiManager.get_widget("/MenuBar/Edit/record").set_active(False)
562 self.recorder.stop()
563
564 def save_completed(self):
565 self.saveButton.set_sensitive(False)
566 self.uiManager.get_action("/MenuBar/File/save").set_sensitive(False)
567 self.app.config_altered()
568
569 def set_dirty(self, dirty):
570 self.dirty = dirty
571 self.uiManager.get_action("/MenuBar/File/save").set_sensitive(dirty)
572 self.saveButton.set_sensitive(dirty)
573 self.revertButton.set_sensitive(dirty)
574
575 def update_actions(self, items, changed):
576 canCreate = isinstance(items[0], model.Folder) and len(items) == 1
577 canCopy = True
578 for item in items:
579 if isinstance(item, model.Folder):
580 canCopy = False
581 break
582
583 self.uiManager.get_action("/MenuBar/File/create").set_sensitive(True)
584 self.uiManager.get_action("/MenuBar/File/create/new-top-folder").set_sensitive(True)
585 self.uiManager.get_action("/MenuBar/File/create/new-folder").set_sensitive(canCreate)
586 self.uiManager.get_action("/MenuBar/File/create/new-phrase").set_sensitive(canCreate)
587 self.uiManager.get_action("/MenuBar/File/create/new-script").set_sensitive(canCreate)
588
589 self.uiManager.get_action("/MenuBar/Edit/copy-item").set_sensitive(canCopy)
590 self.uiManager.get_action("/MenuBar/Edit/paste-item").set_sensitive(canCreate and len(self.cutCopiedItems) > 0)
591 self.uiManager.get_action("/MenuBar/Edit/record").set_sensitive(isinstance(items[0], model.Script) and len(items) == 1)
592
593 if changed:
594 self.uiManager.get_action("/MenuBar/File/save").set_sensitive(False)
595 self.saveButton.set_sensitive(False)
596 self.uiManager.get_action("/MenuBar/Edit/undo").set_sensitive(False)
597 self.uiManager.get_action("/MenuBar/Edit/redo").set_sensitive(False)
598
599 def set_undo_available(self, state):
600 self.uiManager.get_action("/MenuBar/Edit/undo").set_sensitive(state)
601
602 def set_redo_available(self, state):
603 self.uiManager.get_action("/MenuBar/Edit/redo").set_sensitive(state)
604
605 def refresh_tree(self):
606 model, selectedPaths = self.treeView.get_selection().get_selected_rows()
607 for path in selectedPaths:
608 model.update_item(model[path].iter, self.__getTreeSelection())
609
610 # ---- Signal handlers ----
611
612 def on_save(self, widget, data=None):
613 if self.__getCurrentPage().validate():
614 self.__getCurrentPage().save()
615 self.save_completed()
616 self.set_dirty(False)
617
618 self.refresh_tree()
619
620 def on_reset(self, widget, data=None):
621 self.__getCurrentPage().reset()
622 self.set_dirty(False)
623 self.cancel_record()
624
625 def queryClose(self):
626 if self.dirty:
627 return self.promptToSave()
628
629 return False
630
631 def on_close(self, widget, data=None):
632 ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE] = self.get_size()
633 ConfigManager.SETTINGS[HPANE_POSITION] = self.hpaned.get_position()
634 self.cancel_record()
635 if self.queryClose():
636 return True
637 else:
638 self.hide()
639 self.destroy()
640 self.app.configWindow = None
641 self.app.config_altered()
642
643 def on_quit(self, widget, data=None):
644 #if not self.queryClose():
645 ConfigManager.SETTINGS[WINDOW_DEFAULT_SIZE] = self.get_size()
646 ConfigManager.SETTINGS[HPANE_POSITION] = self.hpaned.get_position()
647 self.app.shutdown()
648
649 # File Menu
650
651 def on_new_topfolder(self, widget, data=None):
652 self.__createFolder(None)
653
654 def on_new_folder(self, widget, data=None):
655 theModel, selectedPaths = self.treeView.get_selection().get_selected_rows()
656 parentIter = theModel[selectedPaths[0]].iter
657 self.__createFolder(parentIter)
658
659 def __createFolder(self, parentIter):
660 theModel = self.treeView.get_model()
661 newFolder = model.Folder("New Folder")
662 newIter = theModel.append_item(newFolder, parentIter)
663 self.treeView.expand_to_path(theModel.get_path(newIter))
664 self.treeView.get_selection().unselect_all()
665 self.treeView.get_selection().select_iter(newIter)
666 self.on_tree_selection_changed(self.treeView)
667 self.on_rename(self.treeView)
668
669 def on_new_phrase(self, widget, data=None):
670 theModel, selectedPaths = self.treeView.get_selection().get_selected_rows()
671 parentIter = theModel[selectedPaths[0]].iter
672 newPhrase = model.Phrase("New Phrase", "Enter phrase contents")
673 newIter = theModel.append_item(newPhrase, parentIter)
674 self.treeView.expand_to_path(theModel.get_path(newIter))
675 self.treeView.get_selection().unselect_all()
676 self.treeView.get_selection().select_iter(newIter)
677 self.on_tree_selection_changed(self.treeView)
678 self.on_rename(self.treeView)
679
680 def on_new_script(self, widget, data=None):
681 theModel, selectedPaths = self.treeView.get_selection().get_selected_rows()
682 parentIter = theModel[selectedPaths[0]].iter
683 newScript = model.Script("New Script", "# Enter script code")
684 newIter = theModel.append_item(newScript, parentIter)
685 self.treeView.expand_to_path(theModel.get_path(newIter))
686 self.treeView.get_selection().unselect_all()
687 self.treeView.get_selection().select_iter(newIter)
688 self.on_tree_selection_changed(self.treeView)
689 self.on_rename(self.treeView)
690
691 # Edit Menu
692
693 def on_cut_item(self, widget, data=None):
694 self.cutCopiedItems = self.__getTreeSelection()
695 selection = self.treeView.get_selection()
696 model, selectedPaths = selection.get_selected_rows()
697 refs = []
698 for path in selectedPaths:
699 refs.append(gtk.TreeRowReference(model, path))
700
701 for ref in refs:
702 if ref.valid():
703 self.__removeItem(model, model[ref.get_path()].iter)
704
705 if len(selectedPaths) > 1:
706 self.treeView.get_selection().unselect_all()
707 self.treeView.get_selection().select_iter(model.get_iter_root())
708 self.on_tree_selection_changed(self.treeView)
709
710 self.app.config_altered()
711
712 def on_copy_item(self, widget, data=None):
713 sourceObjects = self.__getTreeSelection()
714
715 for source in sourceObjects:
716 if isinstance(source, model.Phrase):
717 newObj = model.Phrase('', '')
718 else:
719 newObj = model.Script('', '')
720 newObj.copy(source)
721 self.cutCopiedItems.append(newObj)
722
723 def on_paste_item(self, widget, data=None):
724 theModel, selectedPaths = self.treeView.get_selection().get_selected_rows()
725 parentIter = theModel[selectedPaths[0]].iter
726
727 newIters = []
728 for item in self.cutCopiedItems:
729 newIter = theModel.append_item(item, parentIter)
730 if isinstance(item, model.Folder):
731 theModel.populate_store(newIter, item)
732 newIters.append(newIter)
733
734 self.treeView.expand_to_path(theModel.get_path(newIters[-1]))
735 self.treeView.get_selection().unselect_all()
736 self.treeView.get_selection().select_iter(newIters[0])
737 self.cutCopiedItems = []
738 self.on_tree_selection_changed(self.treeView)
739 for iter in newIters:
740 self.treeView.get_selection().select_iter(iter)
741 self.app.config_altered()
742
743 def on_delete_item(self, widget, data=None):
744 selection = self.treeView.get_selection()
745 model, selectedPaths = selection.get_selected_rows()
746 refs = []
747 for path in selectedPaths:
748 refs.append(gtk.TreeRowReference(model, path))
749
750 for ref in refs:
751 if ref.valid():
752 # Prompt for removal of a folder with phrases
753 item = model[ref.get_path()].iter
754
755 if model.iter_n_children(item) > 0:
756 title = model.get_value(item, AkTreeModel.OBJECT_COLUMN).title
757 dlg = gtk.MessageDialog(self.ui, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO,
758 _("Are you sure you want to delete the %s folder and all the items in it?") % title)
759 if dlg.run() == gtk.RESPONSE_YES:
760 self.__removeItem(model, item)
761 dlg.destroy()
762
763 else:
764 self.__removeItem(model, item)
765
766 if len(selectedPaths) > 1:
767 self.treeView.get_selection().unselect_all()
768 self.treeView.get_selection().select_iter(model.get_iter_root())
769 self.on_tree_selection_changed(self.treeView)
770
771 self.app.config_altered()
772
773 def __removeItem(self, model, item):
774 selection = self.treeView.get_selection()
775 model, selectedPaths = selection.get_selected_rows()
776 newSelectionIter = model.iter_parent(model[selectedPaths[0]].iter)
777 if newSelectionIter is None:
778 newSelectionIter = model.get_iter_root()
779
780 model.remove_item(item)
781 self.treeView.get_selection().select_iter(newSelectionIter)
782 self.on_tree_selection_changed(self.treeView)
783
784 def on_undo(self, widget, data=None):
785 self.__getCurrentPage().undo()
786
787 def on_redo(self, widget, data=None):
788 self.__getCurrentPage().redo()
789
790 def on_record_keystrokes(self, widget, data=None):
791 if widget.get_active():
792 dlg = RecordDialog(self.ui, self.on_rec_response)
793 dlg.run()
794 else:
795 self.recorder.stop()
796
797 def on_rec_response(self, response, recKb, recMouse, delay):
798 if response == gtk.RESPONSE_OK:
799 self.recorder.set_record_keyboard(recKb)
800 self.recorder.set_record_mouse(recMouse)
801 self.recorder.start(delay)
802 elif response == gtk.RESPONSE_CANCEL:
803 self.uiManager.get_widget("/MenuBar/Edit/record").set_active(False)
804
805 # View Menu
806
807 def on_toggle_toolbar(self, widget, data=None):
808 if widget.get_active():
809 self.__addToolbar()
810 else:
811 self.vbox.remove(self.uiManager.get_widget('/Toolbar'))
812
813 ConfigManager.SETTINGS[SHOW_TOOLBAR] = widget.get_active()
814
815 def on_show_error(self, widget, data=None):
816 self.app.show_script_error()
817
818 # Settings Menu
819
820 def on_enable_toggled(self, widget, data=None):
821 if widget.get_active():
822 self.app.unpause_service()
823 else:
824 self.app.pause_service()
825
826 def on_advanced_settings(self, widget, data=None):
827 s = SettingsDialog(self.ui, self.app.configManager)
828 s.show()
829
830 # Help Menu
831
832 def on_show_faq(self, widget, data=None):
833 webbrowser.open(common.FAQ_URL, False, True)
834
835 def on_show_help(self, widget, data=None):
836 webbrowser.open(common.HELP_URL, False, True)
837
838 def on_donate(self, widget, data=None):
839 webbrowser.open(common.DONATE_URL, False, True)
840
841 def on_show_about(self, widget, data=None):
842 dlg = gtk.AboutDialog()
843 dlg.set_name("AutoKey (GTK UI)")
844 dlg.set_comments("A desktop automation utility for Linux and X11.")
845 dlg.set_version(common.VERSION)
846 p = gtk.gdk.pixbuf_new_from_file(common.ICON_FILE)
847 p = p.scale_simple(100, 100, gtk.gdk.INTERP_BILINEAR)
848 dlg.set_logo(p)
849 dlg.set_website(WEBSITE)
850 dlg.set_authors(["Chris Dekter (Developer) <cdekter@gmail.com>",
851 "Sam Peterson (Original developer) <peabodyenator@gmail.com>"])
852 dlg.run()
853 dlg.destroy()
854
855 # Tree widget
856
857 def on_rename(self, widget, data=None):
858 selection = self.treeView.get_selection()
859 theModel, selectedPaths = selection.get_selected_rows()
860 self.treeView.set_cursor(selectedPaths[0], self.treeView.get_column(0), True)
861
862 def on_treeWidget_row_activated(self, widget, path, viewColumn, data=None):
863 widget.expand_row(path, False)
864
865 def on_treeview_buttonpress(self, widget, event, data=None):
866 return self.dirty
867
868 def on_treeview_buttonrelease(self, widget, event, data=None):
869 if self.promptToSave():
870 # True result indicates user selected Cancel. Stop event propagation
871 return True
872 else:
873 x = int(event.x)
874 y = int(event.y)
875 time = event.time
876 pthinfo = widget.get_path_at_pos(x, y)
877 if pthinfo is not None:
878 path, col, cellx, celly = pthinfo
879 currentPath, currentCol = widget.get_cursor()
880 if currentPath != path and currentCol != col:
881 widget.set_cursor(path, col, 0)
882 if event.button == 3:
883 self.__popupMenu(event)
884 return False
885
886 def on_tree_selection_changed(self, widget, data=None):
887 selectedObjects = self.__getTreeSelection()
888 if len(selectedObjects) == 1:
889 selectedObject = selectedObjects[0]
890
891 if isinstance(selectedObject, model.Folder):
892 self.stack.set_current_page(0)
893 self.folderPage.load(selectedObject)
894 elif isinstance(selectedObject, model.Phrase):
895 self.stack.set_current_page(1)
896 self.phrasePage.load(selectedObject)
897 else:
898 self.stack.set_current_page(2)
899 self.scriptPage.load(selectedObject)
900
901 self.set_dirty(False)
902 self.cancel_record()
903 self.update_actions(selectedObjects, True)
904 self.selectedObject = selectedObject
905
906 else:
907 self.update_actions(selectedObjects, False)
908
909 def on_drag_data_received(self, treeview, context, x, y, selection, info, etime):
910 selection = self.treeView.get_selection()
911 theModel, sourcePaths = selection.get_selected_rows()
912 drop_info = treeview.get_dest_row_at_pos(x, y)
913 if drop_info:
914 path, position = drop_info
915 targetIter = theModel.get_iter(path)
916
917 sourceModelItems = self.__getTreeSelection()
918 #sourceModelItem = theModel.get_value(sourceIter, AkTreeModel.OBJECT_COLUMN)
919 targetModelItem = theModel.get_value(targetIter, AkTreeModel.OBJECT_COLUMN)
920
921 for path in sourcePaths:
922 self.__removeItem(theModel, theModel[path].iter)
923
924 newIters = []
925 for item in sourceModelItems:
926 newIter = theModel.append_item(item, targetIter)
927 if isinstance(item, model.Folder):
928 theModel.populate_store(newIter, item)
929 newIters.append(newIter)
930
931 self.treeView.expand_to_path(theModel.get_path(newIters[-1]))
932 selection.unselect_all()
933 for iter in newIters:
934 selection.select_iter(iter)
935 self.on_tree_selection_changed(self.treeView)
936 self.app.config_altered()
937
938 def on_drag_drop(self, widget, drag_context, x, y, timestamp):
939 drop_info = widget.get_dest_row_at_pos(x, y)
940 if drop_info:
941 selection = widget.get_selection()
942 theModel, sourcePaths = selection.get_selected_rows()
943 path, position = drop_info
944
945 if position not in (gtk.TREE_VIEW_DROP_INTO_OR_BEFORE, gtk.TREE_VIEW_DROP_INTO_OR_AFTER):
946 return True
947
948 targetIter = theModel.get_iter(path)
949 targetModelItem = theModel.get_value(targetIter, AkTreeModel.OBJECT_COLUMN)
950 if isinstance(targetModelItem, model.Folder) and path not in sourcePaths:
951 # checking path prevents dropping a folder onto itself
952 return False
953 else:
954 return True
955
956 return True
957
958 def on_cell_modified(self, renderer, path, newText, data=None):
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: