aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2004-11-11 07:06:46 +0800
committerXan Lopez <xan@src.gnome.org>2004-11-11 07:06:46 +0800
commit9bffc9190fae704747c284b04c7722d8f2fb1b17 (patch)
treea22fdbca8b659ba31b00befd4b6d3f33f047f111
parenta36abe0a0fc8029b6336cbe6f26e79a79ec70aaf (diff)
downloadgsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar.gz
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar.bz2
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar.lz
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar.xz
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.tar.zst
gsoc2013-epiphany-9bffc9190fae704747c284b04c7722d8f2fb1b17.zip
Do not warn if topic is empty, better title and primary text.
* src/bookmarks/ephy-bookmarks-editor.c: (delete_topic_dialog_construct), (cmd_delete): Do not warn if topic is empty, better title and primary text.
-rw-r--r--ChangeLog7
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c35
2 files changed, 32 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index dfa5b3528..9d6192ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-11 Xan Lopez <xan@gnome.org>
+
+ * src/bookmarks/ephy-bookmarks-editor.c:
+ (delete_topic_dialog_construct), (cmd_delete):
+
+ Do not warn if topic is empty, better title and primary text.
+
2004-11-10 Xan Lopez <xan@gnome.org>
* src/bookmarks/ephy-bookmarks-editor.c:
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 5c6f58953..a5647eebb 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -452,13 +452,19 @@ delete_topic_dialog_construct (GtkWindow *parent, const char *topic)
{
GtkWidget *dialog;
GtkWindowGroup *group;
+ char *str;
+ str = g_strdup_printf (_("Delete topic %s?"), topic);
+
dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
- _("Delete topic?"));
+ str);
+
+ g_free (str);
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Delete this topic?"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("Deleting this topic will cause all its bookmarks to become "
"uncategorized, unless they also belong to other topics. "
@@ -505,20 +511,29 @@ cmd_delete (GtkAction *action,
GtkWidget *dialog;
const char *title;
int response;
-
- title = ephy_node_get_property_string (node, EPHY_NODE_KEYWORD_PROP_NAME);
- dialog = delete_topic_dialog_construct (GTK_WINDOW (editor), title);
-
+ GPtrArray *children;
- response = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_ACCEPT)
+ children = ephy_node_get_children(node);
+
+ /* Do not warn if the topic is empty */
+ if (children->len == 0)
{
ephy_node_view_remove (EPHY_NODE_VIEW (editor->priv->key_view));
}
+ else
+ {
+ title = ephy_node_get_property_string (node, EPHY_NODE_KEYWORD_PROP_NAME);
+ dialog = delete_topic_dialog_construct (GTK_WINDOW (editor), title);
+ response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+
+ if (response == GTK_RESPONSE_ACCEPT)
+ {
+ ephy_node_view_remove (EPHY_NODE_VIEW (editor->priv->key_view));
+ }
+ }
}
g_list_free (selected);
}