aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Adam Bordoley <bordoley@msu.edu>2003-05-06 00:53:25 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-05-06 00:53:25 +0800
commita9ad6d75f510335d318eef6082d6b5b18de48971 (patch)
treedc28bd1b3dc7b5f9f845518c3a6088dab072664d /src
parent7457f676155191be13664f62ccbe2e1fcb184de4 (diff)
downloadgsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar.gz
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar.bz2
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar.lz
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar.xz
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.tar.zst
gsoc2013-epiphany-a9ad6d75f510335d318eef6082d6b5b18de48971.zip
If there is only one "toolbar" make it non-removable.
2003-05-05 David Adam Bordoley <bordoley@msu.edu> * src/toolbar.c: (update_toolbar_remove_flag), (toolbar_set_window): If there is only one "toolbar" make it non-removable. * src/bookmarks/ephy-bookmarks.c: (default_bookmarks []), (default_topics []), (ephy_bookmarks_init_defaults): Make the default topic similar to safari's. Mark the default google smartbookmark for translation and include a comment instructing translators how to properly translate it. Add the google smartbookmark to the bookmarks bar by default. * src/bookmarks/ephy-topic-action.c: (create_tool_item): Change the space between the topic and it arrow to 3px. 6px seemed like too much.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks.c22
-rw-r--r--src/bookmarks/ephy-topic-action.c2
-rwxr-xr-xsrc/toolbar.c38
3 files changed, 57 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 9004dd86d..91c3e9c24 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -23,6 +23,7 @@
#include "ephy-debug.h"
#include "ephy-tree-model-node.h"
#include "ephy-node-view.h"
+#include "ephy-toolbars-model.h"
#include <string.h>
#include <libgnome/gnome-i18n.h>
@@ -51,16 +52,22 @@ typedef struct
static const EphyBookmarksBookmarkInfo default_bookmarks [] =
{
- { N_("Search the web"), "http://www.google.com", "http://www.google.com/search?q=%s" }
+ /* Translators you should change these links to respect your locale.
+ * For instance in .nl these should be
+ * "http://www.google.nl" and "http://www.google.nl/search?q=%s"
+ */
+
+ { N_("Search the web"), N_("http://www.google.com"), N_("http://www.google.com/search?q=%s") }
};
static int n_default_bookmarks = G_N_ELEMENTS (default_bookmarks);
static const char *default_topics [] =
{
+ N_("Entertainment"),
N_("News"),
- N_("People"),
- N_("Shop"),
- N_("Art"),
+ N_("Shopping"),
+ N_("Sports"),
+ N_("Travel"),
N_("Work")
};
static int n_default_topics = G_N_ELEMENTS (default_topics);
@@ -221,6 +228,10 @@ static void
ephy_bookmarks_init_defaults (EphyBookmarks *eb)
{
int i;
+ int id;
+ EphyToolbarsModel *model;
+
+ model = ephy_shell_get_toolbars_model (ephy_shell);
for (i = 0; i < n_default_topics; i++)
{
@@ -232,6 +243,9 @@ ephy_bookmarks_init_defaults (EphyBookmarks *eb)
ephy_bookmarks_add (eb, default_bookmarks[i].title,
default_bookmarks[i].location,
default_bookmarks[i].smart_url);
+
+ id = ephy_bookmarks_get_bookmark_id (eb, default_bookmarks[i].location);
+ ephy_toolbars_model_add_bookmark (model, FALSE, id);
}
}
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 121701286..769403a1b 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -98,7 +98,7 @@ create_tool_item (EggAction *action)
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
gtk_widget_show (arrow);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_hbox_new (FALSE, 3);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (button), hbox);
diff --git a/src/toolbar.c b/src/toolbar.c
index 6cebc97e5..3b8c63359 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -353,6 +353,38 @@ init_bookmarks_toolbar (Toolbar *t)
}
static void
+update_toolbar_remove_flag (EphyToolbarsModel *model, gpointer data)
+{
+ int i, n_toolbars;
+ int not_removable = 0;
+
+ n_toolbars = egg_toolbars_model_n_toolbars
+ (EGG_TOOLBARS_MODEL (model));
+
+ /* If there is only one toolbar and the bookmarks bar */
+ if (n_toolbars <= 2)
+ {
+ not_removable = EGG_TB_MODEL_NOT_REMOVABLE;
+ }
+
+ for (i = 0; i < n_toolbars; i++)
+ {
+ const char *t_name;
+
+ t_name = egg_toolbars_model_toolbar_nth
+ (EGG_TOOLBARS_MODEL (model), i);
+ g_return_if_fail (t_name != NULL);
+
+ if (!(strcmp (t_name, "BookmarksBar") == 0))
+ {
+ egg_toolbars_model_set_flags
+ (EGG_TOOLBARS_MODEL (model),
+ not_removable, i);
+ }
+ }
+}
+
+static void
toolbar_set_window (Toolbar *t, EphyWindow *window)
{
EphyToolbarsModel *model;
@@ -371,6 +403,12 @@ toolbar_set_window (Toolbar *t, EphyWindow *window)
NULL);
model = ephy_shell_get_toolbars_model (ephy_shell);
+ g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_added",
+ G_CALLBACK (update_toolbar_remove_flag),
+ NULL);
+ g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_removed",
+ G_CALLBACK (update_toolbar_remove_flag),
+ NULL);
g_object_set (G_OBJECT (t),
"ToolbarsModel", model,
"MenuMerge", t->priv->ui_merge,