From c3b6dd919c91cd733a081ace6d0444b4191ca15e Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Fri, 28 Sep 2012 14:10:57 +0000 Subject: Show Sugar's palette when right click is pressed SL #3455 When the user right clicks over a link, an image or selected text the Sugar's Palette is shown with the proper menu's items for each case. There are 4 possibilities. When the click is done over: - Link: - Title and subtitle (if they are availables) - title is the content text of the link - subtitle is the uri - Copy link (copy the link into the clipboard) - Keep link (download the .html to the Journal) - Follow link in new tab (open a new tab with the url pointed) - Follow link (follow the link inside the current tab) - Image: - Title and subtitle (if they are availables) - title is the "title" property of the - subtitle is the uri - Keep image (download the image to the Journal) - Copy image (copy the image into the clipboard) - Image with a link: - Title and subtitle (if they are availables) - title is the "title" property of the - subtitle is the uri Same Items than "Link" option - Selected Text: - Title and subtitle (not implemented because the function webkit_web_view_get_selected_text was removed: https://bugs.webkit.org/show_bug.cgi?id=62512) - Copy text (copy the text into the clipboard) Signed-off-by: Simon Schampijer Signed-off-by: Manuel Kaufmann Acked-by: Manuel QuiƱones --- (limited to 'browser.py') diff --git a/browser.py b/browser.py index 53acb7a..4a6a7b4 100644 --- a/browser.py +++ b/browser.py @@ -34,6 +34,7 @@ from sugar3.graphics import style from sugar3.graphics.icon import Icon from widgets import BrowserNotebook +from palettes import ContentInvoker from filepicker import FilePicker import globalhistory import downloadmanager @@ -497,6 +498,8 @@ class Browser(WebKit.WebView): self.__new_window_policy_cb) self.connect('load-error', self.__load_error_cb) + ContentInvoker(self) + try: self.connect('run-file-chooser', self.__run_file_chooser) except TypeError: -- cgit v0.9.1