Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/browser.py
Commit message (Collapse)AuthorAgeFilesLines
* Zoom full content, not just text SL #3541Manuel Quiñones2012-04-301-0/+3
| | | | | | | | | | This is the same behavior as in previous Browse and also the same behavior as in other Browsers (Epiphany, Firefox or Safari). Fixes bug: http://bugs.sugarlabs.org/ticket/3541 Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Handle new windows request and instead open links in new tabs #3507Manuel Quiñones2012-04-271-0/+17
| | | | | | | | | | | | | | | Browse being a Sugar activity only has one full screen window. This patchs adds a callback to the new window policy decision requested signal and handles new links in new tabs. If in need, we can also take the decision to not open the link, using: reason = navigation_action.get_reason() I have not come to a reason to do that yet. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Set default-font-size and monospace-font-size in WebKit based on GtkSettingsManuel Quiñones2012-04-101-0/+13
| | | | | | | | | | | | | | | | | | The font size that GtkSettings provides is multiplied to reach the default values in WebKitWebSettings in a common 96dpi display. Those are 12 for default-font-size and 10 for monospace-font-size, so the monospace font is calculated as 2 units less from the default Gtk+ font. This is similar to Epiphany approach, when the "Use system fonts" is checked in the preferences dialog. This workarounds #3428 "Browse should set DPI for XO screen", tested with screenshots that the resulting font sizes are similar to the previous Browse based on Gecko in the XO. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Daniel Drake <dsd@laptop.org>
* Basic PDF readingManuel Quiñones2012-03-221-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | When a request is made with a MIME type 'application/pdf', a new tab is opened next to the current one to show the document. If the document is remote, a download starts, and the progress is shown in the toolbar's URL entry. It can be cancelled with the X button, the same for cancelling the loading. Basic navigation is provided to allow a quick read of the PDF. The user can also save the document to the Journal to store it, and later it may be opened in Read for featureful usage. The controls are in a floating toolbar, at the bottom of the document. The PDF tabs are restored between sessions as expected. If the user clicks on a hyperlink in a PDF, a new tab is opened next to the current to browse it. This uses Evince, the same backend to display the PDF document as Read. And WebKit to download the document, as per other downloads in Browse. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Make the LinkInfo that is displayed at the bottom left themableSimon Schampijer2012-03-161-4/+13
| | | | | | | | | | | | | | | | Add a gtype_name to make it easily accessible from the theme. We have to do the same for the overlay as well in order to be able to set the 'background-color' of the label. Labels don't create their own window to render themselves into. Instead, they draw themselves directly onto their parents window, so we have to set the background-color of the parent in order to set the labels' background color [1]. The patch does adjust the gtype_names to be consistent. [1] http://developer.gnome.org/gtk-faq/stable/x810.html Signed-off-by: Simon Schampijer <simon@schampijer.de> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Fix session history when the current item is at the beginning of the historyManuel Quiñones2012-03-021-8/+9
| | | | | | | | | Removed conditionals that were checking for back history lenght == 0 to handle the case of an empty tab, and added a proper conditional: a tab is empty if the history list has only one item and that item is None. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Fix, closing tabs was not workingManuel Quiñones2012-02-071-1/+1
| | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Show loading message in the overlayManuel Quiñones2012-02-031-0/+28
| | | | | | | | | | | While Browse is loading, the overlay at the bottom-left of the screen -which is currently used to show the URL of a link when the mouse is over it- will show "Loading...", and later will append the requested URI to that message. This message replaces the one showing the link URL until the page load is done. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Append the current Sugar (Sucrose) version to the user agentSimon Schampijer2012-01-231-0/+7
| | | | | | | | | | | | | | | | | | | This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). One thing that is not perfectly handled by this patch is that we need to modify the user agent for every WebView (see [1]). Furthermore we need to modify the Sugar version in Browse accordingly with each Sugar release as the Sugar version is only availble in the shell and not in the toolkit. [1] https://lists.webkit.org/pipermail/webkit-gtk/2012-January/000893.html Signed-off-by: Simon Schampijer <simon@laptop.org>
* Bring back download functionality using WebKitSimon Schampijer2012-01-231-0/+14
| | | | | | | | | | | | | | This brings back the download functionality to Browse using WebKit, it handles the cases when you click on a link and the Browser is not setup to view this file. Requesting a download through Palettes is still to come. The code is inspired by the download code in Surf. Signed-off-by: Simon Schampijer <simon@laptop.org>
* Show link information when hovering over linkSimon Schampijer2012-01-071-27/+54
| | | | | | | | | When hovering over a link we show the link information at the lower left corner, like Epiphany does. Needs styling to be eve nicer. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Global history for URL autocompletion in URL entryManuel Quiñones2012-01-061-0/+22
| | | | | | | | | The sqlite backend to store the global history is maintained. There are two fields in the database that are left unused: bookmark and gecko_flags. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Cleanup in browser.py from unused xulrunner based codeManuel Quiñones2012-01-051-10/+0
| | | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Cleanup in browser.py from unused xulrunner based codeSimon Schampijer2012-01-051-89/+0
| | | | | Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Make view source using the Webkit APISimon Schampijer2012-01-051-47/+8
| | | | | | | Inspired by: http://wiki.disorder.sk/howto:webkit_snippets Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Normalize and autosearch url input.Manuel Quiñones2012-01-051-0/+68
| | | | | | | | | | This borrows code from Epiphany. Our normalize_or_autosearch_url is like the method of the same name in ephy-web-view.c . And the function has_web_scheme is like ephy_embed_utils_address_has_web_scheme in ephy-embed-utils.c Acked-by: Simon Schampijer <simon@laptop.org> Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Improve session store and restoreManuel Quiñones2012-01-041-22/+64
| | | | | | | | | | | | | | | | | | | | | | | | | This is the review from Simon Schampijer of commit 14102bcd65f015dcbf12d1406df8ef7ffb64d13d . * the sessionstore code is moved into Browser, we do have set_history_index/get_history_index already there, the TabbedView does use that path for their requests about the history * Rename a few bits s/session/history and the return value from self.get_back_forward_list() Use back_forward_list as variable * Fold _get_history and _set_history into their appropriate 'mother' methods * Make set_history_index a bit cleaner, the API provided by webkitgtk does not seem to cleanly allow our usage like: get_current_item_index and go_to_back_forward_item(index) also the API does seem to miss a back_forward_list.get_length() (see the code we have to do in _items_history_as_list) there only exist a back_forward_list.get_back_length() and back_forward_list.get_forward_length(). Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Fix URI for loading default pageManuel Quiñones2011-12-211-1/+1
| | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Remove old zoom methodsManuel Quiñones2011-12-201-16/+0
| | | | | | | Now the WebKit.WebView zoom_in() and zoom_out() methods are called and the page is effectively zoomed. Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Store and restore session for each tabManuel Quiñones2011-12-201-6/+6
| | | | | | | | For going to a specific item in the history, it uses go_back() method of WebKit.WebView. I tried also with WebKit.WebHistoryItem go_back(), seemed the proper solution, but the page wouldn't update. Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Fix bugs adding conditionals for BrowserNotebook with no pagesManuel Quiñones2011-12-051-6/+8
| | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Add needed imports for Gdk, GdkPixbuf and WebKitManuel Quiñones2011-12-011-2/+3
| | | | | | | Using pyflakes to check. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Add page scrolling, fix closing tabsManuel Quiñones2011-11-301-34/+26
| | | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Remove mozilla xpcom and hulahop, add WebKitManuel Quiñones2011-11-291-55/+45
| | | | | | | | | This commit breaks a lot of Browse functionality. This is marked in the code with a FIXME keyword. Original work was done by Daniel Drake. Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Rename sugar to sugar3Manuel Quiñones2011-11-291-4/+4
| | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Port from PyGTK to PyGI, renamingManuel Quiñones2011-11-251-27/+27
| | | | | | | Was done running the pygi-convert.sh script. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Fix for Follow link in new tabManuel Quiñones2011-09-121-0/+14
| | | | | | | | Proper code, using signals, instead of adding a reference of TabbedView to Browse objects. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Pylint cleanupSimon Schampijer2011-09-101-6/+5
|
* Browse: tabs usability improvedManuel Quiñones2011-09-101-20/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Add Tab button has been relocated next to the tab labels, allowing more space for the URL entry. Tabs are always shown. There is at least one tab. In that case, it cannot be closed. We prevent the closing by hiding the 'X' button. Also, the close image was sugarized. There is now a fixed width for tabs. The label text does ellipsize. The width depends on the amount of tabs. There is a maximum size that is used when there is extra space. There is a minimum size to prevent hiding the information. When a new tab is opened, it now shows an empty page, not the default page. In the future, we will add a hint in this empty page, similar to what we have for an empty Journal. Added the option to "follow link in new tab" in the link's palette. Added an icon for this item, and also the icon for "follow link" is also updated. When a new tab is opened via the '+' button, the focus goes to the URL entry in the toolbar. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Remove more unused importsGonzalo Odiard2011-08-291-4/+0
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Set and restore index in the history (OLPC #10779 / SL #2499)Gonzalo Odiard2011-06-181-1/+6
| | | | | | | | | | Restoring the history index instead of (re)loading the active URL will "distribute" the history over the Back and Forward buttons exactly the same as before Stop + Resume instead of putting it all on the Back button. [tweaked description] Signed-off-by: Sascha Silbe <silbe@activitycentral.com> Acked-By: Sascha Silbe <silbe@activitycentral.com>
* Generalise GetSourceListener to SaveListenerSascha Silbe2011-06-071-9/+15
| | | | | | | Slightly enhance and rename GetSourceListener so it can be used for waiting for completion of any save operation, not just GetSource. Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Fix overlong linesSascha Silbe2011-05-211-7/+10
| | | | Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* fix PEP8 whitespace issuesSascha Silbe2011-05-211-4/+3
| | | | Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* fix error writing file if there are not a url in the location barGonzalo Odiard2010-10-191-0/+2
|
*