← Back to team overview

gtg team mailing list archive

[Merge] lp:~mmcasetti/gtg/last_selected_tag into lp:gtg

 

Marta Maria Casetti has proposed merging lp:~mmcasetti/gtg/last_selected_tag into lp:gtg.

Requested reviews:
  Gtg developers (gtg)
Related bugs:
  Bug #1050520 in Getting Things GNOME!: "Remeber the last used tag"
  https://bugs.launchpad.net/gtg/+bug/1050520

For more details, see:
https://code.launchpad.net/~mmcasetti/gtg/last_selected_tag/+merge/150186

Fix for the bug.
-- 
https://code.launchpad.net/~mmcasetti/gtg/last_selected_tag/+merge/150186
Your team Gtg developers is requested to review the proposed merge of lp:~mmcasetti/gtg/last_selected_tag into lp:gtg.
=== modified file 'CHANGELOG'
--- CHANGELOG	2013-02-11 13:10:01 +0000
+++ CHANGELOG	2013-02-23 12:20:25 +0000
@@ -1,4 +1,5 @@
 ????-??-?? Getting Things GNOME! 0.3.1
+    * Fix for bug #1050520: Remember the last used tag, Marta Maria Casetti
     * Fix for bug #1024473: Have 'Show Main Window' in notification area, by Antonio Roquentin
     * Fix for bug #1043457: gtcli search returns closed tasks, by Nimit Shah
     * Fix for bug #1073607: "GTG starts after login" doesn't work with an invalid link

=== modified file 'GTG/core/__init__.py'
--- GTG/core/__init__.py	2013-01-17 16:38:01 +0000
+++ GTG/core/__init__.py	2013-02-23 12:20:25 +0000
@@ -66,6 +66,7 @@
             'tasklist_sort_column': 5,
             'tasklist_sort_order': 1,
             "font_name": "",
+            "last_selected_tag": [], 
             },
 'tag_editor': {
             "custom_colors": [],

=== modified file 'GTG/gtk/browser/browser.py'
--- GTG/gtk/browser/browser.py	2013-02-04 07:48:17 +0000
+++ GTG/gtk/browser/browser.py	2013-02-23 12:20:25 +0000
@@ -464,7 +464,20 @@
             self.builder.get_object("view_sidebar").set_active(True)
             if not self.tagtreeview:
                 self.init_tags_sidebar()
+
+            # for applying the last used tag                
+            taglist = self.config.get("last_selected_tag")
+            model = self.tagtreeview.get_model()
+            for tag_name in taglist:
+                path = self.tagtree.get_paths_for_node(tag_name)[0]
+                tag_iter = model.my_get_iter(path)
+
+                selection = self.tagtreeview.get_selection()
+                selection.select_iter(tag_iter)
+
             self.sidebar.show()
+            self.on_select_tag()
+
 
         sidebar_width = self.config.get("sidebar_width")
         self.builder.get_object("hpaned1").set_position(sidebar_width)
@@ -1146,6 +1159,8 @@
         #When you click on a tag, you want to unselect the tasks
         new_taglist = self.get_selected_tags()
 
+        self.config.set_lst("last_selected_tag", new_taglist)
+
         for tagname in self.applied_tags:
             if tagname not in new_taglist:
                 self.unapply_filter_on_panes(tagname, refresh=False)


Follow ups