Merge lp:~and471/activity-log-manager/ui-tweaks into lp:activity-log-manager/0.8
- ui-tweaks
- Merge into trunk
Proposed by
Andrew
Status: | Merged |
---|---|
Approved by: | Seif Lotfy |
Approved revision: | 41 |
Merged at revision: | 43 |
Proposed branch: | lp:~and471/activity-log-manager/ui-tweaks |
Merge into: | lp:activity-log-manager/0.8 |
Diff against target: |
545 lines (+152/-141) 1 file modified
src/window.py (+152/-141) |
To merge this branch: | bzr merge lp:~and471/activity-log-manager/ui-tweaks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Siegfried Gevatter | Approve | ||
Review via email: mp+61427@code.launchpad.net |
Commit message
Description of the change
Just some small tweaks of the UI, I tried to make better use of the space available and just some small fixes.
Results can be seen here http://
To post a comment you must log in.
Revision history for this message
Seif Lotfy (seif) wrote : | # |
Revision history for this message
Siegfried Gevatter (rainct) wrote : | # |
Awesome, thanks!
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/window.py' |
2 | --- src/window.py 2011-05-17 17:29:23 +0000 |
3 | +++ src/window.py 2011-05-18 15:29:23 +0000 |
4 | @@ -25,6 +25,7 @@ |
5 | import pango |
6 | import logging |
7 | import time |
8 | +import glib |
9 | |
10 | from datetime import date |
11 | |
12 | @@ -45,13 +46,13 @@ |
13 | self.is_incognito = self.zg.get_incognito() |
14 | self.incognito_disabled_text = _("Logging stopped") |
15 | self.incognito_enabled_text = _("Logging active") |
16 | - self.set_border_width(6) |
17 | + self.set_border_width(12) |
18 | self._set_up_ui() |
19 | self.show_all() |
20 | |
21 | def _set_up_ui(self): |
22 | self.set_title(_("Activity Log Manager")) |
23 | - self.set_default_size(600, 400) |
24 | + self.set_default_size(500, 400) |
25 | self.set_position(gtk.WIN_POS_CENTER_ALWAYS) |
26 | |
27 | self._notebook = gtk.Notebook() |
28 | @@ -62,9 +63,9 @@ |
29 | self._set_up_file_tab() |
30 | |
31 | self.pix_indicator_disabled = gtk.image_new_from_stock(gtk.STOCK_NO, |
32 | - gtk.ICON_SIZE_LARGE_TOOLBAR) |
33 | + gtk.ICON_SIZE_MENU) |
34 | self.pix_indicator_enabled = gtk.image_new_from_stock(gtk.STOCK_YES, |
35 | - gtk.ICON_SIZE_LARGE_TOOLBAR) |
36 | + gtk.ICON_SIZE_MENU) |
37 | |
38 | self.incognito_bar = IncognitoBar() |
39 | if not self.zg.get_incognito(): |
40 | @@ -78,7 +79,7 @@ |
41 | |
42 | self.incognito_bar.connect('clicked', self._on_incognito_toggled) |
43 | |
44 | - general_vbox = gtk.VBox(False) |
45 | + general_vbox = gtk.VBox(False, 6) |
46 | hbox = gtk.HBox() |
47 | hbox.pack_end(self.incognito_bar, False, False) |
48 | general_vbox.pack_end(hbox, False, False) |
49 | @@ -134,19 +135,23 @@ |
50 | |
51 | |
52 | def __init__(self): |
53 | - gtk.VBox.__init__(self, spacing=4) |
54 | + gtk.VBox.__init__(self, spacing=12) |
55 | self.zg = ZG |
56 | self._set_up_ui() |
57 | |
58 | def _set_up_ui(self): |
59 | - self.set_border_width(10) |
60 | + self.set_border_width(12) |
61 | + |
62 | + recent_past_records_vbox = gtk.VBox(False, 6) |
63 | + self.pack_start(recent_past_records_vbox, False, False) |
64 | + |
65 | label = gtk.Label() |
66 | - label.set_markup("<b>%s</b>" % _("Forget my activities for the last...")) |
67 | + label.set_markup("<b>%s</b>" % _("Forget my activities for the last:")) |
68 | label.set_alignment(0.0, 0.5) |
69 | - self.pack_start(label, False, False, 6) |
70 | + recent_past_records_vbox.pack_start(label, False, False) |
71 | |
72 | - self._past_records_box = gtk.HBox(False, 6) |
73 | - self.pack_start(self._past_records_box, False, False, 6) |
74 | + recent_past_records_hbox = gtk.HBox(False, 6) |
75 | + recent_past_records_vbox.pack_start(recent_past_records_hbox, False, False) |
76 | |
77 | self._combo_box = gtk.combo_box_new_text() |
78 | temp_records = self._past_records.keys() |
79 | @@ -155,30 +160,34 @@ |
80 | self._combo_box.append_text(self._past_records[record]) |
81 | self._combo_box.set_active(0) |
82 | |
83 | - self.clear_button = gtk.Button(stock=gtk.STOCK_DELETE) |
84 | + self.clear_button = gtk.Button(label=_("Forget")) |
85 | self.clear_button.connect("clicked", self._on_clear_button_clicked) |
86 | - self._past_records_box.pack_start(self._combo_box, False) |
87 | - self._past_records_box.pack_start(self.clear_button, False) |
88 | - |
89 | - separator = gtk.HSeparator() |
90 | - self.pack_start(separator, False, True) |
91 | + hbuttonbox = gtk.HButtonBox() |
92 | + hbuttonbox.pack_start(self.clear_button, False, False); |
93 | + |
94 | + recent_past_records_hbox.pack_start(self._combo_box, False) |
95 | + recent_past_records_hbox.pack_start(hbuttonbox, False) |
96 | + |
97 | + old_past_records_vbox = gtk.VBox(False, 6) |
98 | + self.pack_start(old_past_records_vbox, False, False) |
99 | |
100 | label = gtk.Label() |
101 | label.set_markup("<b>%s</b>" % \ |
102 | _("Forget my activities in the following timerange:")) |
103 | label.set_alignment(0.0, 0.5) |
104 | - self.pack_start(label, False, False, 6) |
105 | - |
106 | - markup = '<span size="smaller" font-weight="bold" >%s</span>' |
107 | + old_past_records_vbox.pack_start(label, False, False, 6) |
108 | + |
109 | + old_past_records_hbox = gtk.HBox(False, 12) |
110 | + old_past_records_vbox.pack_start(old_past_records_hbox, False, False) |
111 | + |
112 | from_label = gtk.Label() |
113 | - from_label.set_markup(markup % _("From:")) |
114 | - from_label.set_alignment(0.0, 0.5) |
115 | + from_label.set_markup(_("From:")) |
116 | + from_label.set_alignment(1, 0.5) |
117 | to_label = gtk.Label() |
118 | - to_label.set_markup(markup % _("To:")) |
119 | - to_label.set_alignment(0.0, 0.5) |
120 | + to_label.set_markup(_("To:")) |
121 | + to_label.set_alignment(1, 0.5) |
122 | |
123 | self.from_entry = gtk.Entry() |
124 | - self.from_entry.set_width_chars(30) |
125 | self.from_button = gtk.Button() |
126 | arrow = gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_IN) |
127 | self.from_button.add(arrow) |
128 | @@ -187,7 +196,6 @@ |
129 | self.from_button.connect("clicked", self.show_calendar, 0) |
130 | |
131 | self.to_entry = gtk.Entry() |
132 | - self.to_entry.set_width_chars(30) |
133 | self.to_button = gtk.Button() |
134 | arrow = gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_IN) |
135 | self.to_button.add(arrow) |
136 | @@ -195,35 +203,37 @@ |
137 | self.to_entry.set_editable(False) |
138 | self.to_button.connect("clicked", self.show_calendar, 1) |
139 | |
140 | - hbox = gtk.HBox(False) |
141 | - hbox.pack_start(self.from_entry, False) |
142 | - hbox.pack_start(self.from_button, False) |
143 | - vbox_from = gtk.VBox(False, 5) |
144 | - vbox_from.pack_start(from_label, False) |
145 | - vbox_from.pack_start(hbox, False) |
146 | - |
147 | - hbox = gtk.HBox(False) |
148 | - hbox.pack_start(self.to_entry, False) |
149 | - hbox.pack_start(self.to_button, False) |
150 | - vbox_to = gtk.VBox(False, 5) |
151 | - vbox_to.pack_start(to_label, False) |
152 | - vbox_to.pack_end(hbox, False) |
153 | - |
154 | - self.clear_button2 = gtk.Button(stock=gtk.STOCK_DELETE) |
155 | + old_past_records_table = gtk.Table(2, 3, False); |
156 | + old_past_records_table.set_row_spacings(6); |
157 | + old_past_records_table.attach(from_label, 0, 1, 0, 1, xpadding=6) |
158 | + old_past_records_table.attach(self.from_entry, 1, 2, 0, 1) |
159 | + old_past_records_table.attach(self.from_button, 2, 3, 0, 1) |
160 | + old_past_records_table.attach(to_label, 0, 1, 1, 2, xpadding=6) |
161 | + old_past_records_table.attach(self.to_entry, 1, 2, 1, 2) |
162 | + old_past_records_table.attach(self.to_button, 2, 3, 1, 2) |
163 | + |
164 | + self.clear_button2 = gtk.Button(label=_("Forget")) |
165 | self.clear_button2.connect("clicked", self._on_clear_button2_clicked) |
166 | self.clear_button2.set_sensitive(False) |
167 | - align = gtk.Alignment(xalign=0.0) |
168 | - align.add(self.clear_button2) |
169 | + |
170 | + hbuttonbox2 = gtk.HButtonBox() |
171 | + hbuttonbox2.pack_start(self.clear_button2, False, False); |
172 | + align = gtk.Alignment(yalign=0.5) |
173 | + align.add(hbuttonbox2) |
174 | |
175 | self._error_label = gtk.Label() |
176 | |
177 | - hbox_delete = gtk.HBox(False, 4) |
178 | + hbox_delete = gtk.HBox(False, 6) |
179 | hbox_delete.pack_start(align, False) |
180 | hbox_delete.pack_start(self._error_label, False, padding=10) |
181 | |
182 | - self.pack_start(vbox_from, False) |
183 | - self.pack_start(vbox_to, False) |
184 | - self.pack_start(hbox_delete, False, padding=10) |
185 | + calendar_sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_VERTICAL); |
186 | + for widget in [self.to_entry, self.to_button, |
187 | + self.from_entry, self.from_button]: |
188 | + calendar_sizegroup.add_widget(widget); |
189 | + |
190 | + old_past_records_hbox.pack_start(old_past_records_table, False) |
191 | + old_past_records_hbox.pack_start(hbox_delete, False) |
192 | |
193 | #used for discriminate if the user is choosing the from or to date entry |
194 | self._n_current_entry = -1 |
195 | @@ -341,38 +351,36 @@ |
196 | class ApplicationsTab(gtk.VBox): |
197 | |
198 | def __init__(self): |
199 | - gtk.VBox.__init__(self, spacing=10) |
200 | + gtk.VBox.__init__(self, spacing=6) |
201 | self.app_chooser_dialog = ApplicationsChooserDialog() |
202 | self.zg = ZG |
203 | self._set_up_ui() |
204 | self.buttons = {} |
205 | |
206 | def _set_up_ui(self): |
207 | - self.set_border_width(10) |
208 | + self.set_border_width(12) |
209 | |
210 | self.treeview = _ApplicationsTreeView() |
211 | - button_box = gtk.VButtonBox() |
212 | + button_box = gtk.HButtonBox() |
213 | + button_box.set_spacing(6) |
214 | button_box.set_layout(gtk.BUTTONBOX_START) |
215 | |
216 | self.add_button = gtk.Button(stock=gtk.STOCK_ADD) |
217 | self.add_button.connect("clicked", self._on_add_application) |
218 | button_box.pack_start(self.add_button) |
219 | |
220 | - self.delete_button = gtk.Button(stock=gtk.STOCK_DELETE) |
221 | + self.delete_button = gtk.Button(stock=gtk.STOCK_REMOVE) |
222 | self.delete_button.connect("clicked", self._on_delete_application) |
223 | button_box.pack_start(self.delete_button) |
224 | |
225 | label = gtk.Label() |
226 | label.set_markup("<b>%s</b>" % \ |
227 | _("Do not log the activity of these applications:")) |
228 | - align = gtk.Alignment(xalign=0, yalign=1) |
229 | - align.add(label) |
230 | - self.pack_start(align, False) |
231 | + label.set_alignment(0, 0.5) |
232 | |
233 | - general_hbox = gtk.HBox(False, 5) |
234 | - general_hbox.pack_start(self.treeview) |
235 | - general_hbox.pack_start(button_box, False) |
236 | - self.pack_start(general_hbox) |
237 | + self.pack_start(label, False, False) |
238 | + self.pack_start(self.treeview, True, True) |
239 | + self.pack_start(button_box, False, False) |
240 | |
241 | self._applications = [t[4:] for t in self.zg.all_templates.iterkeys() \ |
242 | if t.startswith("app-")] |
243 | @@ -392,8 +400,8 @@ |
244 | if app is not None and not self.duplicate: |
245 | self.treeview.store.append(app) |
246 | e = Event() |
247 | - e.actor = "application://"+app[3] |
248 | - self.zg.add_blacklist_template("app-"+app[3], e) |
249 | + e.actor = "application://"+app[2] |
250 | + self.zg.add_blacklist_template("app-"+app[2], e) |
251 | |
252 | self.app_chooser_dialog.hide() |
253 | |
254 | @@ -419,7 +427,16 @@ |
255 | self.treeview.store.foreach(self._is_duplicate, app_name) |
256 | if app_info is not None and not self.duplicate: |
257 | pix = self.treeview._get_pixbuf_from_gio_icon(app_info.get_icon()) |
258 | - self.treeview.store.append([app_name, app_info.get_description(), pix, app_info.get_id()]) |
259 | + |
260 | + name = app_name |
261 | + description = app_info.get_description() |
262 | + |
263 | + if description == None: |
264 | + description = _("No description provided") |
265 | + |
266 | + markup = "<b>%s</b>\n%s" % (glib.markup_escape_text(name), |
267 | + glib.markup_escape_text(description)) |
268 | + self.treeview.store.append([markup, pix, app_info.get_id()]) |
269 | except RuntimeError: |
270 | log.warning(_("Failed to load %s") % app) |
271 | continue |
272 | @@ -455,21 +472,23 @@ |
273 | dirs_blacklist_dict = {} |
274 | |
275 | def __init__(self): |
276 | - gtk.VBox.__init__(self, spacing=10) |
277 | + gtk.VBox.__init__(self, spacing=12) |
278 | self.zg = ZG |
279 | self._set_up_ui() |
280 | |
281 | def _set_up_ui(self): |
282 | - self.set_border_width(10) |
283 | + self.set_border_width(12) |
284 | + |
285 | + vbox_file_types = gtk.VBox(False, 6) |
286 | + self.pack_start(vbox_file_types, False, False) |
287 | |
288 | label = gtk.Label() |
289 | label.set_markup("<b>%s</b>" % \ |
290 | _("Prevent logging for the following file types:")) |
291 | - align = gtk.Alignment(xalign=0, yalign=1) |
292 | - align.add(label) |
293 | - self.pack_start(align, False) |
294 | + label.set_alignment(0, 0.5) |
295 | + vbox_file_types.pack_start(label, False) |
296 | |
297 | - checkbox_table = gtk.Table(3,3) |
298 | + checkbox_table = gtk.Table(3, 3) |
299 | i = 0 |
300 | self.button_list = [] |
301 | for t in sorted(self.mime_dict.keys()): |
302 | @@ -477,33 +496,28 @@ |
303 | self.button_list.append(button) |
304 | if "interpretation-%s" % t.lower() in self.zg.all_templates: |
305 | button.set_active(True) |
306 | - button.connect("toggled", self._on_ckeckbox_toggled, t) |
307 | + button.connect("toggled", self._on_checkbox_toggled, t) |
308 | if i == 3: checkbox_table.attach(button, 0, 1, 1, 2) |
309 | elif i == 7: checkbox_table.attach(button, 1, 2, 2, 3) |
310 | else: checkbox_table.attach(button, i%3, (i%3) + 1 , i%4, (i%4) + 1) |
311 | i += 1 |
312 | |
313 | - self.pack_start(checkbox_table, False) |
314 | + vbox_file_types.pack_start(checkbox_table, False) |
315 | + |
316 | + vbox_folders = gtk.VBox(False, 6) |
317 | + self.pack_start(vbox_folders, True, True) |
318 | |
319 | label = gtk.Label() |
320 | label.set_markup("<b>%s</b>" % \ |
321 | _("Prevent logging files in the following folders:")) |
322 | - align = gtk.Alignment(xalign=0, yalign=1) |
323 | - align.add(label) |
324 | - self.pack_start(align, False) |
325 | - |
326 | - file_chooser_hbox = gtk.HBox(False, 5) |
327 | - file_chooser_dialog = gtk.FileChooserDialog( |
328 | - _("Select a directory to blacklist"), |
329 | - action = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, |
330 | - buttons = (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, |
331 | - gtk.RESPONSE_CANCEL)) |
332 | - self.file_chooser = gtk.FileChooserButton(file_chooser_dialog) |
333 | - file_chooser_hbox.pack_start(self.file_chooser, True) |
334 | - add_button = gtk.Button(stock=gtk.STOCK_ADD) |
335 | - add_button.connect("clicked", self._on_add_blacklist_dir) |
336 | - #file_chooser_hbox.pack_end(add_button, False) |
337 | - #self.pack_start(file_chooser_hbox, False) |
338 | + label.set_alignment(0, 0.5) |
339 | + vbox_folders.pack_start(label, False) |
340 | + |
341 | + file_chooser_vbox = gtk.VBox(False, 6) |
342 | + vbox_folders.pack_start(file_chooser_vbox, True, True) |
343 | + |
344 | + add_button = gtk.Button(label=_("Add...")) |
345 | + add_button.connect("clicked", self._on_add_button_clicked) |
346 | |
347 | #Store fields: |
348 | #1) Directory's Path |
349 | @@ -526,37 +540,25 @@ |
350 | scroll.add(self.treeview) |
351 | scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) |
352 | scroll.set_shadow_type(gtk.SHADOW_IN) |
353 | - scroll.set_border_width(1) |
354 | - |
355 | - hbox_other = gtk.HBox(False, 5) |
356 | - button_box = gtk.VButtonBox() |
357 | + |
358 | + file_chooser_vbox.pack_start(scroll, True, True) |
359 | + |
360 | + button_box = gtk.HButtonBox() |
361 | + button_box.set_spacing(6) |
362 | button_box.set_layout(gtk.BUTTONBOX_START) |
363 | - remove_button = gtk.Button(stock=gtk.STOCK_DELETE) |
364 | + remove_button = gtk.Button(stock=gtk.STOCK_REMOVE) |
365 | remove_button.connect("clicked", self._on_remove_blacklist_dir) |
366 | - #hbox_other.pack_start(scroll, True) |
367 | - #button_box.pack_start(remove_button) |
368 | - #hbox_other.pack_start(button_box, False) |
369 | - |
370 | - #self.pack_start(hbox_other, True) |
371 | - |
372 | - hbox = gtk.HBox(False, 6) |
373 | - self.pack_start(hbox) |
374 | - |
375 | - vbox = gtk.VBox() |
376 | - hbox.pack_start(vbox) |
377 | - vbox.pack_start(file_chooser_hbox, False, False) |
378 | - vbox.pack_start(scroll, True, True) |
379 | - |
380 | - vbox = gtk.VBox() |
381 | - hbox.pack_start(vbox, False, False) |
382 | - vbox.pack_start(add_button, False, False) |
383 | - vbox.pack_start(remove_button, False, False) |
384 | + |
385 | + button_box.pack_start(add_button, False, False) |
386 | + button_box.pack_start(remove_button, False, False) |
387 | + |
388 | + file_chooser_vbox.pack_start(button_box, False, False) |
389 | |
390 | for t in self.zg.all_templates.iterkeys(): |
391 | if t.startswith("dir-"): |
392 | self.store.append([t[4:]]) |
393 | |
394 | - def _on_ckeckbox_toggled(self, checkbox, label): |
395 | + def _on_checkbox_toggled(self, checkbox, label): |
396 | is_active = checkbox.get_active() |
397 | self.blacklist_dict[self.mime_dict[label]] = is_active |
398 | if is_active: |
399 | @@ -568,14 +570,27 @@ |
400 | else: |
401 | self.zg.remove_blacklist_template("interpretation-"+label.lower()) |
402 | |
403 | - def _on_add_blacklist_dir(self, button): |
404 | + def _on_add_button_clicked(self, button): |
405 | + file_chooser = gtk.FileChooserDialog( |
406 | + _("Select a directory to blacklist"), |
407 | + action = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, |
408 | + buttons = (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, |
409 | + gtk.RESPONSE_CANCEL)) |
410 | + |
411 | + result = file_chooser.run() |
412 | + file_chooser.hide() |
413 | + |
414 | + if result == gtk.RESPONSE_OK: |
415 | + self._on_add_blacklist_dir(file_chooser) |
416 | + |
417 | + def _on_add_blacklist_dir(self, file_chooser): |
418 | def is_duplicate(model, path, iter, user_data): |
419 | if model.get_value(iter, 0) == user_data: |
420 | self.duplicate = True |
421 | return True |
422 | |
423 | self.duplicate = False |
424 | - filename = self.file_chooser.get_filename() |
425 | + filename = file_chooser.get_filename() |
426 | self.store.foreach(is_duplicate, filename) |
427 | if not self.duplicate: |
428 | self.dirs_blacklist_dict[filename] = True |
429 | @@ -631,11 +646,10 @@ |
430 | gtk.VBox.__init__(self) |
431 | self._icon_theme = gtk.icon_theme_get_default() |
432 | #Store fields: |
433 | - #1) Name |
434 | - #2) Description |
435 | - #3) Pixbuf |
436 | - #4) Desktop file |
437 | - self.store = gtk.ListStore(str, str, gtk.gdk.Pixbuf, str) |
438 | + #1) Name and Description |
439 | + #2) Pixbuf |
440 | + #3) Desktop file |
441 | + self.store = gtk.ListStore(str, gtk.gdk.Pixbuf, str) |
442 | self.treeview = gtk.TreeView(self.store) |
443 | self.treeview.set_headers_visible(False) |
444 | self.treeview.set_rules_hint(True) |
445 | @@ -645,20 +659,13 @@ |
446 | column_pix_name = gtk.TreeViewColumn(_('Name')) |
447 | self.treeview.append_column(column_pix_name) |
448 | pix_rend = gtk.CellRendererPixbuf() |
449 | - column_pix_name.pack_start(pix_rend) |
450 | - column_pix_name.add_attribute(pix_rend, "pixbuf", 2) |
451 | + column_pix_name.pack_start(pix_rend, False) |
452 | + column_pix_name.add_attribute(pix_rend, "pixbuf", 1) |
453 | name_rend = gtk.CellRendererText() |
454 | + name_rend.set_property("ellipsize", pango.ELLIPSIZE_END) |
455 | column_pix_name.pack_start(name_rend) |
456 | - column_pix_name.add_attribute(name_rend, "text", 0) |
457 | + column_pix_name.add_attribute(name_rend, "markup", 0) |
458 | column_pix_name.set_resizable(True) |
459 | - column_pix_name.set_max_width(350) |
460 | - |
461 | - column_desc = gtk.TreeViewColumn(_('Description')) |
462 | - self.treeview.append_column(column_desc) |
463 | - desc_rend = gtk.CellRendererText() |
464 | - desc_rend.set_property("ellipsize", pango.ELLIPSIZE_END) |
465 | - column_desc.pack_start(desc_rend) |
466 | - column_desc.add_attribute(desc_rend, "text", 1) |
467 | |
468 | scroll = gtk.ScrolledWindow() |
469 | scroll.add(self.treeview) |
470 | @@ -686,20 +693,28 @@ |
471 | pix = self._get_pixbuf_from_gio_icon(icon) |
472 | else: |
473 | pix = None |
474 | - self.store.append([app.get_name(), app.get_description(), pix, app.get_id()]) |
475 | + |
476 | + name = app.get_name() |
477 | + description = app.get_description() |
478 | + if description == None: |
479 | + description = _("No description provided") |
480 | + |
481 | + markup = "<b>%s</b>\n%s" % (glib.markup_escape_text(name), |
482 | + glib.markup_escape_text(description)) |
483 | + self.store.append([markup, pix, app.get_id()]) |
484 | |
485 | def get_selected_app(self): |
486 | selection = self.treeview.get_selection() |
487 | model,_iter = selection.get_selected() |
488 | if _iter is not None: |
489 | - return model.get(_iter, 0, 1, 2, 3) |
490 | + return model.get(_iter, 0, 1, 2) |
491 | return None |
492 | |
493 | def remove_selected_app(self): |
494 | selection = self.treeview.get_selection() |
495 | model,_iter = selection.get_selected() |
496 | if _iter is not None: |
497 | - app = model[_iter][3] |
498 | + app = model[_iter][2] |
499 | return model.remove(_iter), app |
500 | |
501 | class ApplicationsChooserDialog(gtk.Dialog): |
502 | @@ -710,6 +725,7 @@ |
503 | self.set_destroy_with_parent(True) |
504 | self.set_size_request(600, 400) |
505 | self.set_skip_taskbar_hint(True) |
506 | + self.set_border_width(12) |
507 | self._set_up_ui() |
508 | |
509 | def _set_up_ui(self): |
510 | @@ -730,18 +746,15 @@ |
511 | self.message_image = gtk.Image() |
512 | |
513 | self.set_relief(gtk.RELIEF_NONE) |
514 | - self.markup = '<span size="smaller" font-weight="bold">%s</span>' |
515 | |
516 | - self.message_hbox = gtk.HBox() |
517 | - #self.message_hbox.pack_start(gtk.Label()) |
518 | - self.message_hbox.pack_end(self.message_image, False, False, 3) |
519 | - self.message_hbox.pack_end(self.message_label, False, False, 3) |
520 | - #self.message_hbox.pack_start(gtk.Label()) |
521 | + self.message_hbox = gtk.HBox(False, 6) |
522 | + self.message_hbox.pack_start(self.message_image, False, False) |
523 | + self.message_hbox.pack_start(self.message_label, False, False) |
524 | self.add(self.message_hbox) |
525 | |
526 | def set_text(self, text): |
527 | if text is not None: |
528 | - self.message_label.set_markup(self.markup % text) |
529 | + self.message_label.set_markup(text) |
530 | |
531 | def set_image(self, pix): |
532 | if pix is not None: |
533 | @@ -749,10 +762,8 @@ |
534 | self.message_hbox.remove(i) |
535 | |
536 | self.message_image = pix |
537 | - #self.message_hbox.pack_start(gtk.Label()) |
538 | - self.message_hbox.pack_end(self.message_image, False, False, 3) |
539 | - self.message_hbox.pack_end(self.message_label, False, False, 3) |
540 | - #self.message_hbox.pack_start(gtk.Label()) |
541 | + self.message_hbox.pack_start(self.message_image, False, False) |
542 | + self.message_hbox.pack_start(self.message_label, False, False) |
543 | self.show_all() |
544 | |
545 | def set_in_incognito(self, in_incognito): |
Looks good
some1 merge it