diff --git a/GTG/gtk/browser/tag_context_menu.py b/GTG/gtk/browser/tag_context_menu.py index 95c200da33..13217805dc 100644 --- a/GTG/gtk/browser/tag_context_menu.py +++ b/GTG/gtk/browser/tag_context_menu.py @@ -53,22 +53,26 @@ def __build_menu(self): # Color chooser FIXME: SHOULD BECOME A COLOR PICKER self.mi_cc = Gtk.MenuItem() self.mi_cc.set_label(_("Edit Tag...")) + self.append(self.mi_cc) + self.mi_cc.connect('activate', self.on_mi_cc_activate) + self.mi_ctag = Gtk.MenuItem() self.mi_ctag.set_label(_("Generate Color")) - self.mi_del_tag = Gtk.MenuItem() - self.mi_del_tag.set_label(_("Delete Tag")) - self.append(self.mi_cc) self.append(self.mi_ctag) - self.append(self.mi_del_tag) - self.mi_del_tag.connect( - 'activate', self.app.browser.on_delete_tag_activate) - self.mi_cc.connect('activate', self.on_mi_cc_activate) self.mi_ctag.connect('activate', self.on_mi_ctag_activate) + if self.tag.is_search_tag(): self.mi_del = Gtk.MenuItem() self.mi_del.set_label(_("Delete")) self.append(self.mi_del) self.mi_del.connect('activate', self.on_mi_del_activate) + else: + self.mi_del_tag = Gtk.MenuItem() + self.mi_del_tag.set_label(_("Delete Tag")) + self.append(self.mi_del_tag) + self.mi_del_tag.connect( + 'activate', self.app.browser.on_delete_tag_activate) + # Make it visible self.show_all() @@ -86,8 +90,8 @@ def on_mi_cc_activate(self, widget): def on_mi_ctag_activate(self, widget): random_color = generate_tag_color() present_color = self.tag.get_attribute('color') - if(present_color is not None): - color_remove(present_color) + if present_color is not None: + color_remove(present_color) self.tag.set_attribute('color', random_color) color_add(random_color)