← Back to team overview

gtg-user team mailing list archive

Re: [Merge] lp:~gtg-user/gtg/bugfix-830971 into lp:gtg

 

    Is it necessary? We are already reworking the task editor, right?
Nimit Shah,
B Tech 4th year,
Computer Engineering Department,
SVNIT Surat
www.dude-says.blogspot.com



On Thu, Jul 5, 2012 at 12:39 PM, Alan Gomes Alvino <alangalvino@xxxxxxxxx>wrote:

> Alan Gomes Alvino has proposed merging lp:~gtg-user/gtg/bugfix-830971 into
> lp:gtg.
>
> Requested reviews:
>   Gtg developers (gtg)
> Related bugs:
>   Bug #830971 in Getting Things GNOME!: "Importing dashed lines should
> create subtasks immediately"
>   https://bugs.launchpad.net/gtg/+bug/830971
>
> For more details, see:
> https://code.launchpad.net/~gtg-user/gtg/bugfix-830971/+merge/113497
>
> What i do was before the paste on paste_clipboard method i see if the
> lines of the external paste has one dash at beginning(even if the beginning
> of line has spaces). If he was a dash at beginning of line i create a
> subtask.
> --
> https://code.launchpad.net/~gtg-user/gtg/bugfix-830971/+merge/113497
> Your team Gtg users is subscribed to branch lp:~gtg-user/gtg/bugfix-830971.
>
> === modified file 'GTG/gtk/editor/taskview.py'
> --- GTG/gtk/editor/taskview.py  2012-05-20 19:05:20 +0000
> +++ GTG/gtk/editor/taskview.py  2012-07-05 07:08:28 +0000
> @@ -1089,7 +1089,27 @@
>              self.stop_emission("paste_clipboard")
>
>          else:
> -            #we keep the normal pasting by not interupting the signal
> +            #Get the text of the external clipboard
> +            clipboard_text = clip.wait_for_text()
> +
> +            #Separate the text in lines
> +            for line_strip in clipboard_text.split('\n'):
> +                #Remove whitespaces at begining of line
> +                line = line_strip.lstrip(' ')
> +                #If line contain a task
> +                if len(line) > 0 and line[0] == '-':
> +                    #we handle ourselves the pasting
> +                    self.stop_emission("paste_clipboard")
> +                    #Removing dash
> +                    line_without_dash = line[1:]
> +                    anchor = self.new_subtask_callback(line_without_dash)
> +                    mark = self.buff.get_insert()
> +                    line_nbr = self.buff.get_iter_at_mark(mark).get_line()
> +                    #we must paste the \n before inserting the subtask
> +                    #else, we will start another subtask
> +                    self.buff.insert_at_cursor("\n")
> +                    self.write_subtask(self.buff, line_nbr, anchor)
> +
>              self.clipboard.clear()
>
>      #Function called each time the user inputs a letter
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~gtg-user
> Post to     : gtg-user@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~gtg-user
> More help   : https://help.launchpad.net/ListHelp
>
>

-- 
https://code.launchpad.net/~gtg-user/gtg/bugfix-830971/+merge/113497
Your team Gtg users is subscribed to branch lp:~gtg-user/gtg/bugfix-830971.


References