Commit 5781798e authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

GladeCommand: use glade_widget_get_display_name()

Use display name for messages
parent 3efb3662
...@@ -426,12 +426,12 @@ glade_command_property_enabled_collapse (GladeCommand *this_cmd, ...@@ -426,12 +426,12 @@ glade_command_property_enabled_collapse (GladeCommand *this_cmd,
this_priv->description = this_priv->description =
g_strdup_printf (_("Enabling property %s on widget %s"), g_strdup_printf (_("Enabling property %s on widget %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
else else
this_priv->description = this_priv->description =
g_strdup_printf (_("Disabling property %s on widget %s"), g_strdup_printf (_("Disabling property %s on widget %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
} }
/** /**
...@@ -484,12 +484,12 @@ glade_command_set_property_enabled (GladeProperty *property, ...@@ -484,12 +484,12 @@ glade_command_set_property_enabled (GladeProperty *property,
cmd_priv->description = cmd_priv->description =
g_strdup_printf (_("Enabling property %s on widget %s"), g_strdup_printf (_("Enabling property %s on widget %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
else else
cmd_priv->description = cmd_priv->description =
g_strdup_printf (_("Disabling property %s on widget %s"), g_strdup_printf (_("Disabling property %s on widget %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
glade_command_check_group (GLADE_COMMAND (me)); glade_command_check_group (GLADE_COMMAND (me));
...@@ -567,7 +567,7 @@ glade_command_set_property_execute (GladeCommand *cmd) ...@@ -567,7 +567,7 @@ glade_command_set_property_execute (GladeCommand *cmd)
g_print ("Setting %s property of %s to %s (sumode: %d)\n", g_print ("Setting %s property of %s to %s (sumode: %d)\n",
glade_property_def_id (pdef), glade_property_def_id (pdef),
glade_widget_get_name (widget), glade_widget_get_display_name (widget),
str, glade_property_superuser ()); str, glade_property_superuser ());
g_free (str); g_free (str);
...@@ -796,13 +796,13 @@ glade_command_set_property_description (GladeCommandSetProperty *me) ...@@ -796,13 +796,13 @@ glade_command_set_property_description (GladeCommandSetProperty *me)
{ {
description = g_strdup_printf (_("Setting %s of %s"), description = g_strdup_printf (_("Setting %s of %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
} }
else else
{ {
description = g_strdup_printf (_("Setting %s of %s to %s"), description = g_strdup_printf (_("Setting %s of %s to %s"),
glade_property_def_get_name (pdef), glade_property_def_get_name (pdef),
glade_widget_get_name (widget), glade_widget_get_display_name (widget),
value_name); value_name);
} }
g_free (value_name); g_free (value_name);
...@@ -1223,7 +1223,7 @@ glade_command_add (GList *widgets, ...@@ -1223,7 +1223,7 @@ glade_command_add (GList *widgets,
priv->description = priv->description =
g_strdup_printf (_("Add %s"), g_list_length (widgets) == 1 ? g_strdup_printf (_("Add %s"), g_list_length (widgets) == 1 ?
glade_widget_get_name (widget) : _("multiple")); glade_widget_get_display_name (widget) : _("multiple"));
for (list = widgets; list && list->data; list = list->next) for (list = widgets; list && list->data; list = list->next)
{ {
...@@ -1378,9 +1378,9 @@ glade_command_remove (GList *widgets) ...@@ -1378,9 +1378,9 @@ glade_command_remove (GList *widgets)
glade_util_ui_message (glade_app_get_window (), glade_util_ui_message (glade_app_get_window (),
GLADE_UI_WARN, NULL, GLADE_UI_WARN, NULL,
_("%s is locked by %s, edit %s first."), _("%s is locked by %s, edit %s first."),
glade_widget_get_name (widget), glade_widget_get_display_name (widget),
glade_widget_get_name (lock), glade_widget_get_display_name (lock),
glade_widget_get_name (lock)); glade_widget_get_display_name (lock));
return; return;
} }
} }
...@@ -1396,7 +1396,7 @@ glade_command_remove (GList *widgets) ...@@ -1396,7 +1396,7 @@ glade_command_remove (GList *widgets)
if (g_list_length (widgets) == 1) if (g_list_length (widgets) == 1)
glade_command_push_group (_("Remove %s"), glade_command_push_group (_("Remove %s"),
glade_widget_get_name (GLADE_WIDGET (widgets->data))); glade_widget_get_display_name (GLADE_WIDGET (widgets->data)));
else else
glade_command_push_group (_("Remove multiple")); glade_command_push_group (_("Remove multiple"));
...@@ -1492,8 +1492,8 @@ glade_command_add_execute (GladeCommandAddRemove *me) ...@@ -1492,8 +1492,8 @@ glade_command_add_execute (GladeCommandAddRemove *me)
GLADE_NOTE (COMMANDS, GLADE_NOTE (COMMANDS,
g_print ("Adding widget '%s' to parent '%s' " g_print ("Adding widget '%s' to parent '%s' "
"(from clipboard: %s, props recorded: %s, have placeholder: %s, child_type: %s)\n", "(from clipboard: %s, props recorded: %s, have placeholder: %s, child_type: %s)\n",
glade_widget_get_name (cdata->widget), glade_widget_get_display_name (cdata->widget),
cdata->parent ? glade_widget_get_name (cdata->parent) : "(none)", cdata->parent ? glade_widget_get_display_name (cdata->parent) : "(none)",
me->from_clipboard ? "yes" : "no", me->from_clipboard ? "yes" : "no",
cdata->props_recorded ? "yes" : "no", cdata->props_recorded ? "yes" : "no",
cdata->placeholder ? "yes" : "no", cdata->placeholder ? "yes" : "no",
...@@ -1585,8 +1585,8 @@ glade_command_add_execute (GladeCommandAddRemove *me) ...@@ -1585,8 +1585,8 @@ glade_command_add_execute (GladeCommandAddRemove *me)
GLADE_NOTE (COMMANDS, GLADE_NOTE (COMMANDS,
g_print ("Recorded properties for adding widget '%s' to parent '%s' (special child: %s)\n", g_print ("Recorded properties for adding widget '%s' to parent '%s' (special child: %s)\n",
glade_widget_get_name (cdata->widget), glade_widget_get_display_name (cdata->widget),
cdata->parent ? glade_widget_get_name (cdata->parent) : "(none)", cdata->parent ? glade_widget_get_display_name (cdata->parent) : "(none)",
cdata->special_type)); cdata->special_type));
/* Mark the properties as recorded */ /* Mark the properties as recorded */
...@@ -1631,8 +1631,8 @@ glade_command_remove_execute (GladeCommandAddRemove *me) ...@@ -1631,8 +1631,8 @@ glade_command_remove_execute (GladeCommandAddRemove *me)
GLADE_NOTE (COMMANDS, GLADE_NOTE (COMMANDS,
g_print ("Removing widget '%s' from parent '%s' " g_print ("Removing widget '%s' from parent '%s' "
"(from clipboard: %s, props recorded: %s, have placeholder: %s, child_type: %s)\n", "(from clipboard: %s, props recorded: %s, have placeholder: %s, child_type: %s)\n",
glade_widget_get_name (cdata->widget), glade_widget_get_display_name (cdata->widget),
cdata->parent ? glade_widget_get_name (cdata->parent) : "(none)", cdata->parent ? glade_widget_get_display_name (cdata->parent) : "(none)",
me->from_clipboard ? "yes" : "no", me->from_clipboard ? "yes" : "no",
cdata->props_recorded ? "yes" : "no", cdata->props_recorded ? "yes" : "no",
cdata->placeholder ? "yes" : "no", cdata->placeholder ? "yes" : "no",
...@@ -1653,8 +1653,8 @@ glade_command_remove_execute (GladeCommandAddRemove *me) ...@@ -1653,8 +1653,8 @@ glade_command_remove_execute (GladeCommandAddRemove *me)
GLADE_NOTE (COMMANDS, GLADE_NOTE (COMMANDS,
g_print ("Recorded properties for removing widget '%s' from parent '%s' (special child: %s)\n", g_print ("Recorded properties for removing widget '%s' from parent '%s' (special child: %s)\n",
glade_widget_get_name (cdata->widget), glade_widget_get_display_name (cdata->widget),
cdata->parent ? glade_widget_get_name (cdata->parent) : "(none)", cdata->parent ? glade_widget_get_display_name (cdata->parent) : "(none)",
cdata->special_type)); cdata->special_type));
/* Mark the properties as recorded */ /* Mark the properties as recorded */
...@@ -1782,8 +1782,8 @@ glade_command_create (GladeWidgetAdaptor *adaptor, ...@@ -1782,8 +1782,8 @@ glade_command_create (GladeWidgetAdaptor *adaptor,
GladePlaceholder *placeholder, GladePlaceholder *placeholder,
GladeProject *project) GladeProject *project)
{ {
GList widgets = { NULL, };
GladeWidget *widget; GladeWidget *widget;
GList *widgets = NULL;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL); g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL); g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
...@@ -1804,13 +1804,11 @@ glade_command_create (GladeWidgetAdaptor *adaptor, ...@@ -1804,13 +1804,11 @@ glade_command_create (GladeWidgetAdaptor *adaptor,
return NULL; return NULL;
} }
widgets = g_list_prepend (widgets, widget); widgets.data = widget;
glade_command_push_group (_("Create %s"), glade_widget_get_name (widget)); glade_command_push_group (_("Create %s"), glade_widget_get_display_name (widget));
glade_command_add (widgets, parent, placeholder, project, FALSE); glade_command_add (&widgets, parent, placeholder, project, FALSE);
glade_command_pop_group (); glade_command_pop_group ();
g_list_free (widgets);
/* Make selection change immediately when a widget is created */ /* Make selection change immediately when a widget is created */
glade_project_selection_changed (project); glade_project_selection_changed (project);
...@@ -1833,7 +1831,7 @@ glade_command_delete (GList *widgets) ...@@ -1833,7 +1831,7 @@ glade_command_delete (GList *widgets)
widget = widgets->data; widget = widgets->data;
glade_command_push_group (_("Delete %s"), glade_command_push_group (_("Delete %s"),
g_list_length (widgets) == 1 ? g_list_length (widgets) == 1 ?
glade_widget_get_name (widget) : _("multiple")); glade_widget_get_display_name (widget) : _("multiple"));
glade_command_remove (widgets); glade_command_remove (widgets);
glade_command_pop_group (); glade_command_pop_group ();
} }
...@@ -1859,7 +1857,7 @@ glade_command_cut (GList *widgets) ...@@ -1859,7 +1857,7 @@ glade_command_cut (GList *widgets)
widget = widgets->data; widget = widgets->data;
glade_command_push_group (_("Cut %s"), glade_command_push_group (_("Cut %s"),
g_list_length (widgets) == 1 ? g_list_length (widgets) == 1 ?
glade_widget_get_name (widget) : _("multiple")); glade_widget_get_display_name (widget) : _("multiple"));
glade_command_remove (widgets); glade_command_remove (widgets);
glade_command_pop_group (); glade_command_pop_group ();
...@@ -1962,7 +1960,7 @@ glade_command_paste (GList *widgets, ...@@ -1962,7 +1960,7 @@ glade_command_paste (GList *widgets,
glade_command_push_group (_("Paste %s"), glade_command_push_group (_("Paste %s"),
g_list_length (widgets) == 1 ? g_list_length (widgets) == 1 ?
glade_widget_get_name (copied_widget) : _("multiple")); glade_widget_get_display_name (copied_widget) : _("multiple"));
glade_command_add (copied_widgets, parent, placeholder, project, TRUE); glade_command_add (copied_widgets, parent, placeholder, project, TRUE);
glade_command_pop_group (); glade_command_pop_group ();
...@@ -2004,8 +2002,8 @@ glade_command_dnd (GList *widgets, ...@@ -2004,8 +2002,8 @@ glade_command_dnd (GList *widgets,
glade_command_push_group (_("Drag %s and Drop to %s"), glade_command_push_group (_("Drag %s and Drop to %s"),
g_list_length (widgets) == 1 ? g_list_length (widgets) == 1 ?
glade_widget_get_name (widget) : _("multiple"), glade_widget_get_display_name (widget) : _("multiple"),
parent ? glade_widget_get_name (parent) : _("root")); parent ? glade_widget_get_display_name (parent) : _("root"));
glade_command_remove (widgets); glade_command_remove (widgets);
glade_command_add (widgets, parent, placeholder, project, TRUE); glade_command_add (widgets, parent, placeholder, project, TRUE);
glade_command_pop_group (); glade_command_pop_group ();
...@@ -2458,8 +2456,8 @@ glade_command_lock_widget (GladeWidget *widget, GladeWidget *locked) ...@@ -2458,8 +2456,8 @@ glade_command_lock_widget (GladeWidget *widget, GladeWidget *locked)
priv->project = glade_widget_get_project (widget); priv->project = glade_widget_get_project (widget);
priv->description = priv->description =
g_strdup_printf (_("Locking %s by widget %s"), g_strdup_printf (_("Locking %s by widget %s"),
glade_widget_get_name (locked), glade_widget_get_display_name (locked),
glade_widget_get_name (widget)); glade_widget_get_display_name (widget));
glade_command_check_group (cmd); glade_command_check_group (cmd);
...@@ -2502,7 +2500,7 @@ glade_command_unlock_widget (GladeWidget *widget) ...@@ -2502,7 +2500,7 @@ glade_command_unlock_widget (GladeWidget *widget)
priv = glade_command_get_instance_private (cmd); priv = glade_command_get_instance_private (cmd);
priv->project = glade_widget_get_project (widget); priv->project = glade_widget_get_project (widget);
priv->description = priv->description =
g_strdup_printf (_("Unlocking %s"), glade_widget_get_name (widget)); g_strdup_printf (_("Unlocking %s"), glade_widget_get_display_name (widget));
glade_command_check_group (cmd); glade_command_check_group (cmd);
...@@ -3001,10 +2999,10 @@ gcp_template_description_new (GladeCommand *cmd) ...@@ -3001,10 +2999,10 @@ gcp_template_description_new (GladeCommand *cmd)
if (new_template == NULL && old_template != NULL) if (new_template == NULL && old_template != NULL)
return g_strdup_printf (_("Unsetting widget '%s' as template"), return g_strdup_printf (_("Unsetting widget '%s' as template"),
glade_widget_get_name (GLADE_WIDGET (old_template))); glade_widget_get_display_name (GLADE_WIDGET (old_template)));
else if (new_template != NULL) else if (new_template != NULL)
return g_strdup_printf (_("Setting widget '%s' as template"), return g_strdup_printf (_("Setting widget '%s' as template"),
glade_widget_get_name (GLADE_WIDGET (new_template))); glade_widget_get_display_name (GLADE_WIDGET (new_template)));
else else
return g_strdup (_("Unsetting template")); return g_strdup (_("Unsetting template"));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment