Changeset 014842639ffec88ea516166f1a40e612591a1d63

Show
Ignore:
Timestamp:
03/19/09 15:34:01 (3 years ago)
Author:
Lincoln de Sousa <lincoln@…>
Children:
a9c19174a0f3c1230e8b29eaaebfda077b0efbef
Parents:
4b0895a574f8fbaaf2caa4a11fc9c6b4fe504c09
git-author:
Aleksandar Krsteski <alekrsteski@…> (03/17/09 21:10:29)
git-committer:
Lincoln de Sousa <lincoln@…> (03/19/09 15:34:01)
Message:

Allow copying of links by right-click -> Copy.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/guake.py

    r4b0895a5 r0148426  
    416416        handle the matched resource uri. 
    417417        """ 
     418        self.matched_value = '' 
    418419        matched_string = self.match_check( 
    419420            int(event.x / self.get_char_width()), 
     
    437438            # gtk_show_uri seem to not be binded to python yet. 
    438439            open_uri(value) 
    439  
     440        elif event.button == 3 and matched_string: 
     441            self.matched_value = matched_string[0] 
    440442 
    441443class GuakeTerminalBox(gtk.HBox): 
     
    792794        accel key. 
    793795        """ 
    794         pos = self.notebook.get_current_page() 
    795         self.term_list[pos].copy_clipboard() 
     796        current_term = self.term_list[self.notebook.get_current_page()] 
     797 
     798        if current_term.get_has_selection(): 
     799            current_term.copy_clipboard() 
     800        elif current_term.matched_value: 
     801            guake_clipboard = gtk.clipboard_get() 
     802            guake_clipboard.set_text(current_term.matched_value) 
     803 
    796804        return True 
    797805