aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-properties.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-20 19:03:42 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-20 19:03:42 +0800
commitd5eed5f210049e0b3b4332ddb36b0fde6b50a76e (patch)
tree060439e101e1399c1f0cf05cc6b37a2af90f4128 /src/bookmarks/ephy-bookmark-properties.c
parent1ae8286ebfe005b34e1ebe7068fc364aa3a4cb09 (diff)
downloadgsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar.gz
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar.bz2
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar.lz
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar.xz
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.tar.zst
gsoc2013-epiphany-d5eed5f210049e0b3b4332ddb36b0fde6b50a76e.zip
Update
2003-04-20 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-editable-toolbar.c: Update * data/epiphany.schemas.in: * data/ui/epiphany-ui.xml.in: * lib/egg/egg-editable-toolbar.h: * lib/ephy-prefs.h: * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmark-properties.c: (update_checkbox), (update_window_title), (toolbar_checkbox_changed_cb), (set_window_icon), (build_ui): * src/bookmarks/ephy-bookmarks.h: * src/ephy-window.c: (add_widget), (ephy_window_init), (save_window_chrome), (ephy_window_finalize), (translate_default_chrome), (update_layout_toggles), (ephy_window_set_chrome): * src/window-commands.c: (window_cmd_view_bookmarks_toolbar): * src/window-commands.h: First implementation of the new bookmarks toolbar thing. Still doesnt work properly ... old bmk toolbars are still there though. Dave I dont like much the position of the checkbox in properties :/ Maybe a different tab dunno ....
Diffstat (limited to 'src/bookmarks/ephy-bookmark-properties.c')
-rw-r--r--src/bookmarks/ephy-bookmark-properties.c50
1 files changed, 43 insertions, 7 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c
index 7d9d8c2be..1de14b433 100644
--- a/src/bookmarks/ephy-bookmark-properties.c
+++ b/src/bookmarks/ephy-bookmark-properties.c
@@ -23,6 +23,8 @@
#include "ephy-shell.h"
#include "ephy-state.h"
+#include <gtk/gtkcheckbutton.h>
+#include <gtk/gtktogglebutton.h>
#include <gtk/gtkstock.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkvbox.h>
@@ -213,6 +215,22 @@ bookmark_properties_response_cb (GtkDialog *dialog,
}
static void
+update_checkbox (EphyBookmarkProperties *props, GtkWidget *checkbox, gulong prop)
+{
+ GValue value = { 0, };
+ gboolean state;
+
+ state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
+
+ g_value_init (&value, G_TYPE_BOOLEAN);
+ g_value_set_boolean (&value, state);
+ ephy_node_set_property (props->priv->bookmark,
+ prop,
+ &value);
+ g_value_unset (&value);
+}
+
+static void
update_entry (EphyBookmarkProperties *props, GtkWidget *entry, guint prop)
{
GValue value = { 0, };
@@ -233,7 +251,7 @@ update_window_title(EphyBookmarkProperties *editor)
{
char *title;
const char *tmp;
-
+
tmp = ephy_node_get_property_string (editor->priv->bookmark,
EPHY_NODE_BMK_PROP_TITLE);
title = g_strdup_printf (_("%s Properties"), tmp);
@@ -256,6 +274,12 @@ location_entry_changed_cb (GtkWidget *entry, EphyBookmarkProperties *props)
}
static void
+toolbar_checkbox_changed_cb (GtkWidget *checkbox, EphyBookmarkProperties *props)
+{
+ update_checkbox (props, checkbox, EPHY_NODE_BMK_PROP_SHOW_IN_TOOLBAR);
+}
+
+static void
set_window_icon (EphyBookmarkProperties *editor)
{
EphyFaviconCache *cache;
@@ -275,10 +299,10 @@ set_window_icon (EphyBookmarkProperties *editor)
else
{
- icon = gtk_widget_render_icon (GTK_WIDGET (editor),
- GTK_STOCK_PROPERTIES,
- GTK_ICON_SIZE_MENU,
- NULL);
+ icon = gtk_widget_render_icon (GTK_WIDGET (editor),
+ GTK_STOCK_PROPERTIES,
+ GTK_ICON_SIZE_MENU,
+ NULL);
}
gtk_window_set_icon (GTK_WINDOW (editor), icon);
@@ -288,9 +312,11 @@ set_window_icon (EphyBookmarkProperties *editor)
static void
build_ui (EphyBookmarkProperties *editor)
{
- GtkWidget *table, *label, *entry, *topics_selector, *scrolled_window;
+ GtkWidget *table, *label, *entry, *topics_selector;
+ GtkWidget *checkbox, *scrolled_window;
char *str;
const char *tmp;
+ gboolean state;
g_signal_connect (G_OBJECT (editor),
"response",
@@ -312,7 +338,7 @@ build_ui (EphyBookmarkProperties *editor)
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_widget_show (table);
-
+
entry = gtk_entry_new ();
tmp = ephy_node_get_property_string (editor->priv->bookmark,
EPHY_NODE_BMK_PROP_TITLE);
@@ -376,6 +402,16 @@ build_ui (EphyBookmarkProperties *editor)
gtk_table_attach (GTK_TABLE (table), scrolled_window, 1, 2, 2, 3,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ checkbox = gtk_check_button_new_with_mnemonic (_("Show in the bookmarks _toolbar"));
+ state = ephy_node_get_property_boolean (editor->priv->bookmark,
+ EPHY_NODE_BMK_PROP_SHOW_IN_TOOLBAR);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), state);
+ g_signal_connect (checkbox, "toggled",
+ G_CALLBACK (toolbar_checkbox_changed_cb), editor);
+ gtk_table_attach (GTK_TABLE (table), checkbox, 0, 2, 3, 4, GTK_FILL, 0, 0, 0);
+ gtk_widget_show (checkbox);
+
+
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox),
table, TRUE, TRUE, 0);
gtk_dialog_add_button (GTK_DIALOG (editor),