Merge branch 'upstream-unstable'

This commit is contained in:
Yves-Alexis Perez 2011-03-15 19:31:36 +01:00
commit 3eb9643270
42 changed files with 8408 additions and 5814 deletions

View file

@ -1,5 +1,27 @@
This file is licensed under the terms of the expat license, see the file EXPAT.
v0.3.3:
+ Use 60 connections and 6 per host
+ Allow re-ordering of search engines
+ Resurrect right-click button on the panel
+ Page Next finds a and link tags again
+ Always save state when quitting
+ Support MD5 and SHA1 Link Fingerprints
+ Use lock-secure and lock-insecure icons
+ Replace unmaintained docs with FAQ
+ Work around copying bug in WebKitGTK+
+ In doubt always focus page on key press
+ Show transfer speed in tooltips
+ Support x-scheme-handler for GLib < 2.28
+ Improve link search, always require Return
+ Re-order tabs with Ctrl+Shift-PageUp/Down
+ Improve fragment (#) handling
+ Show Netscape plugins in about:version
+ Add Zoom Level combobox to Statusbar Features
+ Improve handling of cookie updates
+ Always show a minimum visible progress
+ Don't limit search engines in completion popup
v0.3.2
+ Fix opening address with Go button
+ Fix automigration of existing bookmarks

4
configure vendored
View file

@ -37,6 +37,9 @@ cd $CUR_DIR
#
checkPython()
{
if [ -z "$PYTHON" ] ; then
PYTHON=`which python2 2>/dev/null`
fi
if [ -z "$PYTHON" ] ; then
PYTHON=`which python 2>/dev/null`
fi
@ -85,6 +88,7 @@ checkWAF()
else
printf $GREEN"$WAF"$NORMAL"\n"
fi
WAF="$PYTHON $WAF"
}
# Generates a Makefile. Requires that $WAF is set.

847
data/faq.html Normal file
View file

@ -0,0 +1,847 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>midori:faq</title>
<meta name="generator" content="DokuWiki" />
<meta name="robots" content="noindex,nofollow" />
<meta name="date" content="2011-03-08T14:48:25+0100" />
<meta name="keywords" content="midori,faq" />
<link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="Xfce Wiki" />
<link rel="start" href="/" />
<link rel="contents" href="/midori/faq?do=index" title="Sitemap" />
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php" />
<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="/feed.php?mode=list&amp;ns=midori" />
<link rel="alternate" type="text/html" title="Plain HTML" href="/_export/xhtml/midori/faq" />
<link rel="alternate" type="text/plain" title="Wiki Markup" href="/_export/raw/midori/faq" />
<link rel="canonical" href="http://wiki.xfce.org/midori/faq" />
<link rel="stylesheet" type="text/css" href="faq.css" />
<script type="text/javascript" ><!--//--><![CDATA[//><!--
var NS='midori';var JSINFO = {"id":"midori:faq","namespace":"midori"};
//--><!]]></script>
<script type="text/javascript" charset="utf-8" src="/lib/exe/js.php?tseed=1299220652" ></script>
</head>
<body>
<div class="dokuwiki export">
<!-- TOC START -->
<div class="toc">
<div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
<div id="toc__inside">
<ul class="toc">
<li class="level1"><div class="li"><span class="li"><a href="#midori_-_frequently_asked_questions" class="toc">Midori - Frequently asked questions</a></span></div></li>
<li class="level1"><div class="li"><span class="li"><a href="#getting_started" class="toc">Getting started</a></span></div>
<ul class="toc">
<li class="level2"><div class="li"><span class="li"><a href="#about_midori" class="toc">About Midori</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#common_problems" class="toc">Common problems</a></span></div></li>
</ul>
</li>
<li class="level1"><div class="li"><span class="li"><a href="#features" class="toc">Features</a></span></div>
<ul class="toc">
<li class="level2"><div class="li"><span class="li"><a href="#web_applicationsprivate_browsing" class="toc">Web Applications/ Private Browsing</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#download_managers" class="toc">Download Managers</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#proxy_servers" class="toc">Proxy servers</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#using_the_keyboard" class="toc">Using the Keyboard</a></span></div>
<ul class="toc">
<li class="level3"><div class="li"><span class="li"><a href="#following_links" class="toc">Following Links</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#toggling_between_pages" class="toc">Toggling between pages</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#customizing_keyboard_shortcuts" class="toc">Customizing keyboard shortcuts</a></span></div></li>
</ul>
</li>
<li class="level2"><div class="li"><span class="li"><a href="#mouse_gestures" class="toc">Mouse Gestures</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#spell_check" class="toc">Spell check</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#user_scripts" class="toc">User scripts</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#user_styles" class="toc">User styles</a></span></div></li></ul>
</li></ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1"><a name="midori_-_frequently_asked_questions" id="midori_-_frequently_asked_questions">Midori - Frequently asked questions</a></h1>
<div class="level1">
<p>
<strong>This document is licensed under the <acronym title="GNU Lesser General Public License">LGPL</acronym> 2.1.</strong>
</p>
<p>
This is a list of frequently asked questions about the Midori Web Browser. Anyone feel free to improve and/ or extend this page, but keep it clean and easy to read for other Xfce users.
</p>
</div>
<!-- EDIT1 SECTION "Midori - Frequently asked questions" [1-289] -->
<h1 class="sectionedit2"><a name="getting_started" id="getting_started">Getting started</a></h1>
<div class="level1">
</div>
<!-- EDIT2 SECTION "Getting started" [290-319] -->
<h2 class="sectionedit3"><a name="about_midori" id="about_midori">About Midori</a></h2>
<div class="level2">
</div>
<h4><a name="what_is_midori_and_why_should_i_use_it" id="what_is_midori_and_why_should_i_use_it">What is &quot;Midori&quot; and why should I use it?</a></h4>
<div class="level4">
<p>
Midori is a Web Browser, that aims to be lightweight and fast. It aligns well with the Xfce philosophy of making the most out of available resources.
</p>
</div>
<h4><a name="how_to_pronounce_midori_and_what_does_the_name_mean" id="how_to_pronounce_midori_and_what_does_the_name_mean">How to pronounce Midori and what does the name mean?</a></h4>
<div class="level4">
<p>
Pronounce it “midoɺi”, with a Spanish/ Japanese “r” or “Mee-Doh-Ree” in English or read it Italian. The name comes from the Japanese word 緑 (みどり) for the colour “green”.
</p>
</div>
<h4><a name="what_does_the_logo_mean" id="what_does_the_logo_mean">What does the logo mean?</a></h4>
<div class="level4">
<p>
The paw of a green cat. Obviously. Also it resembles the letter “M” in “Midori”. The curving is supposed to emphasize speed.
</p>
</div>
<h4><a name="on_which_platforms_does_midori_run_currently" id="on_which_platforms_does_midori_run_currently">On which platforms does Midori run currently?</a></h4>
<div class="level4">
<p>
Midori is basically very portable and should run on all platforms that its dependencies support.
</p>
</div>
<h4><a name="under_which_license_is_midori_distributed" id="under_which_license_is_midori_distributed">Under which license is Midori distributed?</a></h4>
<div class="level4">
<p>
Midori and all delivered artwork are licensed under the LGPL2.
</p>
</div>
<!-- EDIT3 SECTION "About Midori" [320-1212] -->
<h2 class="sectionedit4"><a name="common_problems" id="common_problems">Common problems</a></h2>
<div class="level2">
</div>
<h4><a name="why_does_google_mailcalendarmaps_facebook_not_work_or_show_mobile_version" id="why_does_google_mailcalendarmaps_facebook_not_work_or_show_mobile_version">Why does Google Mail/ Calendar/ Maps, Facebook not work or show mobile version?</a></h4>
<div class="level4">
<p>
Because they discriminate against your browser. Go to Preferences &gt; Network &gt; Identify As, and choose Safari.
Many other websites use similar means of detecting the browser.
</p>
<p>
Ideally Google would follow <a href="http://code.google.com/p/doctype/wiki/ArticleGoogleChromeCompatFAQ#UserAgent_Detection" class="urlextern" title="http://code.google.com/p/doctype/wiki/ArticleGoogleChromeCompatFAQ#UserAgent_Detection" rel="nofollow">their own recommendation</a> at some point.
</p>
</div>
<h4><a name="there_are_missing_iconswarnings" id="there_are_missing_iconswarnings">There are missing icons/ warnings</a></h4>
<div class="level4">
<p>
The set of themed icons Midori can use is very limited. For instance icons for a new tab or the throbber are not guaranteed to be available. To fix this, install a Freedesktop.org <acronym title="specification">spec</acronym> compliant icon theme, such as Tango or Gnome, or one that is compatible with these.
</p>
</div>
<h4><a name="tweaking_midori_on_the_gtk_level" id="tweaking_midori_on_the_gtk_level">Tweaking Midori on the Gtk level</a></h4>
<div class="level4">
<p>
If you don&#039;t have a desktop application that takes care of Gtk settings or if your interface doesn&#039;t support a particular feature, you can modify any settings easily manually by specifying them in a text file called ~/.gtkrc-2.0 or /etc/gtk-2.0/gtkrc:
</p>
<p>
Use Tango as a fallback for your icon theme:
</p>
<pre class="code">gtk-icon-theme-name = &quot;MySuperFancyTheme&quot;
gtk-fallback-icon-theme = &quot;Tango&quot;</pre>
<p>
Use a smaller toolbar:
</p>
<pre class="code">gtk-toolbar-icon-size = GTK_ICON_SIZE_SMALL_TOOLBAR</pre>
<p>
Enable changing hotkeys while hovering menu items:
</p>
<pre class="code">gtk-can-change-accels = 1</pre>
</div>
<h4><a name="midori_crashes_shortly_before_pages_are_loaded" id="midori_crashes_shortly_before_pages_are_loaded">Midori crashes shortly before pages are loaded</a></h4>
<div class="level4">
<p>
There appears to be an issue with Glib 2.16. The recommended solution is to upgrade your Glib package to 2.18.
</p>
</div>
<h4><a name="flashnetscape_plugins_don_t_work" id="flashnetscape_plugins_don_t_work">Flash/ Netscape plugins don&#039;t work</a></h4>
<div class="level4">
<p>
You need to set MOZ_PLUGIN_PATH, for example like this:
</p>
<pre class="code bash"><span class="kw3">export</span> <span class="re2">MOZ_PLUGIN_PATH</span>=<span class="st0">&quot;/usr/lib/mozilla/plugins&quot;</span></pre>
<p>
The official Flash plugin is called libflashplayer.so .
</p>
<p>
You can either run that above line and run Midori in the same terminal afterwards or, for the long term, put it in ~/.bash_profile or /etc/profile.d or your respective distribution&#039;s place for this.
</p>
</div>
<h4><a name="flash_is_crashing_all_the_time" id="flash_is_crashing_all_the_time">Flash is crashing all the time</a></h4>
<div class="level4">
<p>
Try searching for a package named nspluginwrapper or similar in your distribution repositories. It implements plugins in their own process so they can&#039;t drag down the whole browser.
</p>
</div>
<h4><a name="https_urls_won_t_load" id="https_urls_won_t_load">HTTPS URLS won&#039;t load</a></h4>
<div class="level4">
<p>
That&#039;s a problem with WebKit. You can work around it to some extent if you start Midori like so:
</p>
<pre class="code bash"><span class="kw3">export</span> <span class="re2">WEBKIT_IGNORE_SSL_ERRORS</span>=<span class="st0">&quot;1&quot;</span> midori</pre>
</div>
<h4><a name="javascript_popup_windows" id="javascript_popup_windows">Javascript Popup windows</a></h4>
<div class="level4">
<p>
By default, Midori blocks all popup windows that openen on their own. With WebKitGTK+ 1.1.11 or higher, you can use a hidden setting to enable these windows.
</p>
<ol>
<li class="level1"><div class="li"> Quit Midori</div>
</li>
<li class="level1"><div class="li"> Open the file ~/.config/midori/config</div>
</li>
<li class="level1"><div class="li"> Add a line “javascript-can-open-windows-automatically=true”</div>
</li>
</ol>
<p>
There is also a preference in the git version as of 2010-03-23.
</p>
</div>
<h4><a name="scroll_with_middle_mouse_button" id="scroll_with_middle_mouse_button">Scroll with middle mouse button</a></h4>
<div class="level4">
<p>
<a href="http://ubuntuforums.org/showthread.php?t=478418" class="urlextern" title="http://ubuntuforums.org/showthread.php?t=478418" rel="nofollow">http://ubuntuforums.org/showthread.php?t=478418</a>
</p>
</div>
<h4><a name="html5_video_doesn_t_play" id="html5_video_doesn_t_play">HTML5 Video doesn&#039;t play</a></h4>
<div class="level4">
<p>
You need to have GStreamer plugins installed which implement the codecs.
</p>
<ol>
<li class="level1"><div class="li"> You need gstreamer0.10-pulse if you&#039;re using PulseAudio.</div>
</li>
<li class="level1"><div class="li"> You may need gstreamer0.10-alsa for ALSA, depending on your distribution.</div>
</li>
<li class="level1"><div class="li"> With Arch Linux, you may need to install liboil explicitly if it is not installed already (see <a href="https://bugs.archlinux.org/task/20945" class="urlextern" title="https://bugs.archlinux.org/task/20945" rel="nofollow">this</a> bug report).</div>
</li>
<li class="level1"><div class="li"> You need plugins for Theora, gstreamer0.10-base and <acronym title="Motion Picture Experts Group">MPEG</acronym>-4 incluing aac (e.g. gst-plugins-faad), gstreamer0.10-bad. For WebM, you&#039;ll need plugins for vorbis (-base), matroska (-good), and vp8 (-bad). Have a look at <a href="http://www.gstreamer.net/documentation/plugins.html" class="urlextern" title="http://www.gstreamer.net/documentation/plugins.html" rel="nofollow">http://www.gstreamer.net/documentation/plugins.html</a> for details.</div>
</li>
<li class="level1"><div class="li"> For Youtube or Vimeo, you need WebKitGTK+ 1.1.20 or newer.</div>
</li>
</ol>
</div>
<h4><a name="java_doesn_t_work_applets_don_t_show_up" id="java_doesn_t_work_applets_don_t_show_up">Java doesn&#039;t work, applets don&#039;t show up</a></h4>
<div class="level4">
<p>
Java is supported in WebKitGTK+ since 1.1.22. If you need Java, you need to upgrade to at least that version. Sun/ Oracle Java as well as IcedTea are known to work. Distribution specific setup might be required, such as setting LD_LIBRARY_PATH to include the location of libxul.so and making a symbolic link for libnpjp2.so to /usr/lib/mozilla.
</p>
<p>
icedtea6 version 1.8 and above has been known to crash midori. If this is the case for you, try sun-jre.
</p>
</div>
<h4><a name="are_socks_proxy_servers_supported" id="are_socks_proxy_servers_supported">Are SOCKS proxy servers supported?</a></h4>
<div class="level4">
<p>
Currently only <acronym title="Hyper Text Transfer Protocol">HTTP</acronym> proxy servers are supported directly. A way to use SOCKS on Unix is to use tsocks with <acronym title="Secure Shell">SSH</acronym> as follows:
</p>
<ol>
<li class="level1"><div class="li"> Install &#039;tsocks&#039;</div>
</li>
<li class="level1"><div class="li"> Open /etc/tsocks.conf in an editor</div>
</li>
<li class="level1"><div class="li"> Type something like this, you can choose the port freely: <pre class="code">server = 127.0.0.1
server_type = 5
server_port = 5555</pre>
</div>
</li>
<li class="level1"><div class="li"> Open an <acronym title="Secure Shell">SSH</acronym> connection with the same port: <pre class="code"> ssh -D localhost:5555 myhost.com </pre>
</div>
</li>
<li class="level1"><div class="li"> Run Midori with “tsocks” in front of it: <pre class="code"> tsocks midori </pre>
</div>
</li>
<li class="level1"><div class="li"> Now you can use for example <a href="http://www.whatsmyip.org/" class="urlextern" title="http://www.whatsmyip.org/" rel="nofollow">http://www.whatsmyip.org/</a> to verify that you are using a SOCKS connection. The IP address should match the one of your <acronym title="Secure Shell">SSH</acronym> host. Remember to keep the <acronym title="Secure Shell">SSH</acronym> login running, and don&#039;t suspend it, otherwise it won&#039;t work.</div>
</li>
<li class="level1"><div class="li"> If the connection fails for some reason, you should see a connection error.</div>
</li>
</ol>
</div>
<h4><a name="how_do_i_get_rid_of_the_menubar" id="how_do_i_get_rid_of_the_menubar">How do I get rid of the menubar?</a></h4>
<div class="level4">
<p>
In the menubar, go to View → Toolbars → Menubar, voilà the menubar is gone and a new icon appears at the right end of the toolbar. Click the icon to access functionality that otherwise sits in the menubar.
Midori 0.3.2 disables the menubar by default.
</p>
</div>
<h4><a name="why_can_t_i_use_periods_when_searching_from_the_location_bar" id="why_can_t_i_use_periods_when_searching_from_the_location_bar">Why can&#039;t I use periods when searching from the location bar?</a></h4>
<div class="level4">
<p>
Midori tries to make a smart guess on whether you are searching for something or typing a valid address by hand. Yet there are ambiguous cases so it fails.
</p>
<p>
Try using &#039;g&#039; in front of the search terms, like &#039;g Ms.Marple&#039;. The &#039;g&#039; is a token that tells the browser you want to use Google. See Tools &gt; Manage Search Engines or right-click the location bar and select the menu item, to look at search engines and tokens.
</p>
</div>
<h4><a name="how_can_i_reload_and_bypass_the_cache" id="how_can_i_reload_and_bypass_the_cache">How can I reload and bypass the cache?</a></h4>
<div class="level4">
<p>
Hold the Shift key while clicking Refresh in the toolbar (this works in Chromium, Mozilla, Opera and Safari, too).
Since Midori 0.3.2 you can use Ctrl+Shift+R.
</p>
</div>
<h4><a name="how_do_i_make_tabs_pinnedstickyminimized" id="how_do_i_make_tabs_pinnedstickyminimized">How do I make tabs pinned/ sticky/ minimized?</a></h4>
<div class="level4">
<p>
Right-click the tab label, and click &#039;Minimize&#039;.
</p>
</div>
<h4><a name="why_doesn_t_google_live_search_work" id="why_doesn_t_google_live_search_work">Why doesn&#039;t Google &quot;live search&quot; work?</a></h4>
<div class="level4">
<p>
You need to set Preferences &gt; Network &gt; Identify As to Firefox.
</p>
</div>
<h4><a name="opening_html_email_with_mutt" id="opening_html_email_with_mutt">Opening html email with Mutt</a></h4>
<div class="level4">
<p>
Place the following in ~/.mutt/mailcap or ~/.mailcap:
</p>
<pre class="code">text/html; midori -a &#039;%s&#039;; test=test -n &quot;$DISPLAY&quot;; nametemplate=%s.html</pre>
</div>
<h4><a name="scrolling_on_website_xyz_is_very_slow" id="scrolling_on_website_xyz_is_very_slow">Scrolling on website xyz is very slow</a></h4>
<div class="level4">
<ol>
<li class="level1"><div class="li"> Go to Tools &gt; Extensions</div>
</li>
<li class="level1"><div class="li"> Enable &#039;User Addons&#039; if it&#039;s not yet enabled</div>
</li>
<li class="level1"><div class="li"> Create a text file .local/share/midori/styles/scrollfix.user.css</div>
</li>
<li class="level1"><div class="li"> Put this into the file: * {-webkit-box-shadow: none !important;}</div>
</li>
</ol>
</div>
<h4><a name="file_opening_doesn_t_workpdfs_are_opened_with_gimp" id="file_opening_doesn_t_workpdfs_are_opened_with_gimp">File opening doesn&#039;t work/ PDFs are opened with GIMP</a></h4>
<div class="level4">
<p>
Midori opens files with GIO, and falls back to xdg-open, exo-open or gnome-open if these are available. All of this relies on freedesktop.org <acronym title="Multipurpose Internet Mail Extension">MIME</acronym> configuration. To tweak this there are multiple options:
</p>
<ol>
<li class="level1"><div class="li"> Use &#039;Open With&#039; with a graphical file manager</div>
</li>
<li class="level1"><div class="li"> Edit ~/.local/share/applications/defaults.list with a text editor</div>
</li>
<li class="level1"><div class="li"> Run something like xdg-mime default evince.desktop application/pdf</div>
</li>
</ol>
<p>
xdg-open knows how to handle GNOME, KDE and Xfce.
LXDE is unfortunately not supported yet, see <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26058" class="urlextern" title="https://bugs.freedesktop.org/show_bug.cgi?id=26058" rel="nofollow">https://bugs.freedesktop.org/show_bug.cgi?id=26058</a>
</p>
</div>
<h4><a name="open_magnetircaptand_friends_with_an_application" id="open_magnetircaptand_friends_with_an_application">Open magnet:, irc:, apt: and friends with an application</a></h4>
<div class="level4">
<p>
As of git 2011-03-05 02:40:00 UTC and Midori 0.3.3 you can
</p>
<p>
Add a line to ~/.local/share/applications/mimeapps.list:
</p>
<pre class="code"> x-scheme-handler/magnet=transmission-gtk.desktop</pre>
<p>
Or install an application which advertises the scheme like so:
</p>
<pre class="code"> MimeType=x-scheme-handler/magnet;</pre>
<p>
Note that incomplete .desktop files will silently fail and it will look as if it doesn&#039;t exist.
</p>
</div>
<!-- EDIT4 SECTION "Common problems" [1213-8887] -->
<h1 class="sectionedit5"><a name="features" id="features">Features</a></h1>
<div class="level1">
</div>
<!-- EDIT5 SECTION "Features" [8888-8910] -->
<h2 class="sectionedit6"><a name="web_applicationsprivate_browsing" id="web_applicationsprivate_browsing">Web Applications/ Private Browsing</a></h2>
<div class="level2">
<p>
There are two closely related features to open websites as dedicated windows of their own. You can do the following to use them:
</p>
<ol>
<li class="level1"><div class="li"> File (or Globe button) → Private Browsing</div>
</li>
<li class="level1"><div class="li"> Right-click a hyperlink → Open as Web Application</div>
</li>
<li class="level1"><div class="li"> Add or Edit a bookmark → [x] Run as web application</div>
</li>
<li class="level1"><div class="li"> Type midori -a <a href="http://foo.bar" class="urlextern" title="http://foo.bar" rel="nofollow">http://foo.bar</a> on a command line</div>
</li>
</ol>
<p>
You can also add options such as -e Fullscreen, -e Navigationbar or -e Statusbar (as of Midori 0.2.9 midori help-execute will list all available commands)
</p>
<p>
A window like this is always a separate process, so crashes don&#039;t affect the normal browser session. No sensitive data such as cookies, history or bookmarks are stored. No extensions are loaded. Panels are not available.
</p>
<p>
As of Midori 0.2.9 Private Browsing uses preferences, cookies, keyboard shortcuts and search engines from the normal session, but it won&#039;t save any changes. This behaviour can be emulated from the command line with ”-a” and ”-c”.
</p>
</div>
<!-- EDIT6 SECTION "Web Applications/ Private Browsing" [8911-9946] -->
<h2 class="sectionedit7"><a name="download_managers" id="download_managers">Download Managers</a></h2>
<div class="level2">
<p>
Midori can start downloads with an external download manager. To use that feature, open up the “Preferences” dialog, click the “Applications” tab, insert the name of a program executable or shell script in the “Download Manager” input box, right-click a link, and click “Download with Download Manager”. There is a list of download managers on <a href="http://en.wikipedia.org/wiki/Comparison_of_download_managers" class="urlextern" title="http://en.wikipedia.org/wiki/Comparison_of_download_managers" rel="nofollow">Wikipedia</a>.
</p>
</div>
<h4><a name="admiral" id="admiral">Admiral</a></h4>
<div class="level4">
<p>
<a href="http://bbs.archlinux.org/viewtopic.php?id=73504" class="urlextern" title="http://bbs.archlinux.org/viewtopic.php?id=73504" rel="nofollow">Admiral</a> is a shell script that utilizes <a href="http://aria2.sourceforge.net/" class="urlextern" title="http://aria2.sourceforge.net/" rel="nofollow">aria2</a>, <a href="http://freshmeat.net/projects/zenity" class="urlextern" title="http://freshmeat.net/projects/zenity" rel="nofollow">Zenity</a>, and <a href="http://linuxappfinder.com/package/libnotify-bin" class="urlextern" title="http://linuxappfinder.com/package/libnotify-bin" rel="nofollow">libnotify-bin</a>. Admiral allows you to choose the directory to which you wish download a file with a <acronym title="Graphical User Interface">GUI</acronym> dialog, sends a desktop notification if the download fails and when starting and finishing the download, and logs failures.
</p>
</div>
<h4><a name="aria2" id="aria2">Aria2</a></h4>
<div class="level4">
<p>
<a href="http://aria2.sourceforge.net/" class="urlextern" title="http://aria2.sourceforge.net/" rel="nofollow">aria2</a> is a lightweight multi-protocol &amp; multi-source, cross platform download utility operated in command-line. It supports <acronym title="Hyper Text Transfer Protocol">HTTP</acronym>/HTTPS, <acronym title="File Transfer Protocol">FTP</acronym>, BitTorrent and Metalink. aria2 has built-in <acronym title="Extensible Markup Language">XML</acronym>-<acronym title="Remote Procedure Call">RPC</acronym> interface. You can manipulate aria2 via <acronym title="Extensible Markup Language">XML</acronym>-<acronym title="Remote Procedure Call">RPC</acronym> interface.
</p>
</div>
<h4><a name="uget_former_urlgfe" id="uget_former_urlgfe">Uget (former Urlgfe)</a></h4>
<div class="level4">
<p>
<a href="http://urlget.sourceforge.net/" class="urlextern" title="http://urlget.sourceforge.net/" rel="nofollow">UGet</a> is a cross platform download manager. It can watch the clipboard to offer download dialogues automatically and it can be configured to pass through files, such as torrents, to the appropriate handler.
</p>
</div>
<h4><a name="gget" id="gget">GGet</a></h4>
<div class="level4">
<p>
<a href="http://live.gnome.org/GGet" class="urlextern" title="http://live.gnome.org/GGet" rel="nofollow">GGet</a> is a download manager primarily for the GNOME desktop, but it also works in other unix/ GTk+ environments.
</p>
</div>
<!-- EDIT7 SECTION "Download Managers" [9947-11615] -->
<h2 class="sectionedit8"><a name="proxy_servers" id="proxy_servers">Proxy servers</a></h2>
<div class="level2">
<p>
By running a local proxy you can modify web content even before it has reached Midori. That allows you to do things similar to what user scripts and user styles provide and even others that neither is suitable for.
</p>
<p>
To use Midori with a proxy server, there are two options:
</p>
<ol>
<li class="level1"><div class="li"> WebKit is built with libcurl. Define an environment variable http_proxy and set it to your proxy server like so:</div>
</li>
</ol>
<pre class="code">export http_proxy = 234.22.154.11:8000</pre>
<ol>
<li class="level1"><div class="li"> 2. WebKit is built with libsoup. Midori &gt;= 0.1.2, is built with libsoup. Try to open some web page. Now open the preferences, and you should see a Network tab with a &#039;Proxy server&#039; field.</div>
</li>
</ol>
</div>
<h4><a name="privoxy" id="privoxy">Privoxy</a></h4>
<div class="level4">
<p>
Privoxy is a non-caching web proxy with filter capabilites and particular support for blocking advertisements before even loading them.
</p>
<p>
<a href="http://www.privoxy.org/faq/" class="urlextern" title="http://www.privoxy.org/faq/" rel="nofollow">http://www.privoxy.org/faq/</a>
</p>
</div>
<h4><a name="mousehole" id="mousehole">Mousehole</a></h4>
<div class="level4">
<p>
Mousehole is a scriptable proxy server written in Ruby.
</p>
<p>
<a href="http://code.whytheluckystiff.net/mouseHole/" class="urlextern" title="http://code.whytheluckystiff.net/mouseHole/" rel="nofollow">http://code.whytheluckystiff.net/mouseHole/</a>
</p>
</div>
<h4><a name="polipo" id="polipo">Polipo</a></h4>
<div class="level4">
<p>
Polipo is a caching web proxy (a web cache) designed to be used by one
person or a small group of people. It is similar in spirit to WWWOFFLE, but
the implementation techniques are more like the ones used by Squid.
</p>
<p>
<a href="http://www.pps.jussieu.fr/~jch/software/polipo/" class="urlextern" title="http://www.pps.jussieu.fr/~jch/software/polipo/" rel="nofollow">http://www.pps.jussieu.fr/~jch/software/polipo/</a>
</p>
</div>
<!-- EDIT8 SECTION "Proxy servers" [11616-12858] -->
<h2 class="sectionedit9"><a name="using_the_keyboard" id="using_the_keyboard">Using the Keyboard</a></h2>
<div class="level2">
</div>
<!-- EDIT9 SECTION "Using the Keyboard" [12859-12890] -->
<h3 class="sectionedit10"><a name="following_links" id="following_links">Following Links</a></h3>
<div class="level3">
<p>
To enable Hints in Midori [similar to those vimperator provides in Firefox], press .
</p>
<p>
With hints enabled, type the link number, and press Enter to open the link in the current tab, or Ctrl-Enter to open the link in a new tab. To clear a typed link number before pressing Enter or Ctrl-Enter, use Escape.
</p>
</div>
<!-- EDIT10 SECTION "Following Links" [12891-13222] -->
<h3 class="sectionedit11"><a name="toggling_between_pages" id="toggling_between_pages">Toggling between pages</a></h3>
<div class="level3">
<p>
Enable the History List extension Tools → Extensions. Now you can conveniently toggle between any two pages with Ctrl-Tab.
</p>
</div>
<!-- EDIT11 SECTION "Toggling between pages" [13223-13382] -->
<h3 class="sectionedit12"><a name="customizing_keyboard_shortcuts" id="customizing_keyboard_shortcuts">Customizing keyboard shortcuts</a></h3>
<div class="level3">
<p>
Enable the Shortcuts extension Tools → Extensions. To edit a keybinding Tools → Customize Shortcuts…
</p>
</div>
<!-- EDIT12 SECTION "Customizing keyboard shortcuts" [13383-13531] -->
<h2 class="sectionedit13"><a name="mouse_gestures" id="mouse_gestures">Mouse Gestures</a></h2>
<div class="level2">
<p>
Midori has a Mouse Gestures extension (since git 2009-01-21).
</p>
<p>
As of 0.2.5 the right button initiates gestures.
</p>
<p>
You can change the button using a hidden option:
</p>
<ol>
<li class="level1"><div class="li"> Create a text file ~/.config/midori/extensions/libmouse-gestures.so/config .</div>
</li>
<li class="level1"><div class="li"> Type the following in there:</div>
</li>
</ol>
<pre class="code"> [settings]
button=2</pre>
<p>
For a quick and dirty overview of the gestures in the current release take a look at the <a href="http://www.matthiaskruk.de/midori/mouse-gestures.pdf" class="urlextern" title="http://www.matthiaskruk.de/midori/mouse-gestures.pdf" rel="nofollow">preliminary manual</a>.
Further information is available at the <a href="http://www.matthiaskruk.de/midori" class="urlextern" title="http://www.matthiaskruk.de/midori" rel="nofollow">MGX website</a>.
</p>
<p>
Additionally, there are programs allowing mouse gestures system-wide, for example <a href="http://easystroke.wiki.sourceforge.net/" class="urlextern" title="http://easystroke.wiki.sourceforge.net/" rel="nofollow">EasyStroke</a>.
</p>
</div>
<!-- EDIT13 SECTION "Mouse Gestures" [13532-14263] -->
<h2 class="sectionedit14"><a name="spell_check" id="spell_check">Spell check</a></h2>
<div class="level2">
<p>
First enable spell checking:
Edit→Preferences→Behavior and Check off “Enable Spell Checking”.
</p>
<p>
Now while typing any errors should get underlined in red. To get suggestions, highlight the word and right-click. Should see a list of suggestions on the top of the menu.
</p>
</div>
<!-- EDIT14 SECTION "Spell check" [14264-14557] -->
<h2 class="sectionedit15"><a name="user_scripts" id="user_scripts">User scripts</a></h2>
<div class="level2">
</div>
<h4><a name="overview" id="overview">Overview</a></h4>
<div class="level4">
<p>
UserScripts are scripts applied on some, or on all web pages. They can modify pages locally to add or alter functionality. That includes fixing bugs in web pages. User scripts are also available in other browsers, in the form of <a href="http://www.greasespot.net" class="urlextern" title="http://www.greasespot.net" rel="nofollow">Mozilla&#039;s Greasemonkey</a> or <a href="http://www.opera.com/support/tutorials/userjs/" class="urlextern" title="http://www.opera.com/support/tutorials/userjs/" rel="nofollow">Opera&#039;s User JavaScript</a>.
</p>
</div>
<h4><a name="how_to_install_a_userscript" id="how_to_install_a_userscript">How to install a UserScript</a></h4>
<div class="level4">
<p>
First, you need to find some scripts (or write your own). You can find some at <a href="http://userscripts.org/" class="urlextern" title="http://userscripts.org/" rel="nofollow">userscripts.org</a>. As explained previously, a lot of scripts work, while others do not work.
</p>
<p>
To install a userscript, you have to download the script as a file, and put it in the following directory <strong>~/.local/share/midori/scripts</strong> (you may need to create that directory if it does not exist). Midori will automatically see and use it, which you can also see in the user scripts panel.
</p>
<p>
Note, if the script is only shown as source code on the page, you first have to create a new text file in a text editor, copy the source code into the new file, and save it as my-user-script.js where ”.js” is the extension.
</p>
</div>
<h4><a name="flash_blocking_via_a_user_script" id="flash_blocking_via_a_user_script">Flash blocking via a User script</a></h4>
<div class="level4">
<p>
You can use <a href="http://userscripts.org/scripts/show/45343" class="urlextern" title="http://userscripts.org/scripts/show/45343" rel="nofollow">BlockFlash2</a> as a user script which replaces all Flash elements with a button that says “Play Flash”.
</p>
</div>
<h4><a name="flash_blocking_via_a_user_style" id="flash_blocking_via_a_user_style">Flash blocking via a User style</a></h4>
<div class="level4">
<p>
You can also use <a href="http://rightfootin.blogspot.com/2009/04/flashblock-wannabe.html" class="urlextern" title="http://rightfootin.blogspot.com/2009/04/flashblock-wannabe.html" rel="nofollow">FlashBlock WannaBe</a> as a user script in order to replace Flash elements with placeholders and load them on click. The script is pretty advanced compared to most Flash blockers found on the web.
</p>
</div>
<!-- EDIT15 SECTION "User scripts" [14558-16243] -->
<h2 class="sectionedit16"><a name="user_styles" id="user_styles">User styles</a></h2>
<div class="level2">
</div>
<h4><a name="overview1" id="overview1">Overview</a></h4>
<div class="level4">
<p>
User styles are <acronym title="Cascading Style Sheets">CSS</acronym> Cascading Style sheets that are loaded locally and applied on top of web pages, similar to User scripts, in order to add or alter functionality and also fix bugs.
</p>
</div>
<h4><a name="how_to_install_a_user_style" id="how_to_install_a_user_style">How to install a user style</a></h4>
<div class="level4">
<p>
First, you need to find some styles (or write your own). You can find some at <a href="http://userstyles.org/" class="urlextern" title="http://userstyles.org/" rel="nofollow">userstyles.org</a>. Many styles may or may not work, depending on whether the author decided to use browser specific features.
</p>
<p>
To install a user style, you have to download the style as a file, and put it in the following directory <strong>~/.local/share/midori/styles</strong> (you may need to create that directory if it does not exist). Midori will automatically see and use it, which you can also see in the user styles panel.
</p>
<p>
Note, if the style is only shown as source code on the page, you first have to create a new text file in a text editor, copy the source code into the new file, and save it as my-user-style.css where ”.css” is the extension.
</p>
</div>
<h4><a name="how_to_install_a_user_style_before_midori_0020" id="how_to_install_a_user_style_before_midori_0020">How to install a user style before Midori 0.0.20</a></h4>
<div class="level4">
<p>
Open up the Preferences and use the file chooser button beside User Stylesheet to choose a style sheet file. The style sheet will from now on be applied to all sites automatically.
</p>
</div>
<h4><a name="a_user_css_to_display_the_url_when_a_link_is_hovered" id="a_user_css_to_display_the_url_when_a_link_is_hovered">A user css to display the url when a link is hovered</a></h4>
<div class="level4">
<p>
This user css is used to display the corresponding url when a link is hovered. This is similar to what chromium/chrome provides when hovering over a link, shown on the bottom left of the page. Add the following to <strong>~/.local/share/midori/styles</strong>, then restart Midori and make sure that it is enabled Tools → Userstyles.
</p>
<p>
Customize as needed:
</p>
<pre class="code">a[href]:hover {
text-decoration: none !important;
}
a[href]:hover:after {
content: attr(href);
position: fixed; left: 4px; bottom: 4px;
padding: 0 6px !important;
max-width: 95%; overflow: hidden;
white-space: nowrap; text-overflow: ellipsis;
font:10pt sans-serif !important; text-shadow: 0 0 12px white;
background-color: ButtonFace !important; color: ButtonText !important;
opacity: 0.8; outline: ButtonFace solid thick;
z-index: 9999;
}</pre>
</div>
<!-- EDIT16 SECTION "User styles" [16244-] --></div>
</body>
</html>

View file

@ -1,255 +0,0 @@
.. |(version)| replace:: 0.2.2
'''''''
Midori
'''''''
-----------------------------------------
A lightweight, portable GTK+ web browser
-----------------------------------------
:Authors: Christian Dywan
:Date: $Date: 2009-11-18 18:20:11 +0100 (Wed, 18 Nov 2009) $
:Version: |(version)|
Copyright © 2008-2009
This documentation is distributed under the terms of the
`GNU Lesser General Public License`_; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.. contents::
Introduction
''''''''''''
What is Midori
--------------
Midori is a lightweight and portable web browser based on Gtk+. The
interface is designed to be intuitive yet powerful.
* Full integration with GTK+2.
* Fast rendering with WebKit.
* Tabs, windows and session management.
* Flexibly configurable Web Search.
* User scripts and user styles support.
* Straightforward bookmark management.
* Customizable and extensible interface.
* Extensions written in C.
Running Midori
--------------
* If you are using a graphical desktop environment you will usually find
Midori in the menu under Network.
* You can also run Midori from a console or a Run dialog.
See also `Command line usage`.
$ midori
A browser window appears where you can start navigating the web right away.
The main interface
--------------------------
The main browser window consists of a few basic elements:
* The menubar. It's pretty much standardized and gives you access to
allmost all features, many of the items have a keyboard shortcut by default.
See also `Keyboard shortcuts`_.
* The navigationbar. It lets you open tabs, go back and forward, enter
addresses, search the web and reopen closed tabs.
See also `The navigationbar`.
* The sidepanel. It takes a pretty central role in the functionality it provides,
yet it can be hidden and resized to not distract you.
See also `The sidepanel`.
* The statusbar. It displays informational text when hovering something
with a pointer. That's it.
Taking a closer look
''''''''''''''''''''
Command line usage
------------------
Running Midori normally works as follows:
* $ midori
Just run a new instance of Midori. If an instance of Midori is already
running a new window in that instance will be opened.
* $ midori [URIs]
You can supply any number of URIs to open as arguments. If you have a
saved session or a running instance they will be added to the last
active window.
* $ midori [URI1]|[URI2]|...
You can separate URIS by a pipe (|) as well. They are handled as if you
provided all URIs as separate arguments.
* $ midori --run [JAVASCRIPT]
If you pass the filename of a javascript Midori will attempt to run
the contents of the file as javascript code.
Note that support for opening tabs in an existing instance depends on
your build and may not be available on some platforms.
The following arguments are supported if you call Midori from a command line.
+-------+--------------------+------------------------------------------------+
| Short | Long option | Function |
+=======+====================+================================================+
| -a | --app | Run ADDRESS as a web application |
+-------+--------------------+------------------------------------------------+
| -c | --config | Use FOLDER as configuration folder |
+-------+--------------------+------------------------------------------------+
| -r | --run | Run the specified filename as javascript |
+-------+--------------------+------------------------------------------------+
| -s | --snapshot + Take a snapshot of the specified URI |
+-------+--------------------+------------------------------------------------+
| -V | --version | Show version information and exit. |
+-------+--------------------+------------------------------------------------+
Configuration files
-------------------
The configuration files in Midori that save related states are by default
stored in the folder ~/.config/midori in the home directory. It is possible
to use a different folder by specifying '--config' on the command line.
The files stored in the primary configuration folder are the following:
+----------------+------------------------------------------------------------+
| Filename | Contents |
+================+============================================================+
| accels | Keyboard shortcuts, GtkAccelMap resource |
+----------------+------------------------------------------------------------+
| bookmarks.xbel | Bookmarks, XBEL |
+----------------+------------------------------------------------------------+
| config | Preferences, text key file |
+----------------+------------------------------------------------------------+
| cookies.txt | Cookies, Mozilla text cookies |
+----------------+------------------------------------------------------------+
| history.db | History, sqlite3 |
+----------------+------------------------------------------------------------+
| logins | Usernames and passwords, plain text |
+----------------+------------------------------------------------------------+
| running | A file created to track whether Midori quit cleanly |
+----------------+------------------------------------------------------------+
| search | Search engines, text key file |
+----------------+------------------------------------------------------------+
| session.xbel | The current or last session, ie. open tabs, |
+----------------+------------------------------------------------------------+
| tabtrash.xbel | The 10 last closed tabs |
+----------------+------------------------------------------------------------+
Note that generally manual modifications to these files aren't recommended. As
an exception, while Midori is *not* running, it is possible to edit or
replace the 'bookmarks.xbel' as long as it is valid XBEL/ XML.
Currently while Midori is running it will happily overwrite files as needed and
never read back any changes.
Keyboard shortcuts
------------------
...
The navigationbar
-----------------
The navigationbar is the primary toolbar containing notably back and forward
buttons, the location entry and a search entry. The "Toolbar Editor" extension
can be used to add or remove items.
The sidepanel
-------------
...
Extensions
----------
...
Frequently asked questions
''''''''''''''''''''''''''
How do you pronounce Midori and what does it mean anyway?
---------------------------------------------------------
Pronounce it "midoɺi", with a Bavarian/ Japanese "r" or "Mee-Doh-Ree"
in English or read it Italian. The name comes from the Japanese word
緑 (みどり) for the colour "green".
What does the logo mean?
------------------------
The paw of a green cat. Obviously. Also it resembles the letter "M"
in "Midori". The curving is supposed to emphasize speed.
On which platforms does Midori run currently?
---------------------------------------------
Midori is basically very portable and should run on all platforms that
its dependencies support.
Under which license is Midori distributed?
------------------------------------------
Midori, documentation and all delivered artwork are licensed under the LGPL2.
GNU Lesser General Public License
'''''''''''''''''''''''''''''''''
::
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
FIXME: Provide full license text

View file

@ -25,7 +25,7 @@ enum _MouseButton {
struct MouseGestureNode {
double x;
double y;
} MouseGestureNode_t;
};
struct _MouseGesture {
MouseButton button;
@ -38,7 +38,7 @@ struct _MouseGesture {
#define DEVIANCE 20
#define MINLENGTH 50
MouseGesture *gesture;
MouseGesture *gesture = NULL;
void mouse_gesture_clear (MouseGesture *g)
{

View file

@ -100,10 +100,16 @@ shortcuts_accel_cleared_cb (GtkCellRenderer* renderer,
static gchar*
shortcuts_label_for_action (GtkAction* action)
{
const gchar* name = gtk_action_get_name (action);
gchar* label;
gchar* stripped;
if ((label = katze_object_get_string (action, "label")))
if (g_str_equal (name, "ReloadStop"))
{
label = NULL;
stripped = g_strdup (_("Reload page or stop loading"));
}
else if ((label = katze_object_get_string (action, "label")))
stripped = katze_strip_mnemonics (label);
else
{

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2008-2010 Christian Dywan <christian@twotoasts.de>
Copyright (C) 2008-2011 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -12,6 +12,23 @@
#include <midori/midori.h>
#include <midori/sokoke.h>
typedef struct
{
const gchar* label;
gdouble level;
} ZoomLevel;
const ZoomLevel zoom_levels[] =
{
{ "200%", 2.0 },
{ "175%", 1.75 },
{ "150%", 1.5 },
{ "125%", 1.25 },
{ "100%", 1.0 },
{ "50%" , 0.5 },
{ "25%" , 0.25 }
};
static void
statusbar_features_app_add_browser_cb (MidoriApp* app,
MidoriBrowser* browser,
@ -44,6 +61,19 @@ statusbar_features_toolbar_notify_toolbar_style_cb (GtkWidget* toolbar,
}
}
static void
statusbar_features_browser_notify_tab_cb (MidoriBrowser* browser,
GParamSpec* pspec,
GtkWidget* combobox)
{
MidoriView* view = MIDORI_VIEW (midori_browser_get_current_tab (browser));
gchar* zoom_level_text = g_strdup_printf ("%d%%",
(gint)(midori_view_get_zoom_level (view) * 100));
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combobox))),
zoom_level_text);
g_free (zoom_level_text);
}
static void
statusbar_features_deactivate_cb (MidoriExtension* extension,
GtkWidget* bbox)
@ -60,6 +90,19 @@ statusbar_features_deactivate_cb (MidoriExtension* extension,
extension, statusbar_features_deactivate_cb, bbox);
g_signal_handlers_disconnect_by_func (
app, statusbar_features_app_add_browser_cb, extension);
g_signal_handlers_disconnect_matched (browser, G_SIGNAL_MATCH_FUNC,
0, -1, NULL, statusbar_features_browser_notify_tab_cb, NULL);
}
static void
statusbar_features_zoom_level_changed_cb (GtkWidget* combobox,
MidoriBrowser* browser)
{
MidoriView* view = MIDORI_VIEW (midori_browser_get_current_tab (browser));
GtkWidget* entry = gtk_bin_get_child (GTK_BIN (combobox));
const gchar* zoom_level_text = gtk_entry_get_text (GTK_ENTRY (entry));
gdouble zoom_level = g_ascii_strtod (zoom_level_text, NULL);
midori_view_set_zoom_level (view, zoom_level / 100.0);
}
static void
@ -73,6 +116,7 @@ statusbar_features_app_add_browser_cb (MidoriApp* app,
GtkWidget* toolbar;
GtkWidget* button;
GtkWidget* image;
gsize i;
/* FIXME: Monitor each view and modify its settings individually
instead of merely replicating the global preferences. */
@ -108,8 +152,17 @@ statusbar_features_app_add_browser_cb (MidoriApp* app,
g_signal_connect (toolbar, "notify::toolbar-style",
G_CALLBACK (statusbar_features_toolbar_notify_toolbar_style_cb), button);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
button = katze_property_proxy (settings, "identify-as", NULL);
button = katze_property_proxy (settings, "identify-as", "custom-user-agent");
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
button = gtk_combo_box_entry_new_text ();
gtk_entry_set_width_chars (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (button))), 4);
for (i = 0; i < G_N_ELEMENTS (zoom_levels); i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (button), zoom_levels[i].label);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 2);
g_signal_connect (button, "changed",
G_CALLBACK (statusbar_features_zoom_level_changed_cb), browser);
g_signal_connect (browser, "notify::tab",
G_CALLBACK (statusbar_features_browser_notify_tab_cb), button);
gtk_widget_show_all (bbox);
gtk_box_pack_start (GTK_BOX (statusbar), bbox, FALSE, FALSE, 3);
g_object_unref (statusbar);

View file

@ -38,6 +38,13 @@ static void
tab_panel_browser_notify_tab_cb (MidoriBrowser* browser,
GParamSpec* pspec,
GtkTreeView* treeview);
static void
tab_panel_browser_move_tab_cb (MidoriBrowser* browser,
GtkNotebook* notebook,
gint cur_pos,
gint new_pos,
gpointer user_data);
static void
tab_panel_view_notify_minimized_cb (GtkWidget* view,
@ -124,6 +131,8 @@ tab_panel_deactivate_cb (MidoriExtension* extension,
browser, tab_panel_view_notify_icon_cb, extension);
g_signal_handlers_disconnect_by_func (
browser, tab_panel_view_notify_title_cb, extension);
g_signal_handlers_disconnect_by_func (
browser, tab_panel_browser_move_tab_cb, NULL);
gtk_widget_destroy (treeview);
}
@ -598,6 +607,8 @@ tab_panel_app_add_browser_cb (MidoriApp* app,
G_CALLBACK (tab_panel_browser_notify_tab_cb), treeview);
g_signal_connect (extension, "deactivate",
G_CALLBACK (tab_panel_deactivate_cb), treeview);
g_signal_connect (browser, "move-tab",
G_CALLBACK (tab_panel_browser_move_tab_cb), NULL);
}
static void
@ -615,6 +626,33 @@ tab_panel_activate_cb (MidoriExtension* extension,
G_CALLBACK (tab_panel_app_add_browser_cb), extension);
}
static void
tab_panel_browser_move_tab_cb (MidoriBrowser* browser,
GtkNotebook* notebook,
gint cur_pos,
gint new_pos,
gpointer user_data)
{
GtkTreeIter cur, new;
gint last_page;
GtkTreeModel *model;
last_page = gtk_notebook_get_n_pages (notebook) - 1;
model = tab_panel_get_model_for_browser (browser);
gtk_tree_model_iter_nth_child (model, &cur, NULL, cur_pos);
if (cur_pos == 0 && new_pos == last_page)
gtk_tree_store_move_before (GTK_TREE_STORE (model), &cur, NULL);
else if (cur_pos == last_page && new_pos == 0)
gtk_tree_store_move_after (GTK_TREE_STORE (model), &cur, NULL);
else
{
gtk_tree_model_iter_nth_child (model, &new, NULL, new_pos);
gtk_tree_store_swap (GTK_TREE_STORE (model), &cur, &new);
}
}
MidoriExtension*
extension_init (void)
{

View file

@ -383,6 +383,8 @@ katze_array_find_token (KatzeArray* array,
guint i;
gpointer item;
g_return_val_if_fail (KATZE_IS_ARRAY (array), NULL);
i = 0;
while ((item = g_list_nth_data (array->items, i++)))
{

View file

@ -178,7 +178,11 @@ katze_http_cookies_update_jar (KatzeHttpCookies* http_cookies)
gchar* temporary_filename = NULL;
GSList* cookies;
if (http_cookies->timeout > 0)
{
g_source_remove (http_cookies->timeout);
http_cookies->timeout = 0;
}
temporary_filename = g_strconcat (http_cookies->filename, ".XXXXXX", NULL);
if ((fn = g_mkstemp (temporary_filename)) == -1)
@ -299,7 +303,7 @@ katze_http_cookies_detach (SoupSessionFeature* feature,
SoupSession* session)
{
KatzeHttpCookies* http_cookies = (KatzeHttpCookies*)feature;
if (http_cookies->timeout)
if (http_cookies->timeout > 0)
katze_http_cookies_update_jar (http_cookies);
katze_assign (http_cookies->filename, NULL);
katze_object_assign (http_cookies->jar, NULL);

View file

@ -649,6 +649,15 @@ midori_search_engines_modify_cb (KatzeArray* array,
g_free (config_file);
}
static void
midori_search_engines_move_item_cb (KatzeArray* array,
gpointer item,
gint position,
KatzeArray* search_engines)
{
midori_search_engines_modify_cb (array, item, search_engines);
}
static void
midori_trash_add_item_cb (KatzeArray* trash,
GObject* item)
@ -762,7 +771,7 @@ midori_app_quit_cb (MidoriBrowser* browser,
g_unlink (config_file);
g_free (config_file);
if (save_timeout && session)
if (session)
midori_session_save_timeout_cb (session);
}
@ -920,6 +929,13 @@ midori_soup_session_prepare (SoupSession* session,
"SSL certificates cannot be verified."));
#endif
#if !WEBKIT_CHECK_VERSION (1, 3, 5)
/* See http://stevesouders.com/ua/index.php */
g_object_set (session, "max-conns", 60,
"max-conns-per-host", 6,
NULL);
#endif
soup_session_settings_notify_http_proxy_cb (settings, NULL, session);
g_signal_connect (settings, "notify::http-proxy",
G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session);
@ -1288,6 +1304,7 @@ midori_load_session (gpointer data)
KATZE_ARRAY_FOREACH_ITEM (item, _session)
{
g_object_set_data (G_OBJECT (item), "midori-view-append", (void*)1);
katze_item_set_meta_integer (item, "dont-write-history", 1);
midori_browser_add_item (browser, item);
}
current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current");
@ -1450,6 +1467,135 @@ signal_handler (int signal_id)
}
#endif
#if 0
static void
midori_speeddial_import_from_json (const gchar* json_file,
const gchar* speeddial_file)
{
guint i = 0;
guint columns = 3;
guint slot_count = 0;
gchar* json_content;
gchar** parts;
GKeyFile* key_file = g_key_file_new ();
g_file_get_contents (json_file, &json_content, NULL, NULL);
parts = g_strsplit (json_content ? json_content : "", ",", -1);
while (parts && parts[i] != NULL)
{
gchar* key;
gchar* val;
gchar* slot;
gchar* dial_id;
gchar* uri;
gchar** values = g_strsplit (parts[i], "\"", -1);
if (*values[1])
{
if (!g_strcmp0 (values[1], "shortcuts"))
{
key = g_strdup (values[3]);
val = g_strdup (values[5]);
}
else if (!g_strcmp0 (values[1], "thumb"))
{
key = g_strdup (values[1]);
val = g_strdup (values[2]);
}
else
{
key = g_strdup (values[1]);
val = g_strdup (values[3]);
}
if (g_str_equal (key, "id"))
{
/* FIXME: leaked string */
slot = g_strdup (val);
dial_id = g_strdup_printf ("Dial %s", slot + 1);
slot_count++;
}
else if (g_str_equal (key, "href") && (*val && strncmp (val, "#", 1)))
{
uri = g_strdup (val);
g_key_file_set_value (key_file, dial_id, "name", slot);
g_key_file_set_value (key_file, dial_id, "uri", uri);
}
else if (g_str_equal (key, "img") && *val)
{
gsize sz;
gint state = 0;
guint save = 0;
gchar* checksum;
gchar* filename;
gchar* thumb_dir;
gchar* thumb_path;
gsize base64_size = strlen (val);
guchar* decoded = g_malloc0 ((base64_size * 3) / 4);
sz = g_base64_decode_step (g_strdup (val), base64_size,
decoded, &state, &save);
checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, slot, -1);
filename = g_strdup_printf ("%s%s", checksum, ".png");
g_free (checksum);
thumb_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (),
PACKAGE_NAME, "thumbnails", NULL);
if (!g_file_test (thumb_dir, G_FILE_TEST_EXISTS))
katze_mkdir_with_parents (thumb_dir, 0700);
thumb_path = g_build_filename (thumb_dir, filename, NULL);
g_free (filename);
g_file_set_contents (thumb_path, (gchar*)decoded, sz, NULL);
g_free (decoded);
g_free (thumb_dir);
g_free (thumb_path);
}
else if (g_str_equal (key, "thumb"))
{
guint thumb_size;
gchar* thumb_size_type;
/* FIXME: leaked string */
thumb_size = atoi (g_strndup (val + 1, strlen (val) - 3));
if (thumb_size == 80)
thumb_size_type = g_strdup ("SMALL");
else if (thumb_size == 160)
thumb_size_type = g_strdup ("MEDIUM");
else if (thumb_size == 240)
thumb_size_type = g_strdup ("BIG");
g_key_file_set_value (key_file, "settings", "size", thumb_size_type);
g_free (thumb_size_type);
}
else if (g_str_equal (key, "title") && *val)
{
g_key_file_set_value (key_file, dial_id, "name", slot);
g_key_file_set_value (key_file, dial_id, key, val + 3);
}
else if (g_str_equal (key, "width"))
{
columns = atoi (val);
}
i++;
g_free (key);
g_free (val);
g_strfreev (values);
}
}
g_key_file_set_integer (key_file, "settings", "columns", columns);
g_key_file_set_integer (key_file, "settings", "rows", slot_count / columns);
sokoke_key_file_save_to_file (key_file, speeddial_file, NULL);
g_strfreev (parts);
g_free (json_content);
g_key_file_free (key_file);
}
#endif
static void
midori_soup_session_block_uris_cb (SoupSession* session,
SoupMessage* msg,
@ -1563,18 +1709,21 @@ midori_clear_web_cookies_cb (void)
SoupSession* session = webkit_get_default_session ();
SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
GSList* cookies = soup_cookie_jar_all_cookies (SOUP_COOKIE_JAR (jar));
SoupSessionFeature* feature;
for (; cookies != NULL; cookies = g_slist_next (cookies))
{
SoupCookie* cookie = cookies->data;
soup_cookie_set_max_age (cookie, 0);
soup_cookie_free (cookie);
soup_cookie_jar_delete_cookie ((SoupCookieJar*)jar, cookie);
}
g_slist_free (cookies);
soup_cookies_free (cookies);
/* Removing KatzeHttpCookies makes it save outstanding changes */
if (soup_session_get_feature (session, KATZE_TYPE_HTTP_COOKIES))
if ((feature = soup_session_get_feature (session, KATZE_TYPE_HTTP_COOKIES)))
{
soup_session_remove_feature_by_type (session, KATZE_TYPE_HTTP_COOKIES);
soup_session_add_feature_by_type (session, KATZE_TYPE_HTTP_COOKIES);
g_object_ref (feature);
soup_session_remove_feature (session, feature);
soup_session_add_feature (session, feature);
g_object_unref (feature);
}
}
@ -1654,6 +1803,9 @@ main (int argc,
MidoriWebSettings* settings;
gchar* config_file;
gchar* bookmarks_file;
#if 0
gchar* speeddial_file;
#endif
gboolean bookmarks_exist;
MidoriStartup load_on_startup;
KatzeArray* search_engines;
@ -1866,7 +2018,12 @@ main (int argc,
NULL);
midori_browser_set_action_visible (browser, "Menubar", FALSE);
}
g_object_set (settings, "show-panel", FALSE, NULL);
g_object_set (settings, "show-panel", FALSE,
"last-window-state", MIDORI_WINDOW_NORMAL,
#if WEBKIT_CHECK_VERSION (1, 1, 2)
"enable-private-browsing", TRUE,
#endif
NULL);
midori_browser_set_action_visible (browser, "Tools", FALSE);
midori_browser_set_action_visible (browser, "Panel", FALSE);
g_object_set (browser, "settings", settings, NULL);
@ -2060,6 +2217,17 @@ main (int argc,
g_free (bookmarks_file);
midori_startup_timer ("History read: \t%f");
#if 0
speeddial_file = g_build_filename (config, "speeddial", NULL);
if (g_access (speeddial_file, F_OK) != 0)
{
gchar* json_file = g_build_filename (config, "speeddial.json", NULL);
midori_speeddial_import_from_json (json_file, speeddial_file);
g_free (json_file);
}
g_free (speeddial_file);
#endif
/* In case of errors */
if (error_messages->len)
{
@ -2135,6 +2303,8 @@ main (int argc,
KATZE_ARRAY_FOREACH_ITEM (item, search_engines)
g_signal_connect_after (item, "notify",
G_CALLBACK (midori_search_engines_modify_cb), search_engines);
g_signal_connect_after (search_engines, "move-item",
G_CALLBACK (midori_search_engines_move_item_cb), search_engines);
}
}
g_signal_connect_after (trash, "add-item",
@ -2200,6 +2370,8 @@ main (int argc,
gtk_main ();
settings = katze_object_get_object (app, "settings");
settings_notify_cb (settings, NULL, app);
g_object_get (settings, "maximum-history-age", &max_history_age, NULL);
midori_history_terminate (history, max_history_age);
/* Removing KatzeHttpCookies makes it save outstanding changes */

View file

@ -5,6 +5,7 @@ BOOLEAN:VOID
OBJECT:OBJECT
VOID:BOOLEAN,STRING
VOID:OBJECT,ENUM
VOID:OBJECT,INT,INT
VOID:POINTER,INT
VOID:STRING,BOOLEAN
VOID:STRING,INT,STRING

View file

@ -136,6 +136,7 @@ enum
NEW_WINDOW,
ADD_TAB,
REMOVE_TAB,
MOVE_TAB,
ACTIVATE_ACTION,
CONTEXT_READY,
ADD_DOWNLOAD,
@ -330,6 +331,8 @@ _midori_browser_update_interface (MidoriBrowser* browser)
"sensitive", can_reload, NULL);
if (!browser->show_navigationbar)
gtk_widget_hide (browser->navigationbar);
katze_item_set_meta_integer (midori_view_get_proxy_item (view), "dont-write-history", 0);
}
else
{
@ -433,6 +436,9 @@ _midori_browser_update_progress (MidoriBrowser* browser,
/* When we are finished, we don't want to *see* progress anymore */
if (midori_view_get_load_status (view) == MIDORI_LOAD_FINISHED)
progress = 0.0;
/* When loading we want to see at minimum 10% progress */
else
progress = CLAMP (progress, 0.1, 1.0);
midori_location_action_set_progress (action, progress);
}
@ -552,15 +558,18 @@ midori_view_context_ready_cb (GtkWidget* view,
}
static void
midori_view_notify_uri_cb (GtkWidget* view,
midori_view_notify_uri_cb (GtkWidget* widget,
GParamSpec* pspec,
MidoriBrowser* browser)
{
if (view == midori_browser_get_current_tab (browser))
if (widget == midori_browser_get_current_tab (browser))
{
const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view));
MidoriView* view = MIDORI_VIEW (widget);
const gchar* uri = midori_view_get_display_uri (view);
GtkAction* action = _action_by_name (browser, "Location");
midori_location_action_set_text (MIDORI_LOCATION_ACTION (action), uri);
_action_set_sensitive (browser, "Back", midori_view_can_go_back (view));
_action_set_sensitive (browser, "Forward", midori_view_can_go_forward (view));
}
}
@ -588,10 +597,13 @@ midori_view_notify_title_cb (GtkWidget* widget,
if (proxy_uri && *proxy_uri && proxy_uri[1] &&
!g_str_has_prefix (proxy_uri, "about:") &&
(katze_item_get_meta_integer (proxy, "history-step") == -1))
{
if (!katze_item_get_meta_boolean (proxy, "dont-write-history"))
{
midori_browser_new_history_item (browser, proxy);
katze_item_set_meta_integer (proxy, "history-step", 1);
}
}
else if (katze_item_get_name (proxy) &&
!g_str_has_prefix (proxy_uri, "about:") &&
(katze_item_get_meta_integer (proxy, "history-step") == 1))
@ -972,6 +984,7 @@ midori_browser_prepare_download (MidoriBrowser* browser,
}
webkit_download_set_destination_uri (download, uri);
g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download);
midori_transferbar_add_download_item (MIDORI_TRANSFERBAR (browser->transferbar), download);
return TRUE;
}
@ -1405,7 +1418,6 @@ midori_view_download_requested_cb (GtkWidget* view,
WebKitDownload* download,
MidoriBrowser* browser)
{
g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download);
if (!webkit_download_get_destination_uri (download))
{
gchar* folder;
@ -1551,8 +1563,6 @@ _midori_browser_add_tab (MidoriBrowser* browser,
item = midori_view_get_proxy_item (MIDORI_VIEW (view));
g_object_ref (item);
katze_array_add_item (browser->proxy_array, item);
katze_array_move_item (browser->proxy_array, item,
gtk_notebook_get_current_page (notebook) + 1);
g_object_connect (view,
"signal::notify::icon",
@ -1662,6 +1672,9 @@ midori_browser_key_press_event (GtkWidget* widget,
GtkWidgetClass* widget_class;
guint clean_state;
if (gtk_window_get_focus (GTK_WINDOW (widget)) == NULL)
gtk_widget_grab_focus (midori_browser_get_current_tab (MIDORI_BROWSER (widget)));
if (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))
if (sokoke_window_activate_key (window, event))
return TRUE;
@ -1742,6 +1755,28 @@ midori_browser_class_init (MidoriBrowserClass* class)
G_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
/**
* MidoriBrowser::move-tab:
* @browser: the object on which the signal is emitted
* @notebook: the notebook containing the tabs
* @cur_pos: the current position of the tab
* @new_pos: the new position of the tab
*
* Emitted when a tab is moved.
*
* Since: 0.3.3
*/
signals[MOVE_TAB] = g_signal_new (
"move-tab",
G_TYPE_FROM_CLASS (class),
(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
0,
0,
NULL,
midori_cclosure_marshal_VOID__OBJECT_INT_INT,
G_TYPE_NONE, 3,
GTK_TYPE_NOTEBOOK, G_TYPE_INT, G_TYPE_INT);
signals[ACTIVATE_ACTION] = g_signal_new (
"activate-action",
G_TYPE_FROM_CLASS (class),
@ -2431,6 +2466,15 @@ _action_copy_activate (GtkAction* action,
MidoriBrowser* browser)
{
GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
/* Work around broken clipboard handling for the sake of the user */
if (WEBKIT_IS_WEB_VIEW (widget))
{
GtkWidget* scrolled = gtk_widget_get_parent (widget);
GtkWidget* view = gtk_widget_get_parent (scrolled);
const gchar* selected = midori_view_get_selected_text (MIDORI_VIEW (view));
sokoke_widget_copy_clipboard (widget, selected);
return;
}
if (G_LIKELY (widget) && g_signal_lookup ("copy-clipboard", G_OBJECT_TYPE (widget)))
g_signal_emit_by_name (widget, "copy-clipboard");
}
@ -2925,6 +2969,7 @@ _action_compact_menu_populate_popup (GtkAction* action,
{ "BookmarksImport"},
{ "BookmarksExport"},
#endif
{ "HelpFAQ" },
{ "About" },
{ "Preferences" },
#if HAVE_HILDON
@ -2987,7 +3032,7 @@ midori_preferences_response_help_cb (GtkWidget* preferences,
MidoriBrowser* browser)
{
if (response == GTK_RESPONSE_HELP)
gtk_action_activate (_action_by_name (browser, "HelpContents"));
gtk_action_activate (_action_by_name (browser, "HelpFAQ"));
}
static void
@ -3501,14 +3546,10 @@ _action_location_submit_uri (GtkAction* action,
gchar** parts;
gchar* keywords = NULL;
const gchar* search_uri = NULL;
time_t now;
gint64 day;
sqlite3* db;
static sqlite3_stmt* statement = NULL;
/* Do we have a keyword and a string? */
parts = g_strsplit (stripped_uri, " ", 2);
if (parts[0])
if (parts[0] && browser->search_engines)
{
KatzeItem* item;
if ((item = katze_array_find_token (browser->search_engines, parts[0])))
@ -3528,10 +3569,13 @@ _action_location_submit_uri (GtkAction* action,
}
new_uri = sokoke_search_uri (search_uri, keywords);
now = time (NULL);
day = sokoke_time_t_to_julian (&now);
if (browser->history != NULL)
{
time_t now = time (NULL);
gint64 day = sokoke_time_t_to_julian (&now);
sqlite3* db = g_object_get_data (G_OBJECT (browser->history), "db");
static sqlite3_stmt* statement = NULL;
db = g_object_get_data (G_OBJECT (browser->history), "db");
if (!statement)
{
const gchar* sqlcmd;
@ -3548,6 +3592,7 @@ _action_location_submit_uri (GtkAction* action,
sqlite3_reset (statement);
if (sqlite3_step (statement) == SQLITE_DONE)
sqlite3_clear_bindings (statement);
}
g_free (keywords);
}
@ -4370,6 +4415,36 @@ _action_inspect_page_activate (GtkAction* action,
}
#endif
static void
_action_tab_move_backward_activate (GtkAction* action,
MidoriBrowser* browser)
{
gint new_pos;
gint cur_pos = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
GtkWidget* widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), cur_pos);
if (cur_pos > 0)
new_pos = cur_pos - 1;
else
new_pos = gtk_notebook_get_n_pages (GTK_NOTEBOOK (browser->notebook)) - 1;
gtk_notebook_reorder_child (GTK_NOTEBOOK (browser->notebook), widget, new_pos);
g_signal_emit (browser, signals[MOVE_TAB], 0, browser->notebook, cur_pos, new_pos);
}
static void
_action_tab_move_forward_activate (GtkAction* action,
MidoriBrowser* browser)
{
gint new_pos;
gint cur_pos = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
GtkWidget* widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), cur_pos);
if (cur_pos == (gtk_notebook_get_n_pages (GTK_NOTEBOOK (browser->notebook)) - 1))
new_pos = 0;
else
new_pos = cur_pos + 1;
gtk_notebook_reorder_child (GTK_NOTEBOOK (browser->notebook), widget, new_pos);
g_signal_emit (browser, signals[MOVE_TAB], 0, browser->notebook, cur_pos, new_pos);
}
static void
_action_tab_previous_activate (GtkAction* action,
MidoriBrowser* browser)
@ -4514,20 +4589,20 @@ _action_help_link_activate (GtkAction* action,
#endif
action_name = gtk_action_get_name (action);
if (!strncmp ("HelpContents", action_name, 12))
if (!strncmp ("HelpFAQ", action_name, 7))
{
#ifdef G_OS_WIN32
{
#ifdef DOCDIR
gchar* path = sokoke_find_data_filename ("doc/midori/user/midori.html");
gchar* path = sokoke_find_data_filename ("doc/midori/faq.html");
uri = free_uri = g_filename_to_uri (path, NULL, NULL);
if (g_access (path, F_OK) != 0)
{
if (g_access (DOCDIR "/user/midori.html", F_OK) == 0)
uri = "file://" DOCDIR "/user/midori.html";
if (g_access (DOCDIR "/faq.html", F_OK) == 0)
uri = "file://" DOCDIR "/faq.html";
else
#endif
uri = "error:nodocs share/doc/midori/user/midori.html";
uri = "error:nodocs share/doc/midori/faq.html";
#ifdef DOCDIR
}
g_free (path);
@ -4535,14 +4610,12 @@ _action_help_link_activate (GtkAction* action,
}
#else
#ifdef DOCDIR
uri = "file://" DOCDIR "/user/midori.html";
if (g_access (DOCDIR "/user/midori.html", F_OK) != 0)
uri = "file://" DOCDIR "/faq.html";
if (g_access (DOCDIR "/faq.html", F_OK) != 0)
#endif
uri = "error:nodocs " DOCDIR "/user/midori.html";
uri = "error:nodocs " DOCDIR "/faq.html";
#endif
}
else if (!strncmp ("HelpFAQ", action_name, 7))
uri = "http://wiki.xfce.org/midori/faq";
else if (!strncmp ("HelpBugs", action_name, 8))
uri = PACKAGE_BUGREPORT;
else
@ -4720,10 +4793,7 @@ gtk_notebook_switch_page_after_cb (GtkWidget* notebook,
if (browser->proxy_array)
katze_item_set_meta_integer (KATZE_ITEM (browser->proxy_array), "current",
midori_browser_get_current_page (browser));
g_object_freeze_notify (G_OBJECT (browser));
g_object_notify (G_OBJECT (browser), "uri");
g_object_notify (G_OBJECT (browser), "tab");
g_object_thaw_notify (G_OBJECT (browser));
_midori_browser_set_statusbar_text (browser, NULL);
_midori_browser_update_interface (browser);
@ -4738,11 +4808,25 @@ midori_browser_notebook_page_reordered_cb (GtkNotebook* notebook,
{
KatzeItem* item = midori_view_get_proxy_item (view);
katze_array_move_item (browser->proxy_array, item, page_num);
g_object_freeze_notify (G_OBJECT (browser));
g_object_notify (G_OBJECT (browser), "uri");
g_object_notify (G_OBJECT (browser), "tab");
g_object_thaw_notify (G_OBJECT (browser));
}
static gboolean
midori_browser_notebook_reorder_tab_cb (GtkNotebook* notebook,
GtkDirectionType arg1,
gboolean arg2,
gpointer user_data)
{
g_signal_stop_emission_by_name (notebook, "reorder-tab");
return TRUE;
}
static void
midori_browser_switch_tab_cb (GtkWidget* menuitem,
MidoriBrowser* browser)
{
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), "index"));
midori_browser_set_current_page (browser, page);
}
static gboolean
@ -4764,6 +4848,36 @@ midori_browser_notebook_button_press_event_after_cb (GtkNotebook* notebook,
return TRUE;
}
else if (event->type == GDK_BUTTON_PRESS && event->button == 3)
{
GtkWidget* menu = gtk_menu_new ();
GList* tabs = gtk_container_get_children (GTK_CONTAINER (notebook));
GtkWidget* menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (browser->action_group, "TabNew"));
gint i = 0;
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (browser->action_group, "UndoTabClose"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
for (; tabs != NULL; tabs = g_list_next (tabs))
{
const gchar* title = midori_view_get_display_title (tabs->data);
menuitem = katze_image_menu_item_new_ellipsized (title);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem),
gtk_image_new_from_pixbuf (midori_view_get_icon (tabs->data)));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
g_object_set_data (G_OBJECT (menuitem), "index", GINT_TO_POINTER (i));
g_signal_connect (menuitem, "activate",
G_CALLBACK (midori_browser_switch_tab_cb), browser);
i++;
}
g_list_free (tabs);
gtk_widget_show_all (menu);
katze_widget_popup (GTK_WIDGET (notebook), GTK_MENU (menu), NULL,
KATZE_MENU_POSITION_CURSOR);
}
return FALSE;
}
@ -4892,7 +5006,7 @@ static const GtkActionEntry entries[] =
NULL, "<Ctrl>r",
N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
{ "ReloadUncached", GTK_STOCK_REFRESH,
NULL, "<Ctrl><Shift>r",
N_("Reload page without caching"), "<Ctrl><Shift>r",
N_("Reload page without caching"), G_CALLBACK (_action_reload_stop_activate) },
{ "Stop", GTK_STOCK_STOP,
NULL, "Escape",
@ -4989,6 +5103,10 @@ static const GtkActionEntry entries[] =
{ "TabNext", GTK_STOCK_GO_FORWARD,
N_("_Next Tab"), "<Ctrl>Page_Down",
N_("Switch to the next tab"), G_CALLBACK (_action_tab_next_activate) },
{ "TabMoveBackward", NULL, N_("Move Tab _Backward"), "<Ctrl><Shift>Page_Up",
N_("Move tab behind the previous tab"), G_CALLBACK (_action_tab_move_backward_activate) },
{ "TabMoveForward", NULL, N_("_Move Tab Forward"), "<Ctrl><Shift>Page_Down",
N_("Move tab in front of the next tab"), G_CALLBACK (_action_tab_move_forward_activate) },
{ "TabCurrent", NULL,
N_("Focus _Current Tab"), "<Ctrl>Home",
N_("Focus the current tab"), G_CALLBACK (_action_tab_current_activate) },
@ -5006,11 +5124,8 @@ static const GtkActionEntry entries[] =
N_("Open the tabs saved in the last session"), NULL },
{ "Help", NULL, N_("_Help") },
{ "HelpContents", GTK_STOCK_HELP,
N_("_Contents"), "F1",
N_("Show the documentation"), G_CALLBACK (_action_help_link_activate) },
{ "HelpFAQ", NULL,
N_("_Frequent Questions"), NULL,
{ "HelpFAQ", GTK_STOCK_HELP,
N_("_Frequent Questions"), "F1",
N_("Show the Frequently Asked Questions"), G_CALLBACK (_action_help_link_activate) },
{ "HelpBugs", NULL,
N_("_Report a Bug"), NULL,
@ -5168,6 +5283,9 @@ midori_browser_destroy_cb (MidoriBrowser* browser)
/* Destroy panel first, so panels don't need special care */
gtk_widget_destroy (browser->panel);
/* Destroy tabs second, so child widgets don't need special care */
g_signal_handlers_disconnect_by_func (browser->notebook,
midori_browser_notebook_reorder_tab_cb,
NULL);
gtk_container_foreach (GTK_CONTAINER (browser->notebook),
(GtkCallback) gtk_widget_destroy, NULL);
}
@ -5258,7 +5376,6 @@ static const gchar* ui_markup =
"<menuitem action='Tools'/>"
"<menuitem action='Window'/>"
"<menu action='Help'>"
"<menuitem action='HelpContents'/>"
"<menuitem action='HelpFAQ'/>"
"<menuitem action='HelpBugs'/>"
"<separator/>"
@ -5267,6 +5384,8 @@ static const gchar* ui_markup =
/* For accelerators to work all actions need to be used
*somewhere* in the UI definition */
"<menu action='Dummy'>"
"<menuitem action='TabMoveBackward'/>"
"<menuitem action='TabMoveForward'/>"
"<menuitem action='ScrollLeft'/>"
"<menuitem action='ScrollDown'/>"
"<menuitem action='ScrollUp'/>"
@ -5415,12 +5534,11 @@ midori_browser_accel_switch_tab_activate_cb (GtkAccelGroup* accel_group,
MidoriBrowser* browser;
GtkWidget* view;
/* Switch to n-th tab. 9 and 0 go to the last tab. */
n = keyval - GDK_0;
if (n == 0)
n = 10;
browser = g_object_get_data (G_OBJECT (accel_group), "midori-browser");
if ((view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook),
n - 1)))
n < 9 ? n - 1 : -1)))
midori_browser_set_current_tab (browser, view);
}
}
@ -5889,6 +6007,8 @@ midori_browser_init (MidoriBrowser* browser)
g_signal_connect_after (browser->notebook, "button-press-event",
G_CALLBACK (midori_browser_notebook_button_press_event_after_cb),
browser);
g_signal_connect (browser->notebook, "reorder-tab",
G_CALLBACK (midori_browser_notebook_reorder_tab_cb), NULL);
gtk_widget_show (browser->notebook);
/* Inspector container */
@ -6714,11 +6834,18 @@ midori_browser_add_item (MidoriBrowser* browser,
title = katze_item_get_name (item);
view = midori_view_new_with_title (title, browser->settings,
g_object_get_data (G_OBJECT (item), "midori-view-append") ? TRUE : FALSE);
proxy_item = midori_view_get_proxy_item (MIDORI_VIEW (view));
if (katze_item_get_meta_boolean (item, "dont-write-history"))
katze_item_set_meta_integer (proxy_item, "dont-write-history", 1);
page = midori_browser_add_tab (browser, view);
/* Blank pages should not be delayed */
if (katze_item_get_meta_integer (item, "delay") > 0
&& strcmp (uri, "about:blank") != 0)
&& strcmp (uri, "about:blank") != 0
&& strncmp (uri, "pause:", 6) != 0)
{
gchar* new_uri = g_strdup_printf ("pause:%s", uri);
midori_view_set_uri (MIDORI_VIEW (view), new_uri);
@ -6791,6 +6918,7 @@ midori_browser_set_action_visible (MidoriBrowser* browser,
g_return_if_fail (name != NULL);
_action_set_visible (browser, name, visible);
_action_set_sensitive (browser, name, visible);
}
/**
@ -6955,6 +7083,11 @@ midori_browser_set_current_tab (MidoriBrowser* browser,
gtk_action_activate (_action_by_name (browser, "Location"));
else
gtk_widget_grab_focus (view);
g_object_freeze_notify (G_OBJECT (browser));
g_object_notify (G_OBJECT (browser), "uri");
g_object_notify (G_OBJECT (browser), "tab");
g_object_thaw_notify (G_OBJECT (browser));
}
/**

View file

@ -505,8 +505,6 @@ midori_location_action_popup_timeout_cb (gpointer data)
g_free (uri);
g_free (title);
i++;
if (i > 4)
break;
}
searches += i;
}
@ -1797,8 +1795,6 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
MidoriSecurity hint)
{
GSList* proxies;
GtkWidget* entry;
GtkWidget* child;
g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
@ -1809,15 +1805,20 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
{
GdkColor bg_color = { 0, 1 };
GdkColor fg_color = { 0, 1 };
entry = midori_location_action_entry_for_proxy (proxies->data);
child = gtk_bin_get_child (GTK_BIN (entry));
GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
GtkWidget* child = gtk_bin_get_child (GTK_BIN (entry));
GdkScreen* screen = gtk_widget_get_screen (child);
GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen);
if (hint == MIDORI_SECURITY_UNKNOWN)
{
gdk_color_parse ("#ef7070", &bg_color);
gdk_color_parse ("#000", &fg_color);
#if !HAVE_HILDON
if (gtk_icon_theme_has_icon (icon_theme, "lock-insecure"))
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (child),
GTK_ICON_ENTRY_SECONDARY, "lock-insecure");
else
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_INFO);
gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (child),
@ -1829,6 +1830,10 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
gdk_color_parse ("#fcf19a", &bg_color);
gdk_color_parse ("#000", &fg_color);
#if !HAVE_HILDON
if (gtk_icon_theme_has_icon (icon_theme, "lock-secure"))
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (child),
GTK_ICON_ENTRY_SECONDARY, "lock-secure");
else
gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (child),
GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_DIALOG_AUTHENTICATION);
gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (child),

View file

@ -30,6 +30,7 @@ struct _MidoriPanel
GtkWidget* labelbar;
GtkWidget* toolbar;
GtkToolItem* button_align;
GtkWidget* toolbar_label;
GtkWidget* frame;
GtkWidget* toolbook;
@ -209,8 +210,6 @@ midori_panel_class_init (MidoriPanelClass* class)
* Whether to align the panel on the right.
*
* Since: 0.1.3
*
* Deprecated: 0.3.0
*/
g_object_class_install_property (gobject_class,
PROP_RIGHT_ALIGNED,
@ -344,6 +343,13 @@ midori_panel_detach_page (MidoriPanel* panel,
gtk_widget_show (window);
}
static void
midori_panel_button_align_clicked_cb (GtkWidget* toolitem,
MidoriPanel* panel)
{
midori_panel_set_right_aligned (panel, !panel->right_aligned);
}
static void
midori_panel_destroy_cb (MidoriPanel* panel)
{
@ -386,6 +392,19 @@ midori_panel_init (MidoriPanel* panel)
gtk_container_add (GTK_CONTAINER (toolitem), panel->toolbar_label);
gtk_container_set_border_width (GTK_CONTAINER (toolitem), 6);
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem),
_("Align sidepanel to the right"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem),
_("Align sidepanel to the right"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_panel_button_align_clicked_cb), panel);
#if HAVE_OSX
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, 0);
#else
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
#endif
panel->button_align = toolitem;
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close panel"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem), _("Close panel"));
@ -536,7 +555,15 @@ midori_panel_set_right_aligned (MidoriPanel* panel,
box = gtk_widget_get_parent (panel->toolbar);
gtk_box_reorder_child (GTK_BOX (box), panel->toolbar,
right_aligned ? -1 : 0);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (panel->button_align),
right_aligned ? GTK_STOCK_GO_BACK : GTK_STOCK_GO_FORWARD);
panel->right_aligned = right_aligned;
gtk_tool_button_set_label (GTK_TOOL_BUTTON (panel->button_align),
!panel->right_aligned ? _("Align sidepanel to the right")
: _("Align sidepanel to the left"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (panel->button_align),
!panel->right_aligned ? _("Align sidepanel to the right")
: _("Align sidepanel to the left"));
g_object_notify (G_OBJECT (panel), "right-aligned");
}

View file

@ -1095,6 +1095,72 @@ midori_search_action_dialog_remove_cb (GtkWidget* widget,
}
}
static void
midori_search_action_dialog_move_up_cb (GtkWidget* widget,
MidoriSearchAction* search_action)
{
KatzeArray* search_engines;
GtkWidget* treeview;
GtkTreeSelection* selection;
GtkTreeModel* liststore;
GtkTreeIter iter, prev;
GtkTreePath* path;
KatzeItem* item;
gint i;
search_engines = search_action->search_engines;
treeview = search_action->treeview;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
if (gtk_tree_selection_get_selected (selection, &liststore, &iter))
{
path = gtk_tree_model_get_path (liststore, &iter);
if(gtk_tree_path_prev(path))
{
gtk_tree_model_get (liststore, &iter, 0, &item, -1);
gtk_tree_model_get_iter (liststore, &prev, path);
gtk_list_store_swap (GTK_LIST_STORE(liststore), &iter, &prev);
i = katze_array_get_item_index (search_engines, item);
katze_array_move_item (search_engines, item, i - 1);
/* If the index of the current item has changed it needs to be reset */
g_object_notify (G_OBJECT (search_action), "current-item");
}
gtk_tree_path_free (path);
}
}
static void
midori_search_action_dialog_move_down_cb (GtkWidget* widget,
MidoriSearchAction* search_action)
{
KatzeArray* search_engines;
GtkWidget* treeview;
GtkTreeSelection* selection;
GtkTreeModel* liststore;
GtkTreeIter iter, next;
KatzeItem* item;
gint i;
search_engines = search_action->search_engines;
treeview = search_action->treeview;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
if (gtk_tree_selection_get_selected (selection, &liststore, &iter))
{
next = iter;
if (gtk_tree_model_iter_next (liststore, &next))
{
gtk_tree_model_get (liststore, &iter, 0, &item, -1);
gtk_list_store_swap (GTK_LIST_STORE(liststore), &iter, &next);
i = katze_array_get_item_index (search_engines, item);
katze_array_move_item (search_engines, item, i + 1);
/* If the index of the current item has changed it needs to be reset */
g_object_notify (G_OBJECT (search_action), "current-item");
}
}
}
static void
midori_search_action_dialog_default_cb (GtkWidget* widget,
MidoriSearchAction* search_action)
@ -1349,10 +1415,12 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action)
button = gtk_label_new (""); /* This is an invisible separator */
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 12);
button = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN);
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked",
G_CALLBACK (midori_search_action_dialog_move_down_cb), search_action);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_GO_UP);
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked",
G_CALLBACK (midori_search_action_dialog_move_up_cb), search_action);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
#if HAVE_OSX

View file

@ -866,7 +866,7 @@ _midori_web_view_load_icon (MidoriView* view)
icon_uri = g_strdup (view->icon_uri);
if ((icon_uri && g_str_has_prefix (icon_uri, "http"))
|| g_str_has_prefix (view->uri, "http"))
|| (view->uri && g_str_has_prefix (view->uri, "http")))
{
if (!icon_uri)
{
@ -1078,6 +1078,15 @@ midori_view_web_view_resource_request_cb (WebKitWebView* web_view,
webkit_network_request_set_uri (request, file_uri);
g_free (file_uri);
}
else if (g_str_has_prefix (uri, "thumb://"))
{
gchar* file_path = g_build_filename (g_get_user_cache_dir (), "midori", "thumbnails",
g_strdup (uri + 8), NULL);
gchar* file_uri = g_filename_to_uri (file_path, NULL, NULL);
webkit_network_request_set_uri (request, file_uri);
g_free (file_uri);
g_free (file_path);
}
else if (g_str_has_prefix (uri, "stock://"))
{
GdkPixbuf* pixbuf;
@ -1556,6 +1565,15 @@ midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view,
#endif
#if WEBKIT_CHECK_VERSION (1, 1, 4)
static void
webkit_web_view_notify_uri_cb (WebKitWebView* web_view,
GParamSpec* pspec,
MidoriView* view)
{
katze_assign (view->uri, g_strdup (webkit_web_view_get_uri (web_view)));
g_object_notify (G_OBJECT (view), "uri");
}
static void
webkit_web_view_notify_title_cb (WebKitWebView* web_view,
GParamSpec* pspec,
@ -1852,33 +1870,34 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
" var child = document.createElement ('span');"
" child.setAttribute ('class', 'midoriHKD87346');"
" child.appendChild (document.createTextNode (i));"
" if (links[i].insertBefore)"
" if (links[i].insertBefore && links[i].href)"
" links[i].insertBefore (child); }",
NULL);
view->find_links = 0;
}
else if (digit != -1 || event->keyval == GDK_Return)
{
gchar* script;
if (event->keyval != GDK_Return)
else if (digit != -1 && event->keyval != GDK_Return && event->keyval != GDK_Escape)
{
if (view->find_links > -1)
view->find_links *= 10;
view->find_links += digit;
}
else if (event->keyval == GDK_Escape)
{
view->find_links = 0;
}
else if (event->keyval == GDK_Return)
{
gchar* script;
script = g_strdup_printf (
"var links = document.getElementsByClassName ('midoriHKD87346');"
"var i = %d; var return_key = %d;"
"if (return_key || typeof links[i * 10] == 'undefined') {"
" for (var j = 0; j < links.length; j++)"
" links[j].style.display = 'none !important';"
"if (return_key) {"
" if (typeof links[i] != 'undefined')"
" links[i].parentNode.href; }",
view->find_links, event->keyval == GDK_Return);
result = sokoke_js_script_eval (js_context, script, NULL);
if (result && strstr (result, "://"))
{
view->find_links = -1;
if (MIDORI_MOD_NEW_TAB (event->state))
{
gboolean background = view->open_tabs_in_the_background;
@ -1887,20 +1906,33 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
g_signal_emit (view, signals[NEW_TAB], 0, result, background);
}
else
{
gchar* dummy = sokoke_js_script_eval (js_context,
"var links = document.getElementsByClassName ('midoriHKD87346');"
"for (var i = links.length - 1; i >= 0; i--) {"
" var parent = links[i].parentNode;"
" parent.removeChild(links[i]); }",
NULL);
g_free (dummy);
view->find_links = -1;
midori_view_set_uri (view, result);
}
}
g_free (script);
g_free (result);
view->find_links = 0;
}
else
{
result = sokoke_js_script_eval (js_context,
"var links = document.getElementsByClassName ('midoriHKD87346');"
"for (var i = 0; i < links.length; i++)"
" links[i].style.display = 'none !important';",
"for (var i = links.length - 1; i >= 0; i--) {"
" var parent = links[i].parentNode;"
" parent.removeChild(links[i]); }",
NULL);
g_free (result);
view->find_links = -1;
}
g_free (result);
return FALSE;
}
@ -1950,19 +1982,6 @@ gtk_widget_scroll_event_cb (WebKitWebView* web_view,
}
#if WEBKIT_CHECK_VERSION (1, 1, 15)
static void
midori_web_view_set_clipboard (GtkWidget* widget,
const gchar* text)
{
GdkDisplay* display = gtk_widget_get_display (widget);
GtkClipboard* clipboard;
clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, text, -1);
clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_PRIMARY);
gtk_clipboard_set_text (clipboard, text, -1);
}
static void
midori_web_view_menu_new_window_activate_cb (GtkWidget* widget,
MidoriView* view)
@ -1981,7 +2000,10 @@ static void
midori_web_view_menu_link_copy_activate_cb (GtkWidget* widget,
MidoriView* view)
{
midori_web_view_set_clipboard (widget, view->link_uri);
if (g_str_has_prefix (view->link_uri, "mailto:"))
sokoke_widget_copy_clipboard (widget, view->link_uri + 7);
else
sokoke_widget_copy_clipboard (widget, view->link_uri);
}
static void
@ -2011,7 +2033,7 @@ midori_web_view_menu_image_copy_activate_cb (GtkWidget* widget,
MidoriView* view)
{
gchar* uri = katze_object_get_string (view->hit_test, "image-uri");
midori_web_view_set_clipboard (widget, uri);
sokoke_widget_copy_clipboard (widget, uri);
g_free (uri);
}
@ -2034,7 +2056,7 @@ midori_web_view_menu_video_copy_activate_cb (GtkWidget* widget,
MidoriView* view)
{
gchar* uri = katze_object_get_string (view->hit_test, "media-uri");
midori_web_view_set_clipboard (widget, uri);
sokoke_widget_copy_clipboard (widget, uri);
g_free (uri);
}
@ -2127,7 +2149,7 @@ static void
midori_web_view_menu_copy_activate_cb (GtkWidget* widget,
MidoriView* view)
{
midori_web_view_set_clipboard (widget, view->selected_text);
sokoke_widget_copy_clipboard (widget, view->selected_text);
}
#endif
@ -2414,7 +2436,7 @@ midori_view_populate_popup (MidoriView* view,
_("Copy Link de_stination"), NULL,
G_CALLBACK (midori_web_view_menu_link_copy_activate_cb), widget);
midori_view_insert_menu_item (menu_shell, -1,
_("_Save Link destination"), NULL,
NULL, GTK_STOCK_SAVE_AS,
G_CALLBACK (midori_web_view_menu_save_activate_cb), widget);
if (view->download_manager && *view->download_manager)
midori_view_insert_menu_item (menu_shell, -1,
@ -2478,13 +2500,15 @@ midori_view_populate_popup (MidoriView* view,
#if WEBKIT_CHECK_VERSION (1, 1, 3)
/* hack to localize menu item */
label = gtk_bin_get_child (GTK_BIN (menuitem));
gtk_label_set_label (GTK_LABEL (label), _("_Download Link destination"));
GtkStockItem stock_item;
if (gtk_stock_lookup (GTK_STOCK_SAVE_AS, &stock_item))
gtk_label_set_label (GTK_LABEL (label), stock_item.label);
#else
/* hack to disable non-functional Download File */
gtk_widget_hide (menuitem);
gtk_widget_set_no_show_all (menuitem, TRUE);
midori_view_insert_menu_item (menu_shell, 3,
_("_Save Link destination"), NULL,
NULL, GTK_STOCK_SAVE_AS,
G_CALLBACK (midori_web_view_menu_save_as_activate_cb), widget);
#endif
if (view->download_manager && *view->download_manager)
@ -2640,13 +2664,6 @@ midori_view_populate_popup (MidoriView* view,
} */
#endif
if (!g_object_get_data (G_OBJECT (browser), "midori-toolbars-visible"))
{
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "Menubar"));
gtk_menu_shell_append (menu_shell, menuitem);
}
#if !HAVE_HILDON
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "ZoomIn"));
@ -2723,6 +2740,13 @@ midori_view_populate_popup (MidoriView* view,
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "SourceView"));
gtk_menu_shell_append (menu_shell, menuitem);
if (!g_object_get_data (G_OBJECT (browser), "midori-toolbars-visible"))
{
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "Navigationbar"));
gtk_menu_shell_append (menu_shell, menuitem);
}
}
#if WEBKIT_CHECK_VERSION (1, 1, 17)
@ -2833,6 +2857,13 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view,
GtkWidget* dialog;
gchar* content_type;
gchar* description;
gchar* file_type;
#if WEBKIT_CHECK_VERSION (1, 1, 14)
WebKitWebDataSource* datasource;
WebKitNetworkRequest* original_request;
#endif
const gchar* original_uri;
gchar** fingerprint;
#if GTK_CHECK_VERSION (2, 14, 0)
GIcon* icon;
GtkWidget* image;
@ -2892,12 +2923,38 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view,
#endif
g_free (content_type);
if (g_strrstr (description, mime_type))
file_type = g_strdup_printf (_("File Type: '%s'"), mime_type);
else
file_type = g_strdup_printf (_("File Type: %s ('%s')"), description, mime_type);
g_free (description);
/* Link Fingerprint */
#if WEBKIT_CHECK_VERSION (1, 1, 14)
/* We look at the original URI because redirection would lose the fragment */
datasource = webkit_web_frame_get_provisional_data_source (web_frame);
original_request = webkit_web_data_source_get_initial_request (datasource);
original_uri = webkit_network_request_get_uri (original_request);
#else
original_uri = webkit_network_request_get_uri (request);
#endif
fingerprint = g_strsplit (original_uri, "#!md5!", 2);
if (fingerprint && fingerprint[0] && fingerprint[1])
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("File Type: '%s'"), mime_type);
"%s\n%s %s", file_type, _("MD5-Checksum:"), fingerprint[1]);
else
{
g_strfreev (fingerprint);
fingerprint = g_strsplit (original_uri, "#!sha1!", 2);
if (fingerprint && fingerprint[0] && fingerprint[1])
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s\n%s %s", file_type, _("SHA1-Checksum:"), fingerprint[1]);
else
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("File Type: %s ('%s')"), description, mime_type);
g_free (description);
"%s", file_type);
}
g_strfreev (fingerprint);
g_free (file_type);
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
/* i18n: A file open dialog title, ie. "Open http://fila.com/manual.tgz" */
title = g_strdup_printf (_("Open %s"),
@ -2965,6 +3022,16 @@ webkit_web_view_download_requested_cb (GtkWidget* web_view,
MidoriView* view)
{
gboolean handled;
#if WEBKIT_CHECK_VERSION (1, 1, 14)
/* Propagate original URI to make it available when the download finishes */
WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view));
WebKitWebDataSource* datasource = webkit_web_frame_get_provisional_data_source (web_frame);
WebKitNetworkRequest* original_request = webkit_web_data_source_get_initial_request (datasource);
const gchar* original_uri = webkit_network_request_get_uri (original_request);
WebKitNetworkRequest* request = webkit_download_get_network_request (download);
g_object_set_data_full (G_OBJECT (request), "midori-original-uri",
g_strdup (original_uri), g_free);
#endif
g_object_set_data (G_OBJECT (download), "open-download",
g_object_get_data (G_OBJECT (view), "open-download"));
g_object_set_data (G_OBJECT (download), "save-as-download",
@ -3257,10 +3324,8 @@ static gboolean
midori_view_focus_in_event (GtkWidget* widget,
GdkEventFocus* event)
{
MidoriView* view = MIDORI_VIEW (widget);
/* Always propagate focus to the child web view */
gtk_widget_grab_focus (view->web_view);
gtk_widget_grab_focus (midori_view_get_web_view (MIDORI_VIEW (widget)));
return TRUE;
}
@ -3608,6 +3673,8 @@ midori_view_construct_web_view (MidoriView* view)
midori_web_view_notify_icon_uri_cb, view,
#endif
#if WEBKIT_CHECK_VERSION (1, 1, 4)
"signal::notify::uri",
webkit_web_view_notify_uri_cb, view,
"signal::notify::title",
webkit_web_view_notify_title_cb, view,
#else
@ -3680,6 +3747,43 @@ midori_view_construct_web_view (MidoriView* view)
NULL);
}
static gchar* list_netscape_plugins ()
{
GtkWidget* web_view = webkit_web_view_new ();
WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view));
JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
/* This snippet joins the available plugins into a string like this:
URI1|title1,URI2|title2 */
gchar* value = sokoke_js_script_eval (js_context,
"function plugins (l) { var f = new Array (); for (i in l) "
"{ var p = l[i].name + '|' + l[i].filename; "
"if (f.indexOf (p) == -1) f.push (p); } return f; }"
"plugins (navigator.plugins)", NULL);
gchar** items = g_strsplit (value, ",", 0);
guint i = 0;
GString* ns_plugins = g_string_new (NULL);
if (items != NULL)
while (items[i] != NULL)
{
gchar** parts = g_strsplit (items[i], "|", 2);
if (parts && *parts && !g_str_equal (parts[1], "undefined"))
{
g_string_append (ns_plugins, "<tr><td>");
g_string_append (ns_plugins, parts[1]);
g_string_append (ns_plugins, "</td><td>");
g_string_append (ns_plugins, parts[0]);
g_string_append (ns_plugins, "</tr>");
}
g_strfreev (parts);
i++;
}
if (g_str_has_prefix (value, "undefined"))
g_string_append (ns_plugins, "<tr><td>No plugins found</td></tr>");
g_strfreev (items);
g_free (value);
return g_string_free (ns_plugins, FALSE);
}
/**
* midori_view_set_uri:
* @view: a #MidoriView
@ -3840,6 +3944,7 @@ midori_view_set_uri (MidoriView* view,
gchar** argument_vector = sokoke_get_argv (NULL);
gchar* command_line = g_strjoinv (" ", argument_vector);
gchar* ident = katze_object_get_string (view->settings, "user-agent");
gchar* netscape_plugins = list_netscape_plugins ();
#if defined (G_OS_WIN32)
gchar* sys_name = g_strdup ("Windows");
#else
@ -3888,6 +3993,7 @@ midori_view_set_uri (MidoriView* view,
"<tr><td>Platform</td><td>%s</td></tr>"
"<tr><td>Identification</td><td>%s</td></tr>"
"</table>"
"<h2>Netscape Plugins:</h2><table>%s</table>"
"</body></html>",
_("Version numbers in brackets show the version used at runtime."),
command_line,
@ -3907,10 +4013,12 @@ midori_view_set_uri (MidoriView* view,
HAVE_LIBIDN ? "Yes" : "No",
HAVE_UNIQUE ? "Yes" : "No",
HAVE_HILDON ? "Yes" : "No",
sys_name, ident);
sys_name, ident,
netscape_plugins);
g_free (command_line);
g_free (ident);
g_free (sys_name);
g_free (netscape_plugins);
}
else
{
@ -4889,12 +4997,15 @@ midori_view_get_previous_page (MidoriView* view)
web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
js_context = webkit_web_frame_get_global_context (web_frame);
katze_assign (uri, sokoke_js_script_eval (js_context,
"(function (l) { for (i in l) "
"if ((l[i].rel && l[i].rel == 'prev') "
"(function (tags) {"
"for (tag in tags) {"
"var l = document.getElementsByTagName (tag);"
"for (i in l) { "
"if ((l[i].rel && l[i].rel.toLowerCase () == 'prev') "
" || (l[i].innerHTML"
" && l[i].innerHTML.toLowerCase ().indexOf ('prev') != -1)) "
"{ return l[i].href; } return 0; })("
"document.getElementsByTagName ('a'));", NULL));
"{ return l[i].href; } } } return 0; })("
"{ link:'link', a:'a' });", NULL));
return uri && uri[0] != '0' ? uri : NULL;
}
@ -4923,12 +5034,15 @@ midori_view_get_next_page (MidoriView* view)
web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
js_context = webkit_web_frame_get_global_context (web_frame);
katze_assign (uri, sokoke_js_script_eval (js_context,
"(function (l) { for (i in l) "
"if ((l[i].rel && l[i].rel == 'next') "
"(function (tags) {"
"for (tag in tags) {"
"var l = document.getElementsByTagName (tag);"
"for (i in l) { "
"if ((l[i].rel && l[i].rel.toLowerCase () == 'next') "
" || (l[i].innerHTML"
" && l[i].innerHTML.toLowerCase ().indexOf ('next') != -1)) "
"{ return l[i].href; } return 0; })("
"document.getElementsByTagName ('a'));", NULL));
"{ return l[i].href; } } } return 0; })("
"{ link:'link', a:'a' });", NULL));
return uri && uri[0] != '0' ? uri : NULL;
}

View file

@ -271,6 +271,34 @@ sokoke_open_with_response_cb (GtkWidget* dialog,
gtk_widget_destroy (dialog);
}
static GAppInfo*
sokoke_default_for_uri (const gchar* uri,
gchar** scheme_ptr)
{
gchar* scheme;
GAppInfo* info;
scheme = g_uri_parse_scheme (uri);
if (scheme_ptr != NULL)
*scheme_ptr = scheme;
if (!scheme)
return NULL;
info = g_app_info_get_default_for_uri_scheme (scheme);
#if !GLIB_CHECK_VERSION (2, 28, 0)
if (!info)
{
gchar* type = g_strdup_printf ("x-scheme-handler/%s", scheme);
info = g_app_info_get_default_for_type (type, FALSE);
g_free (type);
}
#endif
if (info != NULL && scheme_ptr != NULL)
g_free (scheme);
return info;
}
/**
* sokoke_show_uri:
* @screen: a #GdkScreen, or %NULL
@ -281,6 +309,7 @@ sokoke_open_with_response_cb (GtkWidget* dialog,
* Shows the specified URI with an appropriate application. This
* supports xdg-open, exo-open and gnome-open as fallbacks if
* GIO doesn't do the trick.
* x-scheme-handler is supported for GLib < 2.28 as of 0.3.3.
*
* On Maemo, hildon_uri_open() is used.
*
@ -364,6 +393,10 @@ sokoke_show_uri (GdkScreen* screen,
#else
#if !GLIB_CHECK_VERSION (2, 28, 0)
GAppInfo* info;
gchar* scheme;
#endif
const gchar* fallbacks [] = { "xdg-open", "exo-open", "gnome-open" };
gsize i;
GtkWidget* dialog;
@ -386,6 +419,25 @@ sokoke_show_uri (GdkScreen* screen,
return TRUE;
#endif
#if !GLIB_CHECK_VERSION (2, 28, 0)
info = sokoke_default_for_uri (uri, &scheme);
if (info)
{
gchar* argument = g_strdup (&uri[scheme - uri]);
GList* uris = g_list_prepend (NULL, argument);
if (g_app_info_launch_uris (info, uris, NULL, NULL))
{
g_list_free (uris);
g_free (scheme);
g_object_unref (info);
return TRUE;
}
g_list_free (uris);
g_free (scheme);
g_object_unref (info);
}
#endif
for (i = 0; i < G_N_ELEMENTS (fallbacks); i++)
{
gchar* command = g_strconcat (fallbacks[i], " ", uri, NULL);
@ -756,7 +808,6 @@ sokoke_resolve_hostname (const gchar* hostname)
gboolean
sokoke_external_uri (const gchar* uri)
{
gchar* scheme;
GAppInfo* info;
if (!uri || !strncmp (uri, "http", 4)
@ -764,12 +815,7 @@ sokoke_external_uri (const gchar* uri)
|| !strncmp (uri, "about:", 6))
return FALSE;
scheme = g_uri_parse_scheme (uri);
if (!scheme)
return FALSE;
info = g_app_info_get_default_for_uri_scheme (scheme);
g_free (scheme);
info = sokoke_default_for_uri (uri, NULL);
if (info)
g_object_unref (info);
return info != NULL;
@ -2125,3 +2171,16 @@ sokoke_register_privacy_item (const gchar* name,
items = g_list_append (items, item);
return NULL;
}
void
sokoke_widget_copy_clipboard (GtkWidget* widget,
const gchar* text)
{
GdkDisplay* display = gtk_widget_get_display (widget);
GtkClipboard* clipboard;
clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, text, -1);
clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_PRIMARY);
gtk_clipboard_set_text (clipboard, text, -1);
}

View file

@ -280,4 +280,8 @@ sokoke_register_privacy_item (const gchar* name,
const gchar* label,
GCallback clear);
void
sokoke_widget_copy_clipboard (GtkWidget* widget,
const gchar* text);
#endif /* !__SOKOKE_H__ */

View file

@ -2852,11 +2852,11 @@ msgstr "Empra el disc com a memòria cau de comunicacions HTTP"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Desenganxar el panell triat de la finestra"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Alinear el panell lateral a la dreta"
msgid "Align sidepanel to the right"
msgstr "Alinear el panell lateral a la dreta"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Alinear el panell lateral a l'esquerra"
msgid "Align sidepanel to the left"
msgstr "Alinear el panell lateral a l'esquerra"
#~ msgid "Hide operating controls"
#~ msgstr "Oculta els controls d'operació"

685
po/cs.po

File diff suppressed because it is too large Load diff

112
po/de.po
View file

@ -6,9 +6,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: midori 0.3.0\n"
"Project-Id-Version: midori 0.3.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-19 22:32+0100\n"
"POT-Creation-Date: 2011-03-13 15:04+0100\n"
"PO-Revision-Date: 2009-04-30 00:15+0100\n"
"Last-Translator: Christian Dywan <christian@twotoasts.de>\n"
"Language-Team: German <de@li.org>\n"
@ -863,7 +863,23 @@ msgstr "_Nächster Reiter"
msgid "Switch to the next tab"
msgstr "Zum nächsten Reiter wechseln"
#: ../midori/midori-browser.c:4990
#: ../midori/midori-browser.c:5106
msgid "Move Tab _Backward"
msgstr "Reiter _zurück schieben"
#: ../midori/midori-browser.c:5107
msgid "Move tab behind the previous tab"
msgstr "Reiter hinter den voherigen schieben"
#: ../midori/midori-browser.c:5108
msgid "_Move Tab Forward"
msgstr "Reiter v_orwärts schieben"
#: ../midori/midori-browser.c:5109
msgid "Move tab in front of the next tab"
msgstr "Reiter vor den nächsten schieben"
#: ../midori/midori-browser.c:5111
msgid "Focus _Current Tab"
msgstr "_Aktuellen Reiter fokusieren"
@ -907,15 +923,7 @@ msgstr "In der letzten Sitzung geöffnete Reiter öffnen"
msgid "_Help"
msgstr "_Hilfe"
#: ../midori/midori-browser.c:5007
msgid "_Contents"
msgstr "_Inhalt"
#: ../midori/midori-browser.c:5008
msgid "Show the documentation"
msgstr "Zeige die Dokumentation"
#: ../midori/midori-browser.c:5010
#: ../midori/midori-browser.c:5128
msgid "_Frequent Questions"
msgstr "_Häufige Fragen"
@ -1761,12 +1769,8 @@ msgstr "Verweis als _Internetanwendung öffnen"
msgid "Copy Link de_stination"
msgstr "Verweisziel k_opieren"
#: ../midori/midori-view.c:2417 ../midori/midori-view.c:2487
msgid "_Save Link destination"
msgstr "Verweisziel _speichern"
#: ../midori/midori-view.c:2421 ../midori/midori-view.c:2450
#: ../midori/midori-view.c:2492
#: ../midori/midori-view.c:2443 ../midori/midori-view.c:2472
#: ../midori/midori-view.c:2516
msgid "Download with Download _Manager"
msgstr "Mit Übertragungs_manager herunterladen"
@ -1794,11 +1798,7 @@ msgstr "_Video speichern"
msgid "Download _Video"
msgstr "_Video herunterladen"
#: ../midori/midori-view.c:2481
msgid "_Download Link destination"
msgstr "Verweisziel herunter_laden"
#: ../midori/midori-view.c:2512
#: ../midori/midori-view.c:2536
msgid "Search _with"
msgstr "Suchen _mit"
@ -1824,6 +1824,14 @@ msgstr "Dateityp: »%s«"
msgid "File Type: %s ('%s')"
msgstr "Dateityp: %s (»%s«)"
#: ../midori/midori-view.c:2943
msgid "MD5-Checksum:"
msgstr "MD5-Prüfsumme:"
#: ../midori/midori-view.c:2950
msgid "SHA1-Checksum:"
msgstr "SHA1-Prüfsumme:"
#. i18n: A file open dialog title, ie. "Open http://fila.com/manual.tgz"
#: ../midori/midori-view.c:2903
#, c-format
@ -2202,10 +2210,16 @@ msgstr "Treffer hervorheben"
msgid "Close Findbar"
msgstr "Suchleiste schließen"
#: ../toolbars/midori-transferbar.c:88 ../panels/midori-transfers.c:273
#. i18n: Unknown number of bytes, used for transfer rate like ?B/s
#: ../toolbars/midori-transferbar.c:108
msgid "?B"
msgstr "?B"
#. i18n: Download tooltip, 4KB of 43MB, 130KB/s
#: ../toolbars/midori-transferbar.c:110
#, c-format
msgid "%s of %s"
msgstr "%s von %s"
msgid "%s of %s, %s/s"
msgstr "%s von %s, %s/s"
#: ../toolbars/midori-transferbar.c:122
#, c-format
@ -2216,7 +2230,20 @@ msgstr "Die Datei »<b>%s</b>« wurde heruntergeladen."
msgid "Transfer completed"
msgstr "Übertragung abgeschlossen"
#: ../toolbars/midori-transferbar.c:256 ../panels/midori-transfers.c:144
#: ../toolbars/midori-transferbar.c:242
msgid "The downloaded file is erroneous."
msgstr "Die heruntergeladene Datei ist fehlerhaft."
#: ../toolbars/midori-transferbar.c:243
msgid ""
"The checksum provided with the link did not match. This means the file is "
"probably incomplete or was modified afterwards."
msgstr ""
"Die im Verweis enthaltene Prüfsumme stimmt nicht überein. Das bedeutet "
"normalerweise, dass die Datei unvollständig ist oder im Nachhinein verändert "
"wurde."
#: ../toolbars/midori-transferbar.c:352 ../panels/midori-transfers.c:144
msgid "Clear All"
msgstr "Alle entfernen"
@ -2296,6 +2323,11 @@ msgstr "Ausgewählten Verlaufseintrag löschen"
msgid "Clear the entire history"
msgstr "Den gesamten Verlauf löschen"
#: ../panels/midori-transfers.c:273
#, c-format
msgid "%s of %s"
msgstr "%s von %s"
#: ../panels/midori-transfers.c:481
msgid "Open Destination _Folder"
msgstr "Zielordner ö_ffnen"
@ -2796,7 +2828,11 @@ msgstr "_Seitenhalter"
msgid "Keep one or multiple pages open in parallel to your tabs"
msgstr "Eine oder mehrere Seiten gleichzeitig mit den Reitern offen lassen."
#: ../extensions/shortcuts.c:170
#: ../extensions/shortcuts.c:110
msgid "Reload page or stop loading"
msgstr "Seite neu laden oder laden abbrechen"
#: ../extensions/shortcuts.c:176
msgid "Customize Keyboard shortcuts"
msgstr "Tastaturkürzel anpassen"
@ -2900,6 +2936,18 @@ msgstr "Zwischenspeicher"
msgid "Cache HTTP communication on disk"
msgstr "HTTP-Kommunikation auf der Festplatte zwischenspeichern"
#~ msgid "_Contents"
#~ msgstr "_Inhalt"
#~ msgid "Show the documentation"
#~ msgstr "Zeige die Dokumentation"
#~ msgid "_Save Link destination"
#~ msgstr "Verweisziel _speichern"
#~ msgid "_Download Link destination"
#~ msgstr "Verweisziel herunter_laden"
#~ msgid "%d%% loaded"
#~ msgstr "%d%% geladen"
@ -2937,11 +2985,11 @@ msgstr "HTTP-Kommunikation auf der Festplatte zwischenspeichern"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Gewählte Leiste vom Fenster ablösen"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Seitenleiste rechts anordnen"
msgid "Align sidepanel to the right"
msgstr "Seitenleiste rechts anordnen"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Seitenleiste links anordnen"
msgid "Align sidepanel to the left"
msgstr "Seitenleiste links anordnen"
#~ msgid "Hide operating controls"
#~ msgstr "Bedienelemente anzeigen"

View file

@ -2938,10 +2938,12 @@ msgstr "Προσωρινή μνήμη επικοινωνίας HTTP στο δί
#~ msgstr "Ελαχιστοποίηση της συγκεκριμένης καρτέλας"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Αποσύνδεση επιλεγμένου πλαισίου από το παράθυρο"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα δεξιά"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα αριστερά"
msgid "Align sidepanel to the right"
msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα δεξιά"
msgid "Align sidepanel to the left"
msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα αριστερά"
#~ msgid "Hide operating controls"
#~ msgstr "Απόκρυψη στοιχείων λειτουργίας"
#~ msgid "Spell Checking"

View file

@ -2970,11 +2970,11 @@ msgstr "Cachear tráfico HTTP en disco"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar el panel elegido de la ventana"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Alinear el panel a la derecha"
msgid "Align sidepanel to the right"
msgstr "Alinear el panel a la derecha"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Alinear el panel a la izquierda"
msgid "Align sidepanel to the left"
msgstr "Alinear el panel a la izquierda"
#~ msgid "Hide operating controls"
#~ msgstr "Ocultar _controles de operación"

View file

@ -2856,11 +2856,11 @@ msgstr "Gardar unha caché da comunicación HTTP no disco"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar o panel seleccionado da xanela "
#~ msgid "Align sidepanel to the right"
#~ msgstr "Aliñar o panel lateral á dereita"
msgid "Align sidepanel to the right"
msgstr "Aliñar o panel lateral á dereita"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Aliñar o panel lateral á esquerda"
msgid "Align sidepanel to the left"
msgstr "Aliñar o panel lateral á esquerda"
#~ msgid "Hide operating controls"
#~ msgstr "Ocultar os controis de operación"

1300
po/hr.po

File diff suppressed because it is too large Load diff

View file

@ -2846,11 +2846,11 @@ msgstr "HTTP kommunikáció gyorsítótárazása a lemezen"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Kiválasztott panel leválasztása az ablakról"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Az oldalsáv jobbra igazítása"
msgid "Align sidepanel to the right"
msgstr "Az oldalsáv jobbra igazítása"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Az oldalsáv balra igazítása"
msgid "Align sidepanel to the left"
msgstr "Az oldalsáv balra igazítása"
#~ msgid "Hide operating controls"
#~ msgstr "Vezérlők elrejtése"

2934
po/id.po

File diff suppressed because it is too large Load diff

View file

@ -2900,11 +2900,11 @@ msgstr "Memorizza la comunicazione HTTP sul disco"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Stacca il pannello selezionato dalla finestra"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Allinea il pannello laterale a destra"
msgid "Align sidepanel to the right"
msgstr "Allinea il pannello laterale a destra"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Allinea il pannello laterale a sinistra"
msgid "Align sidepanel to the left"
msgstr "Allinea il pannello laterale a sinistra"
#~ msgid "Hide operating controls"
#~ msgstr "Nasconde i controlli operativi"

1109
po/ja.po

File diff suppressed because it is too large Load diff

View file

@ -2923,11 +2923,11 @@ msgstr "디스크에 HTTP 통신을 저장합니다."
#~ msgid "Detach chosen panel from the window"
#~ msgstr "선택한 패널 창에서 분리"
#~ msgid "Align sidepanel to the right"
#~ msgstr "창을 오른쪽으로 이동"
msgid "Align sidepanel to the right"
msgstr "창을 오른쪽으로 이동"
#~ msgid "Align sidepanel to the left"
#~ msgstr "창을 왼쪽으로 이동"
msgid "Align sidepanel to the left"
msgstr "창을 왼쪽으로 이동"
#~ msgid "Hide operating controls"
#~ msgstr "조작 컨트롤 감추기(_C)"

735
po/pl.po

File diff suppressed because it is too large Load diff

1099
po/pt.po

File diff suppressed because it is too large Load diff

View file

@ -2934,10 +2934,13 @@ msgstr "Pôr comunicações HTTP em cache"
#~ msgstr "Falha ao limpar o histórico de pesquisa: %s\n"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar da janela o painel escolhido"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Alinhar painel lateral à direita"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Alinhar painel lateral à esquerda"
msgid "Align sidepanel to the right"
msgstr "Alinhar painel lateral à direita"
msgid "Align sidepanel to the left"
msgstr "Alinhar painel lateral à esquerda"
#~ msgid "Hide operating controls"
#~ msgstr "Ocultar controles operacionais"
#~ msgid "Spell Checking"

1206
po/ru.po

File diff suppressed because it is too large Load diff

View file

@ -2857,11 +2857,11 @@ msgstr "Diskteki HTTP iletişimi önbelleği"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "Pencereden seçilmiş paneli ayır"
#~ msgid "Align sidepanel to the right"
#~ msgstr "Kenar panelini sağa hizala"
msgid "Align sidepanel to the right"
msgstr "Kenar panelini sağa hizala"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Kenar panelini sola hizala"
msgid "Align sidepanel to the left"
msgstr "Kenar panelini sola hizala"
#~ msgid "Hide operating controls"
#~ msgstr "İşlem kontrollerini gizle"

1053
po/uk.po

File diff suppressed because it is too large Load diff

View file

@ -2908,11 +2908,11 @@ msgstr "在磁盘上缓存 HTTP 通讯"
#~ msgid "Detach chosen panel from the window"
#~ msgstr "从窗口中分离选择的面板"
#~ msgid "Align sidepanel to the right"
#~ msgstr "侧栏在右"
msgid "Align sidepanel to the right"
msgstr "侧栏在右"
#~ msgid "Align sidepanel to the left"
#~ msgstr "侧栏在左"
msgid "Align sidepanel to the left"
msgstr "侧栏在左"
#~ msgid "Hide operating controls"
#~ msgstr "隐藏操作控件"

File diff suppressed because it is too large Load diff

View file

@ -79,19 +79,49 @@ midori_transferbar_download_notify_progress_cb (WebKitDownload* download,
gchar* total;
gchar* size_text;
gchar* text;
gchar* transfer;
gdouble* last_time;
guint64* last_size;
gdouble timestamp;
guint64 size;
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress),
webkit_download_get_progress (download));
size = webkit_download_get_current_size (download);
if (size == webkit_download_get_total_size (download))
{
gtk_widget_set_tooltip_text (progress,
gtk_progress_bar_get_text (GTK_PROGRESS_BAR (progress)));
return;
}
current = g_format_size_for_display (webkit_download_get_current_size (download));
total = g_format_size_for_display (webkit_download_get_total_size (download));
size_text = g_strdup_printf (_("%s of %s"), current, total);
last_time = g_object_get_data (G_OBJECT (download), "last-time");
last_size = g_object_get_data (G_OBJECT (download), "last-size");
timestamp = webkit_download_get_elapsed_time (download);
if (timestamp != *last_time)
transfer = g_format_size_for_display ((size - *last_size) / (timestamp - *last_time));
else
/* i18n: Unknown number of bytes, used for transfer rate like ?B/s */
transfer = g_strdup (_("?B"));
/* i18n: Download tooltip, 4KB of 43MB, 130KB/s */
size_text = g_strdup_printf (_("%s of %s, %s/s"), current, total, transfer);
if (timestamp - *last_time > 5.0)
{
*last_time = timestamp;
*last_size = size;
}
g_free (current);
g_free (total);
text = g_strdup_printf ("%s (%s)",
gtk_progress_bar_get_text (GTK_PROGRESS_BAR (progress)),
size_text);
gtk_widget_set_tooltip_text (progress, text);
g_free (size_text);
g_free (transfer);
g_free (text);
}
static void
@ -107,6 +137,11 @@ midori_transferbar_download_notify_status_cb (WebKitDownload* download,
case WEBKIT_DOWNLOAD_STATUS_FINISHED:
{
MidoriBrowser* browser = midori_browser_get_for_widget (button);
#if WEBKIT_CHECK_VERSION (1, 1, 14)
WebKitNetworkRequest* request;
#endif
const gchar* original_uri;
gchar** fingerprint;
icon = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (button), icon);
@ -125,6 +160,53 @@ midori_transferbar_download_notify_status_cb (WebKitDownload* download,
_("Transfer completed"), msg);
g_free (msg);
}
/* Link Fingerprint */
#if WEBKIT_CHECK_VERSION (1, 1, 14)
request = webkit_download_get_network_request (download);
original_uri = g_object_get_data (G_OBJECT (request), "midori-original-uri");
#else
original_uri = webkit_download_get_uri (download);
#endif
fingerprint = g_strsplit (original_uri, "#!md5!", 2);
if (fingerprint && fingerprint[0] && fingerprint[1])
{
gchar* filename = g_filename_from_uri (
webkit_download_get_destination_uri (download), NULL, NULL);
gchar* contents;
gsize length;
gboolean y = g_file_get_contents (filename, &contents, &length, NULL);
gchar* checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5,
(guchar*)contents, length);
g_free (filename);
g_free (contents);
if (!y || !g_str_equal (fingerprint[1], checksum))
gtk_image_set_from_stock (GTK_IMAGE (icon),
GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
g_free (checksum);
}
else
{
gchar* filename = g_filename_from_uri (
webkit_download_get_destination_uri (download), NULL, NULL);
g_strfreev (fingerprint);
fingerprint = g_strsplit (original_uri, "#!sha1!", 2);
if (fingerprint && fingerprint[0] && fingerprint[1])
{
gchar* contents;
gsize length;
gboolean y = g_file_get_contents (filename, &contents, &length, NULL);
gchar* checksum = g_compute_checksum_for_data (G_CHECKSUM_SHA1,
(guchar*)contents, length);
g_free (contents);
if (!y || !g_str_equal (fingerprint[1], checksum))
gtk_image_set_from_stock (GTK_IMAGE (icon),
GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
g_free (checksum);
}
g_free (filename);
}
g_strfreev (fingerprint);
break;
}
case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
@ -151,7 +233,19 @@ midori_transferbar_download_button_clicked_cb (GtkWidget* button,
case WEBKIT_DOWNLOAD_STATUS_FINISHED:
{
const gchar* uri = webkit_download_get_destination_uri (download);
if (sokoke_show_uri (gtk_widget_get_screen (button),
GtkWidget* icon = gtk_button_get_image (GTK_BUTTON (button));
gchar* stock_id;
gtk_image_get_stock (GTK_IMAGE (icon), &stock_id, NULL);
if (g_str_equal (stock_id, GTK_STOCK_DIALOG_WARNING))
{
sokoke_message_dialog (GTK_MESSAGE_WARNING,
_("The downloaded file is erroneous."),
_("The checksum provided with the link did not match. " \
"This means the file is probably incomplete or was " \
"modified afterwards."),
TRUE);
}
else if (sokoke_show_uri (gtk_widget_get_screen (button),
uri, gtk_get_current_event_time (), NULL))
gtk_widget_destroy (button);
break;
@ -224,6 +318,8 @@ midori_transferbar_add_download_item (MidoriTransferbar* transferbar,
G_CALLBACK (midori_transferbar_download_notify_status_cb), info);
g_signal_connect (button, "clicked",
G_CALLBACK (midori_transferbar_download_button_clicked_cb), info);
g_object_set_data_full (G_OBJECT (download), "last-time", g_new0 (gdouble, 1), g_free);
g_object_set_data_full (G_OBJECT (download), "last-size", g_new0 (guint64, 1), g_free);
}
static void

32
wscript
View file

@ -29,7 +29,7 @@ from Configure import find_program_impl
major = 0
minor = 3
micro = 2
micro = 3
APPNAME = 'midori'
VERSION = str (major) + '.' + str (minor) + '.' + str (micro)
@ -98,19 +98,6 @@ def configure (conf):
sys.exit (1)
conf.check_tool ('glib2')
if option_enabled ('userdocs'):
conf.find_program ('rst2html.py', var='RST2HTML')
# debian renames the executable, check that as well :(
if not conf.env['RST2HTML']:
conf.find_program ('rst2html', var='RST2HTML')
if conf.env['RST2HTML']:
user_docs = 'yes'
else:
option_checkfatal ('userdocs', 'user documentation')
user_docs = 'N/A'
else:
user_docs = 'no '
if option_enabled ('nls'):
conf.check_tool ('intltool')
if conf.env['INTLTOOL'] and conf.env['POCOM']:
@ -329,7 +316,6 @@ def configure (conf):
Notifications: %(libnotify)s (libnotify)
IDN support: %(idn)s (libidn or libsoup 2.27.90)
User documentation: %(user_docs)s (docutils)
API documentation: %(api_docs)s (gtk-doc)
''' % locals ())
if unique == 'yes' and conf.check_cfg (modversion='unique-1.0') == '1.0.4':
@ -368,7 +354,6 @@ def set_options (opt):
group.add_option ('--update-po', action='store_true', default=False,
help='Update localization files', dest='update_po')
add_enable_option ('docs', 'informational text files', group)
add_enable_option ('userdocs', 'user documentation', group)
add_enable_option ('apidocs', 'API documentation', group, disable=True)
group = opt.add_option_group ('Optional features', '')
@ -419,24 +404,11 @@ def build (bld):
if bld.env['docs']:
bld.install_files ('${DOCDIR}/', \
'AUTHORS COPYING ChangeLog EXPAT README')
'AUTHORS COPYING ChangeLog EXPAT README data/faq.html data/faq.css')
# Install default configuration
bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + '/', 'data/search')
if bld.env['RST2HTML']:
# FIXME: Build only if needed
Utils.check_dir (blddir)
Utils.check_dir (blddir + '/docs')
Utils.check_dir (blddir + '/docs/user')
os.chdir (blddir + '/docs/user')
command = bld.env['RST2HTML'] + ' -stg ' + \
'--stylesheet=../../../docs/user/midori.css ' + \
'../../../docs/user/midori.txt ' + 'midori.html'
Utils.exec_command (command)
os.chdir ('../../..')
bld.install_files ('${DOCDIR}/user/', blddir + '/docs/user/midori.html')
if bld.env['INTLTOOL']:
obj = bld.new_task_gen ('intltool_po')
obj.podir = 'po'