Reimplement missing preferences
Implement font properties, web features, Middle click opens selection, Open tabs in the background and proxy. While we are at it, remove Tab label size.
This commit is contained in:
parent
fb320cc0b6
commit
95111a054c
3 changed files with 286 additions and 82 deletions
|
@ -631,10 +631,12 @@ midori_view_console_message_cb (GtkWidget* view,
|
||||||
static void
|
static void
|
||||||
midori_view_new_tab_cb (GtkWidget* view,
|
midori_view_new_tab_cb (GtkWidget* view,
|
||||||
const gchar* uri,
|
const gchar* uri,
|
||||||
|
gboolean background,
|
||||||
MidoriBrowser* browser)
|
MidoriBrowser* browser)
|
||||||
{
|
{
|
||||||
gint n = midori_browser_add_uri (browser, uri);
|
gint n = midori_browser_add_uri (browser, uri);
|
||||||
_midori_browser_set_current_page_smartly (browser, n);
|
if (!background)
|
||||||
|
midori_browser_set_current_page (browser, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3289,7 +3291,6 @@ _midori_browser_update_settings (MidoriBrowser* browser)
|
||||||
MidoriToolbarStyle toolbar_style;
|
MidoriToolbarStyle toolbar_style;
|
||||||
gint last_web_search;
|
gint last_web_search;
|
||||||
gchar* last_pageholder_uri;
|
gchar* last_pageholder_uri;
|
||||||
gint tab_label_size;
|
|
||||||
gboolean close_buttons_on_tabs;
|
gboolean close_buttons_on_tabs;
|
||||||
|
|
||||||
g_object_get (browser->settings,
|
g_object_get (browser->settings,
|
||||||
|
@ -3309,7 +3310,6 @@ _midori_browser_update_settings (MidoriBrowser* browser)
|
||||||
"toolbar-style", &toolbar_style,
|
"toolbar-style", &toolbar_style,
|
||||||
"last-web-search", &last_web_search,
|
"last-web-search", &last_web_search,
|
||||||
"last-pageholder-uri", &last_pageholder_uri,
|
"last-pageholder-uri", &last_pageholder_uri,
|
||||||
"tab-label-size", &tab_label_size,
|
|
||||||
"close-buttons-on-tabs", &close_buttons_on_tabs,
|
"close-buttons-on-tabs", &close_buttons_on_tabs,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,20 @@ struct _MidoriView
|
||||||
gboolean window_object_cleared;
|
gboolean window_object_cleared;
|
||||||
|
|
||||||
gchar* download_manager;
|
gchar* download_manager;
|
||||||
gint tab_label_size;
|
gchar* default_font_family;
|
||||||
|
gint default_font_size;
|
||||||
|
gint minimum_font_size;
|
||||||
|
gchar* default_encoding;
|
||||||
|
gboolean auto_load_images;
|
||||||
|
gboolean auto_shrink_images;
|
||||||
|
gboolean print_backgrounds;
|
||||||
|
gboolean resizable_text_areas;
|
||||||
|
gboolean enable_scripts;
|
||||||
|
gboolean enable_plugins;
|
||||||
|
gboolean middle_click_opens_selection;
|
||||||
|
gboolean open_tabs_in_the_background;
|
||||||
gboolean close_buttons_on_tabs;
|
gboolean close_buttons_on_tabs;
|
||||||
|
gchar* http_proxy;
|
||||||
|
|
||||||
GtkWidget* menu_item;
|
GtkWidget* menu_item;
|
||||||
GtkWidget* tab_label;
|
GtkWidget* tab_label;
|
||||||
|
@ -86,8 +98,8 @@ GType
|
||||||
midori_load_status_get_type (void)
|
midori_load_status_get_type (void)
|
||||||
{
|
{
|
||||||
static GType type = 0;
|
static GType type = 0;
|
||||||
if (!type)
|
if (type)
|
||||||
{
|
return type;
|
||||||
static const GEnumValue values[] = {
|
static const GEnumValue values[] = {
|
||||||
{ MIDORI_LOAD_PROVISIONAL, "MIDORI_LOAD_PROVISIONAL", N_("Load Provisional") },
|
{ MIDORI_LOAD_PROVISIONAL, "MIDORI_LOAD_PROVISIONAL", N_("Load Provisional") },
|
||||||
{ MIDORI_LOAD_COMMITTED, "MIDORI_LOAD_COMMITTED", N_("Load Committed") },
|
{ MIDORI_LOAD_COMMITTED, "MIDORI_LOAD_COMMITTED", N_("Load Committed") },
|
||||||
|
@ -95,7 +107,6 @@ midori_load_status_get_type (void)
|
||||||
{ 0, NULL, NULL }
|
{ 0, NULL, NULL }
|
||||||
};
|
};
|
||||||
type = g_enum_register_static ("MidoriLoadStatus", values);
|
type = g_enum_register_static ("MidoriLoadStatus", values);
|
||||||
}
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +153,42 @@ midori_view_get_property (GObject* object,
|
||||||
GValue* value,
|
GValue* value,
|
||||||
GParamSpec* pspec);
|
GParamSpec* pspec);
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_cclosure_marshal_VOID__STRING_BOOLEAN (GClosure* closure,
|
||||||
|
GValue* return_value,
|
||||||
|
guint n_param_values,
|
||||||
|
const GValue* param_values,
|
||||||
|
gpointer invocation_hint,
|
||||||
|
gpointer marshal_data)
|
||||||
|
{
|
||||||
|
typedef void(*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer data1,
|
||||||
|
gpointer arg_1,
|
||||||
|
gboolean arg_2,
|
||||||
|
gpointer data2);
|
||||||
|
register GMarshalFunc_VOID__STRING_BOOLEAN callback;
|
||||||
|
register GCClosure* cc = (GCClosure*) closure;
|
||||||
|
register gpointer data1, data2;
|
||||||
|
|
||||||
|
g_return_if_fail (n_param_values == 3);
|
||||||
|
|
||||||
|
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||||
|
{
|
||||||
|
data1 = closure->data;
|
||||||
|
data2 = g_value_peek_pointer (param_values + 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data1 = g_value_peek_pointer (param_values + 0);
|
||||||
|
data2 = closure->data;
|
||||||
|
}
|
||||||
|
callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data
|
||||||
|
? marshal_data : cc->callback);
|
||||||
|
callback (data1,
|
||||||
|
(gchar*)g_value_get_string (param_values + 1),
|
||||||
|
g_value_get_boolean (param_values + 2),
|
||||||
|
data2);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_cclosure_marshal_VOID__STRING_INT_STRING (GClosure* closure,
|
midori_cclosure_marshal_VOID__STRING_INT_STRING (GClosure* closure,
|
||||||
GValue* return_value,
|
GValue* return_value,
|
||||||
|
@ -217,9 +264,10 @@ midori_view_class_init (MidoriViewClass* class)
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
g_cclosure_marshal_VOID__STRING,
|
midori_cclosure_marshal_VOID__STRING_BOOLEAN,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 2,
|
||||||
G_TYPE_STRING);
|
G_TYPE_STRING,
|
||||||
|
G_TYPE_BOOLEAN);
|
||||||
|
|
||||||
signals[NEW_WINDOW] = g_signal_new (
|
signals[NEW_WINDOW] = g_signal_new (
|
||||||
"new-window",
|
"new-window",
|
||||||
|
@ -334,7 +382,7 @@ midori_view_class_init (MidoriViewClass* class)
|
||||||
g_param_spec_string (
|
g_param_spec_string (
|
||||||
"statusbar-text",
|
"statusbar-text",
|
||||||
_("Statusbar Text"),
|
_("Statusbar Text"),
|
||||||
_("The text that is displayed in the statusbar"),
|
_("The text displayed in the statusbar"),
|
||||||
"",
|
"",
|
||||||
G_PARAM_READWRITE));
|
G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
@ -635,12 +683,18 @@ midori_view_console_message_cb (MidoriView* view,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_view_new_tab_cb (MidoriView* view,
|
midori_view_new_tab_cb (MidoriView* view,
|
||||||
const gchar* uri)
|
const gchar* uri,
|
||||||
|
gboolean background)
|
||||||
{
|
{
|
||||||
|
gchar* argument;
|
||||||
|
|
||||||
if (midori_view_is_socket (view))
|
if (midori_view_is_socket (view))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
send_command (view, "new-tab", uri);
|
/* (uri, background) => (background, uri) */
|
||||||
|
argument = g_strdup_printf ("%d %s", background, uri);
|
||||||
|
send_command (view, "new-tab", argument);
|
||||||
|
g_free (argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -723,7 +777,8 @@ receive_status (MidoriView* view,
|
||||||
}
|
}
|
||||||
else if (!strncmp (command, "new-tab ", 8))
|
else if (!strncmp (command, "new-tab ", 8))
|
||||||
{
|
{
|
||||||
g_signal_emit (view, signals[NEW_TAB], 0, &command[8]);
|
/* (background, uri) => (uri, background) */
|
||||||
|
g_signal_emit (view, signals[NEW_TAB], 0, &command[10], atoi (&command[8]));
|
||||||
}
|
}
|
||||||
else if (!strncmp (command, "new-window ", 11))
|
else if (!strncmp (command, "new-window ", 11))
|
||||||
{
|
{
|
||||||
|
@ -756,6 +811,11 @@ receive_status (MidoriView* view,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define UPDATE_SETTING(name, value) \
|
||||||
|
g_object_set (webkit_web_view_get_settings ( \
|
||||||
|
WEBKIT_WEB_VIEW (view->web_view)), \
|
||||||
|
name, value, NULL)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
receive_command (MidoriView* view,
|
receive_command (MidoriView* view,
|
||||||
const gchar* command)
|
const gchar* command)
|
||||||
|
@ -786,9 +846,72 @@ receive_command (MidoriView* view,
|
||||||
atoi (&command[15]));
|
atoi (&command[15]));
|
||||||
else if (!strncmp (command, "hl-matches ", 11))
|
else if (!strncmp (command, "hl-matches ", 11))
|
||||||
midori_view_set_highlight_text_matches (view, atoi (&command[11]));
|
midori_view_set_highlight_text_matches (view, atoi (&command[11]));
|
||||||
else if (!strncmp (command, "download-manager ", 17))
|
else if (!strncmp (command, "dlmgr ", 6))
|
||||||
{
|
{
|
||||||
katze_assign (view->download_manager, g_strdup (&command[17]));
|
katze_assign (view->download_manager, g_strdup (&command[6]));
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "dffamily ", 9))
|
||||||
|
{
|
||||||
|
katze_assign (view->default_font_family, g_strdup (&command[9]));
|
||||||
|
UPDATE_SETTING ("default-font-family", view->default_font_family);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "dfsize ", 7))
|
||||||
|
{
|
||||||
|
view->default_font_size = atoi (&command[7]);
|
||||||
|
UPDATE_SETTING ("default-font-size", view->default_font_size);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "mfsize ", 7))
|
||||||
|
{
|
||||||
|
view->minimum_font_size = atoi (&command[7]);
|
||||||
|
UPDATE_SETTING ("minimum-font-size", view->minimum_font_size);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "denc ", 5))
|
||||||
|
{
|
||||||
|
katze_assign (view->default_encoding, g_strdup (&command[5]));
|
||||||
|
UPDATE_SETTING ("default-encoding", view->default_encoding);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "alimg ", 6))
|
||||||
|
{
|
||||||
|
view->auto_load_images = atoi (&command[6]);
|
||||||
|
UPDATE_SETTING ("auto-load-images", view->auto_load_images);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "asimg ", 6))
|
||||||
|
{
|
||||||
|
view->auto_shrink_images = atoi (&command[6]);
|
||||||
|
UPDATE_SETTING ("auto-shrink-images", view->auto_shrink_images);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "pbkg ", 5))
|
||||||
|
{
|
||||||
|
view->print_backgrounds = atoi (&command[5]);
|
||||||
|
UPDATE_SETTING ("print-backgrounds", view->print_backgrounds);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "rta ", 4))
|
||||||
|
{
|
||||||
|
view->print_backgrounds = atoi (&command[4]);
|
||||||
|
UPDATE_SETTING ("resizable-text-areas", view->resizable_text_areas);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "escripts ", 9))
|
||||||
|
{
|
||||||
|
view->enable_scripts = atoi (&command[9]);
|
||||||
|
UPDATE_SETTING ("enable-scripts", view->enable_scripts);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "eplugins ", 9))
|
||||||
|
{
|
||||||
|
view->enable_plugins = atoi (&command[9]);
|
||||||
|
UPDATE_SETTING ("enable-plugins", view->enable_plugins);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "mclksel ", 8))
|
||||||
|
{
|
||||||
|
view->middle_click_opens_selection = atoi (&command[8]);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "tabsbkg ", 8))
|
||||||
|
{
|
||||||
|
view->open_tabs_in_the_background = atoi (&command[8]);
|
||||||
|
}
|
||||||
|
else if (!strncmp (command, "proxy ", 6))
|
||||||
|
{
|
||||||
|
katze_assign (view->http_proxy, g_strdup (&command[6]));
|
||||||
|
g_setenv ("http_proxy", view->http_proxy ? view->http_proxy : "", TRUE);
|
||||||
}
|
}
|
||||||
else if (g_str_has_prefix (command, "**"))
|
else if (g_str_has_prefix (command, "**"))
|
||||||
g_print ("%s\n", command);
|
g_print ("%s\n", command);
|
||||||
|
@ -970,7 +1093,8 @@ webkit_web_frame_load_done_cb (WebKitWebFrame* web_frame,
|
||||||
web_frame, js_context, js_window);
|
web_frame, js_context, js_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* value = gjs_value_new (webkit_web_frame_get_global_context (web_frame), NULL);
|
/* js_context = webkit_web_frame_get_global_context (web_frame);
|
||||||
|
value = gjs_value_new (js_context, NULL);
|
||||||
document = gjs_value_get_by_name (value, "document");
|
document = gjs_value_get_by_name (value, "document");
|
||||||
links = gjs_value_get_elements_by_tag_name (document, "link");
|
links = gjs_value_get_elements_by_tag_name (document, "link");
|
||||||
katze_array_clear (web_view->news_feeds);
|
katze_array_clear (web_view->news_feeds);
|
||||||
|
@ -1030,6 +1154,7 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
|
||||||
gchar* uri;
|
gchar* uri;
|
||||||
gchar* new_uri;
|
gchar* new_uri;
|
||||||
const gchar* link_uri;
|
const gchar* link_uri;
|
||||||
|
gboolean background;
|
||||||
|
|
||||||
gdk_window_get_pointer (NULL, &x, &y, &state);
|
gdk_window_get_pointer (NULL, &x, &y, &state);
|
||||||
link_uri = midori_view_get_link_uri (MIDORI_VIEW (view));
|
link_uri = midori_view_get_link_uri (MIDORI_VIEW (view));
|
||||||
|
@ -1048,14 +1173,10 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
|
||||||
else if (state & GDK_MOD1_MASK)
|
else if (state & GDK_MOD1_MASK)
|
||||||
{
|
{
|
||||||
/* Open link in new tab */
|
/* Open link in new tab */
|
||||||
g_signal_emit_by_name (view, "new-tab", link_uri);
|
background = view->open_tabs_in_the_background;
|
||||||
/* FIXME: Open in the background as appropriate */
|
|
||||||
/* background = sokoke_object_get_boolean (browser->settings,
|
|
||||||
"open-tabs-in-the-background");
|
|
||||||
if (state & GDK_CONTROL_MASK)
|
if (state & GDK_CONTROL_MASK)
|
||||||
background = !background;
|
background = !background;
|
||||||
if (background)
|
g_signal_emit_by_name (view, "new-tab", link_uri, background);
|
||||||
open_tab_in_the_background */
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1063,14 +1184,10 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
|
||||||
if (link_uri)
|
if (link_uri)
|
||||||
{
|
{
|
||||||
/* Open link in new tab */
|
/* Open link in new tab */
|
||||||
g_signal_emit_by_name (view, "new-tab", link_uri);
|
background = view->open_tabs_in_the_background;
|
||||||
/* FIXME: Open in the background as appropriate */
|
|
||||||
/* background = sokoke_object_get_boolean (browser->settings,
|
|
||||||
"open-tabs-in-the-background");
|
|
||||||
if (state & GDK_CONTROL_MASK)
|
if (state & GDK_CONTROL_MASK)
|
||||||
background = !background;
|
background = !background;
|
||||||
if (background)
|
g_signal_emit_by_name (view, "new-tab", link_uri, background);
|
||||||
open_tab_in_the_background */
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (state & GDK_CONTROL_MASK)
|
else if (state & GDK_CONTROL_MASK)
|
||||||
|
@ -1078,7 +1195,7 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
|
||||||
midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
|
midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
|
||||||
return FALSE; /* Allow Ctrl + Middle click */
|
return FALSE; /* Allow Ctrl + Middle click */
|
||||||
}
|
}
|
||||||
else if (TRUE /*middle-click-opens-selection*/)
|
else if (view->middle_click_opens_selection)
|
||||||
{
|
{
|
||||||
state = (GdkModifierType) event->state;
|
state = (GdkModifierType) event->state;
|
||||||
clipboard = gtk_clipboard_get_for_display (
|
clipboard = gtk_clipboard_get_for_display (
|
||||||
|
@ -1089,7 +1206,12 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
|
||||||
{
|
{
|
||||||
new_uri = sokoke_magic_uri (uri, NULL);
|
new_uri = sokoke_magic_uri (uri, NULL);
|
||||||
if (state & GDK_CONTROL_MASK)
|
if (state & GDK_CONTROL_MASK)
|
||||||
g_signal_emit_by_name (view, "new-tab", new_uri);
|
{
|
||||||
|
background = view->open_tabs_in_the_background;
|
||||||
|
if (state & GDK_CONTROL_MASK)
|
||||||
|
background = !background;
|
||||||
|
g_signal_emit_by_name (view, "new-tab", new_uri, background);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
midori_view_set_uri (MIDORI_VIEW (view), new_uri);
|
midori_view_set_uri (MIDORI_VIEW (view), new_uri);
|
||||||
|
@ -1148,7 +1270,8 @@ static void
|
||||||
midori_web_view_menu_new_tab_activate_cb (GtkWidget* widget,
|
midori_web_view_menu_new_tab_activate_cb (GtkWidget* widget,
|
||||||
MidoriView* view)
|
MidoriView* view)
|
||||||
{
|
{
|
||||||
g_signal_emit (view, signals[NEW_TAB], 0, view->link_uri);
|
g_signal_emit (view, signals[NEW_TAB], 0, view->link_uri,
|
||||||
|
view->open_tabs_in_the_background);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1537,6 +1660,9 @@ midori_view_init (MidoriView* view)
|
||||||
view->item = NULL;
|
view->item = NULL;
|
||||||
|
|
||||||
view->download_manager = NULL;
|
view->download_manager = NULL;
|
||||||
|
view->default_font_family = NULL;
|
||||||
|
view->default_encoding = NULL;
|
||||||
|
view->http_proxy = NULL;
|
||||||
|
|
||||||
g_object_connect (view,
|
g_object_connect (view,
|
||||||
"signal::notify::uri",
|
"signal::notify::uri",
|
||||||
|
@ -1588,7 +1714,8 @@ midori_view_finalize (GObject* object)
|
||||||
|
|
||||||
g_free (view->download_manager);
|
g_free (view->download_manager);
|
||||||
|
|
||||||
/* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
|
/* web_frame = webkit_web_view_get_main_frame
|
||||||
|
(WEBKIT_WEB_VIEW (view->web_view));
|
||||||
g_signal_handlers_disconnect_by_func (web_frame,
|
g_signal_handlers_disconnect_by_func (web_frame,
|
||||||
webkit_web_frame_load_done, view); */
|
webkit_web_frame_load_done, view); */
|
||||||
|
|
||||||
|
@ -1761,17 +1888,12 @@ _update_label_size (GtkWidget* label,
|
||||||
{
|
{
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
|
||||||
if (size > -1)
|
if (size < 1)
|
||||||
{
|
size = 10;
|
||||||
|
|
||||||
sokoke_widget_get_text_size (label, "M", &width, &height);
|
sokoke_widget_get_text_size (label, "M", &width, &height);
|
||||||
gtk_widget_set_size_request (label, width * size, -1);
|
gtk_widget_set_size_request (label, width * size, -1);
|
||||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_set_size_request (label, -1, -1);
|
|
||||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1779,11 +1901,41 @@ _midori_view_update_settings (MidoriView* view)
|
||||||
{
|
{
|
||||||
g_object_get (view->settings,
|
g_object_get (view->settings,
|
||||||
"download-manager", &view->download_manager,
|
"download-manager", &view->download_manager,
|
||||||
|
"default-font-family", &view->default_font_family,
|
||||||
|
"default-font-size", &view->default_font_size,
|
||||||
|
"minimum-font-size", &view->minimum_font_size,
|
||||||
|
"default-encoding", &view->default_encoding,
|
||||||
|
"auto-load-images", &view->auto_load_images,
|
||||||
|
"auto-shrink-images", &view->auto_shrink_images,
|
||||||
|
"print-backgrounds", &view->print_backgrounds,
|
||||||
|
"resizable-text-areas", &view->resizable_text_areas,
|
||||||
|
"enable-scripts", &view->enable_scripts,
|
||||||
|
"enable-plugins", &view->enable_plugins,
|
||||||
"close-buttons-on-tabs", &view->close_buttons_on_tabs,
|
"close-buttons-on-tabs", &view->close_buttons_on_tabs,
|
||||||
|
"middle-click-opens-selection", &view->middle_click_opens_selection,
|
||||||
|
"open-tabs-in-the-background", &view->open_tabs_in_the_background,
|
||||||
|
"http-proxy", &view->http_proxy,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (midori_view_is_socket (view))
|
if (midori_view_is_socket (view))
|
||||||
send_command (view, "download-manager", view->download_manager);
|
{
|
||||||
|
send_command (view, "dlmgr", view->download_manager);
|
||||||
|
send_command (view, "dffamily", view->default_font_family);
|
||||||
|
send_command (view, "dfsize", int_to_str (view->default_font_size));
|
||||||
|
send_command (view, "mfsize", int_to_str (view->minimum_font_size));
|
||||||
|
send_command (view, "denc", view->default_encoding);
|
||||||
|
send_command (view, "alimg", int_to_str (view->auto_load_images));
|
||||||
|
send_command (view, "asimg", int_to_str (view->auto_shrink_images));
|
||||||
|
send_command (view, "pbkg", int_to_str (view->print_backgrounds));
|
||||||
|
send_command (view, "rta", int_to_str (view->resizable_text_areas));
|
||||||
|
send_command (view, "escripts", int_to_str (view->enable_scripts));
|
||||||
|
send_command (view, "eplugins", int_to_str (view->enable_plugins));
|
||||||
|
send_command (view, "mclksel",
|
||||||
|
int_to_str (view->middle_click_opens_selection));
|
||||||
|
send_command (view, "tabsbkg",
|
||||||
|
int_to_str (view->open_tabs_in_the_background));
|
||||||
|
send_command (view, "proxy", view->http_proxy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1802,14 +1954,67 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
|
||||||
{
|
{
|
||||||
katze_assign (view->download_manager, g_value_dup_string (&value));
|
katze_assign (view->download_manager, g_value_dup_string (&value));
|
||||||
if (midori_view_is_socket (view))
|
if (midori_view_is_socket (view))
|
||||||
send_command (view, "download-manager", view->download_manager);
|
send_command (view, "dlmgr", view->download_manager);
|
||||||
}
|
}
|
||||||
else if (name == g_intern_string ("tab-label-size"))
|
else if (name == g_intern_string ("default-font-family"))
|
||||||
{
|
{
|
||||||
view->tab_label_size = g_value_get_int (&value);
|
katze_assign (view->default_font_family, g_value_dup_string (&value));
|
||||||
if (!midori_view_is_plug (view))
|
if (midori_view_is_socket (view))
|
||||||
_update_label_size (view->tab_title,
|
send_command (view, "dffamily", view->default_font_family);
|
||||||
sokoke_object_get_int (view->settings, "tab-label-size"));
|
}
|
||||||
|
else if (name == g_intern_string ("default-font-size"))
|
||||||
|
{
|
||||||
|
view->default_font_size = g_value_get_int (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "dfsize", int_to_str (view->default_font_size));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("minimum-font-size"))
|
||||||
|
{
|
||||||
|
view->minimum_font_size = g_value_get_int (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "mfsize", int_to_str (view->minimum_font_size));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("default-encoding"))
|
||||||
|
{
|
||||||
|
katze_assign (view->default_encoding, g_value_dup_string (&value));
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "denc", view->default_encoding);
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("auto-load-images"))
|
||||||
|
{
|
||||||
|
view->auto_load_images = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "alimg", int_to_str (view->auto_load_images));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("auto-shrink-images"))
|
||||||
|
{
|
||||||
|
view->auto_shrink_images = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "asimg", int_to_str (view->auto_shrink_images));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("print-backgrounds"))
|
||||||
|
{
|
||||||
|
view->print_backgrounds = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "pbkg", int_to_str (view->print_backgrounds));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("resizable-text-areas"))
|
||||||
|
{
|
||||||
|
view->resizable_text_areas = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "rta", int_to_str (view->resizable_text_areas));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("enable-scripts"))
|
||||||
|
{
|
||||||
|
view->enable_scripts = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "escripts", int_to_str (view->enable_scripts));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("enable-plugins"))
|
||||||
|
{
|
||||||
|
view->enable_plugins = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "eplugins", int_to_str (view->enable_plugins));
|
||||||
}
|
}
|
||||||
else if (name == g_intern_string ("close-buttons-on-tabs"))
|
else if (name == g_intern_string ("close-buttons-on-tabs"))
|
||||||
{
|
{
|
||||||
|
@ -1817,6 +2022,26 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
|
||||||
sokoke_widget_set_visible (view->tab_close,
|
sokoke_widget_set_visible (view->tab_close,
|
||||||
view->close_buttons_on_tabs);
|
view->close_buttons_on_tabs);
|
||||||
}
|
}
|
||||||
|
else if (name == g_intern_string ("middle-click-opens-selection"))
|
||||||
|
{
|
||||||
|
view->middle_click_opens_selection = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "mclksel",
|
||||||
|
int_to_str (view->middle_click_opens_selection));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("open-tabs-in-the-background"))
|
||||||
|
{
|
||||||
|
view->open_tabs_in_the_background = g_value_get_boolean (&value);
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "tabsbkg",
|
||||||
|
int_to_str (view->open_tabs_in_the_background));
|
||||||
|
}
|
||||||
|
else if (name == g_intern_string ("http-proxy"))
|
||||||
|
{
|
||||||
|
katze_assign (view->http_proxy, g_value_dup_string (&value));
|
||||||
|
if (midori_view_is_socket (view))
|
||||||
|
send_command (view, "proxy", view->http_proxy);
|
||||||
|
}
|
||||||
|
|
||||||
g_value_unset (&value);
|
g_value_unset (&value);
|
||||||
}
|
}
|
||||||
|
@ -1836,7 +2061,6 @@ midori_view_set_settings (MidoriView* view,
|
||||||
g_signal_handlers_disconnect_by_func (view->settings,
|
g_signal_handlers_disconnect_by_func (view->settings,
|
||||||
midori_view_settings_notify_cb, view);
|
midori_view_settings_notify_cb, view);
|
||||||
katze_object_assign (view->settings, g_object_ref (settings));
|
katze_object_assign (view->settings, g_object_ref (settings));
|
||||||
/* FIXME: Propagate settings to the web view */
|
|
||||||
_midori_view_update_settings (view);
|
_midori_view_update_settings (view);
|
||||||
g_signal_connect (settings, "notify",
|
g_signal_connect (settings, "notify",
|
||||||
G_CALLBACK (midori_view_settings_notify_cb), view);
|
G_CALLBACK (midori_view_settings_notify_cb), view);
|
||||||
|
@ -2278,9 +2502,7 @@ midori_view_get_proxy_tab_label (MidoriView* view)
|
||||||
gtk_misc_set_alignment (GTK_MISC (view->tab_title), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (view->tab_title), 0.0, 0.5);
|
||||||
/* TODO: make the tab initially look "unvisited" until it's focused */
|
/* TODO: make the tab initially look "unvisited" until it's focused */
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
|
||||||
if (view->settings)
|
_update_label_size (view->tab_title, 10);
|
||||||
_update_label_size (view->tab_title,
|
|
||||||
sokoke_object_get_int (view->settings, "tab-label-size"));
|
|
||||||
|
|
||||||
view->tab_close = gtk_button_new ();
|
view->tab_close = gtk_button_new ();
|
||||||
gtk_button_set_relief (GTK_BUTTON (view->tab_close), GTK_RELIEF_NONE);
|
gtk_button_set_relief (GTK_BUTTON (view->tab_close), GTK_RELIEF_NONE);
|
||||||
|
|
|
@ -46,7 +46,6 @@ struct _MidoriWebSettings
|
||||||
gchar* location_entry_search;
|
gchar* location_entry_search;
|
||||||
MidoriPreferredEncoding preferred_encoding;
|
MidoriPreferredEncoding preferred_encoding;
|
||||||
|
|
||||||
gint tab_label_size;
|
|
||||||
gboolean close_buttons_on_tabs;
|
gboolean close_buttons_on_tabs;
|
||||||
MidoriNewPage open_new_pages_in;
|
MidoriNewPage open_new_pages_in;
|
||||||
gboolean middle_click_opens_selection;
|
gboolean middle_click_opens_selection;
|
||||||
|
@ -99,7 +98,6 @@ enum
|
||||||
PROP_LOCATION_ENTRY_SEARCH,
|
PROP_LOCATION_ENTRY_SEARCH,
|
||||||
PROP_PREFERRED_ENCODING,
|
PROP_PREFERRED_ENCODING,
|
||||||
|
|
||||||
PROP_TAB_LABEL_SIZE,
|
|
||||||
PROP_CLOSE_BUTTONS_ON_TABS,
|
PROP_CLOSE_BUTTONS_ON_TABS,
|
||||||
PROP_OPEN_NEW_PAGES_IN,
|
PROP_OPEN_NEW_PAGES_IN,
|
||||||
PROP_MIDDLE_CLICK_OPENS_SELECTION,
|
PROP_MIDDLE_CLICK_OPENS_SELECTION,
|
||||||
|
@ -442,16 +440,6 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
||||||
flags));
|
flags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_TAB_LABEL_SIZE,
|
|
||||||
g_param_spec_int (
|
|
||||||
"tab-label-size",
|
|
||||||
_("Tab Label Size"),
|
|
||||||
_("The desired tab label size"),
|
|
||||||
0, G_MAXINT, 10,
|
|
||||||
flags));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_CLOSE_BUTTONS_ON_TABS,
|
PROP_CLOSE_BUTTONS_ON_TABS,
|
||||||
g_param_spec_boolean (
|
g_param_spec_boolean (
|
||||||
|
@ -597,7 +585,8 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
notify_default_encoding_cb (GObject* object, GParamSpec* pspec)
|
notify_default_encoding_cb (GObject* object,
|
||||||
|
GParamSpec* pspec)
|
||||||
{
|
{
|
||||||
MidoriWebSettings* web_settings = MIDORI_WEB_SETTINGS (object);
|
MidoriWebSettings* web_settings = MIDORI_WEB_SETTINGS (object);
|
||||||
|
|
||||||
|
@ -732,9 +721,6 @@ midori_web_settings_set_property (GObject* object,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_TAB_LABEL_SIZE:
|
|
||||||
web_settings->tab_label_size = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_CLOSE_BUTTONS_ON_TABS:
|
case PROP_CLOSE_BUTTONS_ON_TABS:
|
||||||
web_settings->close_buttons_on_tabs = g_value_get_boolean (value);
|
web_settings->close_buttons_on_tabs = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
@ -870,9 +856,6 @@ midori_web_settings_get_property (GObject* object,
|
||||||
g_value_set_enum (value, web_settings->preferred_encoding);
|
g_value_set_enum (value, web_settings->preferred_encoding);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_TAB_LABEL_SIZE:
|
|
||||||
g_value_set_int (value, web_settings->tab_label_size);
|
|
||||||
break;
|
|
||||||
case PROP_CLOSE_BUTTONS_ON_TABS:
|
case PROP_CLOSE_BUTTONS_ON_TABS:
|
||||||
g_value_set_boolean (value, web_settings->close_buttons_on_tabs);
|
g_value_set_boolean (value, web_settings->close_buttons_on_tabs);
|
||||||
break;
|
break;
|
||||||
|
@ -973,7 +956,6 @@ midori_web_settings_copy (MidoriWebSettings* web_settings)
|
||||||
"show-new-tab", web_settings->show_new_tab,
|
"show-new-tab", web_settings->show_new_tab,
|
||||||
"show-trash", web_settings->show_trash,
|
"show-trash", web_settings->show_trash,
|
||||||
|
|
||||||
"tab-label-size", web_settings->tab_label_size,
|
|
||||||
"close-buttons-on-tabs", web_settings->close_buttons_on_tabs,
|
"close-buttons-on-tabs", web_settings->close_buttons_on_tabs,
|
||||||
"open-new-pages-in", web_settings->open_new_pages_in,
|
"open-new-pages-in", web_settings->open_new_pages_in,
|
||||||
"middle-click-opens-selection", web_settings->middle_click_opens_selection,
|
"middle-click-opens-selection", web_settings->middle_click_opens_selection,
|
||||||
|
|
Loading…
Reference in a new issue