Merge branch 'upstream-unstable'
This commit is contained in:
commit
df95876508
60 changed files with 13320 additions and 12932 deletions
23
ChangeLog
23
ChangeLog
|
@ -1,5 +1,28 @@
|
|||
This file is licensed under the terms of the expat license, see the file EXPAT.
|
||||
|
||||
v0.4.3:
|
||||
+ Implement about:widgets to test rendering
|
||||
+ Fix resizing of inspector by applying a minimum size
|
||||
+ Use dark theme with GTK+ 3 in private browsing
|
||||
+ Use channel-(in)secure-symbolic icons if available
|
||||
+ Use .security-(un)trusted classes with GTK+
|
||||
+ Improve notebook resizing peformance
|
||||
+ Fix tab icons in GTK+3 and don't look for GTK+ jscore
|
||||
+ Use system-wide CA file with libSoup 2.37.1
|
||||
+ Improve cookie manager performance
|
||||
+ Action and tab creation for faster startup
|
||||
+ Fix number of items in trash in private browsing
|
||||
+ Add Cairo version to about:version
|
||||
+ Add X-GNOME-Keywords and X-AppInstall-Keywords to .desktop
|
||||
+ Add easy privacy list to default Adblock filters
|
||||
+ Fully implement speed dial for GTK+3
|
||||
+ Disable box shadows with WebKitGTK+ 1.2.7
|
||||
+ Fine-grained monospace font overriding
|
||||
+ Implement resizing of Location and Search in toolbar
|
||||
+ Don't show empty speed dial shortcuts in-between
|
||||
+ Use Midori's name in midori-private.desktop
|
||||
+ Hide all bars in fullscreen and a menu to Unfullscreen
|
||||
|
||||
v0.4.2:
|
||||
+ Improve -moz-document parsing in user stylesheets
|
||||
+ Render verified secure sites in green, not yellow
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>{title}</title>
|
||||
<link rel="shortcut icon" href="{icon}" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #eee;
|
||||
|
@ -37,6 +38,9 @@ icon {
|
|||
h1 {
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#logo {
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[settings]
|
||||
filters=http://adblockplus.mozdev.org/easylist/easylist.txt
|
||||
filters=http://adblockplus.mozdev.org/easylist/easylist.txt;https://easylist-downloads.adblockplus.org/easyprivacy.txt
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
_Name=Private Browsing
|
||||
_Name=Midori Private Browsing
|
||||
_GenericName=Private Browsing
|
||||
_Comment=Open a new private browsing window
|
||||
Categories=GTK;Network;WebBrowser;
|
||||
Exec=midori --private
|
||||
Exec=midori --private %U
|
||||
Icon=midori
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
|
|
|
@ -4,6 +4,8 @@ Type=Application
|
|||
_Name=Midori
|
||||
_GenericName=Web Browser
|
||||
_Comment=Lightweight web browser
|
||||
_X-GNOME-Keywords=Internet;WWW;Explorer
|
||||
_X-AppInstall-Keywords=Internet;WWW;Explorer
|
||||
Categories=GTK;Network;WebBrowser;
|
||||
MimeType=text/html;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/geo;image/svg+xml;
|
||||
Exec=midori %U
|
||||
|
|
|
@ -10,6 +10,17 @@
|
|||
<head>
|
||||
<title>{title}</title>
|
||||
<style>
|
||||
|
||||
/* Animations */
|
||||
|
||||
@-webkit-keyframes popin {
|
||||
0% { opacity: 0.0; -webkit-transform: scale(0.00); }
|
||||
75% { opacity: 0.5; -webkit-transform: scale(1.15); }
|
||||
100% { opacity: 1.0; -webkit-transform: scale(1.00); }
|
||||
}
|
||||
|
||||
/* Styles */
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -23,13 +34,15 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
outline: 0;
|
||||
background: #E1E1E1;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 100%;
|
||||
height: 95%;
|
||||
width: 96%;
|
||||
height: 85%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
padding-top: 5%;
|
||||
padding-left: 2%;
|
||||
}
|
||||
|
||||
div.shortcut {
|
||||
|
@ -39,23 +52,24 @@
|
|||
}
|
||||
|
||||
div.shortcut .preview {
|
||||
width: 70%;
|
||||
height: 60%;
|
||||
margin: 20% auto;
|
||||
-webkit-box-shadow: 0 1px 6px rgba(0,0,0,.25), 0 0 2px #fff inset;
|
||||
box-shadow: 0 1px 6px rgba(0,0,0,.25), 0 0 2px #fff inset;
|
||||
width: 85%;
|
||||
height: 75%;
|
||||
margin: auto;
|
||||
-webkit-box-shadow: 0 4px 18px rgba(0,0,0,.3), 0 0 2px #fff inset;
|
||||
background-image: -webkit-gradient(
|
||||
linear, center top, center bottom,
|
||||
from(#f6f6f6), to(#e3e3e3));
|
||||
border: 1px solid #bebebe;
|
||||
border: 1px solid #bcbcbc;
|
||||
border-bottom-color: #a0a0a0;
|
||||
position: relative;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
div.shortcut .preview img {
|
||||
width: 100%;
|
||||
height: 98%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
div.shortcut .preview.new .add {
|
||||
|
@ -68,11 +82,12 @@
|
|||
|
||||
.title {
|
||||
text-align: center;
|
||||
margin-top: -17%;
|
||||
margin: 8px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
cursor: text;
|
||||
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.cross {
|
||||
|
@ -84,15 +99,12 @@
|
|||
background: url(res://close.png);
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.15s;
|
||||
}
|
||||
|
||||
div.shortcut .preview:hover .cross {
|
||||
visibility: visible;
|
||||
-webkit-animation: popin 250ms ease-in-out;
|
||||
opacity: 1;
|
||||
-webkit-transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
.box.added {
|
||||
|
|
|
@ -61,14 +61,21 @@ adblock_build_js (const gchar* private)
|
|||
"function () {"
|
||||
" if (document.getElementById('madblock'))"
|
||||
" return;"
|
||||
" var URL = location.href;"
|
||||
// Get just domain name from URL
|
||||
" var URL = location.href.match(/:\\/\\/(.[^/]+)/)[1];"
|
||||
" var sites = new Array(); %s;"
|
||||
" var public = '.madblockplaceholder ';"
|
||||
" for (var i in sites) {"
|
||||
" if (URL.indexOf(i) != -1 && sites[i] ){"
|
||||
" public += ', .'+sites[i];"
|
||||
" break;"
|
||||
" }}"
|
||||
// Split domain into subdomain parts
|
||||
" var subdomains = URL.split ('.');"
|
||||
" var hostname = subdomains [subdomains.length - 1];"
|
||||
" var i = subdomains.length - 2;"
|
||||
// Check if any of subdomains do have blocking rules
|
||||
" while (i >= 0) {"
|
||||
" hostname = subdomains [i] + '.' + hostname;"
|
||||
" if (sites [hostname])"
|
||||
" public += ', ' + sites [hostname];"
|
||||
" i--;"
|
||||
" }"
|
||||
" public += ' {display: none !important}';"
|
||||
" var mystyle = document.createElement('style');"
|
||||
" mystyle.setAttribute('type', 'text/css');"
|
||||
|
@ -344,7 +351,8 @@ static void
|
|||
adblock_preferences_add_clicked_cb (GtkWidget* button,
|
||||
GtkTreeModel* model)
|
||||
{
|
||||
GtkEntry* entry = g_object_get_data (G_OBJECT (button), "entry");
|
||||
GtkEntry* entry = GTK_IS_ENTRY (button)
|
||||
? button : g_object_get_data (G_OBJECT (button), "entry");
|
||||
gtk_list_store_insert_with_values (GTK_LIST_STORE (model),
|
||||
NULL, 0, 0, gtk_entry_get_text (entry), -1);
|
||||
gtk_entry_set_text (entry, "");
|
||||
|
@ -534,6 +542,8 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
|
|||
g_object_set_data (G_OBJECT (button), "entry", entry);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (adblock_preferences_add_clicked_cb), liststore);
|
||||
g_signal_connect (entry, "activate",
|
||||
G_CALLBACK (adblock_preferences_add_clicked_cb), liststore);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
|
||||
g_object_set_data (G_OBJECT (button), "treeview", treeview);
|
||||
|
@ -593,29 +603,35 @@ adblock_open_preferences_cb (MidoriExtension* extension)
|
|||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
adblock_check_filter_options (GRegex* regex,
|
||||
const gchar* opts,
|
||||
const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
static inline gint
|
||||
adblock_check_rule (GRegex* regex,
|
||||
const gchar* patt,
|
||||
const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
{
|
||||
if (g_regex_match_simple (",third-party", opts,
|
||||
gchar* opts;
|
||||
|
||||
if (!g_regex_match_full (regex, req_uri, -1, 0, 0, NULL, NULL))
|
||||
return FALSE;
|
||||
|
||||
opts = g_hash_table_lookup (optslist, patt);
|
||||
if (opts && g_regex_match_simple (",third-party", opts,
|
||||
G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
|
||||
{
|
||||
if (page_uri && g_regex_match_full (regex, page_uri, -1, 0, 0, NULL, NULL))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
/* TODO: Domain opt check */
|
||||
return FALSE;
|
||||
adblock_debug ("blocked by pattern regexp=%s -- %s", g_regex_get_pattern (regex), req_uri);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
adblock_is_matched_by_pattern (const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
adblock_is_matched_by_pattern (const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer patt, regex;
|
||||
gchar* opts;
|
||||
|
||||
if (USE_PATTERN_MATCHING == 0)
|
||||
return FALSE;
|
||||
|
@ -623,68 +639,47 @@ adblock_is_matched_by_pattern (const gchar* req_uri,
|
|||
g_hash_table_iter_init (&iter, pattern);
|
||||
while (g_hash_table_iter_next (&iter, &patt, ®ex))
|
||||
{
|
||||
if (g_regex_match_full (regex, req_uri, -1, 0, 0, NULL, NULL))
|
||||
{
|
||||
opts = g_hash_table_lookup (optslist, patt);
|
||||
if (opts && adblock_check_filter_options (regex, opts, req_uri, page_uri) == TRUE)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
adblock_debug ("blocked by pattern regexp=%s -- %s", g_regex_get_pattern (regex), req_uri);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (adblock_check_rule (regex, patt, req_uri, page_uri))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
adblock_is_matched_by_key (const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
adblock_is_matched_by_key (const gchar* req_uri,
|
||||
const gchar* page_uri)
|
||||
{
|
||||
gchar* uri;
|
||||
gint len;
|
||||
int pos = 0;
|
||||
GList* regex_bl = NULL;
|
||||
GString* guri;
|
||||
gboolean ret = FALSE;
|
||||
gchar sig[SIGNATURE_SIZE + 1];
|
||||
|
||||
memset (&sig[0], 0, sizeof (sig));
|
||||
/* Signatures are made on pattern, so we need to convert url to a pattern as well */
|
||||
guri = adblock_fixup_regexp ("", (gchar*)req_uri);
|
||||
uri = guri->str;
|
||||
len = guri->len;
|
||||
|
||||
for (pos = len - SIGNATURE_SIZE; pos >= 0; pos--)
|
||||
{
|
||||
gchar* sig = g_strndup (uri + pos, SIGNATURE_SIZE);
|
||||
GRegex* regex = g_hash_table_lookup (keys, sig);
|
||||
gchar* opts;
|
||||
GRegex* regex;
|
||||
strncpy (sig, uri + pos, SIGNATURE_SIZE);
|
||||
regex = g_hash_table_lookup (keys, sig);
|
||||
|
||||
if (regex && !g_list_find (regex_bl, regex))
|
||||
{
|
||||
if (g_regex_match_full (regex, req_uri, -1, 0, 0, NULL, NULL))
|
||||
{
|
||||
opts = g_hash_table_lookup (optslist, sig);
|
||||
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;
|
||||
}
|
||||
}
|
||||
regex_bl = g_list_prepend (regex_bl, regex);
|
||||
}
|
||||
g_free (sig);
|
||||
/* Dont check if regex is already blacklisted */
|
||||
if (!regex || g_list_find (regex_bl, regex))
|
||||
continue;
|
||||
ret = adblock_check_rule (regex, sig, req_uri, page_uri);
|
||||
if (ret)
|
||||
break;
|
||||
regex_bl = g_list_prepend (regex_bl, regex);
|
||||
}
|
||||
g_string_free (guri, TRUE);
|
||||
g_list_free (regex_bl);
|
||||
return FALSE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -938,9 +933,9 @@ adblock_window_object_cleared_cb (WebKitWebView* web_view,
|
|||
{
|
||||
const char *page_uri;
|
||||
|
||||
page_uri = webkit_web_view_get_uri (web_view);
|
||||
page_uri = webkit_web_frame_get_uri (web_frame);
|
||||
/* Don't add adblock css into speeddial and about: pages */
|
||||
if (midori_uri_is_blank (page_uri))
|
||||
if (!midori_uri_is_http (page_uri))
|
||||
return;
|
||||
|
||||
g_free (sokoke_js_script_eval (js_context, blockscript, NULL));
|
||||
|
@ -1141,31 +1136,35 @@ adblock_add_url_pattern (gchar* prefix,
|
|||
|
||||
data = g_strsplit (line, "$", -1);
|
||||
if (!data || !data[0])
|
||||
{
|
||||
g_strfreev (data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (data[1] && data[2])
|
||||
{
|
||||
patt = g_strconcat (data[0], data[1], NULL);
|
||||
opts = g_strconcat (type, ",", data[2], NULL);
|
||||
g_strfreev (data);
|
||||
}
|
||||
else if (data[1])
|
||||
{
|
||||
patt = data[0];
|
||||
opts = g_strconcat (type, ",", data[1], NULL);
|
||||
g_free (data[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
patt = data[0];
|
||||
opts = g_strdup (type);
|
||||
opts = type;
|
||||
}
|
||||
|
||||
if (g_regex_match_simple ("subdocument", opts,
|
||||
G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
|
||||
{
|
||||
g_free (patt);
|
||||
g_free (opts);
|
||||
if (data[1] && data[2])
|
||||
g_free (patt);
|
||||
if (data[1])
|
||||
g_free (opts);
|
||||
g_strfreev (data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1174,14 +1173,13 @@ adblock_add_url_pattern (gchar* prefix,
|
|||
adblock_debug ("got: %s opts %s", format_patt->str, opts);
|
||||
should_free = adblock_compile_regexp (format_patt, opts);
|
||||
|
||||
g_free (opts);
|
||||
g_free (patt);
|
||||
if (data[1] && data[2])
|
||||
g_free (patt);
|
||||
if (data[1])
|
||||
g_free (opts);
|
||||
g_strfreev (data);
|
||||
|
||||
#if G_ENABLE_DEBUG
|
||||
return g_string_free (format_patt, FALSE);
|
||||
#else
|
||||
return g_string_free (format_patt, should_free);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -1227,8 +1225,17 @@ adblock_frame_add_private (const gchar* line,
|
|||
domains = g_strsplit (data[0], ",", -1);
|
||||
for (i = 0; domains[i]; i++)
|
||||
{
|
||||
gchar* domain;
|
||||
|
||||
domain = domains[i];
|
||||
/* Ignore Firefox-specific option */
|
||||
if (!g_strcmp0 (domain, "~pregecko2"))
|
||||
continue;
|
||||
/* strip ~ from domain */
|
||||
if (domain[0] == '~')
|
||||
domain++;
|
||||
g_string_append_printf (blockcssprivate, ";sites['%s']+=',%s'",
|
||||
g_strstrip (domains[i]), data[1]);
|
||||
g_strstrip (domain), data[1]);
|
||||
}
|
||||
g_strfreev (domains);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ addons_install_response (GtkWidget* infobar,
|
|||
WebKitNetworkRequest* request;
|
||||
WebKitDownload* download;
|
||||
|
||||
hostname = midori_uri_parse (uri, &path);
|
||||
hostname = midori_uri_parse_hostname (uri, &path);
|
||||
temp_uri = NULL;
|
||||
filename = NULL;
|
||||
folder = NULL;
|
||||
|
@ -118,7 +118,7 @@ addons_install_response (GtkWidget* infobar,
|
|||
folder = "scripts";
|
||||
else if (g_str_has_suffix (uri, ".user.css"))
|
||||
folder = "styles";
|
||||
else if (!strcmp (hostname, "userscripts.org"))
|
||||
else if (!g_strcmp0 (hostname, "userscripts.org"))
|
||||
{
|
||||
/* http://userscripts.org/scripts/ACTION/SCRIPT_ID/NAME */
|
||||
gchar* subpage = strchr (strchr (path + 1, '/') + 1, '/');
|
||||
|
@ -148,7 +148,7 @@ addons_install_response (GtkWidget* infobar,
|
|||
folder = "scripts";
|
||||
}
|
||||
}
|
||||
else if (!strcmp (hostname, "userstyles.org"))
|
||||
else if (!g_strcmp0 (hostname, "userstyles.org"))
|
||||
{
|
||||
/* http://userstyles.org/styles/STYLE_ID/NAME */
|
||||
gchar* subpage = strchr (path + 1, '/');
|
||||
|
@ -259,15 +259,15 @@ addons_notify_load_status_cb (MidoriView* view,
|
|||
else
|
||||
{
|
||||
gchar* path;
|
||||
gchar* hostname = midori_uri_parse (uri, &path);
|
||||
if (!strcmp (hostname, "userscripts.org")
|
||||
gchar* hostname = midori_uri_parse_hostname (uri, &path);
|
||||
if (!g_strcmp0 (hostname, "userscripts.org")
|
||||
&& (g_str_has_prefix (path, "/scripts/show/")
|
||||
|| g_str_has_prefix (path, "/scripts/review/")))
|
||||
{
|
||||
/* Main (with desc) and "source view" pages */
|
||||
addons_uri_install (view, ADDONS_USER_SCRIPTS);
|
||||
}
|
||||
else if (!strcmp (hostname, "userstyles.org")
|
||||
else if (!g_strcmp0 (hostname, "userstyles.org")
|
||||
&& g_str_has_prefix (path, "/styles/"))
|
||||
{
|
||||
gchar* subpage = strchr (path + 1, '/');
|
||||
|
@ -1365,7 +1365,7 @@ addons_convert_to_simple_regexp (const gchar* pattern)
|
|||
gchar c;
|
||||
|
||||
len = strlen (pattern);
|
||||
dest = g_malloc0 (len * 2 + 1);
|
||||
dest = g_malloc0 (len * 2 + 2);
|
||||
dest[0] = '^';
|
||||
pos = 1;
|
||||
|
||||
|
@ -1471,6 +1471,11 @@ addons_context_ready_cb (WebKitWebView* web_view,
|
|||
GSList* scripts, *styles;
|
||||
struct AddonElement* script, *style;
|
||||
struct AddonsList* scripts_list, *styles_list;
|
||||
const gchar* page_uri;
|
||||
|
||||
page_uri = webkit_web_frame_get_uri (web_frame);
|
||||
if (!midori_uri_is_http (page_uri) && !midori_uri_is_blank (page_uri))
|
||||
return;
|
||||
|
||||
/* Not a main frame! Abort */
|
||||
if (web_frame != webkit_web_view_get_main_frame (web_view))
|
||||
|
@ -1861,6 +1866,47 @@ addons_activate_cb (MidoriExtension* extension,
|
|||
G_CALLBACK (addons_deactivate_cb), app);
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static void
|
||||
test_addons_simple_regexp (void)
|
||||
{
|
||||
typedef struct
|
||||
{
|
||||
const gchar* before;
|
||||
const gchar* after;
|
||||
} RegexItem;
|
||||
guint i;
|
||||
|
||||
static const RegexItem items[] = {
|
||||
{ "*", "^.*" },
|
||||
{ "http://", "^http://" },
|
||||
{ "https://", "^https://" },
|
||||
{ "about:blank", "^about:blank" },
|
||||
{ "file://", "^file://" },
|
||||
{ "ftp://", "^ftp://" },
|
||||
{ "https://bugzilla.mozilla.org/", "^https://bugzilla\\.mozilla\\.org/" },
|
||||
{ "http://92.48.103.52/fantasy3/*", "^http://92\\.48\\.103\\.52/fantasy3/.*" },
|
||||
{ "http://www.rpg.co.uk/fantasy/*", "^http://www\\.rpg\\.co\\.uk/fantasy/.*" },
|
||||
{ "http://cookpad.com/recipe/*", "^http://cookpad\\.com/recipe/.*" },
|
||||
{ "https://*/*post_bug.cgi", "^https://.*/.*post_bug\\.cgi" },
|
||||
};
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (items); i++)
|
||||
{
|
||||
gchar* result = addons_convert_to_simple_regexp (items[i].before);
|
||||
const gchar* after = items[i].after ? items[i].after : items[i].before;
|
||||
katze_assert_str_equal (items[i].before, result, after);
|
||||
g_free (result);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
extension_test (void)
|
||||
{
|
||||
g_test_add_func ("/extensions/addons/simple_regexp", test_addons_simple_regexp);
|
||||
}
|
||||
#endif
|
||||
|
||||
MidoriExtension*
|
||||
extension_init (void)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ colorful_tabs_view_notify_uri_cb (MidoriView* view,
|
|||
label = midori_view_get_proxy_tab_label (view);
|
||||
|
||||
if (!midori_uri_is_blank (midori_view_get_display_uri (view))
|
||||
&& (hostname = midori_uri_parse (midori_view_get_display_uri (view), NULL))
|
||||
&& (hostname = midori_uri_parse_hostname (midori_view_get_display_uri (view), NULL))
|
||||
&& katze_object_get_enum (view, "load-status") == MIDORI_LOAD_FINISHED)
|
||||
{
|
||||
icon = midori_view_get_icon (view);
|
||||
|
|
|
@ -18,13 +18,6 @@
|
|||
#include "cookie-manager.h"
|
||||
#include "cookie-manager-page.h"
|
||||
|
||||
|
||||
typedef struct _CookieManagerPagePrivate CookieManagerPagePrivate;
|
||||
|
||||
#define COOKIE_MANAGER_PAGE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),\
|
||||
COOKIE_MANAGER_PAGE_TYPE, CookieManagerPagePrivate))
|
||||
|
||||
|
||||
#define CM_EMPTY_LABEL_TEXT "\n\n\n\n\n\n"
|
||||
|
||||
|
||||
|
@ -89,7 +82,7 @@ static const gchar *cookie_manager_page_get_stock_id(MidoriViewable *viewable)
|
|||
|
||||
static void cm_create_toolbar(CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
GtkWidget *toolbar;
|
||||
GtkToolItem *toolitem;
|
||||
|
||||
|
@ -141,7 +134,8 @@ static void cm_create_toolbar(CookieManagerPage *cmp)
|
|||
|
||||
static GtkWidget *cookie_manager_page_get_toolbar(MidoriViewable *viewable)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(viewable);
|
||||
CookieManagerPage *cmp = COOKIE_MANAGER_PAGE(viewable);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
return priv->toolbar;
|
||||
}
|
||||
|
@ -157,7 +151,7 @@ static void cookie_manager_page_viewable_iface_init(MidoriViewableIface* iface)
|
|||
|
||||
static void cookie_manager_page_pre_cookies_change_cb(CookieManager *cm, CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
g_object_ref(priv->filter);
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(priv->treeview), NULL);
|
||||
|
@ -167,7 +161,7 @@ static void cookie_manager_page_pre_cookies_change_cb(CookieManager *cm, CookieM
|
|||
static void cookie_manager_page_cookies_changed_cb(CookieManager *cm, CookieManagerPage *cmp)
|
||||
{
|
||||
const gchar *filter_text;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(priv->treeview), GTK_TREE_MODEL(priv->filter));
|
||||
g_object_unref(priv->filter);
|
||||
|
@ -185,7 +179,7 @@ static void cookie_manager_page_cookies_changed_cb(CookieManager *cm, CookieMana
|
|||
static void cookie_manager_page_filter_changed_cb(CookieManager *cm, const gchar *text,
|
||||
CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
priv->ignore_changed_filter = TRUE;
|
||||
gtk_entry_set_text(GTK_ENTRY(priv->filter_entry), text);
|
||||
|
@ -195,7 +189,8 @@ static void cookie_manager_page_filter_changed_cb(CookieManager *cm, const gchar
|
|||
|
||||
static void cookie_manager_page_finalize(GObject *object)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(object);
|
||||
CookieManagerPage *cmp = COOKIE_MANAGER_PAGE(object);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_widget_destroy(priv->popup_menu);
|
||||
|
||||
|
@ -213,7 +208,8 @@ static void cookie_manager_page_finalize(GObject *object)
|
|||
static void cookie_manager_page_set_property(GObject *object, guint prop_id, const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(object);
|
||||
CookieManagerPage *cmp = COOKIE_MANAGER_PAGE(object);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_STORE:
|
||||
|
@ -288,7 +284,7 @@ static void cookie_manager_page_class_init(CookieManagerPageClass *klass)
|
|||
|
||||
static void cm_set_button_sensitiveness(CookieManagerPage *cmp, gboolean set)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
gboolean expand_set = (gtk_tree_model_iter_n_children(priv->filter, NULL) > 0);
|
||||
guint i, len;
|
||||
|
||||
|
@ -328,7 +324,7 @@ static gint cm_list_length(GList *list)
|
|||
|
||||
static void cm_tree_popup_collapse_activate_cb(GtkMenuItem *item, CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_tree_view_collapse_all(GTK_TREE_VIEW(priv->treeview));
|
||||
}
|
||||
|
@ -336,7 +332,7 @@ static void cm_tree_popup_collapse_activate_cb(GtkMenuItem *item, CookieManagerP
|
|||
|
||||
static void cm_tree_popup_expand_activate_cb(GtkMenuItem *item, CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_tree_view_expand_all(GTK_TREE_VIEW(priv->treeview));
|
||||
}
|
||||
|
@ -345,7 +341,7 @@ static void cm_tree_popup_expand_activate_cb(GtkMenuItem *item, CookieManagerPag
|
|||
static void cm_store_remove(CookieManagerPage *cmp, GtkTreeIter *iter_model)
|
||||
{
|
||||
GtkTreeIter iter_store;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter(
|
||||
GTK_TREE_MODEL_FILTER(priv->filter), &iter_store, iter_model);
|
||||
|
@ -356,7 +352,7 @@ static void cm_store_remove(CookieManagerPage *cmp, GtkTreeIter *iter_model)
|
|||
static void cm_delete_cookie(CookieManagerPage *cmp, GtkTreeModel *model, GtkTreeIter *child)
|
||||
{
|
||||
SoupCookie *cookie;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
gtk_tree_model_get(model, child, COOKIE_MANAGER_COL_COOKIE, &cookie, -1);
|
||||
|
||||
|
@ -403,7 +399,7 @@ static gboolean cm_try_to_select(CMPathWalkFunc path_func, GtkTreeSelection *sel
|
|||
/* select an item after deletion */
|
||||
static void cm_select_path(CookieManagerPage *cmp, GtkTreeModel *model, GtkTreePath *path)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview));
|
||||
CMPathWalkFunc path_funcs[] = {
|
||||
(CMPathWalkFunc) gtk_tree_path_prev, (CMPathWalkFunc) gtk_tree_path_up,
|
||||
|
@ -432,7 +428,7 @@ static void cm_delete_item(CookieManagerPage *cmp)
|
|||
GtkTreeSelection *selection;
|
||||
GList *rows, *row;
|
||||
GList *refs = NULL;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview));
|
||||
rows = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||
|
@ -528,7 +524,7 @@ static void cm_button_delete_clicked_cb(GtkToolButton *button, CookieManagerPage
|
|||
|
||||
static void cm_delete_all_cookies_real(CookieManagerPage *cmp)
|
||||
{
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(priv->treeview));
|
||||
GtkTreeIter iter, iter_store, child;
|
||||
GtkTreePath *path_first, *path;
|
||||
|
@ -567,7 +563,7 @@ static void cm_button_delete_all_clicked_cb(GtkToolButton *button, CookieManager
|
|||
GtkWidget *dialog;
|
||||
const gchar *filter_text;
|
||||
MidoriBrowser *toplevel = midori_browser_get_for_widget(GTK_WIDGET(button));
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(toplevel),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
|
@ -608,7 +604,7 @@ static void cm_tree_drag_data_get_cb(GtkWidget *widget, GdkDragContext *drag_con
|
|||
GtkTreeSelection *selection;
|
||||
GtkTreeModel *model;
|
||||
GList *rows;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview));
|
||||
rows = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||
|
@ -772,7 +768,7 @@ static void cm_filter_tree(CookieManagerPage *cmp, const gchar *filter_text)
|
|||
gint i, n;
|
||||
gchar *name;
|
||||
gchar *domain;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
model = GTK_TREE_MODEL(priv->store);
|
||||
if (! gtk_tree_model_get_iter_first(model, &iter))
|
||||
|
@ -811,7 +807,7 @@ static void cm_filter_tree(CookieManagerPage *cmp, const gchar *filter_text)
|
|||
static void cm_filter_entry_changed_cb(GtkEditable *editable, CookieManagerPage *cmp)
|
||||
{
|
||||
const gchar *text;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
if (priv->ignore_changed_filter)
|
||||
return;
|
||||
|
@ -845,7 +841,7 @@ static void cm_tree_selection_changed_cb(GtkTreeSelection *selection, CookieMana
|
|||
gboolean delete_possible = TRUE;
|
||||
guint rows_len;
|
||||
SoupCookie *cookie;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
rows = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||
rows_len = cm_list_length(rows);
|
||||
|
@ -904,7 +900,7 @@ static void cm_tree_selection_changed_cb(GtkTreeSelection *selection, CookieMana
|
|||
static void cm_tree_show_popup_menu(GtkWidget *widget, GdkEventButton *event, CookieManagerPage *cmp)
|
||||
{
|
||||
gint button, event_time;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
if (event != NULL)
|
||||
{
|
||||
|
@ -1019,7 +1015,7 @@ static GtkWidget *cm_tree_prepare(CookieManagerPage *cmp)
|
|||
GtkWidget *item;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *treeview;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(cmp);
|
||||
CookieManagerPagePrivate *priv = cmp->priv;
|
||||
|
||||
treeview = priv->treeview = gtk_tree_view_new();
|
||||
|
||||
|
@ -1106,10 +1102,11 @@ static void cookie_manager_page_init(CookieManagerPage *self)
|
|||
GtkWidget *filter_hbox;
|
||||
GtkWidget *filter_label;
|
||||
GtkWidget *treeview;
|
||||
CookieManagerPagePrivate *priv = COOKIE_MANAGER_PAGE_GET_PRIVATE(self);
|
||||
CookieManagerPagePrivate *priv;
|
||||
|
||||
priv->parent = NULL;
|
||||
priv->store = NULL;
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
COOKIE_MANAGER_PAGE_TYPE, CookieManagerPagePrivate);
|
||||
priv = self->priv;
|
||||
priv->ignore_changed_filter = FALSE;
|
||||
|
||||
cm_create_toolbar(self);
|
||||
|
|
|
@ -26,10 +26,12 @@ G_BEGIN_DECLS
|
|||
|
||||
typedef struct _CookieManagerPage CookieManagerPage;
|
||||
typedef struct _CookieManagerPageClass CookieManagerPageClass;
|
||||
typedef struct _CookieManagerPagePrivate CookieManagerPagePrivate;
|
||||
|
||||
struct _CookieManagerPage
|
||||
{
|
||||
GtkVBox parent;
|
||||
CookieManagerPagePrivate* priv;
|
||||
};
|
||||
|
||||
struct _CookieManagerPageClass
|
||||
|
|
|
@ -18,12 +18,10 @@
|
|||
|
||||
typedef struct _CookieManagerPrivate CookieManagerPrivate;
|
||||
|
||||
#define COOKIE_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),\
|
||||
COOKIE_MANAGER_TYPE, CookieManagerPrivate))
|
||||
|
||||
struct _CookieManager
|
||||
{
|
||||
GObject parent;
|
||||
CookieManagerPrivate* priv;
|
||||
};
|
||||
|
||||
struct _CookieManagerClass
|
||||
|
@ -116,7 +114,7 @@ static void cookie_manager_panel_pages_foreach(gpointer ptr, gpointer data)
|
|||
|
||||
static void cookie_manager_page_destroy_cb(GObject *page, CookieManager *cm)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
priv->panel_pages = g_slist_remove(priv->panel_pages, page);
|
||||
}
|
||||
|
@ -127,7 +125,7 @@ static void cookie_manager_app_add_browser_cb(MidoriApp *app, MidoriBrowser *bro
|
|||
{
|
||||
MidoriPanel *panel;
|
||||
GtkWidget *page;
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
panel = katze_object_get_object(browser, "panel");
|
||||
|
||||
|
@ -144,7 +142,7 @@ static void cookie_manager_app_add_browser_cb(MidoriApp *app, MidoriBrowser *bro
|
|||
|
||||
static void cookie_manager_free_cookie_list(CookieManager *cm)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
if (priv->cookies != NULL)
|
||||
{
|
||||
|
@ -165,7 +163,7 @@ static void cookie_manager_refresh_store(CookieManager *cm)
|
|||
GtkTreeIter iter;
|
||||
GtkTreeIter *parent_iter;
|
||||
SoupCookie *cookie;
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
g_signal_emit(cm, signals[PRE_COOKIES_CHANGE], 0);
|
||||
|
||||
|
@ -213,7 +211,7 @@ static void cookie_manager_refresh_store(CookieManager *cm)
|
|||
|
||||
static gboolean cookie_manager_delayed_refresh(CookieManager *cm)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
cookie_manager_refresh_store(cm);
|
||||
priv->timer_id = 0;
|
||||
|
@ -225,7 +223,7 @@ static gboolean cookie_manager_delayed_refresh(CookieManager *cm)
|
|||
static void cookie_manager_jar_changed_cb(SoupCookieJar *jar, SoupCookie *old, SoupCookie *new,
|
||||
CookieManager *cm)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
if (priv->ignore_changed_count > 0)
|
||||
{
|
||||
|
@ -243,7 +241,7 @@ static void cookie_manager_jar_changed_cb(SoupCookieJar *jar, SoupCookie *old, S
|
|||
static void cookie_manager_finalize(GObject *object)
|
||||
{
|
||||
CookieManager *cm = COOKIE_MANAGER(object);
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
g_signal_handlers_disconnect_by_func(priv->app, cookie_manager_app_add_browser_cb, cm);
|
||||
g_signal_handlers_disconnect_by_func(priv->jar, cookie_manager_jar_changed_cb, cm);
|
||||
|
@ -267,11 +265,12 @@ static void cookie_manager_finalize(GObject *object)
|
|||
|
||||
static void cookie_manager_init(CookieManager *self)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(self);
|
||||
CookieManagerPrivate *priv;
|
||||
SoupSession *session;
|
||||
|
||||
priv->filter_text = NULL;
|
||||
priv->panel_pages = NULL;
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
COOKIE_MANAGER_TYPE, CookieManagerPrivate);
|
||||
priv = self->priv;
|
||||
/* create the main store */
|
||||
priv->store = gtk_tree_store_new(COOKIE_MANAGER_N_COLUMNS,
|
||||
G_TYPE_STRING, SOUP_TYPE_COOKIE, G_TYPE_BOOLEAN);
|
||||
|
@ -289,7 +288,7 @@ static void cookie_manager_init(CookieManager *self)
|
|||
|
||||
void cookie_manager_update_filter(CookieManager *cm, const gchar *text)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
katze_assign(priv->filter_text, g_strdup(text));
|
||||
|
||||
|
@ -299,7 +298,7 @@ void cookie_manager_update_filter(CookieManager *cm, const gchar *text)
|
|||
|
||||
void cookie_manager_delete_cookie(CookieManager *cm, SoupCookie *cookie)
|
||||
{
|
||||
CookieManagerPrivate *priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
CookieManagerPrivate *priv = cm->priv;
|
||||
|
||||
if (cookie != NULL)
|
||||
{
|
||||
|
@ -320,7 +319,7 @@ CookieManager *cookie_manager_new(MidoriExtension *extension, MidoriApp *app)
|
|||
|
||||
cm = g_object_new(COOKIE_MANAGER_TYPE, NULL);
|
||||
|
||||
priv = COOKIE_MANAGER_GET_PRIVATE(cm);
|
||||
priv = cm->priv;
|
||||
priv->app = app;
|
||||
priv->extension = extension;
|
||||
|
||||
|
|
|
@ -15,19 +15,19 @@ static void
|
|||
copy_tabs_apply_cb (GtkWidget* menuitem,
|
||||
MidoriBrowser* browser)
|
||||
{
|
||||
guint i = 0;
|
||||
GtkWidget* view;
|
||||
gchar* text = g_strdup ("");
|
||||
GList* children;
|
||||
GString* text = g_string_sized_new (256);
|
||||
GtkClipboard* clipboard = gtk_widget_get_clipboard (menuitem,
|
||||
GDK_SELECTION_CLIPBOARD);
|
||||
|
||||
while ((view = midori_browser_get_nth_tab (browser, i++)))
|
||||
children = midori_browser_get_tabs (MIDORI_BROWSER (browser));
|
||||
for (; children; children = g_list_next (children))
|
||||
{
|
||||
gchar* new_text = g_strconcat (text,
|
||||
midori_view_get_display_uri (MIDORI_VIEW (view)), "\n", NULL);
|
||||
katze_assign (text, new_text);
|
||||
g_string_append (text, midori_view_get_display_uri (children->data));
|
||||
g_string_append_c (text, '\n');
|
||||
}
|
||||
gtk_clipboard_set_text (clipboard, text, -1);
|
||||
gtk_clipboard_set_text (clipboard, text->str, -1);
|
||||
g_string_free (text, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -101,27 +101,22 @@ formhistory_fixup_value (char* value)
|
|||
static gchar*
|
||||
formhistory_build_js ()
|
||||
{
|
||||
gchar* suggestions = g_strdup ("");
|
||||
GString* suggestions;
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
gchar* script;
|
||||
|
||||
suggestions = g_string_new (
|
||||
"function FormSuggestions(eid) { "
|
||||
"arr = new Array();");
|
||||
g_hash_table_iter_init (&iter, global_keys);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
gchar* _suggestions = g_strdup_printf ("%s arr[\"%s\"] = [%s]; ",
|
||||
suggestions, (char*)key, (char*)value);
|
||||
katze_assign (suggestions, _suggestions);
|
||||
g_string_append_printf (suggestions, " arr[\"%s\"] = [%s]; ",
|
||||
(gchar*)key, (gchar*)value);
|
||||
}
|
||||
script = g_strdup_printf ("function FormSuggestions(eid) { "
|
||||
"arr = new Array();"
|
||||
"%s"
|
||||
"this.suggestions = arr[eid]; }"
|
||||
"%s",
|
||||
suggestions,
|
||||
jsforms);
|
||||
g_free (suggestions);
|
||||
return script;
|
||||
g_string_append (suggestions, "this.suggestions = arr[eid]; }");
|
||||
g_string_append (suggestions, jsforms);
|
||||
return g_string_free (suggestions, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -255,6 +250,12 @@ formhistory_window_object_cleared_cb (WebKitWebView* web_view,
|
|||
JSObjectRef js_window)
|
||||
{
|
||||
gchar* script;
|
||||
const gchar* page_uri;
|
||||
|
||||
page_uri = webkit_web_frame_get_uri (web_frame);
|
||||
if (!midori_uri_is_http (page_uri))
|
||||
return;
|
||||
|
||||
script = formhistory_build_js ();
|
||||
sokoke_js_script_eval (js_context, script, NULL);
|
||||
g_free (script);
|
||||
|
@ -412,7 +413,9 @@ formhistory_activate_cb (MidoriExtension* extension,
|
|||
filename = g_build_filename (config_dir, "forms.db", NULL);
|
||||
if (sqlite3_open (filename, &db) != SQLITE_OK)
|
||||
{
|
||||
g_warning (_("Failed to open database: %s\n"), sqlite3_errmsg (db));
|
||||
/* If the folder is /, this is a test run, thus no error */
|
||||
if (!g_str_equal (midori_extension_get_config_dir (extension), "/"))
|
||||
g_warning (_("Failed to open database: %s\n"), sqlite3_errmsg (db));
|
||||
sqlite3_close (db);
|
||||
}
|
||||
g_free (filename);
|
||||
|
|
|
@ -6,6 +6,30 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 2, 0)
|
||||
#define GTK_TYPE_VBOX GTK_TYPE_BOX
|
||||
#define GtkVBox GtkBox
|
||||
#define GtkVBoxClass GtkBoxClass
|
||||
#define gtk_vbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
|
||||
"homogeneous", hmg, "spacing", spc, \
|
||||
"orientation", GTK_ORIENTATION_VERTICAL, NULL)
|
||||
#define GTK_TYPE_HBOX GTK_TYPE_BOX
|
||||
#define GtkHBox GtkBox
|
||||
#define GtkHBoxClass GtkBoxClass
|
||||
#define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
|
||||
"homogeneous", hmg, "spacing", spc, \
|
||||
"orientation", GTK_ORIENTATION_HORIZONTAL, NULL)
|
||||
#define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL)
|
||||
#define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL)
|
||||
#define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
|
||||
"orientation", GTK_ORIENTATION_VERTICAL, NULL)
|
||||
/* FIXME */
|
||||
#define gtk_widget_render_icon(wdgt, stk, sz, dtl) \
|
||||
gtk_widget_render_icon_pixbuf(wdgt, stk, sz)
|
||||
#define gtk_widget_size_request(wdgt, req) \
|
||||
gtk_widget_get_preferred_size(wdgt, req, NULL)
|
||||
#endif
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 32, 0)
|
||||
#define G_SOURCE_REMOVE FALSE
|
||||
#define G_SOURCE_CONTINUE TRUE
|
||||
|
|
|
@ -754,7 +754,6 @@ katze_array_action_connect_proxy (GtkAction* action,
|
|||
g_signal_connect (proxy, "select",
|
||||
G_CALLBACK (katze_array_action_proxy_clicked_cb), action);
|
||||
}
|
||||
gtk_widget_set_sensitive (proxy, KATZE_ARRAY_ACTION (action)->array != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -707,6 +707,8 @@ katze_item_set_parent (KatzeItem* item,
|
|||
* Note that subclass specific features will only
|
||||
* be preserved if the class implements it.
|
||||
*
|
||||
* Since 0.4.3 meta data is copied.
|
||||
*
|
||||
* Return value: a new #KatzeItem
|
||||
*
|
||||
* Since: 0.1.3
|
||||
|
@ -715,6 +717,9 @@ KatzeItem*
|
|||
katze_item_copy (KatzeItem* item)
|
||||
{
|
||||
KatzeItem* copy;
|
||||
GHashTableIter iter;
|
||||
const gchar* key;
|
||||
const gchar* value;
|
||||
KatzeItemClass* class;
|
||||
|
||||
g_return_val_if_fail (KATZE_IS_ITEM (item), NULL);
|
||||
|
@ -727,6 +732,15 @@ katze_item_copy (KatzeItem* item)
|
|||
"added", item->added,
|
||||
"parent", item->parent,
|
||||
NULL);
|
||||
|
||||
g_hash_table_iter_init (&iter, item->metadata);
|
||||
while (g_hash_table_iter_next (&iter, (void*)&key, (void*)&value))
|
||||
{
|
||||
if (g_str_has_prefix (key, "midori:"))
|
||||
key = &key[7];
|
||||
g_hash_table_insert (copy->metadata, g_strdup (key), g_strdup (value));
|
||||
}
|
||||
|
||||
class = KATZE_ITEM_GET_CLASS (item);
|
||||
return class->copy ? class->copy (copy) : copy;
|
||||
}
|
||||
|
|
|
@ -102,6 +102,14 @@ katze_preferences_init (KatzePreferences* preferences)
|
|||
#if !HAVE_OSX
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
|
||||
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
|
||||
NULL);
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (
|
||||
gtk_dialog_get_widget_for_response (GTK_DIALOG (preferences),
|
||||
GTK_RESPONSE_HELP)), "help_button");
|
||||
#endif
|
||||
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
|
||||
#if HAVE_HILDON
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_APPLY,
|
||||
#else
|
||||
|
|
|
@ -466,14 +466,12 @@ button_press_event (GtkWidget* widget,
|
|||
gint y;
|
||||
GdkModifierType mask;
|
||||
|
||||
if (!priv->drag_scrolling)
|
||||
return FALSE;
|
||||
|
||||
if (event->button != 1)
|
||||
if (!priv->drag_scrolling || event->button != 1)
|
||||
return FALSE;
|
||||
|
||||
priv->press_received = TRUE;
|
||||
|
||||
gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
|
||||
&x, &y, &mask);
|
||||
if (event->time - priv->previous_time < priv->dragging_stopped_delay &&
|
||||
gtk_drag_check_threshold (widget, priv->previous_x, priv->previous_y, x, y))
|
||||
{
|
||||
|
@ -482,8 +480,6 @@ button_press_event (GtkWidget* widget,
|
|||
g_source_remove (priv->scrolling_timeout_id);
|
||||
priv->scrolling_timeout_id = 0;
|
||||
}
|
||||
gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
|
||||
&x, &y, &mask);
|
||||
/* do_motion_scroll (scrolled, widget, x, y, event->time); */
|
||||
}
|
||||
else
|
||||
|
@ -499,8 +495,6 @@ button_press_event (GtkWidget* widget,
|
|||
priv->dragged = FALSE;
|
||||
priv->previous_time = event->time;
|
||||
}
|
||||
gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
|
||||
&x, &y, &mask);
|
||||
priv->start_x = priv->previous_x = priv->farest_x = x;
|
||||
priv->start_y = priv->previous_y = priv->farest_y = y;
|
||||
priv->start_time = event->time;
|
||||
|
|
|
@ -901,8 +901,14 @@ katze_throbber_aligned_coords (GtkWidget* widget,
|
|||
gtk_misc_get_padding (GTK_MISC (widget), &xpad, &ypad);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
allocation.width = gtk_widget_get_allocated_width (widget);
|
||||
allocation.height = gtk_widget_get_allocated_height (widget);
|
||||
gtk_widget_get_preferred_size (widget, &requisition, NULL);
|
||||
#else
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gtk_widget_size_request (widget, &requisition);
|
||||
#endif
|
||||
*ax = floor (allocation.x + xpad
|
||||
+ ((allocation.width - requisition.width) * xalign));
|
||||
*ay = floor (allocation.y + ypad
|
||||
|
|
|
@ -1561,3 +1561,27 @@ katze_uri_entry_new (GtkWidget* other_widget)
|
|||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* katze_assert_str_equal:
|
||||
* @input: a string
|
||||
* @result: a string
|
||||
* @expected: a string
|
||||
*
|
||||
* Compares the two strings for equality, with verbose errors.
|
||||
*
|
||||
* Since: 0.4.3
|
||||
*/
|
||||
void
|
||||
katze_assert_str_equal (const gchar* input,
|
||||
const gchar* result,
|
||||
const gchar* expected)
|
||||
{
|
||||
if (g_strcmp0 (result, expected))
|
||||
{
|
||||
g_error ("Input: %s\nExpected: %s\nResult: %s",
|
||||
input ? input : "NULL",
|
||||
expected ? expected : "NULL",
|
||||
result ? result : "NULL");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
#include "katze-array.h"
|
||||
#include "gtk3-compat.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -142,6 +143,11 @@ katze_load_cached_icon (const gchar* uri,
|
|||
GtkWidget*
|
||||
katze_uri_entry_new (GtkWidget* other_widget);
|
||||
|
||||
void
|
||||
katze_assert_str_equal (const gchar* input,
|
||||
const gchar* result,
|
||||
const gchar* expected);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __KATZE_UTILS_H__ */
|
||||
|
|
|
@ -16,15 +16,14 @@ namespace GLib {
|
|||
|
||||
namespace Midori {
|
||||
public class URI : Object {
|
||||
public static string parse (string? uri, out string path) {
|
||||
/* path may be null.
|
||||
If there's no hostname, the original URI is returned */
|
||||
public static string? parse_hostname (string? uri, out string path) {
|
||||
/* path may be null. */
|
||||
if (uri == null)
|
||||
return uri;
|
||||
unowned string? hostname = uri.chr (-1, '/');
|
||||
if (hostname == null || hostname[1] != '/'
|
||||
|| hostname.chr (-1, ' ') != null)
|
||||
return uri;
|
||||
return null;
|
||||
hostname = hostname.offset (2);
|
||||
if (&path != null) {
|
||||
if ((path = hostname.chr (-1, '/')) != null)
|
||||
|
@ -32,13 +31,17 @@ namespace Midori {
|
|||
}
|
||||
return hostname;
|
||||
}
|
||||
/* Deprecated: 0.4.3 */
|
||||
public static string parse (string uri, out string path) {
|
||||
return parse_hostname (uri, out path) ?? uri;
|
||||
}
|
||||
public static string to_ascii (string uri) {
|
||||
/* Convert hostname to ASCII. */
|
||||
string? proto = null;
|
||||
if (uri.chr (-1, '/') != null && uri.chr (-1, ':') != null)
|
||||
proto = uri.split ("://")[0];
|
||||
string? path = null;
|
||||
string hostname = parse (uri, out path);
|
||||
string? hostname = parse_hostname (uri, out path) ?? uri;
|
||||
string encoded = hostname_to_ascii (hostname);
|
||||
if (encoded != null) {
|
||||
return (proto ?? "")
|
||||
|
@ -67,7 +70,7 @@ namespace Midori {
|
|||
else if (!unescaped.validate ())
|
||||
return uri;
|
||||
string path;
|
||||
string hostname = parse (unescaped, out path);
|
||||
string hostname = parse_hostname (unescaped, out path);
|
||||
string decoded = hostname_to_unicode (hostname);
|
||||
if (decoded != null)
|
||||
return "http://" + decoded + path;
|
||||
|
@ -102,6 +105,7 @@ namespace Midori {
|
|||
/* file:// is not considered a location for security reasons */
|
||||
return uri != null
|
||||
&& ((uri.str ("://") != null && uri.chr (-1, ' ') == null)
|
||||
|| is_http (uri)
|
||||
|| uri.has_prefix ("about:")
|
||||
|| (uri.has_prefix ("data:") && uri.chr (-1, ';') != null)
|
||||
|| (uri.has_prefix ("geo:") && uri.chr (-1, ',') != null)
|
||||
|
|
105
midori/main.c
105
midori/main.c
|
@ -216,12 +216,10 @@ settings_save_to_file (MidoriWebSettings* settings,
|
|||
}
|
||||
|
||||
g_object_get (settings, property, &string, NULL);
|
||||
if (!string)
|
||||
string = g_strdup ("");
|
||||
if (!def_string)
|
||||
def_string = "";
|
||||
if (strcmp (string, def_string))
|
||||
g_key_file_set_string (key_file, "settings", property, string);
|
||||
if (strcmp (string ? string : "", def_string))
|
||||
g_key_file_set_string (key_file, "settings", property, string ? string : "");
|
||||
g_free (string);
|
||||
}
|
||||
else if (type == G_TYPE_PARAM_INT)
|
||||
|
@ -595,17 +593,6 @@ midori_bookmarks_import (const gchar* filename,
|
|||
midori_bookmarks_import_array_db (db, bookmarks, "");
|
||||
}
|
||||
|
||||
static void
|
||||
midori_session_add_delay (KatzeArray* session)
|
||||
{
|
||||
KatzeItem* item;
|
||||
KATZE_ARRAY_FOREACH_ITEM (item, session)
|
||||
{
|
||||
if (katze_item_get_meta_integer (item, "delay") == -1)
|
||||
katze_item_set_meta_integer (item, "delay", 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
settings_notify_cb (MidoriWebSettings* settings,
|
||||
GParamSpec* pspec,
|
||||
|
@ -615,9 +602,7 @@ settings_notify_cb (MidoriWebSettings* settings,
|
|||
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, "user-stylesheet-uri"))
|
||||
|| (pspec && g_str_has_prefix (pspec->name, "last-panel-")))
|
||||
if (pspec && pspec->flags & MIDORI_PARAM_DELAY_SAVING)
|
||||
return;
|
||||
|
||||
config_file = build_config_filename ("config");
|
||||
|
@ -675,23 +660,12 @@ midori_search_engines_move_item_cb (KatzeArray* array,
|
|||
}
|
||||
|
||||
static void
|
||||
midori_trash_add_item_cb (KatzeArray* trash,
|
||||
GObject* item)
|
||||
midori_trash_add_item_no_save_cb (KatzeArray* trash,
|
||||
GObject* item)
|
||||
{
|
||||
gchar* config_file = build_config_filename ("tabtrash.xbel");
|
||||
GError* error = NULL;
|
||||
GObject* obsolete_item;
|
||||
if (!midori_array_to_file (trash, config_file, "xbel", &error))
|
||||
{
|
||||
/* i18n: Trash, or wastebin, containing closed tabs */
|
||||
g_warning (_("The trash couldn't be saved. %s"), error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (config_file);
|
||||
|
||||
if (katze_array_get_nth_item (trash, 10))
|
||||
{
|
||||
obsolete_item = katze_array_get_nth_item (trash, 0);
|
||||
KatzeItem* obsolete_item = katze_array_get_nth_item (trash, 0);
|
||||
katze_array_remove_item (trash, obsolete_item);
|
||||
}
|
||||
}
|
||||
|
@ -702,14 +676,23 @@ midori_trash_remove_item_cb (KatzeArray* trash,
|
|||
{
|
||||
gchar* config_file = build_config_filename ("tabtrash.xbel");
|
||||
GError* error = NULL;
|
||||
midori_trash_add_item_no_save_cb (trash, item);
|
||||
if (!midori_array_to_file (trash, config_file, "xbel", &error))
|
||||
{
|
||||
/* i18n: Trash, or wastebin, containing closed tabs */
|
||||
g_warning (_("The trash couldn't be saved. %s"), error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (config_file);
|
||||
}
|
||||
|
||||
static void
|
||||
midori_trash_add_item_cb (KatzeArray* trash,
|
||||
GObject* item)
|
||||
{
|
||||
midori_trash_remove_item_cb (trash, item);
|
||||
}
|
||||
|
||||
static void
|
||||
midori_browser_show_preferences_cb (MidoriBrowser* browser,
|
||||
KatzePreferences* preferences,
|
||||
|
@ -1008,7 +991,12 @@ midori_load_soup_session (gpointer settings)
|
|||
{
|
||||
SoupSession* session = webkit_get_default_session ();
|
||||
|
||||
#if defined (HAVE_LIBSOUP_2_29_91)
|
||||
#if defined (HAVE_LIBSOUP_2_37_1)
|
||||
g_object_set (session,
|
||||
"ssl-use-system-ca-file", TRUE,
|
||||
"ssl-strict", FALSE,
|
||||
NULL);
|
||||
#elif defined (HAVE_LIBSOUP_2_29_91)
|
||||
const gchar* certificate_files[] =
|
||||
{
|
||||
"/etc/pki/tls/certs/ca-bundle.crt",
|
||||
|
@ -1239,9 +1227,7 @@ midori_load_extensions (gpointer data)
|
|||
KatzeArray* extensions;
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
|
||||
GTimer* timer;
|
||||
if (startup_timer)
|
||||
timer = g_timer_new ();
|
||||
GTimer* timer = startup_timer ? g_timer_new () : NULL;
|
||||
#endif
|
||||
|
||||
/* Load extensions */
|
||||
|
@ -1325,7 +1311,7 @@ midori_load_extensions (gpointer data)
|
|||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (startup_timer)
|
||||
g_debug ("Extensions:\t%f", g_test_timer_elapsed ());
|
||||
g_debug ("Extensions:\t%f", g_timer_elapsed (timer, NULL));
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
|
@ -1371,9 +1357,7 @@ midori_load_session (gpointer data)
|
|||
gchar** command = g_object_get_data (G_OBJECT (app), "execute-command");
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
|
||||
GTimer* timer;
|
||||
if (startup_timer)
|
||||
timer = g_timer_new ();
|
||||
GTimer* timer = startup_timer ? g_timer_new () : NULL;
|
||||
#endif
|
||||
|
||||
browser = midori_app_create_browser (app);
|
||||
|
@ -1414,14 +1398,13 @@ midori_load_session (gpointer data)
|
|||
g_object_unref (item);
|
||||
}
|
||||
|
||||
if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES)
|
||||
midori_session_add_delay (_session);
|
||||
|
||||
session = midori_browser_get_proxy_array (browser);
|
||||
KATZE_ARRAY_FOREACH_ITEM (item, _session)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (item), "midori-view-append", (void*)1);
|
||||
katze_item_set_meta_integer (item, "append", 1);
|
||||
katze_item_set_meta_integer (item, "dont-write-history", 1);
|
||||
if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES)
|
||||
katze_item_set_meta_integer (item, "delay", 1);
|
||||
midori_browser_add_item (browser, item);
|
||||
}
|
||||
current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current");
|
||||
|
@ -1452,7 +1435,7 @@ midori_load_session (gpointer data)
|
|||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (startup_timer)
|
||||
g_debug ("Session setup:\t%f", g_test_timer_elapsed ());
|
||||
g_debug ("Session setup:\t%f", g_timer_elapsed (timer, NULL));
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
|
@ -1541,7 +1524,7 @@ midori_prepare_uri (const gchar *uri)
|
|||
if (g_path_is_absolute (uri))
|
||||
return g_filename_to_uri (uri, NULL, NULL);
|
||||
else if (g_str_has_prefix(uri, "javascript:"))
|
||||
return g_strdup (uri);
|
||||
return NULL;
|
||||
else if (g_file_test (uri, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
gchar* current_dir = g_get_current_dir ();
|
||||
|
@ -1551,11 +1534,7 @@ midori_prepare_uri (const gchar *uri)
|
|||
return uri_ready;
|
||||
}
|
||||
|
||||
uri_ready = sokoke_magic_uri (uri);
|
||||
if (uri_ready)
|
||||
return midori_uri_to_ascii (uri_ready);
|
||||
|
||||
return midori_uri_to_ascii (uri);
|
||||
return sokoke_magic_uri (uri);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
|
@ -2030,11 +2009,6 @@ main (int argc,
|
|||
else
|
||||
g_set_application_name (_("Midori"));
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (startup_timer)
|
||||
g_test_timer_start ();
|
||||
#endif
|
||||
|
||||
if (version)
|
||||
{
|
||||
g_print (
|
||||
|
@ -2182,6 +2156,8 @@ main (int argc,
|
|||
{
|
||||
/* In-memory trash for re-opening closed tabs */
|
||||
trash = katze_array_new (KATZE_TYPE_ITEM);
|
||||
g_signal_connect_after (trash, "add-item",
|
||||
G_CALLBACK (midori_trash_add_item_no_save_cb), NULL);
|
||||
g_object_set (browser, "trash", trash, NULL);
|
||||
|
||||
g_object_set (settings,
|
||||
|
@ -2201,6 +2177,11 @@ main (int argc,
|
|||
"strip-referer", TRUE, NULL);
|
||||
midori_browser_set_action_visible (browser, "Tools", FALSE);
|
||||
midori_browser_set_action_visible (browser, "ClearPrivateData", FALSE);
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_set (gtk_widget_get_settings (GTK_WIDGET (browser)),
|
||||
"gtk-application-prefer-dark-theme", TRUE,
|
||||
NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (private || !config)
|
||||
|
@ -2226,7 +2207,7 @@ main (int argc,
|
|||
GtkWidget* offscreen = gtk_offscreen_window_new ();
|
||||
#endif
|
||||
gchar* msg = NULL;
|
||||
GtkWidget* view = midori_view_new_with_title (NULL, settings, FALSE);
|
||||
GtkWidget* view = midori_view_new_with_item (NULL, settings);
|
||||
g_object_set (settings, "open-new-pages-in", MIDORI_NEW_PAGE_WINDOW, NULL);
|
||||
midori_browser_add_tab (browser, view);
|
||||
#if 0 /* HAVE_OFFSCREEN */
|
||||
|
@ -2257,7 +2238,8 @@ main (int argc,
|
|||
{
|
||||
gchar* tmp_uri = midori_prepare_uri (webapp);
|
||||
midori_browser_set_action_visible (browser, "Menubar", FALSE);
|
||||
midori_browser_add_uri (browser, tmp_uri);
|
||||
midori_browser_set_action_visible (browser, "CompactMenu", FALSE);
|
||||
midori_browser_add_uri (browser, tmp_uri ? tmp_uri : webapp);
|
||||
g_object_set (settings, "homepage", tmp_uri, NULL);
|
||||
g_free (tmp_uri);
|
||||
|
||||
|
@ -2334,7 +2316,10 @@ main (int argc,
|
|||
while (uris[i] != NULL)
|
||||
{
|
||||
gchar* new_uri = midori_prepare_uri (uris[i]);
|
||||
katze_assign (uris[i], new_uri);
|
||||
gchar* escaped_uri = g_uri_escape_string (
|
||||
new_uri ? new_uri : uris[i], NULL, FALSE);
|
||||
g_free (new_uri);
|
||||
katze_assign (uris[i], escaped_uri);
|
||||
i++;
|
||||
}
|
||||
result = midori_app_instance_send_uris (app, uris);
|
||||
|
@ -2507,7 +2492,7 @@ main (int argc,
|
|||
{
|
||||
item = katze_item_new ();
|
||||
uri_ready = midori_prepare_uri (uri);
|
||||
katze_item_set_uri (item, uri_ready);
|
||||
katze_item_set_uri (item, uri_ready ? uri_ready : uri);
|
||||
g_free (uri_ready);
|
||||
/* Never delay command line arguments */
|
||||
katze_item_set_meta_integer (item, "delay", 0);
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
See the file COPYING for the full license text.
|
||||
*/
|
||||
|
||||
/* When cross-compiling assume at least WinXP */
|
||||
#ifdef _WIN32
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
@ -37,7 +43,13 @@
|
|||
#elif HAVE_UNIQUE
|
||||
typedef gpointer MidoriAppInstance;
|
||||
#define MidoriAppInstanceNull NULL
|
||||
#if defined(G_DISABLE_DEPRECATED) && !defined(G_CONST_RETURN)
|
||||
#define G_CONST_RETURN
|
||||
#endif
|
||||
#include <unique/unique.h>
|
||||
#ifdef G_DISABLE_DEPRECATED
|
||||
#undef G_CONST_RETUTN
|
||||
#endif
|
||||
#define MIDORI_UNIQUE_COMMAND 1
|
||||
#else
|
||||
typedef gint MidoriAppInstance;
|
||||
|
@ -315,7 +327,7 @@ midori_app_class_init (MidoriAppClass* class)
|
|||
"name",
|
||||
"Name",
|
||||
"The name of the instance",
|
||||
"midori",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
|
@ -494,9 +506,7 @@ midori_app_command_received (MidoriApp* app,
|
|||
first = (open_external_pages_in == MIDORI_NEW_PAGE_CURRENT);
|
||||
while (*uris)
|
||||
{
|
||||
gchar* fixed_uri = sokoke_magic_uri (*uris);
|
||||
if (!fixed_uri)
|
||||
fixed_uri = g_strdup (*uris);
|
||||
gchar* fixed_uri = g_uri_unescape_string (*uris, NULL);
|
||||
if (sokoke_recursive_fork_protection (fixed_uri, FALSE))
|
||||
{
|
||||
if (first)
|
||||
|
@ -1431,5 +1441,28 @@ midori_app_setup (gchar** argument_vector)
|
|||
gtk_icon_factory_add_default (factory);
|
||||
g_object_unref (factory);
|
||||
#endif
|
||||
|
||||
/* Print messages to stdout on Win32 console, cf. AbiWord
|
||||
* http://svn.abisource.com/abiword/trunk/src/wp/main/win/Win32Main.cpp */
|
||||
#ifdef _WIN32
|
||||
if (fileno (stdout) != -1
|
||||
&& _get_osfhandle (fileno (stdout)) != -1)
|
||||
{
|
||||
/* stdout is already being redirected to a file */
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef BOOL (WINAPI *AttachConsole_t) (DWORD);
|
||||
AttachConsole_t p_AttachConsole =
|
||||
(AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
|
||||
if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
freopen ("CONOUT$", "w", stdout);
|
||||
dup2 (fileno (stdout), 1);
|
||||
freopen ("CONOUT$", "w", stderr);
|
||||
dup2 (fileno (stderr), 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -796,7 +796,7 @@ katze_item_metadata_to_xbel (KatzeItem* item)
|
|||
const gchar* value;
|
||||
|
||||
if (!keys)
|
||||
return g_strdup ("");
|
||||
return NULL;
|
||||
|
||||
markup = g_string_new ("<info>\n<metadata");
|
||||
markdown = g_string_new (NULL);
|
||||
|
@ -856,7 +856,7 @@ katze_array_to_xbel (KatzeArray* array,
|
|||
">\n");
|
||||
string_append_xml_element (markup, "title", katze_item_get_name (KATZE_ITEM (array)));
|
||||
string_append_xml_element (markup, "desc", katze_item_get_text (KATZE_ITEM (array)));
|
||||
g_string_append (markup, metadata);
|
||||
g_string_append (markup, metadata ? metadata : "");
|
||||
KATZE_ARRAY_FOREACH_ITEM_L (item, array, list)
|
||||
string_append_item (markup, item);
|
||||
g_string_append (markup, "</xbel>\n");
|
||||
|
@ -905,10 +905,9 @@ midori_array_to_file_format (KatzeArray* array,
|
|||
|
||||
if (!g_strcmp0 (format, "xbel"))
|
||||
data = katze_array_to_xbel (array, error);
|
||||
if (!g_strcmp0 (format, "netscape"))
|
||||
else if (!g_strcmp0 (format, "netscape"))
|
||||
data = katze_array_to_netscape_html (array, error);
|
||||
|
||||
if (!data)
|
||||
else
|
||||
return FALSE;
|
||||
if (!(fp = fopen (filename, "w")))
|
||||
{
|
||||
|
@ -968,19 +967,19 @@ katze_item_set_value_from_column (sqlite3_stmt* stmt,
|
|||
const unsigned char* uri;
|
||||
uri = sqlite3_column_text (stmt, column);
|
||||
if (uri && uri[0] && uri[0] != '(')
|
||||
katze_item_set_uri (item, (gchar*)uri);
|
||||
item->uri = g_strdup ((gchar*)uri);
|
||||
}
|
||||
else if (g_str_equal (name, "title") || g_str_equal (name, "name"))
|
||||
{
|
||||
const unsigned char* title;
|
||||
title = sqlite3_column_text (stmt, column);
|
||||
katze_item_set_name (item, (gchar*)title);
|
||||
item->name = g_strdup ((gchar*)title);
|
||||
}
|
||||
else if (g_str_equal (name, "date"))
|
||||
{
|
||||
gint date;
|
||||
date = sqlite3_column_int64 (stmt, column);
|
||||
katze_item_set_added (item, date);
|
||||
item->added = date;
|
||||
}
|
||||
else if (g_str_equal (name, "day") || g_str_equal (name, "app")
|
||||
|| g_str_equal (name, "toolbar"))
|
||||
|
@ -999,7 +998,7 @@ katze_item_set_value_from_column (sqlite3_stmt* stmt,
|
|||
{
|
||||
const unsigned char* text;
|
||||
text = sqlite3_column_text (stmt, column);
|
||||
katze_item_set_text (item, (gchar*)text);
|
||||
item->text = g_strdup ((gchar*)text);
|
||||
}
|
||||
else
|
||||
g_warn_if_reached ();
|
||||
|
@ -1066,3 +1065,49 @@ katze_array_from_sqlite (sqlite3* db,
|
|||
|
||||
return katze_array_from_statement (stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_array_query:
|
||||
* @array: the main bookmark array
|
||||
* @fields: comma separated list of fields
|
||||
* @condition: condition, like "folder = '%q'"
|
||||
* @value: a value to be inserted if @condition contains %q
|
||||
*
|
||||
* Stores the result in a #KatzeArray.
|
||||
*
|
||||
* Return value: a #KatzeArray on success, %NULL otherwise
|
||||
*
|
||||
* Since: 0.4.3
|
||||
**/
|
||||
KatzeArray*
|
||||
midori_array_query (KatzeArray* bookmarks,
|
||||
const gchar* fields,
|
||||
const gchar* condition,
|
||||
const gchar* value)
|
||||
{
|
||||
sqlite3* db;
|
||||
gchar* sqlcmd;
|
||||
char* sqlcmd_value;
|
||||
KatzeArray* array;
|
||||
|
||||
g_return_val_if_fail (KATZE_IS_ARRAY (bookmarks), NULL);
|
||||
g_return_val_if_fail (fields, NULL);
|
||||
g_return_val_if_fail (condition, NULL);
|
||||
db = g_object_get_data (G_OBJECT (bookmarks), "db");
|
||||
if (db == NULL)
|
||||
return NULL;
|
||||
|
||||
sqlcmd = g_strdup_printf ("SELECT %s FROM bookmarks WHERE %s "
|
||||
"ORDER BY title DESC", fields, condition);
|
||||
if (strstr (condition, "%q"))
|
||||
{
|
||||
sqlcmd_value = sqlite3_mprintf (sqlcmd, value ? value : "");
|
||||
array = katze_array_from_sqlite (db, sqlcmd_value);
|
||||
sqlite3_free (sqlcmd_value);
|
||||
}
|
||||
else
|
||||
array = katze_array_from_sqlite (db, sqlcmd);
|
||||
g_free (sqlcmd);
|
||||
return array;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@ midori_array_to_file (KatzeArray* array,
|
|||
KatzeArray*
|
||||
katze_array_from_statement (sqlite3_stmt* stmt);
|
||||
|
||||
KatzeArray*
|
||||
midori_array_query (KatzeArray* array,
|
||||
const gchar* fields,
|
||||
const gchar* condition,
|
||||
const gchar* value);
|
||||
|
||||
KatzeArray*
|
||||
katze_array_from_sqlite (sqlite3* db,
|
||||
const gchar* sqlcmd);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -763,6 +763,30 @@ midori_location_action_create_tool_item (GtkAction* action)
|
|||
gtk_widget_show (entry);
|
||||
gtk_container_add (GTK_CONTAINER (alignment), entry);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
{
|
||||
static const gchar default_style[] =
|
||||
".security_unknown {\n"
|
||||
"background-image: none;\n"
|
||||
"background-color: #ef7070;\n"
|
||||
"color: #000;\n"
|
||||
"}\n"
|
||||
".security_trusted {\n"
|
||||
"background-image: none;\n"
|
||||
"background-color: #d1eeb9;\n"
|
||||
"color: #000;\n"
|
||||
"}\n";
|
||||
GtkCssProvider* css_provider;
|
||||
GtkStyleContext* context;
|
||||
|
||||
css_provider = gtk_css_provider_new ();
|
||||
context = gtk_widget_get_style_context (entry);
|
||||
gtk_css_provider_load_from_data (css_provider, default_style, -1, NULL);
|
||||
gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (css_provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
|
||||
}
|
||||
#endif
|
||||
|
||||
return toolitem;
|
||||
}
|
||||
|
||||
|
@ -1274,6 +1298,8 @@ midori_location_action_populate_popup_cb (GtkWidget* entry,
|
|||
MidoriBrowser* browser = midori_browser_get_for_widget (entry);
|
||||
GtkActionGroup* actions = midori_browser_get_action_group (browser);
|
||||
GtkWidget* menuitem;
|
||||
GtkClipboard* clipboard = gtk_clipboard_get_for_display (
|
||||
gtk_widget_get_display (entry),GDK_SELECTION_CLIPBOARD);
|
||||
|
||||
menuitem = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (menuitem);
|
||||
|
@ -1288,6 +1314,8 @@ midori_location_action_populate_popup_cb (GtkWidget* entry,
|
|||
gtk_menu_shell_insert (menu, menuitem, 3);
|
||||
g_signal_connect (menuitem, "activate",
|
||||
G_CALLBACK (midori_location_action_paste_proceed_cb), location_action);
|
||||
if (!gtk_clipboard_wait_is_text_available (clipboard))
|
||||
gtk_widget_set_sensitive (menuitem, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1631,18 +1659,21 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
|
|||
for (; proxies != NULL; proxies = g_slist_next (proxies))
|
||||
if (GTK_IS_TOOL_ITEM (proxies->data))
|
||||
{
|
||||
GdkColor bg_color = { 0, 1 };
|
||||
GdkColor fg_color = { 0, 1 };
|
||||
const gchar* bg_color = NULL;
|
||||
const gchar* fg_color = NULL;
|
||||
GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
|
||||
GdkScreen* screen = gtk_widget_get_screen (entry);
|
||||
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);
|
||||
bg_color = "#ef7070";
|
||||
fg_color = "#000";
|
||||
#if !HAVE_HILDON
|
||||
if (gtk_icon_theme_has_icon (icon_theme, "lock-insecure"))
|
||||
if (gtk_icon_theme_has_icon (icon_theme, "channel-insecure-symbolic"))
|
||||
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
|
||||
GTK_ICON_ENTRY_SECONDARY, "channel-insecure-symbolic");
|
||||
else if (gtk_icon_theme_has_icon (icon_theme, "lock-insecure"))
|
||||
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
|
||||
GTK_ICON_ENTRY_SECONDARY, "lock-insecure");
|
||||
else
|
||||
|
@ -1654,10 +1685,13 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
|
|||
}
|
||||
else if (hint == MIDORI_SECURITY_TRUSTED)
|
||||
{
|
||||
gdk_color_parse ("#d1eeb9", &bg_color);
|
||||
gdk_color_parse ("#000", &fg_color);
|
||||
bg_color = "#d1eeb9";
|
||||
fg_color = "#000";
|
||||
#if !HAVE_HILDON
|
||||
if (gtk_icon_theme_has_icon (icon_theme, "lock-secure"))
|
||||
if (gtk_icon_theme_has_icon (icon_theme, "channel-secure-symbolic"))
|
||||
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
|
||||
GTK_ICON_ENTRY_SECONDARY, "channel-secure-symbolic");
|
||||
else if (gtk_icon_theme_has_icon (icon_theme, "lock-secure"))
|
||||
gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
|
||||
GTK_ICON_ENTRY_SECONDARY, "lock-secure");
|
||||
else
|
||||
|
@ -1671,9 +1705,31 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
|
|||
gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry),
|
||||
GTK_ICON_ENTRY_SECONDARY, NULL);
|
||||
|
||||
gtk_widget_modify_base (entry, GTK_STATE_NORMAL,
|
||||
bg_color.red == 1 ? NULL : &bg_color);
|
||||
gtk_widget_modify_text (entry, GTK_STATE_NORMAL,
|
||||
bg_color.red == 1 ? NULL : &fg_color);
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
GtkStyleContext* context = gtk_widget_get_style_context (entry);
|
||||
if (hint == MIDORI_SECURITY_UNKNOWN)
|
||||
{
|
||||
gtk_style_context_add_class (context, "security_unknown");
|
||||
gtk_style_context_remove_class (context, "security_trusted");
|
||||
}
|
||||
else if (hint == MIDORI_SECURITY_TRUSTED)
|
||||
{
|
||||
gtk_style_context_add_class (context, "security_trusted");
|
||||
gtk_style_context_remove_class (context, "security_unknown");
|
||||
}
|
||||
else if (hint == MIDORI_SECURITY_NONE)
|
||||
{
|
||||
gtk_style_context_remove_class (context, "security_unknown");
|
||||
gtk_style_context_remove_class (context, "security_trusted");
|
||||
}
|
||||
#else
|
||||
GdkColor color = { 0 };
|
||||
if (bg_color) gdk_color_parse (bg_color, &color);
|
||||
gtk_widget_modify_base (entry, GTK_STATE_NORMAL, bg_color ? &color : NULL);
|
||||
if (fg_color) gdk_color_parse (fg_color, &color);
|
||||
gtk_widget_modify_text (entry, GTK_STATE_NORMAL, fg_color ? &color : NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
227
midori/midori-panedaction.c
Normal file
227
midori/midori-panedaction.c
Normal file
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
Copyright (C) 2011 Peter Hatina <phatina@redhat.com>
|
||||
|
||||
This library is free software; 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.
|
||||
|
||||
See the file COPYING for the full license text.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <katze/katze.h>
|
||||
#include "midori-panedaction.h"
|
||||
|
||||
struct _MidoriPanedActionChild
|
||||
{
|
||||
GtkWidget* widget;
|
||||
gchar* name;
|
||||
gboolean resize;
|
||||
gboolean shrink;
|
||||
};
|
||||
|
||||
struct _MidoriPanedAction
|
||||
{
|
||||
GtkAction parent_instance;
|
||||
GtkWidget* hpaned;
|
||||
GtkWidget* toolitem;
|
||||
struct _MidoriPanedActionChild child1;
|
||||
struct _MidoriPanedActionChild child2;
|
||||
};
|
||||
|
||||
struct _MidoriPanedActionClass
|
||||
{
|
||||
GtkActionClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MidoriPanedAction, midori_paned_action, GTK_TYPE_ACTION);
|
||||
|
||||
static GtkWidget*
|
||||
midori_paned_action_create_tool_item (GtkAction *action);
|
||||
|
||||
static void
|
||||
midori_paned_action_finalize (GObject* object);
|
||||
|
||||
static void
|
||||
midori_paned_action_init (MidoriPanedAction* paned_action)
|
||||
{
|
||||
paned_action->hpaned = NULL;
|
||||
paned_action->toolitem = NULL;
|
||||
memset ((void*) &paned_action->child1, 0, sizeof (struct _MidoriPanedActionChild));
|
||||
memset ((void*) &paned_action->child2, 0, sizeof (struct _MidoriPanedActionChild));
|
||||
}
|
||||
|
||||
static void
|
||||
midori_paned_action_finalize (GObject* object)
|
||||
{
|
||||
MidoriPanedAction* paned_action = MIDORI_PANED_ACTION (object);
|
||||
|
||||
g_object_unref (G_OBJECT (paned_action->toolitem));
|
||||
g_object_unref (G_OBJECT (paned_action->hpaned));
|
||||
katze_assign (paned_action->child1.name, NULL);
|
||||
katze_assign (paned_action->child2.name, NULL);
|
||||
|
||||
G_OBJECT_CLASS (midori_paned_action_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
midori_paned_action_class_init (MidoriPanedActionClass* class)
|
||||
{
|
||||
GObjectClass* gobject_class;
|
||||
GtkActionClass* action_class;
|
||||
|
||||
gobject_class = G_OBJECT_CLASS (class);
|
||||
gobject_class->finalize = midori_paned_action_finalize;
|
||||
|
||||
action_class = GTK_ACTION_CLASS (class);
|
||||
action_class->create_tool_item = midori_paned_action_create_tool_item;
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
midori_paned_action_create_tool_item (GtkAction* action)
|
||||
{
|
||||
MidoriPanedAction* paned_action = MIDORI_PANED_ACTION (action);
|
||||
GtkWidget* alignment = gtk_alignment_new (0.0f, 0.5f, 1.0f, 0.1f);
|
||||
paned_action->hpaned = gtk_hpaned_new ();
|
||||
paned_action->toolitem = GTK_WIDGET (gtk_tool_item_new ());
|
||||
gtk_tool_item_set_expand (GTK_TOOL_ITEM (paned_action->toolitem), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (paned_action->toolitem), alignment);
|
||||
gtk_container_add (GTK_CONTAINER (alignment), GTK_WIDGET (paned_action->hpaned));
|
||||
|
||||
gtk_paned_pack1 (GTK_PANED (paned_action->hpaned),
|
||||
paned_action->child1.widget,
|
||||
paned_action->child1.resize,
|
||||
paned_action->child1.shrink);
|
||||
gtk_paned_pack2 (GTK_PANED (paned_action->hpaned),
|
||||
paned_action->child2.widget,
|
||||
paned_action->child2.resize,
|
||||
paned_action->child2.shrink);
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (paned_action->toolitem));
|
||||
return paned_action->toolitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_set_child1:
|
||||
* @paned_action: a #MidoriPanedAction
|
||||
* @child1: a #GtkWidget to be added into GtkHPaned container
|
||||
* @name: string name for the child2
|
||||
* @resize: should child1 expand when the MidoriPanedAction is resized
|
||||
* @shrink: can child1 be made smaller than its requisition
|
||||
**/
|
||||
void
|
||||
midori_paned_action_set_child1 (MidoriPanedAction* paned_action,
|
||||
GtkWidget* child1,
|
||||
const gchar* name,
|
||||
gboolean resize,
|
||||
gboolean shrink)
|
||||
{
|
||||
g_return_if_fail (MIDORI_IS_PANED_ACTION (paned_action));
|
||||
|
||||
katze_assign (paned_action->child1.name, g_strdup (name));
|
||||
paned_action->child1.widget = child1;
|
||||
paned_action->child1.resize = resize;
|
||||
paned_action->child1.shrink = shrink;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_set_child1:
|
||||
* @paned_action: a #MidoriPanedAction
|
||||
* @child2: a #GtkWidget to be added into GtkHPaned container
|
||||
* @name: string name for the child2
|
||||
* @resize: should child2 expand when the MidoriPanedAction is resized
|
||||
* @shrink: can child2 be made smaller than its requisition
|
||||
**/
|
||||
void
|
||||
midori_paned_action_set_child2 (MidoriPanedAction* paned_action,
|
||||
GtkWidget* child2,
|
||||
const gchar* name,
|
||||
gboolean resize,
|
||||
gboolean shrink)
|
||||
{
|
||||
g_return_if_fail (MIDORI_IS_PANED_ACTION (paned_action));
|
||||
|
||||
katze_assign (paned_action->child2.name, g_strdup (name));
|
||||
paned_action->child2.widget = child2;
|
||||
paned_action->child2.resize = resize;
|
||||
paned_action->child2.shrink = shrink;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_get_child1:
|
||||
* @paned_action: a #MidoriPanedAction
|
||||
*
|
||||
* returns the first child held in GtkHPaned container
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child1 (MidoriPanedAction* paned_action)
|
||||
{
|
||||
g_return_val_if_fail (MIDORI_IS_PANED_ACTION (paned_action), NULL);
|
||||
|
||||
return paned_action->child1.widget;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_get_child1:
|
||||
* @paned_action: a #MidoriPanedAction
|
||||
*
|
||||
* returns the second child held in GtkHPaned container
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child2 (MidoriPanedAction* paned_action)
|
||||
{
|
||||
g_return_val_if_fail (MIDORI_IS_PANED_ACTION (paned_action), NULL);
|
||||
|
||||
return paned_action->child2.widget;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_get_child1:
|
||||
* @paned_action: a #MidoriPanedAction
|
||||
* @name: string name for one of the children
|
||||
*
|
||||
* returns a child specified by its name
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child_by_name (MidoriPanedAction* paned_action,
|
||||
const gchar* name)
|
||||
{
|
||||
g_return_val_if_fail (MIDORI_IS_PANED_ACTION (paned_action), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
if (g_strcmp0 (name, paned_action->child1.name) == 0)
|
||||
return midori_paned_action_get_child1 (paned_action);
|
||||
else if (g_strcmp0 (name, paned_action->child2.name) == 0)
|
||||
return midori_paned_action_get_child2 (paned_action);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_get_child1_name:
|
||||
* @paned_action a #MidoriPanedAction
|
||||
*
|
||||
* Returns: The name of the first child
|
||||
**/
|
||||
const gchar*
|
||||
midori_paned_action_get_child1_name (MidoriPanedAction* paned_action)
|
||||
{
|
||||
g_return_val_if_fail (MIDORI_IS_PANED_ACTION (paned_action), NULL);
|
||||
|
||||
return paned_action->child1.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_paned_action_get_child2_name:
|
||||
* @paned_action a #MidoriPanedAction
|
||||
*
|
||||
* Returns: The name of the second child
|
||||
**/
|
||||
const gchar*
|
||||
midori_paned_action_get_child2_name (MidoriPanedAction* paned_action)
|
||||
{
|
||||
g_return_val_if_fail (MIDORI_IS_PANED_ACTION (paned_action), NULL);
|
||||
|
||||
return paned_action->child2.name;
|
||||
}
|
70
midori/midori-panedaction.h
Normal file
70
midori/midori-panedaction.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
Copyright (C) 2011 Peter Hatina <phatina@redhat.com>
|
||||
|
||||
This library is free software; 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.
|
||||
|
||||
See the file COPYING for the full license text.
|
||||
*/
|
||||
|
||||
#ifndef __MIDORI_PANED_ACTION_H__
|
||||
#define __MIDORI_PANED_ACTION_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define MIDORI_TYPE_PANED_ACTION \
|
||||
(midori_paned_action_get_type ())
|
||||
#define MIDORI_PANED_ACTION(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_PANED_ACTION, MidoriPanedAction))
|
||||
#define MIDORI_PANED_ACTION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_PANED_ACTION, MidoriPanedActionClass))
|
||||
#define MIDORI_IS_PANED_ACTION(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_PANED_ACTION))
|
||||
#define MIDORI_IS_PANED_ACTION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_PANED_ACTION))
|
||||
#define MIDORI_PANED_ACTION_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_PANED_ACTION, MidoriPanedActionClass))
|
||||
|
||||
typedef struct _MidoriPanedAction MidoriPanedAction;
|
||||
typedef struct _MidoriPanedActionClass MidoriPanedActionClass;
|
||||
|
||||
GType
|
||||
midori_paned_action_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void
|
||||
midori_paned_action_set_child1 (MidoriPanedAction* paned_action,
|
||||
GtkWidget* child1,
|
||||
const gchar* name,
|
||||
gboolean resize,
|
||||
gboolean shrink);
|
||||
|
||||
void
|
||||
midori_paned_action_set_child2 (MidoriPanedAction* paned_action,
|
||||
GtkWidget* child2,
|
||||
const gchar* name,
|
||||
gboolean resize,
|
||||
gboolean shrink);
|
||||
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child1 (MidoriPanedAction* paned_action);
|
||||
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child2 (MidoriPanedAction* paned_action);
|
||||
|
||||
GtkWidget*
|
||||
midori_paned_action_get_child_by_name (MidoriPanedAction* paned_action,
|
||||
const gchar* name);
|
||||
|
||||
const gchar*
|
||||
midori_paned_action_get_child1_name (MidoriPanedAction* paned_action);
|
||||
|
||||
const gchar*
|
||||
midori_paned_action_get_child2_name (MidoriPanedAction* paned_action);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif // __MIDORI_PANED_ACTION_H__
|
|
@ -685,7 +685,9 @@ midori_panel_append_page (MidoriPanel* panel,
|
|||
MidoriViewable* viewable)
|
||||
{
|
||||
GtkWidget* scrolled;
|
||||
#if !GTK_CHECK_VERSION (3, 0, 0)
|
||||
GObjectClass* gobject_class;
|
||||
#endif
|
||||
GtkWidget* widget;
|
||||
GtkWidget* toolbar;
|
||||
GtkToolItem* toolitem;
|
||||
|
@ -696,6 +698,12 @@ midori_panel_append_page (MidoriPanel* panel,
|
|||
g_return_val_if_fail (MIDORI_IS_PANEL (panel), -1);
|
||||
g_return_val_if_fail (MIDORI_IS_VIEWABLE (viewable), -1);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 2, 0)
|
||||
if (GTK_IS_ORIENTABLE (viewable))
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (viewable),
|
||||
GTK_ORIENTATION_VERTICAL);
|
||||
#endif
|
||||
|
||||
if (GTK_IS_SCROLLED_WINDOW (viewable))
|
||||
scrolled = (GtkWidget*)viewable;
|
||||
else
|
||||
|
@ -706,12 +714,14 @@ midori_panel_append_page (MidoriPanel* panel,
|
|||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_set_can_focus (scrolled, TRUE);
|
||||
gtk_widget_show (scrolled);
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
if (GTK_IS_SCROLLABLE (viewable))
|
||||
#else
|
||||
gobject_class = G_OBJECT_GET_CLASS (viewable);
|
||||
#if !GTK_CHECK_VERSION(3,0,0) /* TODO */
|
||||
if (GTK_WIDGET_CLASS (gobject_class)->set_scroll_adjustments_signal)
|
||||
#endif
|
||||
widget = (GtkWidget*)viewable;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
widget = gtk_viewport_new (NULL, NULL);
|
||||
gtk_widget_show (widget);
|
||||
|
|
|
@ -168,7 +168,6 @@ enum
|
|||
enum {
|
||||
ACTIVATE_ACTION,
|
||||
CONSOLE_MESSAGE,
|
||||
CONTEXT_READY,
|
||||
ATTACH_INSPECTOR,
|
||||
DETACH_INSPECTOR,
|
||||
NEW_TAB,
|
||||
|
@ -248,17 +247,6 @@ midori_view_class_init (MidoriViewClass* class)
|
|||
G_TYPE_INT,
|
||||
G_TYPE_STRING);
|
||||
|
||||
signals[CONTEXT_READY] = g_signal_new (
|
||||
"context-ready",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
(GSignalFlags)(G_SIGNAL_RUN_LAST),
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_POINTER);
|
||||
|
||||
signals[ATTACH_INSPECTOR] = g_signal_new (
|
||||
"attach-inspector",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
|
@ -679,7 +667,7 @@ midori_view_apply_icon (MidoriView* view,
|
|||
|
||||
if (view->tab_icon)
|
||||
{
|
||||
if (icon_name)
|
||||
if (icon_name && !strchr (icon_name, '/'))
|
||||
katze_throbber_set_static_icon_name (KATZE_THROBBER (view->tab_icon),
|
||||
icon_name);
|
||||
else
|
||||
|
@ -689,7 +677,7 @@ midori_view_apply_icon (MidoriView* view,
|
|||
if (view->menu_item)
|
||||
{
|
||||
GtkWidget* image;
|
||||
if (icon_name)
|
||||
if (icon_name && !strchr (icon_name, '/'))
|
||||
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
|
||||
else
|
||||
image = gtk_image_new_from_pixbuf (view->icon);
|
||||
|
@ -731,7 +719,7 @@ midori_view_update_icon (MidoriView* view,
|
|||
|
||||
if (icon)
|
||||
{
|
||||
midori_view_apply_icon (view, icon, NULL);
|
||||
midori_view_apply_icon (view, icon, view->icon_uri);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -866,17 +854,16 @@ static void
|
|||
_midori_web_view_load_icon (MidoriView* view)
|
||||
{
|
||||
GdkPixbuf* pixbuf;
|
||||
gchar* icon_uri;
|
||||
gchar* icon_file;
|
||||
gint icon_width, icon_height;
|
||||
GdkPixbuf* pixbuf_scaled;
|
||||
GtkSettings* settings;
|
||||
|
||||
pixbuf = NULL;
|
||||
icon_uri = g_strdup (view->icon_uri);
|
||||
|
||||
if (midori_uri_is_http (icon_uri) || midori_uri_is_http (view->uri))
|
||||
if (midori_uri_is_http (view->icon_uri) || midori_uri_is_http (view->uri))
|
||||
{
|
||||
gchar* icon_uri = g_strdup (view->icon_uri);
|
||||
if (!icon_uri)
|
||||
{
|
||||
guint i = 8;
|
||||
|
@ -1041,6 +1028,7 @@ webkit_web_view_load_committed_cb (WebKitWebView* web_view,
|
|||
for (; children; children = g_list_next (children))
|
||||
if (g_object_get_data (G_OBJECT (children->data), "midori-infobar-cb"))
|
||||
gtk_widget_destroy (children->data);
|
||||
g_list_free (children);
|
||||
view->alerts = 0;
|
||||
|
||||
if (g_strcmp0 (uri, katze_item_get_uri (view->item)))
|
||||
|
@ -1339,13 +1327,14 @@ midori_view_web_view_database_quota_exceeded_cb (WebKitWebView* web_view,
|
|||
MidoriView* view)
|
||||
{
|
||||
const gchar* uri = webkit_web_frame_get_uri (web_frame);
|
||||
const gchar* hostname = midori_uri_parse (uri, NULL);
|
||||
gchar* hostname = midori_uri_parse_hostname (uri, NULL);
|
||||
gchar* message = g_strdup_printf (_("%s wants to save an HTML5 database."),
|
||||
hostname && *hostname ? hostname : uri);
|
||||
midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION, message,
|
||||
G_CALLBACK (midori_view_database_response_cb), database,
|
||||
_("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
g_free (hostname);
|
||||
g_free (message);
|
||||
}
|
||||
|
||||
|
@ -1368,13 +1357,14 @@ midori_view_web_view_geolocation_decision_cb (WebKitWebView* w
|
|||
MidoriView* view)
|
||||
{
|
||||
const gchar* uri = webkit_web_frame_get_uri (web_frame);
|
||||
const gchar* hostname = midori_uri_parse (uri, NULL);
|
||||
gchar* hostname = midori_uri_parse_hostname (uri, NULL);
|
||||
gchar* message = g_strdup_printf (_("%s wants to know your location."),
|
||||
hostname && *hostname ? hostname : uri);
|
||||
midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION,
|
||||
message, G_CALLBACK (midori_view_location_response_cb), decision,
|
||||
_("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
g_free (hostname);
|
||||
g_free (message);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1409,11 +1399,14 @@ midori_view_display_error (MidoriView* view,
|
|||
if (g_file_get_contents (path, &template, NULL, NULL))
|
||||
{
|
||||
gchar* title_escaped;
|
||||
const gchar* icon;
|
||||
gchar* result;
|
||||
|
||||
title_escaped = g_markup_escape_text (title, -1);
|
||||
icon = katze_item_get_icon (view->item);
|
||||
result = sokoke_replace_variables (template,
|
||||
"{title}", title_escaped,
|
||||
"{icon}", icon ? icon : "",
|
||||
"{message}", message,
|
||||
"{description}", description,
|
||||
"{tryagain}", try_again,
|
||||
|
@ -1961,8 +1954,8 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
|
|||
if (!webkit_web_view_can_cut_clipboard (web_view)
|
||||
&& !webkit_web_view_can_paste_clipboard (web_view))
|
||||
{
|
||||
gchar* text = character ? g_strdup_printf ("%c", character) : g_strdup ("");
|
||||
g_signal_emit (view, signals[SEARCH_TEXT], 0, TRUE, text);
|
||||
gchar* text = character ? g_strdup_printf ("%c", character) : NULL;
|
||||
g_signal_emit (view, signals[SEARCH_TEXT], 0, TRUE, text ? text : "");
|
||||
g_free (text);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2598,10 +2591,6 @@ midori_view_populate_popup (MidoriView* view,
|
|||
menuitem = sokoke_action_create_popup_menu_item (
|
||||
gtk_action_group_get_action (actions, "SaveAs"));
|
||||
gtk_menu_shell_append (menu_shell, menuitem);
|
||||
/* Currently views that don't support source, don't support
|
||||
saving either. If that changes, we need to think of something. */
|
||||
if (!midori_view_can_view_source (view))
|
||||
gtk_widget_set_sensitive (menuitem, FALSE);
|
||||
menuitem = sokoke_action_create_popup_menu_item (
|
||||
gtk_action_group_get_action (actions, "SourceView"));
|
||||
gtk_menu_shell_append (menu_shell, menuitem);
|
||||
|
@ -2625,6 +2614,17 @@ midori_view_populate_popup (MidoriView* view,
|
|||
g_object_set_data (G_OBJECT (menuitem), "y", GINT_TO_POINTER (y));
|
||||
}
|
||||
|
||||
GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
|
||||
if (state & GDK_WINDOW_STATE_FULLSCREEN)
|
||||
{
|
||||
menuitem = sokoke_action_create_popup_menu_item (
|
||||
gtk_action_group_get_action (actions, "Fullscreen"));
|
||||
|
||||
gtk_image_menu_item_set_use_stock (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
|
||||
gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), GTK_STOCK_LEAVE_FULLSCREEN);
|
||||
gtk_menu_shell_append (menu_shell, menuitem);
|
||||
}
|
||||
|
||||
gtk_widget_show_all (menu);
|
||||
}
|
||||
|
||||
|
@ -2700,8 +2700,7 @@ webkit_web_view_create_web_view_cb (GtkWidget* web_view,
|
|||
new_view = view;
|
||||
else
|
||||
{
|
||||
new_view = (MidoriView*)midori_view_new_with_title (NULL,
|
||||
view->settings, FALSE);
|
||||
new_view = (MidoriView*)midori_view_new_with_item (NULL, view->settings);
|
||||
g_signal_connect (new_view->web_view, "web-view-ready",
|
||||
G_CALLBACK (webkit_web_view_web_view_ready_cb), view);
|
||||
}
|
||||
|
@ -2931,6 +2930,12 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view,
|
|||
JSObjectRef js_window,
|
||||
MidoriView* view)
|
||||
{
|
||||
const gchar* page_uri;
|
||||
|
||||
page_uri = webkit_web_frame_get_uri (web_frame);
|
||||
if (!midori_uri_is_http (page_uri))
|
||||
return;
|
||||
|
||||
if (katze_object_get_boolean (view->settings, "enable-private-browsing"))
|
||||
{
|
||||
/* Mask language, architecture, no plugin list */
|
||||
|
@ -2942,12 +2947,12 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view,
|
|||
"'language': 'en-US',"
|
||||
"'platform': 'Linux i686',"
|
||||
"'cookieEnabled': true,"
|
||||
"'javaEnabled': function () { return true; },"
|
||||
"'mimeTypes': {},"
|
||||
"'plugins': {'refresh': function () { } } };",
|
||||
NULL);
|
||||
g_free (result);
|
||||
}
|
||||
|
||||
g_signal_emit (view, signals[CONTEXT_READY], 0, js_context);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3033,12 +3038,16 @@ midori_view_init (MidoriView* view)
|
|||
view->scrollh = view->scrollv = -2;
|
||||
view->back_forward_set = FALSE;
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 2, 0)
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (view), GTK_ORIENTATION_VERTICAL);
|
||||
#endif
|
||||
|
||||
view->web_view = NULL;
|
||||
/* Adjustments are not created initially, but overwritten later */
|
||||
view->scrolled_window = katze_scrolled_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->scrolled_window),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_container_add (GTK_CONTAINER (view), view->scrolled_window);
|
||||
gtk_box_pack_start (GTK_BOX (view), view->scrolled_window, TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect (view->item, "meta-data-changed",
|
||||
G_CALLBACK (midori_view_item_meta_data_changed), view);
|
||||
|
@ -3195,7 +3204,7 @@ midori_view_focus_in_event (GtkWidget* widget,
|
|||
*
|
||||
* Return value: a new #MidoriView
|
||||
*
|
||||
* Deprecated: 0.2.8: Use midori_view_new_with_title() instead.
|
||||
* Deprecated: 0.2.8: Use midori_view_new_with_item() instead.
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_view_new (KatzeNet* net)
|
||||
|
@ -3240,7 +3249,6 @@ _midori_view_set_settings (MidoriView* view,
|
|||
|
||||
/**
|
||||
* midori_view_new_with_title:
|
||||
* @uri: an URI string, or %NULL
|
||||
* @title: a title, or %NULL
|
||||
* @settings: a #MidoriWebSettings, or %NULL
|
||||
* @append: if %TRUE, the view should be appended
|
||||
|
@ -3251,17 +3259,46 @@ _midori_view_set_settings (MidoriView* view,
|
|||
* Return value: a new #MidoriView
|
||||
*
|
||||
* Since: 0.3.0
|
||||
* Deprecated: 0.4.3
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_view_new_with_title (const gchar* title,
|
||||
MidoriWebSettings* settings,
|
||||
gboolean append)
|
||||
{
|
||||
MidoriView* view = g_object_new (MIDORI_TYPE_VIEW, "title", title, NULL);
|
||||
KatzeItem* item = katze_item_new ();
|
||||
item->name = g_strdup (title);
|
||||
if (append)
|
||||
katze_item_set_meta_integer (item, "append", 1);
|
||||
return midori_view_new_with_item (item, settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_view_new_with_item:
|
||||
* @item: a #KatzeItem, or %NULL
|
||||
* @settings: a #MidoriWebSettings, or %NULL
|
||||
*
|
||||
* Creates a new view from an item that is visible by default.
|
||||
*
|
||||
* Return value: a new #MidoriView
|
||||
*
|
||||
* Since: 0.4.3
|
||||
**/
|
||||
GtkWidget*
|
||||
midori_view_new_with_item (KatzeItem* item,
|
||||
MidoriWebSettings* settings)
|
||||
{
|
||||
MidoriView* view = g_object_new (MIDORI_TYPE_VIEW,
|
||||
"title", item ? item->name : NULL,
|
||||
NULL);
|
||||
if (settings)
|
||||
_midori_view_set_settings (view, settings);
|
||||
if (append)
|
||||
g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1);
|
||||
if (item)
|
||||
{
|
||||
katze_object_assign (view->item, katze_item_copy (item));
|
||||
view->minimized = katze_item_get_meta_string (
|
||||
view->item, "minimized") != NULL;
|
||||
}
|
||||
gtk_widget_show ((GtkWidget*)view);
|
||||
return (GtkWidget*)view;
|
||||
}
|
||||
|
@ -3396,6 +3433,8 @@ midori_view_web_inspector_construct_window (gpointer inspector,
|
|||
width = gdk_screen_get_width (screen) / 1.7;
|
||||
height = gdk_screen_get_height (screen) / 1.7;
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
|
||||
/* 700x100 is the approximate useful minimum dimensions */
|
||||
gtk_widget_set_size_request (inspector_view, 700, 100);
|
||||
}
|
||||
|
||||
/* Attempt to make a gray version of the icon on the fly */
|
||||
|
@ -3657,7 +3696,6 @@ prepare_speed_dial_html (MidoriView* view,
|
|||
MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
|
||||
GKeyFile* key_file;
|
||||
GString* markup = NULL;
|
||||
guint slot = 1;
|
||||
guint slot_count = 1, i, grid_index = 3, slot_size;
|
||||
gchar* speed_dial_head;
|
||||
gchar* file_path;
|
||||
|
@ -3687,7 +3725,7 @@ prepare_speed_dial_html (MidoriView* view,
|
|||
else
|
||||
{
|
||||
g_free (file_path);
|
||||
return g_strdup ("");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
groups = g_key_file_get_groups (key_file, NULL);
|
||||
|
@ -3721,16 +3759,15 @@ prepare_speed_dial_html (MidoriView* view,
|
|||
g_string_append_printf (markup,
|
||||
"<style>.cross { left: -14px }</style>");
|
||||
|
||||
while (slot <= slot_count)
|
||||
for (i = 0; groups[i]; i++)
|
||||
{
|
||||
gchar* dial_entry = g_strdup_printf ("Dial %d", slot);
|
||||
gchar* uri = g_key_file_get_string (key_file, dial_entry, "uri", NULL);
|
||||
|
||||
if (uri && *uri && *uri != '#')
|
||||
gchar* uri = g_key_file_get_string (key_file, groups[i], "uri", NULL);
|
||||
if (uri && strstr (uri, "://"))
|
||||
{
|
||||
gchar* title = g_key_file_get_string (key_file, dial_entry, "title", NULL);
|
||||
gchar* title = g_key_file_get_string (key_file, groups[i], "title", NULL);
|
||||
gchar* thumb_file = sokoke_build_thumbnail_path (uri);
|
||||
gchar* encoded;
|
||||
guint slot = atoi (groups[i] + strlen ("Dial "));
|
||||
|
||||
if (g_access (thumb_file, F_OK) == 0)
|
||||
{
|
||||
|
@ -3742,9 +3779,9 @@ prepare_speed_dial_html (MidoriView* view,
|
|||
}
|
||||
else
|
||||
{
|
||||
encoded = g_strdup ("");
|
||||
encoded = NULL;
|
||||
if (load_missing)
|
||||
midori_view_speed_dial_get_thumb (view, dial_entry, uri);
|
||||
midori_view_speed_dial_get_thumb (view, groups[i], uri);
|
||||
}
|
||||
g_free (thumb_file);
|
||||
|
||||
|
@ -3753,24 +3790,23 @@ prepare_speed_dial_html (MidoriView* view,
|
|||
"<a class=\"cross\" href=\"#\" onclick='clearShortcut(\"s%d\");'></a>"
|
||||
"<a href=\"%s\"><img src=\"data:image/png;base64,%s\"></a>"
|
||||
"</div><div class=\"title\" onclick='renameShortcut(\"s%d\");'>%s</div></div>\n",
|
||||
slot, slot, uri, encoded, slot, title ? title : "");
|
||||
slot, slot, uri, encoded ? encoded : "", slot, title ? title : "");
|
||||
|
||||
g_free (title);
|
||||
g_free (encoded);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append_printf (markup,
|
||||
"<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">"
|
||||
"<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>"
|
||||
"</div><div class=\"title\">%s</div></div>\n",
|
||||
slot, slot, _("Click to add a shortcut"));
|
||||
}
|
||||
else if (strcmp (groups[i], "settings"))
|
||||
g_key_file_remove_group (key_file, groups[i], NULL);
|
||||
|
||||
slot++;
|
||||
g_free (dial_entry);
|
||||
g_free (uri);
|
||||
}
|
||||
g_strfreev (groups);
|
||||
|
||||
g_string_append_printf (markup,
|
||||
"<div class=\"shortcut\" id=\"s%d\"><div class=\"preview new\">"
|
||||
"<a class=\"add\" href=\"#\" onclick='return getAction(\"s%d\");'></a>"
|
||||
"</div><div class=\"title\">%s</div></div>\n",
|
||||
slot_count + 1, slot_count + 1, _("Click to add a shortcut"));
|
||||
g_string_append_printf (markup,
|
||||
"</div>\n</body>\n</html>\n");
|
||||
|
||||
|
@ -3800,12 +3836,9 @@ midori_view_set_uri (MidoriView* view,
|
|||
g_warning ("Calling %s() before adding the view to a browser. This "
|
||||
"breaks extensions that monitor page loading.", G_STRFUNC);
|
||||
|
||||
/* Treat "about:blank" and "" equally, see midori_view_is_blank(). */
|
||||
if (!uri || !strcmp (uri, "about:blank")) uri = "";
|
||||
|
||||
if (g_getenv ("MIDORI_UNARMED") == NULL)
|
||||
{
|
||||
if (!strcmp (uri, ""))
|
||||
if (!uri || !strcmp (uri, "") || !strcmp (uri, "about:blank"))
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
GTimer* timer = NULL;
|
||||
|
@ -3814,14 +3847,14 @@ midori_view_set_uri (MidoriView* view,
|
|||
timer = g_timer_new ();
|
||||
#endif
|
||||
|
||||
katze_assign (view->uri, g_strdup (""));
|
||||
katze_item_set_uri (view->item, "");
|
||||
katze_assign (view->uri, NULL);
|
||||
katze_assign (view->mime_type, g_strdup ("text/html"));
|
||||
|
||||
if (speeddial_markup == NULL)
|
||||
speeddial_markup = prepare_speed_dial_html (view, TRUE);
|
||||
|
||||
midori_view_load_alternate_string (view,
|
||||
speeddial_markup, "about:blank", NULL);
|
||||
speeddial_markup ? speeddial_markup : "", "about:blank", NULL);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (g_getenv ("MIDORI_STARTTIME") != NULL)
|
||||
|
@ -3856,6 +3889,51 @@ midori_view_set_uri (MidoriView* view,
|
|||
title, title, view->uri);
|
||||
g_free (title);
|
||||
}
|
||||
else if (!strcmp (uri, "about:widgets"))
|
||||
{
|
||||
static const gchar* widgets[] = {
|
||||
"<input value=\"demo\"%s>",
|
||||
"<p><input type=\"password\" value=\"demo\"%s>",
|
||||
"<p><input type=\"checkbox\" value=\"demo\"%s> demo",
|
||||
"<p><input type=\"radio\" value=\"demo\"%s> demo",
|
||||
"<p><select%s><option>foo bar</option><option selected>spam eggs</option>",
|
||||
"<p><input type=\"file\"%s>",
|
||||
"<input type=\"button\" value=\"demo\"%s>",
|
||||
"<p><input type=\"email\" value=\"user@localhost.com\"%s>",
|
||||
"<input type=\"url\" value=\"http://www.example.com\"%s>",
|
||||
"<input type=\"tel\" value=\"+1 234 567 890\" pattern=\"^[0+][1-9 /-]*$\"%s>",
|
||||
"<input type=\"number\" min=1 max=9 step=1 value=\"4\"%s>",
|
||||
"<input type=\"range\" min=1 max=9 step=1 value=\"4\"%s>",
|
||||
"<input type=\"date\" min=1990-01-01 max=2010-01-01%s>",
|
||||
"<input type=\"search\" placeholder=\"demo\"%s>",
|
||||
"<textarea%s>Lorem ipsum doloret sit amet...</textarea>",
|
||||
"<input type=\"color\" value=\"#d1eeb9\"%s>",
|
||||
"<progress min=1 max=9 value=4 %s></progress>",
|
||||
"<keygen type=\"rsa\" challenge=\"235ldahlae983dadfar\"%s>",
|
||||
"<p><input type=\"reset\"%s>",
|
||||
"<input type=\"submit\"%s>",
|
||||
};
|
||||
guint i;
|
||||
GString* demo = g_string_new ("<html><head><style>"
|
||||
".fallback, .fallback::-webkit-file-upload-button { "
|
||||
"-webkit-appearance: none !important }"
|
||||
".column { display:inline-block; vertical-align:top;"
|
||||
"width:25%;margin-right:1% }</style><title>");
|
||||
g_string_append_printf (demo,
|
||||
"%s</title></head><body><h1>%s</h1>", uri, uri);
|
||||
g_string_append (demo, "<div class=\"column\"");
|
||||
for (i = 0; i < G_N_ELEMENTS (widgets); i++)
|
||||
g_string_append_printf (demo, widgets[i], "");
|
||||
g_string_append (demo, "</div><div class=\"column\"");
|
||||
for (i = 0; i < G_N_ELEMENTS (widgets); i++)
|
||||
g_string_append_printf (demo, widgets[i], " disabled");
|
||||
g_string_append (demo, "</div><div class=\"column\"");
|
||||
for (i = 0; i < G_N_ELEMENTS (widgets); i++)
|
||||
g_string_append_printf (demo, widgets[i], " class=\"fallback\"");
|
||||
g_string_append (demo, "</div>");
|
||||
katze_assign (view->uri, g_strdup (uri));
|
||||
data = g_string_free (demo, FALSE);
|
||||
}
|
||||
else if (!strcmp (uri, "about:") || !strcmp (uri, "about:version"))
|
||||
{
|
||||
gchar* arguments = g_strjoinv (" ", sokoke_get_argv (NULL));
|
||||
|
@ -3882,6 +3960,7 @@ midori_view_set_uri (MidoriView* view,
|
|||
"<tr><td>GTK+</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
|
||||
"<tr><td>Glib</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
|
||||
"<tr><td>libsoup</td><td>%s</td></tr>"
|
||||
"<tr><td>cairo</td><td>%s (%s)</td></tr>"
|
||||
"<tr><td>libnotify</td><td>%s</td></tr>"
|
||||
"<tr><td>libunique</td><td>%s</td></tr>"
|
||||
"<tr><td>libhildon</td><td>%s</td></tr>"
|
||||
|
@ -3903,6 +3982,7 @@ midori_view_set_uri (MidoriView* view,
|
|||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
|
||||
glib_major_version, glib_minor_version, glib_micro_version,
|
||||
LIBSOUP_VERSION,
|
||||
CAIRO_VERSION_STRING, cairo_version_string (),
|
||||
LIBNOTIFY_VERSION,
|
||||
UNIQUE_VERSION,
|
||||
HAVE_HILDON ? "Yes" : "No",
|
||||
|
@ -3927,20 +4007,22 @@ midori_view_set_uri (MidoriView* view,
|
|||
webkit_web_view_load_html_string (
|
||||
WEBKIT_WEB_VIEW (view->web_view), data, view->uri);
|
||||
g_free (data);
|
||||
katze_item_set_uri (view->item, uri);
|
||||
if (g_strcmp0 (view->item->uri, view->uri))
|
||||
katze_item_set_uri (view->item, view->uri);
|
||||
g_object_notify (G_OBJECT (view), "uri");
|
||||
return;
|
||||
}
|
||||
else if (g_str_has_prefix (uri, "pause:"))
|
||||
else if (katze_item_get_meta_boolean (view->item, "delay"))
|
||||
{
|
||||
katze_assign (view->uri, g_strdup (&uri[6]));
|
||||
katze_assign (view->uri, g_strdup (uri));
|
||||
katze_item_set_meta_integer (view->item, "delay", -1);
|
||||
midori_view_display_error (
|
||||
view, view->uri, view->title ? view->title : view->uri,
|
||||
_("Page loading delayed"),
|
||||
_("Loading delayed either due to a recent crash or startup preferences."),
|
||||
_("Load Page"),
|
||||
NULL);
|
||||
katze_item_set_uri (view->item, uri);
|
||||
if (g_strcmp0 (view->item->uri, uri))
|
||||
katze_item_set_uri (view->item, uri);
|
||||
g_object_notify (G_OBJECT (view), "uri");
|
||||
}
|
||||
else if (g_str_has_prefix (uri, "javascript:"))
|
||||
|
@ -3963,8 +4045,8 @@ midori_view_set_uri (MidoriView* view,
|
|||
else
|
||||
{
|
||||
katze_assign (view->uri, midori_uri_format_for_display (uri));
|
||||
katze_item_set_uri (view->item, uri);
|
||||
katze_item_set_meta_integer (view->item, "delay", -1);
|
||||
if (g_strcmp0 (view->item->uri, view->uri))
|
||||
katze_item_set_uri (view->item, view->uri);
|
||||
g_object_notify (G_OBJECT (view), "uri");
|
||||
webkit_web_view_open (WEBKIT_WEB_VIEW (view->web_view), uri);
|
||||
}
|
||||
|
@ -4064,8 +4146,6 @@ midori_view_get_display_uri (MidoriView* view)
|
|||
* as a title. Most of the time this will be the title
|
||||
* or the current URI.
|
||||
*
|
||||
* An empty page is represented as "about:blank".
|
||||
*
|
||||
* You can assume that the string is not %NULL.
|
||||
*
|
||||
* Return value: a title string
|
||||
|
@ -4266,11 +4346,9 @@ midori_view_tab_label_menu_duplicate_tab_cb (GtkWidget* menuitem,
|
|||
MidoriView* view)
|
||||
{
|
||||
MidoriNewView where = MIDORI_NEW_VIEW_TAB;
|
||||
GtkWidget* new_view = midori_view_new_with_title (
|
||||
NULL, view->settings, FALSE);
|
||||
const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view));
|
||||
GtkWidget* new_view = midori_view_new_with_item (view->item, view->settings);
|
||||
g_signal_emit (view, signals[NEW_VIEW], 0, new_view, where, TRUE);
|
||||
midori_view_set_uri (MIDORI_VIEW (new_view), uri);
|
||||
midori_view_set_uri (MIDORI_VIEW (new_view), view->uri);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4805,6 +4883,43 @@ midori_view_can_view_source (MidoriView* view)
|
|||
return is_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* midori_view_can_save:
|
||||
* @view: a #MidoriView
|
||||
*
|
||||
* Determines if the view can be saved to disk.
|
||||
*
|
||||
* Return value: %TRUE if the website or image can be saved
|
||||
*
|
||||
* Since: 0.4.3
|
||||
**/
|
||||
gboolean
|
||||
midori_view_can_save (MidoriView* view)
|
||||
{
|
||||
GtkWidget* web_view;
|
||||
WebKitWebDataSource *data_source;
|
||||
WebKitWebFrame *frame;
|
||||
const GString *data;
|
||||
|
||||
g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE);
|
||||
|
||||
if (midori_view_is_blank (view) || view->mime_type == NULL)
|
||||
return FALSE;
|
||||
|
||||
web_view = midori_view_get_web_view (view);
|
||||
if (webkit_web_view_get_view_source_mode (WEBKIT_WEB_VIEW (web_view)))
|
||||
return FALSE;
|
||||
|
||||
frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view));
|
||||
data_source = webkit_web_frame_get_data_source (frame);
|
||||
data = webkit_web_data_source_get_data (data_source);
|
||||
|
||||
if (data != NULL)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#define can_do(what) \
|
||||
gboolean \
|
||||
midori_view_can_##what (MidoriView* view) \
|
||||
|
@ -4831,7 +4946,7 @@ midori_view_reload (MidoriView* view,
|
|||
{
|
||||
g_return_if_fail (MIDORI_IS_VIEW (view));
|
||||
|
||||
if (!(view->uri && *view->uri && strncmp (view->uri, "about:", 6)))
|
||||
if (midori_uri_is_blank (view->uri))
|
||||
{
|
||||
gchar* uri = g_strdup (view->uri);
|
||||
midori_view_set_uri (view, uri);
|
||||
|
@ -5201,22 +5316,23 @@ midori_view_web_view_get_snapshot (GtkWidget* web_view,
|
|||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkWindow* window;
|
||||
GtkAllocation allocation;
|
||||
gboolean fast;
|
||||
gint x, y, w, h;
|
||||
GdkRectangle rect;
|
||||
#if !GTK_CHECK_VERSION (3, 0, 0)
|
||||
GdkWindow* window;
|
||||
GdkPixmap* pixmap;
|
||||
GdkEvent event;
|
||||
gboolean result;
|
||||
GdkColormap* colormap;
|
||||
#else
|
||||
cairo_surface_t* surface;
|
||||
cairo_t* cr;
|
||||
#endif
|
||||
GdkPixbuf* pixbuf;
|
||||
|
||||
g_return_val_if_fail (WEBKIT_IS_WEB_VIEW (web_view), NULL);
|
||||
window = gtk_widget_get_window (web_view);
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
gtk_widget_get_allocation (web_view, &allocation);
|
||||
x = allocation.x;
|
||||
|
@ -5238,9 +5354,14 @@ midori_view_web_view_get_snapshot (GtkWidget* web_view,
|
|||
}
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
cairo_t* cr = gdk_cairo_create (window);
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
|
||||
allocation.width, allocation.height);
|
||||
cr = cairo_create (surface);
|
||||
cairo_rectangle (cr, x, y, width, height);
|
||||
cairo_clip (cr);
|
||||
gtk_widget_draw (web_view, cr);
|
||||
pixbuf = NULL; /* TODO */
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, x, y, width, height);
|
||||
cairo_surface_destroy (surface);
|
||||
cairo_destroy (cr);
|
||||
#else
|
||||
rect.x = x;
|
||||
|
@ -5248,6 +5369,9 @@ midori_view_web_view_get_snapshot (GtkWidget* web_view,
|
|||
rect.width = w;
|
||||
rect.height = h;
|
||||
|
||||
window = gtk_widget_get_window (web_view);
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
pixmap = gdk_pixmap_new (window, w, h, gdk_drawable_get_depth (window));
|
||||
event.expose.type = GDK_EXPOSE;
|
||||
event.expose.window = pixmap;
|
||||
|
|
|
@ -78,6 +78,10 @@ midori_view_new_with_title (const gchar* title,
|
|||
MidoriWebSettings* settings,
|
||||
gboolean append);
|
||||
|
||||
GtkWidget*
|
||||
midori_view_new_with_item (KatzeItem* item,
|
||||
MidoriWebSettings* settings);
|
||||
|
||||
void
|
||||
midori_view_set_settings (MidoriView* view,
|
||||
MidoriWebSettings* settings);
|
||||
|
@ -190,6 +194,9 @@ midori_view_print (MidoriView* view);
|
|||
gboolean
|
||||
midori_view_can_view_source (MidoriView* view);
|
||||
|
||||
gboolean
|
||||
midori_view_can_save (MidoriView* view);
|
||||
|
||||
gboolean
|
||||
midori_view_can_find (MidoriView* view);
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ struct _MidoriWebSettings
|
|||
gint last_web_search;
|
||||
gint maximum_cookie_age;
|
||||
gint maximum_history_age;
|
||||
gint search_width;
|
||||
|
||||
gchar* toolbar_items;
|
||||
gchar* homepage;
|
||||
|
@ -176,6 +177,8 @@ enum
|
|||
PROP_STRIP_REFERER,
|
||||
PROP_ENFORCE_FONT_FAMILY,
|
||||
PROP_USER_STYLESHEET_URI,
|
||||
|
||||
PROP_SEARCH_WIDTH,
|
||||
};
|
||||
|
||||
GType
|
||||
|
@ -366,7 +369,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
_("Last window width"),
|
||||
_("The last saved window width"),
|
||||
0, G_MAXINT, 0,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_LAST_WINDOW_HEIGHT,
|
||||
|
@ -375,7 +378,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
_("Last window height"),
|
||||
_("The last saved window height"),
|
||||
0, G_MAXINT, 0,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
/**
|
||||
* MidoriWebSettings:last-window-state:
|
||||
|
@ -392,7 +395,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
"The last saved window state",
|
||||
MIDORI_TYPE_WINDOW_STATE,
|
||||
MIDORI_WINDOW_NORMAL,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_LAST_PANEL_POSITION,
|
||||
|
@ -401,7 +404,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
_("Last panel position"),
|
||||
_("The last saved panel position"),
|
||||
0, G_MAXINT, 0,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_LAST_PANEL_PAGE,
|
||||
|
@ -411,7 +414,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
_("Last panel page"),
|
||||
_("The last saved panel page"),
|
||||
0, G_MAXINT, 0,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_LAST_WEB_SEARCH,
|
||||
|
@ -1076,7 +1079,23 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
|||
"User stylesheet URI",
|
||||
"Load stylesheets from a local URI",
|
||||
NULL,
|
||||
flags));
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
|
||||
/**
|
||||
* MidoriWebSettings:search-entry-width:
|
||||
*
|
||||
* Search action width in pixels
|
||||
*
|
||||
* Since: 0.4.3
|
||||
**/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_SEARCH_WIDTH,
|
||||
g_param_spec_int (
|
||||
"search-width",
|
||||
"Search action width",
|
||||
"Search action width in pixels",
|
||||
10, G_MAXINT, 200,
|
||||
flags | MIDORI_PARAM_DELAY_SAVING));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1126,6 +1145,12 @@ midori_web_settings_init (MidoriWebSettings* web_settings)
|
|||
web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL;
|
||||
web_settings->user_stylesheets = NULL;
|
||||
|
||||
#if WEBKIT_CHECK_VERSION (1, 2, 6) && !WEBKIT_CHECK_VERSION (1, 2, 8)
|
||||
/* Shadows are very slow with WebKitGTK+ 1.2.7 */
|
||||
midori_web_settings_add_style (web_settings, "box-shadow-workaround",
|
||||
"* { -webkit-box-shadow: none !important; }");
|
||||
#endif
|
||||
|
||||
g_signal_connect (web_settings, "notify::default-encoding",
|
||||
G_CALLBACK (notify_default_encoding_cb), NULL);
|
||||
g_signal_connect (web_settings, "notify::default-font-family",
|
||||
|
@ -1532,10 +1557,15 @@ midori_web_settings_set_property (GObject* object,
|
|||
{
|
||||
gchar* font_family = katze_object_get_string (web_settings,
|
||||
"default-font-family");
|
||||
gchar* css = g_strdup_printf ("* { font-family: %s !important; }",
|
||||
font_family);
|
||||
gchar* monospace = katze_object_get_string (web_settings,
|
||||
"monospace-font-family");
|
||||
gchar* css = g_strdup_printf ("body * { font-family: %s !important; } \
|
||||
code, code *, pre, pre *, blockquote, blockquote *, \
|
||||
input, textarea { font-family: %s !important; }",
|
||||
font_family, monospace);
|
||||
midori_web_settings_add_style (web_settings, "enforce-font-family", css);
|
||||
g_free (font_family);
|
||||
g_free (monospace);
|
||||
g_free (css);
|
||||
}
|
||||
else
|
||||
|
@ -1565,6 +1595,9 @@ midori_web_settings_set_property (GObject* object,
|
|||
midori_web_settings_process_stylesheets (web_settings, new_len - old_len);
|
||||
}
|
||||
break;
|
||||
case PROP_SEARCH_WIDTH:
|
||||
web_settings->search_width = g_value_get_int (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -1678,9 +1711,9 @@ midori_web_settings_get_property (GObject* object,
|
|||
GdkScreen* screen = gdk_screen_get_default ();
|
||||
GtkSettings* settings = gtk_settings_get_for_screen (screen);
|
||||
gchar* theme = katze_object_get_string (settings, "gtk-theme-name");
|
||||
gchar* folder = gtk_rc_get_theme_dir ();
|
||||
gchar* filename = g_build_filename (folder, theme, "index.theme", NULL);
|
||||
g_free (folder);
|
||||
gchar* theme_file = g_build_filename ("themes", theme, "index.theme", NULL);
|
||||
gchar* filename = sokoke_find_data_filename (theme_file, FALSE);
|
||||
g_free (theme_file);
|
||||
web_settings->close_buttons_left = 1;
|
||||
if (g_access (filename, F_OK) != 0)
|
||||
katze_assign (filename,
|
||||
|
@ -1830,6 +1863,9 @@ midori_web_settings_get_property (GObject* object,
|
|||
g_value_take_string (value, katze_object_get_string (web_settings,
|
||||
"WebKitWebSettings::user-stylesheet-uri"));
|
||||
break;
|
||||
case PROP_SEARCH_WIDTH:
|
||||
g_value_set_int (value, web_settings->search_width);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
|
|
@ -34,6 +34,8 @@ G_BEGIN_DECLS
|
|||
typedef struct _MidoriWebSettings MidoriWebSettings;
|
||||
typedef struct _MidoriWebSettingsClass MidoriWebSettingsClass;
|
||||
|
||||
#define MIDORI_PARAM_DELAY_SAVING (1 << 8)
|
||||
|
||||
enum
|
||||
{
|
||||
MIDORI_CLEAR_NONE = 0,
|
||||
|
|
|
@ -194,7 +194,11 @@ sokoke_show_uri_with_mime_type (GdkScreen* screen,
|
|||
g_free (content_type);
|
||||
files = g_list_prepend (NULL, file);
|
||||
#if GTK_CHECK_VERSION (2, 14, 0)
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
|
||||
#else
|
||||
context = gdk_app_launch_context_new ();
|
||||
#endif
|
||||
gdk_app_launch_context_set_screen (context, screen);
|
||||
gdk_app_launch_context_set_timestamp (context, timestamp);
|
||||
#else
|
||||
|
@ -703,23 +707,6 @@ sokoke_magic_uri (const gchar* uri)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
sokoke_combo_box_add_strings (GtkComboBox* combobox,
|
||||
const gchar* label_first, ...)
|
||||
{
|
||||
const gchar* label;
|
||||
|
||||
/* Add a number of strings to a combobox, terminated with NULL
|
||||
This works only for text comboboxes */
|
||||
va_list args;
|
||||
va_start (args, label_first);
|
||||
|
||||
for (label = label_first; label; label = va_arg (args, const gchar*))
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), label);
|
||||
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
void sokoke_widget_set_visible (GtkWidget* widget, gboolean visible)
|
||||
{
|
||||
/* Show or hide the widget */
|
||||
|
@ -1450,8 +1437,7 @@ sokoke_prefetch_uri (MidoriWebSettings* settings,
|
|||
if (settings && !katze_object_get_boolean (settings, "enable-dns-prefetching"))
|
||||
return FALSE;
|
||||
|
||||
if (!(hostname = midori_uri_parse (uri, NULL))
|
||||
|| !strcmp (hostname, uri)
|
||||
if (!(hostname = midori_uri_parse_hostname (uri, NULL))
|
||||
|| g_hostname_is_ip_address (hostname)
|
||||
|| !midori_uri_is_http (uri))
|
||||
{
|
||||
|
@ -1715,7 +1701,7 @@ midori_download_prepare_tooltip_text (WebKitDownload* download)
|
|||
|
||||
if (time_estimated > 0)
|
||||
{
|
||||
gchar* eta;
|
||||
gchar* eta = NULL;
|
||||
if (hours_left > 0)
|
||||
eta = g_strdup_printf ("%s, %s", hours_str, minutes_str);
|
||||
else if (minutes_left >= 10)
|
||||
|
@ -1724,11 +1710,12 @@ midori_download_prepare_tooltip_text (WebKitDownload* download)
|
|||
eta = g_strdup_printf ("%s, %s", minutes_str, seconds_str);
|
||||
else if (seconds_left > 0)
|
||||
eta = g_strdup_printf ("%s", seconds_str);
|
||||
else
|
||||
eta = g_strdup ("");
|
||||
/* i18n: Download tooltip (estimated time) : - 1 hour, 5 minutes remaning */
|
||||
g_string_append_printf (tooltip, _(" - %s remaining"), eta);
|
||||
g_free (eta);
|
||||
if (eta != NULL)
|
||||
{
|
||||
/* i18n: Download tooltip (estimated time) : - 1 hour, 5 minutes remaning */
|
||||
g_string_append_printf (tooltip, _(" - %s remaining"), eta);
|
||||
g_free (eta);
|
||||
}
|
||||
}
|
||||
|
||||
g_free (hours_str);
|
||||
|
|
|
@ -55,11 +55,6 @@ sokoke_external_uri (const gchar* uri);
|
|||
gchar*
|
||||
sokoke_magic_uri (const gchar* uri);
|
||||
|
||||
void
|
||||
sokoke_combo_box_add_strings (GtkComboBox* combobox,
|
||||
const gchar* label_first,
|
||||
...);
|
||||
|
||||
void
|
||||
sokoke_widget_set_visible (GtkWidget* widget,
|
||||
gboolean visible);
|
||||
|
|
|
@ -124,19 +124,13 @@ midori_bookmarks_export_array_db (sqlite3* db,
|
|||
KatzeArray* array,
|
||||
const gchar* folder)
|
||||
{
|
||||
gchar* sqlcmd;
|
||||
KatzeArray* root_array;
|
||||
KatzeArray* subarray;
|
||||
KatzeItem* item;
|
||||
GList* list;
|
||||
|
||||
if (!db)
|
||||
if (!(root_array = midori_array_query (array, "*", "folder='%q'", folder)))
|
||||
return;
|
||||
|
||||
sqlcmd = g_strdup_printf ("SELECT * FROM bookmarks where folder='%s'", folder);
|
||||
root_array = katze_array_from_sqlite (db, sqlcmd);
|
||||
g_free (sqlcmd);
|
||||
|
||||
KATZE_ARRAY_FOREACH_ITEM_L (item, root_array, list)
|
||||
{
|
||||
if (KATZE_ITEM_IS_FOLDER (item))
|
||||
|
@ -177,40 +171,15 @@ midori_bookmarks_read_from_db (MidoriBookmarks* bookmarks,
|
|||
const gchar* folder,
|
||||
const gchar* keyword)
|
||||
{
|
||||
sqlite3* db;
|
||||
sqlite3_stmt* statement;
|
||||
gint result;
|
||||
const gchar* sqlcmd;
|
||||
|
||||
db = g_object_get_data (G_OBJECT (bookmarks->array), "db");
|
||||
|
||||
if (!db)
|
||||
return katze_array_new (KATZE_TYPE_ITEM);
|
||||
KatzeArray* array;
|
||||
|
||||
if (keyword && *keyword)
|
||||
{
|
||||
gchar* filterstr;
|
||||
sqlcmd = "SELECT uri, title, desc, app, toolbar, folder from bookmarks where "
|
||||
" title like ? ORDER BY uri DESC";
|
||||
result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL);
|
||||
filterstr = g_strdup_printf ("%%%s%%", keyword);
|
||||
sqlite3_bind_text (statement, 1, g_strdup (filterstr), -1, g_free);
|
||||
g_free (filterstr);
|
||||
}
|
||||
array = midori_array_query (bookmarks->array,
|
||||
"uri, title, desc, app, toolbar, folder", "title LIKE '%%%q%%'", keyword);
|
||||
else
|
||||
{
|
||||
if (!folder)
|
||||
folder = "";
|
||||
sqlcmd = "SELECT uri, title, desc, app, toolbar, folder from bookmarks where "
|
||||
" folder = ? ORDER BY title DESC";
|
||||
result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL);
|
||||
sqlite3_bind_text (statement, 1, g_strdup (folder), -1, g_free);
|
||||
}
|
||||
|
||||
if (result != SQLITE_OK)
|
||||
return katze_array_new (KATZE_TYPE_ITEM);
|
||||
|
||||
return katze_array_from_statement (statement);
|
||||
array = midori_array_query (bookmarks->array,
|
||||
"uri, title, desc, app, toolbar, folder", "folder = '%q'", folder);
|
||||
return array ? array : katze_array_new (KATZE_TYPE_ITEM);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -247,9 +216,9 @@ midori_bookmarks_insert_item_db (sqlite3* db,
|
|||
gchar* sqlcmd;
|
||||
char* errmsg = NULL;
|
||||
KatzeItem* old_parent;
|
||||
gchar* parent;
|
||||
gchar* uri;
|
||||
gchar* desc;
|
||||
const gchar* parent;
|
||||
const gchar* uri = NULL;
|
||||
const gchar* desc = NULL;
|
||||
|
||||
/* Bookmarks must have a name, import may produce invalid items */
|
||||
g_return_if_fail (katze_item_get_name (item));
|
||||
|
@ -258,30 +227,26 @@ midori_bookmarks_insert_item_db (sqlite3* db,
|
|||
return;
|
||||
|
||||
if (KATZE_ITEM_IS_BOOKMARK (item))
|
||||
uri = g_strdup (katze_item_get_uri (item));
|
||||
else
|
||||
uri = g_strdup ("");
|
||||
uri = katze_item_get_uri (item);
|
||||
|
||||
if (katze_item_get_text (item))
|
||||
desc = g_strdup (katze_item_get_text (item));
|
||||
else
|
||||
desc = g_strdup ("");
|
||||
desc = katze_item_get_text (item);
|
||||
|
||||
/* Use folder, otherwise fallback to parent folder */
|
||||
old_parent = katze_item_get_parent (item);
|
||||
if (folder && *folder)
|
||||
parent = g_strdup (folder);
|
||||
parent = folder;
|
||||
else if (old_parent && katze_item_get_name (old_parent))
|
||||
parent = g_strdup (katze_item_get_name (old_parent));
|
||||
parent = katze_item_get_name (old_parent);
|
||||
else
|
||||
parent = g_strdup ("");
|
||||
parent = "";
|
||||
|
||||
sqlcmd = sqlite3_mprintf (
|
||||
"INSERT into bookmarks (uri, title, desc, folder, toolbar, app) values"
|
||||
" ('%q', '%q', '%q', '%q', %d, %d)",
|
||||
uri,
|
||||
uri ? uri : "",
|
||||
katze_item_get_name (item),
|
||||
desc,
|
||||
desc ? desc : "",
|
||||
parent,
|
||||
katze_item_get_meta_boolean (item, "toolbar"),
|
||||
katze_item_get_meta_boolean (item, "app"));
|
||||
|
@ -292,9 +257,6 @@ midori_bookmarks_insert_item_db (sqlite3* db,
|
|||
sqlite3_free (errmsg);
|
||||
}
|
||||
|
||||
g_free (uri);
|
||||
g_free (parent);
|
||||
g_free (desc);
|
||||
sqlite3_free (sqlcmd);
|
||||
}
|
||||
|
||||
|
@ -346,30 +308,31 @@ midori_bookmarks_row_changed_cb (GtkTreeModel* model,
|
|||
{
|
||||
KatzeItem* item;
|
||||
GtkTreeIter parent;
|
||||
gchar* parent_name;
|
||||
KatzeItem* new_parent = NULL;
|
||||
const gchar* parent_name;
|
||||
|
||||
gtk_tree_model_get (model, iter, 0, &item, -1);
|
||||
|
||||
if (gtk_tree_model_iter_parent (model, &parent, iter))
|
||||
{
|
||||
KatzeItem* new_parent;
|
||||
|
||||
gtk_tree_model_get (model, &parent, 0, &new_parent, -1);
|
||||
|
||||
/* Bookmarks must not be moved into non-folder items */
|
||||
if (!KATZE_ITEM_IS_FOLDER (new_parent))
|
||||
parent_name = g_strdup ("");
|
||||
parent_name = "";
|
||||
else
|
||||
parent_name = g_strdup (katze_item_get_name (new_parent));
|
||||
|
||||
g_object_unref (new_parent);
|
||||
parent_name = katze_item_get_name (new_parent);
|
||||
}
|
||||
else
|
||||
parent_name = g_strdup ("");
|
||||
parent_name = "";
|
||||
|
||||
katze_array_remove_item (bookmarks->array, item);
|
||||
katze_item_set_meta_string (item, "folder", parent_name);
|
||||
katze_array_add_item (bookmarks->array, item);
|
||||
|
||||
g_object_unref (item);
|
||||
if (new_parent)
|
||||
g_object_unref (new_parent);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
1346
po/zh_CN.po
1346
po/zh_CN.po
File diff suppressed because it is too large
Load diff
1836
po/zh_TW.po
1836
po/zh_TW.po
File diff suppressed because it is too large
Load diff
|
@ -168,6 +168,8 @@ extension_activate (gconstpointer data)
|
|||
{
|
||||
MidoriApp* app = midori_app_new ();
|
||||
MidoriExtension* extension = MIDORI_EXTENSION (data);
|
||||
if (extension == NULL)
|
||||
return;
|
||||
g_object_set (app, "settings", midori_web_settings_new (), NULL);
|
||||
g_signal_emit_by_name (extension, "activate", app);
|
||||
midori_extension_deactivate (extension);
|
||||
|
|
|
@ -14,20 +14,6 @@
|
|||
|
||||
#define SM "http://www.searchmash.com/search/"
|
||||
|
||||
static void
|
||||
sokoke_assert_str_equal (const gchar* input,
|
||||
const gchar* result,
|
||||
const gchar* expected)
|
||||
{
|
||||
if (g_strcmp0 (result, expected))
|
||||
{
|
||||
g_error ("Input: %s\nExpected: %s\nResult: %s",
|
||||
input ? input : "NULL",
|
||||
expected ? expected : "NULL",
|
||||
result ? result : "NULL");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
test_input (const gchar* input,
|
||||
const gchar* expected)
|
||||
|
@ -76,13 +62,16 @@ test_input (const gchar* input,
|
|||
|
||||
g_free (keywords);
|
||||
}
|
||||
sokoke_assert_str_equal (input, uri, expected);
|
||||
katze_assert_str_equal (input, uri, expected);
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
static void
|
||||
magic_uri_uri (void)
|
||||
{
|
||||
const gchar* uri;
|
||||
gchar* path;
|
||||
|
||||
test_input ("ftp://ftp.mozilla.org", "ftp://ftp.mozilla.org");
|
||||
test_input ("ftp://ftp.mozilla.org/pub", "ftp://ftp.mozilla.org/pub");
|
||||
test_input ("http://www.example.com", "http://www.example.com");
|
||||
|
@ -91,6 +80,8 @@ magic_uri_uri (void)
|
|||
test_input ("example.com", "http://example.com");
|
||||
test_input ("www.google..com", "http://www.google..com");
|
||||
test_input ("/home/user/midori.html", "file:///home/user/midori.html");
|
||||
test_input ("http://www.google.com/search?q=query test",
|
||||
"http://www.google.com/search?q=query test");
|
||||
if (sokoke_resolve_hostname ("localhost"))
|
||||
{
|
||||
test_input ("localhost", "http://localhost");
|
||||
|
@ -105,6 +96,20 @@ magic_uri_uri (void)
|
|||
test_input ("foo:123@bar.baz", "http://foo:123@bar.baz");
|
||||
/* test_input ("foo:f1o2o3@bar.baz", "http://f1o2o3:foo@bar.baz"); */
|
||||
/* test_input ("foo:foo@bar.baz", "http://foo:foo@bar.baz"); */
|
||||
|
||||
uri = "http://bugs.launchpad.net/midori";
|
||||
g_assert_cmpstr ("bugs.launchpad.net", ==, midori_uri_parse_hostname (uri, NULL));
|
||||
uri = "https://bugs.launchpad.net/midori";
|
||||
g_assert_cmpstr ("bugs.launchpad.net", ==, midori_uri_parse_hostname (uri, NULL));
|
||||
g_assert_cmpstr ("bugs.launchpad.net", ==, midori_uri_parse_hostname (uri, &path));
|
||||
g_assert_cmpstr ("/midori", ==, path);
|
||||
uri = "http://айкидо.ru/users/kotyata";
|
||||
g_assert_cmpstr ("айкидо.ru", ==, midori_uri_parse_hostname (uri, &path));
|
||||
g_assert_cmpstr ("/users/kotyata", ==, path);
|
||||
uri = "invalid:/uri.like/thing";
|
||||
g_assert_cmpstr (NULL, ==, midori_uri_parse_hostname (uri, NULL));
|
||||
uri = "invalid-uri.like:thing";
|
||||
g_assert_cmpstr (NULL, ==, midori_uri_parse_hostname (uri, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -132,7 +137,7 @@ magic_uri_idn (void)
|
|||
{
|
||||
gchar* result = midori_uri_to_ascii (items[i].before);
|
||||
const gchar* after = items[i].after ? items[i].after : items[i].before;
|
||||
sokoke_assert_str_equal (items[i].before, result, after);
|
||||
katze_assert_str_equal (items[i].before, result, after);
|
||||
g_free (result);
|
||||
}
|
||||
|
||||
|
@ -250,7 +255,7 @@ magic_uri_format (void)
|
|||
{
|
||||
gchar* result = midori_uri_format_for_display (items[i].before);
|
||||
const gchar* after = items[i].after ? items[i].after : items[i].before;
|
||||
sokoke_assert_str_equal (items[i].before, result, after);
|
||||
katze_assert_str_equal (items[i].before, result, after);
|
||||
g_free (result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ void
|
|||
midori_findbar_invoke (MidoriFindbar* findbar)
|
||||
{
|
||||
if (gtk_widget_get_visible (GTK_WIDGET (findbar)))
|
||||
midori_findbar_done (findbar);
|
||||
gtk_widget_grab_focus (GTK_WIDGET (findbar->find_text));
|
||||
else
|
||||
{
|
||||
MidoriBrowser* browser = midori_browser_get_for_widget (findbar->find_text);
|
||||
|
|
|
@ -21,6 +21,12 @@ then
|
|||
UPDATE=yes
|
||||
fi
|
||||
|
||||
which xmlgrep 2> /dev/null && HAVE_XMLGREP=1 || HAVE_XMLGREP=0
|
||||
if [[ "$HAVE_XMLGREP" == "0" ]]; then
|
||||
echo -e "\nPlease install xmlclitools http://robur.slu.se/jensl/xmlclitools\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
# create download and build directory
|
||||
mkdir -p $DOWNLOAD_PATH
|
||||
mkdir -p $BUILD_PATH
|
||||
|
|
5
wscript
5
wscript
|
@ -29,7 +29,7 @@ from Configure import find_program_impl
|
|||
|
||||
major = 0
|
||||
minor = 4
|
||||
micro = 2
|
||||
micro = 3
|
||||
|
||||
APPNAME = 'midori'
|
||||
VERSION = VERSION_FULL = str (major) + '.' + str (minor) + '.' + str (micro)
|
||||
|
@ -230,7 +230,7 @@ def configure (conf):
|
|||
'Pass --disable-gtk3 to build without GTK+3.')
|
||||
sys.exit (1)
|
||||
if check_version (conf.check_cfg (modversion='webkitgtk-3.0'), 1, 5, 1):
|
||||
check_pkg ('javascriptcoregtk-1.0', '1.5.1', args=args)
|
||||
check_pkg ('javascriptcoregtk-3.0', '1.5.1', args=args)
|
||||
conf.env.append_value ('VALAFLAGS', '-D HAVE_GTK3')
|
||||
else:
|
||||
check_pkg ('gtk+-2.0', '2.10.0', var='GTK')
|
||||
|
@ -243,6 +243,7 @@ def configure (conf):
|
|||
conf.define ('HAVE_LIBSOUP_2_27_90', 1)
|
||||
check_pkg ('libsoup-2.4', '2.29.3', False, var='LIBSOUP_2_29_3')
|
||||
check_pkg ('libsoup-2.4', '2.29.91', False, var='LIBSOUP_2_29_91')
|
||||
check_pkg ('libsoup-2.4', '2.37.1', False, var='LIBSOUP_2_37_1')
|
||||
conf.define ('LIBSOUP_VERSION', conf.check_cfg (modversion='libsoup-2.4'))
|
||||
check_pkg ('libxml-2.0', '2.6')
|
||||
check_pkg ('sqlite3', '3.0', True, var='SQLITE')
|
||||
|
|
Loading…
Reference in a new issue