gtg team mailing list archive
-
gtg team
-
Mailing list archive
-
Message #03334
[Merge] lp:~izidor/gtg/fix-625708 into lp:gtg
Izidor Matušov has proposed merging lp:~izidor/gtg/fix-625708 into lp:gtg.
Requested reviews:
Gtg developers (gtg)
Related bugs:
Bug #625708 in Getting Things GNOME!: "New tag dialog should keep previous value"
https://bugs.launchpad.net/gtg/+bug/625708
For more details, see:
https://code.launchpad.net/~izidor/gtg/fix-625708/+merge/56764
Tag completion did not work prior working on this bug so it is not related to this change (it is a regression)
I use the patch for a long time in GTG 0.2.4.
--
https://code.launchpad.net/~izidor/gtg/fix-625708/+merge/56764
Your team Gtg developers is requested to review the proposed merge of lp:~izidor/gtg/fix-625708 into lp:gtg.
=== modified file 'GTG/gtk/browser/browser.py'
--- GTG/gtk/browser/browser.py 2011-04-04 07:48:46 +0000
+++ GTG/gtk/browser/browser.py 2011-04-07 13:28:34 +0000
@@ -132,6 +132,10 @@
#Autocompletion for Tags
self._init_tag_list()
self._init_tag_completion()
+
+ # Rember values from last time
+ self.last_added_tags = "NewTask"
+ self.last_apply_tags_to_subtasks = False
self.restore_state_from_conf()
@@ -1008,9 +1012,9 @@
# We don't want to reset the text entry and checkbox if we got
# sent back here after a warning.
if not tryagain:
- tag_entry.set_text("NewTag")
- apply_to_subtasks.set_active(False)
+ tag_entry.set_text(self.last_added_tags)
tag_entry.set_completion(self.tag_completion)
+ apply_to_subtasks.set_active(self.last_apply_tags_to_subtasks)
tag_entry.grab_focus()
addtag_dialog = self.builder.get_object("addtag_dialog")
addtag_dialog.run()
@@ -1046,6 +1050,10 @@
for new_tag in new_tags:
task.add_tag(new_tag)
task.sync()
+
+ # Rember the last actions
+ self.last_added_tags = tag_entry.get_text()
+ self.last_apply_tags_to_subtasks = apply_to_subtasks.get_active()
def on_tag_entry_key_press_event(self, widget, event):
if gtk.gdk.keyval_name(event.keyval) == "Return":