← Back to team overview

gtg team mailing list archive

[Merge] lp:~emclaughlin1215/gtg/bug584667 into lp:gtg

 

Erin McLaughlin has proposed merging lp:~emclaughlin1215/gtg/bug584667 into lp:gtg.

Requested reviews:
  Gtg developers (gtg)

For more details, see:
https://code.launchpad.net/~emclaughlin1215/gtg/bug584667/+merge/76859

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
-- 
https://code.launchpad.net/~emclaughlin1215/gtg/bug584667/+merge/76859
Your team Gtg developers is requested to review the proposed merge of lp:~emclaughlin1215/gtg/bug584667 into lp:gtg.
=== modified file 'AUTHORS'
--- AUTHORS	2011-08-12 14:11:35 +0000
+++ AUTHORS	2011-09-24 15:31:24 +0000
@@ -76,3 +76,4 @@
 * Ivan Evtukhovich <evtuhovich@xxxxxxxxx>
 * Madhumitha Viswanathan <madhuvishy@xxxxxxxxx>
 * Fabio Prina <fabio@xxxxxxxxx>
+* Erin McLaughlin <emclaughlin1215@xxxxxxxxx>

=== modified file 'CHANGELOG'
--- CHANGELOG	2011-08-12 14:11:35 +0000
+++ CHANGELOG	2011-09-24 15:31:24 +0000
@@ -12,6 +12,7 @@
     * Right click behaviour in the task treeview is now consistant with other GNOME applications, by Jonathan Barnoud
     * Underscore characters in tasks not treated as accelerators (bug #676088) fixed, by Madhumitha Viswanathan
     * Setting start/due date by a right click menu in the task browser, by Fabio Prina & Kevin Mehall
+    * Fixed bug #584667, indicating missing plugin dependencies, by Erin McLaughlin
 
 2010-03-01 Getting Things GNOME! 0.2.2
     * Autostart on login, by Luca Invernizzi

=== modified file 'GTG/gtk/preferences.py'
--- GTG/gtk/preferences.py	2011-08-07 09:32:44 +0000
+++ GTG/gtk/preferences.py	2011-09-24 15:31:24 +0000
@@ -45,26 +45,35 @@
 PLUGINS_COL_DESC = 4
 PLUGINS_COL_ACTIVATABLE = 5
 
+
 def plugin_icon(column, cell, store, iter):
     """Callback to set the content of a PluginTree cell.
-    
+
     See PreferencesDialog._init_plugin_tree().
-    
+
     """
     cell.set_property('icon-name', 'gtg-plugin')
     cell.set_property('sensitive', store.get_value(iter,
       PLUGINS_COL_ACTIVATABLE))
 
 
-def plugin_markup(column, cell, store, iter):
+def plugin_markup(column, cell, store, iter, self):
     """Callback to set the content of a PluginTree cell.
-    
+
     See PreferencesDialog._init_plugin_tree().
-    
+
     """
     name = store.get_value(iter, PLUGINS_COL_NAME)
     desc = store.get_value(iter, PLUGINS_COL_SHORT_DESC)
-    cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc))
+    plugin_id = store.get_value(iter, PLUGINS_COL_ID)
+    p = self.pengine.get_plugin(plugin_id)
+    dep = plugin_error_text(p)
+    if dep != 'Everything necessary to run this plugin is available.':
+        dep = dep.split('\n')
+        dep = dep[2] + '\n' + dep[3]
+        cell.set_property('markup', "<b>%s</b>\n%s\n<i>%s</i>" % (name, desc, dep))
+    else:
+        cell.set_property('markup', "<b>%s</b>\n%s" % (name, desc))
     cell.set_property('sensitive', store.get_value(iter,
       PLUGINS_COL_ACTIVATABLE))
 
@@ -80,15 +89,15 @@
     dbus = plugin.missing_dbus
     # convert to strings
     if modules:
-      modules = "<small><b>%s</b></small>" % ', '.join(modules)
+        modules = "<small><b>%s</b></small>" % ', '.join(modules)
     if dbus:
-      ifaces = ["%s:%s" % (a, b) for (a, b) in dbus]
-      dbus = "<small><b>%s</b></small>" % ', '.join(ifaces)
+        ifaces = ["%s:%s" % (a, b) for (a, b) in dbus]
+        dbus = "<small><b>%s</b></small>" % ', '.join(ifaces)
     # combine
     if modules and not dbus:
         text += '\n'.join((GnomeConfig.MODULEMISSING, modules))
     elif dbus and not modules:
-        text += '\n'.join((GnomeConfig.DBUSMISSING,  dbus))
+        text += '\n'.join((GnomeConfig.DBUSMISSING, dbus))
     elif modules and dbus:
         text += '\n'.join((GnomeConfig.MODULANDDBUS, modules, dbus))
     else:
@@ -106,7 +115,7 @@
         self.config_obj = config_obj
         self.req = req
         self.config = self.config_obj.conf_dict
-        self.builder = gtk.Builder() 
+        self.builder = gtk.Builder()
         self.builder.add_from_file(ViewConfig.PREFERENCES_GLADE_FILE)
         # store references to some objects
         widgets = {
@@ -155,14 +164,14 @@
         if not hasattr(self, 'plugin_store'):
             # see constants PLUGINS_COL_* for column meanings
             self.plugin_store = gtk.ListStore(str, 'gboolean', str, str, str,
-              'gboolean',)
+              'gboolean', )
         self.plugin_store.clear()
         # refresh the status of all plugins
         self.pengine.recheck_plugin_errors(True)
         # repopulate the store
         for name, p in self.pengine.plugins.iteritems():
             self.plugin_store.append([name, p.enabled, p.full_name,
-              p.short_description, p.description, not p.error,]) # activateable if there is no error
+              p.short_description, p.description, not p.error, ]) # activateable if there is no error
 
     def  _refresh_preferences_store(self):
         """Sets the correct value in the preferences checkboxes"""
@@ -177,13 +186,12 @@
             toset = 0
         self.pref_show_preview.set_active(toset)
 
-
     def _init_plugin_tree(self):
         """Initialize the PluginTree gtk.TreeView.
-        
+
         The format is modelled after the one used in gedit; see
         http://git.gnome.org/browse/gedit/tree/gedit/gedit-plugin-mapnager.c
-        
+
         """
         # force creation of the gtk.ListStore so we can reference it
         self._refresh_plugin_store()
@@ -211,7 +219,7 @@
         name_renderer = gtk.CellRendererText()
         name_renderer.set_property('ellipsize', pango.ELLIPSIZE_END)
         column.pack_start(name_renderer)
-        column.set_cell_data_func(name_renderer, plugin_markup)
+        column.set_cell_data_func(name_renderer, plugin_markup, self)
 
         self.plugin_tree.append_column(column)
 
@@ -344,18 +352,17 @@
             self.pengine.deactivate_plugins([p])
         self.plugin_store.set_value(iter, PLUGINS_COL_ENABLED, p.enabled)
         self._update_plugin_configure(p)
-    
+
     def toggle_preview(self, widget):
         """Toggle previews in the task view on or off."""
-        self.config_priv.set("contents_preview_enable",widget.get_active())
+        self.config_priv.set("contents_preview_enable", widget.get_active())
         view = self.req.get_tasks_tree(refresh=False)
         view.refresh_all()
 
-    
     def toggle_spellcheck(self, widget):
         """Toggle spell checking on or off."""
         print __name__
-    
+
     def _update_plugin_configure(self, plugin):
         """Enable the "Configure Plugin" button if appropriate."""
         configurable = plugin.active and plugin.is_configurable()
@@ -365,7 +372,7 @@
         """Toggle GTG autostarting with the GNOME desktop"""
         autostart_path = os.path.join(self.__AUTOSTART_DIRECTORY, \
                                       self.__AUTOSTART_FILE)
-        if widget.get_active() == False: 
+        if widget.get_active() == False:
             #Disable autostart, removing the file in autostart_path
             if os.path.isfile(autostart_path):
                 os.remove(autostart_path)