GTG

Merge lp:~emclaughlin1215/gtg/bug584667 into lp:~gtg/gtg/old-trunk

Proposed by Erin McLaughlin
Status: Merged
Merged at revision: 1026
Proposed branch: lp:~emclaughlin1215/gtg/bug584667
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 168 lines (+31/-22)
3 files modified
AUTHORS (+1/-0)
CHANGELOG (+1/-0)
GTG/gtk/preferences.py (+29/-22)
To merge this branch: bzr merge lp:~emclaughlin1215/gtg/bug584667
Reviewer Review Type Date Requested Status
Izidor Matušov Approve
Review via email: mp+76859@code.launchpad.net

Description of the change

Fixed bug #584667 by adding two lines to the bottom of grayed out plugins, listing the missing dependencies. This seemed like the least obtrusive way to do it, and still be easily seen. Also got rid of some of the lint in preferences.py

To post a comment you must log in.
Revision history for this message
Izidor Matušov (izidor) wrote :

Thanks for working on this bug. However, I have to change the way of generation of the markup (it depended on the value of the message which can be different for various languages)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2011-08-12 14:11:35 +0000
3+++ AUTHORS 2011-09-24 15:31:24 +0000
4@@ -76,3 +76,4 @@
5 * Ivan Evtukhovich <evtuhovich@gmail.com>
6 * Madhumitha Viswanathan <madhuvishy@gmail.com>
7 * Fabio Prina <fabio@nimsh.com>
8+* Erin McLaughlin <emclaughlin1215@gmail.com>
9
10=== modified file 'CHANGELOG'
11--- CHANGELOG 2011-08-12 14:11:35 +0000
12+++ CHANGELOG 2011-09-24 15:31:24 +0000
13@@ -12,6 +12,7 @@
14 * Right click behaviour in the task treeview is now consistant with other GNOME applications, by Jonathan Barnoud
15 * Underscore characters in tasks not treated as accelerators (bug #676088) fixed, by Madhumitha Viswanathan
16 * Setting start/due date by a right click menu in the task browser, by Fabio Prina & Kevin Mehall
17+ * Fixed bug #584667, indicating missing plugin dependencies, by Erin McLaughlin
18
19 2010-03-01 Getting Things GNOME! 0.2.2
20 * Autostart on login, by Luca Invernizzi
21
22=== modified file 'GTG/gtk/preferences.py'
23--- GTG/gtk/preferences.py 2011-08-07 09:32:44 +0000
24+++ GTG/gtk/preferences.py 2011-09-24 15:31:24 +0000
25@@ -45,26 +45,35 @@
26 PLUGINS_COL_DESC = 4
27 PLUGINS_COL_ACTIVATABLE = 5
28
29+
30 def plugin_icon(column, cell, store, iter):
31 """Callback to set the content of a PluginTree cell.
32-
33+
34 See PreferencesDialog._init_plugin_tree().
35-
36+
37 """
38 cell.set_property('icon-name', 'gtg-plugin')
39 cell.set_property('sensitive', store.get_value(iter,
40 PLUGINS_COL_ACTIVATABLE))
41
42
43-def plugin_markup(column, cell, store, iter):
44+def plugin_markup(column, cell, store, iter, self):
45 """Callback to set the content of a PluginTree cell.
46-
47+
48 See PreferencesDialog._init_plugin_tree().
49-
50+
51 """
52 name = store.get_value(iter, PLUGINS_COL_NAME)
53 desc = store.get_value(iter, PLUGINS_COL_SHORT_DESC)
54- cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc))
55+ plugin_id = store.get_value(iter, PLUGINS_COL_ID)
56+ p = self.pengine.get_plugin(plugin_id)
57+ dep = plugin_error_text(p)
58+ if dep != 'Everything necessary to run this plugin is available.':
59+ dep = dep.split('\n')
60+ dep = dep[2] + '\n' + dep[3]
61+ cell.set_property('markup', "<b>%s</b>\n%s\n<i>%s</i>" % (name, desc, dep))
62+ else:
63+ cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc))
64 cell.set_property('sensitive', store.get_value(iter,
65 PLUGINS_COL_ACTIVATABLE))
66
67@@ -80,15 +89,15 @@
68 dbus = plugin.missing_dbus
69 # convert to strings
70 if modules:
71- modules = "<small><b>%s</b></small>" % ', '.join(modules)
72+ modules = "<small><b>%s</b></small>" % ', '.join(modules)
73 if dbus:
74- ifaces = ["%s:%s" % (a, b) for (a, b) in dbus]
75- dbus = "<small><b>%s</b></small>" % ', '.join(ifaces)
76+ ifaces = ["%s:%s" % (a, b) for (a, b) in dbus]
77+ dbus = "<small><b>%s</b></small>" % ', '.join(ifaces)
78 # combine
79 if modules and not dbus:
80 text += '\n'.join((GnomeConfig.MODULEMISSING, modules))
81 elif dbus and not modules:
82- text += '\n'.join((GnomeConfig.DBUSMISSING, dbus))
83+ text += '\n'.join((GnomeConfig.DBUSMISSING, dbus))
84 elif modules and dbus:
85 text += '\n'.join((GnomeConfig.MODULANDDBUS, modules, dbus))
86 else:
87@@ -106,7 +115,7 @@
88 self.config_obj = config_obj
89 self.req = req
90 self.config = self.config_obj.conf_dict
91- self.builder = gtk.Builder()
92+ self.builder = gtk.Builder()
93 self.builder.add_from_file(ViewConfig.PREFERENCES_GLADE_FILE)
94 # store references to some objects
95 widgets = {
96@@ -155,14 +164,14 @@
97 if not hasattr(self, 'plugin_store'):
98 # see constants PLUGINS_COL_* for column meanings
99 self.plugin_store = gtk.ListStore(str, 'gboolean', str, str, str,
100- 'gboolean',)
101+ 'gboolean', )
102 self.plugin_store.clear()
103 # refresh the status of all plugins
104 self.pengine.recheck_plugin_errors(True)
105 # repopulate the store
106 for name, p in self.pengine.plugins.iteritems():
107 self.plugin_store.append([name, p.enabled, p.full_name,
108- p.short_description, p.description, not p.error,]) # activateable if there is no error
109+ p.short_description, p.description, not p.error, ]) # activateable if there is no error
110
111 def _refresh_preferences_store(self):
112 """Sets the correct value in the preferences checkboxes"""
113@@ -177,13 +186,12 @@
114 toset = 0
115 self.pref_show_preview.set_active(toset)
116
117-
118 def _init_plugin_tree(self):
119 """Initialize the PluginTree gtk.TreeView.
120-
121+
122 The format is modelled after the one used in gedit; see
123 http://git.gnome.org/browse/gedit/tree/gedit/gedit-plugin-mapnager.c
124-
125+
126 """
127 # force creation of the gtk.ListStore so we can reference it
128 self._refresh_plugin_store()
129@@ -211,7 +219,7 @@
130 name_renderer = gtk.CellRendererText()
131 name_renderer.set_property('ellipsize', pango.ELLIPSIZE_END)
132 column.pack_start(name_renderer)
133- column.set_cell_data_func(name_renderer, plugin_markup)
134+ column.set_cell_data_func(name_renderer, plugin_markup, self)
135
136 self.plugin_tree.append_column(column)
137
138@@ -344,18 +352,17 @@
139 self.pengine.deactivate_plugins([p])
140 self.plugin_store.set_value(iter, PLUGINS_COL_ENABLED, p.enabled)
141 self._update_plugin_configure(p)
142-
143+
144 def toggle_preview(self, widget):
145 """Toggle previews in the task view on or off."""
146- self.config_priv.set("contents_preview_enable",widget.get_active())
147+ self.config_priv.set("contents_preview_enable", widget.get_active())
148 view = self.req.get_tasks_tree(refresh=False)
149 view.refresh_all()
150
151-
152 def toggle_spellcheck(self, widget):
153 """Toggle spell checking on or off."""
154 print __name__
155-
156+
157 def _update_plugin_configure(self, plugin):
158 """Enable the "Configure Plugin" button if appropriate."""
159 configurable = plugin.active and plugin.is_configurable()
160@@ -365,7 +372,7 @@
161 """Toggle GTG autostarting with the GNOME desktop"""
162 autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \
163 self.__AUTOSTART_FILE)
164- if widget.get_active() == False:
165+ if widget.get_active() == False:
166 #Disable autostart, removing the file in autostart_path
167 if os.path.isfile(autostart_path):
168 os.remove(autostart_path)

Subscribers

People subscribed via source and target branches

to status/vote changes: