~gtg-user/gtg/gmail-like-ui

« back to all changes in this revision

Viewing changes to GTG/taskeditor/taskview.py

  • Committer: Lionel Dricot
  • Date: 2010-01-07 16:46:49 UTC
  • mfrom: (524.1.6 gtg.local)
  • Revision ID: ploum@ploum.net-20100107164649-c0ppt2c5k3pzou7e
tags name are now properly escaped, fix bug #497397

Show diffs side-by-side

added added

removed removed

Lines of Context:
995
995
        #else, that we can empty it.
996
996
        our_paste = self.clipboard.paste_text()
997
997
        if our_paste != None and clip.wait_for_text() == our_paste :
 
998
            #first, we delete the current selection
 
999
            self.buff.delete_selection(False,True)
998
1000
            for line in self.clipboard.paste():
999
1001
                if line[0] == 'text':
1000
1002
                    self.buff.insert_at_cursor(line[1])
1001
1003
                if line[0] == 'subtask':
1002
 
                    self.new_subtask_callback(tid=line[1])
 
1004
                    tid=line[1]
 
1005
                    self.new_subtask_callback(tid=tid)
1003
1006
                    mark = self.buff.get_insert()
1004
1007
                    line_nbr = self.buff.get_iter_at_mark(mark).get_line()
1005
1008
                    #we must paste the \n before inserting the subtask
1006
1009
                    #else, we will start another subtask
1007
1010
                    self.buff.insert_at_cursor("\n")
1008
 
                    self.write_subtask(self.buff,line_nbr,line[1])
1009
 
#                else:
1010
 
#                    self.buff.insert_at_cursor(line[1])
 
1011
                    self.write_subtask(self.buff,line_nbr,tid)
 
1012
 
1011
1013
            #we handle ourselves the pasting
1012
1014
            self.stop_emission("paste_clipboard")
1013
1015