Merge lp:~mart-e/terminator/terminator-copy-email-mailto into lp:terminator/gtk3

Proposed by Martin T.
Status: Needs review
Proposed branch: lp:~mart-e/terminator/terminator-copy-email-mailto
Merge into: lp:terminator/gtk3
Diff against target: 27 lines (+4/-1)
1 file modified
terminatorlib/terminal_popup_menu.py (+4/-1)
To merge this branch: bzr merge lp:~mart-e/terminator/terminator-copy-email-mailto
Reviewer Review Type Date Requested Status
Terminator Pending
Review via email: mp+337915@code.launchpad.net

Description of the change

Do not copy mailto: attribute when copying an email address

The emails addresses were transformed into mailto:foo@bar which allows to
open email client but was also polluting the clipboard

To post a comment you must log in.
1790. By Martin T.

missing index

Unmerged revisions

1790. By Martin T.

missing index

1789. By Martin T.

Do not copy mailto: attribute when copying an email address

The emails addresses were transformed into mailto:foo@bar which allows to
open email client but was also poluting the clipboasrd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'terminatorlib/terminal_popup_menu.py'
2--- terminatorlib/terminal_popup_menu.py 2017-02-19 15:57:36 +0000
3+++ terminatorlib/terminal_popup_menu.py 2018-02-19 11:54:49 +0000
4@@ -57,9 +57,11 @@
5
6 nameopen = None
7 namecopy = None
8+ preparecopy = True
9 if url[1] == terminal.matches['email']:
10 nameopen = _('_Send email to...')
11 namecopy = _('_Copy email address')
12+ preparecopy = False
13 elif url[1] == terminal.matches['voip']:
14 nameopen = _('Ca_ll VoIP address')
15 namecopy = _('_Copy VoIP address')
16@@ -94,9 +96,10 @@
17 item.connect('activate', lambda x: terminal.open_url(url, True))
18 menu.append(item)
19
20+ purl = preparecopy and terminal.prepare_url(url) or url[0]
21 item = Gtk.MenuItem.new_with_mnemonic(namecopy)
22 item.connect('activate',
23- lambda x: terminal.clipboard.set_text(terminal.prepare_url(url), len(terminal.prepare_url(url))))
24+ lambda x: terminal.clipboard.set_text(purl, len(purl)))
25 menu.append(item)
26
27 menu.append(Gtk.SeparatorMenuItem())

Subscribers

People subscribed via source and target branches

to status/vote changes: