2007-12-16 22:20:24 +00:00
/*
2009-03-16 22:55:25 +00:00
Copyright ( C ) 2007 - 2009 Christian Dywan < christian @ twotoasts . de >
2007-12-16 22:20:24 +00:00
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 .
*/
2008-04-20 01:30:24 +00:00
# include "midori-preferences.h"
2007-12-16 22:20:24 +00:00
2012-05-31 22:45:50 +00:00
# include "midori-app.h"
2012-08-27 19:49:36 +00:00
# include "midori-core.h"
2011-10-31 21:10:39 +00:00
# include "midori-platform.h"
2007-12-16 22:20:24 +00:00
2008-10-30 01:21:19 +00:00
# include <string.h>
2008-04-13 19:51:43 +00:00
# include <glib/gi18n.h>
2009-03-16 22:55:25 +00:00
# include <libsoup/soup.h>
2008-12-07 14:12:42 +00:00
2011-08-08 13:44:38 +00:00
# if WEBKIT_CHECK_VERSION (1, 3, 11)
# define LIBSOUP_USE_UNSTABLE_REQUEST_API
# include <libsoup/soup-cache.h>
# endif
2011-10-31 21:10:39 +00:00
# include <config.h>
2009-12-14 22:51:05 +00:00
# if HAVE_LIBNOTIFY
# include <libnotify/notify.h>
# endif
2008-06-19 18:41:05 +00:00
struct _MidoriPreferences
2008-04-20 01:30:24 +00:00
{
2009-10-18 20:06:24 +00:00
KatzePreferences parent_instance ;
2009-10-26 22:43:17 +00:00
gpointer settings ;
2008-04-20 01:30:24 +00:00
} ;
2009-10-18 20:06:24 +00:00
G_DEFINE_TYPE ( MidoriPreferences , midori_preferences , KATZE_TYPE_PREFERENCES ) ;
2008-04-20 01:30:24 +00:00
enum
{
PROP_0 ,
PROP_SETTINGS
} ;
static void
midori_preferences_finalize ( GObject * object ) ;
static void
midori_preferences_set_property ( GObject * object ,
guint prop_id ,
const GValue * value ,
GParamSpec * pspec ) ;
static void
midori_preferences_get_property ( GObject * object ,
guint prop_id ,
GValue * value ,
GParamSpec * pspec ) ;
static void
midori_preferences_class_init ( MidoriPreferencesClass * class )
{
GObjectClass * gobject_class = G_OBJECT_CLASS ( class ) ;
gobject_class - > finalize = midori_preferences_finalize ;
gobject_class - > set_property = midori_preferences_set_property ;
gobject_class - > get_property = midori_preferences_get_property ;
2009-10-18 20:06:24 +00:00
/**
* MidoriPreferences : settings :
*
* The settings to proxy properties from .
*/
2008-04-20 01:30:24 +00:00
g_object_class_install_property ( gobject_class ,
PROP_SETTINGS ,
g_param_spec_object (
" settings " ,
2008-10-15 01:32:11 +00:00
" Settings " ,
" Settings instance to provide properties " ,
2008-04-20 01:30:24 +00:00
MIDORI_TYPE_WEB_SETTINGS ,
2009-10-26 22:43:17 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-20 01:30:24 +00:00
}
2007-12-16 22:20:24 +00:00
2008-04-20 01:30:24 +00:00
static void
midori_preferences_init ( MidoriPreferences * preferences )
2007-12-16 22:20:24 +00:00
{
2009-10-26 22:43:17 +00:00
preferences - > settings = NULL ;
2008-04-20 01:30:24 +00:00
}
static void
midori_preferences_finalize ( GObject * object )
{
G_OBJECT_CLASS ( midori_preferences_parent_class ) - > finalize ( object ) ;
}
static void
midori_preferences_set_property ( GObject * object ,
guint prop_id ,
const GValue * value ,
GParamSpec * pspec )
{
MidoriPreferences * preferences = MIDORI_PREFERENCES ( object ) ;
switch ( prop_id )
{
case PROP_SETTINGS :
midori_preferences_set_settings ( preferences ,
g_value_get_object ( value ) ) ;
break ;
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
}
static void
midori_preferences_get_property ( GObject * object ,
guint prop_id ,
GValue * value ,
GParamSpec * pspec )
{
2009-10-26 22:43:17 +00:00
MidoriPreferences * preferences = MIDORI_PREFERENCES ( object ) ;
2008-04-20 01:30:24 +00:00
switch ( prop_id )
{
2009-10-26 22:43:17 +00:00
case PROP_SETTINGS :
g_value_set_object ( value , preferences - > settings ) ;
break ;
2008-04-20 01:30:24 +00:00
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
}
/**
* midori_preferences_new :
* @ parent : the parent window
* @ settings : the settings
*
* Creates a new preferences dialog .
*
2008-12-12 09:14:17 +00:00
* Since 0.1 .2 @ parent may be % NULL .
*
2008-04-20 01:30:24 +00:00
* Return value : a new # MidoriPreferences
* */
GtkWidget *
midori_preferences_new ( GtkWindow * parent ,
MidoriWebSettings * settings )
{
2008-11-16 01:00:17 +00:00
MidoriPreferences * preferences ;
2008-12-12 09:14:17 +00:00
g_return_val_if_fail ( ! parent | | GTK_IS_WINDOW ( parent ) , NULL ) ;
2008-04-20 01:30:24 +00:00
g_return_val_if_fail ( MIDORI_IS_WEB_SETTINGS ( settings ) , NULL ) ;
2008-11-16 01:00:17 +00:00
preferences = g_object_new ( MIDORI_TYPE_PREFERENCES ,
" transient-for " , parent ,
" settings " , settings ,
NULL ) ;
2008-04-20 01:30:24 +00:00
return GTK_WIDGET ( preferences ) ;
}
2009-03-05 22:36:13 +00:00
static void
midori_preferences_homepage_current_clicked_cb ( GtkWidget * button ,
MidoriWebSettings * settings )
{
GtkWidget * preferences = gtk_widget_get_toplevel ( button ) ;
GtkWidget * browser = katze_object_get_object ( preferences , " transient-for " ) ;
if ( GTK_IS_WINDOW ( browser ) )
{
gchar * uri = katze_object_get_string ( browser , " uri " ) ;
2010-06-30 19:21:06 +00:00
if ( uri & & * uri )
g_object_set ( settings , " homepage " , uri , NULL ) ;
else
g_object_set ( settings , " homepage " , " about:blank " , NULL ) ;
2009-03-05 22:36:13 +00:00
g_free ( uri ) ;
}
}
2009-10-25 13:50:29 +00:00
# if !HAVE_HILDON
2009-02-12 23:49:30 +00:00
static void
2010-04-02 18:41:39 +00:00
midori_preferences_notify_proxy_type_cb ( MidoriWebSettings * settings ,
GParamSpec * pspec ,
GtkWidget * entry )
2009-02-12 23:49:30 +00:00
{
2010-04-02 18:41:39 +00:00
MidoriProxy proxy_type = katze_object_get_enum ( settings , " proxy-type " ) ;
2009-02-12 23:49:30 +00:00
2010-04-02 18:41:39 +00:00
gtk_widget_set_sensitive ( entry , proxy_type = = MIDORI_PROXY_HTTP ) ;
2009-02-12 23:49:30 +00:00
}
2009-10-25 13:50:29 +00:00
# endif
2009-02-12 23:49:30 +00:00
2009-01-09 21:54:40 +00:00
# if HAVE_OSX
2008-10-15 22:58:22 +00:00
static void
midori_preferences_toolbutton_clicked_cb ( GtkWidget * toolbutton ,
GtkWidget * page )
{
gpointer notebook = g_object_get_data ( G_OBJECT ( toolbutton ) , " notebook " ) ;
guint n = gtk_notebook_page_num ( notebook , page ) ;
gtk_notebook_set_current_page ( notebook , n ) ;
}
# endif
static inline void
midori_preferences_add_toolbutton ( GtkWidget * toolbar ,
GtkWidget * * toolbutton ,
const gchar * icon ,
const gchar * label ,
GtkWidget * page )
{
2009-01-09 21:54:40 +00:00
# if HAVE_OSX
2008-10-15 22:58:22 +00:00
* toolbutton = GTK_WIDGET ( * toolbutton ? gtk_radio_tool_button_new_from_widget (
GTK_RADIO_TOOL_BUTTON ( * toolbutton ) ) : gtk_radio_tool_button_new ( NULL ) ) ;
gtk_tool_button_set_label ( GTK_TOOL_BUTTON ( * toolbutton ) , label ) ;
gtk_tool_button_set_stock_id ( GTK_TOOL_BUTTON ( * toolbutton ) , icon ) ;
gtk_toolbar_insert ( GTK_TOOLBAR ( toolbar ) , GTK_TOOL_ITEM ( * toolbutton ) , - 1 ) ;
g_signal_connect ( * toolbutton , " clicked " ,
G_CALLBACK ( midori_preferences_toolbutton_clicked_cb ) , page ) ;
# endif
}
2009-12-14 22:25:33 +00:00
#if 0
2009-10-29 22:46:47 +00:00
static void
midori_preferences_list_dicts_cb ( const gchar * lang_tag ,
const gchar * provider_name ,
const gchar * provider_desc ,
const gchar * provider_file ,
GList * * dicts )
{
* dicts = g_list_prepend ( * dicts , ( gchar * ) lang_tag ) ;
}
static GList *
midori_preferences_get_spell_languages ( void )
{
GList * dicts = NULL ;
2009-12-14 22:25:33 +00:00
gpointer broker = enchant_broker_init ( ) ;
2009-10-29 22:46:47 +00:00
enchant_broker_list_dicts ( broker , ( GCallback ) midori_preferences_list_dicts_cb , & dicts ) ;
enchant_broker_free ( broker ) ;
return dicts ;
}
2009-12-14 22:25:33 +00:00
# endif
2009-10-29 22:46:47 +00:00
2008-04-20 01:30:24 +00:00
/**
* midori_preferences_set_settings :
* @ settings : the settings
*
* Assigns a settings instance to a preferences dialog .
*
* Note : This must not be called more than once .
2008-12-12 09:14:17 +00:00
*
* Since 0.1 .2 this is equal to setting # MidoriPreferences : settings : .
2008-04-20 01:30:24 +00:00
* */
void
midori_preferences_set_settings ( MidoriPreferences * preferences ,
MidoriWebSettings * settings )
{
2008-12-12 09:14:17 +00:00
GtkWidget * header ;
GtkWindow * parent ;
const gchar * icon_name ;
2009-10-18 20:06:24 +00:00
KatzePreferences * _preferences ;
2008-07-16 20:32:37 +00:00
GtkWidget * label ;
GtkWidget * button ;
GtkWidget * entry ;
2008-04-20 01:30:24 +00:00
g_return_if_fail ( MIDORI_IS_PREFERENCES ( preferences ) ) ;
g_return_if_fail ( MIDORI_IS_WEB_SETTINGS ( settings ) ) ;
2009-10-26 22:43:17 +00:00
g_return_if_fail ( ! preferences - > settings ) ;
preferences - > settings = settings ;
2009-02-19 21:57:51 +00:00
2008-12-12 09:14:17 +00:00
g_object_get ( preferences , " transient-for " , & parent , NULL ) ;
icon_name = parent ? gtk_window_get_icon_name ( parent ) : NULL ;
if ( ( header = sokoke_xfce_header_new ( icon_name ,
gtk_window_get_title ( GTK_WINDOW ( preferences ) ) ) ) )
2009-10-18 20:06:24 +00:00
{
2010-10-18 20:35:39 +00:00
GtkWidget * vbox = gtk_dialog_get_content_area ( GTK_DIALOG ( preferences ) ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , header , FALSE , FALSE , 0 ) ;
2009-10-18 20:06:24 +00:00
gtk_widget_show_all ( header ) ;
}
_preferences = KATZE_PREFERENCES ( preferences ) ;
2008-12-12 09:14:17 +00:00
2008-10-15 22:58:22 +00:00
# define PAGE_NEW(__icon, __label) \
2009-10-18 20:06:24 +00:00
katze_preferences_add_category ( _preferences , __label , __icon )
# define FRAME_NEW(__label) \
katze_preferences_add_group ( _preferences , __label )
# define FILLED_ADD(__widget) \
katze_preferences_add_widget ( _preferences , __widget , " filled " )
# define INDENTED_ADD(__widget) \
katze_preferences_add_widget ( _preferences , __widget , " indented " )
# define SPANNED_ADD(__widget) \
katze_preferences_add_widget ( _preferences , __widget , " spanned " )
2008-06-19 18:41:05 +00:00
/* Page "General" */
2012-08-27 19:49:36 +00:00
if ( ! midori_paths_is_readonly ( ) )
2011-08-04 21:45:57 +00:00
{
2011-05-01 22:02:54 +00:00
PAGE_NEW ( GTK_STOCK_HOME , _ ( " Startup " ) ) ;
FRAME_NEW ( NULL ) ;
2008-04-13 19:51:43 +00:00
label = katze_property_label ( settings , " load-on-startup " ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2008-04-13 19:51:43 +00:00
button = katze_property_proxy ( settings , " load-on-startup " , NULL ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Homepage: " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2011-05-15 14:45:14 +00:00
entry = katze_property_proxy ( settings , " homepage " , " address " ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2009-03-05 22:36:13 +00:00
if ( parent & & katze_object_has_property ( parent , " uri " ) )
{
2011-05-15 00:27:21 +00:00
#if 0
button = gtk_button_new_with_mnemonic ( _ ( " Use _current page " ) ) ;
2009-11-13 18:37:15 +00:00
# else
2011-05-15 00:27:21 +00:00
label = gtk_label_new ( NULL ) ;
INDENTED_ADD ( label ) ;
button = gtk_button_new_with_label ( _ ( " Use current page as homepage " ) ) ;
# endif
2009-03-05 22:36:13 +00:00
g_signal_connect ( button , " clicked " ,
G_CALLBACK ( midori_preferences_homepage_current_clicked_cb ) , settings ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2009-03-05 22:36:13 +00:00
}
2011-08-04 21:45:57 +00:00
}
2007-12-16 22:20:24 +00:00
2008-06-19 18:41:05 +00:00
/* Page "Appearance" */
2011-05-16 00:53:40 +00:00
PAGE_NEW ( GTK_STOCK_SELECT_FONT , _ ( " Fonts " ) ) ;
2011-05-01 22:02:54 +00:00
FRAME_NEW ( NULL ) ;
2009-10-25 13:50:29 +00:00
# if !HAVE_HILDON
2011-05-16 01:30:55 +00:00
label = gtk_label_new ( _ ( " Proportional Font Family " ) ) ;
2011-05-15 19:25:53 +00:00
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2008-04-20 16:12:39 +00:00
button = katze_property_proxy ( settings , " default-font-family " , " font " ) ;
2009-05-10 14:40:43 +00:00
gtk_widget_set_tooltip_text ( button , _ ( " The default font family used to display text " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2008-04-13 19:51:43 +00:00
entry = katze_property_proxy ( settings , " default-font-size " , NULL ) ;
2009-01-04 18:21:25 +00:00
gtk_widget_set_tooltip_text ( entry , _ ( " The default font size used to display text " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2009-04-26 00:23:27 +00:00
label = gtk_label_new ( _ ( " Fixed-width Font Family " ) ) ;
2011-05-15 19:25:53 +00:00
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2009-09-13 21:48:48 +00:00
button = katze_property_proxy ( settings , " monospace-font-family " , " font-monospace " ) ;
2009-04-26 00:23:27 +00:00
gtk_widget_set_tooltip_text ( button , _ ( " The font family used to display fixed-width text " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2009-06-03 20:00:29 +00:00
entry = katze_property_proxy ( settings , " default-monospace-font-size " , NULL ) ;
gtk_widget_set_tooltip_text ( entry , _ ( " The font size used to display fixed-width text " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2009-04-26 00:23:27 +00:00
label = gtk_label_new ( _ ( " Minimum Font Size " ) ) ;
2011-05-15 19:25:53 +00:00
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2008-04-13 19:51:43 +00:00
entry = katze_property_proxy ( settings , " minimum-font-size " , NULL ) ;
2009-01-04 18:21:25 +00:00
gtk_widget_set_tooltip_text ( entry , _ ( " The minimum font size used to display text " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2011-10-26 19:11:50 +00:00
button = katze_property_proxy ( settings , " enforce-font-family " , NULL ) ;
INDENTED_ADD ( button ) ;
2009-10-25 13:50:29 +00:00
# endif
2012-09-16 23:00:49 +00:00
label = gtk_label_new ( _ ( " Preferred Encoding " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2009-11-03 17:01:22 +00:00
button = katze_property_proxy ( settings , " preferred-encoding " , " custom-default-encoding " ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2007-12-16 22:20:24 +00:00
2008-06-19 18:41:05 +00:00
/* Page "Behavior" */
2008-10-15 22:58:22 +00:00
PAGE_NEW ( GTK_STOCK_SELECT_COLOR , _ ( " Behavior " ) ) ;
2011-05-01 22:02:54 +00:00
FRAME_NEW ( NULL ) ;
2009-10-26 17:07:10 +00:00
# if !HAVE_HILDON
2008-04-13 19:51:43 +00:00
button = katze_property_proxy ( settings , " auto-load-images " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Load images automatically " ) ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( button ) ;
2010-12-05 22:14:19 +00:00
button = katze_property_proxy ( settings , " enable-spell-checking " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Enable Spell Checking " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2011-08-04 21:29:56 +00:00
/* Disable spell check option if there are no enchant modules */
{
2012-08-29 18:19:05 +00:00
gchar * enchant_path = midori_paths_get_lib_path ( " enchant " ) ;
2011-08-04 21:29:56 +00:00
if ( enchant_path = = NULL )
2011-08-04 22:02:17 +00:00
{
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button ) , FALSE ) ;
2011-08-04 21:29:56 +00:00
gtk_widget_set_sensitive ( button , FALSE ) ;
2011-08-04 22:02:17 +00:00
}
2011-08-04 21:29:56 +00:00
else
g_free ( enchant_path ) ;
}
2008-04-13 19:51:43 +00:00
button = katze_property_proxy ( settings , " enable-scripts " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Enable scripts " ) ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( button ) ;
2010-01-09 22:49:25 +00:00
button = katze_property_proxy ( settings , " enable-plugins " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Enable Netscape plugins " ) ) ;
gtk_widget_set_sensitive ( button , midori_web_settings_has_plugin_support ( ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2010-10-27 19:09:19 +00:00
# endif
2010-01-09 22:49:25 +00:00
button = katze_property_proxy ( settings , " zoom-text-and-images " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Zoom Text and Images " ) ) ;
2009-12-23 15:24:51 +00:00
INDENTED_ADD ( button ) ;
2010-03-23 19:52:06 +00:00
button = katze_property_proxy ( settings , " javascript-can-open-windows-automatically " , NULL ) ;
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Allow scripts to open popups " ) ) ;
gtk_widget_set_tooltip_text ( button , _ ( " Whether scripts are allowed to open popup windows automatically " ) ) ;
SPANNED_ADD ( button ) ;
2010-12-05 22:14:19 +00:00
if ( katze_widget_has_touchscreen_mode ( parent ?
GTK_WIDGET ( parent ) : GTK_WIDGET ( preferences ) ) )
2012-08-31 19:52:02 +00:00
{
2010-12-05 22:14:19 +00:00
button = katze_property_proxy ( settings , " kinetic-scrolling " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Kinetic scrolling " ) ) ;
gtk_widget_set_tooltip_text ( button , _ ( " Whether scrolling should kinetically move according to speed " ) ) ;
}
2011-07-20 21:10:50 +00:00
else
2012-08-31 19:52:02 +00:00
{
2011-07-20 21:10:50 +00:00
button = katze_property_proxy ( settings , " middle-click-opens-selection " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Middle click opens Selection " ) ) ;
gtk_widget_set_tooltip_text ( button , _ ( " Load an address from the selection via middle click " ) ) ;
}
2011-07-20 21:10:50 +00:00
INDENTED_ADD ( button ) ;
2012-01-03 02:28:22 +00:00
if ( katze_object_has_property ( settings , " enable-webgl " ) )
{
button = katze_property_proxy ( settings , " enable-webgl " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Enable WebGL support " ) ) ;
2012-07-01 20:00:23 +00:00
SPANNED_ADD ( button ) ;
2012-01-03 02:28:22 +00:00
}
2012-07-16 17:04:24 +00:00
# ifndef G_OS_WIN32
button = katze_property_proxy ( settings , " flash-window-on-new-bg-tabs " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Flash window on background tabs " ) ) ;
2012-07-16 17:04:24 +00:00
INDENTED_ADD ( button ) ;
# endif
2012-01-03 02:28:22 +00:00
2011-05-15 09:28:03 +00:00
FRAME_NEW ( NULL ) ;
2012-09-16 23:00:49 +00:00
button = gtk_label_new ( _ ( " Preferred languages " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( button ) , 0.0 , 0.5 ) ;
2009-12-14 22:25:33 +00:00
INDENTED_ADD ( button ) ;
2010-12-05 22:14:19 +00:00
entry = katze_property_proxy ( settings , " preferred-languages " , " languages " ) ;
2012-09-16 23:00:49 +00:00
gtk_widget_set_tooltip_text ( entry , _ ( " A comma separated list of languages preferred for rendering multilingual webpages, for example \" de \" , \" ru,nl \" or \" en-us;q=1.0, fr-fr;q=0.667 \" " ) ) ;
2009-12-14 22:25:33 +00:00
SPANNED_ADD ( entry ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Save downloaded files to: " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2011-05-01 22:02:54 +00:00
INDENTED_ADD ( label ) ;
button = katze_property_proxy ( settings , " download-folder " , " folder " ) ;
SPANNED_ADD ( button ) ;
2007-12-16 22:20:24 +00:00
2008-06-19 18:41:05 +00:00
/* Page "Interface" */
2011-05-01 16:03:43 +00:00
PAGE_NEW ( GTK_STOCK_CONVERT , _ ( " Browsing " ) ) ;
2009-02-11 22:41:09 +00:00
# if !HAVE_HILDON
2011-04-04 19:21:27 +00:00
if ( ! g_getenv ( " DESKTOP_SESSION " ) )
{
2011-05-01 22:02:54 +00:00
FRAME_NEW ( NULL ) ;
2011-04-04 19:21:27 +00:00
INDENTED_ADD ( katze_property_label ( settings , " toolbar-style " ) ) ;
button = katze_property_proxy ( settings , " toolbar-style " , NULL ) ;
SPANNED_ADD ( button ) ;
}
2009-10-25 13:50:29 +00:00
# endif
2011-05-01 22:02:54 +00:00
FRAME_NEW ( NULL ) ;
2008-12-02 01:00:55 +00:00
label = katze_property_label ( settings , " open-new-pages-in " ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2008-04-13 19:51:43 +00:00
button = katze_property_proxy ( settings , " open-new-pages-in " , NULL ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2009-10-26 17:07:10 +00:00
button = katze_property_proxy ( settings , " close-buttons-on-tabs " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Close Buttons on Tabs " ) ) ;
2012-03-14 20:33:16 +00:00
INDENTED_ADD ( button ) ;
# ifndef HAVE_GRANITE
button = katze_property_proxy ( settings , " always-show-tabbar " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Always Show Tabbar " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2009-10-26 17:07:10 +00:00
# endif
2008-08-15 18:38:27 +00:00
button = katze_property_proxy ( settings , " open-tabs-next-to-current " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Open Tabs next to Current " ) ) ;
gtk_widget_set_tooltip_text ( button , _ ( " Whether to open new tabs next to the current tab or after the last one " ) ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( button ) ;
2009-10-26 17:07:10 +00:00
button = katze_property_proxy ( settings , " open-tabs-in-the-background " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_button_set_label ( GTK_BUTTON ( button ) , _ ( " Open tabs in the background " ) ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2012-08-31 19:52:02 +00:00
2011-05-16 01:19:21 +00:00
INDENTED_ADD ( gtk_label_new ( NULL ) ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Text Editor " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2009-10-16 21:25:11 +00:00
entry = katze_property_proxy ( settings , " text-editor " , " application-text/plain " ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " News Aggregator " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2011-05-01 04:59:00 +00:00
INDENTED_ADD ( label ) ;
entry = katze_property_proxy ( settings , " news-aggregator " , " application-News " ) ;
SPANNED_ADD ( entry ) ;
2009-04-28 21:52:16 +00:00
2008-06-19 18:41:05 +00:00
/* Page "Network" */
2008-11-02 23:17:43 +00:00
PAGE_NEW ( GTK_STOCK_NETWORK , _ ( " Network " ) ) ;
2011-05-01 22:02:54 +00:00
FRAME_NEW ( NULL ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Proxy server " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2010-04-02 18:41:39 +00:00
INDENTED_ADD ( label ) ;
button = katze_property_proxy ( settings , " proxy-type " , NULL ) ;
SPANNED_ADD ( button ) ;
label = gtk_label_new ( _ ( " Hostname " ) ) ;
2011-05-15 19:25:53 +00:00
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2012-08-28 21:57:57 +00:00
entry = katze_property_proxy ( settings , " http-proxy " , " address " ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( entry ) ;
2010-04-02 18:41:39 +00:00
g_signal_connect ( settings , " notify::proxy-type " ,
G_CALLBACK ( midori_preferences_notify_proxy_type_cb ) , entry ) ;
midori_preferences_notify_proxy_type_cb ( settings , NULL , entry ) ;
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Port " ) ) ;
2011-10-24 17:53:37 +00:00
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
INDENTED_ADD ( label ) ;
entry = katze_property_proxy ( settings , " http-proxy-port " , NULL ) ;
SPANNED_ADD ( entry ) ;
g_signal_connect ( settings , " notify::proxy-type " ,
G_CALLBACK ( midori_preferences_notify_proxy_type_cb ) , entry ) ;
midori_preferences_notify_proxy_type_cb ( settings , NULL , entry ) ;
2011-05-01 04:59:00 +00:00
# if WEBKIT_CHECK_VERSION (1, 3, 11)
2011-08-08 13:44:38 +00:00
if ( soup_session_get_feature ( webkit_get_default_session ( ) , SOUP_TYPE_CACHE ) )
{
2012-08-31 19:52:02 +00:00
label = gtk_label_new ( _ ( " Web Cache " ) ) ;
gtk_widget_set_tooltip_text ( label , _ ( " The maximum size of cached pages on disk " ) ) ;
2011-08-08 13:44:38 +00:00
INDENTED_ADD ( label ) ;
button = katze_property_proxy ( settings , " maximum-cache-size " , NULL ) ;
2012-08-31 19:52:02 +00:00
gtk_widget_set_tooltip_text ( button , _ ( " The maximum size of cached pages on disk " ) ) ;
2011-08-08 13:44:38 +00:00
SPANNED_ADD ( button ) ;
label = gtk_label_new ( _ ( " MB " ) ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0.0 , 0.5 ) ;
SPANNED_ADD ( label ) ;
}
2011-05-01 04:59:00 +00:00
# endif
2008-12-08 22:18:14 +00:00
label = katze_property_label ( settings , " identify-as " ) ;
2009-10-18 20:06:24 +00:00
INDENTED_ADD ( label ) ;
2010-01-31 21:10:24 +00:00
button = katze_property_proxy ( settings , " identify-as " , " custom-user-agent " ) ;
2009-10-18 20:06:24 +00:00
SPANNED_ADD ( button ) ;
2007-12-16 22:20:24 +00:00
}