Add Show Homepage option, remove Form Fill and Small Toolbar

This commit is contained in:
Christian Dywan 2008-05-20 03:21:11 +02:00
parent ebdedf6f31
commit 6bc5150ea2
3 changed files with 36 additions and 16 deletions

View file

@ -43,6 +43,7 @@ struct _MidoriBrowserPrivate
GtkWidget* throbber; GtkWidget* throbber;
GtkWidget* navigationbar; GtkWidget* navigationbar;
GtkWidget* button_tab_new; GtkWidget* button_tab_new;
GtkWidget* button_homepage;
GtkWidget* location_icon; GtkWidget* location_icon;
GtkWidget* location; GtkWidget* location;
GtkWidget* search; GtkWidget* search;
@ -1199,7 +1200,7 @@ _action_forward_activate (GtkAction* action,
} }
static void static void
_action_home_activate (GtkAction* action, _action_homepage_activate (GtkAction* action,
MidoriBrowser* browser) MidoriBrowser* browser)
{ {
MidoriBrowserPrivate* priv = browser->priv; MidoriBrowserPrivate* priv = browser->priv;
@ -2102,9 +2103,6 @@ static const GtkActionEntry entries[] = {
{ "SelectAll", GTK_STOCK_SELECT_ALL, { "SelectAll", GTK_STOCK_SELECT_ALL,
NULL, "<Ctrl>a", NULL, "<Ctrl>a",
N_("Select all text"), G_CALLBACK (_action_select_all_activate) }, N_("Select all text"), G_CALLBACK (_action_select_all_activate) },
{ "FormFill", STOCK_FORM_FILL,
NULL, "",
"hm?", NULL/*G_CALLBACK (_action_form_fill_activate)*/ },
{ "Find", GTK_STOCK_FIND, { "Find", GTK_STOCK_FIND,
NULL, "<Ctrl>f", NULL, "<Ctrl>f",
"hm?", G_CALLBACK (_action_find_activate) }, "hm?", G_CALLBACK (_action_find_activate) },
@ -2158,9 +2156,9 @@ static const GtkActionEntry entries[] = {
{ "Forward", GTK_STOCK_GO_FORWARD, { "Forward", GTK_STOCK_GO_FORWARD,
NULL, "<Alt>Right", NULL, "<Alt>Right",
"hm?", G_CALLBACK (_action_forward_activate) }, "hm?", G_CALLBACK (_action_forward_activate) },
{ "Home", STOCK_HOMEPAGE, { "Homepage", STOCK_HOMEPAGE,
NULL, "<Alt>Home", NULL, "<Alt>Home",
"hm?", G_CALLBACK (_action_home_activate) }, "hm?", G_CALLBACK (_action_homepage_activate) },
{ "Location", GTK_STOCK_JUMP_TO, { "Location", GTK_STOCK_JUMP_TO,
N_("Location..."), "<Ctrl>l", N_("Location..."), "<Ctrl>l",
"hm?", G_CALLBACK (_action_location_activate) }, "hm?", G_CALLBACK (_action_location_activate) },
@ -2365,7 +2363,7 @@ static const gchar* ui_markup =
"<menu action='Go'>" "<menu action='Go'>"
"<menuitem action='Back'/>" "<menuitem action='Back'/>"
"<menuitem action='Forward'/>" "<menuitem action='Forward'/>"
"<menuitem action='Home'/>" "<menuitem action='Homepage'/>"
"<menuitem action='Location'/>" "<menuitem action='Location'/>"
"<menuitem action='Search'/>" "<menuitem action='Search'/>"
"<menuitem action='OpenInPageholder'/>" "<menuitem action='OpenInPageholder'/>"
@ -2379,8 +2377,6 @@ static const gchar* ui_markup =
"<menuitem action='Find'/>" "<menuitem action='Find'/>"
"<menuitem action='FindNext'/>" "<menuitem action='FindNext'/>"
"<menuitem action='FindPrevious'/>" "<menuitem action='FindPrevious'/>"
"<separator/>"
"<menuitem action='FormFill'/>"
"</menu>" "</menu>"
"<menu action='Bookmarks'>" "<menu action='Bookmarks'>"
"<menuitem action='BookmarkNew'/>" "<menuitem action='BookmarkNew'/>"
@ -2409,8 +2405,7 @@ static const gchar* ui_markup =
"<toolitem action='Back'/>" "<toolitem action='Back'/>"
"<toolitem action='Forward'/>" "<toolitem action='Forward'/>"
"<toolitem action='ReloadStop'/>" "<toolitem action='ReloadStop'/>"
"<toolitem action='Home'/>" "<toolitem action='Homepage'/>"
"<toolitem action='FormFill'/>"
"<placeholder name='Location'/>" "<placeholder name='Location'/>"
"<placeholder name='Search'/>" "<placeholder name='Search'/>"
"<placeholder name='TabTrash'/>" "<placeholder name='TabTrash'/>"
@ -2539,6 +2534,8 @@ midori_browser_init (MidoriBrowser* browser)
priv->button_tab_new = gtk_ui_manager_get_widget ( priv->button_tab_new = gtk_ui_manager_get_widget (
ui_manager, "/toolbar_navigation/TabNew"); ui_manager, "/toolbar_navigation/TabNew");
g_object_set (_action_by_name (browser, "Back"), "is-important", TRUE, NULL); g_object_set (_action_by_name (browser, "Back"), "is-important", TRUE, NULL);
priv->button_homepage = gtk_ui_manager_get_widget (
ui_manager, "/toolbar_navigation/Homepage");
// Location // Location
priv->location = sexy_icon_entry_new(); priv->location = sexy_icon_entry_new();
@ -2912,7 +2909,8 @@ _midori_browser_update_settings (MidoriBrowser* browser)
gint last_window_width, last_window_height; gint last_window_width, last_window_height;
gint last_panel_position, last_panel_page; gint last_panel_position, last_panel_page;
gboolean show_navigationbar, show_bookmarkbar, show_panel, show_statusbar; gboolean show_navigationbar, show_bookmarkbar, show_panel, show_statusbar;
gboolean small_toolbar, show_new_tab, show_web_search, show_trash; gboolean small_toolbar, show_new_tab, show_homepage,
show_web_search, show_trash;
MidoriToolbarStyle toolbar_style; MidoriToolbarStyle toolbar_style;
gint last_web_search; gint last_web_search;
gchar* last_pageholder_uri; gchar* last_pageholder_uri;
@ -2928,6 +2926,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
"show-statusbar", &show_statusbar, "show-statusbar", &show_statusbar,
"small-toolbar", &small_toolbar, "small-toolbar", &small_toolbar,
"show-new-tab", &show_new_tab, "show-new-tab", &show_new_tab,
"show-homepage", &show_homepage,
"show-web-search", &show_web_search, "show-web-search", &show_web_search,
"show-trash", &show_trash, "show-trash", &show_trash,
"toolbar-style", &toolbar_style, "toolbar-style", &toolbar_style,
@ -2967,6 +2966,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
_action_set_active (browser, "Statusbar", show_statusbar); _action_set_active (browser, "Statusbar", show_statusbar);
sokoke_widget_set_visible (priv->button_tab_new, show_new_tab); sokoke_widget_set_visible (priv->button_tab_new, show_new_tab);
sokoke_widget_set_visible (priv->button_homepage, show_homepage);
sokoke_widget_set_visible (priv->search, show_web_search); sokoke_widget_set_visible (priv->search, show_web_search);
sokoke_widget_set_visible (priv->button_trash, show_trash); sokoke_widget_set_visible (priv->button_trash, show_trash);
@ -2995,6 +2995,9 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
else if (name == g_intern_string ("show-new-tab")) else if (name == g_intern_string ("show-new-tab"))
sokoke_widget_set_visible (priv->button_tab_new, sokoke_widget_set_visible (priv->button_tab_new,
g_value_get_boolean (&value)); g_value_get_boolean (&value));
else if (name == g_intern_string ("show-homepage"))
sokoke_widget_set_visible (priv->button_homepage,
g_value_get_boolean (&value));
else if (name == g_intern_string ("show-web-search")) else if (name == g_intern_string ("show-web-search"))
sokoke_widget_set_visible (priv->search, sokoke_widget_set_visible (priv->search,
g_value_get_boolean (&value)); g_value_get_boolean (&value));

View file

@ -319,11 +319,11 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (katze_property_label (settings, "toolbar-style"), 0, 1, 0, 1); INDENTED_ADD (katze_property_label (settings, "toolbar-style"), 0, 1, 0, 1);
button = katze_property_proxy (settings, "toolbar-style", NULL); button = katze_property_proxy (settings, "toolbar-style", NULL);
FILLED_ADD(button, 1, 2, 0, 1); FILLED_ADD(button, 1, 2, 0, 1);
button = katze_property_proxy (settings, "small-toolbar", NULL); button = katze_property_proxy (settings, "show-new-tab", NULL);
INDENTED_ADD (button, 0, 1, 1, 2); INDENTED_ADD (button, 0, 1, 1, 2);
button = katze_property_proxy (settings, "show-web-search", NULL); button = katze_property_proxy (settings, "show-web-search", NULL);
SPANNED_ADD (button, 1, 2, 1, 2); SPANNED_ADD (button, 1, 2, 1, 2);
button = katze_property_proxy (settings, "show-new-tab", NULL); button = katze_property_proxy (settings, "show-homepage", NULL);
INDENTED_ADD (button, 0, 1, 2, 3); INDENTED_ADD (button, 0, 1, 2, 3);
button = katze_property_proxy (settings, "show-trash", NULL); button = katze_property_proxy (settings, "show-trash", NULL);
SPANNED_ADD (button, 1, 2, 2, 3); SPANNED_ADD (button, 1, 2, 2, 3);

View file

@ -35,8 +35,9 @@ struct _MidoriWebSettingsPrivate
MidoriToolbarStyle toolbar_style; MidoriToolbarStyle toolbar_style;
gboolean small_toolbar; gboolean small_toolbar;
gboolean show_web_search;
gboolean show_new_tab; gboolean show_new_tab;
gboolean show_homepage;
gboolean show_web_search;
gboolean show_trash; gboolean show_trash;
MidoriStartup load_on_startup; MidoriStartup load_on_startup;
@ -90,6 +91,7 @@ enum
PROP_TOOLBAR_STYLE, PROP_TOOLBAR_STYLE,
PROP_SMALL_TOOLBAR, PROP_SMALL_TOOLBAR,
PROP_SHOW_NEW_TAB, PROP_SHOW_NEW_TAB,
PROP_SHOW_HOMEPAGE,
PROP_SHOW_WEB_SEARCH, PROP_SHOW_WEB_SEARCH,
PROP_SHOW_TRASH, PROP_SHOW_TRASH,
@ -370,6 +372,15 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
TRUE, TRUE,
flags)); flags));
g_object_class_install_property (gobject_class,
PROP_SHOW_HOMEPAGE,
g_param_spec_boolean (
"show-homepage",
_("Show Homepage"),
_("Show the Homepage button in the toolbar"),
TRUE,
flags));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_SHOW_WEB_SEARCH, PROP_SHOW_WEB_SEARCH,
g_param_spec_boolean ( g_param_spec_boolean (
@ -688,6 +699,9 @@ midori_web_settings_set_property (GObject* object,
case PROP_SHOW_NEW_TAB: case PROP_SHOW_NEW_TAB:
priv->show_new_tab = g_value_get_boolean (value); priv->show_new_tab = g_value_get_boolean (value);
break; break;
case PROP_SHOW_HOMEPAGE:
priv->show_homepage = g_value_get_boolean (value);
break;
case PROP_SHOW_WEB_SEARCH: case PROP_SHOW_WEB_SEARCH:
priv->show_web_search = g_value_get_boolean (value); priv->show_web_search = g_value_get_boolean (value);
break; break;
@ -844,6 +858,9 @@ midori_web_settings_get_property (GObject* object,
case PROP_SHOW_NEW_TAB: case PROP_SHOW_NEW_TAB:
g_value_set_boolean (value, priv->show_new_tab); g_value_set_boolean (value, priv->show_new_tab);
break; break;
case PROP_SHOW_HOMEPAGE:
g_value_set_boolean (value, priv->show_homepage);
break;
case PROP_SHOW_WEB_SEARCH: case PROP_SHOW_WEB_SEARCH:
g_value_set_boolean (value, priv->show_web_search); g_value_set_boolean (value, priv->show_web_search);
break; break;