GTG

Merge lp:~huxuan/gtg/port-to-gtk3-py3 into lp:~gtg/gtg/old-trunk

Proposed by Xuan (Sean) Hu
Status: Merged
Merged at revision: 1345
Proposed branch: lp:~huxuan/gtg/port-to-gtk3-py3
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 10663 lines (+1954/-1840)
114 files modified
AUTHORS (+1/-0)
GTG/__init__.py (+5/-11)
GTG/backends/__init__.py (+9/-10)
GTG/backends/backend_rtm.py (+6/-6)
GTG/backends/backendsignals.py (+9/-9)
GTG/backends/genericbackend.py (+4/-3)
GTG/backends/generictomboy.py (+8/-8)
GTG/backends/rtm/rtm.py (+10/-10)
GTG/core/__init__.py (+5/-5)
GTG/core/datastore.py (+6/-9)
GTG/core/plugins/__init__.py (+0/-5)
GTG/core/plugins/api.py (+10/-10)
GTG/core/plugins/engine.py (+12/-12)
GTG/core/requester.py (+4/-4)
GTG/core/tag.py (+4/-3)
GTG/core/task.py (+11/-13)
GTG/gtg.py (+3/-3)
GTG/gtk/__init__.py (+6/-6)
GTG/gtk/backends_dialog.ui (+9/-8)
GTG/gtk/backends_dialog/__init__.py (+18/-19)
GTG/gtk/backends_dialog/addpanel.py (+63/-61)
GTG/gtk/backends_dialog/backendscombo.py (+10/-9)
GTG/gtk/backends_dialog/backendstree.py (+21/-16)
GTG/gtk/backends_dialog/configurepanel.py (+43/-42)
GTG/gtk/backends_dialog/parameters_ui/__init__.py (+13/-10)
GTG/gtk/backends_dialog/parameters_ui/checkboxui.py (+7/-7)
GTG/gtk/backends_dialog/parameters_ui/importtagsui.py (+22/-20)
GTG/gtk/backends_dialog/parameters_ui/passwordui.py (+9/-9)
GTG/gtk/backends_dialog/parameters_ui/pathui.py (+22/-22)
GTG/gtk/backends_dialog/parameters_ui/periodui.py (+13/-13)
GTG/gtk/backends_dialog/parameters_ui/textui.py (+11/-11)
GTG/gtk/browser/CellRendererTags.py (+23/-26)
GTG/gtk/browser/__init__.py (+2/-0)
GTG/gtk/browser/browser.py (+73/-69)
GTG/gtk/browser/custominfobar.py (+34/-34)
GTG/gtk/browser/modifytags_dialog.py (+11/-6)
GTG/gtk/browser/modifytags_dialog.ui (+2/-1)
GTG/gtk/browser/simple_color_selector.py (+62/-56)
GTG/gtk/browser/tag_context_menu.py (+5/-8)
GTG/gtk/browser/tag_editor.py (+127/-90)
GTG/gtk/browser/taskbrowser.ui (+20/-83)
GTG/gtk/browser/treeview_factory.py (+32/-25)
GTG/gtk/colors.py (+8/-5)
GTG/gtk/crashhandler.py (+35/-37)
GTG/gtk/dbuswrapper.py (+1/-1)
GTG/gtk/delete_dialog.py (+3/-3)
GTG/gtk/deletion.ui (+6/-5)
GTG/gtk/editor/__init__.py (+1/-1)
GTG/gtk/editor/calendar.py (+38/-23)
GTG/gtk/editor/editor.py (+64/-57)
GTG/gtk/editor/taskeditor.ui (+78/-30)
GTG/gtk/editor/taskview.py (+130/-118)
GTG/gtk/editor/taskviewserial.py (+18/-17)
GTG/gtk/manager.py (+16/-22)
GTG/gtk/plugins.py (+25/-21)
GTG/gtk/plugins.ui (+10/-8)
GTG/gtk/preferences.py (+26/-22)
GTG/gtk/preferences.ui (+12/-47)
GTG/gtk/tag_completion.py (+5/-5)
GTG/info.py (+3/-0)
GTG/plugins/bugzilla/bugzilla.py (+11/-11)
GTG/plugins/bugzilla/notification.py (+6/-6)
GTG/plugins/bugzilla/services.py (+2/-2)
GTG/plugins/export/export.py (+21/-23)
GTG/plugins/export/export.ui (+18/-12)
GTG/plugins/export/templates.py (+2/-2)
GTG/plugins/geolocalized_tasks/geolocalized.ui (+145/-130)
GTG/plugins/geolocalized_tasks/geolocalized_tasks.py (+32/-27)
GTG/plugins/geolocalized_tasks/marker.py (+4/-4)
GTG/plugins/hamster/hamster.py (+29/-33)
GTG/plugins/hamster/prefs.ui (+4/-5)
GTG/plugins/not_today/not_today.py (+2/-2)
GTG/plugins/notification_area/notification_area.py (+17/-14)
GTG/plugins/notification_area/notification_area.ui (+7/-6)
GTG/plugins/send_email/sendEmail.py (+7/-7)
GTG/plugins/task_reaper/reaper.py (+3/-13)
GTG/plugins/task_reaper/reaper.ui (+5/-6)
GTG/plugins/tomboy/combobox_enhanced.py (+10/-10)
GTG/plugins/tomboy/tomboy.py (+58/-66)
GTG/plugins/tomboy/tomboy.ui (+4/-4)
GTG/plugins/untouched_tasks/untouchedTasks.py (+6/-8)
GTG/plugins/untouched_tasks/untouchedTasks.ui (+5/-20)
GTG/plugins/urgency_color/preferences.ui (+10/-8)
GTG/plugins/urgency_color/urgency_color.py (+13/-12)
GTG/tests/__init__.py (+1/-2)
GTG/tests/signals_testing.py (+5/-5)
GTG/tests/test_backend_tomboy.py (+5/-5)
GTG/tests/test_bidict.py (+1/-1)
GTG/tests/test_datastore.py (+10/-10)
GTG/tests/test_signal_testing.py (+7/-7)
GTG/tests/test_twokeydict.py (+3/-3)
GTG/tests/tree_testing.py (+8/-8)
GTG/tools/bidict.py (+2/-1)
GTG/tools/cleanxml.py (+12/-12)
GTG/tools/clipboard.py (+3/-3)
GTG/tools/dates.py (+86/-18)
GTG/tools/import_liblarch.py (+10/-8)
GTG/tools/keyring.py (+20/-11)
GTG/tools/networkmanager.py (+7/-17)
GTG/tools/shortcut.py (+1/-1)
GTG/tools/taskxml.py (+1/-1)
GTG/tools/urlregex.py (+5/-5)
gtcli (+37/-37)
gtg (+10/-9)
gtg_new_task (+1/-1)
profile.py (+1/-1)
run-tests (+15/-11)
scripts/anonymize_task_file.py (+15/-15)
scripts/build_integrity.py (+5/-5)
scripts/close_launchpad_bugs.py (+8/-8)
scripts/gtg_stress_test (+4/-4)
scripts/profile_interpret.sh (+1/-1)
scripts/tarball_integrity.py (+3/-3)
setup.py (+2/-2)
To merge this branch: bzr merge lp:~huxuan/gtg/port-to-gtk3-py3
Reviewer Review Type Date Requested Status
Izidor Matušov Needs Fixing
Review via email: mp+187552@code.launchpad.net

Description of the change

This is the Gtk3 and Python3 ported GTG.
You can get more information about the porting work here [1].
BTW, there is a shared evernote [2] with test actions and coverage [3] report listed.
If you find any bugs, feel free to tell me. :-)

[1] https://wiki.gnome.org/SummerOfCode2013/Projects/XuanHu_PortingGTG
[2] https://www.evernote.com/shard/s43/sh/8e6e0ce8-227e-4c7a-b1e4-1e4e13e2728a/3b9d652d1303c5418292963b9483155c
[3] http://nedbatchelder.com/code/coverage/

To post a comment you must log in.
Revision history for this message
Parin Porecha (parinporecha) wrote :

Hi Huxuan,

I found 2 bugs -

1) In the icon selection in tag editor, I noticed a difference in the window heights -
Trunk code - http://i.imgur.com/QkAMZzN.png
Your branch - http://i.imgur.com/Ae4jKyL.png
Only one row of icons are visible at a time.

2) I can't close the icon selection without selecting an icon. On clicking anywhere outside, or on clicking the 'Remove selection' button (i.e. - on trying to close the icon selection window), I get this traceback - http://pastebin.com/hurXQb0U

Another thing -
When I ran GTG through './gtg', the dark theme I've applied for all GTK3 windows works for GTG (http://i.imgur.com/76rhSaD.png).
But when I run the dev version './scripts/debug.sh', it does not work (http://i.imgur.com/Ae4jKyL.png). I don't know if it is a bug in your branch or some XDG variable fault (I'm just guessing).

Revision history for this message
Parin Porecha (parinporecha) wrote :

The no. 2 bug in the above comment also occurs in the task editor.

When the calendar is opened, it doesn't close if I don't select a date. Here's the traceback - http://pastebin.com/gt9Cgv7C

Here's a link which I think will help - http://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons

Revision history for this message
Izidor Matušov (izidor) wrote :

I am not able to select a color for tag. It would be better to either stick with the old colorselector, or make it work with Gtk3 selector.

review: Needs Fixing
Revision history for this message
Xuan (Sean) Hu (huxuan) wrote :

Hi, thx for your guys' bug reporting!

I was a little busy before China's National Holiday. But the bug fixing work is already listed on my to do list in GTG. Suppose to have some update in two or three days.

If you find any other problems, feel free to note it down here.

lp:~huxuan/gtg/port-to-gtk3-py3 updated
1325. By Xuan (Sean) Hu

Merge Trunk

Revision history for this message
Parin Porecha (parinporecha) wrote :

Hi,

can you please patch the bugs mentioned above ?
GTG is participating in OPW round from November, and the student will work on your branch
So, it's better if we can make it as stable as possible :-)

Thanks !

Revision history for this message
Xuan (Sean) Hu (huxuan) wrote :

Sorry, Just too busy these days. I will try my best.

lp:~huxuan/gtg/port-to-gtk3-py3 updated
1326. By Xuan (Sean) Hu

Merge Trunk

1327. By Xuan (Sean) Hu

Bug fix for change gobject to GObject

Revision history for this message
Xuan (Sean) Hu (huxuan) wrote :

Hi, all

Need help for the IconView set_size_request bug.
It seems to be a bug of PyGObject/Gtk3, I have created a simple demo as following:
```python
from gi.repository import Gtk

win = Gtk.Window()
sw = Gtk.ScrolledWindow()
sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.ALWAYS)
iv = Gtk.IconView()
iv.set_size_request(640, 640)
sw.add(iv)
win.add(sw)
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
```
The set_size_request() doesn't seem to work when vertical policy is set to ALWAYS, but when change the PolicyType to NEVER, the request size seems to work fine.
Just not sure whether this conclusion is true. Any suggestions are welcome. :-)

lp:~huxuan/gtg/port-to-gtk3-py3 updated
1328. By Xuan (Sean) Hu

use specific method rather than set_property

Revision history for this message
Izidor Matušov (izidor) wrote :

Where do we use IconView?

Revision history for this message
Xuan (Sean) Hu (huxuan) wrote :

The icon selector in Tag Editor.
The related code can be found here [1].

[1] http://bazaar.launchpad.net/~huxuan/gtg/port-to-gtk3-py3/view/head:/GTG/gtk/browser/tag_editor.py#L68

Revision history for this message
Izidor Matušov (izidor) wrote :

Try to report the bug with the demo and chase folks at GNOME IRC channels.
With such a simple demo, it should be pretty straightforward to get some
answer.

On Sun, Nov 10, 2013 at 7:18 PM, Xuan (Sean) Hu <email address hidden>wrote:

> The icon selector in Tag Editor.
> The related code can be found here [1].
>
> [1]
> http://bazaar.launchpad.net/~huxuan/gtg/port-to-gtk3-py3/view/head:/GTG/gtk/browser/tag_editor.py#L68
> --
> https://code.launchpad.net/~huxuan/gtg/port-to-gtk3-py3/+merge/187552
> You are reviewing the proposed merge of lp:~huxuan/gtg/port-to-gtk3-py3
> into lp:gtg.
>

Revision history for this message
Xuan (Sean) Hu (huxuan) wrote :

I have created the bug here [1]. If there is any problem about the reporting, feel free to tell me.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=711793

lp:~huxuan/gtg/port-to-gtk3-py3 updated
1329. By Xuan (Sean) Hu

Merge Trunk

1330. By Xuan (Sean) Hu

Merge Trunk

Revision history for this message
Parin Porecha (parinporecha) wrote :

Hi,

we want to merge your branch to the trunk as soon as possible, but the tag editor is not working, thats where we're stuck.
Once it gets working, we'll merge it.

If you need help, I'll be happy to fix some problems :-)

lp:~huxuan/gtg/port-to-gtk3-py3 updated
1331. By Xuan (Sean) Hu

Merge Trunk

1332. By Xuan (Sean) Hu

Merge Trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2013-10-27 00:28:23 +0000
3+++ AUTHORS 2014-01-12 07:15:48 +0000
4@@ -114,6 +114,7 @@
5
6 For 0.3.1:
7 ----------
8+* Joe R. Nassimian <nassimian.joseph@gmail.com>
9 * Antonio Roquentin <https://launchpad.net/~antonio-roquentin> (no email provided)
10 * Codee <kmhpfoss@gmail.com>
11 * Sebastian Dyroff <sebastian@dyroff.org>
12
13=== modified file 'GTG/__init__.py'
14--- GTG/__init__.py 2013-11-23 14:40:23 +0000
15+++ GTG/__init__.py 2014-01-12 07:15:48 +0000
16@@ -29,13 +29,9 @@
17 locale.setlocale(locale.LC_ALL, 'C')
18
19 import gettext
20-try:
21- from gtk import glade
22- loaded_glade = glade
23-except:
24- # that's not pretty but it looks functional.
25- loaded_glade = None
26
27+# FIXME is this construction needed?
28+# There are many other places where this is used
29 try:
30 from xdg.BaseDirectory import xdg_config_home
31 config_home = xdg_config_home
32@@ -48,11 +44,9 @@
33 GETTEXT_DOMAIN = 'gtg'
34 LOCALE_PATH = gettext.bindtextdomain(GETTEXT_DOMAIN)
35
36-for module in gettext, loaded_glade:
37- # check if glade is well loaded to avoid error in Fedora build farm
38- if module:
39- module.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
40- module.textdomain(GETTEXT_DOMAIN)
41+gettext.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
42+gettext.textdomain(GETTEXT_DOMAIN)
43+# FIXME set translation for Builder as well!
44
45 translation = gettext.translation(GETTEXT_DOMAIN, LOCALE_PATH, fallback=True)
46
47
48=== modified file 'GTG/backends/__init__.py'
49--- GTG/backends/__init__.py 2013-11-23 14:40:23 +0000
50+++ GTG/backends/__init__.py 2014-01-12 07:15:48 +0000
51@@ -50,30 +50,29 @@
52 """
53 Creates a dictionary of the currently available backend modules
54 """
55- super(BackendFactory, self).__init__()
56+ Borg.__init__(self)
57 if hasattr(self, "backend_modules"):
58 # This object has already been constructed
59 return
60 self.backend_modules = {}
61 # Look for backends in the GTG/backends dir
62 this_dir = os.path.dirname(__file__)
63- backend_files = filter(lambda f: f.endswith(".py") and
64- f.startswith(self.BACKEND_PREFIX),
65- os.listdir(this_dir))
66+ backend_files = [f for f in os.listdir(this_dir) if f.endswith(".py") and
67+ f.startswith(self.BACKEND_PREFIX)]
68 # Create module names
69- module_names = map(lambda f: f.replace(".py", ""), backend_files)
70+ module_names = [f.replace(".py", "") for f in backend_files]
71 Log.debug("Backends found: " + str(module_names))
72 # Load backend modules
73 for module_name in module_names:
74 extended_module_name = "GTG.backends." + module_name
75 try:
76 __import__(extended_module_name)
77- except ImportError, exception:
78+ except ImportError as exception:
79 # Something is wrong with this backend, skipping
80 Log.warning("Backend %s could not be loaded: %s" %
81 (module_name, str(exception)))
82 continue
83- except Exception, exception:
84+ except Exception as exception:
85 # Other exception log as errors
86 Log.error("Malformated backend %s: %s" %
87 (module_name, str(exception)))
88@@ -113,11 +112,11 @@
89 # type
90 parameters = module.Backend.get_static_parameters()
91 # we all the parameters and their default values in dic
92- for param_name, param_dic in parameters.iteritems():
93+ for param_name, param_dic in parameters.items():
94 dic[param_name] = param_dic[GenericBackend.PARAM_DEFAULT_VALUE]
95 dic["pid"] = str(uuid.uuid4())
96 dic["module"] = module.Backend.get_name()
97- for param_name, param_value in additional_parameters.iteritems():
98+ for param_name, param_value in additional_parameters.items():
99 dic[param_name] = param_value
100 dic["backend"] = module.Backend(dic)
101 return dic
102@@ -146,7 +145,7 @@
103 # Building the dictionary
104 parameters_specs = module.Backend.get_static_parameters()
105 dic["pid"] = str(xp.getAttribute("pid"))
106- for param_name, param_dic in parameters_specs.iteritems():
107+ for param_name, param_dic in parameters_specs.items():
108 if xp.hasAttribute(param_name):
109 # we need to convert the parameter to the right format.
110 # we fetch the format from the static_parameters
111
112=== modified file 'GTG/backends/backend_rtm.py'
113--- GTG/backends/backend_rtm.py 2013-11-23 14:40:23 +0000
114+++ GTG/backends/backend_rtm.py 2014-01-12 07:15:48 +0000
115@@ -41,6 +41,7 @@
116 from GTG.core.task import Task
117 from GTG.tools.interruptible import interruptible
118 from GTG.tools.logger import Log
119+from functools import reduce
120
121
122 class Backend(PeriodicImportBackend):
123@@ -140,7 +141,7 @@
124 # set
125 stored_rtm_task_ids = self.sync_engine.get_all_remote()
126 current_rtm_task_ids = [tid for tid in
127- self.rtm_proxy.get_rtm_tasks_dict().iterkeys()]
128+ self.rtm_proxy.get_rtm_tasks_dict().keys()]
129
130 if self._this_is_the_first_loop:
131 self._on_successful_authentication()
132@@ -424,7 +425,7 @@
133 # tags to add
134 for tag in tags.difference(gtg_tags_lower):
135 gtg_all_tags = self.datastore.get_all_tags()
136- matching_tags = filter(lambda t: t.lower() == tag, gtg_all_tags)
137+ matching_tags = [t for t in gtg_all_tags if t.lower() == tag]
138 if len(matching_tags) != 0:
139 tag = matching_tags[0]
140 task.add_tag(tag)
141@@ -471,7 +472,7 @@
142 three times before giving up.
143 '''
144 MAX_ATTEMPTS = 3
145- for i in xrange(MAX_ATTEMPTS):
146+ for i in range(MAX_ATTEMPTS):
147 try:
148 return fun(*args)
149 except:
150@@ -589,7 +590,7 @@
151 self.rtm = createRTM(self.PUBLIC_KEY, self.PRIVATE_KEY, self.token)
152 self.timeline = self.rtm.timelines.create().timeline
153 return True
154- except (RTMError, RTMAPIError), e:
155+ except (RTMError, RTMAPIError) as e:
156 Log.error("RTM ERROR" + str(e))
157 return False
158
159@@ -890,8 +891,7 @@
160 return ""
161 else:
162 note_list = self.__getattr_the_rtm_way(notes, 'note')
163- return "".join(map(lambda note: "%s\n" % getattr(note, '$t'),
164- note_list))
165+ return "".join(["%s\n" % getattr(note, '$t') for note in note_list])
166
167 def set_text(self, text, transaction_ids=[]):
168 '''
169
170=== modified file 'GTG/backends/backendsignals.py'
171--- GTG/backends/backendsignals.py 2013-11-23 14:40:23 +0000
172+++ GTG/backends/backendsignals.py 2014-01-12 07:15:48 +0000
173@@ -17,7 +17,7 @@
174 # this program. If not, see <http://www.gnu.org/licenses/>.
175 # -----------------------------------------------------------------------------
176
177-import gobject
178+from gi.repository import GObject
179
180 from GTG.tools.borg import Borg
181
182@@ -59,10 +59,10 @@
183
184 @returns: tuple
185 '''
186- return (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, args)
187-
188-
189-class _BackendSignalsGObject(gobject.GObject):
190+ return (GObject.SignalFlags.RUN_FIRST, None, args)
191+
192+
193+class _BackendSignalsGObject(GObject.GObject):
194
195 # signal name constants
196 BACKEND_STATE_TOGGLED = 'backend-state-toggled' # emitted when a
197@@ -103,7 +103,7 @@
198 # As a general rule, signals should only be emitted in the GenericBackend
199 # class
200 def _emit_signal(self, signal, backend_id):
201- gobject.idle_add(self.emit, signal, backend_id)
202+ GObject.idle_add(self.emit, signal, backend_id)
203
204 def backend_state_changed(self, backend_id):
205 self._emit_signal(self.BACKEND_STATE_TOGGLED, backend_id)
206@@ -118,15 +118,15 @@
207 self._emit_signal(self.BACKEND_REMOVED, backend_id)
208
209 def default_backend_loaded(self):
210- gobject.idle_add(self.emit, self.DEFAULT_BACKEND_LOADED)
211+ GObject.idle_add(self.emit, self.DEFAULT_BACKEND_LOADED)
212
213 def backend_failed(self, backend_id, error_code):
214- gobject.idle_add(self.emit, self.BACKEND_FAILED, backend_id,
215+ GObject.idle_add(self.emit, self.BACKEND_FAILED, backend_id,
216 error_code)
217
218 def interaction_requested(self, backend_id, description,
219 interaction_type, callback_str):
220- gobject.idle_add(self.emit, self.INTERACTION_REQUESTED,
221+ GObject.idle_add(self.emit, self.INTERACTION_REQUESTED,
222 backend_id, description, interaction_type,
223 callback_str)
224
225
226=== modified file 'GTG/backends/genericbackend.py'
227--- GTG/backends/genericbackend.py 2013-11-23 14:40:23 +0000
228+++ GTG/backends/genericbackend.py 2014-01-12 07:15:48 +0000
229@@ -33,6 +33,7 @@
230 from GTG.core import CoreConfig
231 from GTG.tools.logger import Log
232 from GTG.tools.interruptible import _cancellation_point
233+from functools import reduce
234
235 PICKLE_BACKUP_NBR = 2
236
237@@ -261,9 +262,9 @@
238 if cls._general_description[cls.BACKEND_TYPE] == \
239 cls.TYPE_READWRITE:
240 for key, value in \
241- cls._static_parameters_obligatory_for_rw.iteritems():
242+ cls._static_parameters_obligatory_for_rw.items():
243 temp_dic[key] = value
244- for key, value in cls._static_parameters.iteritems():
245+ for key, value in cls._static_parameters.items():
246 temp_dic[key] = value
247 return temp_dic
248
249@@ -537,7 +538,7 @@
250 # mkdir -p
251 try:
252 os.makedirs(os.path.dirname(path))
253- except OSError, exception:
254+ except OSError as exception:
255 if exception.errno != errno.EEXIST:
256 raise
257
258
259=== modified file 'GTG/backends/generictomboy.py'
260--- GTG/backends/generictomboy.py 2014-01-01 11:43:36 +0000
261+++ GTG/backends/generictomboy.py 2014-01-12 07:15:48 +0000
262@@ -126,7 +126,7 @@
263 while True:
264 try:
265 [key, timer] = \
266- self._tomboy_setting_timers.iteritems().next()
267+ next(iter(self._tomboy_setting_timers.items()))
268 except StopIteration:
269 break
270 timer.cancel()
271@@ -416,12 +416,12 @@
272 try:
273 end_of_title = content.index('\n')
274 except ValueError:
275- return content, unicode("")
276+ return content, str("")
277 title = content[: end_of_title]
278 if len(content) > end_of_title:
279 return title, content[end_of_title + 1:]
280 else:
281- return title, unicode("")
282+ return title, str("")
283
284 def _populate_task(self, task, note):
285 '''
286@@ -438,10 +438,10 @@
287 # update the tags list
288 task.set_only_these_tags(extract_tags_from_text(content))
289 # extract title and text
290- [title, text] = self._tomboy_split_title_and_text(unicode(content))
291+ [title, text] = self._tomboy_split_title_and_text(str(content))
292 # Tomboy speaks unicode, we don't
293- title = unicodedata.normalize('NFKD', title).encode('ascii', 'ignore')
294- text = unicodedata.normalize('NFKD', text).encode('ascii', 'ignore')
295+ title = unicodedata.normalize('NFKD', title)
296+ text = unicodedata.normalize('NFKD', text)
297 task.set_title(title)
298 task.set_text(text)
299 task.add_remote_id(self.get_id(), note)
300@@ -467,7 +467,7 @@
301 # tomboy passes Dbus.String objects, which are not pickable. We convert
302 # those to unicode
303 if "remote_id" in kwargs:
304- kwargs["remote_id"] = unicode(kwargs["remote_id"])
305+ kwargs["remote_id"] = str(kwargs["remote_id"])
306 try:
307 self.sync_engine.break_relationship(*args, **kwargs)
308 # we try to save the state at each change in the sync_engine:
309@@ -485,7 +485,7 @@
310 # tomboy passes Dbus.String objects, which are not pickable. We convert
311 # those to unicode
312 if "remote_id" in kwargs:
313- kwargs["remote_id"] = unicode(kwargs["remote_id"])
314+ kwargs["remote_id"] = str(kwargs["remote_id"])
315
316 self.sync_engine.record_relationship(*args, **kwargs)
317 # we try to save the state at each change in the sync_engine:
318
319=== modified file 'GTG/backends/rtm/rtm.py'
320--- GTG/backends/rtm/rtm.py 2013-02-25 08:12:02 +0000
321+++ GTG/backends/rtm/rtm.py 2014-01-12 07:15:48 +0000
322@@ -8,7 +8,7 @@
323 )
324
325
326-import urllib
327+import urllib.request, urllib.parse, urllib.error
328 from hashlib import md5
329
330 from GTG import _
331@@ -80,7 +80,7 @@
332 self.authInfo = AuthStateMachine(['frob', 'token'])
333
334 # this enables one to do 'rtm.tasks.getList()', for example
335- for prefix, methods in API.items():
336+ for prefix, methods in list(API.items()):
337 setattr(self, prefix,
338 RTMAPICategory(self, prefix, methods))
339
340@@ -130,7 +130,7 @@
341 'frob': frob
342 }
343 params['api_sig'] = self._sign(params)
344- return AUTH_SERVICE_URL + '?' + urllib.urlencode(params)
345+ return AUTH_SERVICE_URL + '?' + urllib.parse.urlencode(params)
346
347 def getToken(self):
348 frob = self.authInfo.get('frob')
349@@ -178,7 +178,7 @@
350 # Utility functions
351 def sortedItems(dictionary):
352 "Return a list of (key, value) sorted based on keys"
353- keys = dictionary.keys()
354+ keys = list(dictionary.keys())
355 keys.sort()
356 for key in keys:
357 yield key, dictionary[key]
358@@ -186,9 +186,9 @@
359
360 def openURL(url, queryArgs=None):
361 if queryArgs:
362- url = url + '?' + urllib.urlencode(queryArgs)
363+ url = url + '?' + urllib.parse.urlencode(queryArgs)
364 # LOG.debug("URL> %s", url)
365- return urllib.urlopen(url)
366+ return urllib.request.urlopen(url)
367
368
369 class dottedDict(object):
370@@ -198,7 +198,7 @@
371 self._name = name
372
373 if type(dictionary) is dict:
374- for key, value in dictionary.items():
375+ for key, value in list(dictionary.items()):
376 if type(value) is dict:
377 value = dottedDict(key, value)
378 elif type(value) in (list, tuple) and key != 'tag':
379@@ -396,12 +396,12 @@
380 rtm = createRTM(apiKey, secret, token)
381
382 rspTasks = rtm.tasks.getList(filter='dueWithin:"1 week of today"')
383- print [t.name for t in rspTasks.tasks.list.taskseries]
384- print rspTasks.tasks.list.id
385+ print([t.name for t in rspTasks.tasks.list.taskseries])
386+ print(rspTasks.tasks.list.id)
387
388 rspLists = rtm.lists.getList()
389 # print rspLists.lists.list
390- print [(x.name, x.id) for x in rspLists.lists.list]
391+ print([(x.name, x.id) for x in rspLists.lists.list])
392
393
394 def set_log_level(level):
395
396=== modified file 'GTG/core/__init__.py'
397--- GTG/core/__init__.py 2013-11-23 14:40:23 +0000
398+++ GTG/core/__init__.py 2014-01-12 07:15:48 +0000
399@@ -37,8 +37,8 @@
400
401 #=== IMPORT ===================================================================
402 from re import findall
403+import configparser
404
405-import ConfigParser
406 from xdg.BaseDirectory import xdg_data_home, xdg_config_home, xdg_data_dirs
407 import os
408
409@@ -132,8 +132,8 @@
410 toreturn = DEFAULTS[self._section][option]
411 self.set(option, toreturn)
412 else:
413- print "Warning : no default conf value for %s in %s" % (
414- option, self._section)
415+ print("Warning : no default conf value for %s in %s" % (
416+ option, self._section))
417 toreturn = None
418 return toreturn
419
420@@ -208,10 +208,10 @@
421 def check_config_file(self, path):
422 """ This function bypasses the errors of config file and allows GTG
423 to open smoothly"""
424- config = ConfigParser.ConfigParser()
425+ config = configparser.ConfigParser()
426 try:
427 config.read(path)
428- except ConfigParser.Error:
429+ except configparser.Error:
430 open(path, "w").close()
431 return config
432
433
434=== modified file 'GTG/core/datastore.py'
435--- GTG/core/datastore.py 2013-11-23 14:40:23 +0000
436+++ GTG/core/datastore.py 2014-01-12 07:15:48 +0000
437@@ -106,7 +106,6 @@
438 ### Tags functions ########################################################
439 def _add_new_tag(self, name, tag, filter_func, parameters, parent_id=None):
440 """ Add tag into a tree """
441- name = name.encode("UTF-8")
442 if self._tagstore.has_node(name):
443 raise IndexError('tag %s was already in the datastore' % name)
444
445@@ -120,7 +119,6 @@
446
447 @returns GTG.core.tag.Tag: the new tag
448 """
449- name = name.encode("UTF-8")
450 parameters = {'tag': name}
451 tag = Tag(name, req=self.requester, attributes=attributes)
452 self._add_new_tag(name, tag, self.treefactory.tag_filter, parameters)
453@@ -134,12 +132,11 @@
454 """
455 try:
456 parameters = parse_search_query(query)
457- except InvalidQuery, e:
458+ except InvalidQuery as e:
459 Log.warning("Problem with parsing query '%s' (skipping): %s" %
460 (query, e.message))
461 return None
462
463- name = name.encode("UTF-8")
464
465 # Create own copy of attributes and add special attributes label, query
466 init_attr = dict(attributes)
467@@ -176,7 +173,7 @@
468 tag = self.get_tag(oldname)
469
470 if not tag.is_search_tag():
471- print "Tag renaming not implemented yet"
472+ print("Tag renaming not implemented yet")
473 return None
474
475 query = tag.get_attribute("query")
476@@ -360,7 +357,7 @@
477 @return list: a list of TaskSource objects
478 """
479 result = []
480- for backend in self.backends.itervalues():
481+ for backend in self.backends.values():
482 if backend.is_enabled() or disabled:
483 result.append(backend)
484 return result
485@@ -437,7 +434,7 @@
486 return
487
488 self.is_default_backend_loaded = True
489- for backend in self.backends.itervalues():
490+ for backend in self.backends.values():
491 if backend.is_enabled() and not backend.is_default():
492 self._backend_startup(backend)
493
494@@ -565,7 +562,7 @@
495 thread = threading.Thread(target=b.quit)
496 threads_dic[b.get_id()] = thread
497 thread.start()
498- for backend_id, thread in threads_dic.iteritems():
499+ for backend_id, thread in threads_dic.items():
500 # after 20 seconds, we give up
501 thread.join(20)
502 if thread.isAlive():
503@@ -574,7 +571,7 @@
504 # we save the parameters
505 for b in self.get_all_backends(disabled=True):
506 t_xml = doc.createElement("backend")
507- for key, value in b.get_parameters().iteritems():
508+ for key, value in b.get_parameters().items():
509 if key in ["backend", "xmlobject"]:
510 # We don't want parameters, backend, xmlobject:
511 # we'll create them at next startup
512
513=== modified file 'GTG/core/plugins/__init__.py'
514--- GTG/core/plugins/__init__.py 2013-11-23 14:40:23 +0000
515+++ GTG/core/plugins/__init__.py 2014-01-12 07:15:48 +0000
516@@ -21,15 +21,10 @@
517 # This is the tool package. It contains some useful function and tool
518 # that could be useful for any part of GTG.
519
520-import os
521-
522 from GTG import _
523
524
525 class GnomeConfig:
526- current_rep = os.path.dirname(os.path.abspath(__file__))
527- GLADE_FILE = os.path.join(current_rep, "pluginmanager.glade")
528-
529 CANLOAD = _("Everything necessary to run this plugin is available.")
530 CANNOTLOAD = _("The plugin can not be loaded")
531 miss1 = _("Some python modules are missing")
532
533=== modified file 'GTG/core/plugins/api.py'
534--- GTG/core/plugins/api.py 2014-01-02 07:08:53 +0000
535+++ GTG/core/plugins/api.py 2014-01-12 07:15:48 +0000
536@@ -135,7 +135,7 @@
537 """Adds a menu entry to the Plugin Menu of the Main Window
538 (task browser).
539
540- @param item: The gtk.MenuItem that is going to be added.
541+ @param item: The Gtk.MenuItem that is going to be added.
542 """
543 widget = self.__builder.get_object('plugin_mi')
544 widget.get_submenu().append(item)
545@@ -145,7 +145,7 @@
546 """Removes a menu entry from the Plugin Menu of the Main Window
547 (task browser).
548
549- @param item: The gtk.MenuItem that is going to be removed.
550+ @param item: The Gtk.MenuItem that is going to be removed.
551 @return: Returns C{True} if the operation has sucess or c{False} if it
552 fails.
553 """
554@@ -162,7 +162,7 @@
555 """Adds a button to the task browser's toolbar or the task editor
556 toolbar, depending on which plugin api it's being used.
557
558- @param widget: The gtk.ToolButton that is going to be added to the
559+ @param widget: The Gtk.ToolButton that is going to be added to the
560 toolbar.
561 """
562 #-1 means "append to the end"
563@@ -174,17 +174,17 @@
564 """
565 try:
566 self.__toolbar.remove(widget)
567- except Exception, e:
568- print "Error removing the toolbar item in the TaskEditor: %s" % e
569+ except Exception as e:
570+ print("Error removing the toolbar item in the TaskEditor: %s" % e)
571
572 def add_widget_to_taskeditor(self, widget):
573 """Adds a widget to the bottom of the task editor dialog
574
575- @param widget: The gtk.Widget that is going to be added.
576+ @param widget: The Gtk.Widget that is going to be added.
577 """
578 vbox = self.__builder.get_object('vbox4')
579 if vbox:
580- vbox.pack_start(widget)
581+ vbox.pack_start(widget, True, True, 0)
582 vbox.reorder_child(widget, -2)
583 widget.show_all()
584 self.taskwidget_id += 1
585@@ -196,14 +196,14 @@
586 def remove_widget_from_taskeditor(self, widg_id):
587 """Remove a widget from the bottom of the task editor dialog
588
589- @param widget: The gtk.Widget that is going to be removed
590+ @param widget: The Gtk.Widget that is going to be removed
591 """
592 if self.is_editor() and widg_id:
593 try:
594 wi = self.__builder.get_object('vbox4')
595 if wi and widg_id in self.taskwidget_widg:
596 wi.remove(self.taskwidget_widg.pop(widg_id))
597- except Exception, e:
598+ except Exception as e:
599 Log.debug("Error removing the toolbar item in the TaskEditor:"
600 "%s" % e)
601
602@@ -219,7 +219,7 @@
603 if func is None:
604 func = browser.tv_factory.task_bg_color
605
606- for pane in browser.vtree_panes.itervalues():
607+ for pane in browser.vtree_panes.values():
608 pane.set_bg_color(func, 'bg_color')
609 pane.basetree.get_basetree().refresh_all()
610
611
612=== modified file 'GTG/core/plugins/engine.py'
613--- GTG/core/plugins/engine.py 2013-11-23 14:40:23 +0000
614+++ GTG/core/plugins/engine.py 2014-01-12 07:15:48 +0000
615@@ -19,7 +19,7 @@
616 import imp
617 import os
618 import types
619-import ConfigParser
620+import configparser
621
622 import dbus
623
624@@ -53,7 +53,7 @@
625 'module_depends': 'dependencies',
626 'dbus_depends': 'dbus-dependencies',
627 }
628- for attr, field in info_fields.iteritems():
629+ for attr, field in info_fields.items():
630 try:
631 setattr(self, attr, info[field])
632 except KeyError:
633@@ -122,12 +122,12 @@
634 f, pathname, desc = imp.find_module(self.module_name, module_path)
635 module = imp.load_module(self.module_name, f, pathname, desc)
636 # find the class object for the actual plugin
637- for key, item in module.__dict__.iteritems():
638- if isinstance(item, types.ClassType):
639+ for key, item in module.__dict__.items():
640+ if isinstance(item, type):
641 self.plugin_class = item
642 self.class_name = item.__dict__['__module__'].split('.')[1]
643 break
644- except ImportError, e:
645+ except ImportError as e:
646 # load_module() failed, probably because of a module dependency
647 if len(self.module_depends) > 0:
648 self._check_module_depends()
649@@ -135,7 +135,7 @@
650 # no dependencies in info file; use the ImportError instead
651 self.missing_modules.append(str(e).split(" ")[3])
652 self.error = True
653- except Exception, e:
654+ except Exception as e:
655 # load_module() failed for some other reason
656 Log.error(e)
657 self.error = True
658@@ -169,9 +169,9 @@
659 for f in os.listdir(path):
660 info_file = os.path.join(path, f)
661 if os.path.isfile(info_file) and f.endswith('.gtg-plugin'):
662- info = ConfigParser.ConfigParser()
663+ info = configparser.ConfigParser()
664 info.read(info_file)
665- info = dict(info.items("GTG Plugin"))
666+ info = dict(info.items("GTG Plugin", True))
667 p = Plugin(info, self.plugin_path)
668 self.plugins[p.module_name] = p
669
670@@ -188,7 +188,7 @@
671 "disabled",
672 "all"
673 """
674- all_plugins = self.plugins.itervalues()
675+ all_plugins = iter(self.plugins.values())
676 if kind_of_plugins == "all":
677 return all_plugins
678
679@@ -197,7 +197,7 @@
680 (kind_of_plugins == "inactive" and not plugin.active) or
681 (kind_of_plugins == "enabled" and plugin.enabled) or
682 (kind_of_plugins == "disabled" and not plugin.enabled))
683- return filter(filter_fun, all_plugins)
684+ return list(filter(filter_fun, all_plugins))
685
686 def register_api(self, api):
687 '''Adds a plugin api to the list of currently loaded apis'''
688@@ -287,8 +287,8 @@
689 plugin.enabled = False
690 else:
691 self.activate_plguins(self.plugin_apis, [plugin])
692- except Exception, e:
693- print "Error: %s" % e
694+ except Exception as e:
695+ print("Error: %s" % e)
696
697 def recheck_plugin_errors(self, check_all=False):
698 """Attempt a reload of plugins with errors, or all plugins."""
699
700=== modified file 'GTG/core/requester.py'
701--- GTG/core/requester.py 2013-11-23 14:40:23 +0000
702+++ GTG/core/requester.py 2014-01-12 07:15:48 +0000
703@@ -21,13 +21,13 @@
704 A nice general purpose interface for the datastore and tagstore
705 """
706
707-import gobject
708+from gi.repository import GObject
709
710 from GTG.core.tag import Tag
711 from GTG.tools.logger import Log
712
713
714-class Requester(gobject.GObject):
715+class Requester(GObject.GObject):
716 """ A view on a GTG datastore.
717
718 L{Requester} is a stateless object that simply provides a nice API for
719@@ -39,7 +39,7 @@
720
721 def __init__(self, datastore, global_conf):
722 """Construct a L{Requester}."""
723- gobject.GObject.__init__(self)
724+ GObject.GObject.__init__(self)
725 self.ds = datastore
726 self.__config = global_conf
727 self.__basetree = self.ds.get_tasks_tree()
728@@ -198,7 +198,7 @@
729 tagstore = self.ds.get_tagstore()
730 view = tagstore.get_viewtree(name='tag_completion', refresh=False)
731 tags = view.get_all_nodes()
732- tags.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
733+ tags.sort(key=str.lower)
734 return tags
735
736 def get_all_tags(self):
737
738=== modified file 'GTG/core/tag.py'
739--- GTG/core/tag.py 2013-11-23 14:40:23 +0000
740+++ GTG/core/tag.py 2014-01-12 07:15:48 +0000
741@@ -28,6 +28,7 @@
742
743 from GTG.core import CoreConfig
744 from liblarch import TreeNode
745+from functools import reduce
746
747
748 class Tag(TreeNode):
749@@ -54,7 +55,7 @@
750 self.req = req
751 self._save = None
752 self._attributes = {'name': self._name}
753- for key, value in attributes.iteritems():
754+ for key, value in attributes.items():
755 self.set_attribute(key, value)
756
757 self.viewcount = None
758@@ -126,7 +127,7 @@
759 modified = True
760 else:
761 # Attributes should all be strings.
762- val = unicode(str(att_value), "UTF-8")
763+ val = str(att_value)
764 self._attributes[att_name] = val
765 if self._save:
766 self._save()
767@@ -174,7 +175,7 @@
768 names.
769 @param withparent: If True, the "parent" attribute is attached
770 """
771- attributes = self._attributes.keys()
772+ attributes = list(self._attributes.keys())
773 if butname:
774 attributes.remove('name')
775 if withparent:
776
777=== modified file 'GTG/core/task.py'
778--- GTG/core/task.py 2013-12-17 14:39:47 +0000
779+++ GTG/core/task.py 2014-01-12 07:15:48 +0000
780@@ -47,7 +47,7 @@
781 TreeNode.__init__(self, ze_id)
782 # the id of this task in the project should be set
783 # tid is a string ! (we have to choose a type and stick to it)
784- assert(isinstance(ze_id, str) or isinstance(ze_id, unicode))
785+ assert(isinstance(ze_id, str) or isinstance(ze_id, str))
786 self.tid = str(ze_id)
787 self.set_uuid(uuid.uuid4())
788 self.remote_ids = {}
789@@ -128,8 +128,6 @@
790 # We should check for other task with the same title
791 # In that case, we should add a number (like Tomboy does)
792 old_title = self.title
793- if isinstance(title, str):
794- title = title.decode('utf8')
795 if title:
796 self.title = title.strip('\t\n')
797 else:
798@@ -360,7 +358,8 @@
799 return self.due_date
800
801 def get_urgent_date(self):
802- """Returns the most urgent due date among the task and it's subtasks"""
803+ """ Returns the most urgent due date among the tasks and its subtasks
804+ """
805 urg_date = self.due_date
806 for sub in self.get_subtasks():
807 sub_urg_date = sub.get_urgent_date()
808@@ -568,7 +567,7 @@
809 # (Lionel)
810 # Agreed. it's only used by the "add tag to all subtasks" widget.
811 def get_self_and_all_subtasks(self, active_only=False, tasks=[]):
812- print "DEPRECATED FUNCTION: get_self_and_all_subtasks"
813+ print("DEPRECATED FUNCTION: get_self_and_all_subtasks")
814 tasks.append(self)
815 for tid in self.get_children():
816 i = self.req.get_task(tid)
817@@ -579,7 +578,7 @@
818
819 def get_subtask(self, tid):
820 # FIXME : remove this function. This is not useful
821- print "DEPRECATED: get_subtask"
822+ print("DEPRECATED: get_subtask")
823 """Return the task corresponding to a given ID.
824
825 @param tid: the ID of the task to return.
826@@ -605,7 +604,7 @@
827 @param att_value: The value of the attribute. Will be converted to a
828 string.
829 """
830- val = unicode(str(att_value), "UTF-8")
831+ val = str(att_value)
832 self.attributes[(namespace, att_name)] = val
833 self.sync()
834
835@@ -662,18 +661,17 @@
836 """
837 Adds a tag. Does not add '@tag' to the contents. See add_tag
838 """
839- t = tagname.encode("UTF-8")
840 # Do not add the same tag twice
841- if not t in self.tags:
842- self.tags.append(t)
843+ if not tagname in self.tags:
844+ self.tags.append(tagname)
845 if self.is_loaded():
846 for child in self.get_subtasks():
847 if child.can_be_deleted:
848- child.add_tag(t)
849+ child.add_tag(tagname)
850
851- tag = self.req.get_tag(t)
852+ tag = self.req.get_tag(tagname)
853 if not tag:
854- tag = self.req.new_tag(t)
855+ tag = self.req.new_tag(tagname)
856 tag.modified()
857 return True
858
859
860=== modified file 'GTG/gtg.py'
861--- GTG/gtg.py 2013-11-23 14:40:23 +0000
862+++ GTG/gtg.py 2014-01-12 07:15:48 +0000
863@@ -1,4 +1,4 @@
864-#!/usr/bin/env python2
865+#!/usr/bin/env python3
866 # -*- coding: utf-8 -*-
867 # -----------------------------------------------------------------------------
868 # Getting Things GNOME! - a personal organizer for the GNOME desktop
869@@ -74,7 +74,7 @@
870 pidfile = os.path.join(directory, "gtg.pid")
871 if not os.path.exists(pidfile):
872 open(pidfile, "w").close()
873- os.chmod(pidfile, 0600)
874+ os.chmod(pidfile, 0o600)
875
876 # see if gtg is already running
877 pid = open(pidfile, "r").readline()
878@@ -82,7 +82,7 @@
879 p = os.system("/bin/ps %s >/dev/null" % pid)
880 p_name = os.popen("/bin/ps -f %s" % pid).read()
881 if p == 0 and "gtg" in p_name:
882- print _("gtg is already running!")
883+ print(_("gtg is already running!"))
884 try:
885 d = dbus.SessionBus().get_object(CoreConfig.BUSNAME,
886 CoreConfig.BUSINTERFACE)
887
888=== modified file 'GTG/gtk/__init__.py'
889--- GTG/gtk/__init__.py 2013-11-23 14:40:23 +0000
890+++ GTG/gtk/__init__.py 2014-01-12 07:15:48 +0000
891@@ -17,14 +17,14 @@
892 # this program. If not, see <http://www.gnu.org/licenses/>.
893 # -----------------------------------------------------------------------------
894
895-""" Configuration for browser, it contains path to .glade files """
896+""" Configuration for browser, it contains path to .ui files """
897
898 import os
899
900
901-class ViewConfig:
902+class ViewConfig(object):
903 current_rep = os.path.dirname(os.path.abspath(__file__))
904- DELETE_GLADE_FILE = os.path.join(current_rep, "deletion.glade")
905- PREFERENCES_GLADE_FILE = os.path.join(current_rep, "preferences.glade")
906- PLUGINS_GLADE_FILE = os.path.join(current_rep, "plugins.glade")
907- BACKENDS_GLADE_FILE = os.path.join(current_rep, "backends_dialog.glade")
908+ DELETE_UI_FILE = os.path.join(current_rep, "deletion.ui")
909+ PREFERENCES_UI_FILE = os.path.join(current_rep, "preferences.ui")
910+ PLUGINS_UI_FILE = os.path.join(current_rep, "plugins.ui")
911+ BACKENDS_UI_FILE = os.path.join(current_rep, "backends_dialog.ui")
912
913=== renamed file 'GTG/gtk/backends_dialog.glade' => 'GTG/gtk/backends_dialog.ui'
914--- GTG/gtk/backends_dialog.glade 2012-11-10 12:08:18 +0000
915+++ GTG/gtk/backends_dialog.ui 2014-01-12 07:15:48 +0000
916@@ -1,7 +1,6 @@
917 <?xml version="1.0" encoding="UTF-8"?>
918 <interface>
919- <requires lib="gtk+" version="2.16"/>
920- <!-- interface-naming-policy project-wide -->
921+ <!-- interface-requires gtk+ 3.0 -->
922 <object class="GtkAdjustment" id="adjustment1">
923 <property name="upper">100</property>
924 <property name="step_increment">1</property>
925@@ -11,7 +10,7 @@
926 <object class="GtkWindow" id="backends_dialog">
927 <property name="can_focus">False</property>
928 <property name="window_position">mouse</property>
929- <signal name="delete-event" handler="on_BackendsDialog_delete_event" swapped="no"/>
930+ <signal name="delete_event" handler="on_BackendsDialog_delete_event"/>
931 <child>
932 <object class="GtkAlignment" id="alignment1">
933 <property name="visible">True</property>
934@@ -21,19 +20,21 @@
935 <property name="left_padding">10</property>
936 <property name="right_padding">10</property>
937 <child>
938- <object class="GtkVBox" id="vbox1">
939+ <object class="GtkBox" id="vbox1">
940 <property name="visible">True</property>
941 <property name="can_focus">False</property>
942 <property name="spacing">10</property>
943+ <property name="orientation">vertical</property>
944 <child>
945- <object class="GtkHBox" id="big_central_hbox">
946+ <object class="GtkBox" id="big_central_box">
947 <property name="visible">True</property>
948 <property name="can_focus">False</property>
949 <property name="spacing">10</property>
950 <child>
951- <object class="GtkVBox" id="vbox2">
952+ <object class="GtkBox" id="vbox2">
953 <property name="visible">True</property>
954 <property name="can_focus">False</property>
955+ <property name="orientation">vertical</property>
956 <child>
957 <object class="GtkViewport" id="treeview_window">
958 <property name="height_request">400</property>
959@@ -60,7 +61,7 @@
960 <property name="left_padding">10</property>
961 <property name="right_padding">10</property>
962 <child>
963- <object class="GtkHButtonBox" id="hbuttonbox3">
964+ <object class="GtkButtonBox" id="hbuttonbox3">
965 <property name="visible">True</property>
966 <property name="can_focus">False</property>
967 <property name="spacing">10</property>
968@@ -145,7 +146,7 @@
969 </packing>
970 </child>
971 <child>
972- <object class="GtkHButtonBox" id="hbuttonbox2">
973+ <object class="GtkButtonBox" id="hbuttonbox2">
974 <property name="visible">True</property>
975 <property name="can_focus">False</property>
976 <property name="layout_style">edge</property>
977
978=== modified file 'GTG/gtk/backends_dialog/__init__.py'
979--- GTG/gtk/backends_dialog/__init__.py 2013-11-23 14:40:23 +0000
980+++ GTG/gtk/backends_dialog/__init__.py 2014-01-12 07:15:48 +0000
981@@ -26,7 +26,7 @@
982 panel (these are called also "views" in this class)
983 '''
984
985-import gtk
986+from gi.repository import Gtk
987
988 from webbrowser import open as openurl
989
990@@ -68,9 +68,8 @@
991 self.backends_tv = None
992 self.config_panel = None
993 self.add_panel = None
994- # Load from Glade
995- builder = gtk.Builder()
996- self._load_widgets_from_glade(builder)
997+ builder = Gtk.Builder()
998+ self._load_widgets_from_builder(builder)
999 # Load and setup other widgets
1000 self.dialog.set_title(_("Synchronization Services - %s" % info.NAME))
1001 self._create_widgets_for_add_panel()
1002@@ -119,14 +118,14 @@
1003 @param height: the height of the returned pixbuf
1004 @param width: the width of the returned pixbuf
1005
1006- @returns gtk.gdk.Pixbuf: a pixbuf containing the wanted icon, or None
1007+ @returns GdkPixbuf: a pixbuf containing the wanted icon, or None
1008 (if the icon is not present)
1009 '''
1010 icon_info = self.icon_theme.lookup_icon(name, height, 0)
1011 if icon_info is None:
1012 return None
1013 else:
1014- return gtk.icon_theme_get_default().load_icon(name, height, 0)
1015+ return Gtk.IconTheme.get_default().load_icon(name, height, 0)
1016
1017 def _show_panel(self, panel_name):
1018 '''
1019@@ -147,7 +146,7 @@
1020 Log.error("panel name unknown")
1021 return
1022 # Central pane
1023- # NOTE: self.central_pane is the gtk.Container in which we load panels
1024+ # NOTE: self.central_pane is the Gtk.Container in which we load panels
1025 if panel_to_remove in self.central_pane:
1026 self.central_pane.remove(panel_to_remove)
1027 if not panel_to_add in self.central_pane:
1028@@ -167,13 +166,13 @@
1029 ########################################
1030 ### WIDGETS AND SIGNALS ################
1031 ########################################
1032- def _load_widgets_from_glade(self, builder):
1033+ def _load_widgets_from_builder(self, builder):
1034 '''
1035- Loads widgets from the glade file
1036+ Loads widgets from the builder .ui file
1037
1038- @param builder: a gtk.Builder
1039+ @param builder: a Gtk.Builder
1040 '''
1041- builder.add_from_file(ViewConfig.BACKENDS_GLADE_FILE)
1042+ builder.add_from_file(ViewConfig.BACKENDS_UI_FILE)
1043 widgets = {
1044 'dialog': 'backends_dialog',
1045 'treeview_window': 'treeview_window',
1046@@ -181,14 +180,14 @@
1047 'add_button': 'add_button',
1048 'remove_button': 'remove_button',
1049 }
1050- for attr, widget in widgets.iteritems():
1051+ for attr, widget in widgets.items():
1052 setattr(self, attr, builder.get_object(widget))
1053
1054 def _setup_signal_connections(self, builder):
1055 '''
1056 Creates some GTK signals connections
1057
1058- @param builder: a gtk.Builder
1059+ @param builder: a Gtk.Builder
1060 '''
1061 signals = {
1062 'on_add_button_clicked': self.on_add_button,
1063@@ -205,7 +204,7 @@
1064 Inform gtk on the location of the backends icons (which is in
1065 the GTG directory tree, and not in the default location for icons
1066 '''
1067- self.icon_theme = gtk.icon_theme_get_default()
1068+ self.icon_theme = Gtk.IconTheme.get_default()
1069 for directory in CoreConfig().get_icons_directories():
1070 self.icon_theme.prepend_search_path(directory)
1071
1072@@ -285,17 +284,17 @@
1073 # no backend selected
1074 return
1075 backend = self.req.get_backend(backend_id)
1076- dialog = gtk.MessageDialog(
1077+ dialog = Gtk.MessageDialog(
1078 parent=self.dialog,
1079- flags=gtk.DIALOG_DESTROY_WITH_PARENT,
1080- type=gtk.MESSAGE_QUESTION,
1081- buttons=gtk.BUTTONS_YES_NO,
1082+ flags=Gtk.DialogFlags.DESTROY_WITH_PARENT,
1083+ type=Gtk.MessageType.QUESTION,
1084+ buttons=Gtk.ButtonsType.YES_NO,
1085 message_format=_("Do you really want to remove the '%s' "
1086 "synchronization service?") %
1087 backend.get_human_name())
1088 response = dialog.run()
1089 dialog.destroy()
1090- if response == gtk.RESPONSE_YES:
1091+ if response == Gtk.ResponseType.YES:
1092 # delete the backend and remove it from the lateral treeview
1093 self.req.remove_backend(backend_id)
1094 self.backends_tv.remove_backend(backend_id)
1095
1096=== modified file 'GTG/gtk/backends_dialog/addpanel.py'
1097--- GTG/gtk/backends_dialog/addpanel.py 2013-11-23 14:40:23 +0000
1098+++ GTG/gtk/backends_dialog/addpanel.py 2014-01-12 07:15:48 +0000
1099@@ -17,16 +17,18 @@
1100 # this program. If not, see <http://www.gnu.org/licenses/>.
1101 # -----------------------------------------------------------------------------
1102
1103-import gtk
1104+from gi.repository import Gtk
1105
1106 from GTG.gtk.backends_dialog.backendscombo import BackendsCombo
1107 from GTG.backends import BackendFactory
1108 from GTG import _, ngettext
1109-
1110-
1111-class AddPanel(gtk.VBox):
1112+from functools import reduce
1113+
1114+
1115+class AddPanel(Gtk.Box):
1116 '''
1117- A VBox filled with gtk widgets to let the user choose a new backend.
1118+ A vertical Box filled with gtk widgets to let the user choose a new
1119+ backend.
1120 '''
1121
1122 def __init__(self, backends_dialog):
1123@@ -36,7 +38,7 @@
1124 @param backends_dialog: a reference to the dialog in which this is
1125 loaded
1126 '''
1127- super(AddPanel, self).__init__()
1128+ super(AddPanel, self).__init__(orientation=Gtk.Orientation.VERTICAL)
1129 self.dialog = backends_dialog
1130 self._create_widgets()
1131
1132@@ -46,90 +48,90 @@
1133 '''
1134 # Division of the available space in three segments:
1135 # top, middle and bottom.
1136- top = gtk.HBox()
1137+ top = Gtk.Box()
1138 top.set_spacing(6)
1139- middle = gtk.HBox()
1140- bottom = gtk.HBox()
1141- self._fill_top_hbox(top)
1142- self._fill_middle_hbox(middle)
1143- self._fill_bottom_hbox(bottom)
1144- self.pack_start(top, False)
1145- self.pack_start(middle, True)
1146- self.pack_start(bottom, True)
1147+ middle = Gtk.Box()
1148+ bottom = Gtk.Box()
1149+ self._fill_top_box(top)
1150+ self._fill_middle_box(middle)
1151+ self._fill_bottom_box(bottom)
1152+ self.pack_start(top, False, True, 0)
1153+ self.pack_start(middle, True, True, 0)
1154+ self.pack_start(bottom, True, True, 0)
1155 self.set_border_width(12)
1156
1157- def _fill_top_hbox(self, hbox):
1158+ def _fill_top_box(self, box):
1159 '''
1160- Helper function to fill and hbox with a combobox that lists the
1161- available backends and a gtk.Label.
1162+ Helper function to fill and box with a combobox that lists the
1163+ available backends and a Gtk.Label.
1164
1165- @param hbox: the gtk.HBox to fill
1166+ @param box: the Gtk.Box to fill
1167 '''
1168- label = gtk.Label(_("Select synchronization service:"))
1169+ label = Gtk.Label(label=_("Select synchronization service:"))
1170 label.set_alignment(0, 0.5)
1171 self.combo_types = BackendsCombo(self.dialog)
1172- self.combo_types.child.connect('changed', self.on_combo_changed)
1173- hbox.pack_start(label, False, True)
1174- hbox.pack_start(self.combo_types, False, True)
1175-
1176- def _fill_middle_hbox(self, hbox):
1177- '''
1178- Helper function to fill an hbox with a label describing the backend
1179- and a gtk.Image (that loads the backend image)
1180-
1181- @param hbox: the gtk.HBox to fill
1182- '''
1183- self.label_name = gtk.Label("name")
1184+ #FIXME
1185+ #self.combo_types.get_child().connect('changed', self.on_combo_changed)
1186+ self.combo_types.connect('changed', self.on_combo_changed)
1187+ box.pack_start(label, False, True, 0)
1188+ box.pack_start(self.combo_types, False, True, 0)
1189+
1190+ def _fill_middle_box(self, box):
1191+ '''
1192+ Helper function to fill an box with a label describing the backend
1193+ and a Gtk.Image (that loads the backend image)
1194+
1195+ @param box: the Gtk.Box to fill
1196+ '''
1197+ self.label_name = Gtk.Label(label="name")
1198 self.label_name.set_alignment(xalign=0.5, yalign=1)
1199- self.label_description = gtk.Label()
1200- self.label_description.set_justify(gtk.JUSTIFY_FILL)
1201+ self.label_description = Gtk.Label()
1202+ self.label_description.set_justify(Gtk.Justification.FILL)
1203 self.label_description.set_line_wrap(True)
1204 self.label_description.set_size_request(300, -1)
1205 self.label_description.set_alignment(xalign=0, yalign=0.5)
1206- self.label_author = gtk.Label("")
1207+ self.label_author = Gtk.Label(label="")
1208 self.label_author.set_line_wrap(True)
1209 self.label_author.set_alignment(xalign=0, yalign=0)
1210- self.label_modules = gtk.Label("")
1211+ self.label_modules = Gtk.Label(label="")
1212 self.label_modules.set_line_wrap(True)
1213 self.label_modules.set_alignment(xalign=0, yalign=0)
1214- self.image_icon = gtk.Image()
1215+ self.image_icon = Gtk.Image()
1216 self.image_icon.set_size_request(128, 128)
1217- align_image = gtk.Alignment(xalign=1, yalign=0)
1218+ align_image = Gtk.Alignment.new(1, 0, 0, 0)
1219 align_image.add(self.image_icon)
1220- labels_vbox = gtk.VBox()
1221- labels_vbox.pack_start(self.label_description, True, True, padding=10)
1222- labels_vbox.pack_start(self.label_author, True, True)
1223- labels_vbox.pack_start(self.label_modules, True, True)
1224- low_hbox = gtk.HBox()
1225- low_hbox.pack_start(labels_vbox, True, True)
1226- low_hbox.pack_start(align_image, True, True)
1227- vbox = gtk.VBox()
1228- vbox.pack_start(self.label_name, True, True)
1229- vbox.pack_start(low_hbox, True, True)
1230- hbox.pack_start(vbox, True, True)
1231+ labels_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
1232+ labels_vbox.pack_start(self.label_description, True, True, 10)
1233+ labels_vbox.pack_start(self.label_author, True, True, 0)
1234+ labels_vbox.pack_start(self.label_modules, True, True, 0)
1235+ low_box = Gtk.Box()
1236+ low_box.pack_start(labels_vbox, True, True, 0)
1237+ low_box.pack_start(align_image, True, True, 0)
1238+ vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
1239+ vbox.pack_start(self.label_name, True, True, 0)
1240+ vbox.pack_start(low_box, True, True, 0)
1241+ box.pack_start(vbox, True, True, 0)
1242
1243- def _fill_bottom_hbox(self, hbox):
1244+ def _fill_bottom_box(self, box):
1245 '''
1246- Helper function to fill and hbox with a buttonbox, featuring
1247+ Helper function to fill and box with a buttonbox, featuring
1248 and ok and cancel buttons.
1249
1250- @param hbox: the gtk.HBox to fill
1251+ @param box: the Gtk.Box to fill
1252 '''
1253- cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
1254+ cancel_button = Gtk.Button(stock=Gtk.STOCK_CANCEL)
1255 cancel_button.connect('clicked', self.on_cancel)
1256- self.ok_button = gtk.Button(stock=gtk.STOCK_OK)
1257+ self.ok_button = Gtk.Button(stock=Gtk.STOCK_OK)
1258 self.ok_button.connect('clicked', self.on_confirm)
1259- align = gtk.Alignment(xalign=0.5,
1260- yalign=1,
1261- xscale=1)
1262+ align = Gtk.Alignment.new(0.5, 1, 1, 0)
1263 align.set_padding(0, 10, 0, 0)
1264- buttonbox = gtk.HButtonBox()
1265- buttonbox.set_layout(gtk.BUTTONBOX_EDGE)
1266+ buttonbox = Gtk.ButtonBox()
1267+ buttonbox.set_layout(Gtk.ButtonBoxStyle.EDGE)
1268 buttonbox.add(cancel_button)
1269 buttonbox.set_child_secondary(cancel_button, False)
1270 buttonbox.add(self.ok_button)
1271 align.add(buttonbox)
1272- hbox.pack_start(align, True, True)
1273+ box.pack_start(align, True, True, 0)
1274
1275 def refresh_backends(self):
1276 '''Populates the combo box containing the available backends'''
1277@@ -137,7 +139,7 @@
1278
1279 def on_confirm(self, widget=None):
1280 '''
1281- Notifies the dialog holding this VBox that a backend has been
1282+ Notifies the dialog holding this Box that a backend has been
1283 chosen
1284
1285 @param widget: just to make this function usable as a signal callback.
1286
1287=== modified file 'GTG/gtk/backends_dialog/backendscombo.py'
1288--- GTG/gtk/backends_dialog/backendscombo.py 2013-11-23 14:40:23 +0000
1289+++ GTG/gtk/backends_dialog/backendscombo.py 2014-01-12 07:15:48 +0000
1290@@ -17,12 +17,13 @@
1291 # this program. If not, see <http://www.gnu.org/licenses/>.
1292 # -----------------------------------------------------------------------------
1293
1294-import gtk
1295+from gi.repository import Gtk
1296+from gi.repository import GdkPixbuf
1297
1298 from GTG.backends import BackendFactory
1299
1300
1301-class BackendsCombo(gtk.ComboBoxEntry):
1302+class BackendsCombo(Gtk.ComboBox):
1303 '''
1304 A combobox listing all the available backends types
1305 '''
1306@@ -39,7 +40,7 @@
1307 @param backends_dialog: reference to the dialog in which this combo is
1308 loaded.
1309 '''
1310- super(BackendsCombo, self).__init__()
1311+ Gtk.ComboBox.__init__(self)
1312 self.dialog = backends_dialog
1313 self._liststore_init()
1314 self._renderers_init()
1315@@ -47,18 +48,18 @@
1316 self.show_all()
1317
1318 def _liststore_init(self):
1319- '''Setup the gtk.ListStore'''
1320- self.liststore = gtk.ListStore(str, str, gtk.gdk.Pixbuf)
1321+ '''Setup the Gtk.ListStore'''
1322+ self.liststore = Gtk.ListStore(str, str, GdkPixbuf.Pixbuf)
1323 self.set_model(self.liststore)
1324
1325 def _renderers_init(self):
1326 '''Configure the cell renderers'''
1327 # Text renderer
1328- text_cell = gtk.CellRendererText()
1329+ text_cell = Gtk.CellRendererText()
1330 self.pack_start(text_cell, False)
1331- self.set_text_column(self.COLUMN_HUMAN_NAME)
1332+ self.add_attribute(text_cell, 'text', 1)
1333 # Icon renderer
1334- pixbuf_cell = gtk.CellRendererPixbuf()
1335+ pixbuf_cell = Gtk.CellRendererPixbuf()
1336 self.pack_start(pixbuf_cell, False)
1337 self.add_attribute(pixbuf_cell, "pixbuf", self.COLUMN_ICON)
1338
1339@@ -68,7 +69,7 @@
1340 '''
1341 self.liststore.clear()
1342 backend_types = BackendFactory().get_all_backends()
1343- for name, module in backend_types.iteritems():
1344+ for name, module in backend_types.items():
1345 # FIXME: Disable adding another localfile backend.
1346 # It just produce many warnings, provides no use case
1347 # See LP bug #940917 (Izidor)
1348
1349=== modified file 'GTG/gtk/backends_dialog/backendstree.py'
1350--- GTG/gtk/backends_dialog/backendstree.py 2013-11-23 14:40:23 +0000
1351+++ GTG/gtk/backends_dialog/backendstree.py 2014-01-12 07:15:48 +0000
1352@@ -17,16 +17,17 @@
1353 # this program. If not, see <http://www.gnu.org/licenses/>.
1354 # -----------------------------------------------------------------------------
1355
1356-import gtk
1357+from gi.repository import Gtk
1358+from gi.repository import GdkPixbuf
1359
1360 from GTG.gtk.colors import get_colored_tags_markup
1361 from GTG.backends.genericbackend import GenericBackend
1362 from GTG.backends.backendsignals import BackendSignals
1363
1364
1365-class BackendsTree(gtk.TreeView):
1366+class BackendsTree(Gtk.TreeView):
1367 '''
1368- gtk.TreeView that shows the currently loaded backends.
1369+ Gtk.TreeView that shows the currently loaded backends.
1370 '''
1371
1372 COLUMN_BACKEND_ID = 0 # never shown, used for internal lookup.
1373@@ -50,7 +51,7 @@
1374 self.refresh()
1375
1376 def refresh(self):
1377- '''refreshes the gtk.Liststore'''
1378+ '''refreshes the Gtk.Liststore'''
1379 self.backendid_to_iter = {}
1380 self.liststore.clear()
1381
1382@@ -110,7 +111,6 @@
1383 @param backend_id: the id of the backend to add
1384 '''
1385 if backend_id in self.backendid_to_iter:
1386- style = self.get_style()
1387 b_iter = self.backendid_to_iter[backend_id]
1388 b_path = self.liststore.get_path(b_iter)
1389 backend = self.req.get_backend(backend_id)
1390@@ -118,7 +118,12 @@
1391 if backend.is_enabled():
1392 text = backend_name
1393 else:
1394- color = str(style.text[gtk.STATE_INSENSITIVE])
1395+ #FIXME This snippet is on more than 2 places!!!
1396+ #FIXME create a function which takes a widget and
1397+ #flag and returns color as #RRGGBB
1398+ style_context = self.get_style_context()
1399+ color = style_context.get_color(Gtk.StateFlags.INSENSITIVE)
1400+ color = color.to_color().to_string()
1401 text = "<span color='%s'>%s</span>" % \
1402 (color, backend_name)
1403 self.liststore[b_path][self.COLUMN_TEXT] = text
1404@@ -153,7 +158,7 @@
1405
1406 def _init_liststore(self):
1407 '''Creates the liststore'''
1408- self.liststore = gtk.ListStore(object, gtk.gdk.Pixbuf, str, str)
1409+ self.liststore = Gtk.ListStore(object, GdkPixbuf.Pixbuf, str, str)
1410 self.set_model(self.liststore)
1411
1412 def _init_renderers(self):
1413@@ -161,29 +166,29 @@
1414 # We hide the columns headers
1415 self.set_headers_visible(False)
1416 # For the backend icon
1417- pixbuf_cell = gtk.CellRendererPixbuf()
1418- tvcolumn_pixbuf = gtk.TreeViewColumn('Icon', pixbuf_cell)
1419+ pixbuf_cell = Gtk.CellRendererPixbuf()
1420+ tvcolumn_pixbuf = Gtk.TreeViewColumn('Icon', pixbuf_cell)
1421 tvcolumn_pixbuf.add_attribute(pixbuf_cell, 'pixbuf', self.COLUMN_ICON)
1422 self.append_column(tvcolumn_pixbuf)
1423 # For the backend name
1424- text_cell = gtk.CellRendererText()
1425- tvcolumn_text = gtk.TreeViewColumn('Name', text_cell)
1426+ text_cell = Gtk.CellRendererText()
1427+ tvcolumn_text = Gtk.TreeViewColumn('Name', text_cell)
1428 tvcolumn_text.add_attribute(text_cell, 'markup', self.COLUMN_TEXT)
1429 self.append_column(tvcolumn_text)
1430 text_cell.connect('edited', self.cell_edited_callback)
1431 text_cell.set_property('editable', True)
1432 # For the backend tags
1433- tags_cell = gtk.CellRendererText()
1434- tvcolumn_tags = gtk.TreeViewColumn('Tags', tags_cell)
1435+ tags_cell = Gtk.CellRendererText()
1436+ tvcolumn_tags = Gtk.TreeViewColumn('Tags', tags_cell)
1437 tvcolumn_tags.add_attribute(tags_cell, 'markup', self.COLUMN_TAGS)
1438 self.append_column(tvcolumn_tags)
1439
1440 def cell_edited_callback(self, text_cell, path, new_text):
1441 '''If a backend name is changed, it saves the changes in the Backend
1442
1443- @param text_cell: not used. The gtk.CellRendererText that emitted the
1444+ @param text_cell: not used. The Gtk.CellRendererText that emitted the
1445 signal. Only here because it's passed by the signal
1446- @param path: the gtk.TreePath of the edited cell
1447+ @param path: the Gtk.TreePath of the edited cell
1448 @param new_text: the new name of the backend
1449 '''
1450 # we strip everything not permitted in backend names
1451@@ -218,7 +223,7 @@
1452 '''
1453 Helper function to get the selected path
1454
1455- @return gtk.TreePath : returns exactly one path for the selected object
1456+ @return Gtk.TreePath : returns exactly one path for the selected object
1457 or None
1458 '''
1459 selection = self.get_selection()
1460
1461=== modified file 'GTG/gtk/backends_dialog/configurepanel.py'
1462--- GTG/gtk/backends_dialog/configurepanel.py 2013-11-23 14:40:23 +0000
1463+++ GTG/gtk/backends_dialog/configurepanel.py 2014-01-12 07:15:48 +0000
1464@@ -17,16 +17,16 @@
1465 # this program. If not, see <http://www.gnu.org/licenses/>.
1466 # -----------------------------------------------------------------------------
1467
1468-import gtk
1469+from gi.repository import Gtk
1470
1471 from GTG import _
1472 from GTG.gtk.backends_dialog.parameters_ui import ParametersUI
1473 from GTG.backends.backendsignals import BackendSignals
1474
1475
1476-class ConfigurePanel(gtk.VBox):
1477+class ConfigurePanel(Gtk.Box):
1478 '''
1479- A VBox that lets you configure a backend
1480+ A vertical Box that lets you configure a backend
1481 '''
1482
1483 def __init__(self, backends_dialog):
1484@@ -36,7 +36,8 @@
1485 @param backends_dialog: a reference to the dialog in which this is
1486 loaded
1487 '''
1488- super(ConfigurePanel, self).__init__()
1489+ super(ConfigurePanel, self).__init__(
1490+ orientation=Gtk.Orientation.VERTICAL)
1491 self.dialog = backends_dialog
1492 self.should_spinner_be_shown = False
1493 self.task_deleted_handle = None
1494@@ -56,61 +57,61 @@
1495
1496 def _create_widgets(self):
1497 '''
1498- This function fills this Vbox with widgets
1499+ This function fills this box with widgets
1500 '''
1501 # Division of the available space in three segments:
1502 # top, middle and bottom
1503- top = gtk.HBox()
1504- middle = gtk.HBox()
1505- self._fill_top_hbox(top)
1506- self._fill_middle_hbox(middle)
1507- self.pack_start(top, False)
1508- self.pack_start(middle, False)
1509- align = gtk.Alignment(xalign=0, yalign=0, xscale=1)
1510+ top = Gtk.Box()
1511+ middle = Gtk.Box()
1512+ self._fill_top_box(top)
1513+ self._fill_middle_box(middle)
1514+ self.pack_start(top, False, True, 0)
1515+ self.pack_start(middle, False, True, 0)
1516+ align = Gtk.Alignment.new(0, 0, 1, 0)
1517 align.set_padding(10, 0, 0, 0)
1518 self.parameters_ui = ParametersUI(self.req)
1519 align.add(self.parameters_ui)
1520- self.pack_start(align, False)
1521+ self.pack_start(align, False, True, 0)
1522
1523- def _fill_top_hbox(self, hbox):
1524+ def _fill_top_box(self, box):
1525 """ Fill header with service's icon, name, and a spinner
1526 for inidcation of work.
1527-
1528- @param hbox: the gtk.HBox to fill
1529 """
1530- self.image_icon = gtk.Image()
1531+ box.set_spacing(10)
1532+ self.image_icon = Gtk.Image()
1533 self.image_icon.set_size_request(48, 48)
1534
1535- self.human_name_label = gtk.Label()
1536+ self.human_name_label = Gtk.Label()
1537 self.human_name_label.set_alignment(xalign=0, yalign=0.5)
1538
1539+ #FIXME in the newer versions of GTK3 there always be Spinner!
1540 try:
1541- self.spinner = gtk.Spinner()
1542+ self.spinner = Gtk.Spinner()
1543 except AttributeError:
1544 # worarkound for archlinux: bug #624204
1545- self.spinner = gtk.HBox()
1546+ self.spinner = Gtk.Box()
1547 self.spinner.connect("show", self.on_spinner_show)
1548 self.spinner.set_size_request(32, 32)
1549- align_spin = gtk.Alignment(xalign=1, yalign=0)
1550+ align_spin = Gtk.Alignment.new(1, 0, 0, 0)
1551 align_spin.add(self.spinner)
1552
1553- hbox.set_spacing(10)
1554- hbox.pack_start(self.image_icon, False)
1555- hbox.pack_start(self.human_name_label, True)
1556- hbox.pack_start(align_spin, False)
1557-
1558- def _fill_middle_hbox(self, hbox):
1559- '''
1560- Helper function to fill an hbox with a label and a button
1561-
1562- @param hbox: the gtk.HBox to fill
1563- '''
1564- self.sync_status_label = gtk.Label()
1565+ box.set_spacing(10)
1566+ box.pack_start(self.image_icon, False, True, 0)
1567+ box.pack_start(self.human_name_label, True, True, 0)
1568+ box.pack_start(align_spin, False, True, 0)
1569+
1570+ def _fill_middle_box(self, box):
1571+ '''
1572+ Helper function to fill an box with a label and a button
1573+
1574+ @param box: the Gtk.Box to fill
1575+ '''
1576+ self.sync_status_label = Gtk.Label()
1577 self.sync_status_label.set_alignment(xalign=0.8, yalign=0.5)
1578- self.sync_button = gtk.Button()
1579+ self.sync_button = Gtk.Button()
1580 self.sync_button.connect("clicked", self.on_sync_button_clicked)
1581- hbox.pack_start(self.sync_status_label, True)
1582- hbox.pack_start(self.sync_button, True)
1583+ box.pack_start(self.sync_status_label, True, True, 0)
1584+ box.pack_start(self.sync_button, True, True, 0)
1585
1586 def set_backend(self, backend_id):
1587 '''Changes the backend to configure, refreshing this view.
1588@@ -149,7 +150,7 @@
1589
1590 def refresh_sync_status_label(self):
1591 '''
1592- Refreshes the gtk.Label that shows the current state of this backend
1593+ Refreshes the Gtk.Label that shows the current state of this backend
1594 '''
1595 if self.backend.is_default():
1596 label = _("This is the default synchronization service")
1597@@ -183,7 +184,7 @@
1598 def on_sync_started(self, sender, backend_id):
1599 '''
1600 If the backend has started syncing tasks, update the state of the
1601- gtk.Spinner
1602+ Gtk.Spinner
1603
1604 @param sender: not used, here only for signal callback compatibility
1605 @param backend_id: the id of the backend that emitted this signal
1606@@ -194,7 +195,7 @@
1607 def on_sync_ended(self, sender, backend_id):
1608 '''
1609 If the backend has stopped syncing tasks, update the state of the
1610- gtk.Spinner
1611+ Gtk.Spinner
1612
1613 @param sender: not used, here only for signal callback compatibility
1614 @param backend_id: the id of the backend that emitted this signal
1615@@ -216,17 +217,17 @@
1616
1617 def spinner_set_active(self, active):
1618 '''
1619- Enables/disables the gtk.Spinner, while showing/hiding it at the same
1620+ Enables/disables the Gtk.Spinner, while showing/hiding it at the same
1621 time
1622
1623 @param active: True if the spinner should spin
1624 '''
1625 self.should_spinner_be_shown = active
1626 if active:
1627- if isinstance(self.spinner, gtk.Spinner):
1628+ if isinstance(self.spinner, Gtk.Spinner):
1629 self.spinner.start()
1630 self.spinner.show()
1631 else:
1632 self.spinner.hide()
1633- if isinstance(self.spinner, gtk.Spinner):
1634+ if isinstance(self.spinner, Gtk.Spinner):
1635 self.spinner.stop()
1636
1637=== modified file 'GTG/gtk/backends_dialog/parameters_ui/__init__.py'
1638--- GTG/gtk/backends_dialog/parameters_ui/__init__.py 2013-11-23 14:40:23 +0000
1639+++ GTG/gtk/backends_dialog/parameters_ui/__init__.py 2014-01-12 07:15:48 +0000
1640@@ -24,7 +24,7 @@
1641 server and client
1642 '''
1643
1644-import gtk
1645+from gi.repository import Gtk
1646 import functools
1647
1648 from GTG import _
1649@@ -37,9 +37,10 @@
1650 from GTG.gtk.backends_dialog.parameters_ui.pathui import PathUI
1651
1652
1653-class ParametersUI(gtk.VBox):
1654+class ParametersUI(Gtk.Box):
1655 '''
1656- Given a bakcend, this gtk.VBox populates itself with all the necessary
1657+ Given a bakcend, this vertical Gtk.Box populates itself with all the
1658+ necessary
1659 widgets to view and edit a backend configuration
1660 '''
1661
1662@@ -50,7 +51,8 @@
1663
1664 @param requester: a GTG.core.requester.Requester object
1665 '''
1666- super(ParametersUI, self).__init__(False)
1667+ super(ParametersUI, self).__init__(
1668+ False, orientation=Gtk.Orientation.VERTICAL)
1669 self.req = requester
1670 self.set_spacing(10)
1671
1672@@ -98,7 +100,7 @@
1673 })),
1674 ("tag-with-project-name", self.UI_generator(CheckBoxUI, {
1675 "text": _("Tag your GTG tasks with the project "
1676- "targeted by the bug"),
1677+ "targeted by the bug"),
1678 "parameter": "tag-with-project-name",
1679 })),
1680 )
1681@@ -127,9 +129,9 @@
1682 @param backend: the backend that is being configured
1683 '''
1684 # remove the old parameters UIs
1685- def _remove_child(self, child):
1686+ def _remove_child(self, child, data=None):
1687 self.remove(child)
1688- self.foreach(functools.partial(_remove_child, self))
1689+ self.foreach(functools.partial(_remove_child, self), None)
1690 # add new widgets
1691 backend_parameters = backend.get_parameters()
1692 if backend_parameters[GenericBackend.KEY_DEFAULT_BACKEND]:
1693@@ -137,7 +139,8 @@
1694 return
1695 for parameter_name, widget in self.parameter_widgets:
1696 if parameter_name in backend_parameters:
1697- self.pack_start(widget(backend), True)
1698+ #FIXME I am not 100% about this change
1699+ self.pack_start(widget(backend), True, True, 0)
1700 self.show_all()
1701
1702 def commit_changes(self):
1703@@ -146,6 +149,6 @@
1704 modified them)
1705 '''
1706
1707- def _commit_changes(child):
1708+ def _commit_changes(child, data=None):
1709 child.commit_changes()
1710- self.foreach(_commit_changes)
1711+ self.foreach(_commit_changes, None)
1712
1713=== modified file 'GTG/gtk/backends_dialog/parameters_ui/checkboxui.py'
1714--- GTG/gtk/backends_dialog/parameters_ui/checkboxui.py 2013-11-23 14:40:23 +0000
1715+++ GTG/gtk/backends_dialog/parameters_ui/checkboxui.py 2014-01-12 07:15:48 +0000
1716@@ -17,10 +17,10 @@
1717 # this program. If not, see <http://www.gnu.org/licenses/>.
1718 # -----------------------------------------------------------------------------
1719
1720-import gtk
1721-
1722-
1723-class CheckBoxUI(gtk.HBox):
1724+from gi.repository import Gtk
1725+
1726+
1727+class CheckBoxUI(Gtk.Box):
1728 '''
1729 It's a widget displaying a simple checkbox, with some text to explain its
1730 meaning
1731@@ -46,13 +46,13 @@
1732 def _populate_gtk(self, width):
1733 '''Creates the checkbox and the related label
1734
1735- @param width: the width of the gtk.Label object
1736+ @param width: the width of the Gtk.Label object
1737 '''
1738- self.checkbutton = gtk.CheckButton(label=self.text)
1739+ self.checkbutton = Gtk.CheckButton(label=self.text)
1740 backend_parameters = self.backend.get_parameters()[self.parameter]
1741 self.checkbutton.set_active(backend_parameters)
1742 self.checkbutton.connect("toggled", self.on_modified)
1743- self.pack_start(self.checkbutton, False)
1744+ self.pack_start(self.checkbutton, False, True, 0)
1745
1746 def commit_changes(self):
1747 '''Saves the changes to the backend parameter'''
1748
1749=== modified file 'GTG/gtk/backends_dialog/parameters_ui/importtagsui.py'
1750--- GTG/gtk/backends_dialog/parameters_ui/importtagsui.py 2013-11-23 14:40:23 +0000
1751+++ GTG/gtk/backends_dialog/parameters_ui/importtagsui.py 2014-01-12 07:15:48 +0000
1752@@ -17,12 +17,13 @@
1753 # this program. If not, see <http://www.gnu.org/licenses/>.
1754 # -----------------------------------------------------------------------------
1755
1756-import gtk
1757+from gi.repository import Gtk
1758
1759 from GTG.backends.genericbackend import GenericBackend
1760-
1761-
1762-class ImportTagsUI(gtk.VBox):
1763+from functools import reduce
1764+
1765+
1766+class ImportTagsUI(Gtk.Box):
1767 '''
1768 It's a widget displaying a couple of radio buttons, a label and a textbox
1769 to let the user change the attached tags (or imported)
1770@@ -42,7 +43,8 @@
1771 radio button
1772 @param parameter_name: the backend parameter this widget should modify
1773 '''
1774- super(ImportTagsUI, self).__init__()
1775+ super(ImportTagsUI, self).__init__(
1776+ orientation=Gtk.Orientation.VERTICAL)
1777 self.backend = backend
1778 self.req = req
1779 self.title = title
1780@@ -59,26 +61,26 @@
1781
1782 @param width: the length of the radio buttons
1783 '''
1784- title_label = gtk.Label()
1785+ title_label = Gtk.Label()
1786 title_label.set_alignment(xalign=0, yalign=0)
1787 title_label.set_markup("<big><b>%s</b></big>" % self.title)
1788- self.pack_start(title_label, True)
1789- align = gtk.Alignment(xalign=0, yalign=0, xscale=1)
1790+ self.pack_start(title_label, True, True, 0)
1791+ align = Gtk.Alignment.new(0, 0, 1, 0)
1792 align.set_padding(0, 0, 10, 0)
1793- self.pack_start(align, True)
1794- vbox = gtk.VBox()
1795+ self.pack_start(align, True, True, 0)
1796+ vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
1797 align.add(vbox)
1798- self.all_tags_radio = gtk.RadioButton(group=None,
1799+ self.all_tags_radio = Gtk.RadioButton(group=None,
1800 label=self.anybox_text)
1801- vbox.pack_start(self.all_tags_radio, True)
1802- self.some_tags_radio = gtk.RadioButton(group=self.all_tags_radio,
1803+ vbox.pack_start(self.all_tags_radio, True, True, 0)
1804+ self.some_tags_radio = Gtk.RadioButton(group=self.all_tags_radio,
1805 label=self.somebox_text)
1806 self.some_tags_radio.set_size_request(width=width, height=-1)
1807- hbox = gtk.HBox()
1808- vbox.pack_start(hbox, True)
1809- hbox.pack_start(self.some_tags_radio, False)
1810- self.tags_entry = gtk.Entry()
1811- hbox.pack_start(self.tags_entry, True)
1812+ box = Gtk.Box()
1813+ vbox.pack_start(box, True, True, 0)
1814+ box.pack_start(self.some_tags_radio, False, True, 0)
1815+ self.tags_entry = Gtk.Entry()
1816+ box.pack_start(self.tags_entry, True, True, 0)
1817
1818 def on_changed(self, radio, data=None):
1819 ''' Signal callback, executed when the user modifies something.
1820@@ -99,9 +101,9 @@
1821 else:
1822 tags = self.tags_entry.get_text().split(",")
1823 # stripping spaces
1824- tags = map(lambda t: t.strip(), tags)
1825+ tags = [t.strip() for t in tags]
1826 # removing empty tags
1827- tags = filter(lambda t: t, tags)
1828+ tags = [t for t in tags if t]
1829
1830 self.backend.set_parameter(self.parameter_name, tags)
1831
1832
1833=== modified file 'GTG/gtk/backends_dialog/parameters_ui/passwordui.py'
1834--- GTG/gtk/backends_dialog/parameters_ui/passwordui.py 2013-11-23 14:40:23 +0000
1835+++ GTG/gtk/backends_dialog/parameters_ui/passwordui.py 2014-01-12 07:15:48 +0000
1836@@ -17,12 +17,12 @@
1837 # this program. If not, see <http://www.gnu.org/licenses/>.
1838 # -----------------------------------------------------------------------------
1839
1840-import gtk
1841+from gi.repository import Gtk
1842
1843 from GTG import _
1844
1845
1846-class PasswordUI(gtk.HBox):
1847+class PasswordUI(Gtk.Box):
1848 '''Widget displaying a gtk.Label and a textbox to input a password'''
1849
1850 def __init__(self, req, backend, width):
1851@@ -31,7 +31,7 @@
1852
1853 @param req: a Requester
1854 @param backend: a backend object
1855- @param width: the width of the gtk.Label object
1856+ @param width: the width of the Gtk.Label object
1857 '''
1858 super(PasswordUI, self).__init__()
1859 self.backend = backend
1860@@ -43,16 +43,16 @@
1861 def _populate_gtk(self, width):
1862 '''Creates the text box and the related label
1863
1864- @param width: the width of the gtk.Label object
1865+ @param width: the width of the Gtk.Label object
1866 '''
1867- password_label = gtk.Label(_("Password:"))
1868+ password_label = Gtk.Label(label=_("Password:"))
1869 password_label.set_alignment(xalign=0, yalign=0.5)
1870 password_label.set_size_request(width=width, height=-1)
1871- self.pack_start(password_label, False)
1872- align = gtk.Alignment(xalign=0, yalign=0.5, xscale=1)
1873+ self.pack_start(password_label, False, True, 0)
1874+ align = Gtk.Alignment.new(0, 0.5, 1, 0)
1875 align.set_padding(0, 0, 10, 0)
1876- self.pack_start(align, True)
1877- self.password_textbox = gtk.Entry()
1878+ self.pack_start(align, True, True, 0)
1879+ self.password_textbox = Gtk.Entry()
1880 align.add(self.password_textbox)
1881
1882 def _load_password(self):
1883
1884=== modified file 'GTG/gtk/backends_dialog/parameters_ui/pathui.py'
1885--- GTG/gtk/backends_dialog/parameters_ui/pathui.py 2013-11-23 14:40:23 +0000
1886+++ GTG/gtk/backends_dialog/parameters_ui/pathui.py 2014-01-12 07:15:48 +0000
1887@@ -17,13 +17,13 @@
1888 # this program. If not, see <http://www.gnu.org/licenses/>.
1889 # -----------------------------------------------------------------------------
1890
1891-import gtk
1892+from gi.repository import Gtk
1893 import os.path
1894
1895 from GTG import _
1896
1897
1898-class PathUI(gtk.HBox):
1899+class PathUI(Gtk.Box):
1900 '''Gtk widgets to show a path in a textbox, and a button to bring up a
1901 filesystem explorer to modify that path (also, a label to describe those)
1902 '''
1903@@ -34,7 +34,7 @@
1904
1905 @param req: a Requester
1906 @param backend: a backend object
1907- @param width: the width of the gtk.Label object
1908+ @param width: the width of the Gtk.Label object
1909 '''
1910 super(PathUI, self).__init__()
1911 self.backend = backend
1912@@ -42,25 +42,25 @@
1913 self._populate_gtk(width)
1914
1915 def _populate_gtk(self, width):
1916- '''Creates the gtk.Label, the textbox and the button
1917+ '''Creates the Gtk.Label, the textbox and the button
1918
1919- @param width: the width of the gtk.Label object
1920+ @param width: the width of the Gtk.Label object
1921 '''
1922- label = gtk.Label(_("Filename:"))
1923+ label = Gtk.Label(label=_("Filename:"))
1924 label.set_line_wrap(True)
1925 label.set_alignment(xalign=0, yalign=0.5)
1926 label.set_size_request(width=width, height=-1)
1927- self.pack_start(label, False)
1928- align = gtk.Alignment(xalign=0, yalign=0.5, xscale=1)
1929+ self.pack_start(label, False, True, 0)
1930+ align = Gtk.Alignment.new(0, 0.5, 1, 0)
1931 align.set_padding(0, 0, 10, 0)
1932- self.pack_start(align, True)
1933- self.textbox = gtk.Entry()
1934+ self.pack_start(align, True, True, 0)
1935+ self.textbox = Gtk.Entry()
1936 self.textbox.set_text(self.backend.get_parameters()['path'])
1937 self.textbox.connect('changed', self.on_path_modified)
1938 align.add(self.textbox)
1939- self.button = gtk.Button(stock=gtk.STOCK_EDIT)
1940+ self.button = Gtk.Button(stock=Gtk.STOCK_EDIT)
1941 self.button.connect('clicked', self.on_button_clicked)
1942- self.pack_start(self.button, False)
1943+ self.pack_start(self.button, False, True, 0)
1944
1945 def commit_changes(self):
1946 '''Saves the changes to the backend parameter'''
1947@@ -81,30 +81,30 @@
1948
1949 @param sender: not used, only here for signal compatibility
1950 '''
1951- self.chooser = gtk.FileChooserDialog(
1952+ self.chooser = Gtk.FileChooserDialog(
1953 title=None,
1954- action=gtk.FILE_CHOOSER_ACTION_SAVE,
1955- buttons=(gtk.STOCK_CANCEL,
1956- gtk.RESPONSE_CANCEL,
1957- gtk.STOCK_OK,
1958- gtk.RESPONSE_OK))
1959- self.chooser.set_default_response(gtk.RESPONSE_OK)
1960+ action=Gtk.FileChooserAction.SAVE,
1961+ buttons=(Gtk.STOCK_CANCEL,
1962+ Gtk.ResponseType.CANCEL,
1963+ Gtk.STOCK_OK,
1964+ Gtk.ResponseType.OK))
1965+ self.chooser.set_default_response(Gtk.ResponseType.OK)
1966 # set default file as the current self.path
1967 dirname, basename = os.path.split(self.textbox.get_text())
1968 self.chooser.set_current_name(basename)
1969 self.chosser.set_current_folder(dirname)
1970
1971 # filter files
1972- afilter = gtk.FileFilter()
1973+ afilter = Gtk.FileFilter()
1974 afilter.set_name("All files")
1975 afilter.add_pattern("*")
1976 self.chooser.add_filter(afilter)
1977- afilter = gtk.FileFilter()
1978+ afilter = Gtk.FileFilter()
1979 afilter.set_name("XML files")
1980 afilter.add_mime_type("text/plain")
1981 afilter.add_pattern("*.xml")
1982 self.chooser.add_filter(afilter)
1983 response = self.chooser.run()
1984- if response == gtk.RESPONSE_OK:
1985+ if response == Gtk.ResponseType.OK:
1986 self.textbox.set_text(self.chooser.get_filename())
1987 self.chooser.destroy()
1988
1989=== modified file 'GTG/gtk/backends_dialog/parameters_ui/periodui.py'
1990--- GTG/gtk/backends_dialog/parameters_ui/periodui.py 2013-11-23 14:40:23 +0000
1991+++ GTG/gtk/backends_dialog/parameters_ui/periodui.py 2014-01-12 07:15:48 +0000
1992@@ -17,23 +17,23 @@
1993 # this program. If not, see <http://www.gnu.org/licenses/>.
1994 # -----------------------------------------------------------------------------
1995
1996-import gtk
1997+from gi.repository import Gtk
1998
1999 from GTG import _, ngettext
2000
2001
2002-class PeriodUI(gtk.HBox):
2003+class PeriodUI(Gtk.Box):
2004 '''A widget to change the frequency of a backend synchronization
2005 '''
2006
2007 def __init__(self, req, backend, width):
2008 '''
2009- Creates the gtk.Adjustment and the related label. Loads the current
2010+ Creates the Gtk.Adjustment and the related label. Loads the current
2011 period.
2012
2013 @param req: a Requester
2014 @param backend: a backend object
2015- @param width: the width of the gtk.Label object
2016+ @param width: the width of the Gtk.Label object
2017 '''
2018 super(PeriodUI, self).__init__()
2019 self.backend = backend
2020@@ -44,30 +44,30 @@
2021 def _populate_gtk(self, width):
2022 '''Creates the gtk widgets
2023
2024- @param width: the width of the gtk.Label object
2025+ @param width: the width of the Gtk.Label object
2026 '''
2027- period_label = gtk.Label(_("Check for new tasks every"))
2028+ period_label = Gtk.Label(label=_("Check for new tasks every"))
2029 period_label.set_alignment(xalign=0, yalign=0.5)
2030 period_label.set_line_wrap(True)
2031 period_label.set_size_request(width=width, height=-1)
2032- self.pack_start(period_label, False)
2033- align = gtk.Alignment(xalign=0, yalign=0.5, xscale=1)
2034+ self.pack_start(period_label, False, True, 0)
2035+ align = Gtk.Alignment.new(0, 0.5, 1, 0)
2036 align.set_padding(0, 0, 10, 0)
2037- self.pack_start(align, False)
2038+ self.pack_start(align, False, True, 0)
2039 period = self.backend.get_parameters()['period']
2040- self.adjustment = gtk.Adjustment(value=period,
2041+ self.adjustment = Gtk.Adjustment(value=period,
2042 lower=1,
2043 upper=120,
2044 step_incr=1,
2045 page_incr=0,
2046 page_size=0)
2047- self.period_spin = gtk.SpinButton(adjustment=self.adjustment,
2048+ self.period_spin = Gtk.SpinButton(adjustment=self.adjustment,
2049 climb_rate=0.3,
2050 digits=0)
2051- self.minutes_label = gtk.Label()
2052+ self.minutes_label = Gtk.Label()
2053 self.update_minutes_label()
2054 self.minutes_label.set_alignment(xalign=0, yalign=0.5)
2055- self.pack_start(self.minutes_label, False)
2056+ self.pack_start(self.minutes_label, False, True, 0)
2057 align.add(self.period_spin)
2058 self.show_all()
2059
2060
2061=== modified file 'GTG/gtk/backends_dialog/parameters_ui/textui.py'
2062--- GTG/gtk/backends_dialog/parameters_ui/textui.py 2013-11-23 14:40:23 +0000
2063+++ GTG/gtk/backends_dialog/parameters_ui/textui.py 2014-01-12 07:15:48 +0000
2064@@ -17,10 +17,10 @@
2065 # this program. If not, see <http://www.gnu.org/licenses/>.
2066 # -----------------------------------------------------------------------------
2067
2068-import gtk
2069-
2070-
2071-class TextUI(gtk.HBox):
2072+from gi.repository import Gtk
2073+
2074+
2075+class TextUI(Gtk.Box):
2076 '''A widget to display a simple textbox and a label to describe its content
2077 '''
2078
2079@@ -31,7 +31,7 @@
2080
2081 @param req: a Requester
2082 @param backend: a backend object
2083- @param width: the width of the gtk.Label object
2084+ @param width: the width of the Gtk.Label object
2085 '''
2086 super(TextUI, self).__init__()
2087 self.backend = backend
2088@@ -43,17 +43,17 @@
2089 def _populate_gtk(self, width):
2090 '''Creates the gtk widgets
2091
2092- @param width: the width of the gtk.Label object
2093+ @param width: the width of the Gtk.Label object
2094 '''
2095- label = gtk.Label("%s:" % self.description)
2096+ label = Gtk.Label(label="%s:" % self.description)
2097 label.set_line_wrap(True)
2098 label.set_alignment(xalign=0, yalign=0.5)
2099 label.set_size_request(width=width, height=-1)
2100- self.pack_start(label, False)
2101- align = gtk.Alignment(xalign=0, yalign=0.5, xscale=1)
2102+ self.pack_start(label, False, True, 0)
2103+ align = Gtk.Alignment.new(0, 0.5, 1, 0)
2104 align.set_padding(0, 0, 10, 0)
2105- self.pack_start(align, True)
2106- self.textbox = gtk.Entry()
2107+ self.pack_start(align, True, True, 0)
2108+ self.textbox = Gtk.Entry()
2109 backend_parameters = self.backend.get_parameters()[self.parameter_name]
2110 self.textbox.set_text(backend_parameters)
2111 self.textbox.connect('changed', self.on_text_modified)
2112
2113=== modified file 'GTG/gtk/browser/CellRendererTags.py'
2114--- GTG/gtk/browser/CellRendererTags.py 2013-11-23 14:40:23 +0000
2115+++ GTG/gtk/browser/CellRendererTags.py 2014-01-12 07:15:48 +0000
2116@@ -20,23 +20,19 @@
2117 #=== IMPORT ===================================================================
2118
2119 # system imports
2120-import pygtk
2121-pygtk.require('2.0')
2122-import gobject
2123-import glib
2124-import gtk
2125+from gi.repository import GObject, GLib, Gtk, Gdk
2126 import cairo
2127 from GTG.tools.logger import Log
2128
2129 #=== MAIN CLASS ===============================================================
2130
2131
2132-class CellRendererTags(gtk.GenericCellRenderer):
2133+class CellRendererTags(Gtk.CellRenderer):
2134 __gproperties__ = {
2135- 'tag_list': (gobject.TYPE_PYOBJECT,
2136- "Tag list", "A list of tags", gobject.PARAM_READWRITE),
2137- 'tag': (gobject.TYPE_PYOBJECT, "Tag",
2138- "Tag", gobject.PARAM_READWRITE),
2139+ 'tag_list': (GObject.TYPE_PYOBJECT,
2140+ "Tag list", "A list of tags", GObject.PARAM_READWRITE),
2141+ 'tag': (GObject.TYPE_PYOBJECT, "Tag",
2142+ "Tag", GObject.PARAM_READWRITE),
2143 }
2144
2145 # Private methods
2146@@ -81,7 +77,7 @@
2147
2148 # Class methods
2149 def __init__(self):
2150- self.__gobject_init__()
2151+ Gtk.CellRenderer.__init__(self)
2152 self.tag_list = None
2153 self.tag = None
2154 self.xpad = 1
2155@@ -100,8 +96,7 @@
2156 else:
2157 return getattr(self, pspec.name)
2158
2159- def on_render(self, window, widget, background_area, cell_area,
2160- expose_area, flags):
2161+ def do_render(self, cr, widget, background_area, cell_area, flags):
2162
2163 vw_tags = self.__count_viewable_tags()
2164 count = 0
2165@@ -115,8 +110,9 @@
2166 return
2167
2168 # Drawing context
2169- cr = window.cairo_create()
2170- gdkcontext = gtk.gdk.CairoContext(cr)
2171+ #cr = window.cairo_create()
2172+ #gdkcontext = Gdk.CairoContext(cr)
2173+ gdkcontext = cr
2174 gdkcontext.set_antialias(cairo.ANTIALIAS_NONE)
2175
2176 # Coordinates of the origin point
2177@@ -138,12 +134,13 @@
2178
2179 if my_tag_icon:
2180 try:
2181- pixbuf = gtk.icon_theme_get_default().load_icon(
2182+ pixbuf = Gtk.IconTheme.get_default().load_icon(
2183 my_tag_icon, 16, 0)
2184- gdkcontext.set_source_pixbuf(pixbuf, rect_x, rect_y)
2185+ Gdk.cairo_set_source_pixbuf(gdkcontext, pixbuf,
2186+ rect_x, rect_y)
2187 gdkcontext.paint()
2188 count = count + 1
2189- except glib.GError:
2190+ except GLib.GError:
2191 # In some rare cases an icon could not be found
2192 # (e.g. wrong set icon path, missing icon)
2193 # Raising an exception breaks UI and signal catcher badly
2194@@ -152,14 +149,14 @@
2195 elif my_tag_color:
2196
2197 # Draw rounded rectangle
2198- my_color = gtk.gdk.color_parse(my_tag_color)
2199- gdkcontext.set_source_color(my_color)
2200+ my_color = Gdk.color_parse(my_tag_color)
2201+ Gdk.cairo_set_source_color(gdkcontext, my_color)
2202 self.__roundedrec(gdkcontext, rect_x, rect_y, 16, 16, 8)
2203 gdkcontext.fill()
2204 count = count + 1
2205
2206 # Outer line
2207- gdkcontext.set_source_rgba(0, 0, 0, 0.20)
2208+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0.20))
2209 gdkcontext.set_line_width(1.0)
2210 self.__roundedrec(gdkcontext, rect_x, rect_y, 16, 16, 8)
2211 gdkcontext.stroke()
2212@@ -171,18 +168,18 @@
2213
2214 if not my_tag_icon and not my_tag_color:
2215 # Draw rounded rectangle
2216- gdkcontext.set_source_rgba(0.95, 0.95, 0.95, 1)
2217+ Gdk.cairo_set_source_rgba(gdkcontext,
2218+ Gdk.RGBA(0.95, 0.95, 0.95, 1))
2219 self.__roundedrec(gdkcontext, rect_x, rect_y, 16, 16, 8)
2220 gdkcontext.fill()
2221
2222 # Outer line
2223- gdkcontext.set_source_rgba(0, 0, 0, 0.20)
2224+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0.20))
2225 gdkcontext.set_line_width(1.0)
2226 self.__roundedrec(gdkcontext, rect_x, rect_y, 16, 16, 8)
2227 gdkcontext.stroke()
2228
2229- def on_get_size(self, widget, cell_area=None):
2230-
2231+ def do_get_size(self, widget, cell_area=None):
2232 count = self.__count_viewable_tags()
2233
2234 if count != 0:
2235@@ -192,4 +189,4 @@
2236 else:
2237 return (self.xpad, self.ypad, self.xpad * 2, self.ypad * 2)
2238
2239-gobject.type_register(CellRendererTags)
2240+GObject.type_register(CellRendererTags)
2241
2242=== modified file 'GTG/gtk/browser/__init__.py'
2243--- GTG/gtk/browser/__init__.py 2013-11-23 14:40:23 +0000
2244+++ GTG/gtk/browser/__init__.py 2014-01-12 07:15:48 +0000
2245@@ -29,6 +29,8 @@
2246
2247 class GnomeConfig:
2248 current_rep = os.path.dirname(os.path.abspath(__file__))
2249+ BROWSER_UI_FILE = os.path.join(current_rep, "taskbrowser.ui")
2250+ MODIFYTAGS_UI_FILE = os.path.join(current_rep, "modifytags_dialog.ui")
2251 GLADE_FILE = os.path.join(current_rep, "taskbrowser.glade")
2252 MODIFYTAGS_GLADE_FILE = os.path.join(current_rep,
2253 "modifytags_dialog.glade")
2254
2255=== modified file 'GTG/gtk/browser/browser.py'
2256--- GTG/gtk/browser/browser.py 2013-12-17 17:40:11 +0000
2257+++ GTG/gtk/browser/browser.py 2014-01-12 07:15:48 +0000
2258@@ -25,10 +25,7 @@
2259 import threading
2260 from webbrowser import open as openurl
2261
2262-import pygtk
2263-pygtk.require('2.0')
2264-import gobject
2265-import gtk
2266+from gi.repository import GObject, Gtk, Gdk
2267
2268 # our own imports
2269 from GTG import _, info, ngettext
2270@@ -55,21 +52,21 @@
2271 self.start = time.time()
2272
2273 def __exit__(self, *args):
2274- print "%s : %s" % (self.name, time.time() - self.start)
2275-
2276-
2277-class TaskBrowser(gobject.GObject):
2278+ print(("{0} : {1}".format(self.name, time.time() - self.start)))
2279+
2280+
2281+class TaskBrowser(GObject.GObject):
2282 """ The UI for browsing open and closed tasks,
2283 and listing tags in a tree """
2284
2285- __string_signal__ = (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, (str, ))
2286- __none_signal__ = (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, tuple())
2287+ __string_signal__ = (GObject.SignalFlags.RUN_FIRST, None, (str, ))
2288+ __none_signal__ = (GObject.SignalFlags.RUN_FIRST, None, tuple())
2289 __gsignals__ = {'task-added-via-quick-add': __string_signal__,
2290 'visibility-toggled': __none_signal__,
2291 }
2292
2293 def __init__(self, requester, vmanager):
2294- gobject.GObject.__init__(self)
2295+ GObject.GObject.__init__(self)
2296 # Object prime variables
2297 self.req = requester
2298 self.vmanager = vmanager
2299@@ -98,13 +95,13 @@
2300 self.tagtreeview = None
2301
2302 # Load window tree
2303- self.builder = gtk.Builder()
2304- self.builder.add_from_file(GnomeConfig.GLADE_FILE)
2305+ self.builder = Gtk.Builder()
2306+ self.builder.add_from_file(GnomeConfig.BROWSER_UI_FILE)
2307
2308 # Define aliases for specific widgets
2309 self._init_widget_aliases()
2310
2311- # Init non-glade widgets
2312+ # Init non-GtkBuilder widgets
2313 self._init_ui_widget()
2314
2315 # Set the tooltip for the toolbar buttons
2316@@ -142,8 +139,8 @@
2317 """
2318 icon_dirs = CoreConfig().get_icons_directories()
2319 for i in icon_dirs:
2320- gtk.icon_theme_get_default().prepend_search_path(i)
2321- gtk.window_set_default_icon_name("gtg")
2322+ Gtk.IconTheme.get_default().prepend_search_path(i)
2323+ Gtk.Window.set_default_icon_name("gtg")
2324
2325 def _init_widget_aliases(self):
2326 """
2327@@ -244,7 +241,6 @@
2328 """
2329 Show the about dialog
2330 """
2331- gtk.about_dialog_set_url_hook(lambda dialog, url: openurl(url))
2332 self.about.set_website(info.URL)
2333 self.about.set_website_label(info.URL)
2334 self.about.set_version(info.VERSION)
2335@@ -382,14 +378,15 @@
2336
2337 def _add_accelerator_for_widget(self, agr, name, accel):
2338 widget = self.builder.get_object(name)
2339- key, mod = gtk.accelerator_parse(accel)
2340- widget.add_accelerator("activate", agr, key, mod, gtk.ACCEL_VISIBLE)
2341+ key, mod = Gtk.accelerator_parse(accel)
2342+ widget.add_accelerator("activate", agr, key, mod,
2343+ Gtk.AccelFlags.VISIBLE)
2344
2345 def _init_accelerators(self):
2346 """
2347 initialize gtk accelerators for different interface elements
2348 """
2349- agr = gtk.AccelGroup()
2350+ agr = Gtk.AccelGroup()
2351 self.builder.get_object("MainWindow").add_accel_group(agr)
2352
2353 self._add_accelerator_for_widget(agr, "view_sidebar", "F9")
2354@@ -407,9 +404,9 @@
2355 self._add_accelerator_for_widget(agr, "help_contents", "F1")
2356
2357 quickadd_field = self.builder.get_object("quickadd_field")
2358- key, mod = gtk.accelerator_parse("<Control>l")
2359+ key, mod = Gtk.accelerator_parse("<Control>l")
2360 quickadd_field.add_accelerator("grab-focus", agr, key, mod,
2361- gtk.ACCEL_VISIBLE)
2362+ Gtk.AccelFlags.VISIBLE)
2363
2364 ### HELPER FUNCTIONS ########################################################
2365 def open_preferences(self, widget):
2366@@ -429,11 +426,9 @@
2367 and stores the state in self.config.max
2368 This is used to check the window state afterwards
2369 and maximize it if needed """
2370- mask = gtk.gdk.WINDOW_STATE_MAXIMIZED
2371- if widget.get_window().get_state() & mask == mask:
2372- self.config.set("max", True)
2373- else:
2374- self.config.set("max", False)
2375+ mask = Gdk.WindowState.MAXIMIZED
2376+ is_maximized = widget.get_window().get_state() & mask == mask
2377+ self.config.set("max", is_maximized)
2378
2379 def restore_state_from_conf(self):
2380
2381@@ -531,7 +526,7 @@
2382 return True
2383
2384 for t in self.config.get("opened_tasks"):
2385- gobject.idle_add(open_task, self.req, t)
2386+ GObject.idle_add(open_task, self.req, t)
2387
2388 def do_toggle_workview(self):
2389 """ Switch between default and work view
2390@@ -616,7 +611,7 @@
2391 def on_sort_column_changed(self, model):
2392 sort_column, sort_order = model.get_sort_column_id()
2393
2394- if sort_order == gtk.SORT_ASCENDING:
2395+ if sort_order == Gtk.SortType.ASCENDING:
2396 sort_order = 0
2397 else:
2398 sort_order = 1
2399@@ -706,10 +701,10 @@
2400 self.on_taskdone_cursor_changed)
2401 ctree.apply_filter(self.get_selected_tags()[0], refresh=True)
2402 if not self.closed_pane:
2403- self.closed_pane = gtk.ScrolledWindow()
2404+ self.closed_pane = Gtk.ScrolledWindow()
2405 self.closed_pane.set_size_request(-1, 100)
2406- self.closed_pane.set_policy(gtk.POLICY_AUTOMATIC,
2407- gtk.POLICY_AUTOMATIC)
2408+ self.closed_pane.set_policy(Gtk.PolicyType.AUTOMATIC,
2409+ Gtk.PolicyType.AUTOMATIC)
2410 self.closed_pane.add(self.vtree_panes['closed'])
2411
2412 elif self.accessory_notebook.page_num(self.closed_pane) != -1:
2413@@ -811,7 +806,7 @@
2414
2415 def on_quickadd_activate(self, widget):
2416 """ Add a new task from quickadd toolbar """
2417- text = unicode(self.quickadd_entry.get_text())
2418+ text = str(self.quickadd_entry.get_text())
2419 text = text.strip()
2420 if text:
2421 tags = self.get_selected_tags(nospecial=True)
2422@@ -840,7 +835,7 @@
2423 selection.select_path(path)
2424
2425 # It cannot be another thread than the main gtk thread !
2426- gobject.idle_add(selecter, treemodelsort, path, iter, self)
2427+ GObject.idle_add(selecter, treemodelsort, path, iter, self)
2428 # event that is set when the new task is created
2429 self.__last_quick_added_tid_event = threading.Event()
2430 self.__quick_add_select_handle = \
2431@@ -854,7 +849,7 @@
2432 self.quickadd_entry.set_text('')
2433
2434 # signal the event for the plugins to catch
2435- gobject.idle_add(self.emit, "task-added-via-quick-add",
2436+ GObject.idle_add(self.emit, "task-added-via-quick-add",
2437 task.get_id())
2438 else:
2439 # if no text is selected, we open the currently selected task
2440@@ -864,7 +859,7 @@
2441
2442 def on_quickadd_iconpress(self, widget, icon, event):
2443 """ Clear the text in quickadd field by clicking on 'clear' icon """
2444- if icon == gtk.ENTRY_ICON_SECONDARY:
2445+ if icon == Gtk.EntryIconPosition.SECONDARY:
2446 self.quickadd_entry.set_text('')
2447
2448 def on_tag_treeview_button_press_event(self, treeview, event):
2449@@ -897,38 +892,45 @@
2450 selected_tags = self.get_selected_tags(nospecial=True)
2451 selected_search = self.get_selected_search()
2452 # popup menu for searches
2453+ # FIXME thos two branches could be simplified
2454+ # (there is no difference betweenn search and normal tag
2455 if selected_search is not None:
2456 my_tag = self.req.get_tag(selected_search)
2457 self.tagpopup.set_tag(my_tag)
2458- self.tagpopup.popup(None, None, None, event.button, time)
2459+ self.tagpopup.popup(None, None, None, None, event.button,
2460+ time)
2461 elif len(selected_tags) > 0:
2462 # Then we are looking at single, normal tag rather than
2463 # the special 'All tags' or 'Tasks without tags'. We only
2464 # want to popup the menu for normal tags.
2465 my_tag = self.req.get_tag(selected_tags[0])
2466 self.tagpopup.set_tag(my_tag)
2467- self.tagpopup.popup(None, None, None, event.button, time)
2468+ self.tagpopup.popup(None, None, None, None, event.button,
2469+ time)
2470 else:
2471 self.reset_cursor()
2472 return True
2473
2474 def on_tag_treeview_key_press_event(self, treeview, event):
2475- keyname = gtk.gdk.keyval_name(event.keyval)
2476+ keyname = Gdk.keyval_name(event.keyval)
2477 is_shift_f10 = (keyname == "F10" and
2478- event.get_state() & gtk.gdk.SHIFT_MASK)
2479+ event.get_state() & Gdk.ModifierType.SHIFT_MASK)
2480 if is_shift_f10 or keyname == "Menu":
2481 selected_tags = self.get_selected_tags(nospecial=True)
2482 selected_search = self.get_selected_search()
2483+ # FIXME thos two branches could be simplified (there is
2484+ # no difference betweenn search and normal tag
2485 # popup menu for searches
2486 if selected_search is not None:
2487- self.searchpopup.popup(None, None, None, 0, event.time)
2488+ self.tagpopup.set_tag(selected_search)
2489+ self.tagpopup.popup(None, None, None, 0, event.time)
2490 elif len(selected_tags) > 0:
2491 # Then we are looking at single, normal tag rather than
2492 # the special 'All tags' or 'Tasks without tags'. We only
2493 # want to popup the menu for normal tags.
2494 selected_tag = self.req.get_tag(selected_tags[0])
2495 self.tagpopup.set_tag(selected_tag)
2496- self.tagpopup.popup(None, None, None, 0, event.time)
2497+ self.tagpopup.popup(None, None, None, None, 0, event.time)
2498 else:
2499 self.reset_cursor()
2500 return True
2501@@ -952,13 +954,14 @@
2502 else:
2503 treeview.set_cursor(path, col, 0)
2504 treeview.grab_focus()
2505- self.taskpopup.popup(None, None, None, event.button, time)
2506+ self.taskpopup.popup(None, None, None, None, event.button,
2507+ time)
2508 return True
2509
2510 def on_task_treeview_key_press_event(self, treeview, event):
2511- keyname = gtk.gdk.keyval_name(event.keyval)
2512+ keyname = Gdk.keyval_name(event.keyval)
2513 is_shift_f10 = (keyname == "F10" and
2514- event.get_state() & gtk.gdk.SHIFT_MASK)
2515+ event.get_state() & Gdk.ModifierType.SHIFT_MASK)
2516
2517 if keyname == "Delete":
2518 self.on_delete_tasks()
2519@@ -981,9 +984,9 @@
2520 return True
2521
2522 def on_closed_task_treeview_key_press_event(self, treeview, event):
2523- keyname = gtk.gdk.keyval_name(event.keyval)
2524+ keyname = Gdk.keyval_name(event.keyval)
2525 is_shift_f10 = (keyname == "F10" and
2526- event.get_state() & gtk.gdk.SHIFT_MASK)
2527+ event.get_state() & Gdk.ModifierType.SHIFT_MASK)
2528
2529 if keyname == "Delete":
2530 self.on_delete_tasks()
2531@@ -1214,7 +1217,7 @@
2532 button.set_tooltip_text(settings["tooltip"])
2533
2534 def update_menu_item(menu_item, settings):
2535- image = gtk.image_new_from_icon_name(settings["icon-name"], 16)
2536+ image = Gtk.Image.new_from_icon_name(settings["icon-name"], 16)
2537 image.set_pixel_size(16)
2538 image.show()
2539 menu_item.set_image(image)
2540@@ -1367,8 +1370,8 @@
2541 """Adds a new page tab to the left panel. The tab will
2542 be added as the last tab. Also causes the tabs to be
2543 shown if they're not.
2544- @param icon: a gtk.Image picture to display on the tab
2545- @param page: gtk.Frame-based panel to be added
2546+ @param icon: a Gtk.Image picture to display on the tab
2547+ @param page: Gtk.Frame-based panel to be added
2548 """
2549 return self._add_page(self.sidebar_notebook, icon, page)
2550
2551@@ -1377,23 +1380,24 @@
2552 will be added as the last tab. Also causes the tabs to be
2553 shown.
2554 @param title: Short text to use for the tab label
2555- @param page: gtk.Frame-based panel to be added
2556+ @param page: Gtk.Frame-based panel to be added
2557 """
2558- return self._add_page(self.main_notebook, gtk.Label(title), page)
2559+ return self._add_page(self.main_notebook, Gtk.Label(label=title), page)
2560
2561 def add_page_to_accessory_notebook(self, title, page):
2562 """Adds a new page tab to the lower right accessory panel. The
2563 tab will be added as the last tab. Also causes the tabs to be
2564 shown.
2565 @param title: Short text to use for the tab label
2566- @param page: gtk.Frame-based panel to be added
2567+ @param page: Gtk.Frame-based panel to be added
2568 """
2569- return self._add_page(self.accessory_notebook, gtk.Label(title), page)
2570+ return self._add_page(self.accessory_notebook, Gtk.Label(label=title),
2571+ page)
2572
2573 def remove_page_from_sidebar_notebook(self, page):
2574 """Removes a new page tab from the left panel. If this leaves
2575 only one tab in the notebook, the tab selector will be hidden.
2576- @param page: gtk.Frame-based panel to be removed
2577+ @param page: Gtk.Frame-based panel to be removed
2578 """
2579 return self._remove_page(self.sidebar_notebook, page)
2580
2581@@ -1401,7 +1405,7 @@
2582 """Removes a new page tab from the top right main panel. If
2583 this leaves only one tab in the notebook, the tab selector will
2584 be hidden.
2585- @param page: gtk.Frame-based panel to be removed
2586+ @param page: Gtk.Frame-based panel to be removed
2587 """
2588 return self._remove_page(self.main_notebook, page)
2589
2590@@ -1409,7 +1413,7 @@
2591 """Removes a new page tab from the lower right accessory panel.
2592 If this leaves only one tab in the notebook, the tab selector
2593 will be hidden.
2594- @param page: gtk.Frame-based panel to be removed
2595+ @param page: Gtk.Frame-based panel to be removed
2596 """
2597 return self._remove_page(self.accessory_notebook, page)
2598
2599@@ -1417,7 +1421,7 @@
2600 """ Hides the task browser """
2601 self.browser_shown = False
2602 self.window.hide()
2603- gobject.idle_add(self.emit, "visibility-toggled")
2604+ GObject.idle_add(self.emit, "visibility-toggled")
2605
2606 def show(self):
2607 """ Unhides the TaskBrowser """
2608@@ -1427,7 +1431,7 @@
2609 self.window.present()
2610 self.window.grab_focus()
2611 self.quickadd_entry.grab_focus()
2612- gobject.idle_add(self.emit, "visibility-toggled")
2613+ GObject.idle_add(self.emit, "visibility-toggled")
2614
2615 def iconify(self):
2616 """ Minimizes the TaskBrowser """
2617@@ -1469,7 +1473,7 @@
2618 def on_backend_failed(self, sender, backend_id, error_code):
2619 """
2620 Signal callback.
2621- When a backend fails to work, loads a gtk.Infobar to alert the user
2622+ When a backend fails to work, loads a Gtk.Infobar to alert the user
2623
2624 @param sender: not used, only here for signal compatibility
2625 @param backend_id: the id of the failing backend
2626@@ -1484,7 +1488,7 @@
2627 '''
2628 Signal callback.
2629 When a backend needs some kind of feedback from the user,
2630- loads a gtk.Infobar to alert the user.
2631+ loads a Gtk.Infobar to alert the user.
2632 This is used, for example, to request confirmation after authenticating
2633 via OAuth.
2634
2635@@ -1502,10 +1506,10 @@
2636
2637 def __remove_backend_infobar(self, child, backend_id):
2638 '''
2639- Helper function to remove an gtk.Infobar related to a backend
2640+ Helper function to remove an Gtk.Infobar related to a backend
2641
2642- @param child: a gtk.Infobar
2643- @param backend_id: the id of the backend which gtk.Infobar should be
2644+ @param child: a Gtk.Infobar
2645+ @param backend_id: the id of the backend which Gtk.Infobar should be
2646 removed.
2647 '''
2648 if isinstance(child, CustomInfoBar) and\
2649@@ -1516,10 +1520,10 @@
2650 def remove_backend_infobar(self, sender, backend_id):
2651 '''
2652 Signal callback.
2653- Deletes the gtk.Infobars related to a backend
2654+ Deletes the Gtk.Infobars related to a backend
2655
2656 @param sender: not used, only here for signal compatibility
2657- @param backend_id: the id of the backend which gtk.Infobar should be
2658+ @param backend_id: the id of the backend which Gtk.Infobar should be
2659 removed.
2660 '''
2661 backend = self.req.get_backend(backend_id)
2662@@ -1534,7 +1538,7 @@
2663 Helper function to create a new infobar for a backend
2664
2665 @param backend_id: the backend for which we're creating the infobar
2666- @returns gtk.Infobar: the created infobar
2667+ @returns Gtk.Infobar: the created infobar
2668 '''
2669 # remove old infobar related to backend_id, if any
2670 if not self.vbox_toolbars:
2671@@ -1542,7 +1546,7 @@
2672 self.vbox_toolbars.foreach(self.__remove_backend_infobar, backend_id)
2673 # add a new one
2674 infobar = CustomInfoBar(self.req, self, self.vmanager, backend_id)
2675- self.vbox_toolbars.pack_start(infobar, True)
2676+ self.vbox_toolbars.pack_start(infobar, True, True, 0)
2677 return infobar
2678
2679 #### SEARCH RELATED STUFF #####################################################
2680@@ -1570,7 +1574,7 @@
2681
2682 self.search_actions = []
2683
2684- self.search_complete_store = gtk.ListStore(str)
2685+ self.search_complete_store = Gtk.ListStore(str)
2686 for tagname in self.req.get_all_tags():
2687 # only for regular tags
2688 if tagname.startswith("@"):
2689
2690=== modified file 'GTG/gtk/browser/custominfobar.py'
2691--- GTG/gtk/browser/custominfobar.py 2013-11-23 14:40:23 +0000
2692+++ GTG/gtk/browser/custominfobar.py 2014-01-12 07:15:48 +0000
2693@@ -17,7 +17,7 @@
2694 # this program. If not, see <http://www.gnu.org/licenses/>.
2695 # -----------------------------------------------------------------------------
2696
2697-import gtk
2698+from gi.repository import Gtk
2699 import threading
2700
2701 from GTG import _
2702@@ -25,9 +25,9 @@
2703 from GTG.tools.networkmanager import is_connection_up
2704
2705
2706-class CustomInfoBar(gtk.InfoBar):
2707+class CustomInfoBar(Gtk.InfoBar):
2708 '''
2709- A gtk.InfoBar specialized for displaying errors and requests for
2710+ A Gtk.InfoBar specialized for displaying errors and requests for
2711 interaction coming from the backends
2712 '''
2713
2714@@ -61,19 +61,19 @@
2715 def get_backend_id(self):
2716 '''
2717 Getter function to return the id of the backend for which this
2718- gtk.InfoBar was created
2719+ Gtk.InfoBar was created
2720 '''
2721 return self.backend_id
2722
2723 def _populate(self):
2724 '''Setting up gtk widgets'''
2725- content_hbox = self.get_content_area()
2726- content_hbox.set_homogeneous(False)
2727- self.label = gtk.Label()
2728+ content_box = self.get_content_area()
2729+ content_box.set_homogeneous(False)
2730+ self.label = Gtk.Label()
2731 self.label.set_line_wrap(True)
2732 self.label.set_alignment(0.5, 0.5)
2733- self.label.set_justify(gtk.JUSTIFY_FILL)
2734- content_hbox.pack_start(self.label, True, True)
2735+ self.label.set_justify(Gtk.Justification.FILL)
2736+ content_box.pack_start(self.label, True, True, 0)
2737
2738 def _on_error_response(self, widget, event):
2739 '''
2740@@ -84,7 +84,7 @@
2741 @param event: the code of the gtk response
2742 '''
2743 self.hide()
2744- if event == gtk.RESPONSE_ACCEPT:
2745+ if event == Gtk.ResponseType.ACCEPT:
2746 self.vmanager.configure_backend(backend_id=self.backend_id)
2747
2748 def set_error_code(self, error_code):
2749@@ -99,24 +99,24 @@
2750 backend_name = self.backend.get_human_name()
2751
2752 if error_code == BackendSignals.ERRNO_AUTHENTICATION:
2753- self.set_message_type(gtk.MESSAGE_ERROR)
2754+ self.set_message_type(Gtk.MessageType.ERROR)
2755 self.label.set_markup(self.AUTHENTICATION_MESSAGE % backend_name)
2756 self.add_button(_('Configure synchronization service'),
2757- gtk.RESPONSE_ACCEPT)
2758- self.add_button(_('Ignore'), gtk.RESPONSE_CLOSE)
2759+ Gtk.ResponseType.ACCEPT)
2760+ self.add_button(_('Ignore'), Gtk.ResponseType.CLOSE)
2761
2762 elif error_code == BackendSignals.ERRNO_NETWORK:
2763 if not is_connection_up():
2764 return
2765- self.set_message_type(gtk.MESSAGE_WARNING)
2766+ self.set_message_type(Gtk.MessageType.WARNING)
2767 self.label.set_markup(self.NETWORK_MESSAGE % backend_name)
2768 # FIXME: use gtk stock button instead
2769- self.add_button(_('Ok'), gtk.RESPONSE_CLOSE)
2770+ self.add_button(_('Ok'), Gtk.ResponseType.CLOSE)
2771
2772 elif error_code == BackendSignals.ERRNO_DBUS:
2773- self.set_message_type(gtk.MESSAGE_WARNING)
2774+ self.set_message_type(Gtk.MessageType.WARNING)
2775 self.label.set_markup(self.DBUS_MESSAGE % backend_name)
2776- self.add_button(_('Ok'), gtk.RESPONSE_CLOSE)
2777+ self.add_button(_('Ok'), Gtk.ResponseType.CLOSE)
2778
2779 self.show_all()
2780
2781@@ -132,14 +132,14 @@
2782 '''
2783 self._populate()
2784 self.callback = callback
2785- self.set_message_type(gtk.MESSAGE_INFO)
2786+ self.set_message_type(Gtk.MessageType.INFO)
2787 self.label.set_markup(description)
2788 self.connect("response", self._on_interaction_response)
2789 self.interaction_type = interaction_type
2790 if interaction_type == BackendSignals().INTERACTION_CONFIRM:
2791- self.add_button(_('Confirm'), gtk.RESPONSE_ACCEPT)
2792+ self.add_button(_('Confirm'), Gtk.ResponseType.ACCEPT)
2793 elif interaction_type == BackendSignals().INTERACTION_TEXT:
2794- self.add_button(_('Continue'), gtk.RESPONSE_ACCEPT)
2795+ self.add_button(_('Continue'), Gtk.ResponseType.ACCEPT)
2796 self.show_all()
2797
2798 def _on_interaction_response(self, widget, event):
2799@@ -150,10 +150,10 @@
2800 @param widget: not used, here for compatibility with signals callbacks
2801 @param event: the code of the gtk response
2802 '''
2803- if event == gtk.RESPONSE_ACCEPT:
2804+ if event == Gtk.ResponseType.ACCEPT:
2805 if self.interaction_type == BackendSignals().INTERACTION_TEXT:
2806 self._prepare_textual_interaction()
2807- print "done"
2808+ print("done")
2809 elif self.interaction_type == BackendSignals().INTERACTION_CONFIRM:
2810 self.hide()
2811 threading.Thread(target=getattr(self.backend,
2812@@ -167,33 +167,33 @@
2813 title, description\
2814 = getattr(self.backend,
2815 self.callback)("get_ui_dialog_text")
2816- self.dialog = gtk.Window() # type = gtk.WINDOW_POPUP)
2817+ self.dialog = Gtk.Window() # type = Gtk.WindowType.POPUP
2818 self.dialog.set_title(title)
2819 self.dialog.set_transient_for(self.browser.window)
2820 self.dialog.set_destroy_with_parent(True)
2821- self.dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
2822+ self.dialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
2823 self.dialog.set_modal(True)
2824 # self.dialog.set_size_request(300,170)
2825- vbox = gtk.VBox()
2826+ vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
2827 self.dialog.add(vbox)
2828- description_label = gtk.Label()
2829- description_label.set_justify(gtk.JUSTIFY_FILL)
2830+ description_label = Gtk.Label()
2831+ description_label.set_justify(Gtk.Justification.FILL)
2832 description_label.set_line_wrap(True)
2833 description_label.set_markup(description)
2834- align = gtk.Alignment(0.5, 0.5, 1, 1)
2835+ align = Gtk.Alignment.new(0.5, 0.5, 1, 1)
2836 align.set_padding(10, 0, 20, 20)
2837 align.add(description_label)
2838- vbox.pack_start(align)
2839- self.text_box = gtk.Entry()
2840+ vbox.pack_start(align, True, True, 0)
2841+ self.text_box = Gtk.Entry()
2842 self.text_box.set_size_request(-1, 40)
2843- align = gtk.Alignment(0.5, 0.5, 1, 1)
2844+ align = Gtk.Alignment.new(0.5, 0.5, 1, 1)
2845 align.set_padding(20, 20, 20, 20)
2846 align.add(self.text_box)
2847- vbox.pack_start(align)
2848- button = gtk.Button(stock=gtk.STOCK_OK)
2849+ vbox.pack_start(align, True, True, 0)
2850+ button = Gtk.Button(stock=Gtk.STOCK_OK)
2851 button.connect("clicked", self._on_text_confirmed)
2852 button.set_size_request(-1, 40)
2853- vbox.pack_start(button, False)
2854+ vbox.pack_start(button, False, True, 0)
2855 self.dialog.show_all()
2856 self.hide()
2857
2858
2859=== modified file 'GTG/gtk/browser/modifytags_dialog.py'
2860--- GTG/gtk/browser/modifytags_dialog.py 2013-11-23 14:40:23 +0000
2861+++ GTG/gtk/browser/modifytags_dialog.py 2014-01-12 07:15:48 +0000
2862@@ -17,15 +17,18 @@
2863 # this program. If not, see <http://www.gnu.org/licenses/>.
2864 # -----------------------------------------------------------------------------
2865 """ A dialog for batch adding/removal of tags """
2866-import gtk
2867+
2868+from gi.repository import Gtk
2869
2870 from GTG import _
2871 from GTG.gtk.browser import GnomeConfig
2872 from GTG.tools.tags import parse_tag_list
2873
2874
2875-class ModifyTagsDialog:
2876- """ Dialog for batch adding/removal of tags """
2877+class ModifyTagsDialog(object):
2878+ """
2879+ Dialog for batch adding/removal of tags
2880+ """
2881
2882 def __init__(self, tag_completion, req):
2883 self.req = req
2884@@ -39,9 +42,9 @@
2885 self.last_apply_to_subtasks = False
2886
2887 def _init_dialog(self):
2888- """ Init .glade file """
2889- builder = gtk.Builder()
2890- builder.add_from_file(GnomeConfig.MODIFYTAGS_GLADE_FILE)
2891+ """ Init GtkBuilder .ui file """
2892+ builder = Gtk.Builder()
2893+ builder.add_from_file(GnomeConfig.MODIFYTAGS_UI_FILE)
2894 builder.connect_signals({
2895 "on_modifytags_confirm":
2896 self.on_confirm,
2897@@ -97,3 +100,5 @@
2898 # Rember the last actions
2899 self.last_tag_entry = self.tag_entry.get_text()
2900 self.last_apply_to_subtasks = self.apply_to_subtasks.get_active()
2901+
2902+# -----------------------------------------------------------------------------
2903
2904=== renamed file 'GTG/gtk/browser/modifytags_dialog.glade' => 'GTG/gtk/browser/modifytags_dialog.ui'
2905--- GTG/gtk/browser/modifytags_dialog.glade 2012-05-23 08:55:31 +0000
2906+++ GTG/gtk/browser/modifytags_dialog.ui 2014-01-12 07:15:48 +0000
2907@@ -1,6 +1,6 @@
2908 <?xml version="1.0" encoding="UTF-8"?>
2909 <interface>
2910- <requires lib="gtk+" version="2.16"/>
2911+ <!-- interface-requires gtk+ 3.0 -->
2912 <object class="GtkDialog" id="modifytags_dialog">
2913 <property name="can_focus">False</property>
2914 <property name="border_width">5</property>
2915@@ -11,6 +11,7 @@
2916 <object class="GtkBox" id="modifytags_dialog_vbox">
2917 <property name="visible">True</property>
2918 <property name="can_focus">False</property>
2919+ <property name="orientation">vertical</property>
2920 <property name="spacing">2</property>
2921 <child internal-child="action_area">
2922 <object class="GtkButtonBox" id="dialog-action_area3">
2923
2924=== modified file 'GTG/gtk/browser/simple_color_selector.py'
2925--- GTG/gtk/browser/simple_color_selector.py 2013-11-23 14:40:23 +0000
2926+++ GTG/gtk/browser/simple_color_selector.py 2014-01-12 07:15:48 +0000
2927@@ -22,10 +22,8 @@
2928 from a palette. The widget also allows to define and add new colors.
2929 """
2930
2931-import pygtk
2932-pygtk.require('2.0')
2933-import gobject
2934-import gtk
2935+from gi.repository import GObject, Gtk, Gdk
2936+
2937 import math
2938
2939 from GTG import _
2940@@ -43,38 +41,42 @@
2941 BUTTON_HEIGHT = 24
2942
2943
2944-class SimpleColorSelectorPaletteItem(gtk.DrawingArea):
2945+class SimpleColorSelectorPaletteItem(Gtk.DrawingArea):
2946 """An item of the color selecctor palette"""
2947
2948 def __init__(self, color=None):
2949- gtk.DrawingArea.__init__(self)
2950- self.__gobject_init__()
2951+ Gtk.DrawingArea.__init__(self)
2952 self.color = color
2953 self.selected = False
2954- self.add_events(gtk.gdk.BUTTON_PRESS_MASK)
2955+ self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
2956 # Connect callbacks
2957- self.connect("expose_event", self.on_expose)
2958+ #FIXME
2959+ #self.connect("expose-event", self.on_expose)
2960+ self.connect("draw", self.on_expose)
2961 self.connect("configure_event", self.on_configure)
2962
2963- def __draw(self):
2964+ def __draw(self, cr):
2965 """Draws the widget"""
2966 alloc = self.get_allocation()
2967- alloc_w, alloc_h = alloc[2], alloc[3]
2968+ #FIXME - why to use a special variables?
2969+ alloc_w, alloc_h = alloc.width, alloc.height
2970 # Drawing context
2971- cr_ctxt = self.window.cairo_create()
2972- gdkcontext = gtk.gdk.CairoContext(cr_ctxt)
2973+ #cr_ctxt = self.window.cairo_create() # pylint: disable-msg=E1101
2974+ #gdkcontext = Gdk.CairoContext(cr_ctxt)
2975+ #FIXME
2976+ gdkcontext = cr
2977
2978 # Draw rectangle
2979 if self.color is not None:
2980- my_color = gtk.gdk.color_parse(self.color)
2981- gdkcontext.set_source_color(my_color)
2982+ my_color = Gdk.color_parse(self.color)
2983+ Gdk.cairo_set_source_color(gdkcontext, my_color)
2984 else:
2985- gdkcontext.set_source_rgba(0, 0, 0, 0)
2986+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0))
2987 gdkcontext.rectangle(0, 0, alloc_w, alloc_h)
2988 gdkcontext.fill()
2989
2990 # Outer line
2991- gdkcontext.set_source_rgba(0, 0, 0, 0.30)
2992+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0.30))
2993 gdkcontext.set_line_width(2.0)
2994 gdkcontext.rectangle(0, 0, alloc_w, alloc_h)
2995 gdkcontext.stroke()
2996@@ -84,16 +86,17 @@
2997 size = alloc_h * 0.50 - 3
2998 pos_x = math.floor((alloc_w - size) / 2)
2999 pos_y = math.floor((alloc_h - size) / 2)
3000- gdkcontext.set_source_rgba(255, 255, 255, 0.80)
3001+ Gdk.cairo_set_source_rgba(gdkcontext,
3002+ Gdk.RGBA(255, 255, 255, 0.80))
3003 gdkcontext.arc(
3004 alloc_w / 2, alloc_h / 2, size / 2 + 3, 0, 2 * math.pi)
3005 gdkcontext.fill()
3006 gdkcontext.set_line_width(1.0)
3007- gdkcontext.set_source_rgba(0, 0, 0, 0.20)
3008+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0.20))
3009 gdkcontext.arc(
3010 alloc_w / 2, alloc_h / 2, size / 2 + 3, 0, 2 * math.pi)
3011 gdkcontext.stroke()
3012- gdkcontext.set_source_rgba(0, 0, 0, 0.50)
3013+ Gdk.cairo_set_source_rgba(gdkcontext, Gdk.RGBA(0, 0, 0, 0.50))
3014 gdkcontext.set_line_width(3.0)
3015 gdkcontext.move_to(pos_x, pos_y + size / 2)
3016 gdkcontext.line_to(pos_x + size / 2, pos_y + size)
3017@@ -101,13 +104,14 @@
3018 gdkcontext.stroke()
3019
3020 ### callbacks ###
3021- def on_expose(self, widget, params):
3022+ def on_expose(self, widget, cr):
3023 """Callback: redraws the widget when it is exposed"""
3024- self.__draw()
3025+ self.__draw(cr)
3026
3027 def on_configure(self, widget, params):
3028 """Callback: redraws the widget when it is exposed"""
3029- self.__draw()
3030+ #FIXME - missing cairo context
3031+ #self.__draw(cr)
3032
3033 ### PUBLIC IF ###
3034 def set_color(self, color):
3035@@ -124,13 +128,12 @@
3036 return self.selected
3037
3038
3039-class SimpleColorSelector(gtk.VBox):
3040+class SimpleColorSelector(Gtk.Box):
3041 """Widget displaying a palette of colors, possibly with a button allowing
3042 to define new colors."""
3043
3044 def __init__(self, width=9, colors=None, custom_colors=None):
3045- gtk.VBox.__init__(self)
3046- self.__gobject_init__()
3047+ Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
3048 self.width = width
3049 # widget model
3050 if colors is None:
3051@@ -168,16 +171,16 @@
3052 """Draws the palette of colors"""
3053 self.__reset_palette()
3054 # (re-)create the palette widget
3055- self.palette = gtk.Alignment()
3056- self.pack_start(self.palette)
3057+ self.palette = Gtk.Alignment()
3058+ self.pack_start(self.palette, True, True, 0)
3059 # Draw the palette
3060- vbox = gtk.VBox()
3061+ vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
3062 self.palette.add(vbox)
3063 vbox.set_spacing(4)
3064- for i in xrange(len(self.colors)):
3065+ for i in range(len(self.colors)):
3066 if i % self.width == 0:
3067- cur_hbox = gtk.HBox()
3068- vbox.pack_start(cur_hbox)
3069+ cur_box = Gtk.Box()
3070+ vbox.pack_start(cur_box, True, True, 0)
3071 # add the color box
3072 img = SimpleColorSelectorPaletteItem()
3073 img.set_size_request(
3074@@ -186,8 +189,8 @@
3075 img.set_color(self.colors[i])
3076 self.buttons_lookup[self.colors[i]] = img
3077 self.buttons.append(img)
3078- cur_hbox.pack_start(img, expand=False, fill=False)
3079- cur_hbox.set_spacing(4)
3080+ cur_box.pack_start(img, False, False, 0)
3081+ cur_box.set_spacing(4)
3082 # make palette visible
3083 self.palette.show_all()
3084
3085@@ -207,16 +210,16 @@
3086 """Draws the palette of custom colors"""
3087 self.__reset_custom_palette()
3088 # (re-)create the palette widget
3089- self.custom_palette = gtk.Alignment(xscale=1.0)
3090+ self.custom_palette = Gtk.Alignment.new(0, 0, 1, 0)
3091 self.custom_palette.set_padding(10, 0, 0, 0)
3092- self.pack_start(self.custom_palette)
3093+ self.pack_start(self.custom_palette, True, True, 0)
3094 # Draw the previous color palette: only one line
3095- cc_vbox = gtk.VBox()
3096+ cc_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
3097 self.custom_palette.add(cc_vbox)
3098 cc_vbox.set_spacing(4)
3099- cc_hbox = gtk.HBox()
3100- cc_vbox.pack_start(cc_hbox)
3101- for i in xrange(len(self.custom_colors)):
3102+ cc_box = Gtk.Box()
3103+ cc_vbox.pack_start(cc_box, True, True, 0)
3104+ for i in range(len(self.custom_colors)):
3105 # add the color box
3106 img = SimpleColorSelectorPaletteItem()
3107 img.set_size_request(
3108@@ -225,15 +228,15 @@
3109 if i < len(self.custom_colors):
3110 img.set_color(self.custom_colors[i])
3111 self.buttons_lookup[self.custom_colors[i]] = img
3112- cc_hbox.pack_start(img, expand=False, fill=False)
3113- cc_hbox.set_spacing(4)
3114+ cc_box.pack_start(img, False, False, 0)
3115+ cc_box.set_spacing(4)
3116 self.cc_buttons.append(img)
3117 # Draw the add button
3118- buttons_hbox = gtk.HBox()
3119+ buttons_hbox = Gtk.Box()
3120 cc_vbox.pack_start(buttons_hbox)
3121- img = gtk.Image()
3122- img.set_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)
3123- self.add_button = gtk.Button()
3124+ img = Gtk.Image()
3125+ img.set_from_stock(Gtk.STOCK_ADD, Gtk.ICON_SIZE_BUTTON)
3126+ self.add_button = Gtk.Button()
3127 self.add_button.set_image(img)
3128 self.add_button.set_label(_("Add custom color"))
3129 buttons_hbox.pack_start(self.add_button, expand=True, fill=False)
3130@@ -284,16 +287,19 @@
3131 def on_color_add(self, widget):
3132 """Callback: when adding a new color, show the color definition
3133 window, update the model, notifies the parent."""
3134- color_dialog = gtk.ColorSelectionDialog(_('Choose a color'))
3135- colorsel = color_dialog.colorsel
3136+ color_dialog = Gtk.ColorSelectionDialog(_('Choose a color'))
3137+#FIXME
3138+ colorsel = color_dialog.get_color_selection()
3139 if self.selected_col is not None:
3140- color = gtk.gdk.color_parse(self.selected_col.color)
3141+ color = Gdk.color_parse(self.selected_col.color)
3142 colorsel.set_current_color(color)
3143 response = color_dialog.run()
3144 new_color = colorsel.get_current_color()
3145 # Check response_id and set color if required
3146- if response == gtk.RESPONSE_OK and new_color:
3147- strcolor = gtk.color_selection_palette_to_string([new_color])
3148+ if response == Gtk.ResponseType.OK and new_color:
3149+#FIXME
3150+ #strcolor = Gtk.color_selection_palette_to_string([new_color])
3151+ strcolor = new_color.to_string()
3152 # Add the color to the palette and notify
3153 if strcolor not in self.colors:
3154 self.add_custom_color(strcolor)
3155@@ -356,8 +362,8 @@
3156 self.selected_col = None
3157 self.clear_button.set_sensitive(False)
3158
3159-gobject.type_register(SimpleColorSelector)
3160-gobject.signal_new("color-changed", SimpleColorSelector,
3161- gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ())
3162-gobject.signal_new("color-added", SimpleColorSelector,
3163- gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ())
3164+Gobject.type_register(SimpleColorSelector)
3165+Gobject.signal_new("color-changed", SimpleColorSelector,
3166+ Gobject.SIGNAL_RUN_FIRST, Gobject.TYPE_NONE, ())
3167+Gobject.signal_new("color-added", SimpleColorSelector,
3168+ Gobject.SIGNAL_RUN_FIRST, Gobject.TYPE_NONE, ())
3169
3170=== modified file 'GTG/gtk/browser/tag_context_menu.py'
3171--- GTG/gtk/browser/tag_context_menu.py 2013-11-23 14:40:23 +0000
3172+++ GTG/gtk/browser/tag_context_menu.py 2014-01-12 07:15:48 +0000
3173@@ -26,19 +26,16 @@
3174 like a color picker)
3175 """
3176
3177-import pygtk
3178-pygtk.require('2.0')
3179-import gtk
3180+from gi.repository import Gtk
3181
3182 from GTG import _
3183
3184
3185-class TagContextMenu(gtk.Menu):
3186+class TagContextMenu(Gtk.Menu):
3187 """Context menu fo the tag i the sidebar"""
3188
3189 def __init__(self, req, vmanager, tag=None):
3190- self.__gobject_init__()
3191- gtk.Menu.__init__(self)
3192+ Gtk.Menu.__init__(self)
3193 self.req = req
3194 self.vmanager = vmanager
3195 self.tag = tag
3196@@ -54,12 +51,12 @@
3197 i.destroy()
3198 if self.tag is not None:
3199 # Color chooser FIXME: SHOULD BECOME A COLOR PICKER
3200- self.mi_cc = gtk.MenuItem()
3201+ self.mi_cc = Gtk.MenuItem()
3202 self.mi_cc.set_label(_("Edit Tag..."))
3203 self.append(self.mi_cc)
3204 self.mi_cc.connect('activate', self.on_mi_cc_activate)
3205 if self.tag.is_search_tag():
3206- self.mi_del = gtk.MenuItem()
3207+ self.mi_del = Gtk.MenuItem()
3208 self.mi_del.set_label(_("Delete"))
3209 self.append(self.mi_del)
3210 self.mi_del.connect('activate', self.on_mi_del_activate)
3211
3212=== modified file 'GTG/gtk/browser/tag_editor.py'
3213--- GTG/gtk/browser/tag_editor.py 2013-11-23 14:40:23 +0000
3214+++ GTG/gtk/browser/tag_editor.py 2014-01-12 07:15:48 +0000
3215@@ -27,48 +27,48 @@
3216 for a tag.
3217 """
3218
3219-import pygtk
3220-pygtk.require('2.0')
3221-import gobject
3222-import gtk
3223-import gtk.gdk as gdk
3224+from gi.repository import GObject, Gtk, Gdk, GdkPixbuf
3225
3226 from GTG import _
3227 from GTG.tools.logger import Log
3228-from GTG.gtk.browser.simple_color_selector import SimpleColorSelector
3229-
3230-
3231-class TagIconSelector(gtk.Window):
3232+
3233+
3234+class TagIconSelector(Gtk.Window):
3235 """
3236 TagIconSelector is intended as a floating window that allows to select
3237 an icon for a tag. It display a list of icon in a popup window.
3238 """
3239
3240 def __init__(self):
3241- self.__gobject_init__(type=gtk.WINDOW_POPUP)
3242- gtk.Window.__init__(self)
3243+ # FIXME
3244+ #self.__gobject_init__(type=Gtk.WindowType.POPUP)
3245+ #GObject.GObject.__init__(self)
3246+ Gtk.Window.__init__(self)
3247+
3248 self.loaded = False
3249 self.selected_icon = None
3250 self.symbol_model = None
3251 # Build up the window
3252 self.__build_window()
3253 # Make it visible
3254- self.hide_all()
3255+ #self.hide_all()
3256+ # FIXME
3257+ self.hide()
3258
3259 def __build_window(self):
3260 """Build up the widget"""
3261- self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_POPUP_MENU)
3262- vbox = gtk.VBox()
3263+ self.set_type_hint(Gdk.WindowTypeHint.POPUP_MENU)
3264+ vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
3265 self.add(vbox)
3266 # icon list
3267- scld_win = gtk.ScrolledWindow()
3268- scld_win.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
3269- scld_win.set_shadow_type(gtk.SHADOW_ETCHED_IN)
3270- vbox.pack_start(scld_win, expand=True, fill=True)
3271- self.symbol_iv = gtk.IconView()
3272+ scld_win = Gtk.ScrolledWindow()
3273+ scld_win.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.ALWAYS)
3274+ scld_win.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
3275+ vbox.pack_start(scld_win, True, True, 0)
3276+ self.symbol_iv = Gtk.IconView()
3277 self.symbol_iv.set_pixbuf_column(0)
3278- self.symbol_iv.set_property("columns", 7)
3279- self.symbol_iv.set_property("item-width", 32)
3280+ self.symbol_iv.set_columns(7)
3281+ self.symbol_iv.set_item_width(32)
3282 # IconView size:
3283 # --------------
3284 # it seems that with the above parameters, a row width is about:
3285@@ -80,19 +80,19 @@
3286 self.symbol_iv.set_size_request(40 * 7 + 12, 38 * 4)
3287 scld_win.add(self.symbol_iv)
3288 # icon remove button
3289- img = gtk.Image()
3290- img.set_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_BUTTON)
3291- self.remove_bt = gtk.Button()
3292+ img = Gtk.Image()
3293+ img.set_from_stock(Gtk.STOCK_REMOVE, Gtk.IconSize.BUTTON)
3294+ self.remove_bt = Gtk.Button()
3295 self.remove_bt.set_image(img)
3296 self.remove_bt.set_label(_("Remove selected icon"))
3297- vbox.pack_start(self.remove_bt, fill=False, expand=False)
3298+ vbox.pack_start(self.remove_bt, False, False, 0)
3299 # set the callbacks
3300 self.symbol_iv.connect("selection-changed", self.on_selection_changed)
3301 self.remove_bt.connect("clicked", self.on_remove_bt_clicked)
3302
3303 def __focus_out(self, widget, event):
3304 """Hides the window if the user clicks out of it"""
3305- win_ptr = self.window.get_pointer()
3306+ win_ptr = self.get_window().get_pointer()
3307 win_size = self.get_size()
3308 if not(0 <= win_ptr[0] <= win_size[0] and
3309 0 <= win_ptr[1] <= win_size[1]):
3310@@ -106,12 +106,12 @@
3311 libraries, e.g. bug #1079587. Gracefuly degradate and skip
3312 the loading of a corrupted icon.
3313 """
3314- self.symbol_model = gtk.ListStore(gtk.gdk.Pixbuf, str)
3315- for icon in gtk.icon_theme_get_default().list_icons(context="Emblems"):
3316+ self.symbol_model = Gtk.ListStore(GdkPixbuf.Pixbuf, str)
3317+ for icon in Gtk.IconTheme.get_default().list_icons(context="Emblems"):
3318 try:
3319- img = gtk.icon_theme_get_default().load_icon(icon, 16, 0)
3320+ img = Gtk.IconTheme.get_default().load_icon(icon, 16, 0)
3321 self.symbol_model.append([img, icon])
3322- except gobject.GError:
3323+ except GObject.GError:
3324 Log.error("Failed to load icon '%s'" % icon)
3325 self.symbol_iv.set_model(self.symbol_model)
3326 self.loaded = True
3327@@ -152,14 +152,22 @@
3328 self.move(pos_x, pos_y)
3329 self.grab_add()
3330 # We grab the pointer in the calendar
3331- gdk.pointer_grab(self.window, True,
3332- gdk.BUTTON1_MASK | gdk.MOD2_MASK)
3333+# FIXME THIS DOES NOT WORK!!!!!!!
3334+ Gdk.pointer_grab(self.get_window(), True,
3335+ # Gdk.ModifierType.BUTTON1_MASK |
3336+ # Gdk.ModifierType.MOD2_MASK,
3337+ # FIXME!!!! JUST GUESSING THE TYPE
3338+ Gdk.EventMask.ALL_EVENTS_MASK,
3339+ None,
3340+ None,
3341+ 0,)
3342 self.connect('button-press-event', self.__focus_out)
3343
3344 def close_selector(self):
3345 """Hides the window"""
3346 self.hide()
3347- gtk.gdk.pointer_ungrab()
3348+#FIXME!!!
3349+ Gdk.pointer_ungrab(0)
3350 self.grab_remove()
3351
3352 def get_selected_icon(self):
3353@@ -171,17 +179,17 @@
3354 self.symbol_iv.unselect_all()
3355
3356
3357-gobject.type_register(TagIconSelector)
3358-gobject.signal_new("selection-changed", TagIconSelector,
3359- gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ())
3360-
3361-
3362-class TagEditor(gtk.Window):
3363+GObject.type_register(TagIconSelector)
3364+GObject.signal_new("selection-changed", TagIconSelector,
3365+ GObject.SignalFlags.RUN_FIRST, None, ())
3366+
3367+
3368+class TagEditor(Gtk.Window):
3369 """Window allowing to edit a tag's properties."""
3370
3371 def __init__(self, req, vmanager, tag=None):
3372- gtk.Window.__init__(self)
3373- self.__gobject_init__()
3374+ Gtk.Window.__init__(self)
3375+
3376 self.req = req
3377 self.vmanager = vmanager
3378 self.tag = tag
3379@@ -193,7 +201,7 @@
3380 self.tis_selection_changed_hid = None
3381 self.tag_icon_selector = None
3382 # Build up the window
3383- self.set_position(gtk.WIN_POS_CENTER)
3384+ self.set_position(Gtk.WindowPosition.CENTER)
3385 self.set_title('Edit tag')
3386 self.set_border_width(10)
3387 self.set_resizable(False)
3388@@ -206,57 +214,59 @@
3389 def __build_window(self):
3390 """Build up the widget"""
3391 # toplevel widget
3392- self.top_vbox = gtk.VBox()
3393+ self.top_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
3394 self.add(self.top_vbox)
3395- # header line: icon, table with name and "hide in wv"
3396- self.hdr_align = gtk.Alignment()
3397- self.top_vbox.pack_start(self.hdr_align)
3398+ # header line: icon, grid with name and "hide in wv"
3399+ #FIXME
3400+ self.hdr_align = Gtk.Alignment()
3401+ self.top_vbox.pack_start(self.hdr_align, True, True, 0)
3402 self.hdr_align.set_padding(0, 25, 0, 0)
3403- self.hdr_hbox = gtk.HBox()
3404- self.hdr_align.add(self.hdr_hbox)
3405- self.hdr_hbox.set_spacing(10)
3406+ self.hdr_box = Gtk.Box()
3407+ self.hdr_align.add(self.hdr_box)
3408+ self.hdr_box.set_spacing(10)
3409 # Button to tag icon selector
3410- self.ti_bt = gtk.Button()
3411- self.ti_bt_label = gtk.Label()
3412+ self.ti_bt = Gtk.Button()
3413+ self.ti_bt_label = Gtk.Label()
3414 self.ti_bt.add(self.ti_bt_label)
3415- self.hdr_hbox.pack_start(self.ti_bt)
3416+ self.hdr_box.pack_start(self.ti_bt, True, True, 0)
3417 self.ti_bt.set_size_request(64, 64)
3418- self.ti_bt.set_relief(gtk.RELIEF_HALF)
3419+ self.ti_bt.set_relief(Gtk.ReliefStyle.HALF)
3420 # vbox for tag name and hid in WV
3421- self.tp_table = gtk.Table(2, 2)
3422- self.hdr_hbox.pack_start(self.tp_table)
3423- self.tp_table.set_col_spacing(0, 5)
3424- self.tn_entry_lbl_align = gtk.Alignment(0, 0.5)
3425- self.tp_table.attach(self.tn_entry_lbl_align, 0, 1, 0, 1)
3426- self.tn_entry_lbl = gtk.Label()
3427+ self.tp_grid = Gtk.Grid()
3428+ self.hdr_box.pack_start(self.tp_grid, True, True, 0)
3429+ self.tp_grid.set_column_spacing(5)
3430+ self.tn_entry_lbl_align = Gtk.Alignment.new(0, 0.5, 0, 0)
3431+ self.tp_grid.add(self.tn_entry_lbl_align)
3432+ self.tn_entry_lbl = Gtk.Label()
3433 self.tn_entry_lbl.set_markup("<span weight='bold'>%s</span>"
3434 % _("Name : "))
3435 self.tn_entry_lbl_align.add(self.tn_entry_lbl)
3436- self.tn_entry = gtk.Entry()
3437- self.tp_table.attach(self.tn_entry, 1, 2, 0, 1)
3438+ self.tn_entry = Gtk.Entry()
3439 self.tn_entry.set_width_chars(20)
3440- self.tn_cb_lbl_align = gtk.Alignment(0, 0.5)
3441- self.tp_table.attach(self.tn_cb_lbl_align, 0, 1, 1, 2)
3442- self.tn_cb_lbl = gtk.Label(_("Show Tag in Work View :"))
3443+ self.tp_grid.attach(self.tn_entry, 1, 0, 1, 1)
3444+ self.tn_cb_lbl_align = Gtk.Alignment.new(0, 0.5, 0, 0)
3445+ self.tp_grid.attach(self.tn_cb_lbl_align, 0, 1, 1, 1)
3446+ self.tn_cb_lbl = Gtk.Label(label=_("Show Tag in Work View :"))
3447 self.tn_cb_lbl_align.add(self.tn_cb_lbl)
3448- self.tn_cb = gtk.CheckButton()
3449- self.tp_table.attach(self.tn_cb, 1, 2, 1, 2)
3450+ self.tn_cb = Gtk.CheckButton()
3451+ self.tp_grid.attach(self.tn_cb, 1, 1, 1, 1)
3452 # Tag color
3453- self.tc_vbox = gtk.VBox()
3454- self.top_vbox.pack_start(self.tc_vbox)
3455- self.tc_label_align = gtk.Alignment()
3456- self.tc_vbox.pack_start(self.tc_label_align)
3457+ self.tc_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
3458+ self.top_vbox.pack_start(self.tc_vbox, True, True, 0)
3459+ self.tc_label_align = Gtk.Alignment()
3460+ self.tc_vbox.pack_start(self.tc_label_align, True, True, 0)
3461 self.tc_label_align.set_padding(0, 0, 0, 0)
3462- self.tc_label = gtk.Label()
3463+ self.tc_label = Gtk.Label()
3464 self.tc_label_align.add(self.tc_label)
3465 self.tc_label.set_markup(
3466 "<span weight='bold'>%s</span>" % _("Select Tag Color:"))
3467 self.tc_label.set_alignment(0, 0.5)
3468 # Tag color chooser
3469- self.tc_cc_align = gtk.Alignment(0.5, 0.5, 0, 0)
3470- self.tc_vbox.pack_start(self.tc_cc_align)
3471+ self.tc_cc_align = Gtk.Alignment.new(0.5, 0.5, 0, 0)
3472+ self.tc_vbox.pack_start(self.tc_cc_align, True, True, 0)
3473 self.tc_cc_align.set_padding(15, 15, 10, 10)
3474- self.tc_cc_colsel = SimpleColorSelector()
3475+ #self.tc_cc_colsel = SimpleColorSelector()
3476+ self.tc_cc_colsel = Gtk.ColorChooserWidget()
3477 self.tc_cc_align.add(self.tc_cc_colsel)
3478 # Icon selector
3479 self.tag_icon_selector = TagIconSelector()
3480@@ -272,15 +282,21 @@
3481 self.tn_entry.connect('changed', self.on_tn_entry_changed)
3482 self.tn_cb_clicked_hid = self.tn_cb.connect('clicked',
3483 self.on_tn_cb_clicked)
3484- self.tc_cc_colsel.connect('color-changed', self.on_tc_colsel_changed)
3485- self.tc_cc_colsel.connect('color-added', self.on_tc_colsel_added)
3486+ #FIXME
3487+ #self.tc_cc_colsel.connect('color-changed', self.on_tc_colsel_changed)
3488+ #self.tc_cc_colsel.connect('color-added', self.on_tc_colsel_added)
3489+ self.tc_cc_colsel.connect('color-activated',
3490+ self.on_tc_colsel_activated)
3491 self.connect('delete-event', self.on_close)
3492
3493 # allow fast closing by Escape key
3494- agr = gtk.AccelGroup()
3495+ #FIXME
3496+ '''
3497+ agr = Gtk.AccelGroup()
3498 self.add_accel_group(agr)
3499- key, modifier = gtk.accelerator_parse('Escape')
3500- agr.connect_group(key, modifier, gtk.ACCEL_VISIBLE, self.on_close)
3501+ key, modifier = Gtk.accelerator_parse('Escape')
3502+ agr.connect_group(key, modifier, Gtk.AccelFlags.VISIBLE, self.on_close)
3503+ '''
3504
3505 def __set_default_values(self):
3506 """Configure the widget components with their initial default values"""
3507@@ -291,7 +307,7 @@
3508 self.tag_icon_selector.handler_block(self.tis_selection_changed_hid)
3509 # Default icon
3510 markup = "<span size='small'>%s</span>" % _("Click To\nSet Icon")
3511- self.ti_bt_label.set_justify(gtk.JUSTIFY_CENTER)
3512+ self.ti_bt_label.set_justify(Gtk.Justification.CENTER)
3513 self.ti_bt_label.set_markup(markup)
3514 self.ti_bt_label.show()
3515 self.__set_icon(None)
3516@@ -301,9 +317,13 @@
3517 self.tn_cb.set_active(True)
3518 # Name entry
3519 self.tn_entry.set_text(_("Enter tag name here"))
3520- self.tn_entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, None)
3521+ self.tn_entry.set_icon_from_stock(Gtk.EntryIconPosition.SECONDARY,
3522+ None)
3523 # Color selection
3524- self.tc_cc_colsel.unselect_color()
3525+ #FIXME
3526+ #self.tc_cc_colsel.unselect_color()
3527+ self.tc_cc_colsel.set_use_alpha(False)
3528+ #self.tc_cc_colsel.set_rgba(self.tc_cc_colsel, None)
3529 # Custom colors
3530 self.custom_colors = self.config.get('custom_colors')
3531 if len(self.custom_colors) > 0:
3532@@ -321,8 +341,8 @@
3533 if icon is not None:
3534 for i in self.ti_bt:
3535 self.ti_bt.remove(i)
3536- ti_bt_img = gtk.image_new_from_icon_name(icon,
3537- gtk.ICON_SIZE_BUTTON)
3538+ ti_bt_img = Gtk.Image.new_from_icon_name(icon,
3539+ Gtk.IconSize.BUTTON)
3540 ti_bt_img.show()
3541 self.ti_bt.add(ti_bt_img)
3542 else:
3543@@ -401,8 +421,11 @@
3544 """Callback: displays the tag icon selector widget next
3545 to the button."""
3546 rect = self.ti_bt.get_allocation()
3547- pos_x, pos_y = \
3548- self.ti_bt.window.get_origin()
3549+ # print self.ti_bt.get_window().get_origin()
3550+#FIXME
3551+ result, pos_x, pos_y = \
3552+ self.ti_bt.get_window().get_origin()
3553+ # self.ti_bt.window.get_origin()
3554 self.tag_icon_selector.show_at_position(
3555 pos_x + rect.x + rect.width + 2,
3556 pos_y + rect.y)
3557@@ -417,17 +440,18 @@
3558 self.tn_entry_last_recorded_value = self.tn_entry.get_text()
3559 # check validity
3560 if self.tn_entry_last_recorded_value.strip() == "":
3561- self.tn_entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY,
3562- gtk.STOCK_DIALOG_ERROR)
3563+ self.tn_entry.set_icon_from_stock(Gtk.EntryIconPosition.SECONDARY,
3564+ Gtk.STOCK_DIALOG_ERROR)
3565 else:
3566- self.tn_entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, None)
3567+ self.tn_entry.set_icon_from_stock(
3568+ Gtk.EntryIconPosition.SECONDARY, None)
3569 # filter out change requests to reduce commit overhead
3570 if self.tn_entry_watch_id is None:
3571 # There is no watchers for the text entry. Register one.
3572 # Also, wait 1 second before commiting the change in order to
3573 # reduce rename requests
3574 tn_entry_changes = self.watch_tn_entry_changes
3575- self.tn_entry_watch_id = gobject.timeout_add(1000,
3576+ self.tn_entry_watch_id = GObject.timeout_add(1000,
3577 tn_entry_changes)
3578
3579 def on_tn_cb_clicked(self, widget):
3580@@ -448,6 +472,19 @@
3581 else:
3582 self.tag.del_attribute('color')
3583
3584+ def on_tc_colsel_activated(self, widget, color):
3585+ """Callback: update the tag color depending on the current color
3586+ selection"""
3587+ print("activated", widget, color, " <--- ignoring for now")
3588+ return
3589+ #color = self.tc_cc_colsel.get_rgba().to_color()
3590+ color = color.to_color()
3591+ if self.tag is not None:
3592+ if color is not None:
3593+ self.tag.set_attribute('color', color)
3594+ else:
3595+ self.tag.del_attribute('color')
3596+
3597 def on_tc_colsel_added(self, widget):
3598 """Callback: if a new color is added, we register it in the
3599 configuration"""
3600
3601=== renamed file 'GTG/gtk/browser/taskbrowser.glade' => 'GTG/gtk/browser/taskbrowser.ui'
3602--- GTG/gtk/browser/taskbrowser.glade 2013-11-23 14:40:23 +0000
3603+++ GTG/gtk/browser/taskbrowser.ui 2014-01-12 07:15:48 +0000
3604@@ -1,7 +1,6 @@
3605 <?xml version="1.0" encoding="UTF-8"?>
3606 <interface>
3607- <requires lib="gtk+" version="2.16"/>
3608- <!-- interface-naming-policy toplevel-contextual -->
3609+ <!-- interface-requires gtk+ 3.0 -->
3610 <object class="GtkWindow" id="MainWindow">
3611 <property name="can_focus">False</property>
3612 <property name="title" translatable="yes">Getting Things GNOME!</property>
3613@@ -10,9 +9,10 @@
3614 <signal name="configure-event" handler="on_move" swapped="no"/>
3615 <signal name="size-allocate" handler="on_size_allocate" swapped="no"/>
3616 <child>
3617- <object class="GtkVBox" id="master_vbox">
3618+ <object class="GtkBox" id="master_vbox">
3619 <property name="visible">True</property>
3620 <property name="can_focus">False</property>
3621+ <property name="orientation">vertical</property>
3622 <child>
3623 <object class="GtkMenuBar" id="browser_menu">
3624 <property name="visible">True</property>
3625@@ -21,7 +21,6 @@
3626 <object class="GtkMenuItem" id="bm_task">
3627 <property name="visible">True</property>
3628 <property name="can_focus">False</property>
3629- <property name="use_action_appearance">False</property>
3630 <property name="label" translatable="yes">_Tasks</property>
3631 <property name="use_underline">True</property>
3632 <child type="submenu">
3633@@ -34,7 +33,6 @@
3634 <property name="visible">True</property>
3635 <property name="can_focus">False</property>
3636 <property name="tooltip_text" translatable="yes">Create a new task</property>
3637- <property name="use_action_appearance">False</property>
3638 <property name="use_underline">True</property>
3639 <property name="image">bm_img_task</property>
3640 <property name="use_stock">False</property>
3641@@ -48,7 +46,6 @@
3642 <property name="visible">True</property>
3643 <property name="sensitive">False</property>
3644 <property name="can_focus">False</property>
3645- <property name="use_action_appearance">False</property>
3646 <property name="use_underline">True</property>
3647 <property name="image">bm_img_subtask</property>
3648 <property name="use_stock">False</property>
3649@@ -62,7 +59,6 @@
3650 <property name="visible">True</property>
3651 <property name="sensitive">False</property>
3652 <property name="can_focus">False</property>
3653- <property name="use_action_appearance">False</property>
3654 <property name="use_underline">True</property>
3655 <property name="use_stock">True</property>
3656 <property name="accel_group">accelgroup1</property>
3657@@ -81,7 +77,6 @@
3658 <property name="visible">True</property>
3659 <property name="sensitive">False</property>
3660 <property name="can_focus">False</property>
3661- <property name="use_action_appearance">False</property>
3662 <property name="use_underline">True</property>
3663 <property name="image">bm_img_done</property>
3664 <property name="use_stock">False</property>
3665@@ -95,7 +90,6 @@
3666 <property name="visible">True</property>
3667 <property name="sensitive">False</property>
3668 <property name="can_focus">False</property>
3669- <property name="use_action_appearance">False</property>
3670 <property name="use_underline">True</property>
3671 <property name="image">bm_img_dismiss</property>
3672 <property name="use_stock">False</property>
3673@@ -109,7 +103,6 @@
3674 <property name="visible">True</property>
3675 <property name="sensitive">False</property>
3676 <property name="can_focus">False</property>
3677- <property name="use_action_appearance">False</property>
3678 <property name="use_underline">True</property>
3679 <property name="use_stock">True</property>
3680 <property name="accel_group">accelgroup1</property>
3681@@ -127,7 +120,6 @@
3682 <property name="label">gtk-quit</property>
3683 <property name="visible">True</property>
3684 <property name="can_focus">False</property>
3685- <property name="use_action_appearance">False</property>
3686 <property name="use_underline">True</property>
3687 <property name="use_stock">True</property>
3688 <property name="accel_group">accelgroup1</property>
3689@@ -142,7 +134,6 @@
3690 <object class="GtkMenuItem" id="bm_edit">
3691 <property name="visible">True</property>
3692 <property name="can_focus">False</property>
3693- <property name="use_action_appearance">False</property>
3694 <property name="label" translatable="yes">_Edit</property>
3695 <property name="use_underline">True</property>
3696 <child type="submenu">
3697@@ -153,7 +144,6 @@
3698 <object class="GtkImageMenuItem" id="edit_undo">
3699 <property name="label">gtk-undo</property>
3700 <property name="can_focus">False</property>
3701- <property name="use_action_appearance">False</property>
3702 <property name="use_underline">True</property>
3703 <property name="use_stock">True</property>
3704 <property name="accel_group">accelgroup1</property>
3705@@ -163,7 +153,6 @@
3706 <object class="GtkImageMenuItem" id="edit_redo">
3707 <property name="label">gtk-redo</property>
3708 <property name="can_focus">False</property>
3709- <property name="use_action_appearance">False</property>
3710 <property name="use_underline">True</property>
3711 <property name="use_stock">True</property>
3712 <property name="accel_group">accelgroup1</property>
3713@@ -178,7 +167,6 @@
3714 <object class="GtkMenuItem" id="plugins_mi">
3715 <property name="visible">True</property>
3716 <property name="can_focus">False</property>
3717- <property name="use_action_appearance">False</property>
3718 <property name="label">P_lugins</property>
3719 <property name="use_underline">True</property>
3720 <signal name="activate" handler="on_edit_plugins_activate" swapped="no"/>
3721@@ -188,7 +176,6 @@
3722 <object class="GtkMenuItem" id="backends_mi">
3723 <property name="visible">True</property>
3724 <property name="can_focus">False</property>
3725- <property name="use_action_appearance">False</property>
3726 <property name="label">_Synchronization Services</property>
3727 <property name="use_underline">True</property>
3728 <signal name="activate" handler="on_edit_backends_activate" swapped="no"/>
3729@@ -205,7 +192,6 @@
3730 <property name="label">gtk-preferences</property>
3731 <property name="visible">True</property>
3732 <property name="can_focus">False</property>
3733- <property name="use_action_appearance">False</property>
3734 <property name="use_underline">True</property>
3735 <property name="use_stock">True</property>
3736 <property name="accel_group">accelgroup1</property>
3737@@ -220,7 +206,6 @@
3738 <object class="GtkMenuItem" id="menu_view">
3739 <property name="visible">True</property>
3740 <property name="can_focus">False</property>
3741- <property name="use_action_appearance">False</property>
3742 <property name="label" translatable="yes">_View</property>
3743 <property name="use_underline">True</property>
3744 <child type="submenu">
3745@@ -231,7 +216,6 @@
3746 <object class="GtkCheckMenuItem" id="view_workview">
3747 <property name="visible">True</property>
3748 <property name="can_focus">False</property>
3749- <property name="use_action_appearance">False</property>
3750 <property name="label" translatable="yes">_Work View</property>
3751 <property name="use_underline">True</property>
3752 <signal name="toggled" handler="on_view_workview_toggled" swapped="no"/>
3753@@ -247,7 +231,6 @@
3754 <object class="GtkCheckMenuItem" id="view_sidebar">
3755 <property name="visible">True</property>
3756 <property name="can_focus">False</property>
3757- <property name="use_action_appearance">False</property>
3758 <property name="label" translatable="yes">_Tags Sidebar</property>
3759 <property name="use_underline">True</property>
3760 <signal name="toggled" handler="on_view_sidebar_toggled" swapped="no"/>
3761@@ -257,7 +240,6 @@
3762 <object class="GtkCheckMenuItem" id="view_closed">
3763 <property name="visible">True</property>
3764 <property name="can_focus">False</property>
3765- <property name="use_action_appearance">False</property>
3766 <property name="label" translatable="yes">_Closed Tasks Pane</property>
3767 <property name="use_underline">True</property>
3768 <signal name="toggled" handler="on_view_closed_toggled" swapped="no"/>
3769@@ -267,7 +249,6 @@
3770 <object class="GtkCheckMenuItem" id="view_toolbar">
3771 <property name="visible">True</property>
3772 <property name="can_focus">False</property>
3773- <property name="use_action_appearance">False</property>
3774 <property name="label" translatable="yes">T_oolbar</property>
3775 <property name="use_underline">True</property>
3776 <signal name="toggled" handler="on_view_toolbar_toggled" swapped="no"/>
3777@@ -277,7 +258,6 @@
3778 <object class="GtkCheckMenuItem" id="view_quickadd">
3779 <property name="visible">True</property>
3780 <property name="can_focus">False</property>
3781- <property name="use_action_appearance">False</property>
3782 <property name="label" translatable="yes">_Quick Add Entry</property>
3783 <property name="use_underline">True</property>
3784 <signal name="toggled" handler="on_view_quickadd_toggled" swapped="no"/>
3785@@ -290,7 +270,6 @@
3786 <child>
3787 <object class="GtkMenuItem" id="plugin_mi">
3788 <property name="can_focus">False</property>
3789- <property name="use_action_appearance">False</property>
3790 <property name="label" translatable="yes">_Plugins</property>
3791 <property name="use_underline">True</property>
3792 <child type="submenu">
3793@@ -305,7 +284,6 @@
3794 <object class="GtkMenuItem" id="help_mi">
3795 <property name="visible">True</property>
3796 <property name="can_focus">False</property>
3797- <property name="use_action_appearance">False</property>
3798 <property name="label" translatable="yes">_Help</property>
3799 <property name="use_underline">True</property>
3800 <child type="submenu">
3801@@ -318,7 +296,6 @@
3802 <property name="visible">True</property>
3803 <property name="can_focus">False</property>
3804 <property name="tooltip_text" translatable="yes">Open GTG help</property>
3805- <property name="use_action_appearance">False</property>
3806 <property name="image">image7</property>
3807 <property name="use_stock">False</property>
3808 <property name="accel_group">accelgroup1</property>
3809@@ -337,7 +314,6 @@
3810 <property name="visible">True</property>
3811 <property name="can_focus">False</property>
3812 <property name="tooltip_text" translatable="yes">Help to translate GTG into your language</property>
3813- <property name="use_action_appearance">False</property>
3814 <property name="use_underline">True</property>
3815 <property name="use_stock">True</property>
3816 <property name="accel_group">accelgroup1</property>
3817@@ -350,7 +326,6 @@
3818 <property name="visible">True</property>
3819 <property name="can_focus">False</property>
3820 <property name="tooltip_text" translatable="yes">Report a problem to GTG developers</property>
3821- <property name="use_action_appearance">False</property>
3822 <property name="use_underline">True</property>
3823 <property name="use_stock">True</property>
3824 <property name="accel_group">accelgroup1</property>
3825@@ -368,7 +343,6 @@
3826 <property name="label">gtk-about</property>
3827 <property name="visible">True</property>
3828 <property name="can_focus">False</property>
3829- <property name="use_action_appearance">False</property>
3830 <property name="use_underline">True</property>
3831 <property name="use_stock">True</property>
3832 <property name="accel_group">accelgroup1</property>
3833@@ -387,9 +361,10 @@
3834 </packing>
3835 </child>
3836 <child>
3837- <object class="GtkVBox" id="vbox_toolbars">
3838+ <object class="GtkBox" id="vbox_toolbars">
3839 <property name="visible">True</property>
3840 <property name="can_focus">False</property>
3841+ <property name="orientation">vertical</property>
3842 <child>
3843 <object class="GtkToolbar" id="task_toolbar">
3844 <property name="visible">True</property>
3845@@ -398,7 +373,6 @@
3846 <object class="GtkToolButton" id="new_task_b">
3847 <property name="visible">True</property>
3848 <property name="can_focus">False</property>
3849- <property name="use_action_appearance">False</property>
3850 <property name="is_important">True</property>
3851 <property name="label" translatable="yes">New Task</property>
3852 <property name="icon_name">gtg-task-new</property>
3853@@ -412,7 +386,6 @@
3854 <child>
3855 <object class="GtkToolButton" id="new_subtask_b">
3856 <property name="can_focus">False</property>
3857- <property name="use_action_appearance">False</property>
3858 <property name="label" translatable="yes">New Subtask</property>
3859 <property name="icon_name">gtg-task-new</property>
3860 <signal name="clicked" handler="on_add_subtask" swapped="no"/>
3861@@ -426,7 +399,6 @@
3862 <object class="GtkToolButton" id="edit_b">
3863 <property name="visible">True</property>
3864 <property name="can_focus">False</property>
3865- <property name="use_action_appearance">False</property>
3866 <property name="visible_horizontal">False</property>
3867 <property name="visible_vertical">False</property>
3868 <property name="label" translatable="yes">Edit</property>
3869@@ -450,7 +422,6 @@
3870 <child>
3871 <object class="GtkToolButton" id="Undo">
3872 <property name="can_focus">False</property>
3873- <property name="use_action_appearance">False</property>
3874 <property name="label" translatable="yes">Undo</property>
3875 <property name="stock_id">gtk-undo</property>
3876 </object>
3877@@ -462,7 +433,6 @@
3878 <child>
3879 <object class="GtkToolButton" id="Redo">
3880 <property name="can_focus">False</property>
3881- <property name="use_action_appearance">False</property>
3882 <property name="label" translatable="yes">Redo</property>
3883 <property name="stock_id">gtk-redo</property>
3884 </object>
3885@@ -486,7 +456,6 @@
3886 <property name="visible">True</property>
3887 <property name="sensitive">False</property>
3888 <property name="can_focus">False</property>
3889- <property name="use_action_appearance">False</property>
3890 <property name="is_important">True</property>
3891 <property name="label" translatable="yes">Mark as Done</property>
3892 <property name="icon_name">gtg-task-done</property>
3893@@ -502,7 +471,6 @@
3894 <property name="visible">True</property>
3895 <property name="sensitive">False</property>
3896 <property name="can_focus">False</property>
3897- <property name="use_action_appearance">False</property>
3898 <property name="label" translatable="yes">Dismiss</property>
3899 <property name="icon_name">gtg-task-dismiss</property>
3900 <signal name="clicked" handler="on_dismiss_task" swapped="no"/>
3901@@ -516,7 +484,6 @@
3902 <object class="GtkToolButton" id="delete_b">
3903 <property name="sensitive">False</property>
3904 <property name="can_focus">False</property>
3905- <property name="use_action_appearance">False</property>
3906 <property name="label" translatable="yes">Delete</property>
3907 <property name="icon_name">edit-delete</property>
3908 <signal name="clicked" handler="on_delete_task" swapped="no"/>
3909@@ -540,7 +507,6 @@
3910 <object class="GtkToggleToolButton" id="workview_toggle">
3911 <property name="visible">True</property>
3912 <property name="can_focus">False</property>
3913- <property name="use_action_appearance">False</property>
3914 <property name="is_important">True</property>
3915 <property name="label" translatable="yes">Work View</property>
3916 <property name="stock_id">gtk-index</property>
3917@@ -566,15 +532,16 @@
3918 </packing>
3919 </child>
3920 <child>
3921- <object class="GtkHPaned" id="hpaned1">
3922+ <object class="GtkPaned" id="hpaned1">
3923 <property name="visible">True</property>
3924 <property name="can_focus">True</property>
3925 <child>
3926- <object class="GtkVBox" id="sidebar_vbox">
3927+ <object class="GtkBox" id="sidebar_vbox">
3928 <property name="width_request">75</property>
3929 <property name="can_focus">False</property>
3930+ <property name="orientation">vertical</property>
3931 <child>
3932- <object class="GtkHBox" id="hbox4">
3933+ <object class="GtkBox" id="box4">
3934 <property name="visible">True</property>
3935 <property name="can_focus">False</property>
3936 <child>
3937@@ -608,7 +575,6 @@
3938 <property name="visible">True</property>
3939 <property name="can_focus">True</property>
3940 <property name="receives_default">True</property>
3941- <property name="use_action_appearance">False</property>
3942 <property name="relief">none</property>
3943 <signal name="clicked" handler="on_view_sidebar_toggled" swapped="no"/>
3944 <child>
3945@@ -643,8 +609,6 @@
3946 <object class="GtkScrolledWindow" id="sidebar-scroll">
3947 <property name="visible">True</property>
3948 <property name="can_focus">True</property>
3949- <property name="hscrollbar_policy">automatic</property>
3950- <property name="vscrollbar_policy">automatic</property>
3951 <property name="shadow_type">in</property>
3952 <child>
3953 <placeholder/>
3954@@ -675,11 +639,12 @@
3955 </packing>
3956 </child>
3957 <child>
3958- <object class="GtkVBox" id="main_vbox">
3959+ <object class="GtkBox" id="main_vbox">
3960 <property name="visible">True</property>
3961 <property name="can_focus">False</property>
3962+ <property name="orientation">vertical</property>
3963 <child>
3964- <object class="GtkHBox" id="quickadd_pane">
3965+ <object class="GtkBox" id="quickadd_pane">
3966 <property name="visible">True</property>
3967 <property name="can_focus">False</property>
3968 <child>
3969@@ -692,9 +657,6 @@
3970 <property name="invisible_char">●</property>
3971 <property name="secondary_icon_stock">gtk-clear</property>
3972 <property name="primary_icon_activatable">False</property>
3973- <property name="secondary_icon_activatable">True</property>
3974- <property name="primary_icon_sensitive">True</property>
3975- <property name="secondary_icon_sensitive">True</property>
3976 <signal name="changed" handler="on_quickadd_field_changed" swapped="no"/>
3977 <signal name="activate" handler="on_quickadd_field_activate" swapped="no"/>
3978 <signal name="icon-press" handler="on_quickadd_field_icon_press" swapped="no"/>
3979@@ -714,9 +676,10 @@
3980 </packing>
3981 </child>
3982 <child>
3983- <object class="GtkVPaned" id="vpaned1">
3984+ <object class="GtkPaned" id="vpaned1">
3985 <property name="visible">True</property>
3986 <property name="can_focus">True</property>
3987+ <property name="orientation">vertical</property>
3988 <child>
3989 <object class="GtkNotebook" id="main_notebook">
3990 <property name="visible">True</property>
3991@@ -728,7 +691,6 @@
3992 <property name="visible">True</property>
3993 <property name="can_focus">True</property>
3994 <property name="hscrollbar_policy">never</property>
3995- <property name="vscrollbar_policy">automatic</property>
3996 <child>
3997 <placeholder/>
3998 </child>
3999@@ -794,9 +756,10 @@
4000 <property name="resizable">False</property>
4001 <property name="window_position">center-on-parent</property>
4002 <property name="type_hint">dialog</property>
4003- <property name="program_name" translatable="yes">Getting Things GNOME!</property>
4004+ <property name="program_name">Getting Things GNOME!</property>
4005 <property name="copyright" translatable="yes">Copyright © 2008-2013 Lionel Dricot, Bertrand Rousseau</property>
4006- <property name="comments" translatable="yes">GTG is a personal tasks and TODO-list items organizer for the GNOME desktop environment.</property>
4007+ <property name="comments" translatable="yes">GTG is a personal tasks and TODO-list items
4008+organizer for the GNOME desktop environment.</property>
4009 <property name="website_label" translatable="yes">GTG website</property>
4010 <property name="license" translatable="yes">Getting Things GNOME! is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
4011
4012@@ -810,12 +773,13 @@
4013 <signal name="delete-event" handler="on_about_delete" swapped="no"/>
4014 <signal name="response" handler="on_about_close" swapped="no"/>
4015 <child internal-child="vbox">
4016- <object class="GtkVBox" id="about_dialog_vbox">
4017+ <object class="GtkBox" id="about_dialog_vbox">
4018 <property name="visible">True</property>
4019 <property name="can_focus">False</property>
4020+ <property name="orientation">vertical</property>
4021 <property name="spacing">2</property>
4022 <child internal-child="action_area">
4023- <object class="GtkHButtonBox" id="dialog-action_area2">
4024+ <object class="GtkButtonBox" id="dialog-action_area2">
4025 <property name="visible">True</property>
4026 <property name="can_focus">False</property>
4027 <property name="layout_style">end</property>
4028@@ -863,7 +827,6 @@
4029 <property name="label">gtk-edit</property>
4030 <property name="visible">True</property>
4031 <property name="can_focus">False</property>
4032- <property name="use_action_appearance">False</property>
4033 <property name="use_underline">True</property>
4034 <property name="use_stock">True</property>
4035 <property name="accel_group">accelgroup1</property>
4036@@ -881,7 +844,6 @@
4037 <property name="label" translatable="yes">Mark as Not Done</property>
4038 <property name="visible">True</property>
4039 <property name="can_focus">False</property>
4040- <property name="use_action_appearance">False</property>
4041 <property name="use_underline">True</property>
4042 <property name="image">ctcm_img_mark_not_done</property>
4043 <property name="use_stock">False</property>
4044@@ -894,7 +856,6 @@
4045 <property name="label" translatable="yes">Und_ismiss</property>
4046 <property name="visible">True</property>
4047 <property name="can_focus">False</property>
4048- <property name="use_action_appearance">False</property>
4049 <property name="use_underline">True</property>
4050 <property name="image">tcm_img_undismiss</property>
4051 <property name="use_stock">False</property>
4052@@ -907,7 +868,6 @@
4053 <property name="label">gtk-delete</property>
4054 <property name="visible">True</property>
4055 <property name="can_focus">False</property>
4056- <property name="use_action_appearance">False</property>
4057 <property name="use_underline">True</property>
4058 <property name="use_stock">True</property>
4059 <property name="accel_group">accelgroup1</property>
4060@@ -972,7 +932,6 @@
4061 <property name="label" translatable="yes">Add a subtask</property>
4062 <property name="visible">True</property>
4063 <property name="can_focus">False</property>
4064- <property name="use_action_appearance">False</property>
4065 <property name="use_underline">True</property>
4066 <property name="image">tcm_img_add_subtask</property>
4067 <property name="use_stock">False</property>
4068@@ -985,7 +944,6 @@
4069 <property name="label">gtk-edit</property>
4070 <property name="visible">True</property>
4071 <property name="can_focus">False</property>
4072- <property name="use_action_appearance">False</property>
4073 <property name="use_underline">True</property>
4074 <property name="use_stock">True</property>
4075 <property name="accel_group">accelgroup1</property>
4076@@ -1003,7 +961,6 @@
4077 <property name="label" translatable="yes">Mark as _Done</property>
4078 <property name="visible">True</property>
4079 <property name="can_focus">False</property>
4080- <property name="use_action_appearance">False</property>
4081 <property name="use_underline">True</property>
4082 <property name="image">tcm_img_mark_done</property>
4083 <property name="use_stock">False</property>
4084@@ -1016,7 +973,6 @@
4085 <property name="label" translatable="yes">D_ismiss</property>
4086 <property name="visible">True</property>
4087 <property name="can_focus">False</property>
4088- <property name="use_action_appearance">False</property>
4089 <property name="use_underline">True</property>
4090 <property name="image">tcm_img_dismiss</property>
4091 <property name="use_stock">False</property>
4092@@ -1029,7 +985,6 @@
4093 <property name="label">gtk-delete</property>
4094 <property name="visible">True</property>
4095 <property name="can_focus">False</property>
4096- <property name="use_action_appearance">False</property>
4097 <property name="use_underline">True</property>
4098 <property name="use_stock">True</property>
4099 <property name="accel_group">accelgroup1</property>
4100@@ -1047,7 +1002,6 @@
4101 <property name="label" translatable="yes">_Set Start Date</property>
4102 <property name="visible">True</property>
4103 <property name="can_focus">False</property>
4104- <property name="use_action_appearance">False</property>
4105 <property name="use_underline">True</property>
4106 <property name="use_stock">False</property>
4107 <child type="submenu">
4108@@ -1059,7 +1013,6 @@
4109 <property name="label" translatable="yes">T_oday</property>
4110 <property name="visible">True</property>
4111 <property name="can_focus">False</property>
4112- <property name="use_action_appearance">False</property>
4113 <property name="use_underline">True</property>
4114 <property name="use_stock">False</property>
4115 <signal name="activate" handler="on_mark_as_started" swapped="no"/>
4116@@ -1070,7 +1023,6 @@
4117 <property name="label" translatable="yes">_Tomorrow</property>
4118 <property name="visible">True</property>
4119 <property name="can_focus">False</property>
4120- <property name="use_action_appearance">False</property>
4121 <property name="use_underline">True</property>
4122 <property name="use_stock">False</property>
4123 <signal name="activate" handler="on_start_for_tomorrow" swapped="no"/>
4124@@ -1081,7 +1033,6 @@
4125 <property name="label" translatable="yes">Next _Week</property>
4126 <property name="visible">True</property>
4127 <property name="can_focus">False</property>
4128- <property name="use_action_appearance">False</property>
4129 <property name="use_underline">True</property>
4130 <property name="use_stock">False</property>
4131 <signal name="activate" handler="on_start_for_next_week" swapped="no"/>
4132@@ -1092,7 +1043,6 @@
4133 <property name="label" translatable="yes">Next _Month</property>
4134 <property name="visible">True</property>
4135 <property name="can_focus">False</property>
4136- <property name="use_action_appearance">False</property>
4137 <property name="use_underline">True</property>
4138 <property name="use_stock">False</property>
4139 <signal name="activate" handler="on_start_for_next_month" swapped="no"/>
4140@@ -1103,7 +1053,6 @@
4141 <property name="label" translatable="yes">Next _Year</property>
4142 <property name="visible">True</property>
4143 <property name="can_focus">False</property>
4144- <property name="use_action_appearance">False</property>
4145 <property name="use_underline">True</property>
4146 <property name="use_stock">False</property>
4147 <signal name="activate" handler="on_start_for_next_year" swapped="no"/>
4148@@ -1120,7 +1069,6 @@
4149 <property name="label" translatable="yes">_Clear Start Date</property>
4150 <property name="visible">True</property>
4151 <property name="can_focus">False</property>
4152- <property name="use_action_appearance">False</property>
4153 <property name="use_underline">True</property>
4154 <property name="use_stock">False</property>
4155 <signal name="activate" handler="on_start_clear" swapped="no"/>
4156@@ -1135,7 +1083,6 @@
4157 <property name="label" translatable="yes">Set Due Date</property>
4158 <property name="visible">True</property>
4159 <property name="can_focus">False</property>
4160- <property name="use_action_appearance">False</property>
4161 <property name="use_underline">True</property>
4162 <property name="use_stock">False</property>
4163 <child type="submenu">
4164@@ -1147,7 +1094,6 @@
4165 <property name="label" translatable="yes">T_oday</property>
4166 <property name="visible">True</property>
4167 <property name="can_focus">False</property>
4168- <property name="use_action_appearance">False</property>
4169 <property name="use_underline">True</property>
4170 <property name="use_stock">False</property>
4171 <signal name="activate" handler="on_set_due_today" swapped="no"/>
4172@@ -1158,7 +1104,6 @@
4173 <property name="label" translatable="yes">_Tomorrow</property>
4174 <property name="visible">True</property>
4175 <property name="can_focus">False</property>
4176- <property name="use_action_appearance">False</property>
4177 <property name="use_underline">True</property>
4178 <property name="use_stock">False</property>
4179 <signal name="activate" handler="on_set_due_tomorrow" swapped="no"/>
4180@@ -1169,7 +1114,6 @@
4181 <property name="label" translatable="yes">Next _Week</property>
4182 <property name="visible">True</property>
4183 <property name="can_focus">False</property>
4184- <property name="use_action_appearance">False</property>
4185 <property name="use_underline">True</property>
4186 <property name="use_stock">False</property>
4187 <signal name="activate" handler="on_set_due_next_week" swapped="no"/>
4188@@ -1180,7 +1124,6 @@
4189 <property name="label" translatable="yes">Next _Month</property>
4190 <property name="visible">True</property>
4191 <property name="can_focus">False</property>
4192- <property name="use_action_appearance">False</property>
4193 <property name="use_underline">True</property>
4194 <property name="use_stock">False</property>
4195 <signal name="activate" handler="on_set_due_next_month" swapped="no"/>
4196@@ -1191,7 +1134,6 @@
4197 <property name="label" translatable="yes">Next _Year</property>
4198 <property name="visible">True</property>
4199 <property name="can_focus">False</property>
4200- <property name="use_action_appearance">False</property>
4201 <property name="use_underline">True</property>
4202 <property name="use_stock">False</property>
4203 <signal name="activate" handler="on_set_due_next_year" swapped="no"/>
4204@@ -1208,7 +1150,6 @@
4205 <property name="label" translatable="yes">_Now</property>
4206 <property name="visible">True</property>
4207 <property name="can_focus">False</property>
4208- <property name="use_action_appearance">False</property>
4209 <property name="use_underline">True</property>
4210 <property name="use_stock">False</property>
4211 <signal name="activate" handler="on_set_due_now" swapped="no"/>
4212@@ -1219,7 +1160,6 @@
4213 <property name="label" translatable="yes">_Soon</property>
4214 <property name="visible">True</property>
4215 <property name="can_focus">False</property>
4216- <property name="use_action_appearance">False</property>
4217 <property name="use_underline">True</property>
4218 <property name="use_stock">False</property>
4219 <signal name="activate" handler="on_set_due_soon" swapped="no"/>
4220@@ -1230,7 +1170,6 @@
4221 <property name="label" translatable="yes">_Someday</property>
4222 <property name="visible">True</property>
4223 <property name="can_focus">False</property>
4224- <property name="use_action_appearance">False</property>
4225 <property name="use_underline">True</property>
4226 <property name="use_stock">False</property>
4227 <signal name="activate" handler="on_set_due_someday" swapped="no"/>
4228@@ -1247,7 +1186,6 @@
4229 <property name="label" translatable="yes">_Clear Due Date</property>
4230 <property name="visible">True</property>
4231 <property name="can_focus">False</property>
4232- <property name="use_action_appearance">False</property>
4233 <property name="use_underline">True</property>
4234 <property name="use_stock">False</property>
4235 <signal name="activate" handler="on_set_due_clear" swapped="no"/>
4236@@ -1268,7 +1206,6 @@
4237 <property name="label" translatable="yes">Modify Tags...</property>
4238 <property name="visible">True</property>
4239 <property name="can_focus">False</property>
4240- <property name="use_action_appearance">False</property>
4241 <property name="image">image3</property>
4242 <property name="use_stock">False</property>
4243 <signal name="activate" handler="on_modify_tags" swapped="no"/>
4244
4245=== modified file 'GTG/gtk/browser/treeview_factory.py'
4246--- GTG/gtk/browser/treeview_factory.py 2013-11-23 14:40:23 +0000
4247+++ GTG/gtk/browser/treeview_factory.py 2014-01-12 07:15:48 +0000
4248@@ -17,9 +17,7 @@
4249 # this program. If not, see <http://www.gnu.org/licenses/>.
4250 # -----------------------------------------------------------------------------
4251
4252-import gtk
4253-import gobject
4254-import pango
4255+from gi.repository import GObject, Gtk, Pango
4256 import xml.sax.saxutils as saxutils
4257 import locale
4258
4259@@ -150,7 +148,9 @@
4260 return sort
4261
4262 def title_sorting(self, task1, task2, order):
4263- return cmp(task1.get_title(), task2.get_title())
4264+ t1 = task1.get_title()
4265+ t2 = task2.get_title()
4266+ return (t1 > t2) - (t1 < t2)
4267
4268 def __date_comp(self, task1, task2, para, order):
4269 '''This is a quite complex method to sort tasks by date,
4270@@ -174,15 +174,15 @@
4271 else:
4272 raise ValueError(
4273 'invalid date comparison parameter: %s') % para
4274- sort = cmp(t2, t1)
4275+ sort = (t2 > t1) - (t2 < t1)
4276 else:
4277 sort = 0
4278
4279 # local function
4280 def reverse_if_descending(s):
4281- """Make a cmp() result relative to the top instead of following
4282+ """Make a cmpare result relative to the top instead of following
4283 user-specified sort direction"""
4284- if order == gtk.SORT_ASCENDING:
4285+ if order == Gtk.SortType.ASCENDING:
4286 return s
4287 else:
4288 return -1 * s
4289@@ -193,14 +193,16 @@
4290 t1_tags.sort()
4291 t2_tags = task2.get_tags_name()
4292 t2_tags.sort()
4293- sort = reverse_if_descending(cmp(t1_tags, t2_tags))
4294+ cmp_tags = (t1_tags > t2_tags) - (t1_tags < t2_tags)
4295+ sort = reverse_if_descending(cmp_tags)
4296
4297 if sort == 0: # Break ties by sorting by title
4298 t1_title = task1.get_title()
4299 t2_title = task2.get_title()
4300 t1_title = locale.strxfrm(t1_title)
4301 t2_title = locale.strxfrm(t2_title)
4302- sort = reverse_if_descending(cmp(t1_title, t2_title))
4303+ cmp_title = (t1_title > t2_title) - (t1_title < t2_title)
4304+ sort = reverse_if_descending(cmp_title)
4305
4306 return sort
4307
4308@@ -234,7 +236,7 @@
4309 t1_name = locale.strxfrm(t1.get_name())
4310 t2_name = locale.strxfrm(t2.get_name())
4311 if not t1_sp and not t2_sp:
4312- return cmp(t1_name, t2_name)
4313+ return (t1_name > t2_name) - (t1_name < t2_name)
4314 elif not t1_sp and t2_sp:
4315 return 1
4316 elif t1_sp and not t2_sp:
4317@@ -242,7 +244,7 @@
4318 else:
4319 t1_order = t1.get_attribute("order")
4320 t2_order = t2.get_attribute("order")
4321- return cmp(t1_order, t2_order)
4322+ return (t1_order > t2_order) - (t1_order < t2_order)
4323
4324 def ontag_task_dnd(self, source, target):
4325 task = self.req.get_task(source)
4326@@ -262,7 +264,7 @@
4327 # Tag id
4328 col_name = 'tag_id'
4329 col = {}
4330- col['renderer'] = ['markup', gtk.CellRendererText()]
4331+ col['renderer'] = ['markup', Gtk.CellRendererText()]
4332 col['value'] = [str, lambda node: node.get_id()]
4333 col['visible'] = False
4334 col['order'] = 0
4335@@ -276,7 +278,7 @@
4336 render_tags.set_property('ypad', 3)
4337 col['title'] = _("Tags")
4338 col['renderer'] = ['tag', render_tags]
4339- col['value'] = [gobject.TYPE_PYOBJECT, lambda node: node]
4340+ col['value'] = [GObject.TYPE_PYOBJECT, lambda node: node]
4341 col['expandable'] = False
4342 col['resizable'] = False
4343 col['order'] = 1
4344@@ -285,7 +287,7 @@
4345 # Tag names
4346 col_name = 'tagname'
4347 col = {}
4348- render_text = gtk.CellRendererText()
4349+ render_text = Gtk.CellRendererText()
4350 render_text.set_property('ypad', 3)
4351 col['renderer'] = ['markup', render_text]
4352 col['value'] = [str, self.tag_name]
4353@@ -297,7 +299,7 @@
4354 # Tag count
4355 col_name = 'tagcount'
4356 col = {}
4357- render_text = gtk.CellRendererText()
4358+ render_text = Gtk.CellRendererText()
4359 render_text.set_property('xpad', 3)
4360 render_text.set_property('ypad', 3)
4361 render_text.set_property('xalign', 1.0)
4362@@ -369,7 +371,7 @@
4363 # invisible 'task_id' column
4364 col_name = 'task_id'
4365 col = {}
4366- col['renderer'] = ['markup', gtk.CellRendererText()]
4367+ col['renderer'] = ['markup', Gtk.CellRendererText()]
4368 col['value'] = [str, lambda node: node.get_id()]
4369 col['visible'] = False
4370 col['order'] = 0
4371@@ -385,8 +387,8 @@
4372 # invisible 'title' column
4373 col_name = 'title'
4374 col = {}
4375- render_text = gtk.CellRendererText()
4376- render_text.set_property("ellipsize", pango.ELLIPSIZE_END)
4377+ render_text = Gtk.CellRendererText()
4378+ render_text.set_property("ellipsize", Pango.EllipsizeMode.END)
4379 col['renderer'] = ['markup', render_text]
4380 col['value'] = [str, self.task_title_column]
4381 col['visible'] = False
4382@@ -400,7 +402,7 @@
4383 render_tags = CellRendererTags()
4384 render_tags.set_property('xalign', 0.0)
4385 col['renderer'] = ['tag_list', render_tags]
4386- col['value'] = [gobject.TYPE_PYOBJECT, self.task_tags_column]
4387+ col['value'] = [GObject.TYPE_PYOBJECT, self.task_tags_column]
4388 col['expandable'] = False
4389 col['resizable'] = False
4390 col['order'] = 1
4391@@ -410,8 +412,8 @@
4392 col_name = 'label'
4393 col = {}
4394 col['title'] = _("Title")
4395- render_text = gtk.CellRendererText()
4396- render_text.set_property("ellipsize", pango.ELLIPSIZE_END)
4397+ render_text = Gtk.CellRendererText()
4398+ render_text.set_property("ellipsize", Pango.EllipsizeMode.END)
4399 col['renderer'] = ['markup', render_text]
4400 col['value'] = [str, self.task_label_column]
4401 col['expandable'] = True
4402@@ -434,8 +436,10 @@
4403 treeview.set_rules_hint(False)
4404 treeview.set_multiple_selection(True)
4405 # Updating the unactive color (same for everyone)
4406- self.unactive_color = \
4407- treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
4408+ color = treeview.get_style_context().get_color(
4409+ Gtk.StateFlags.INSENSITIVE)
4410+ # Convert color into #RRRGGGBBB
4411+ self.unactive_color = color.to_color().to_string()
4412 return treeview
4413
4414 def build_tag_treeview(self, tree, desc):
4415@@ -448,8 +452,11 @@
4416 treeview.set_dnd_name('gtg/tag-iter-str')
4417 treeview.set_dnd_external('gtg/task-iter-str', self.ontag_task_dnd)
4418 # Updating the unactive color (same for everyone)
4419- self.unactive_color = \
4420- treeview.style.text[gtk.STATE_INSENSITIVE].to_string()
4421+ color = treeview.get_style_context().get_color(
4422+ Gtk.StateFlags.INSENSITIVE)
4423+ # Convert color into #RRRGGGBBB
4424+ self.unactive_color = color.to_color().to_string()
4425+
4426 treeview.set_sort_column('tag_id')
4427 self.tags_view = treeview
4428 return treeview
4429
4430=== modified file 'GTG/gtk/colors.py'
4431--- GTG/gtk/colors.py 2013-11-23 14:40:23 +0000
4432+++ GTG/gtk/colors.py 2014-01-12 07:15:48 +0000
4433@@ -17,7 +17,8 @@
4434 # this program. If not, see <http://www.gnu.org/licenses/>.
4435 # -----------------------------------------------------------------------------
4436
4437-import gtk
4438+from gi.repository import Gdk
4439+from functools import reduce
4440
4441 # Take list of Tags and give the background color that should be applied
4442 # The returned color might be None (in which case, the default is used)
4443@@ -25,7 +26,7 @@
4444
4445 def background_color(tags, bgcolor=None):
4446 if not bgcolor:
4447- bgcolor = gtk.gdk.color_parse("#FFFFFF")
4448+ bgcolor = Gdk.color_parse("#FFFFFF")
4449 # Compute color
4450 my_color = None
4451 color_count = 0.0
4452@@ -35,7 +36,7 @@
4453 for my_tag in tags:
4454 my_color_str = my_tag.get_attribute("color")
4455 if my_color_str:
4456- my_color = gtk.gdk.color_parse(my_color_str)
4457+ my_color = Gdk.color_parse(my_color_str)
4458 color_count = color_count + 1
4459 red = red + my_color.red
4460 green = green + my_color.green
4461@@ -52,7 +53,7 @@
4462 green = int(green * alpha + bgcolor.green * (1 - alpha))
4463 blue = int(blue * alpha + bgcolor.blue * (1 - alpha))
4464
4465- my_color = gtk.gdk.Color(red, green, blue).to_string()
4466+ my_color = Gdk.Color(red, green, blue).to_string()
4467 return my_color
4468
4469
4470@@ -82,9 +83,11 @@
4471 '''
4472 Calls get_colored_tag_markup for each tag_name in tag_names
4473 '''
4474- tag_markups = map(lambda t: get_colored_tag_markup(req, t), tag_names)
4475+ tag_markups = [get_colored_tag_markup(req, t) for t in tag_names]
4476 tags_txt = ""
4477 if tag_markups:
4478 # reduce crashes if applied to an empty list
4479 tags_txt = reduce(lambda a, b: a + ", " + b, tag_markups)
4480 return tags_txt
4481+
4482+# -----------------------------------------------------------------------------
4483
4484=== modified file 'GTG/gtk/crashhandler.py'
4485--- GTG/gtk/crashhandler.py 2013-02-25 07:35:07 +0000
4486+++ GTG/gtk/crashhandler.py 2014-01-12 07:15:48 +0000
4487@@ -1,4 +1,4 @@
4488-#!/usr/bin/env python2
4489+#!/usr/bin/env python3
4490 # Copyright 2010 David D. Lowe
4491 # All rights reserved.
4492 #
4493@@ -23,9 +23,9 @@
4494
4495 """GTK except hook for your applications.
4496 To use, simply import this module and call gtkcrashhandler.initialize().
4497-Import this module before calling gtk.main().
4498+Import this module before calling Gtk.main().
4499
4500-If gtkcrashhandler cannot import gtk, pygtk, pango or gobject,
4501+If gtkcrashhandler cannot import Gtk, Pango or GObject,
4502 gtkcrashhandler will print a warning and use the default excepthook.
4503
4504 If you're using multiple threads, use gtkcrashhandler_thread decorator."""
4505@@ -34,24 +34,22 @@
4506 import os
4507 import time
4508 import signal
4509+import traceback
4510+import threading
4511 from contextlib import contextmanager
4512
4513 from GTG import info
4514
4515
4516 try:
4517- import pygtk
4518- pygtk.require("2.0") # not tested on earlier versions
4519- import gtk
4520- import pango
4521- import gobject
4522- _gtk_initialized = True
4523+ from gi.repository import GObject, Gtk, Pango
4524 except Exception:
4525- print >> sys.stderr, "gtkcrashhandler could not load GTK 2.0"
4526+ print("gtkcrashhandler could not load GTK 3.0", file=sys.stderr)
4527 _gtk_initialized = False
4528-import traceback
4529+else:
4530+ _gtk_initialized = True
4531+
4532 from gettext import gettext as _
4533-import threading
4534
4535 APP_NAME = None
4536 MESSAGE = _("We're terribly sorry. Could you help us fix the problem by "
4537@@ -99,7 +97,7 @@
4538 if thread:
4539 if not isinstance(thread, threading._MainThread):
4540 tb = "Exception in thread %s:\n%s" % (thread.getName(), tb)
4541- print >> sys.stderr, tb
4542+ print(tb, file=sys.stderr)
4543
4544 # determine whether to add a "Report problem..." button
4545 add_apport_button = False
4546@@ -109,7 +107,7 @@
4547 try:
4548 from apport.fileutils import likely_packaged
4549 try:
4550- filename = os.path.realpath(os.path.join(os.getcwdu(),
4551+ filename = os.path.realpath(os.path.join(os.getcwd(),
4552 sys.argv[0]))
4553 except:
4554 filename = os.path.realpath("/proc/%i/exe" % os.getpid())
4555@@ -176,17 +174,17 @@
4556 if dialog is not None:
4557 return 1
4558
4559- dialog = gtk.Dialog(title)
4560+ dialog = Gtk.Dialog(title)
4561
4562 # title Label
4563- label = gtk.Label()
4564+ label = Gtk.Label()
4565 label.set_markup("<b>%s</b>" % _("It looks like an error has occurred."))
4566 label.set_alignment(0, 0.5)
4567- dialog.get_content_area().pack_start(label, False)
4568+ dialog.get_content_area().pack_start(label, False, True, 0)
4569
4570 # message Label
4571 global MESSAGE
4572- text_label = gtk.Label()
4573+ text_label = Gtk.Label()
4574 text_label.set_markup(MESSAGE)
4575 text_label.set_alignment(0, 0.5)
4576 text_label.set_line_wrap(True)
4577@@ -197,36 +195,36 @@
4578
4579 text_label.connect("size-allocate", text_label_size_allocate)
4580 if not MESSAGE == "":
4581- dialog.get_content_area().pack_start(text_label, False)
4582+ dialog.get_content_area().pack_start(text_label, False, True, 0)
4583
4584 # TextView with error_string
4585- buffer = gtk.TextBuffer()
4586+ buffer = Gtk.TextBuffer()
4587 buffer.set_text(error_string)
4588- textview = gtk.TextView()
4589+ textview = Gtk.TextView()
4590 textview.set_buffer(buffer)
4591 textview.set_editable(False)
4592 try:
4593- textview.modify_font(pango.FontDescription("monospace 8"))
4594+ textview.override_font(Pango.FontDescription("monospace 8"))
4595 except Exception:
4596- print >> sys.stderr, "gtkcrashhandler: modify_font raised an exception"
4597+ print("gtkcrashhandler: override_font raised an exception", file=sys.stderr)
4598
4599 # allow scrolling of textview
4600- scrolled = gtk.ScrolledWindow()
4601- scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
4602+ scrolled = Gtk.ScrolledWindow()
4603+ scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
4604 scrolled.add_with_viewport(textview)
4605
4606 # hide the textview in an Expander widget
4607- expander = gtk.expander_new_with_mnemonic(_("_Details"))
4608+ expander = Gtk.expander_new_with_mnemonic(_("_Details"))
4609 expander.add(scrolled)
4610 expander.connect('activate', on_expanded)
4611- dialog.get_content_area().pack_start(expander, True)
4612+ dialog.get_content_area().pack_start(expander, True, True, 0)
4613
4614 # add buttons
4615 if add_apport_button:
4616 dialog.add_button(_("_Report this problem..."), 3)
4617 # If we're have multiple threads, or if we're in a GTK callback,
4618 # execution can continue normally in other threads, so add button
4619- if gtk.main_level() > 0 or threading.activeCount() > 1:
4620+ if Gtk.main_level() > 0 or threading.activeCount() > 1:
4621 dialog.add_button(_("_Ignore the error"), 1)
4622 dialog.add_button(("_Close the program"), 2)
4623 dialog.set_default_response(2)
4624@@ -275,28 +273,28 @@
4625 def gtkcrashhandler_wrapped_run(*args, **kwargs):
4626 try:
4627 run(*args, **kwargs)
4628- except Exception, ee:
4629+ except Exception as ee:
4630 lock = threading.Lock()
4631 lock.acquire()
4632 tb = sys.exc_info()[2]
4633- if gtk.main_level() > 0:
4634- gobject.idle_add(
4635+ if Gtk.main_level() > 0:
4636+ GObject.idle_add(
4637 lambda ee=ee, tb=tb, thread=threading.currentThread():
4638 _replacement_excepthook(ee.__class__, ee, tb,
4639 thread=thread))
4640 else:
4641 time.sleep(0.1) # ugly hack, seems like threads that are
4642- # started before running gtk.main() cause
4643+ # started before running Gtk.main() cause
4644 # this one to crash.
4645- # This delay allows gtk.main() to initialize
4646+ # This delay allows Gtk.main() to initialize
4647 # properly.
4648- # My advice: run gtk.main() before starting
4649- # any threads or don't run gtk.main() at all
4650+ # My advice: run Gtk.main() before starting
4651+ # any threads or don't run Gtk.main() at all
4652 _replacement_excepthook(ee.__class__, ee, tb,
4653 thread=threading.currentThread())
4654 lock.release()
4655
4656- # return wrapped run if gtkcrashhandler has been initialized
4657+ # return wrapped run if Gtkcrashhandler has been initialized
4658 global _gtk_initialized, _old_sys_excepthook
4659 if _gtk_initialized and _old_sys_excepthook:
4660 return gtkcrashhandler_wrapped_run
4661@@ -307,7 +305,7 @@
4662 # throw test exception
4663 initialize(app_name="gtkcrashhandler", message="Don't worry, though. This "
4664 "is just a test. To use the code properly, call "
4665- "gtkcrashhandler.initialize() in your PyGTK app to "
4666+ "gtkcrashhandler.initialize() in your GTK app to "
4667 "automatically catch any Python exceptions like this.")
4668
4669 class DoNotRunException(Exception):
4670
4671=== modified file 'GTG/gtk/dbuswrapper.py'
4672--- GTG/gtk/dbuswrapper.py 2013-11-23 14:40:23 +0000
4673+++ GTG/gtk/dbuswrapper.py 2014-01-12 07:15:48 +0000
4674@@ -38,7 +38,7 @@
4675 so these need to be converted into blank values D-Bus accepts.
4676 @return: Cleaned up dictionary
4677 """
4678- for k, v in data.items():
4679+ for k, v in list(data.items()):
4680 # Manually specify an arbitrary content type for empty Python arrays
4681 # because D-Bus can't handle the type conversion for empty arrays
4682 if not v and isinstance(v, list):
4683
4684=== modified file 'GTG/gtk/delete_dialog.py'
4685--- GTG/gtk/delete_dialog.py 2013-11-23 14:40:23 +0000
4686+++ GTG/gtk/delete_dialog.py 2014-01-12 07:15:48 +0000
4687@@ -18,7 +18,7 @@
4688 # -----------------------------------------------------------------------------
4689
4690
4691-import gtk
4692+from gi.repository import Gtk
4693
4694 from GTG import _, ngettext
4695 from GTG.gtk import ViewConfig
4696@@ -34,8 +34,8 @@
4697 # Tags which must be updated
4698 self.update_tags = []
4699 # Load window tree
4700- self.builder = gtk.Builder()
4701- self.builder.add_from_file(ViewConfig.DELETE_GLADE_FILE)
4702+ self.builder = Gtk.Builder()
4703+ self.builder.add_from_file(ViewConfig.DELETE_UI_FILE)
4704 signals = {"on_delete_confirm": self.on_delete_confirm,
4705 "on_delete_cancel": lambda x: x.hide, }
4706 self.builder.connect_signals(signals)
4707
4708=== renamed file 'GTG/gtk/deletion.glade' => 'GTG/gtk/deletion.ui'
4709--- GTG/gtk/deletion.glade 2012-05-23 08:55:31 +0000
4710+++ GTG/gtk/deletion.ui 2014-01-12 07:15:48 +0000
4711@@ -1,6 +1,6 @@
4712 <?xml version="1.0" encoding="UTF-8"?>
4713 <interface>
4714- <requires lib="gtk+" version="2.16"/>
4715+ <!-- interface-requires gtk+ 3.0 -->
4716 <object class="GtkDialog" id="confirm_delete">
4717 <property name="can_focus">False</property>
4718 <property name="border_width">5</property>
4719@@ -28,7 +28,7 @@
4720 <property name="use_action_appearance">False</property>
4721 <signal name="released" handler="on_delete_cancel" swapped="no"/>
4722 <child>
4723- <object class="GtkHBox" id="cd-hbox2">
4724+ <object class="GtkBox" id="cd-box2">
4725 <property name="visible">True</property>
4726 <property name="can_focus">False</property>
4727 <child>
4728@@ -75,7 +75,7 @@
4729 <signal name="activate" handler="on_delete_confirm" swapped="no"/>
4730 <signal name="released" handler="on_delete_confirm" swapped="no"/>
4731 <child>
4732- <object class="GtkHBox" id="cd-hbox3">
4733+ <object class="GtkBox" id="cd-box3">
4734 <property name="visible">True</property>
4735 <property name="can_focus">False</property>
4736 <child>
4737@@ -120,7 +120,7 @@
4738 </packing>
4739 </child>
4740 <child>
4741- <object class="GtkHBox" id="cd-hbox1">
4742+ <object class="GtkBox" id="cd-box1">
4743 <property name="visible">True</property>
4744 <property name="can_focus">False</property>
4745 <child>
4746@@ -139,10 +139,11 @@
4747 </packing>
4748 </child>
4749 <child>
4750- <object class="GtkVBox" id="cd-vbox2">
4751+ <object class="GtkBox" id="cd-vbox2">
4752 <property name="visible">True</property>
4753 <property name="can_focus">False</property>
4754 <property name="spacing">16</property>
4755+ <property name="orientation">vertical</property>
4756 <child>
4757 <object class="GtkLabel" id="cd-label2">
4758 <property name="visible">True</property>
4759
4760=== modified file 'GTG/gtk/editor/__init__.py'
4761--- GTG/gtk/editor/__init__.py 2013-11-23 14:40:23 +0000
4762+++ GTG/gtk/editor/__init__.py 2014-01-12 07:15:48 +0000
4763@@ -26,7 +26,7 @@
4764
4765 class GnomeConfig:
4766 current_rep = os.path.dirname(os.path.abspath(__file__))
4767- GLADE_FILE = os.path.join(current_rep, "taskeditor.glade")
4768+ EDITOR_UI_FILE = os.path.join(current_rep, "taskeditor.ui")
4769
4770 MARK_DONE = _("Mark as Done")
4771 MARK_UNDONE = _("Mark as not Done")
4772
4773=== modified file 'GTG/gtk/editor/calendar.py'
4774--- GTG/gtk/editor/calendar.py 2013-11-23 14:40:23 +0000
4775+++ GTG/gtk/editor/calendar.py 2014-01-12 07:15:48 +0000
4776@@ -19,31 +19,29 @@
4777
4778 import datetime
4779
4780-import gobject
4781-import gtk
4782-from gtk import gdk
4783+from gi.repository import GObject, Gdk
4784
4785 from GTG.tools.dates import Date
4786
4787
4788-class GTGCalendar(gobject.GObject):
4789- """ Wrapper around gtk.Calendar object """
4790+class GTGCalendar(GObject.GObject):
4791+ """ Wrapper around Gtk.Calendar object """
4792
4793 # CONSTANTS
4794 DATE_KIND_DUE = "due"
4795 DATE_KIND_START = "start"
4796 DATE_KIND_CLOSED = "closed"
4797
4798- # Gobject signal description
4799- __signal_type__ = (gobject.SIGNAL_RUN_FIRST,
4800- gobject.TYPE_NONE,
4801+ #Gobject signal description
4802+ __signal_type__ = (GObject.SignalFlags.RUN_FIRST,
4803+ None,
4804 [])
4805
4806 __gsignals__ = {'date-changed': __signal_type__, }
4807
4808- def __init__(self, gtk_builder):
4809+ def __init__(self, Gtk_builder):
4810 super(GTGCalendar, self).__init__()
4811- self.__builder = gtk_builder
4812+ self.__builder = Gtk_builder
4813 self.__date_kind = None
4814 self.__date = Date.no_date()
4815 self.__init_gtk__()
4816@@ -106,13 +104,13 @@
4817 else:
4818 # If marked day is 31th, and the next month does not have 31th day,
4819 # unmark_day raises a warning. Clear_marks() is clever way how
4820- # to let PyGTK solve it's bussiness.
4821+ # to let GTK solve it's bussiness.
4822 self.__calendar.clear_marks()
4823
4824 def move_calendar_inside(self, width, height, x, y):
4825 """ This method moves the calender inside the screen whenever part of
4826 it is displayed outside the screen """
4827- screen_width = gtk.gdk.screen_width()
4828+ screen_width = Gdk.Screen.width()
4829 # To display calendar inside the screen when editor window is
4830 # outside leftside of the screen
4831 if x < width:
4832@@ -132,32 +130,49 @@
4833 # ones? question by invernizzi)
4834 self.move_calendar_inside(width, height, x, y)
4835 self.__window.grab_add()
4836- # We grab the pointer in the calendar
4837- gdk.pointer_grab(self.__window.window, True,
4838- gdk.BUTTON1_MASK | gdk.MOD2_MASK)
4839+
4840+ #We grab the pointer in the calendar
4841+ #Gdk.pointer_grab(
4842+ #self.__window.get_window(),
4843+ #True,
4844+ #Gdk.ModifierType.BUTTON1_MASK | Gdk.ModifierType.MOD2_MASK
4845+ #)
4846+#FIXME THIS DOES NOT WORK!!!!!!!
4847+ Gdk.pointer_grab(
4848+ self.get_window(),
4849+ True,
4850+ #Gdk.ModifierType.BUTTON1_MASK | Gdk.ModifierType.MOD2_MASK,
4851+#FIXME!!!! JUST GUESSING THE TYPE
4852+ Gdk.EventMask.ALL_EVENTS_MASK,
4853+ None,
4854+ None,
4855+ 0,
4856+ )
4857+
4858 self.__window.connect('button-press-event', self.__focus_out)
4859 self.__sigid = self.__calendar.connect("day-selected",
4860 self.__day_selected,
4861- "RealDate")
4862+ "RealDate",)
4863+
4864 self.__sigid_month = self.__calendar.connect("month-changed",
4865 self.__month_changed)
4866- # Problem: gtk.Calendar does not tell you directly if the
4867- # "day-selected" signal was caused by the user clicking on
4868- # a date, or just browsing the calendar.
4869+ # Problem: Gtk.Calendar does not tell you directly if the
4870+ # "day-selected" signal was caused by the user clicking on
4871+ # a date, or just browsing the calendar.
4872 # Solution: we track that in a variable
4873 self.__is_user_just_browsing_the_calendar = False
4874 self.__mark_today_in_bold()
4875
4876 def __focus_out(self, w=None, e=None):
4877 # We should only close if the pointer click is out of the calendar !
4878- p = self.__window.window.get_pointer()
4879+ p = self.__window.get_window().get_pointer()
4880 s = self.__window.get_size()
4881 if not(0 <= p[0] <= s[0] and 0 <= p[1] <= s[1]):
4882 self.close_calendar()
4883
4884 def close_calendar(self, widget=None, e=None):
4885 self.__window.hide()
4886- gtk.gdk.pointer_ungrab()
4887+ Gdk.pointer_ungrab(0)
4888 self.__window.grab_remove()
4889 if self.__sigid is not None:
4890 self.__calendar.disconnect(self.__sigid)
4891@@ -181,11 +196,11 @@
4892 else:
4893 # inform the Editor that the date has changed
4894 self.close_calendar()
4895- gobject.idle_add(self.emit, "date-changed")
4896+ GObject.idle_add(self.emit, "date-changed")
4897
4898 def __from_calendar_date_to_datetime(self, calendar_date):
4899 '''
4900- gtk.Calendar uses a 0-based convention for counting months.
4901+ Gtk.Calendar uses a 0-based convention for counting months.
4902 The rest of the world, including the datetime module, starts from 1.
4903 This is a converter between the two. GTG follows the datetime
4904 convention.
4905
4906=== modified file 'GTG/gtk/editor/editor.py'
4907--- GTG/gtk/editor/editor.py 2013-11-23 14:40:23 +0000
4908+++ GTG/gtk/editor/editor.py 2014-01-12 07:15:48 +0000
4909@@ -25,8 +25,7 @@
4910 """
4911 import time
4912
4913-import pango
4914-import gtk
4915+from gi.repository import Gtk, Gdk, Pango
4916
4917 from GTG import _, ngettext
4918 from GTG.gtk.editor import GnomeConfig
4919@@ -38,7 +37,7 @@
4920 from GTG.gtk.editor.calendar import GTGCalendar
4921
4922
4923-class TaskEditor:
4924+class TaskEditor(object):
4925
4926 def __init__(self,
4927 requester,
4928@@ -59,8 +58,8 @@
4929 self.config = taskconfig
4930 self.time = None
4931 self.clipboard = clipboard
4932- self.builder = gtk.Builder()
4933- self.builder.add_from_file(GnomeConfig.GLADE_FILE)
4934+ self.builder = Gtk.Builder()
4935+ self.builder.add_from_file(GnomeConfig.EDITOR_UI_FILE)
4936 self.donebutton = self.builder.get_object("mark_as_done_editor")
4937 self.dismissbutton = self.builder.get_object("dismiss_editor")
4938 self.deletebutton = self.builder.get_object("delete_editor")
4939@@ -75,25 +74,25 @@
4940 "mark_as_done_clicked": self.change_status,
4941 "on_dismiss": self.dismiss,
4942 "delete_clicked": self.delete_task,
4943- "on_duedate_pressed": (self.on_date_pressed,
4944- GTGCalendar.DATE_KIND_DUE),
4945- "on_startdate_pressed": (self.on_date_pressed,
4946- GTGCalendar.DATE_KIND_START),
4947- "on_closeddate_pressed": (self.on_date_pressed,
4948- GTGCalendar.DATE_KIND_CLOSED),
4949+ "on_duedate_pressed": lambda w: self.on_date_pressed(
4950+ w, GTGCalendar.DATE_KIND_DUE),
4951+ "on_startdate_pressed": lambda w: self.on_date_pressed(
4952+ w, GTGCalendar.DATE_KIND_START),
4953+ "on_closeddate_pressed": lambda w: self.on_date_pressed(
4954+ w, GTGCalendar.DATE_KIND_CLOSED),
4955 "close_clicked": self.close,
4956- "duedate_changed": (self.date_changed,
4957- GTGCalendar.DATE_KIND_DUE),
4958- "duedate_focus_out": (self.date_focus_out,
4959- GTGCalendar.DATE_KIND_DUE),
4960- "startingdate_changed": (self.date_changed,
4961- GTGCalendar.DATE_KIND_START),
4962- "startdate_focus_out": (self.date_focus_out,
4963- GTGCalendar.DATE_KIND_START),
4964- "closeddate_changed": (self.date_changed,
4965- GTGCalendar.DATE_KIND_CLOSED),
4966- "closeddate_focus_out": (self.date_focus_out,
4967- GTGCalendar.DATE_KIND_CLOSED),
4968+ "duedate_changed": lambda w: self.date_changed(
4969+ w, GTGCalendar.DATE_KIND_DUE),
4970+ "duedate_focus_out": lambda w, e: self.date_focus_out(
4971+ w, e, GTGCalendar.DATE_KIND_DUE),
4972+ "startingdate_changed": lambda w: self.date_changed(
4973+ w, GTGCalendar.DATE_KIND_START),
4974+ "startdate_focus_out": lambda w, e: self.date_focus_out(
4975+ w, e, GTGCalendar.DATE_KIND_START),
4976+ "closeddate_changed": lambda w: self.date_changed(
4977+ w, GTGCalendar.DATE_KIND_CLOSED),
4978+ "closeddate_focus_out": lambda w, e: self.date_focus_out(
4979+ w, e, GTGCalendar.DATE_KIND_CLOSED),
4980 "on_insert_subtask_clicked": self.insert_subtask,
4981 "on_inserttag_clicked": self.inserttag_clicked,
4982 "on_move": self.on_move,
4983@@ -115,7 +114,7 @@
4984 scrolled.add(self.textview)
4985 conf_font_value = self.browser_config.get("font_name")
4986 if conf_font_value != "":
4987- self.textview.modify_font(pango.FontDescription(conf_font_value))
4988+ self.textview.override_font(Pango.FontDescription(conf_font_value))
4989 # Voila! it's done
4990 self.calendar = GTGCalendar(self.builder)
4991 self.duedate_widget = self.builder.get_object("duedate_entry")
4992@@ -189,38 +188,38 @@
4993 # Define accelerator-keys for this dialog
4994 # TODO: undo/redo
4995 def init_accelerators(self):
4996- agr = gtk.AccelGroup()
4997+ agr = Gtk.AccelGroup()
4998 self.window.add_accel_group(agr)
4999
5000 # Escape and Ctrl-W close the dialog. It's faster to call close
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: