2008-03-10 21:26:09 +00:00
/*
2009-01-20 22:27:19 +00:00
Copyright ( C ) 2008 - 2009 Christian Dywan < christian @ twotoasts . de >
2008-03-10 21:26:09 +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-13 09:29:21 +00:00
# include "midori-websettings.h"
2008-03-10 21:26:09 +00:00
# include "sokoke.h"
2008-04-13 09:29:21 +00:00
2008-03-22 02:38:23 +00:00
# include <glib/gi18n.h>
2008-04-13 09:29:21 +00:00
# include <string.h>
2008-03-10 21:26:09 +00:00
2008-12-08 22:18:14 +00:00
# if HAVE_CONFIG_H
# include <config.h>
# endif
2009-06-15 23:48:39 +00:00
# if defined (G_OS_UNIX)
# include <sys/utsname.h>
# endif
2008-06-19 18:41:43 +00:00
struct _MidoriWebSettings
2008-03-10 21:26:09 +00:00
{
2008-06-19 18:41:43 +00:00
WebKitWebSettings parent_instance ;
2008-04-16 23:38:22 +00:00
gboolean remember_last_window_size ;
gint last_window_width ;
gint last_window_height ;
2009-01-20 22:27:19 +00:00
MidoriWindowState last_window_state ;
2008-04-16 23:38:22 +00:00
gint last_panel_position ;
gint last_panel_page ;
gint last_web_search ;
2008-10-12 20:09:49 +00:00
gboolean show_menubar ;
2008-04-16 23:38:22 +00:00
gboolean show_navigationbar ;
gboolean show_bookmarkbar ;
gboolean show_panel ;
2009-03-20 22:55:38 +00:00
gboolean show_transferbar ;
2008-04-16 23:38:22 +00:00
gboolean show_statusbar ;
2008-04-13 09:29:21 +00:00
MidoriToolbarStyle toolbar_style ;
2009-02-11 22:41:09 +00:00
gboolean progress_in_location ;
2009-04-18 21:26:54 +00:00
gboolean search_engines_in_completion ;
2008-10-12 16:14:57 +00:00
gchar * toolbar_items ;
2008-10-21 22:01:01 +00:00
gboolean compact_sidepanel ;
2009-07-26 20:00:10 +00:00
gboolean show_panel_controls ;
2009-02-22 02:51:10 +00:00
gboolean right_align_sidepanel ;
2009-11-28 22:53:49 +00:00
gboolean open_panels_in_windows ;
2008-04-13 09:29:21 +00:00
2008-04-16 23:38:22 +00:00
MidoriStartup load_on_startup ;
gchar * homepage ;
2009-01-12 02:17:37 +00:00
gboolean show_crash_dialog ;
2009-05-10 14:07:28 +00:00
gboolean speed_dial_in_new_tabs ;
2008-04-16 23:38:22 +00:00
gchar * download_folder ;
2009-04-28 21:49:52 +00:00
gboolean ask_for_destination_folder ;
2009-04-26 22:22:16 +00:00
gboolean notify_transfer_completed ;
2008-07-16 20:32:37 +00:00
gchar * download_manager ;
2008-10-20 19:32:25 +00:00
gchar * text_editor ;
2009-04-14 17:44:48 +00:00
gchar * news_aggregator ;
2008-04-16 23:38:22 +00:00
gchar * location_entry_search ;
MidoriPreferredEncoding preferred_encoding ;
2008-10-21 22:01:01 +00:00
gboolean always_show_tabbar ;
2008-04-13 09:29:21 +00:00
gboolean close_buttons_on_tabs ;
MidoriNewPage open_new_pages_in ;
2008-10-20 06:50:16 +00:00
MidoriNewPage open_external_pages_in ;
2008-04-13 09:29:21 +00:00
gboolean middle_click_opens_selection ;
gboolean open_tabs_in_the_background ;
2008-08-15 18:38:27 +00:00
gboolean open_tabs_next_to_current ;
2008-04-13 09:29:21 +00:00
gboolean open_popups_in_tabs ;
2009-01-16 04:05:50 +00:00
gboolean zoom_text_and_images ;
2009-03-01 18:21:27 +00:00
gboolean find_while_typing ;
2009-09-27 21:48:08 +00:00
gboolean kinetic_scrolling ;
2008-04-13 09:29:21 +00:00
MidoriAcceptCookies accept_cookies ;
gboolean original_cookies_only ;
gint maximum_cookie_age ;
gboolean remember_last_visited_pages ;
gint maximum_history_age ;
gboolean remember_last_downloaded_files ;
gchar * http_proxy ;
2010-01-06 23:49:41 +00:00
gchar * http_accept_language ;
2009-02-12 23:49:30 +00:00
gboolean auto_detect_proxy ;
2008-12-08 22:18:14 +00:00
MidoriIdentity identify_as ;
gchar * ident_string ;
2009-05-22 21:53:54 +00:00
gint clear_private_data ;
2008-03-10 21:26:09 +00:00
} ;
2008-12-08 22:18:14 +00:00
struct _MidoriWebSettingsClass
{
WebKitWebSettingsClass parent_class ;
} ;
2008-06-19 18:41:43 +00:00
G_DEFINE_TYPE ( MidoriWebSettings , midori_web_settings , WEBKIT_TYPE_WEB_SETTINGS )
2008-03-10 21:26:09 +00:00
enum
{
PROP_0 ,
2008-04-16 23:38:22 +00:00
PROP_REMEMBER_LAST_WINDOW_SIZE ,
PROP_LAST_WINDOW_WIDTH ,
PROP_LAST_WINDOW_HEIGHT ,
2009-01-20 22:27:19 +00:00
PROP_LAST_WINDOW_STATE ,
2008-04-16 23:38:22 +00:00
PROP_LAST_PANEL_POSITION ,
PROP_LAST_PANEL_PAGE ,
PROP_LAST_WEB_SEARCH ,
2008-10-12 20:09:49 +00:00
PROP_SHOW_MENUBAR ,
2008-04-16 23:38:22 +00:00
PROP_SHOW_NAVIGATIONBAR ,
PROP_SHOW_BOOKMARKBAR ,
PROP_SHOW_PANEL ,
2009-03-20 22:55:38 +00:00
PROP_SHOW_TRANSFERBAR ,
2008-04-16 23:38:22 +00:00
PROP_SHOW_STATUSBAR ,
2008-04-13 09:29:21 +00:00
PROP_TOOLBAR_STYLE ,
2009-02-11 22:41:09 +00:00
PROP_PROGRESS_IN_LOCATION ,
2009-04-18 21:26:54 +00:00
PROP_SEARCH_ENGINES_IN_COMPLETION ,
2008-10-12 16:14:57 +00:00
PROP_TOOLBAR_ITEMS ,
2008-10-21 22:01:01 +00:00
PROP_COMPACT_SIDEPANEL ,
2009-07-26 20:00:10 +00:00
PROP_SHOW_PANEL_CONTROLS ,
2009-02-22 02:51:10 +00:00
PROP_RIGHT_ALIGN_SIDEPANEL ,
2009-11-28 22:53:49 +00:00
PROP_OPEN_PANELS_IN_WINDOWS ,
2008-04-13 09:29:21 +00:00
2008-04-16 23:38:22 +00:00
PROP_LOAD_ON_STARTUP ,
PROP_HOMEPAGE ,
2009-01-12 02:17:37 +00:00
PROP_SHOW_CRASH_DIALOG ,
2009-05-10 14:07:28 +00:00
PROP_SPEED_DIAL_IN_NEW_TABS ,
2008-04-16 23:38:22 +00:00
PROP_DOWNLOAD_FOLDER ,
2009-04-28 21:49:52 +00:00
PROP_ASK_FOR_DESTINATION_FOLDER ,
2009-04-26 22:22:16 +00:00
PROP_NOTIFY_TRANSFER_COMPLETED ,
2008-07-16 20:32:37 +00:00
PROP_DOWNLOAD_MANAGER ,
2008-10-20 19:32:25 +00:00
PROP_TEXT_EDITOR ,
2009-04-14 17:44:48 +00:00
PROP_NEWS_AGGREGATOR ,
2008-04-16 23:38:22 +00:00
PROP_LOCATION_ENTRY_SEARCH ,
PROP_PREFERRED_ENCODING ,
2008-10-21 22:01:01 +00:00
PROP_ALWAYS_SHOW_TABBAR ,
2008-04-13 09:29:21 +00:00
PROP_CLOSE_BUTTONS_ON_TABS ,
PROP_OPEN_NEW_PAGES_IN ,
2008-10-20 06:50:16 +00:00
PROP_OPEN_EXTERNAL_PAGES_IN ,
2008-04-13 09:29:21 +00:00
PROP_MIDDLE_CLICK_OPENS_SELECTION ,
PROP_OPEN_TABS_IN_THE_BACKGROUND ,
2008-08-15 18:38:27 +00:00
PROP_OPEN_TABS_NEXT_TO_CURRENT ,
2008-04-13 09:29:21 +00:00
PROP_OPEN_POPUPS_IN_TABS ,
2009-11-08 20:55:36 +00:00
PROP_AUTO_LOAD_IMAGES ,
PROP_ENABLE_SCRIPTS ,
PROP_ENABLE_PLUGINS ,
2009-12-23 15:24:51 +00:00
PROP_ENABLE_DEVELOPER_EXTRAS ,
2009-12-31 22:24:02 +00:00
PROP_ENABLE_PAGE_CACHE ,
2009-01-16 04:05:50 +00:00
PROP_ZOOM_TEXT_AND_IMAGES ,
2009-03-01 18:21:27 +00:00
PROP_FIND_WHILE_TYPING ,
2009-09-27 21:48:08 +00:00
PROP_KINETIC_SCROLLING ,
2008-04-13 09:29:21 +00:00
PROP_ACCEPT_COOKIES ,
PROP_ORIGINAL_COOKIES_ONLY ,
PROP_MAXIMUM_COOKIE_AGE ,
PROP_REMEMBER_LAST_VISITED_PAGES ,
PROP_MAXIMUM_HISTORY_AGE ,
PROP_REMEMBER_LAST_DOWNLOADED_FILES ,
PROP_HTTP_PROXY ,
2009-02-12 23:49:30 +00:00
PROP_AUTO_DETECT_PROXY ,
2008-12-08 22:18:14 +00:00
PROP_IDENTIFY_AS ,
PROP_IDENT_STRING ,
2010-01-06 23:49:41 +00:00
PROP_PREFERRED_LANGUAGES ,
2009-05-22 21:53:54 +00:00
PROP_CLEAR_PRIVATE_DATA
2008-03-10 21:26:09 +00:00
} ;
2009-01-20 22:27:19 +00:00
GType
midori_window_state_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
{ MIDORI_WINDOW_NORMAL , " MIDORI_WINDOW_NORMAL " , " Normal " } ,
{ MIDORI_WINDOW_MINIMIZED , " MIDORI_WINDOW_MINIMIZED " , " Minimized " } ,
{ MIDORI_WINDOW_MAXIMIZED , " MIDORI_WINDOW_MAXIMIZED " , " Maximized " } ,
{ MIDORI_WINDOW_FULLSCREEN , " MIDORI_WINDOW_FULLSCREEN " , " Fullscreen " } ,
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriWindowState " , values ) ;
}
return type ;
}
2008-04-13 09:29:21 +00:00
GType
midori_startup_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
2009-07-22 21:53:29 +00:00
{ MIDORI_STARTUP_BLANK_PAGE , " MIDORI_STARTUP_BLANK_PAGE " , N_ ( " Show Blank page " ) } ,
{ MIDORI_STARTUP_HOMEPAGE , " MIDORI_STARTUP_HOMEPAGE " , N_ ( " Show Homepage " ) } ,
{ MIDORI_STARTUP_LAST_OPEN_PAGES , " MIDORI_STARTUP_LAST_OPEN_PAGES " , N_ ( " Show last open tabs " ) } ,
2008-04-13 09:29:21 +00:00
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriStartup " , values ) ;
}
return type ;
}
GType
midori_preferred_encoding_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
2008-04-18 00:40:53 +00:00
{ MIDORI_ENCODING_CHINESE , " MIDORI_ENCODING_CHINESE " , N_ ( " Chinese (BIG5) " ) } ,
{ MIDORI_ENCODING_JAPANESE , " MIDORI_ENCODING_JAPANESE " , N_ ( " Japanese (SHIFT_JIS) " ) } ,
2009-10-31 21:51:35 +00:00
{ MIDORI_ENCODING_KOREAN , " MIDORI_ENCODING_KOREAN " , N_ ( " Korean (EUC-KR) " ) } ,
2008-04-18 00:40:53 +00:00
{ MIDORI_ENCODING_RUSSIAN , " MIDORI_ENCODING_RUSSIAN " , N_ ( " Russian (KOI8-R) " ) } ,
{ MIDORI_ENCODING_UNICODE , " MIDORI_ENCODING_UNICODE " , N_ ( " Unicode (UTF-8) " ) } ,
{ MIDORI_ENCODING_WESTERN , " MIDORI_ENCODING_WESTERN " , N_ ( " Western (ISO-8859-1) " ) } ,
2008-12-08 22:18:14 +00:00
{ MIDORI_ENCODING_CUSTOM , " MIDORI_ENCODING_CUSTOM " , N_ ( " Custom... " ) } ,
2008-04-13 09:29:21 +00:00
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriPreferredEncoding " , values ) ;
}
return type ;
}
GType
midori_new_page_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
2008-04-18 00:40:53 +00:00
{ MIDORI_NEW_PAGE_TAB , " MIDORI_NEW_PAGE_TAB " , N_ ( " New tab " ) } ,
{ MIDORI_NEW_PAGE_WINDOW , " MIDORI_NEW_PAGE_WINDOW " , N_ ( " New window " ) } ,
{ MIDORI_NEW_PAGE_CURRENT , " MIDORI_NEW_PAGE_CURRENT " , N_ ( " Current tab " ) } ,
2008-04-13 09:29:21 +00:00
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriNewPage " , values ) ;
}
return type ;
}
GType
midori_toolbar_style_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
2008-04-18 00:40:53 +00:00
{ MIDORI_TOOLBAR_DEFAULT , " MIDORI_TOOLBAR_DEFAULT " , N_ ( " Default " ) } ,
{ MIDORI_TOOLBAR_ICONS , " MIDORI_TOOLBAR_ICONS " , N_ ( " Icons " ) } ,
2009-11-17 17:49:14 +00:00
{ MIDORI_TOOLBAR_SMALL_ICONS , " MIDORI_TOOLBAR_SMALL_ICONS " , N_ ( " Small icons " ) } ,
2008-04-18 00:40:53 +00:00
{ MIDORI_TOOLBAR_TEXT , " MIDORI_TOOLBAR_TEXT " , N_ ( " Text " ) } ,
2009-07-22 21:53:29 +00:00
{ MIDORI_TOOLBAR_BOTH , " MIDORI_TOOLBAR_BOTH " , N_ ( " Icons and text " ) } ,
{ MIDORI_TOOLBAR_BOTH_HORIZ , " MIDORI_TOOLBAR_BOTH_HORIZ " , N_ ( " Text beside icons " ) } ,
2008-04-13 09:29:21 +00:00
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriToolbarStyle " , values ) ;
}
return type ;
}
GType
midori_accept_cookies_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
2008-04-18 00:40:53 +00:00
{ MIDORI_ACCEPT_COOKIES_ALL , " MIDORI_ACCEPT_COOKIES_ALL " , N_ ( " All cookies " ) } ,
{ MIDORI_ACCEPT_COOKIES_SESSION , " MIDORI_ACCEPT_COOKIES_SESSION " , N_ ( " Session cookies " ) } ,
{ MIDORI_ACCEPT_COOKIES_NONE , " MIDORI_ACCEPT_COOKIES_NONE " , N_ ( " None " ) } ,
2008-04-13 09:29:21 +00:00
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriAcceptCookies " , values ) ;
}
return type ;
}
2008-12-08 22:18:14 +00:00
GType
midori_identity_get_type ( void )
{
static GType type = 0 ;
if ( ! type )
{
static const GEnumValue values [ ] = {
{ MIDORI_IDENT_MIDORI , " MIDORI_IDENT_MIDORI " , N_ ( " Midori " ) } ,
{ MIDORI_IDENT_SAFARI , " MIDORI_IDENT_SAFARI " , N_ ( " Safari " ) } ,
2009-09-14 15:52:31 +00:00
{ MIDORI_IDENT_IPHONE , " MIDORI_IDENT_IPHONE " , N_ ( " iPhone " ) } ,
2008-12-08 22:18:14 +00:00
{ MIDORI_IDENT_FIREFOX , " MIDORI_IDENT_FIREFOX " , N_ ( " Firefox " ) } ,
{ MIDORI_IDENT_EXPLORER , " MIDORI_IDENT_EXPLORER " , N_ ( " Internet Explorer " ) } ,
{ MIDORI_IDENT_CUSTOM , " MIDORI_IDENT_CUSTOM " , N_ ( " Custom... " ) } ,
{ 0 , NULL , NULL }
} ;
type = g_enum_register_static ( " MidoriIdentity " , values ) ;
}
return type ;
}
2008-03-10 21:26:09 +00:00
static void
midori_web_settings_finalize ( GObject * object ) ;
static void
2008-04-13 09:29:21 +00:00
midori_web_settings_set_property ( GObject * object ,
guint prop_id ,
2008-03-10 21:26:09 +00:00
const GValue * value ,
2008-04-13 09:29:21 +00:00
GParamSpec * pspec ) ;
2008-03-10 21:26:09 +00:00
static void
2008-04-13 09:29:21 +00:00
midori_web_settings_get_property ( GObject * object ,
guint prop_id ,
GValue * value ,
2008-03-10 21:26:09 +00:00
GParamSpec * pspec ) ;
2009-03-19 17:28:50 +00:00
static const gchar *
midori_get_download_dir ( void )
{
const gchar * dir = g_get_user_special_dir ( G_USER_DIRECTORY_DOWNLOAD ) ;
if ( dir )
{
2009-10-20 16:24:24 +00:00
katze_mkdir_with_parents ( dir , 0700 ) ;
2009-03-19 17:28:50 +00:00
return dir ;
}
return g_get_home_dir ( ) ;
}
2008-03-10 21:26:09 +00:00
static void
midori_web_settings_class_init ( MidoriWebSettingsClass * class )
{
2008-11-16 01:00:17 +00:00
GObjectClass * gobject_class ;
GParamFlags flags ;
gobject_class = G_OBJECT_CLASS ( class ) ;
2008-03-10 21:26:09 +00:00
gobject_class - > finalize = midori_web_settings_finalize ;
gobject_class - > set_property = midori_web_settings_set_property ;
gobject_class - > get_property = midori_web_settings_get_property ;
2009-01-16 04:19:43 +00:00
flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS ;
2008-03-10 21:26:09 +00:00
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_REMEMBER_LAST_WINDOW_SIZE ,
g_param_spec_boolean (
" remember-last-window-size " ,
_ ( " Remember last window size " ) ,
_ ( " Whether to save the last window size " ) ,
TRUE ,
2008-04-13 09:29:21 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_LAST_WINDOW_WIDTH ,
g_param_spec_int (
" last-window-width " ,
_ ( " Last window width " ) ,
_ ( " The last saved window width " ) ,
0 , G_MAXINT , 0 ,
2008-04-13 09:29:21 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_LAST_WINDOW_HEIGHT ,
g_param_spec_int (
" last-window-height " ,
_ ( " Last window height " ) ,
_ ( " The last saved window height " ) ,
0 , G_MAXINT , 0 ,
flags ) ) ;
2009-01-20 22:27:19 +00:00
/**
* MidoriWebSettings : last - window - state :
*
* The last saved window state .
*
* Since : 0.1 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_LAST_WINDOW_STATE ,
g_param_spec_enum (
" last-window-state " ,
" Last window state " ,
" The last saved window state " ,
MIDORI_TYPE_WINDOW_STATE ,
MIDORI_WINDOW_NORMAL ,
flags ) ) ;
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
PROP_LAST_PANEL_POSITION ,
g_param_spec_int (
" last-panel-position " ,
_ ( " Last panel position " ) ,
_ ( " The last saved panel position " ) ,
0 , G_MAXINT , 0 ,
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_LAST_PANEL_PAGE ,
g_param_spec_int (
" last-panel-page " ,
2008-11-08 02:05:30 +00:00
/* i18n: The internal index of the last opened panel */
2008-04-16 23:38:22 +00:00
_ ( " Last panel page " ) ,
_ ( " The last saved panel page " ) ,
0 , G_MAXINT , 0 ,
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_LAST_WEB_SEARCH ,
g_param_spec_int (
" last-web-search " ,
_ ( " Last Web search " ) ,
_ ( " The last saved Web search " ) ,
0 , G_MAXINT , 0 ,
flags ) ) ;
2008-10-12 20:09:49 +00:00
g_object_class_install_property ( gobject_class ,
PROP_SHOW_MENUBAR ,
g_param_spec_boolean (
" show-menubar " ,
_ ( " Show Menubar " ) ,
_ ( " Whether to show the menubar " ) ,
TRUE ,
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_SHOW_NAVIGATIONBAR ,
2008-04-13 09:29:21 +00:00
g_param_spec_boolean (
2008-04-16 23:38:22 +00:00
" show-navigationbar " ,
_ ( " Show Navigationbar " ) ,
_ ( " Whether to show the navigationbar " ) ,
2008-04-13 09:29:21 +00:00
TRUE ,
2008-04-16 23:38:22 +00:00
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_SHOW_BOOKMARKBAR ,
g_param_spec_boolean (
" show-bookmarkbar " ,
_ ( " Show Bookmarkbar " ) ,
_ ( " Whether to show the bookmarkbar " ) ,
FALSE ,
2008-04-13 09:29:21 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
2008-04-16 23:38:22 +00:00
PROP_SHOW_PANEL ,
g_param_spec_boolean (
" show-panel " ,
_ ( " Show Panel " ) ,
_ ( " Whether to show the panel " ) ,
FALSE ,
2008-04-13 09:29:21 +00:00
flags ) ) ;
2009-03-20 22:55:38 +00:00
/**
* MidoriWebSettings : show - transferbar :
*
* Whether to show the transferbar .
*
* Since : 0.1 .5
*/
g_object_class_install_property ( gobject_class ,
PROP_SHOW_TRANSFERBAR ,
g_param_spec_boolean (
" show-transferbar " ,
_ ( " Show Transferbar " ) ,
_ ( " Whether to show the transferbar " ) ,
TRUE ,
flags ) ) ;
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
PROP_SHOW_STATUSBAR ,
g_param_spec_boolean (
" show-statusbar " ,
_ ( " Show Statusbar " ) ,
_ ( " Whether to show the statusbar " ) ,
TRUE ,
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_TOOLBAR_STYLE ,
g_param_spec_enum (
" toolbar-style " ,
2009-07-22 21:53:29 +00:00
_ ( " Toolbar Style: " ) ,
2008-04-13 09:29:21 +00:00
_ ( " The style of the toolbar " ) ,
MIDORI_TYPE_TOOLBAR_STYLE ,
MIDORI_TOOLBAR_DEFAULT ,
flags ) ) ;
2009-02-11 22:41:09 +00:00
/**
* MidoriWebSettings : progress - in - location :
*
* Whether to show loading progress in the location entry .
*
* Since : 0.1 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_PROGRESS_IN_LOCATION ,
g_param_spec_boolean (
" progress-in-location " ,
_ ( " Show progress in location entry " ) ,
_ ( " Whether to show loading progress in the location entry " ) ,
TRUE ,
flags ) ) ;
2009-04-18 21:26:54 +00:00
/**
* MidoriWebSettings : search - engines - in - completion :
*
* Whether to show search engines in the location completion .
*
2010-01-28 21:19:00 +00:00
* Since : 0.1 .6
2009-04-18 21:26:54 +00:00
*/
g_object_class_install_property ( gobject_class ,
PROP_SEARCH_ENGINES_IN_COMPLETION ,
g_param_spec_boolean (
" search-engines-in-completion " ,
_ ( " Search engines in location completion " ) ,
_ ( " Whether to show search engines in the location completion " ) ,
TRUE ,
flags ) ) ;
2008-10-12 16:14:57 +00:00
g_object_class_install_property ( gobject_class ,
PROP_TOOLBAR_ITEMS ,
g_param_spec_string (
" toolbar-items " ,
_ ( " Toolbar Items " ) ,
_ ( " The items to show on the toolbar " ) ,
2009-12-26 22:12:36 +00:00
" TabNew,Back,Forward,Next,ReloadStop,Location,Panel,Search,Trash " ,
2008-10-12 16:14:57 +00:00
flags ) ) ;
2008-10-03 23:45:17 +00:00
g_object_class_install_property ( gobject_class ,
2008-10-21 22:01:01 +00:00
PROP_COMPACT_SIDEPANEL ,
2008-10-03 23:45:17 +00:00
g_param_spec_boolean (
2008-10-21 22:01:01 +00:00
" compact-sidepanel " ,
_ ( " Compact Sidepanel " ) ,
_ ( " Whether to make the sidepanel compact " ) ,
2008-10-03 23:45:17 +00:00
FALSE ,
flags ) ) ;
2009-07-26 20:00:10 +00:00
/**
* MidoriWebSettings : show - panel - controls :
*
* Whether to show the operating controls of the panel .
*
* Since : 0.1 .9
*/
g_object_class_install_property ( gobject_class ,
PROP_SHOW_PANEL_CONTROLS ,
g_param_spec_boolean (
" show-panel-controls " ,
_ ( " Show operating controls of the panel " ) ,
_ ( " Whether to show the operating controls of the panel " ) ,
TRUE ,
flags ) ) ;
2009-02-22 02:51:10 +00:00
/**
* MidoriWebSettings : right - sidepanel :
*
* Whether to align the sidepanel on the right .
*
* Since : 0.1 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_RIGHT_ALIGN_SIDEPANEL ,
g_param_spec_boolean (
" right-align-sidepanel " ,
_ ( " Align sidepanel on the right " ) ,
_ ( " Whether to align the sidepanel on the right " ) ,
FALSE ,
flags ) ) ;
2009-11-28 22:53:49 +00:00
/**
* MidoriWebSettings : open - panels - in - window :
*
* Whether to open panels in separate windows .
*
* Since : 0.2 .2
*/
g_object_class_install_property ( gobject_class ,
PROP_OPEN_PANELS_IN_WINDOWS ,
g_param_spec_boolean (
" open-panels-in-windows " ,
_ ( " Open panels in separate windows " ) ,
_ ( " Whether to always open panels in separate windows " ) ,
FALSE ,
flags ) ) ;
2008-04-13 09:29:21 +00:00
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
PROP_LOAD_ON_STARTUP ,
g_param_spec_enum (
" load-on-startup " ,
2009-07-22 21:53:29 +00:00
_ ( " When Midori starts: " ) ,
_ ( " What to do when Midori starts " ) ,
2008-04-16 23:38:22 +00:00
MIDORI_TYPE_STARTUP ,
2009-04-27 18:49:32 +00:00
MIDORI_STARTUP_LAST_OPEN_PAGES ,
2008-04-16 23:38:22 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_HOMEPAGE ,
g_param_spec_string (
" homepage " ,
2009-07-22 21:53:29 +00:00
_ ( " Homepage: " ) ,
2008-04-16 23:38:22 +00:00
_ ( " The homepage " ) ,
" http://www.google.com " ,
flags ) ) ;
2009-01-12 02:17:37 +00:00
/**
* MidoriWebSettings : show - crash - dialog :
*
* Show a dialog after Midori crashed .
*
* Since : 0.1 .2
*/
g_object_class_install_property ( gobject_class ,
PROP_SHOW_CRASH_DIALOG ,
g_param_spec_boolean (
" show-crash-dialog " ,
_ ( " Show crash dialog " ) ,
_ ( " Show a dialog after Midori crashed " ) ,
TRUE ,
flags ) ) ;
2009-05-08 01:29:25 +00:00
/**
2009-05-10 14:07:28 +00:00
* MidoriWebSettings : speed - dial - in - new - tabs :
2009-05-08 01:29:25 +00:00
*
2009-05-10 14:07:28 +00:00
* Show spee dial in newly opened tabs .
2009-05-08 01:29:25 +00:00
*
* Since : 0.1 .7
*/
g_object_class_install_property ( gobject_class ,
2009-05-10 14:07:28 +00:00
PROP_SPEED_DIAL_IN_NEW_TABS ,
2009-05-08 01:29:25 +00:00
g_param_spec_boolean (
2009-05-10 14:07:28 +00:00
" speed-dial-in-new-tabs " ,
/* i18n: Speed dial, webpage shortcuts, named for the phone function */
_ ( " Show speed dial in new tabs " ) ,
_ ( " Show speed dial in newly opened tabs " ) ,
2009-05-08 01:29:25 +00:00
TRUE ,
flags ) ) ;
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
PROP_DOWNLOAD_FOLDER ,
g_param_spec_string (
" download-folder " ,
2009-07-22 21:53:29 +00:00
_ ( " Save downloaded files to: " ) ,
2008-04-16 23:38:22 +00:00
_ ( " The folder downloaded files are saved to " ) ,
2009-03-19 17:28:50 +00:00
midori_get_download_dir ( ) ,
# if WEBKIT_CHECK_VERSION (1, 1, 3)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
# else
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
# endif
2008-04-16 23:38:22 +00:00
2009-04-28 21:49:52 +00:00
/**
* MidoriWebSettings : ask - for - destination - folder :
*
* Whether to ask for the destination folder when downloading a file .
*
2009-09-20 19:04:15 +00:00
* Note : Only since 0.2 .0 is this value actually used .
*
2009-04-28 21:49:52 +00:00
* Since : 0.1 .7
*/
g_object_class_install_property ( gobject_class ,
PROP_ASK_FOR_DESTINATION_FOLDER ,
g_param_spec_boolean (
" ask-for-destination-folder " ,
_ ( " Ask for the destination folder " ) ,
_ ( " Whether to ask for the destination folder when downloading a file " ) ,
FALSE ,
2009-09-20 19:04:15 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 15)
2009-04-28 21:49:52 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
# else
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
# endif
2009-04-26 22:22:16 +00:00
/**
* MidoriWebSettings : notify - transfer - completed :
*
* Whether to show a notification when a transfer has been completed .
*
* Since : 0.1 .7
*/
g_object_class_install_property ( gobject_class ,
PROP_NOTIFY_TRANSFER_COMPLETED ,
g_param_spec_boolean (
" notify-transfer-completed " ,
_ ( " Notify when a transfer has been completed " ) ,
2009-04-28 21:49:52 +00:00
_ ( " Whether to show a notification when a transfer has been completed " ) ,
2009-04-26 22:22:16 +00:00
TRUE ,
# if WEBKIT_CHECK_VERSION (1, 1, 3)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
# else
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
# endif
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
2008-07-16 20:32:37 +00:00
PROP_DOWNLOAD_MANAGER ,
g_param_spec_string (
" download-manager " ,
_ ( " Download Manager " ) ,
_ ( " An external download manager " ) ,
NULL ,
flags ) ) ;
2008-04-16 23:38:22 +00:00
2008-10-20 19:32:25 +00:00
g_object_class_install_property ( gobject_class ,
PROP_TEXT_EDITOR ,
g_param_spec_string (
" text-editor " ,
_ ( " Text Editor " ) ,
_ ( " An external text editor " ) ,
NULL ,
flags ) ) ;
2009-04-14 17:44:48 +00:00
/**
* MidoriWebSettings : news - aggregator :
*
* An external news aggregator .
*
* Since : 0.1 .6
*/
g_object_class_install_property ( gobject_class ,
PROP_NEWS_AGGREGATOR ,
g_param_spec_string (
" news-aggregator " ,
_ ( " News Aggregator " ) ,
_ ( " An external news aggregator " ) ,
NULL ,
flags ) ) ;
2008-04-16 23:38:22 +00:00
g_object_class_install_property ( gobject_class ,
PROP_LOCATION_ENTRY_SEARCH ,
g_param_spec_string (
" location-entry-search " ,
_ ( " Location entry Search " ) ,
_ ( " The search to perform inside the location entry " ) ,
2010-01-30 15:54:38 +00:00
NULL ,
2008-04-16 23:38:22 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_PREFERRED_ENCODING ,
g_param_spec_enum (
" preferred-encoding " ,
_ ( " Preferred Encoding " ) ,
_ ( " The preferred character encoding " ) ,
MIDORI_TYPE_PREFERRED_ENCODING ,
MIDORI_ENCODING_WESTERN ,
flags ) ) ;
2008-10-21 22:01:01 +00:00
g_object_class_install_property ( gobject_class ,
PROP_ALWAYS_SHOW_TABBAR ,
g_param_spec_boolean (
" always-show-tabbar " ,
_ ( " Always Show Tabbar " ) ,
_ ( " Always show the tabbar " ) ,
FALSE ,
flags ) ) ;
2008-03-10 21:26:09 +00:00
g_object_class_install_property ( gobject_class ,
2008-04-13 09:29:21 +00:00
PROP_CLOSE_BUTTONS_ON_TABS ,
2008-03-10 21:26:09 +00:00
g_param_spec_boolean (
2008-04-13 09:29:21 +00:00
" close-buttons-on-tabs " ,
_ ( " Close Buttons on Tabs " ) ,
2008-03-22 02:38:23 +00:00
_ ( " Whether tabs have close buttons " ) ,
2008-05-02 20:30:26 +00:00
TRUE ,
2008-03-10 21:26:09 +00:00
flags ) ) ;
g_object_class_install_property ( gobject_class ,
2008-04-13 09:29:21 +00:00
PROP_OPEN_NEW_PAGES_IN ,
g_param_spec_enum (
" open-new-pages-in " ,
2009-07-22 21:53:29 +00:00
_ ( " Open new pages in: " ) ,
2008-04-13 09:29:21 +00:00
_ ( " Where to open new pages " ) ,
MIDORI_TYPE_NEW_PAGE ,
MIDORI_NEW_PAGE_TAB ,
2009-03-16 01:05:45 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
2008-10-20 06:50:16 +00:00
g_object_class_install_property ( gobject_class ,
PROP_OPEN_EXTERNAL_PAGES_IN ,
g_param_spec_enum (
" open-external-pages-in " ,
2009-07-22 21:53:29 +00:00
_ ( " Open external pages in: " ) ,
2008-10-20 06:50:16 +00:00
_ ( " Where to open externally opened pages " ) ,
MIDORI_TYPE_NEW_PAGE ,
MIDORI_NEW_PAGE_TAB ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-10-20 06:50:16 +00:00
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_MIDDLE_CLICK_OPENS_SELECTION ,
2008-03-10 21:26:09 +00:00
g_param_spec_boolean (
2008-04-13 09:29:21 +00:00
" middle-click-opens-selection " ,
_ ( " Middle click opens Selection " ) ,
2009-01-04 18:21:25 +00:00
_ ( " Load an address from the selection via middle click " ) ,
2009-08-23 22:18:22 +00:00
TRUE ,
2008-03-10 21:26:09 +00:00
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_OPEN_TABS_IN_THE_BACKGROUND ,
g_param_spec_boolean (
" open-tabs-in-the-background " ,
_ ( " Open tabs in the background " ) ,
_ ( " Whether to open new tabs in the background " ) ,
FALSE ,
flags ) ) ;
2008-08-15 18:38:27 +00:00
g_object_class_install_property ( gobject_class ,
PROP_OPEN_TABS_NEXT_TO_CURRENT ,
g_param_spec_boolean (
" open-tabs-next-to-current " ,
_ ( " Open Tabs next to Current " ) ,
2009-04-28 21:49:52 +00:00
_ ( " Whether to open new tabs next to the current tab or after the last one " ) ,
2008-08-15 18:38:27 +00:00
TRUE ,
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_OPEN_POPUPS_IN_TABS ,
g_param_spec_boolean (
" open-popups-in-tabs " ,
_ ( " Open popups in tabs " ) ,
_ ( " Whether to open popup windows in tabs " ) ,
TRUE ,
2009-01-16 04:19:43 +00:00
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
2009-11-08 20:55:36 +00:00
/* Override properties to localize them for preference proxies */
g_object_class_install_property ( gobject_class ,
PROP_AUTO_LOAD_IMAGES ,
g_param_spec_boolean (
" auto-load-images " ,
_ ( " Load images automatically " ) ,
_ ( " Load and display images automatically " ) ,
TRUE ,
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_ENABLE_SCRIPTS ,
g_param_spec_boolean (
" enable-scripts " ,
_ ( " Enable scripts " ) ,
_ ( " Enable embedded scripting languages " ) ,
TRUE ,
flags ) ) ;
g_object_class_install_property ( gobject_class ,
PROP_ENABLE_PLUGINS ,
g_param_spec_boolean (
" enable-plugins " ,
_ ( " Enable Netscape plugins " ) ,
_ ( " Enable embedded Netscape plugin objects " ) ,
TRUE ,
flags ) ) ;
2009-12-23 15:24:51 +00:00
/* Override properties to override defaults */
g_object_class_install_property ( gobject_class ,
PROP_ENABLE_DEVELOPER_EXTRAS ,
g_param_spec_boolean (
" enable-developer-extras " ,
" Enable developer tools " ,
" Enable special extensions for developers " ,
TRUE ,
flags ) ) ;
2009-12-31 22:24:02 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 18)
g_object_class_install_property ( gobject_class ,
PROP_ENABLE_PAGE_CACHE ,
g_param_spec_boolean ( " enable-page-cache " ,
" Enable page cache " ,
" Whether the page cache should be used " ,
TRUE ,
flags ) ) ;
# endif
2009-11-08 20:55:36 +00:00
2008-12-23 22:15:36 +00:00
/**
2009-03-16 01:05:45 +00:00
* MidoriWebSettings : zoom - text - and - images :
*
* Whether to zoom text and images .
*
* Since : 0.1 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_ZOOM_TEXT_AND_IMAGES ,
g_param_spec_boolean (
" zoom-text-and-images " ,
_ ( " Zoom Text and Images " ) ,
_ ( " Whether to zoom text and images " ) ,
FALSE ,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2009-01-16 04:05:50 +00:00
2009-03-01 18:21:27 +00:00
/**
* MidoriWebSettings : find - while - typing :
*
* Whether to automatically find inline while typing something .
*
* Since : 0.1 .4
*/
g_object_class_install_property ( gobject_class ,
PROP_FIND_WHILE_TYPING ,
g_param_spec_boolean (
" find-while-typing " ,
_ ( " Find inline while typing " ) ,
_ ( " Whether to automatically find inline while typing " ) ,
2009-03-03 00:02:28 +00:00
FALSE ,
2009-03-01 18:21:27 +00:00
flags ) ) ;
2009-09-27 21:48:08 +00:00
/**
* MidoriWebSettings : kinetic - scrolling :
*
* Whether scrolling should kinetically move according to speed .
*
* Since : 0.2 .0
*/
g_object_class_install_property ( gobject_class ,
PROP_KINETIC_SCROLLING ,
g_param_spec_boolean (
" kinetic-scrolling " ,
_ ( " Kinetic scrolling " ) ,
_ ( " Whether scrolling should kinetically move according to speed " ) ,
TRUE ,
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_ACCEPT_COOKIES ,
g_param_spec_enum (
" accept-cookies " ,
_ ( " Accept cookies " ) ,
_ ( " What type of cookies to accept " ) ,
MIDORI_TYPE_ACCEPT_COOKIES ,
MIDORI_ACCEPT_COOKIES_ALL ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
2009-12-23 15:01:24 +00:00
/**
* MidoriWebSettings : original - cookies - only :
*
* Accept cookies from the original website only .
*
* Deprecated : 0.2 .3 : This value is not used .
*/
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_ORIGINAL_COOKIES_ONLY ,
g_param_spec_boolean (
" original-cookies-only " ,
_ ( " Original cookies only " ) ,
_ ( " Accept cookies from the original website only " ) ,
FALSE ,
2009-01-16 04:19:43 +00:00
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_MAXIMUM_COOKIE_AGE ,
g_param_spec_int (
" maximum-cookie-age " ,
_ ( " Maximum cookie age " ) ,
_ ( " The maximum number of days to save cookies for " ) ,
0 , G_MAXINT , 30 ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
2009-11-14 17:29:29 +00:00
/**
* MidoriWebSettings : remember - last - visited - pages :
*
* Whether the last visited pages are saved .
*
* Deprecated : 0.2 .2
*/
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_REMEMBER_LAST_VISITED_PAGES ,
g_param_spec_boolean (
" remember-last-visited-pages " ,
_ ( " Remember last visited pages " ) ,
_ ( " Whether the last visited pages are saved " ) ,
TRUE ,
2008-10-13 16:29:46 +00:00
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_MAXIMUM_HISTORY_AGE ,
g_param_spec_int (
" maximum-history-age " ,
_ ( " Maximum history age " ) ,
_ ( " The maximum number of days to save the history for " ) ,
0 , G_MAXINT , 30 ,
2008-10-15 23:31:47 +00:00
flags ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_REMEMBER_LAST_DOWNLOADED_FILES ,
g_param_spec_boolean (
" remember-last-downloaded-files " ,
_ ( " Remember last downloaded files " ) ,
_ ( " Whether the last downloaded files are saved " ) ,
TRUE ,
2009-01-16 04:19:43 +00:00
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
g_object_class_install_property ( gobject_class ,
PROP_HTTP_PROXY ,
g_param_spec_string (
" http-proxy " ,
2009-01-04 18:21:25 +00:00
_ ( " Proxy Server " ) ,
_ ( " The proxy server used for HTTP connections " ) ,
2008-10-05 22:27:25 +00:00
NULL ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-12-08 22:18:14 +00:00
2009-02-12 23:49:30 +00:00
/**
* MidoriWebSettings : auto - detect - proxy :
*
* Whether to detect the proxy server automatically from the environment
*
* Since : 0.1 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_AUTO_DETECT_PROXY ,
g_param_spec_boolean (
" auto-detect-proxy " ,
_ ( " Detect proxy server automatically " ) ,
_ ( " Whether to detect the proxy server automatically from the environment " ) ,
TRUE ,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-12-08 22:18:14 +00:00
/**
* MidoriWebSettings : identify - as :
*
* What to identify as to web pages .
*
* Since : 0.1 .2
*/
g_object_class_install_property ( gobject_class ,
PROP_IDENTIFY_AS ,
g_param_spec_enum (
" identify-as " ,
2009-01-04 18:21:25 +00:00
/* i18n: This refers to an application, not the 'user agent' string */
2008-12-08 22:18:14 +00:00
_ ( " Identify as " ) ,
_ ( " What to identify as to web pages " ) ,
MIDORI_TYPE_IDENTITY ,
MIDORI_IDENT_MIDORI ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-12-08 22:18:14 +00:00
/**
* MidoriWebSettings : ident - string :
*
* The browser identification string .
*
* Since : 0.1 .2
*/
g_object_class_install_property ( gobject_class ,
PROP_IDENT_STRING ,
g_param_spec_string (
" ident-string " ,
_ ( " Identification string " ) ,
_ ( " The application identification string " ) ,
NULL ,
2009-01-16 04:19:43 +00:00
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2008-04-13 09:29:21 +00:00
2010-01-06 23:49:41 +00:00
/**
* MidoriWebSettings : preferred - languages :
*
* A comma separated list of languages preferred for rendering multilingual webpages .
*
* Since : 0.2 .3
*/
g_object_class_install_property ( gobject_class ,
PROP_PREFERRED_LANGUAGES ,
g_param_spec_string (
" preferred-languages " ,
_ ( " Preferred languages " ) ,
_ ( " 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 \" " ) ,
NULL ,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ) ;
2009-05-22 21:53:54 +00:00
/**
* MidoriWebSettings : clear - private - data :
*
* The private data selected for deletion .
*
* Since : 0.1 .7
*/
g_object_class_install_property ( gobject_class ,
PROP_CLEAR_PRIVATE_DATA ,
g_param_spec_int (
" clear-private-data " ,
_ ( " Clear private data " ) ,
_ ( " The private data selected for deletion " ) ,
0 , G_MAXINT , 0 ,
flags ) ) ;
2008-03-10 21:26:09 +00:00
}
2008-04-13 09:29:21 +00:00
static void
2008-10-02 22:49:16 +00:00
notify_default_encoding_cb ( GObject * object ,
GParamSpec * pspec )
2008-04-13 09:29:21 +00:00
{
2008-11-16 01:00:17 +00:00
MidoriWebSettings * web_settings ;
2009-05-14 20:26:02 +00:00
gchar * string ;
2008-11-16 01:00:17 +00:00
const gchar * encoding ;
web_settings = MIDORI_WEB_SETTINGS ( object ) ;
2008-04-13 09:29:21 +00:00
g_object_get ( object , " default-encoding " , & string , NULL ) ;
2008-11-16 01:00:17 +00:00
encoding = string ? string : " " ;
2008-04-13 09:29:21 +00:00
if ( ! strcmp ( encoding , " BIG5 " ) )
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_CHINESE ;
2008-04-13 09:29:21 +00:00
else if ( ! strcmp ( encoding , " SHIFT_JIS " ) )
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_JAPANESE ;
2009-10-31 21:51:35 +00:00
else if ( ! strcmp ( encoding , " EUC-KR " ) )
web_settings - > preferred_encoding = MIDORI_ENCODING_KOREAN ;
2008-04-13 09:29:21 +00:00
else if ( ! strcmp ( encoding , " KOI8-R " ) )
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_RUSSIAN ;
2008-04-13 09:29:21 +00:00
else if ( ! strcmp ( encoding , " UTF-8 " ) )
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_UNICODE ;
2008-04-13 09:29:21 +00:00
else if ( ! strcmp ( encoding , " ISO-8859-1 " ) )
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_WESTERN ;
2008-04-13 09:29:21 +00:00
else
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = MIDORI_ENCODING_CUSTOM ;
2009-05-14 20:26:02 +00:00
g_free ( string ) ;
2008-04-13 09:29:21 +00:00
g_object_notify ( object , " preferred-encoding " ) ;
}
2008-03-10 21:26:09 +00:00
static void
midori_web_settings_init ( MidoriWebSettings * web_settings )
{
2009-04-26 22:22:16 +00:00
web_settings - > notify_transfer_completed = TRUE ;
2009-03-19 17:28:50 +00:00
web_settings - > download_folder = g_strdup ( midori_get_download_dir ( ) ) ;
2008-10-05 22:27:25 +00:00
web_settings - > http_proxy = NULL ;
2009-07-26 20:00:10 +00:00
web_settings - > show_panel_controls = TRUE ;
2009-02-22 18:29:08 +00:00
web_settings - > open_popups_in_tabs = TRUE ;
web_settings - > remember_last_downloaded_files = TRUE ;
2009-09-27 21:48:08 +00:00
web_settings - > kinetic_scrolling = TRUE ;
2009-02-22 18:29:08 +00:00
web_settings - > auto_detect_proxy = TRUE ;
2008-10-05 22:27:25 +00:00
2008-04-13 09:29:21 +00:00
g_signal_connect ( web_settings , " notify::default-encoding " ,
G_CALLBACK ( notify_default_encoding_cb ) , NULL ) ;
2008-03-10 21:26:09 +00:00
}
static void
midori_web_settings_finalize ( GObject * object )
{
2009-05-14 20:26:02 +00:00
MidoriWebSettings * web_settings ;
web_settings = MIDORI_WEB_SETTINGS ( object ) ;
katze_assign ( web_settings - > toolbar_items , NULL ) ;
katze_assign ( web_settings - > homepage , NULL ) ;
katze_assign ( web_settings - > download_folder , NULL ) ;
katze_assign ( web_settings - > download_manager , NULL ) ;
katze_assign ( web_settings - > text_editor , NULL ) ;
katze_assign ( web_settings - > news_aggregator , NULL ) ;
katze_assign ( web_settings - > location_entry_search , NULL ) ;
katze_assign ( web_settings - > http_proxy , NULL ) ;
katze_assign ( web_settings - > ident_string , NULL ) ;
2008-03-10 21:26:09 +00:00
G_OBJECT_CLASS ( midori_web_settings_parent_class ) - > finalize ( object ) ;
}
2009-11-16 22:33:32 +00:00
# if defined (G_OS_UNIX) && !HAVE_OSX
2009-06-15 23:48:39 +00:00
static gchar *
get_sys_name ( void )
{
static gchar * sys_name = NULL ;
if ( ! sys_name )
{
struct utsname name ;
if ( uname ( & name ) ! = - 1 )
sys_name = g_strdup_printf ( " %s %s " , name . sysname , name . machine ) ;
else
sys_name = " Unix " ;
}
return sys_name ;
}
# endif
2008-12-08 22:18:14 +00:00
static gchar *
generate_ident_string ( MidoriIdentity identify_as )
{
const gchar * platform =
# ifdef GDK_WINDOWING_X11
" X11 " ;
# elif defined(GDK_WINDOWING_WIN32)
" Windows " ;
# elif defined(GDK_WINDOWING_QUARTZ)
" Macintosh " ;
# elif defined(GDK_WINDOWING_DIRECTFB)
" DirectFB " ;
# else
" Unknown " ;
# endif
const gchar * os =
2009-01-10 19:13:08 +00:00
# if HAVE_OSX
2008-12-08 22:18:14 +00:00
/* #if defined (HAVE_X86) */
" Intel Mac OS X " ;
/* #else
" PPC Mac OS X " ;
# endif * /
# elif defined (G_OS_UNIX)
2009-06-15 23:48:39 +00:00
get_sys_name ( ) ;
2008-12-08 22:18:14 +00:00
# elif defined (G_OS_WIN32)
// FIXME: Windows NT version
" Windows " ;
# else
" Unknown " ;
# endif
2008-12-09 01:22:58 +00:00
const gchar * appname = " Midori/ "
G_STRINGIFY ( MIDORI_MAJOR_VERSION ) " . "
G_STRINGIFY ( MIDORI_MINOR_VERSION ) " . "
G_STRINGIFY ( MIDORI_MICRO_VERSION ) ;
2008-12-08 22:18:14 +00:00
2008-12-09 01:22:58 +00:00
const gchar * lang = pango_language_to_string ( gtk_get_default_language ( ) ) ;
2008-12-08 22:18:14 +00:00
2009-08-17 17:36:22 +00:00
# ifndef WEBKIT_USER_AGENT_MAJOR_VERSION
# define WEBKIT_USER_AGENT_MAJOR_VERSION 532
# define WEBKIT_USER_AGENT_MINOR_VERSION 1
# endif
2009-09-18 17:35:15 +00:00
const int webcore_major = WEBKIT_USER_AGENT_MAJOR_VERSION ;
const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION ;
2009-08-17 17:36:22 +00:00
2008-12-08 22:18:14 +00:00
switch ( identify_as )
{
case MIDORI_IDENT_MIDORI :
2009-09-18 17:35:15 +00:00
return g_strdup_printf ( " %s (%s; %s; U; %s) WebKit/%d.%d+ " ,
appname , platform , os , lang , webcore_major , webcore_minor ) ;
2008-12-08 22:18:14 +00:00
case MIDORI_IDENT_SAFARI :
return g_strdup_printf ( " Mozilla/5.0 (%s; U; %s; %s) "
2009-09-18 17:35:15 +00:00
" AppleWebKit/%d+ (KHTML, like Gecko) Safari/%d.%d+ %s " ,
platform , os , lang , webcore_major , webcore_major , webcore_minor , appname ) ;
2009-09-14 15:52:31 +00:00
case MIDORI_IDENT_IPHONE :
return g_strdup_printf ( " Mozilla/5.0 (iPhone; U; %s; %s) "
" AppleWebKit/532+ (KHTML, like Gecko) Version/3.0 Mobile/1A538b "
" Safari/419.3 %s " ,
os , lang , appname ) ;
2008-12-08 22:18:14 +00:00
case MIDORI_IDENT_FIREFOX :
2010-01-21 17:35:41 +00:00
return g_strdup_printf ( " Mozilla/5.0 (%s; U; %s; %s; rv:1.9.0.2) "
" Gecko/2008092313 Firefox/3.8 %s " ,
2008-12-08 22:18:14 +00:00
platform , os , lang , appname ) ;
case MIDORI_IDENT_EXPLORER :
return g_strdup_printf ( " Mozilla/4.0 (compatible; "
" MSIE 6.0; Windows NT 5.1; %s) %s " ,
lang , appname ) ;
default :
return g_strdup_printf ( " %s " , appname ) ;
}
}
2008-03-10 21:26:09 +00:00
static void
midori_web_settings_set_property ( GObject * object ,
guint prop_id ,
const GValue * value ,
GParamSpec * pspec )
{
MidoriWebSettings * web_settings = MIDORI_WEB_SETTINGS ( object ) ;
switch ( prop_id )
{
2008-04-16 23:38:22 +00:00
case PROP_REMEMBER_LAST_WINDOW_SIZE :
2008-06-19 18:41:43 +00:00
web_settings - > remember_last_window_size = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_LAST_WINDOW_WIDTH :
2008-06-19 18:41:43 +00:00
web_settings - > last_window_width = g_value_get_int ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_LAST_WINDOW_HEIGHT :
2008-06-19 18:41:43 +00:00
web_settings - > last_window_height = g_value_get_int ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-01-20 22:27:19 +00:00
case PROP_LAST_WINDOW_STATE :
web_settings - > last_window_state = g_value_get_enum ( value ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_PANEL_POSITION :
2008-06-19 18:41:43 +00:00
web_settings - > last_panel_position = g_value_get_int ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_LAST_PANEL_PAGE :
2008-06-19 18:41:43 +00:00
web_settings - > last_panel_page = g_value_get_int ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_LAST_WEB_SEARCH :
2008-06-19 18:41:43 +00:00
web_settings - > last_web_search = g_value_get_int ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
2008-10-12 20:09:49 +00:00
case PROP_SHOW_MENUBAR :
web_settings - > show_menubar = g_value_get_boolean ( value ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_SHOW_NAVIGATIONBAR :
2008-06-19 18:41:43 +00:00
web_settings - > show_navigationbar = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_SHOW_BOOKMARKBAR :
2008-06-19 18:41:43 +00:00
web_settings - > show_bookmarkbar = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_SHOW_PANEL :
2008-06-19 18:41:43 +00:00
web_settings - > show_panel = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-03-20 22:55:38 +00:00
case PROP_SHOW_TRANSFERBAR :
web_settings - > show_transferbar = g_value_get_boolean ( value ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_SHOW_STATUSBAR :
2008-06-19 18:41:43 +00:00
web_settings - > show_statusbar = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_TOOLBAR_STYLE :
2008-06-19 18:41:43 +00:00
web_settings - > toolbar_style = g_value_get_enum ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-02-11 22:41:09 +00:00
case PROP_PROGRESS_IN_LOCATION :
web_settings - > progress_in_location = g_value_get_boolean ( value ) ;
break ;
2009-04-18 21:26:54 +00:00
case PROP_SEARCH_ENGINES_IN_COMPLETION :
web_settings - > search_engines_in_completion = g_value_get_boolean ( value ) ;
break ;
2008-10-12 16:14:57 +00:00
case PROP_TOOLBAR_ITEMS :
katze_assign ( web_settings - > toolbar_items , g_value_dup_string ( value ) ) ;
break ;
2008-10-21 22:01:01 +00:00
case PROP_COMPACT_SIDEPANEL :
web_settings - > compact_sidepanel = g_value_get_boolean ( value ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-07-26 20:00:10 +00:00
case PROP_SHOW_PANEL_CONTROLS :
web_settings - > show_panel_controls = g_value_get_boolean ( value ) ;
break ;
2009-02-22 02:51:10 +00:00
case PROP_RIGHT_ALIGN_SIDEPANEL :
web_settings - > right_align_sidepanel = g_value_get_boolean ( value ) ;
break ;
2009-11-28 22:53:49 +00:00
case PROP_OPEN_PANELS_IN_WINDOWS :
web_settings - > open_panels_in_windows = g_value_get_boolean ( value ) ;
break ;
2008-04-16 23:38:22 +00:00
2008-04-13 09:29:21 +00:00
case PROP_LOAD_ON_STARTUP :
2008-06-19 18:41:43 +00:00
web_settings - > load_on_startup = g_value_get_enum ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_HOMEPAGE :
2008-06-19 18:41:43 +00:00
katze_assign ( web_settings - > homepage , g_value_dup_string ( value ) ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-01-12 02:17:37 +00:00
case PROP_SHOW_CRASH_DIALOG :
web_settings - > show_crash_dialog = g_value_get_boolean ( value ) ;
break ;
2009-05-10 14:07:28 +00:00
case PROP_SPEED_DIAL_IN_NEW_TABS :
web_settings - > speed_dial_in_new_tabs = g_value_get_boolean ( value ) ;
2009-05-08 01:29:25 +00:00
break ;
2008-04-13 09:29:21 +00:00
case PROP_DOWNLOAD_FOLDER :
2008-06-19 18:41:43 +00:00
katze_assign ( web_settings - > download_folder , g_value_dup_string ( value ) ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-04-28 21:49:52 +00:00
case PROP_ASK_FOR_DESTINATION_FOLDER :
web_settings - > ask_for_destination_folder = g_value_get_boolean ( value ) ;
break ;
2009-04-26 22:22:16 +00:00
case PROP_NOTIFY_TRANSFER_COMPLETED :
web_settings - > notify_transfer_completed = g_value_get_boolean ( value ) ;
break ;
2008-07-16 20:32:37 +00:00
case PROP_DOWNLOAD_MANAGER :
katze_assign ( web_settings - > download_manager , g_value_dup_string ( value ) ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-10-20 19:32:25 +00:00
case PROP_TEXT_EDITOR :
katze_assign ( web_settings - > text_editor , g_value_dup_string ( value ) ) ;
break ;
2009-04-14 17:44:48 +00:00
case PROP_NEWS_AGGREGATOR :
katze_assign ( web_settings - > news_aggregator , g_value_dup_string ( value ) ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_LOCATION_ENTRY_SEARCH :
2008-06-19 18:41:43 +00:00
katze_assign ( web_settings - > location_entry_search , g_value_dup_string ( value ) ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_PREFERRED_ENCODING :
2008-06-19 18:41:43 +00:00
web_settings - > preferred_encoding = g_value_get_enum ( value ) ;
switch ( web_settings - > preferred_encoding )
2008-04-13 09:29:21 +00:00
{
case MIDORI_ENCODING_CHINESE :
g_object_set ( object , " default-encoding " , " BIG5 " , NULL ) ;
break ;
case MIDORI_ENCODING_JAPANESE :
g_object_set ( object , " default-encoding " , " SHIFT_JIS " , NULL ) ;
break ;
2009-10-31 21:51:35 +00:00
case MIDORI_ENCODING_KOREAN :
g_object_set ( object , " default-encoding " , " EUC-KR " , NULL ) ;
break ;
2008-04-13 09:29:21 +00:00
case MIDORI_ENCODING_RUSSIAN :
g_object_set ( object , " default-encoding " , " KOI8-R " , NULL ) ;
break ;
case MIDORI_ENCODING_UNICODE :
g_object_set ( object , " default-encoding " , " UTF-8 " , NULL ) ;
break ;
case MIDORI_ENCODING_WESTERN :
g_object_set ( object , " default-encoding " , " ISO-8859-1 " , NULL ) ;
break ;
case MIDORI_ENCODING_CUSTOM :
g_object_set ( object , " default-encoding " , " " , NULL ) ;
}
break ;
2008-10-21 22:01:01 +00:00
case PROP_ALWAYS_SHOW_TABBAR :
web_settings - > always_show_tabbar = g_value_get_boolean ( value ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_CLOSE_BUTTONS_ON_TABS :
2008-06-19 18:41:43 +00:00
web_settings - > close_buttons_on_tabs = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_OPEN_NEW_PAGES_IN :
2008-06-19 18:41:43 +00:00
web_settings - > open_new_pages_in = g_value_get_enum ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-10-20 06:50:16 +00:00
case PROP_OPEN_EXTERNAL_PAGES_IN :
web_settings - > open_external_pages_in = g_value_get_enum ( value ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_MIDDLE_CLICK_OPENS_SELECTION :
2008-06-19 18:41:43 +00:00
web_settings - > middle_click_opens_selection = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_OPEN_TABS_IN_THE_BACKGROUND :
2008-06-19 18:41:43 +00:00
web_settings - > open_tabs_in_the_background = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-08-15 18:38:27 +00:00
case PROP_OPEN_TABS_NEXT_TO_CURRENT :
web_settings - > open_tabs_next_to_current = g_value_get_boolean ( value ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_OPEN_POPUPS_IN_TABS :
2008-06-19 18:41:43 +00:00
web_settings - > open_popups_in_tabs = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-11-08 20:55:36 +00:00
case PROP_AUTO_LOAD_IMAGES :
g_object_set ( web_settings , " WebKitWebSettings::auto-load-images " ,
g_value_get_boolean ( value ) , NULL ) ;
break ;
case PROP_ENABLE_SCRIPTS :
g_object_set ( web_settings , " WebKitWebSettings::enable-scripts " ,
g_value_get_boolean ( value ) , NULL ) ;
break ;
case PROP_ENABLE_PLUGINS :
g_object_set ( web_settings , " WebKitWebSettings::enable-plugins " ,
g_value_get_boolean ( value ) , NULL ) ;
break ;
2009-12-23 15:24:51 +00:00
case PROP_ENABLE_DEVELOPER_EXTRAS :
g_object_set ( web_settings , " WebKitWebSettings::enable-developer-extras " ,
g_value_get_boolean ( value ) , NULL ) ;
break ;
2009-12-31 22:24:02 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 18)
case PROP_ENABLE_PAGE_CACHE :
g_object_set ( web_settings , " WebKitWebSettings::enable-page-cache " ,
g_value_get_boolean ( value ) , NULL ) ;
break ;
# endif
2009-01-16 04:05:50 +00:00
case PROP_ZOOM_TEXT_AND_IMAGES :
web_settings - > zoom_text_and_images = g_value_get_boolean ( value ) ;
break ;
2009-03-01 18:21:27 +00:00
case PROP_FIND_WHILE_TYPING :
web_settings - > find_while_typing = g_value_get_boolean ( value ) ;
break ;
2009-09-27 21:48:08 +00:00
case PROP_KINETIC_SCROLLING :
web_settings - > kinetic_scrolling = g_value_get_boolean ( value ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_ACCEPT_COOKIES :
2008-06-19 18:41:43 +00:00
web_settings - > accept_cookies = g_value_get_enum ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_ORIGINAL_COOKIES_ONLY :
2008-06-19 18:41:43 +00:00
web_settings - > original_cookies_only = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_MAXIMUM_COOKIE_AGE :
2008-06-19 18:41:43 +00:00
web_settings - > maximum_cookie_age = g_value_get_int ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_REMEMBER_LAST_VISITED_PAGES :
2008-06-19 18:41:43 +00:00
web_settings - > remember_last_visited_pages = g_value_get_boolean ( value ) ;
2008-03-10 21:26:09 +00:00
break ;
2008-04-13 09:29:21 +00:00
case PROP_MAXIMUM_HISTORY_AGE :
2008-06-19 18:41:43 +00:00
web_settings - > maximum_history_age = g_value_get_int ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_REMEMBER_LAST_DOWNLOADED_FILES :
2008-06-19 18:41:43 +00:00
web_settings - > remember_last_downloaded_files = g_value_get_boolean ( value ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_HTTP_PROXY :
2008-06-19 18:41:43 +00:00
katze_assign ( web_settings - > http_proxy , g_value_dup_string ( value ) ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-02-12 23:49:30 +00:00
case PROP_AUTO_DETECT_PROXY :
web_settings - > auto_detect_proxy = g_value_get_boolean ( value ) ;
break ;
2008-12-08 22:18:14 +00:00
case PROP_IDENTIFY_AS :
web_settings - > identify_as = g_value_get_enum ( value ) ;
if ( web_settings - > identify_as ! = MIDORI_IDENT_CUSTOM )
{
gchar * string = generate_ident_string ( web_settings - > identify_as ) ;
2009-04-12 12:28:11 +00:00
katze_assign ( web_settings - > ident_string , string ) ;
2009-08-01 21:24:32 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 11)
g_object_set ( web_settings , " user-agent " , string , NULL ) ;
# endif
2009-04-12 12:28:11 +00:00
g_object_notify ( object , " ident-string " ) ;
2008-12-08 22:18:14 +00:00
}
break ;
case PROP_IDENT_STRING :
2009-06-12 21:17:34 +00:00
if ( web_settings - > identify_as = = MIDORI_IDENT_CUSTOM )
2009-08-01 21:24:32 +00:00
{
2009-06-12 21:17:34 +00:00
katze_assign ( web_settings - > ident_string , g_value_dup_string ( value ) ) ;
2009-08-01 21:24:32 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 11)
g_object_set ( web_settings , " user-agent " , web_settings - > ident_string , NULL ) ;
# endif
}
2008-12-08 22:18:14 +00:00
break ;
2010-01-06 23:49:41 +00:00
case PROP_PREFERRED_LANGUAGES :
katze_assign ( web_settings - > http_accept_language , g_value_dup_string ( value ) ) ;
break ;
2009-05-22 21:53:54 +00:00
case PROP_CLEAR_PRIVATE_DATA :
web_settings - > clear_private_data = g_value_get_int ( value ) ;
break ;
2008-03-10 21:26:09 +00:00
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
}
static void
midori_web_settings_get_property ( GObject * object ,
guint prop_id ,
GValue * value ,
GParamSpec * pspec )
{
MidoriWebSettings * web_settings = MIDORI_WEB_SETTINGS ( object ) ;
switch ( prop_id )
{
2008-04-16 23:38:22 +00:00
case PROP_REMEMBER_LAST_WINDOW_SIZE :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > remember_last_window_size ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_WINDOW_WIDTH :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > last_window_width ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_WINDOW_HEIGHT :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > last_window_height ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-01-20 22:27:19 +00:00
case PROP_LAST_WINDOW_STATE :
g_value_set_enum ( value , web_settings - > last_window_state ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_PANEL_POSITION :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > last_panel_position ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_PANEL_PAGE :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > last_panel_page ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-04-16 23:38:22 +00:00
case PROP_LAST_WEB_SEARCH :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > last_web_search ) ;
2008-04-16 23:38:22 +00:00
break ;
2008-10-12 20:09:49 +00:00
case PROP_SHOW_MENUBAR :
g_value_set_boolean ( value , web_settings - > show_menubar ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_SHOW_NAVIGATIONBAR :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > show_navigationbar ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_SHOW_BOOKMARKBAR :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > show_bookmarkbar ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_SHOW_PANEL :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > show_panel ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-03-20 22:55:38 +00:00
case PROP_SHOW_TRANSFERBAR :
g_value_set_boolean ( value , web_settings - > show_transferbar ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_SHOW_STATUSBAR :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > show_statusbar ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_TOOLBAR_STYLE :
2008-06-19 18:41:43 +00:00
g_value_set_enum ( value , web_settings - > toolbar_style ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-02-11 22:41:09 +00:00
case PROP_PROGRESS_IN_LOCATION :
g_value_set_boolean ( value , web_settings - > progress_in_location ) ;
break ;
2009-04-18 21:26:54 +00:00
case PROP_SEARCH_ENGINES_IN_COMPLETION :
g_value_set_boolean ( value , web_settings - > search_engines_in_completion ) ;
break ;
2008-10-12 16:14:57 +00:00
case PROP_TOOLBAR_ITEMS :
g_value_set_string ( value , web_settings - > toolbar_items ) ;
break ;
2008-10-21 22:01:01 +00:00
case PROP_COMPACT_SIDEPANEL :
g_value_set_boolean ( value , web_settings - > compact_sidepanel ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-07-26 20:00:10 +00:00
case PROP_SHOW_PANEL_CONTROLS :
g_value_set_boolean ( value , web_settings - > show_panel_controls ) ;
break ;
2009-02-22 02:51:10 +00:00
case PROP_RIGHT_ALIGN_SIDEPANEL :
g_value_set_boolean ( value , web_settings - > right_align_sidepanel ) ;
break ;
2009-11-28 22:53:49 +00:00
case PROP_OPEN_PANELS_IN_WINDOWS :
g_value_set_boolean ( value , web_settings - > open_panels_in_windows ) ;
break ;
2008-04-13 09:29:21 +00:00
2008-04-16 23:38:22 +00:00
case PROP_LOAD_ON_STARTUP :
2008-06-19 18:41:43 +00:00
g_value_set_enum ( value , web_settings - > load_on_startup ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_HOMEPAGE :
2008-06-19 18:41:43 +00:00
g_value_set_string ( value , web_settings - > homepage ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-01-12 02:17:37 +00:00
case PROP_SHOW_CRASH_DIALOG :
g_value_set_boolean ( value , web_settings - > show_crash_dialog ) ;
break ;
2009-05-10 14:07:28 +00:00
case PROP_SPEED_DIAL_IN_NEW_TABS :
g_value_set_boolean ( value , web_settings - > speed_dial_in_new_tabs ) ;
2009-05-08 01:29:25 +00:00
break ;
2008-04-16 23:38:22 +00:00
case PROP_DOWNLOAD_FOLDER :
2008-06-19 18:41:43 +00:00
g_value_set_string ( value , web_settings - > download_folder ) ;
2008-04-16 23:38:22 +00:00
break ;
2009-04-28 21:49:52 +00:00
case PROP_ASK_FOR_DESTINATION_FOLDER :
g_value_set_boolean ( value , web_settings - > ask_for_destination_folder ) ;
break ;
2009-04-26 22:22:16 +00:00
case PROP_NOTIFY_TRANSFER_COMPLETED :
g_value_set_boolean ( value , web_settings - > notify_transfer_completed ) ;
break ;
2008-07-16 20:32:37 +00:00
case PROP_DOWNLOAD_MANAGER :
g_value_set_string ( value , web_settings - > download_manager ) ;
2008-04-16 23:38:22 +00:00
break ;
2008-10-20 19:32:25 +00:00
case PROP_TEXT_EDITOR :
g_value_set_string ( value , web_settings - > text_editor ) ;
break ;
2009-04-14 17:44:48 +00:00
case PROP_NEWS_AGGREGATOR :
g_value_set_string ( value , web_settings - > news_aggregator ) ;
break ;
2008-04-16 23:38:22 +00:00
case PROP_LOCATION_ENTRY_SEARCH :
2008-06-19 18:41:43 +00:00
g_value_set_string ( value , web_settings - > location_entry_search ) ;
2008-04-16 23:38:22 +00:00
break ;
case PROP_PREFERRED_ENCODING :
2008-06-19 18:41:43 +00:00
g_value_set_enum ( value , web_settings - > preferred_encoding ) ;
2008-04-16 23:38:22 +00:00
break ;
2008-10-21 22:01:01 +00:00
case PROP_ALWAYS_SHOW_TABBAR :
g_value_set_boolean ( value , web_settings - > always_show_tabbar ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_CLOSE_BUTTONS_ON_TABS :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > close_buttons_on_tabs ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_OPEN_NEW_PAGES_IN :
2008-06-19 18:41:43 +00:00
g_value_set_enum ( value , web_settings - > open_new_pages_in ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-10-20 06:50:16 +00:00
case PROP_OPEN_EXTERNAL_PAGES_IN :
g_value_set_enum ( value , web_settings - > open_external_pages_in ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_MIDDLE_CLICK_OPENS_SELECTION :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > middle_click_opens_selection ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_OPEN_TABS_IN_THE_BACKGROUND :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > open_tabs_in_the_background ) ;
2008-04-13 09:29:21 +00:00
break ;
2008-08-15 18:38:27 +00:00
case PROP_OPEN_TABS_NEXT_TO_CURRENT :
g_value_set_boolean ( value , web_settings - > open_tabs_next_to_current ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_OPEN_POPUPS_IN_TABS :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > open_popups_in_tabs ) ;
2008-04-13 09:29:21 +00:00
break ;
2009-11-08 20:55:36 +00:00
case PROP_AUTO_LOAD_IMAGES :
g_value_set_boolean ( value , katze_object_get_boolean ( web_settings ,
" WebKitWebSettings::auto-load-images " ) ) ;
break ;
case PROP_ENABLE_SCRIPTS :
g_value_set_boolean ( value , katze_object_get_boolean ( web_settings ,
" WebKitWebSettings::enable-scripts " ) ) ;
break ;
case PROP_ENABLE_PLUGINS :
g_value_set_boolean ( value , katze_object_get_boolean ( web_settings ,
" WebKitWebSettings::enable-plugins " ) ) ;
break ;
2009-12-23 15:24:51 +00:00
case PROP_ENABLE_DEVELOPER_EXTRAS :
g_value_set_boolean ( value , katze_object_get_boolean ( web_settings ,
" WebKitWebSettings::enable-developer-extras " ) ) ;
break ;
2009-12-31 22:24:02 +00:00
# if WEBKIT_CHECK_VERSION (1, 1, 18)
case PROP_ENABLE_PAGE_CACHE :
g_value_set_boolean ( value , katze_object_get_boolean ( web_settings ,
" WebKitWebSettings::enable-page-cache " ) ) ;
break ;
# endif
2009-01-16 04:05:50 +00:00
case PROP_ZOOM_TEXT_AND_IMAGES :
g_value_set_boolean ( value , web_settings - > zoom_text_and_images ) ;
break ;
2009-03-01 18:21:27 +00:00
case PROP_FIND_WHILE_TYPING :
g_value_set_boolean ( value , web_settings - > find_while_typing ) ;
break ;
2009-09-27 21:48:08 +00:00
case PROP_KINETIC_SCROLLING :
g_value_set_boolean ( value , web_settings - > kinetic_scrolling ) ;
break ;
2008-04-13 09:29:21 +00:00
case PROP_ACCEPT_COOKIES :
2008-06-19 18:41:43 +00:00
g_value_set_enum ( value , web_settings - > accept_cookies ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_ORIGINAL_COOKIES_ONLY :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > original_cookies_only ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_MAXIMUM_COOKIE_AGE :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > maximum_cookie_age ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_REMEMBER_LAST_VISITED_PAGES :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > remember_last_visited_pages ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_MAXIMUM_HISTORY_AGE :
2008-06-19 18:41:43 +00:00
g_value_set_int ( value , web_settings - > maximum_history_age ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_REMEMBER_LAST_DOWNLOADED_FILES :
2008-06-19 18:41:43 +00:00
g_value_set_boolean ( value , web_settings - > remember_last_downloaded_files ) ;
2008-04-13 09:29:21 +00:00
break ;
case PROP_HTTP_PROXY :
2008-06-19 18:41:43 +00:00
g_value_set_string ( value , web_settings - > http_proxy ) ;
2008-03-10 21:26:09 +00:00
break ;
2009-02-12 23:49:30 +00:00
case PROP_AUTO_DETECT_PROXY :
g_value_set_boolean ( value , web_settings - > auto_detect_proxy ) ;
break ;
2008-12-08 22:18:14 +00:00
case PROP_IDENTIFY_AS :
g_value_set_enum ( value , web_settings - > identify_as ) ;
break ;
case PROP_IDENT_STRING :
2009-04-12 12:28:11 +00:00
if ( ! g_strcmp0 ( web_settings - > ident_string , " " ) )
{
gchar * string = generate_ident_string ( web_settings - > identify_as ) ;
katze_assign ( web_settings - > ident_string , string ) ;
}
2008-12-08 22:18:14 +00:00
g_value_set_string ( value , web_settings - > ident_string ) ;
break ;
2010-01-06 23:49:41 +00:00
case PROP_PREFERRED_LANGUAGES :
g_value_set_string ( value , web_settings - > http_accept_language ) ;
break ;
2009-05-22 21:53:54 +00:00
case PROP_CLEAR_PRIVATE_DATA :
g_value_set_int ( value , web_settings - > clear_private_data ) ;
break ;
2008-03-10 21:26:09 +00:00
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
}
/**
* midori_web_settings_new :
*
* Creates a new # MidoriWebSettings instance with default values .
*
* You will typically want to assign this to a # MidoriWebView or # MidoriBrowser .
*
* Return value : a new # MidoriWebSettings
* */
MidoriWebSettings *
midori_web_settings_new ( void )
{
MidoriWebSettings * web_settings = g_object_new ( MIDORI_TYPE_WEB_SETTINGS ,
NULL ) ;
return web_settings ;
}