summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-04-26 15:27:36 +0200
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2016-05-20 17:06:47 -0300
commit7ae104ef82584e91ab3abe720c0a06e0b74eb3c9 (patch)
treeeb4668cea3006f600cdfe42f616d5a5177e7cb78
parentd9955f6cba3ce29554f84e5441a6e2bea3cf9da0 (diff)
downloadglade-7ae104ef82584e91ab3abe720c0a06e0b74eb3c9.tar.gz
GladeGtkNotebook: Fix "format not a string literal" warning
glade-gtk-notebook.c: In function ‘glade_gtk_box_notebook_child_insert_remove_action’: glade-gtk-notebook.c:988:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] glade_command_push_group (group_format, glade_widget_get_name (parent)); ^~~~~~~~~~~~~~~~~~~~~~~~ https://bugzilla.gnome.org/show_bug.cgi?id=765612
-rw-r--r--plugins/gtk+/glade-gtk-box.c9
-rw-r--r--plugins/gtk+/glade-gtk-notebook.c25
-rw-r--r--plugins/gtk+/glade-gtk-notebook.h3
3 files changed, 24 insertions, 13 deletions
diff --git a/plugins/gtk+/glade-gtk-box.c b/plugins/gtk+/glade-gtk-box.c
index f7e032d2..e2bb2227 100644
--- a/plugins/gtk+/glade-gtk-box.c
+++ b/plugins/gtk+/glade-gtk-box.c
@@ -611,24 +611,21 @@ glade_gtk_box_child_action_activate (GladeWidgetAdaptor * adaptor,
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "size",
- _
- ("Insert placeholder to %s"),
+ FALSE, TRUE,
FALSE, TRUE);
}
else if (strcmp (action_path, "insert_before") == 0)
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "size",
- _
- ("Insert placeholder to %s"),
+ FALSE, TRUE,
FALSE, FALSE);
}
else if (strcmp (action_path, "remove_slot") == 0)
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "size",
- _
- ("Remove placeholder from %s"),
+ FALSE, FALSE,
TRUE, FALSE);
}
else
diff --git a/plugins/gtk+/glade-gtk-notebook.c b/plugins/gtk+/glade-gtk-notebook.c
index b685d0cd..8393bb2e 100644
--- a/plugins/gtk+/glade-gtk-notebook.c
+++ b/plugins/gtk+/glade-gtk-notebook.c
@@ -936,22 +936,21 @@ glade_gtk_notebook_child_action_activate (GladeWidgetAdaptor * adaptor,
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "pages",
- _("Insert page on %s"),
+ TRUE, TRUE,
FALSE, TRUE);
}
else if (strcmp (action_path, "insert_page_before") == 0)
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "pages",
- _("Insert page on %s"),
+ TRUE, TRUE,
FALSE, FALSE);
}
else if (strcmp (action_path, "remove_page") == 0)
{
glade_gtk_box_notebook_child_insert_remove_action (adaptor, container,
object, "pages",
- _
- ("Remove page from %s"),
+ TRUE, FALSE,
TRUE, TRUE);
}
else
@@ -967,7 +966,8 @@ glade_gtk_box_notebook_child_insert_remove_action (GladeWidgetAdaptor * adaptor,
GObject * container,
GObject * object,
const gchar * size_prop,
- const gchar * group_format,
+ gboolean is_notebook,
+ gboolean is_insert,
gboolean remove,
gboolean after)
{
@@ -985,7 +985,20 @@ glade_gtk_box_notebook_child_insert_remove_action (GladeWidgetAdaptor * adaptor,
GTK_WIDGET (object), "position", &child_pos, NULL);
parent = glade_widget_get_from_gobject (container);
- glade_command_push_group (group_format, glade_widget_get_name (parent));
+ if (is_notebook)
+ {
+ if (is_insert)
+ glade_command_push_group (_("Insert page on %s"), glade_widget_get_name (parent));
+ else
+ glade_command_push_group (_("Remove page from %s"), glade_widget_get_name (parent));
+ }
+ else
+ {
+ if (is_insert)
+ glade_command_push_group (_("Insert placeholder to %s"), glade_widget_get_name (parent));
+ else
+ glade_command_push_group (_("Remove placeholder from %s"), glade_widget_get_name (parent));
+ }
/* Make sure widgets does not get destroyed */
children = glade_widget_adaptor_get_children (adaptor, container);
diff --git a/plugins/gtk+/glade-gtk-notebook.h b/plugins/gtk+/glade-gtk-notebook.h
index bb5e835d..90b0aa14 100644
--- a/plugins/gtk+/glade-gtk-notebook.h
+++ b/plugins/gtk+/glade-gtk-notebook.h
@@ -30,7 +30,8 @@ void glade_gtk_box_notebook_child_insert_remove_action (GladeWidgetAdaptor * ada
GObject * container,
GObject * object,
const gchar * size_prop,
- const gchar * group_format,
+ gboolean is_notebook,
+ gboolean is_insert,
gboolean remove,
gboolean after);