From 64392676b3a9e5e1c16bb23611b08414bb02d4fb Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 01 Nov 2007 23:33:05 +0000 Subject: Added zoom support with keybindings and view toolbar --- diff --git a/NEWS b/NEWS index 2d72601..76af745 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +* Added zoom support with keybindings (erikos) +* Added a view toolbar for fullscreen/tray/zoom (erikos) +* Make outline of the session bookmarks smaller (erikos) * Use favorite icon for session bookmark and call it Bookmark #3741 (erikos) 70 diff --git a/browser.py b/browser.py index ec6a69f..84b3ed0 100644 --- a/browser.py +++ b/browser.py @@ -37,6 +37,8 @@ from sugar.activity import activity import sessionstore +_ZOOM_AMOUNT = 0.1 + class GetSourceListener(gobject.GObject): _com_interfaces_ = interfaces.nsIWebProgressListener @@ -92,7 +94,7 @@ class Browser(WebView): None, None) style_sheet_service.loadAndRegisterSheet(user_sheet_uri, interfaces.nsIStyleSheetService.USER_SHEET) - + def get_session(self): return sessionstore.get_session(self) @@ -157,3 +159,15 @@ class Browser(WebView): os.remove(self._jobject.file_path) self._jobject.destroy() self._jobject = None + + def zoom_in(self): + contentViewer = self.doc_shell.queryInterface(interfaces.nsIDocShell).contentViewer + if contentViewer is not None: + markupDocumentViewer = contentViewer.queryInterface(interfaces.nsIMarkupDocumentViewer) + markupDocumentViewer.fullZoom += _ZOOM_AMOUNT + + def zoom_out(self): + contentViewer = self.doc_shell.queryInterface(interfaces.nsIDocShell).contentViewer + if contentViewer is not None: + markupDocumentViewer = contentViewer.queryInterface(interfaces.nsIMarkupDocumentViewer) + markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT diff --git a/icons/link.svg b/icons/link.svg index 230f1d1..ee31fbe 100644 --- a/icons/link.svg +++ b/icons/link.svg @@ -8,5 +8,5 @@ - + diff --git a/icons/tray-empty.svg b/icons/tray-empty.svg deleted file mode 100644 index 5980eec..0000000 --- a/icons/tray-empty.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/icons/tray-hide.svg b/icons/tray-hide.svg deleted file mode 100644 index 4f30fa8..0000000 --- a/icons/tray-hide.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/icons/tray-show.svg b/icons/tray-show.svg deleted file mode 100644 index 0361b23..0000000 --- a/icons/tray-show.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/po/Web.pot b/po/Web.pot index d31b219..0ffdc19 100644 --- a/po/Web.pot +++ b/po/Web.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,11 +16,11 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -63,46 +63,42 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 msgid "Download in progress" msgstr "" -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "" - -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" diff --git a/po/ar.po b/po/ar.po index 57b7a2f..fcded01 100644 --- a/po/ar.po +++ b/po/ar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: web-activity.master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-06-28 21:44+0300\n" "Last-Translator: Khaled Hosny \n" "Language-Team: Arabic \n" @@ -18,11 +18,11 @@ msgstr "" "Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n>=3 && n<=10 ? 2 : " "3\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "تصفّح" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -69,53 +69,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "جري تنزيل %s من\n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "قف" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "للخلف" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "للأمام" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "أعد التحميل" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/de.po b/po/de.po index 4055c8e..80ad4ff 100644 --- a/po/de.po +++ b/po/de.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: web\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-07-30 10:37+0100\n" "Last-Translator: Fabian Affolter \n" "Language-Team: German \n" @@ -15,11 +15,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: German\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Durchsuchen" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -66,53 +66,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Herunterladen %s von \n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Stopp" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Zurück" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Weiter" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Neu laden" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/el.po b/po/el.po index 8269298..c956071 100644 --- a/po/el.po +++ b/po/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Web activity\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-07-25 18:49+0100\n" "Last-Translator: Simos Xenitellis \n" "Language-Team: Greek \n" @@ -15,11 +15,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Περιήγηση" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -66,53 +66,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Γίνεται λήψη του %s από \n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Σταμάτημα" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Πίσω" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Μπροστά" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Φόρτωση ξανά" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/es.po b/po/es.po index 1ff83aa..06c7d68 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: web-activity\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-09-18 09:57-0300\n" "Last-Translator: Domingo Becker \n" "Language-Team: Fedora Spanish \n" @@ -17,11 +17,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-Language: Spanish\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Navegar" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -68,53 +68,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Bajando %s desde \n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Parar" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Volver" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Avanzar" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Refrescar" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/fr.po b/po/fr.po index 24fcaf5..f495988 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-07-31 09:48+0200\n" "Last-Translator: Samuel Bizien \n" "Language-Team: Traduc-fr \n" @@ -15,11 +15,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Naviguer" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -66,53 +66,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Téléchargement de %s depuis \n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Arrêter" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Précédent" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Suivant" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Recharger" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/mk.po b/po/mk.po index 05137d2..e17497f 100644 --- a/po/mk.po +++ b/po/mk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: web-activity.master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-07-06 13:43+0200\n" "Last-Translator: Arangel Angov \n" "Language-Team: Macedonian \n" @@ -16,11 +16,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Разгледај" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -67,53 +67,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Преземам %s од \n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Стоп" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Назад" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Напред" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Освежи" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/po/pt.po b/po/pt.po index 08571fa..1fa644b 100644 --- a/po/pt.po +++ b/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-03-23 15:04+0100\n" "Last-Translator: Tomeu Vizoso \n" "Language-Team: Portuguese \n" @@ -16,11 +16,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -63,50 +63,46 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 msgid "Download in progress" msgstr "" -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Interromper" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Voltar" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Avançar" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Recarregar" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "Web Activity" #~ msgstr "Actividade Web" diff --git a/po/pt_BR.po b/po/pt_BR.po index 48cfebc..54196ea 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-01 15:06+0100\n" +"POT-Creation-Date: 2007-11-01 22:55+0100\n" "PO-Revision-Date: 2007-07-03 10:43-0300\n" "Last-Translator: Diego Búrigo Zacarão \n" "Language-Team: Brazilian Portuguese \n" @@ -16,11 +16,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#: activity/activity.info:2 webactivity.py:82 +#: activity/activity.info:2 webactivity.py:83 msgid "Browse" msgstr "Navegar" -#: browser.py:131 +#: browser.py:133 msgid "Source" msgstr "" @@ -67,53 +67,49 @@ msgstr "" msgid "Remove" msgstr "" -#: webactivity.py:107 webactivity.py:108 +#: webactivity.py:91 +msgid "View" +msgstr "" + +#: webactivity.py:109 webactivity.py:110 msgid "blank" msgstr "" -#: webactivity.py:415 +#: webactivity.py:407 #, fuzzy msgid "Download in progress" msgstr "" "Efetuando download %s a partir de\n" "%s." -#: webactivity.py:416 +#: webactivity.py:408 msgid "Stopping now will cancel your download" msgstr "" -#: webactivity.py:418 +#: webactivity.py:410 msgid "Cancel" msgstr "" -#: webactivity.py:420 webtoolbar.py:178 +#: webactivity.py:412 webtoolbar.py:169 msgid "Stop" msgstr "Parar" -#: webtoolbar.py:54 +#: webtoolbar.py:51 msgid "Back" msgstr "Voltar" -#: webtoolbar.py:61 +#: webtoolbar.py:58 msgid "Forward" msgstr "Ir adiante" -#: webtoolbar.py:84 +#: webtoolbar.py:81 msgid "Bookmark" msgstr "" -#: webtoolbar.py:181 +#: webtoolbar.py:172 msgid "Reload" msgstr "Recarregar" -#: webtoolbar.py:231 -msgid "Show Tray" -msgstr "" - -#: webtoolbar.py:236 -msgid "Hide Tray" -msgstr "" - #~ msgid "" #~ "Downloading %s from\n" #~ "%s. Progress %i%%." diff --git a/webactivity.py b/webactivity.py index 76ad9f0..3651d16 100755 --- a/webactivity.py +++ b/webactivity.py @@ -40,6 +40,7 @@ hulahop.startup(os.path.join(env.get_profile_path(), 'gecko')) from browser import Browser from webtoolbar import WebToolbar +from viewtoolbar import ViewToolbar import downloadmanager import promptservice import filepicker @@ -81,23 +82,24 @@ class WebActivity(activity.Activity): self.toolbar = WebToolbar(self._browser) toolbox.add_toolbar(_('Browse'), self.toolbar) self.toolbar.show() + + self._tray = HTray() + self.set_tray(self._tray, gtk.POS_BOTTOM) + self._tray.show() + + self.viewtoolbar = ViewToolbar(self) + toolbox.add_toolbar(_('View'), self.viewtoolbar) + self.viewtoolbar.show() self.set_toolbox(toolbox) toolbox.show() self.set_canvas(self._browser) self._browser.show() - - self._tray = HTray() - self.set_tray(self._tray, gtk.POS_BOTTOM) - self._tray.show() - self._tray.connect('unmap', self._unmap_cb) - self._tray.connect('map', self._map_cb) - + self.session_history = sessionhistory.get_instance() self.session_history.connect('session-link-changed', self._session_history_changed_cb) self.toolbar.connect('add-link', self._link_add_button_cb) - self.toolbar.connect('visibility-tray', self._tray_visibility_cb) self._browser.connect("notify::title", self._title_changed_cb) @@ -304,6 +306,15 @@ class WebActivity(activity.Activity): _logger.debug('keyboard: Show source of the current page') self._show_source() return True + elif gtk.gdk.keyval_name(event.keyval) == "minus": + _logger.debug('keyboard: Zoom in') + self._browser.zoom_in() + return True + elif gtk.gdk.keyval_name(event.keyval) == "plus" \ + or gtk.gdk.keyval_name(event.keyval) == "equal" : + _logger.debug('keyboard: Zoom out') + self._browser.zoom_out() + return True elif event.keyval == _VIEW_SOURCE_KEY_CODE: _logger.debug('keyboard: Show source of the current page SHOW_KEY') self._show_source() @@ -345,37 +356,18 @@ class WebActivity(activity.Activity): item.show() if self._tray.props.visible is False: self._tray.show() - self.toolbar.tray_set_hide() - + self.viewtoolbar.traybutton.props.sensitive = True + def _link_removed_cb(self, button, hash): ''' remove a link from tray and delete it in the model ''' self.model.remove_link(hash) self._tray.remove_item(button) if len(self._tray.get_children()) == 0: - self.toolbar.tray_set_empty() + self.viewtoolbar.traybutton.props.sensitive = False def _link_clicked_cb(self, button, url): ''' an item of the link tray has been clicked ''' self._browser.load_uri(url) - - def _tray_visibility_cb(self, toolbar): - self._tray_visibility() - - def _map_cb(self, tray): - if len(self._tray.get_children()) > 0: - self.toolbar.tray_set_hide() - - def _unmap_cb(self, tray): - self.toolbar.tray_set_show() - - def _tray_visibility(self): - if len(self._tray.get_children()) > 0: - if self._tray.props.visible is False: - self.toolbar.tray_set_hide() - self._tray.show() - else: - self.toolbar.tray_set_show() - self._tray.hide() def _show_source(self): self._browser.get_source() diff --git a/webtoolbar.py b/webtoolbar.py index 6fe0d32..ec09336 100755 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -39,10 +39,7 @@ class WebToolbar(gtk.Toolbar): __gsignals__ = { 'add-link': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, - ([])), - 'visibility-tray': (gobject.SIGNAL_RUN_FIRST, - gobject.TYPE_NONE, - ([])) + ([])) } def __init__(self, browser): @@ -85,12 +82,6 @@ class WebToolbar(gtk.Toolbar): self._link_add.connect('clicked', self._link_add_clicked_cb) self.insert(self._link_add, -1) self._link_add.show() - - self._tray_vis = ToolButton() - self._tray_vis.connect('clicked', self._tray_vis_clicked_cb) - self.insert(self._tray_vis, -1) - self.tray_set_empty() - self._tray_vis.show() progress_listener = progresslistener.get_instance() progress_listener.connect('location-changed', self._location_changed_cb) @@ -222,19 +213,3 @@ class WebToolbar(gtk.Toolbar): def _link_add_clicked_cb(self, button): self.emit('add-link') - def tray_set_empty(self): - self._tray_vis.set_icon('tray-empty') - self._tray_vis.set_sensitive(False) - - def tray_set_show(self): - self._tray_vis.set_icon('tray-show') - self._tray_vis.set_tooltip(_('Show Tray')) - self._tray_vis.set_sensitive(True) - - def tray_set_hide(self): - self._tray_vis.set_icon('tray-hide') - self._tray_vis.set_tooltip(_('Hide Tray')) - self._tray_vis.set_sensitive(True) - - def _tray_vis_clicked_cb(self, button): - self.emit('visibility-tray') -- cgit v0.9.1