Merge branch 'upstream-unstable'

This commit is contained in:
Yves-Alexis Perez 2011-02-19 23:39:59 +01:00
commit 99655c6cc4
29 changed files with 10906 additions and 9320 deletions

View file

@ -1,5 +1,20 @@
This file is licensed under the terms of the expat license, see the file EXPAT.
v0.3.1
+ Fix automigration of existing bookmarks
+ Fix crash on opening autocompletion
+ Fix adblock handling of frames
+ Reflect tab order in the saved session
+ Don't show multiple user addon infobars
+ Provide distribution setting for close on left
+ Export to Netscape HTML format
+ Avoid config update on state changes
+ Always show progress and search engines in location
+ Default to app menu and no menubar
+ Fix GTK+ 2.14 build problems
+ Show 'Private Browsing' in window title
+ Uncached reload with Ctrl+Shift+R
v0.3.0
+ Support libnotify 0.7
+ Copy-friendly URIs with %20

View file

@ -654,16 +654,17 @@ adblock_is_matched_by_key (const gchar* opts,
{
if (g_regex_match_full (regex, req_uri, -1, 0, 0, NULL, NULL))
{
g_free (uri);
g_free (sig);
if (opts && adblock_check_filter_options (regex, opts, req_uri, page_uri))
{
g_free (uri);
g_list_free (regex_bl);
return FALSE;
}
else
{
adblock_debug ("blocked by regexp=%s -- %s", g_regex_get_pattern (regex), uri);
g_free (uri);
g_list_free (regex_bl);
return TRUE;
}
@ -753,7 +754,8 @@ adblock_resource_request_starting_cb (WebKitWebView* web_view,
const char *page_uri;
/* Never filter the main page itself */
if (web_frame == webkit_web_view_get_main_frame (web_view))
if (web_frame == webkit_web_view_get_main_frame (web_view)
&& webkit_web_frame_get_load_status (web_frame) == WEBKIT_LOAD_PROVISIONAL)
return;
req_uri = webkit_network_request_get_uri (request);

View file

@ -108,7 +108,7 @@ addons_install_response (GtkWidget* infobar,
if (uri && *uri)
{
gchar** split_uri;
gchar* path, *filename, *hostname, *dest_path, *temp_uri;
gchar* path, *filename, *hostname, *dest_path, *temp_uri, *folder_path;
const gchar* folder;
WebKitNetworkRequest* request;
WebKitDownload* download;
@ -119,7 +119,11 @@ addons_install_response (GtkWidget* infobar,
filename = NULL;
folder = NULL;
if (!g_strcmp0 (hostname, "userscripts.org"))
if (g_str_has_suffix (uri, ".user.js"))
folder = "scripts";
else if (g_str_has_suffix (uri, ".user.css"))
folder = "styles";
else if (!g_strcmp0 (hostname, "userscripts.org"))
{
gchar* script_id;
const gchar* js_script;
@ -129,7 +133,7 @@ addons_install_response (GtkWidget* infobar,
web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
web_frame = webkit_web_view_get_main_frame (web_view);
js_script = "document.getElementById('heading').childNodes[3].childNodes[1].innerHTML";
js_script = "document.getElementById('heading').childNodes[3].childNodes[1].textContent";
if (WEBKIT_IS_WEB_FRAME (web_frame))
{
JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
@ -182,14 +186,14 @@ addons_install_response (GtkWidget* infobar,
}
}
if (g_str_has_suffix (uri, ".user.js"))
folder = "scripts";
else if (g_str_has_suffix (uri, ".user.css"))
folder = "styles";
if (!filename)
filename = g_path_get_basename (uri);
path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),
PACKAGE_NAME, folder, filename, NULL);
folder_path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),
PACKAGE_NAME, folder, NULL);
if (!g_file_test (folder_path, G_FILE_TEST_EXISTS))
katze_mkdir_with_parents (folder_path, 0700);
path = g_build_path (G_DIR_SEPARATOR_S, folder_path, filename, NULL);
request = webkit_network_request_new (uri);
download = webkit_download_new (request);
@ -203,6 +207,7 @@ addons_install_response (GtkWidget* infobar,
g_free (path);
g_free (temp_uri);
g_free (dest_path);
g_free (folder_path);
g_strfreev (split_uri);
}
}
@ -210,8 +215,7 @@ addons_install_response (GtkWidget* infobar,
}
static void
addons_uri_install (MidoriBrowser* browser,
MidoriView* view,
addons_uri_install (MidoriView* view,
AddonsKind kind)
{
const gchar* message;
@ -239,31 +243,35 @@ addons_uri_install (MidoriBrowser* browser,
}
static void
addons_notify_load_status_cb (MidoriBrowser* browser,
addons_notify_load_status_cb (MidoriView* view,
GParamSpec* pspec,
MidoriExtension* extension)
{
const gchar* uri = midori_browser_get_current_uri (browser);
const gchar* uri = midori_view_get_display_uri (view);
WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
#if WEBKIT_CHECK_VERSION (1, 1, 14)
if (webkit_web_view_get_view_source_mode (web_view))
return;
#endif
if (uri && *uri)
{
/* FIXME: addons_notify_load_status_cb should pass MidoriView* pointer */
GtkWidget* view = midori_browser_get_current_tab (browser);
if (midori_view_get_load_status (MIDORI_VIEW (view)) == MIDORI_LOAD_FINISHED)
if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED)
{
/* casual sites goes by uri suffix */
if (g_str_has_suffix (uri, ".user.js"))
addons_uri_install (browser, MIDORI_VIEW (view), ADDONS_USER_SCRIPTS);
addons_uri_install (view, ADDONS_USER_SCRIPTS);
else if (g_str_has_suffix (uri, ".user.css"))
addons_uri_install (browser, MIDORI_VIEW (view), ADDONS_USER_STYLES);
addons_uri_install (view, ADDONS_USER_STYLES);
else if (g_str_has_prefix (uri, "http://userscripts.org/scripts/"))
{
gchar** split_uri = g_strsplit (uri, "/", -1);
gchar* subpage = split_uri[4];
/* userscripts.org script main (with desc) and "source view" pages */
if (!g_strcmp0 (subpage, "show") /* || !g_strcmp0 (subpage, "review") */)
addons_uri_install (browser, MIDORI_VIEW (view), ADDONS_USER_SCRIPTS);
if (!g_strcmp0 (subpage, "show") || !g_strcmp0 (subpage, "review"))
addons_uri_install (view, ADDONS_USER_SCRIPTS);
g_strfreev (split_uri);
}
@ -278,7 +286,7 @@ addons_notify_load_status_cb (MidoriBrowser* browser,
subpage = split_uri[5];
/* userstyles.org style main page with style description */
if (!subpage)
addons_uri_install (browser, MIDORI_VIEW (view), ADDONS_USER_STYLES);
addons_uri_install (view, ADDONS_USER_STYLES);
g_strfreev (split_uri);
}
@ -415,6 +423,7 @@ midori_addons_button_delete_clicked_cb (GtkWidget* toolitem,
struct AddonElement* element;
gint delete_response;
GtkWidget* dialog;
gchar* markup;
gtk_tree_model_get (model, &iter, 0, &element, -1);
dialog = gtk_message_dialog_new (
@ -431,10 +440,12 @@ midori_addons_button_delete_clicked_cb (GtkWidget* toolitem,
? _("Delete user script")
: _("Delete user style"));
gtk_message_dialog_format_secondary_markup (
GTK_MESSAGE_DIALOG (dialog),
markup = g_markup_printf_escaped (
_("The file <b>%s</b> will be permanently deleted."),
element->fullpath);
gtk_message_dialog_format_secondary_markup (
GTK_MESSAGE_DIALOG (dialog), "%s", markup);
g_free (markup);
delete_response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
@ -929,14 +940,15 @@ js_metadata_from_file (const gchar* filename,
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
== G_IO_STATUS_NORMAL)
{
g_strstrip (line);
if (g_str_has_prefix (line, "// ==UserScript=="))
found_meta = TRUE;
else if (found_meta)
{
if (g_str_has_prefix (line, "// ==/UserScript=="))
found_meta = FALSE;
else if (g_str_has_prefix (line, "// @require ") ||
g_str_has_prefix (line, "// @resource "))
else if (g_str_has_prefix (line, "// @require")
|| g_str_has_prefix (line, "// @resource"))
{
/* We don't support these, so abort here */
g_free (line);
@ -947,27 +959,29 @@ js_metadata_from_file (const gchar* filename,
*excludes = NULL;
return FALSE;
}
else if (includes && g_str_has_prefix (line, "// @include "))
else if (includes && g_str_has_prefix (line, "// @include"))
{
rest_of_line = g_strdup (line + strlen ("// @include "));
rest_of_line = g_strdup (line + strlen ("// @include"));
rest_of_line = g_strstrip (rest_of_line);
*includes = g_slist_prepend (*includes, rest_of_line);
}
else if (excludes && g_str_has_prefix (line, "// @exclude "))
else if (excludes && g_str_has_prefix (line, "// @exclude"))
{
rest_of_line = g_strdup (line + strlen ("// @exclude "));
rest_of_line = g_strdup (line + strlen ("// @exclude"));
rest_of_line = g_strstrip (rest_of_line);
*excludes = g_slist_prepend (*excludes, rest_of_line);
}
else if (name && g_str_has_prefix (line, "// @name "))
else if (name && g_str_has_prefix (line, "// @name"))
{
rest_of_line = g_strdup (line + strlen ("// @name "));
if (!strncmp (line, "// @namespace", 13))
continue;
rest_of_line = g_strdup (line + strlen ("// @name"));
rest_of_line = g_strstrip (rest_of_line);
*name = rest_of_line;
}
else if (description && g_str_has_prefix (line, "// @description "))
else if (description && g_str_has_prefix (line, "// @description"))
{
rest_of_line = g_strdup (line + strlen ("// @description "));
rest_of_line = g_strdup (line + strlen ("// @description"));
rest_of_line = g_strstrip (rest_of_line);
*description = rest_of_line;
}
@ -1001,6 +1015,7 @@ css_metadata_from_file (const gchar* filename,
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
== G_IO_STATUS_NORMAL)
{
g_strstrip (line);
if (g_str_has_prefix (line, "@-moz-document") || line_has_meta)
{ /* FIXME: We merely look for includes. We should honor blocks. */
if (includes)
@ -1265,13 +1280,11 @@ addons_update_elements (MidoriExtension* extension,
filename = g_path_get_basename (element->fullpath);
if (element->description)
{
tooltip = g_strdup_printf ("%s\n\n%s",
tooltip = g_markup_printf_escaped ("%s\n\n%s",
filename, element->description);
g_free (filename);
}
else
tooltip = filename;
tooltip = g_markup_escape_text (filename, -1);
g_free (filename);
gtk_list_store_append (liststore, &iter);
gtk_list_store_set (liststore, &iter,
@ -1504,6 +1517,8 @@ addons_add_tab_cb (MidoriBrowser* browser,
GtkWidget* web_view = midori_view_get_web_view (view);
g_signal_connect (web_view, "window-object-cleared",
G_CALLBACK (addons_context_ready_cb), extension);
g_signal_connect (view, "notify::load-status",
G_CALLBACK (addons_notify_load_status_cb), extension);
}
static void
@ -1575,8 +1590,6 @@ addons_app_add_browser_cb (MidoriApp* app,
(GtkCallback)addons_add_tab_foreach_cb, extension);
g_signal_connect (browser, "add-tab",
G_CALLBACK (addons_add_tab_cb), extension);
g_signal_connect (browser, "notify::load-status",
G_CALLBACK (addons_notify_load_status_cb), extension);
panel = katze_object_get_object (browser, "panel");
scripts = addons_new (ADDONS_USER_SCRIPTS, extension);

View file

@ -86,9 +86,16 @@ settings_and_accels_new (const gchar* config,
{
if (error->code == G_FILE_ERROR_NOENT)
{
GError* inner_error = NULL;
katze_assign (config_file, sokoke_find_config_filename (NULL, "config"));
g_key_file_load_from_file (key_file, config_file,
G_KEY_FILE_KEEP_COMMENTS, NULL);
G_KEY_FILE_KEEP_COMMENTS, &inner_error);
if (inner_error != NULL)
{
printf (_("The configuration couldn't be loaded: %s\n"),
inner_error->message);
g_error_free (inner_error);
}
}
else
printf (_("The configuration couldn't be loaded: %s\n"),
@ -589,8 +596,15 @@ settings_notify_cb (MidoriWebSettings* settings,
GParamSpec* pspec,
MidoriApp* app)
{
gchar* config_file = build_config_filename ("config");
GError* error = NULL;
gchar* config_file;
/* Skip state related properties to avoid disk IO */
if ((pspec && g_str_has_prefix (pspec->name, "last-window-"))
|| (pspec && g_str_has_prefix (pspec->name, "last-panel-")))
return;
config_file = build_config_filename ("config");
if (!settings_save_to_file (settings, app, config_file, &error))
{
g_warning (_("The configuration couldn't be saved. %s"), error->message);
@ -886,6 +900,7 @@ midori_soup_session_prepare (SoupSession* session,
{
"/etc/pki/tls/certs/ca-bundle.crt",
"/etc/ssl/certs/ca-certificates.crt",
"/etc/ssl/certs/ca-bundle.crt",
"/usr/local/share/certs/ca-root-nss.crt",
NULL
};
@ -1639,6 +1654,7 @@ main (int argc,
MidoriWebSettings* settings;
gchar* config_file;
gchar* bookmarks_file;
gboolean bookmarks_exist;
MidoriStartup load_on_startup;
KatzeArray* search_engines;
KatzeArray* bookmarks;
@ -1722,7 +1738,10 @@ main (int argc,
/* libSoup uses threads, so we need to initialize threads. */
if (!g_thread_supported ()) g_thread_init (NULL);
sokoke_register_stock_items ();
g_set_application_name (_("Midori"));
if (webapp && config)
g_set_application_name (_("Midori (Private Browsing)"));
else
g_set_application_name (_("Midori"));
#ifdef G_ENABLE_DEBUG
if (startup_timer)
@ -1733,7 +1752,7 @@ main (int argc,
{
g_print (
"%s %s\n\n"
"Copyright (c) 2007-2010 Christian Dywan\n\n"
"Copyright (c) 2007-2011 Christian Dywan\n\n"
"%s\n"
"\t%s\n\n"
"%s\n"
@ -1757,12 +1776,15 @@ main (int argc,
const gchar* name = gtk_action_get_name (action);
const gchar* space = " ";
gchar* padding = g_strndup (space, strlen (space) - strlen (name));
gchar* label = katze_strip_mnemonics (gtk_action_get_label (action));
const gchar* tooltip = gtk_action_get_tooltip (action);
g_print ("%s%s%s%s%s\n", name, padding, label,
gchar* label = katze_object_get_string (action, "label");
gchar* stripped = katze_strip_mnemonics (label);
gchar* tooltip = katze_object_get_string (action, "tooltip");
g_print ("%s%s%s%s%s\n", name, padding, stripped,
tooltip ? ": " : "", tooltip ? tooltip : "");
g_free (tooltip);
g_free (padding);
g_free (label);
g_free (stripped);
}
g_list_free (actions);
gtk_widget_destroy (GTK_WIDGET (browser));
@ -1966,6 +1988,7 @@ main (int argc,
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
bookmarks_file = g_build_filename (config, "bookmarks.db", NULL);
bookmarks_exist = g_access (bookmarks_file, F_OK) == 0;
errmsg = NULL;
if ((db = midori_bookmarks_initialize (bookmarks, bookmarks_file, &errmsg)) == NULL)
{
@ -1973,8 +1996,9 @@ main (int argc,
_("Bookmarks couldn't be loaded: %s\n"), errmsg);
g_free (errmsg);
}
else
else if (!bookmarks_exist)
{
/* Initial creation, import old bookmarks */
gchar* old_bookmarks;
if (g_path_is_absolute (BOOKMARK_FILE))
old_bookmarks = g_strdup (BOOKMARK_FILE);
@ -1986,8 +2010,8 @@ main (int argc,
/* Leave old bookmarks around */
}
g_free (old_bookmarks);
g_object_set_data (G_OBJECT (bookmarks), "db", db);
}
g_object_set_data (G_OBJECT (bookmarks), "db", db);
midori_startup_timer ("Bookmarks read: \t%f");
config_file = NULL;

View file

@ -293,6 +293,45 @@ katze_array_from_xmlDocPtr (KatzeArray* array,
return TRUE;
}
static gchar*
katze_unescape_html (const gchar* text)
{
gchar* amp = g_strstr_len (text, -1, "&");
if (amp && *amp)
{
if (!strncmp (amp, "&quot;", 6) || !strncmp (amp, "&amp;", 5)
|| !strncmp (amp, "&lt;", 4) || !strncmp (amp, "&gt;", 4)
|| !strncmp (amp, "&apos;", 6))
{
guint i = 0;
gchar** parts = g_strsplit_set (text, "&;", -1);
GString *unescaped = g_string_new (NULL);
while (parts[i])
{
if (katze_str_equal ("quot", parts[i]))
g_string_append (unescaped, "\"");
else if (katze_str_equal ("amp", parts[i]))
g_string_append (unescaped, "&");
else if (katze_str_equal ("lt", parts[i]))
g_string_append (unescaped, "<");
else if (katze_str_equal ("gt", parts[i]))
g_string_append (unescaped, ">");
else if (katze_str_equal ("apos", parts[i]))
g_string_append (unescaped, "'");
else
g_string_append (unescaped, parts[i]);
i++;
}
g_strfreev (parts);
return g_string_free (unescaped, FALSE);
}
}
return g_strdup (text);
}
static gboolean
katze_array_from_netscape_file (KatzeArray* array,
const gchar* filename)
@ -322,8 +361,8 @@ katze_array_from_netscape_file (KatzeArray* array,
gchar** parts = g_strsplit (line, "\"", -1);
item = katze_item_new ();
katze_array_add_item (folder, item);
item->name = g_strdup (element[4]);
item->uri = g_strdup (parts[1]);
item->name = katze_unescape_html (element[4]);
item->uri = katze_unescape_html (parts[1]);
g_strfreev (parts);
}
/* item is folder */
@ -332,14 +371,14 @@ katze_array_from_netscape_file (KatzeArray* array,
item = (KatzeItem*)katze_array_new (KATZE_TYPE_ARRAY);
katze_array_add_item (folder, item);
folder = (KatzeArray*)item;
item->name = g_strdup (element[4]);
item->name = katze_unescape_html (element[4]);
}
}
/* item description */
if (item && katze_str_equal (element[1], "DD"))
{
if (element[2])
item->text = g_strdup (element[2]);
item->text = katze_unescape_html (element[2]);
item = NULL;
}
/* end of current folder, level-up */
@ -702,6 +741,48 @@ string_append_item (GString* string,
g_free (metadata);
}
static void
string_append_netscape_item (GString* string,
KatzeItem* item)
{
g_return_if_fail (KATZE_IS_ITEM (item));
if (KATZE_IS_ARRAY (item))
{
KatzeItem* _item;
KatzeArray* array = KATZE_ARRAY (item);
GList* list;
g_string_append (string, "\t<DT><H3 FOLDED ADD_DATE=\"\">");
string_append_escaped (string, katze_item_get_name (item));
g_string_append (string, "</H3>\n");
g_string_append (string, "\t<DL><P>\n");
KATZE_ARRAY_FOREACH_ITEM_L (_item, array, list)
{
g_string_append (string, "\t");
string_append_netscape_item (string, _item);
}
g_string_append (string, "\t</DL><P>\n");
g_list_free (list);
}
else if (katze_item_get_uri (item))
{
g_string_append (string, "\t<DT><A HREF=\"");
string_append_escaped (string, katze_item_get_uri (item));
g_string_append (string, "\" ADD_DATE=\"\" LAST_VISIT=\"\" LAST_MODIFIED=\"\">");
string_append_escaped (string, katze_item_get_name (item));
g_string_append (string, "</A>\n");
if (item->text && g_strcmp0 (item->text, ""))
{
g_string_append (string, "\t<DD>");
string_append_escaped (string, katze_item_get_text (item));
g_string_append (string, "\n");
}
}
}
static gchar*
katze_item_metadata_to_xbel (KatzeItem* item)
{
@ -788,15 +869,48 @@ katze_array_to_xbel (KatzeArray* array,
return g_string_free (markup, FALSE);
}
static gchar*
katze_array_to_netscape_html (KatzeArray* array,
GError** error)
{
KatzeItem* item;
GList* list;
/* The header, including the text, is the same as used in other browsers,
see http://msdn.microsoft.com/en-us/library/aa753582(v=vs.85).aspx */
GString* markup = g_string_new (
"<!DOCTYPE NETSCAPE-Bookmark-file-1>\n"
"<!--This is an automatically generated file.\n"
"It will be read and overwritten.\n"
"Do Not Edit! -->\n"
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">\n"
"<Title>Bookmarks</Title>\n"
"<H1>Bookmarks</H1>\n"
"\n");
g_string_append (markup, "<DL><P>\n");
KATZE_ARRAY_FOREACH_ITEM_L (item, array, list)
string_append_netscape_item (markup, item);
g_string_append (markup, "</DL><P>\n");
g_list_free (list);
return g_string_free (markup, FALSE);
}
static gboolean
midori_array_to_file_xbel (KatzeArray* array,
const gchar* filename,
GError** error)
midori_array_to_file_format (KatzeArray* array,
const gchar* filename,
const gchar* format,
GError** error)
{
gchar* data;
FILE* fp;
if (!(data = katze_array_to_xbel (array, error)))
if (!g_strcmp0 (format, "xbel"))
data = katze_array_to_xbel (array, error);
if (!g_strcmp0 (format, "netscape"))
data = katze_array_to_netscape_html (array, error);
if (!data)
return FALSE;
if (!(fp = fopen (filename, "w")))
{
@ -833,8 +947,10 @@ midori_array_to_file (KatzeArray* array,
g_return_val_if_fail (filename, FALSE);
g_return_val_if_fail (!error || !*error, FALSE);
if (!g_strcmp0 (format, "xbel"))
return midori_array_to_file_xbel (array, filename, error);
if (!g_strcmp0 (format, "xbel")
|| !g_strcmp0 (format, "netscape"))
return midori_array_to_file_format (array, filename, format, error);
g_critical ("Cannot write KatzeArray to unknown format '%s'.", format);
return FALSE;
}

View file

@ -80,7 +80,6 @@ struct _MidoriBrowser
GtkWidget* statusbar;
GtkWidget* statusbar_contents;
GtkWidget* transferbar;
GtkWidget* progressbar;
gchar* statusbar_text;
gint last_window_width, last_window_height;
@ -100,7 +99,6 @@ struct _MidoriBrowser
gboolean show_navigationbar;
gboolean show_statusbar;
gboolean speed_dial_in_new_tabs;
gboolean progress_in_location;
guint maximum_history_age;
gchar* location_entry_search;
gchar* news_aggregator;
@ -330,8 +328,7 @@ _midori_browser_update_interface (MidoriBrowser* browser)
"stock-id", GTK_STOCK_REFRESH,
"tooltip", _("Reload the current page"),
"sensitive", can_reload, NULL);
gtk_widget_hide (browser->progressbar);
if (!browser->show_navigationbar && !browser->show_statusbar)
if (!browser->show_navigationbar)
gtk_widget_hide (browser->navigationbar);
}
else
@ -339,11 +336,7 @@ _midori_browser_update_interface (MidoriBrowser* browser)
g_object_set (action,
"stock-id", GTK_STOCK_STOP,
"tooltip", _("Stop loading the current page"), NULL);
if (!browser->progress_in_location || !gtk_widget_get_visible (browser->navigationbar))
gtk_widget_show (browser->progressbar);
if (!gtk_widget_get_visible (browser->statusbar) &&
!gtk_widget_get_visible (browser->navigationbar) &&
browser->progress_in_location)
if (!gtk_widget_get_visible (browser->navigationbar))
gtk_widget_show (browser->navigationbar);
}
@ -434,30 +427,12 @@ _midori_browser_update_progress (MidoriBrowser* browser,
{
MidoriLocationAction* action;
gdouble progress;
gchar* message;
action = MIDORI_LOCATION_ACTION (_action_by_name (browser, "Location"));
progress = midori_view_get_progress (view);
/* 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;
if (progress > 0.0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (browser->progressbar),
progress);
message = g_strdup_printf (_("%d%% loaded"), (gint)(progress * 100));
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (browser->progressbar),
message);
g_free (message);
if (!browser->progress_in_location)
progress = 0.0;
}
else
{
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (browser->progressbar));
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (browser->progressbar),
NULL);
}
midori_location_action_set_progress (action, progress);
}
@ -989,7 +964,7 @@ midori_browser_prepare_download (MidoriBrowser* browser,
else
g_assert_not_reached ();
sokoke_message_dialog (GTK_MESSAGE_ERROR, message, detailed_message);
sokoke_message_dialog (GTK_MESSAGE_ERROR, message, detailed_message, FALSE);
g_free (message);
g_free (detailed_message);
g_object_unref (download);
@ -997,11 +972,6 @@ midori_browser_prepare_download (MidoriBrowser* browser,
}
webkit_download_set_destination_uri (download, uri);
if (!browser->show_statusbar && gtk_widget_get_visible (browser->transferbar))
{
_midori_browser_set_statusbar_text (browser, NULL);
gtk_widget_show (browser->statusbar);
}
midori_transferbar_add_download_item (MIDORI_TRANSFERBAR (browser->transferbar), download);
return TRUE;
}
@ -1581,6 +1551,8 @@ _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",
@ -1626,11 +1598,16 @@ _midori_browser_add_tab (MidoriBrowser* browser,
if (!g_object_get_data (G_OBJECT (view), "midori-view-append") &&
katze_object_get_boolean (browser->settings, "open-tabs-next-to-current"))
{
n = gtk_notebook_get_current_page (notebook);
gtk_notebook_insert_page (notebook, view, tab_label, n + 1);
n = gtk_notebook_get_current_page (notebook) + 1;
gtk_notebook_insert_page (notebook, view, tab_label, n);
katze_array_move_item (browser->proxy_array, item, n);
}
else
{
gtk_notebook_append_page (notebook, view, tab_label);
katze_array_move_item (browser->proxy_array, item,
gtk_notebook_get_n_pages (notebook));
}
gtk_notebook_set_tab_reorderable (notebook, view, TRUE);
gtk_notebook_set_tab_detachable (notebook, view, TRUE);
@ -2260,7 +2237,7 @@ midori_browser_subscribe_to_news_feed (MidoriBrowser* browser,
"Alternatively go to Preferences, Applications in Midori, "
"and select a News Aggregator. Next time you click the "
"news feed icon, it will be added automatically."));
sokoke_message_dialog (GTK_MESSAGE_INFO, _("New feed"), description);
sokoke_message_dialog (GTK_MESSAGE_INFO, _("New feed"), description, FALSE);
g_free (description);
}
}
@ -2631,9 +2608,6 @@ midori_browser_toolbar_popup_context_menu_cb (GtkWidget* widget,
menuitem = sokoke_action_create_popup_menu_item (
_action_by_name (browser, "Bookmarkbar"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = sokoke_action_create_popup_menu_item (
_action_by_name (browser, "Transferbar"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = sokoke_action_create_popup_menu_item (
_action_by_name (browser, "Statusbar"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
@ -2948,6 +2922,8 @@ _action_compact_menu_populate_popup (GtkAction* action,
{ "InspectPage" },
#endif
{ "Fullscreen" },
{ "BookmarksImport"},
{ "BookmarksExport"},
#endif
{ "About" },
{ "Preferences" },
@ -3106,15 +3082,6 @@ _action_bookmarkbar_activate (GtkToggleAction* action,
sokoke_widget_set_visible (browser->bookmarkbar, active);
}
static void
_action_transferbar_activate (GtkToggleAction* action,
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
g_object_set (browser->settings, "show-transferbar", active, NULL);
sokoke_widget_set_visible (browser->transferbar, active);
}
static void
_action_statusbar_activate (GtkToggleAction* action,
MidoriBrowser* browser)
@ -3130,9 +3097,6 @@ _action_reload_stop_activate (GtkAction* action,
{
gchar* stock_id;
GtkWidget* view;
GdkModifierType state = (GdkModifierType)0;
gint x, y;
gboolean from_cache;
if (!(view = midori_browser_get_current_tab (browser)))
return;
@ -3142,9 +3106,19 @@ _action_reload_stop_activate (GtkAction* action,
/* Refresh or stop, depending on the stock id */
if (!strcmp (stock_id, GTK_STOCK_REFRESH))
{
gdk_window_get_pointer (NULL, &x, &y, &state);
from_cache = state & GDK_SHIFT_MASK;
midori_view_reload (MIDORI_VIEW (view), !from_cache);
GdkModifierType state = (GdkModifierType)0;
gint x, y;
gboolean from_cache = TRUE;
if (!strcmp (gtk_action_get_name (action), "ReloadUncached"))
from_cache = FALSE;
else
{
gdk_window_get_pointer (NULL, &x, &y, &state);
if (state & GDK_SHIFT_MASK)
from_cache = FALSE;
}
midori_view_reload (MIDORI_VIEW (view), from_cache);
}
else
midori_view_stop_loading (MIDORI_VIEW (view));
@ -3325,7 +3299,8 @@ _action_source_view_activate (GtkAction* action,
if (!sokoke_show_uri_with_mime_type (gtk_widget_get_screen (view),
uri, "text/plain", gtk_get_current_event_time (), &error))
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."), error ? error->message : "");
_("Could not run external program."),
error ? error->message : "", FALSE);
if (error)
g_error_free (error);
g_free (text_editor);
@ -4115,7 +4090,8 @@ _action_bookmarks_import_activate (GtkAction* action,
if (path && !midori_array_from_file (bookmarks, path, NULL, &error))
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Failed to import bookmarks"), error ? error->message : "");
_("Failed to import bookmarks"),
error ? error->message : "", FALSE);
if (error)
g_error_free (error);
}
@ -4134,6 +4110,8 @@ _action_bookmarks_export_activate (GtkAction* action,
MidoriBrowser* browser)
{
GtkWidget* file_dialog;
GtkFileFilter* filter;
const gchar* format;
gchar* path = NULL;
GError* error;
sqlite3* db;
@ -4142,13 +4120,36 @@ _action_bookmarks_export_activate (GtkAction* action,
if (!browser->bookmarks || !gtk_widget_get_visible (GTK_WIDGET (browser)))
return;
wrong_format:
file_dialog = sokoke_file_chooser_dialog_new (_("Save file as"),
GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_dialog),
"bookmarks.xbel");
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("XBEL Bookmarks"));
gtk_file_filter_add_mime_type (filter, "application/xml");
gtk_file_filter_add_pattern (filter, "*.xbel");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_dialog), filter);
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("Netscape Bookmarks"));
gtk_file_filter_add_mime_type (filter, "text/html");
gtk_file_filter_add_pattern (filter, "*.html");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_dialog), filter);
if (gtk_dialog_run (GTK_DIALOG (file_dialog)) == GTK_RESPONSE_OK)
path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog));
gtk_widget_destroy (file_dialog);
if (g_str_has_suffix (path, ".xbel"))
format = "xbel";
else if (g_str_has_suffix (path, ".html"))
format = "netscape";
else if (path != NULL)
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Midori can only export to XBEL (*.xbel) and Netscape (*.html)"),
"", TRUE);
katze_assign (path, NULL);
goto wrong_format;
}
if (path == NULL)
return;
@ -4157,10 +4158,10 @@ _action_bookmarks_export_activate (GtkAction* action,
db = g_object_get_data (G_OBJECT (browser->history), "db");
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
midori_bookmarks_export_array_db (db, bookmarks, "");
if (!midori_array_to_file (bookmarks, path, "xbel", &error))
if (!midori_array_to_file (bookmarks, path, format, &error))
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Failed to export bookmarks"), error ? error->message : "");
_("Failed to export bookmarks"), error ? error->message : "", FALSE);
if (error)
g_error_free (error);
}
@ -4470,10 +4471,9 @@ static void
_action_about_activate (GtkAction* action,
MidoriBrowser* browser)
{
gchar* comments = g_strdup_printf ("GTK+ %d.%d.%d, WebKitGTK+ %d.%d.%d\n%s",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION,
_("A lightweight web browser."));
gchar* comments = g_strdup_printf ("%s\n%s",
_("A lightweight web browser."),
_("See about:version for version info."));
const gchar* license =
_("This library is free software; you can redistribute it and/or "
"modify it under the terms of the GNU Lesser General Public "
@ -4487,7 +4487,7 @@ _action_about_activate (GtkAction* action,
"name", PACKAGE_NAME,
"version", PACKAGE_VERSION,
"comments", comments,
"copyright", "Copyright © 2007-2010 Christian Dywan",
"copyright", "Copyright © 2007-2011 Christian Dywan",
"website", "http://www.twotoasts.de",
"authors", credits_authors,
"documenters", credits_documenters,
@ -4819,8 +4819,13 @@ static const GtkActionEntry entries[] =
N_("Add to Speed _dial"), "<Ctrl>h",
N_("Add shortcut to speed dial"), G_CALLBACK (_action_add_speed_dial_activate) },
{ "AddDesktopShortcut", NULL,
#if HAVE_HILDON
N_("Add Shortcut to the _desktop"), "<Ctrl>j",
N_("Add shortcut to the desktop"), G_CALLBACK (_action_add_desktop_shortcut_activate) },
#else
N_("Create _Launcher"), "<Ctrl>j",
N_("Create a launcher"), G_CALLBACK (_action_add_desktop_shortcut_activate) },
#endif
{ "AddNewsFeed", NULL,
N_("Subscribe to News _feed"), NULL,
N_("Subscribe to this news feed"), G_CALLBACK (_action_add_news_feed_activate) },
@ -4883,6 +4888,9 @@ static const GtkActionEntry entries[] =
{ "Reload", GTK_STOCK_REFRESH,
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"), G_CALLBACK (_action_reload_stop_activate) },
{ "Stop", GTK_STOCK_STOP,
NULL, "Escape",
N_("Stop loading the current page"), G_CALLBACK (_action_reload_stop_activate) },
@ -5029,10 +5037,6 @@ static const GtkToggleActionEntry toggle_entries[] =
N_("_Bookmarkbar"), "",
N_("Show bookmarkbar"), G_CALLBACK (_action_bookmarkbar_activate),
FALSE },
{ "Transferbar", NULL,
N_("_Transferbar"), "",
N_("Show transferbar"), G_CALLBACK (_action_transferbar_activate),
FALSE },
{ "Statusbar", NULL,
N_("_Statusbar"), "",
N_("Show statusbar"), G_CALLBACK (_action_statusbar_activate),
@ -5213,7 +5217,6 @@ static const gchar* ui_markup =
"<menuitem action='Menubar'/>"
"<menuitem action='Navigationbar'/>"
"<menuitem action='Bookmarkbar'/>"
"<menuitem action='Transferbar'/>"
"<menuitem action='Statusbar'/>"
"</menu>"
"<menuitem action='Panel'/>"
@ -5281,6 +5284,7 @@ static const gchar* ui_markup =
"<menuitem action='TrashEmpty'/>"
"<menuitem action='Preferences'/>"
"<menuitem action='InspectPage'/>"
"<menuitem action='ReloadUncached'/>"
"</menu>"
"</menubar>"
"<toolbar name='toolbar_navigation'>"
@ -5769,9 +5773,6 @@ midori_browser_init (MidoriBrowser* browser)
#if HAVE_HILDON
_action_set_visible (browser, "Menubar", FALSE);
#endif
#if !WEBKIT_CHECK_VERSION (1, 1, 3)
_action_set_visible (browser, "Transferbar", FALSE);
#endif
#if !WEBKIT_CHECK_VERSION (1, 1, 2)
_action_set_sensitive (browser, "Encoding", FALSE);
#endif
@ -5936,10 +5937,6 @@ midori_browser_init (MidoriBrowser* browser)
#endif
gtk_box_pack_start (GTK_BOX (vbox), browser->statusbar, FALSE, FALSE, 0);
browser->progressbar = gtk_progress_bar_new ();
gtk_box_pack_start (GTK_BOX (browser->statusbar_contents),
browser->progressbar, FALSE, FALSE, 3);
browser->transferbar = g_object_new (MIDORI_TYPE_TRANSFERBAR, NULL);
gtk_box_pack_start (GTK_BOX (browser->statusbar_contents), browser->transferbar, FALSE, FALSE, 3);
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (browser->transferbar), FALSE);
@ -6095,7 +6092,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
gboolean right_align_sidepanel, open_panels_in_windows;
gint last_panel_position, last_panel_page;
gboolean show_menubar, show_bookmarkbar;
gboolean show_panel, show_transferbar;
gboolean show_panel;
MidoriToolbarStyle toolbar_style;
gchar* toolbar_items;
gint last_web_search;
@ -6119,7 +6116,6 @@ _midori_browser_update_settings (MidoriBrowser* browser)
"show-navigationbar", &browser->show_navigationbar,
"show-bookmarkbar", &show_bookmarkbar,
"show-panel", &show_panel,
"show-transferbar", &show_transferbar,
"show-statusbar", &browser->show_statusbar,
"speed-dial-in-new-tabs", &browser->speed_dial_in_new_tabs,
"toolbar-style", &toolbar_style,
@ -6127,7 +6123,6 @@ _midori_browser_update_settings (MidoriBrowser* browser)
"last-web-search", &last_web_search,
"location-entry-search", &browser->location_entry_search,
"close-buttons-on-tabs", &close_buttons_on_tabs,
"progress-in-location", &browser->progress_in_location,
"maximum-history-age", &browser->maximum_history_age,
"news-aggregator", &browser->news_aggregator,
NULL);
@ -6206,9 +6201,6 @@ _midori_browser_update_settings (MidoriBrowser* browser)
_action_set_active (browser, "Bookmarkbar", show_bookmarkbar
&& browser->bookmarks != NULL);
_action_set_active (browser, "Panel", show_panel);
#if WEBKIT_CHECK_VERSION (1, 1, 3)
_action_set_active (browser, "Transferbar", show_transferbar);
#endif
_action_set_active (browser, "Statusbar", browser->show_statusbar);
g_free (toolbar_items);
@ -6261,8 +6253,6 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
browser->show_statusbar = g_value_get_boolean (&value);
else if (name == g_intern_string ("speed-dial-in-new-tabs"))
browser->speed_dial_in_new_tabs = g_value_get_boolean (&value);
else if (name == g_intern_string ("progress-in-location"))
browser->progress_in_location = g_value_get_boolean (&value);
else if (name == g_intern_string ("search-engines-in-completion"))
{
if (g_value_get_boolean (&value))

View file

@ -505,6 +505,8 @@ midori_location_action_popup_timeout_cb (gpointer data)
g_free (uri);
g_free (title);
i++;
if (i > 4)
break;
}
searches += i;
}
@ -1065,6 +1067,7 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
{
MidoriLocationAction* action = data;
gchar* uri_escaped;
gchar* uri_temp;
gchar* uri;
gchar* title;
gboolean style;
@ -1107,8 +1110,10 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
keys = g_strsplit_set (key, " %", -1);
g_free (key);
uri = sokoke_uri_unescape_string (uri_escaped);
uri_temp = sokoke_uri_unescape_string (uri_escaped);
g_free (uri_escaped);
uri = g_strescape (uri_temp, NULL);
g_free (uri_temp);
if (G_LIKELY (uri))
{

View file

@ -365,15 +365,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (label);
button = katze_property_proxy (settings, "download-folder", "folder");
SPANNED_ADD (button);
label = katze_property_proxy (settings, "ask-for-destination-folder", NULL);
INDENTED_ADD (label);
#if HAVE_LIBNOTIFY
if (notify_is_initted () || g_find_program_in_path ("notify-send"))
{
button = katze_property_proxy (settings, "notify-transfer-completed", NULL);
SPANNED_ADD (button);
}
#endif
#endif
/* Page "Appearance" */
@ -456,10 +447,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (katze_property_label (settings, "toolbar-style"));
button = katze_property_proxy (settings, "toolbar-style", NULL);
SPANNED_ADD (button);
button = katze_property_proxy (settings, "progress-in-location", NULL);
INDENTED_ADD (button);
button = katze_property_proxy (settings, "search-engines-in-completion", NULL);
SPANNED_ADD (button);
#endif
FRAME_NEW (_("Browsing"));
label = katze_property_label (settings, "open-new-pages-in");

View file

@ -92,7 +92,6 @@ struct _MidoriView
gboolean speed_dial_in_new_tabs;
gchar* download_manager;
gchar* news_aggregator;
gboolean ask_for_destination_folder;
gboolean middle_click_opens_selection;
gboolean open_tabs_in_the_background;
gboolean close_buttons_on_tabs;
@ -1353,6 +1352,7 @@ midori_view_display_error (MidoriView* view,
#endif
gchar* res_root;
gchar* stock_root;
gchar* title_escaped;
gchar* result;
#if WEBKIT_CHECK_VERSION (1, 1, 14)
@ -1365,14 +1365,16 @@ midori_view_display_error (MidoriView* view,
stock_root = g_strdup_printf ("http://localhost:%d/stock", port);
#endif
title_escaped = g_markup_escape_text (title, -1);
result = sokoke_replace_variables (template,
"{title}", title,
"{title}", title_escaped,
"{message}", message,
"{description}", description,
"{tryagain}", try_again,
"{res}", res_root,
"{stock}", stock_root,
NULL);
g_free (title_escaped);
g_free (template);
midori_view_load_alternate_string (view,
@ -1990,11 +1992,8 @@ midori_web_view_menu_save_activate_cb (GtkWidget* widget,
WebKitDownload* download = webkit_download_new (request);
gboolean handled;
g_object_unref (request);
if (view->ask_for_destination_folder)
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_signal_emit (view, signals[DOWNLOAD_REQUESTED], 0, download, &handled);
if (!view->ask_for_destination_folder)
webkit_download_start (download);
}
static void
@ -2025,11 +2024,8 @@ midori_web_view_menu_image_save_activate_cb (GtkWidget* widget,
WebKitDownload* download = webkit_download_new (request);
gboolean handled;
g_object_unref (request);
if (view->ask_for_destination_folder)
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_signal_emit (view, signals[DOWNLOAD_REQUESTED], 0, download, &handled);
if (!view->ask_for_destination_folder)
webkit_download_start (download);
g_free (uri);
}
@ -2051,11 +2047,8 @@ midori_web_view_menu_video_save_activate_cb (GtkWidget* widget,
WebKitDownload* download = webkit_download_new (request);
gboolean handled;
g_object_unref (request);
if (view->ask_for_destination_folder)
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_object_set_data (G_OBJECT (download), "save-as-download", (void*)0xdeadbeef);
g_signal_emit (view, signals[DOWNLOAD_REQUESTED], 0, download, &handled);
if (!view->ask_for_destination_folder)
webkit_download_start (download);
g_free (uri);
}
@ -2421,8 +2414,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,
view->ask_for_destination_folder ? _("_Save Link destination")
: _("_Download Link destination"), NULL,
_("_Save Link destination"), NULL,
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,
@ -2441,8 +2433,7 @@ midori_view_populate_popup (MidoriView* view,
_("Copy Image _Address"), NULL,
G_CALLBACK (midori_web_view_menu_image_copy_activate_cb), widget);
midori_view_insert_menu_item (menu_shell, -1,
view->ask_for_destination_folder ? _("Save I_mage")
: _("Download I_mage"), GTK_STOCK_SAVE,
_("Save I_mage"), GTK_STOCK_SAVE,
G_CALLBACK (midori_web_view_menu_image_save_activate_cb), widget);
}
@ -2893,6 +2884,7 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view,
description = g_content_type_get_description (content_type);
#if GTK_CHECK_VERSION (2, 14, 0)
icon = g_content_type_get_icon (content_type);
g_themed_icon_append_name (G_THEMED_ICON (icon), "document-x-generic");
image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
g_object_unref (icon);
gtk_widget_show (image);
@ -3319,7 +3311,6 @@ _midori_view_set_settings (MidoriView* view,
"kinetic-scrolling", &kinetic_scrolling,
"close-buttons-on-tabs", &view->close_buttons_on_tabs,
"open-new-pages-in", &view->open_new_pages_in,
"ask-for-destination-folder", &view->ask_for_destination_folder,
"middle-click-opens-selection", &view->middle_click_opens_selection,
"open-tabs-in-the-background", &view->open_tabs_in_the_background,
"find-while-typing", &view->find_while_typing,
@ -3396,8 +3387,6 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
}
else if (name == g_intern_string ("open-new-pages-in"))
view->open_new_pages_in = g_value_get_enum (&value);
else if (name == g_intern_string ("ask-for-destination-folder"))
view->ask_for_destination_folder = g_value_get_boolean (&value);
else if (name == g_intern_string ("middle-click-opens-selection"))
view->middle_click_opens_selection = g_value_get_boolean (&value);
else if (name == g_intern_string ("open-tabs-in-the-background"))
@ -3469,6 +3458,7 @@ midori_view_web_inspector_construct_window (gpointer inspector,
MidoriView* view)
{
gchar* title;
gchar* label;
GtkWidget* window;
GtkWidget* toplevel;
GdkScreen* screen;
@ -3477,10 +3467,12 @@ midori_view_web_inspector_construct_window (gpointer inspector,
GdkPixbuf* icon;
GdkPixbuf* gray_icon;
title = g_strdup_printf (_("Inspect page - %s"), "");
label = g_strdup (midori_view_get_display_title (view));
title = g_strdup_printf (_("Inspect page - %s"), label);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), title);
g_free (title);
g_free (label);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
if (gtk_widget_is_toplevel (toplevel))
@ -3879,7 +3871,7 @@ midori_view_set_uri (MidoriView* view,
data = g_strdup_printf (
"<html><head><title>about:version</title></head>"
"<body><h1>about:version</h1>"
"<p>Version numbers in brackets show the version used at runtime.</p>"
"<p>%s</p>"
"<img src=\"res://logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
"<table>"
@ -3897,6 +3889,7 @@ midori_view_set_uri (MidoriView* view,
"<tr><td>Identification</td><td>%s</td></tr>"
"</table>"
"</body></html>",
_("Version numbers in brackets show the version used at runtime."),
command_line,
DEBUGGING,
WEBKIT_MAJOR_VERSION,
@ -3962,7 +3955,8 @@ midori_view_set_uri (MidoriView* view,
result = midori_view_execute_script (view, &uri[11], &exception);
if (!result)
{
sokoke_message_dialog (GTK_MESSAGE_ERROR, "javascript:", exception);
sokoke_message_dialog (GTK_MESSAGE_ERROR, "javascript:",
exception, FALSE);
g_free (exception);
}
}
@ -4582,15 +4576,18 @@ midori_view_get_proxy_tab_label (MidoriView* view)
align = gtk_alignment_new (1.0, 0.0, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), view->tab_close);
#if HAVE_OSX
gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
#else
gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
#endif
if (katze_object_get_boolean (view->settings, "close-buttons-left"))
{
gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
}
else
{
gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
}
gtk_widget_show_all (GTK_WIDGET (event_box));
if (view->minimized)

View file

@ -37,7 +37,6 @@ struct _MidoriWebSettings
gboolean show_transferbar : 1;
gboolean show_statusbar : 1;
MidoriToolbarStyle toolbar_style : 3;
gboolean progress_in_location : 1;
gboolean search_engines_in_completion : 1;
gboolean compact_sidepanel : 1;
gboolean show_panel_controls : 1;
@ -46,11 +45,10 @@ struct _MidoriWebSettings
MidoriStartup load_on_startup : 2;
gboolean show_crash_dialog : 1;
gboolean speed_dial_in_new_tabs : 1;
gboolean ask_for_destination_folder : 1;
gboolean notify_transfer_completed : 1;
MidoriPreferredEncoding preferred_encoding : 3;
gboolean always_show_tabbar : 1;
gboolean close_buttons_on_tabs : 1;
gboolean close_buttons_left : 1;
MidoriNewPage open_new_pages_in : 2;
MidoriNewPage open_external_pages_in : 2;
gboolean middle_click_opens_selection : 1;
@ -117,7 +115,6 @@ enum
PROP_SHOW_STATUSBAR,
PROP_TOOLBAR_STYLE,
PROP_PROGRESS_IN_LOCATION,
PROP_SEARCH_ENGINES_IN_COMPLETION,
PROP_TOOLBAR_ITEMS,
PROP_COMPACT_SIDEPANEL,
@ -130,8 +127,6 @@ enum
PROP_SHOW_CRASH_DIALOG,
PROP_SPEED_DIAL_IN_NEW_TABS,
PROP_DOWNLOAD_FOLDER,
PROP_ASK_FOR_DESTINATION_FOLDER,
PROP_NOTIFY_TRANSFER_COMPLETED,
PROP_DOWNLOAD_MANAGER,
PROP_TEXT_EDITOR,
PROP_NEWS_AGGREGATOR,
@ -140,6 +135,7 @@ enum
PROP_ALWAYS_SHOW_TABBAR,
PROP_CLOSE_BUTTONS_ON_TABS,
PROP_CLOSE_BUTTONS_LEFT,
PROP_OPEN_NEW_PAGES_IN,
PROP_OPEN_EXTERNAL_PAGES_IN,
PROP_MIDDLE_CLICK_OPENS_SELECTION,
@ -444,7 +440,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"show-menubar",
_("Show Menubar"),
_("Whether to show the menubar"),
TRUE,
FALSE,
flags));
g_object_class_install_property (gobject_class,
@ -480,6 +476,8 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
* Whether to show the transferbar.
*
* Since: 0.1.5
*
* Deprecated: 0.3.1
*/
g_object_class_install_property (gobject_class,
PROP_SHOW_TRANSFERBAR,
@ -510,28 +508,14 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
MIDORI_TOOLBAR_DEFAULT,
flags));
/**
* MidoriWebSettings:progress-in-location:
*
* Whether to show loading progress in the location entry.
*
* Since: 0.1.3
*/
g_object_class_install_property (gobject_class,
PROP_PROGRESS_IN_LOCATION,
g_param_spec_boolean (
"progress-in-location",
_("Show progress in location entry"),
_("Whether to show loading progress in the location entry"),
TRUE,
flags));
/**
* MidoriWebSettings:search-engines-in-completion:
*
* Whether to show search engines in the location completion.
*
* Since: 0.1.6
*
* Deprecated: 0.3.1
*/
g_object_class_install_property (gobject_class,
PROP_SEARCH_ENGINES_IN_COMPLETION,
@ -548,7 +532,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"toolbar-items",
_("Toolbar Items"),
_("The items to show on the toolbar"),
"TabNew,Back,Forward,Next,ReloadStop,BookmarkAdd,Location,Search,Trash",
"TabNew,Back,Forward,Next,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu",
flags));
g_object_class_install_property (gobject_class,
@ -676,52 +660,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#endif
/**
* MidoriWebSettings:ask-for-destination-folder:
*
* Whether to ask for the destination folder when downloading a file.
*
* Note: Only since 0.2.0 is this value actually used.
*
* Since: 0.1.7
*
* Deprecated: 0.3.0
*/
g_object_class_install_property (gobject_class,
PROP_ASK_FOR_DESTINATION_FOLDER,
g_param_spec_boolean (
"ask-for-destination-folder",
_("Ask for the destination folder"),
_("Whether to ask for the destination folder when downloading a file"),
FALSE,
#if WEBKIT_CHECK_VERSION (1, 1, 15)
flags));
#else
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#endif
/**
* MidoriWebSettings:notify-transfer-completed:
*
* Whether to show a notification when a transfer has been completed.
*
* Since: 0.1.7
*
* Deprecated: 0.3.0
*/
g_object_class_install_property (gobject_class,
PROP_NOTIFY_TRANSFER_COMPLETED,
g_param_spec_boolean (
"notify-transfer-completed",
_("Notify when a transfer has been completed"),
_("Whether to show a notification when a transfer has been completed"),
TRUE,
#if WEBKIT_CHECK_VERSION (1, 1, 3)
flags));
#else
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#endif
g_object_class_install_property (gobject_class,
PROP_DOWNLOAD_MANAGER,
g_param_spec_string (
@ -794,6 +732,27 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
TRUE,
flags));
/**
* MidoriWebSettings:close-buttons-left:
*
* Whether to show close buttons on the left side.
*
* Since: 0.3.1
*/
g_object_class_install_property (gobject_class,
PROP_CLOSE_BUTTONS_LEFT,
g_param_spec_boolean (
"close-buttons-left",
"Close buttons on the left",
"Whether to show close buttons on the left side",
#if HAVE_OSX
TRUE,
#else
FALSE,
#endif
flags));
g_object_class_install_property (gobject_class,
PROP_OPEN_NEW_PAGES_IN,
g_param_spec_enum (
@ -1168,7 +1127,6 @@ notify_default_encoding_cb (GObject* object,
static void
midori_web_settings_init (MidoriWebSettings* web_settings)
{
web_settings->notify_transfer_completed = TRUE;
web_settings->download_folder = g_strdup (midori_get_download_dir ());
web_settings->http_proxy = NULL;
web_settings->show_panel_controls = TRUE;
@ -1339,9 +1297,6 @@ midori_web_settings_set_property (GObject* object,
case PROP_TOOLBAR_STYLE:
web_settings->toolbar_style = g_value_get_enum (value);
break;
case PROP_PROGRESS_IN_LOCATION:
web_settings->progress_in_location = g_value_get_boolean (value);
break;
case PROP_SEARCH_ENGINES_IN_COMPLETION:
web_settings->search_engines_in_completion = g_value_get_boolean (value);
break;
@ -1376,12 +1331,6 @@ midori_web_settings_set_property (GObject* object,
case PROP_DOWNLOAD_FOLDER:
katze_assign (web_settings->download_folder, g_value_dup_string (value));
break;
case PROP_ASK_FOR_DESTINATION_FOLDER:
web_settings->ask_for_destination_folder = g_value_get_boolean (value);
break;
case PROP_NOTIFY_TRANSFER_COMPLETED:
web_settings->notify_transfer_completed = g_value_get_boolean (value);
break;
case PROP_DOWNLOAD_MANAGER:
katze_assign (web_settings->download_manager, g_value_dup_string (value));
break;
@ -1427,6 +1376,9 @@ midori_web_settings_set_property (GObject* object,
case PROP_CLOSE_BUTTONS_ON_TABS:
web_settings->close_buttons_on_tabs = g_value_get_boolean (value);
break;
case PROP_CLOSE_BUTTONS_LEFT:
web_settings->close_buttons_left = g_value_get_boolean (value);
break;
case PROP_OPEN_NEW_PAGES_IN:
web_settings->open_new_pages_in = g_value_get_enum (value);
break;
@ -1617,9 +1569,6 @@ midori_web_settings_get_property (GObject* object,
case PROP_TOOLBAR_STYLE:
g_value_set_enum (value, web_settings->toolbar_style);
break;
case PROP_PROGRESS_IN_LOCATION:
g_value_set_boolean (value, web_settings->progress_in_location);
break;
case PROP_SEARCH_ENGINES_IN_COMPLETION:
g_value_set_boolean (value, web_settings->search_engines_in_completion);
break;
@ -1654,12 +1603,6 @@ midori_web_settings_get_property (GObject* object,
case PROP_DOWNLOAD_FOLDER:
g_value_set_string (value, web_settings->download_folder);
break;
case PROP_ASK_FOR_DESTINATION_FOLDER:
g_value_set_boolean (value, web_settings->ask_for_destination_folder);
break;
case PROP_NOTIFY_TRANSFER_COMPLETED:
g_value_set_boolean (value, web_settings->notify_transfer_completed);
break;
case PROP_DOWNLOAD_MANAGER:
g_value_set_string (value, web_settings->download_manager);
break;
@ -1682,6 +1625,9 @@ midori_web_settings_get_property (GObject* object,
case PROP_CLOSE_BUTTONS_ON_TABS:
g_value_set_boolean (value, web_settings->close_buttons_on_tabs);
break;
case PROP_CLOSE_BUTTONS_LEFT:
g_value_set_boolean (value, web_settings->close_buttons_left);
break;
case PROP_OPEN_NEW_PAGES_IN:
g_value_set_enum (value, web_settings->open_new_pages_in);
break;

View file

@ -153,7 +153,8 @@ sokoke_message_dialog_response_cb (GtkWidget* dialog,
void
sokoke_message_dialog (GtkMessageType message_type,
const gchar* short_message,
const gchar* detailed_message)
const gchar* detailed_message,
gboolean modal)
{
GtkWidget* dialog = gtk_message_dialog_new (
NULL, 0, message_type,
@ -165,9 +166,18 @@ sokoke_message_dialog (GtkMessageType message_type,
"%s", short_message);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", detailed_message);
g_signal_connect (dialog, "response",
G_CALLBACK (sokoke_message_dialog_response_cb), NULL);
gtk_widget_show (dialog);
if (modal)
{
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
else
{
g_signal_connect (dialog, "response",
G_CALLBACK (sokoke_message_dialog_response_cb), NULL);
gtk_widget_show (dialog);
}
}
/**
@ -391,7 +401,10 @@ sokoke_show_uri (GdkScreen* screen,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
box = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
filename = g_filename_from_uri (uri, NULL, NULL);
if (g_str_has_prefix (uri, "file:///"))
filename = g_filename_from_uri (uri, NULL, NULL);
else
filename = g_strdup (uri);
ms = g_strdup_printf (_("Choose an application or command to open \"%s\":"),
filename);
gtk_box_pack_start (GTK_BOX (box), gtk_label_new (ms), TRUE, FALSE, 4);
@ -434,7 +447,7 @@ sokoke_spawn_program (const gchar* command,
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
"Failed to initialize libosso");
"Failed to initialize libosso", FALSE);
return FALSE;
}
@ -444,7 +457,7 @@ sokoke_spawn_program (const gchar* command,
osso_deinitialize (osso);
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
"Failed to get dbus connection from osso context");
"Failed to get dbus connection from osso context", FALSE);
return FALSE;
}
@ -472,7 +485,7 @@ sokoke_spawn_program (const gchar* command,
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
error ? error->message : "");
error ? error->message : "", FALSE);
if (error)
g_error_free (error);
return FALSE;
@ -501,7 +514,7 @@ sokoke_spawn_program (const gchar* command,
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
error->message);
error->message, FALSE);
g_error_free (error);
g_free (command_ready);
return FALSE;
@ -515,7 +528,7 @@ sokoke_spawn_program (const gchar* command,
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
error->message);
error->message, FALSE);
g_error_free (error);
}
@ -960,7 +973,16 @@ sokoke_get_desktop (void)
static SokokeDesktop desktop = SOKOKE_DESKTOP_UNTESTED;
if (G_UNLIKELY (desktop == SOKOKE_DESKTOP_UNTESTED))
{
/* Are we running in Xfce? */
desktop = SOKOKE_DESKTOP_UNKNOWN;
/* Are we running in Xfce >= 4.8? */
if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xfce"))
{
desktop = SOKOKE_DESKTOP_XFCE;
}
else
{
/* Are we running in Xfce <= 4.6? */
GdkDisplay* display = gdk_display_get_default ();
Display* xdisplay = GDK_DISPLAY_XDISPLAY (display);
Window root_window = RootWindow (xdisplay, 0);
@ -974,13 +996,13 @@ sokoke_get_desktop (void)
save_mode_atom, 0, (~0L),
False, AnyPropertyType, &actual_type, &actual_format,
&n_items, &bytes, (unsigned char**)&value);
desktop = SOKOKE_DESKTOP_UNKNOWN;
if (status == Success)
{
if (n_items == 6 && !strncmp (value, "xfce4", 6))
desktop = SOKOKE_DESKTOP_XFCE;
XFree (value);
}
}
}
return desktop;

View file

@ -85,7 +85,8 @@ sokoke_js_script_eval (JSContextRef js_context,
void
sokoke_message_dialog (GtkMessageType message_type,
const gchar* short_message,
const gchar* detailed_message);
const gchar* detailed_message,
gboolean modal);
gboolean
sokoke_show_uri_with_mime_type (GdkScreen* screen,

View file

@ -243,6 +243,7 @@ midori_bookmarks_insert_item_db (sqlite3* db,
KatzeItem* old_parent;
gchar* parent;
gchar* uri;
gchar* desc;
/* Bookmarks must have a name, import may produce invalid items */
g_return_if_fail (katze_item_get_name (item));
@ -252,6 +253,11 @@ midori_bookmarks_insert_item_db (sqlite3* db,
else
uri = g_strdup ("");
if (katze_item_get_text (item))
desc = g_strdup (katze_item_get_text (item));
else
desc = g_strdup ("");
/* Use folder, otherwise fallback to parent folder */
old_parent = katze_item_get_parent (item);
if (folder && *folder)
@ -266,7 +272,7 @@ midori_bookmarks_insert_item_db (sqlite3* db,
" ('%q', '%q', '%q', '%q', %d, %d)",
uri,
katze_item_get_name (item),
katze_item_get_text (item),
desc,
parent,
katze_item_get_meta_boolean (item, "toolbar"),
katze_item_get_meta_boolean (item, "app"));
@ -279,6 +285,7 @@ midori_bookmarks_insert_item_db (sqlite3* db,
g_free (uri);
g_free (parent);
g_free (desc);
sqlite3_free (sqlcmd);
}

1231
po/cs.po

File diff suppressed because it is too large Load diff

1398
po/de.po

File diff suppressed because it is too large Load diff

1760
po/es.po

File diff suppressed because it is too large Load diff

2897
po/he.po

File diff suppressed because it is too large Load diff

1152
po/it.po

File diff suppressed because it is too large Load diff

1199
po/ja.po

File diff suppressed because it is too large Load diff

1203
po/ko.po

File diff suppressed because it is too large Load diff

1452
po/pl.po

File diff suppressed because it is too large Load diff

1209
po/pt.po

File diff suppressed because it is too large Load diff

2404
po/ro.po

File diff suppressed because it is too large Load diff

1191
po/ru.po

File diff suppressed because it is too large Load diff

1165
po/uk.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -69,6 +69,12 @@ midori_findbar_find_key_press_event_cb (MidoriFindbar* findbar,
midori_findbar_done (findbar);
return TRUE;
}
else if (event->keyval == GDK_Return
&& (event->state & GDK_SHIFT_MASK))
{
midori_findbar_find (findbar, FALSE);
return TRUE;
}
return FALSE;
}

View file

@ -107,14 +107,13 @@ midori_transferbar_download_notify_status_cb (WebKitDownload* download,
case WEBKIT_DOWNLOAD_STATUS_FINISHED:
{
MidoriBrowser* browser = midori_browser_get_for_widget (button);
MidoriWebSettings* settings = midori_browser_get_settings (browser);
icon = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (button), icon);
if (g_object_get_data (G_OBJECT (download), "open-download"))
gtk_button_clicked (GTK_BUTTON (button));
if (katze_object_get_boolean (settings, "notify-transfer-completed"))
if (1)
{
const gchar* uri = webkit_download_get_destination_uri (download);
gchar* path = soup_uri_decode (uri);

View file

@ -29,7 +29,7 @@ from Configure import find_program_impl
major = 0
minor = 3
micro = 0
micro = 1
APPNAME = 'midori'
VERSION = str (major) + '.' + str (minor) + '.' + str (micro)