=== modified file 'GTG/gtk/preferences.py'
--- GTG/gtk/preferences.py 2011-11-19 21:41:08 +0000
+++ GTG/gtk/preferences.py 2011-12-10 11:29:25 +0000
@@ -83,7 +83,8 @@
# get lists
modules = plugin.missing_modules
dbus = plugin.missing_dbus
-
+ text = ""
+
# convert to strings
if modules:
modules = "%s" % ', '.join(modules)
@@ -137,7 +138,7 @@
"""Constructor."""
self.config_obj = config_obj
self.req = req
- self.config = self.config_obj.conf_dict
+ self.config = self.config_obj.conf_dict
self.builder = gtk.Builder()
self.builder.add_from_file(ViewConfig.PREFERENCES_GLADE_FILE)
# store references to some objects
@@ -158,6 +159,20 @@
#FIXME: this is not needed and should be removed
# self.tb = taskbrowser
self.pengine = PluginEngine()
+ #plugin config initiation, if never used
+ if self.config.has_key("plugins"):
+ if self.config["plugins"].has_key("enabled") == False:
+ self.config["plugins"]["enabled"] = []
+
+ if self.config["plugins"].has_key("disabled") == False:
+ self.config["plugins"]["disabled"] = []
+ else:
+ if self.pengine.get_plugins():
+ self.config["plugins"] = {}
+ self.config["plugins"]["disabled"] = \
+ [p.module_name for p in self.pengine.get_plugins("disabled")]
+ self.config["plugins"]["enabled"] = \
+ [p.module_name for p in self.pengine.get_plugins("enabled")]
# initialize tree models
self._init_backend_tree()
# this can't happen yet, due to the order of things in
@@ -165,6 +180,9 @@
# self._init_plugin_tree()
pref_signals_dic = self.get_signals_dict()
self.builder.connect_signals(pref_signals_dic)
+
+ #this line enables the about dialog widget to be reused
+ self.plugin_about_dialog.connect("delete-event", lambda w, e: self.plugin_about_dialog.hide() or True)
def _init_backend_tree(self):
"""Initialize the BackendTree gtk.TreeView."""
@@ -304,15 +322,6 @@
def on_close(self, widget, data = None):
"""Close the preferences dialog."""
- if self.pengine.get_plugins():
- self.config["plugins"] = {}
- self.config["plugins"]["disabled"] = \
- [p.module_name for p in self.pengine.get_plugins("disabled")]
- self.config["plugins"]["enabled"] = \
- [p.module_name for p in self.pengine.get_plugins("enabled")]
-
- self.config_obj.save()
-
self.dialog.hide()
return True
@@ -327,6 +336,7 @@
return
plugin_id = self.plugin_store.get_value(iter, PLUGINS_COL_ID)
p = self.pengine.get_plugin(plugin_id)
+
pad = self.plugin_about_dialog
pad.set_name(p.full_name)
pad.set_version(p.version)
@@ -371,10 +381,18 @@
p.enabled = not self.plugin_store.get_value(iter, PLUGINS_COL_ENABLED)
if p.enabled:
self.pengine.activate_plugins([p])
+ self.config["plugins"]["enabled"].append(p.module_name)
+ if p.module_name in self.config["plugins"]["disabled"]:
+ self.config["plugins"]["disabled"].remove(p.module_name)
else:
self.pengine.deactivate_plugins([p])
+ self.config["plugins"]["disabled"].append(p.module_name)
+ if p.module_name in self.config["plugins"]["enabled"]:
+ self.config["plugins"]["enabled"].remove(p.module_name)
self.plugin_store.set_value(iter, PLUGINS_COL_ENABLED, p.enabled)
self._update_plugin_configure(p)
+
+ self.config_obj.save()
def toggle_preview(self, widget):
"""Toggle previews in the task view on or off."""
=== modified file 'GTG/plugins/bugzilla/bug.py'
--- GTG/plugins/bugzilla/bug.py 2009-12-03 09:59:33 +0000
+++ GTG/plugins/bugzilla/bug.py 2011-12-10 11:29:25 +0000
@@ -14,11 +14,21 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see .
-from bugz import Bugz
+#this handles old versions of pybugz as well as new ones
+try:
+ from bugz import bugzilla
+except:
+ import bugz as bugzilla
+
+#changed the default action to skip auth
class Bug:
def __init__(self, base, nb):
- self.bug = Bugz(base).get(nb)
+ #this also handles old versions of pybugz
+ try:
+ self.bug = bugzilla.Bugz(base, skip_auth=True).get(nb)
+ except:
+ self.bug = bugzilla.Bugz(base).get(nb)
if self.bug is None:
raise Exception('Failed to create bug')
@@ -42,11 +52,11 @@
comment = self.bug.findall('//long_desc')[0]
return comment.find('.//thetext').text
-if __name__ == '__main__':
- for bug in [Bug('http://bugzilla.gnome.org', '598354'),
- Bug('http://bugs.freedesktop.org', '24120')]:
- print "title:", bug.get_title()
- print "product:", bug.get_product()
- print "component:", bug.get_component()
- print "description:", bug.get_description()
- print ""
+#if __name__ == '__main__':
+# for bug in [Bug('http://bugzilla.gnome.org', '598354'),
+# Bug('http://bugs.freedesktop.org', '24120')]:
+# print "title:", bug.get_title()
+# print "product:", bug.get_product()
+# print "component:", bug.get_component()
+# print "description:", bug.get_description()
+# print ""
=== modified file 'GTG/plugins/bugzilla/bugzilla.py'
--- GTG/plugins/bugzilla/bugzilla.py 2011-11-19 21:41:08 +0000
+++ GTG/plugins/bugzilla/bugzilla.py 2011-12-10 11:29:25 +0000
@@ -54,14 +54,14 @@
if server is None:
return
- base = '%s://%s' % (r.scheme, server.name)
-
+ base = '%s://%s' % (r.scheme, server.name)
+
# get the number of the bug
try:
nb = r.query.split('id=')[1]
except IndexError:
return
-
+
try:
bug = Bug(base, nb)
except:
=== modified file 'GTG/plugins/bugzilla/server.py'
--- GTG/plugins/bugzilla/server.py 2010-05-26 20:21:27 +0000
+++ GTG/plugins/bugzilla/server.py 2011-12-10 11:29:25 +0000
@@ -40,6 +40,11 @@
server = Server('bugzilla.samba.org')
server.tag = SERVER_TAG_COMPONENT
self.add(server)
+
+ # GENTOO
+ server = Server('bugs.gentoo.org')
+ server.tag = SERVER_TAG_COMPONENT
+ self.add(server)
def add(self, server):
self.servers[server.name] = server
=== modified file 'GTG/plugins/notification_area/notification_area.py'
--- GTG/plugins/notification_area/notification_area.py 2011-08-07 08:57:59 +0000
+++ GTG/plugins/notification_area/notification_area.py 2011-12-10 11:29:25 +0000
@@ -85,7 +85,7 @@
if self.__indicator:
self.__indicator.set_status(appindicator.STATUS_PASSIVE)
else:
- self.__status_icon.set_visible(False)
+ self.status_icon.set_visible(False)
## Helper methods ##############################################################