[Goodies-commits] r7262 - in xfce4-clipman-plugin/trunk: . panel-plugin
Mike Massonnet
mmassonnet at xfce.org
Tue Apr 21 20:16:57 CEST 2009
Author: mmassonnet
Date: 2009-04-21 18:16:57 +0000 (Tue, 21 Apr 2009)
New Revision: 7262
Modified:
xfce4-clipman-plugin/trunk/ChangeLog
xfce4-clipman-plugin/trunk/panel-plugin/main.c
Log:
Markup escape for action name and command name in the treeview
Modified: xfce4-clipman-plugin/trunk/ChangeLog
===================================================================
--- xfce4-clipman-plugin/trunk/ChangeLog 2009-04-21 08:08:24 UTC (rev 7261)
+++ xfce4-clipman-plugin/trunk/ChangeLog 2009-04-21 18:16:57 UTC (rev 7262)
@@ -1,4 +1,7 @@
2009-04-21 Mike Massonnet
+Markup escape for action name and command name in the treeview
+
+2009-04-21 Mike Massonnet
Add OnlyShowIn to the desktop entry file for the menu
- xfce4-clipman-plugin.desktop.in:
Modified: xfce4-clipman-plugin/trunk/panel-plugin/main.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/main.c 2009-04-21 08:08:24 UTC (rev 7261)
+++ xfce4-clipman-plugin/trunk/panel-plugin/main.c 2009-04-21 18:16:57 UTC (rev 7262)
@@ -742,7 +742,7 @@
setup_actions_treeview (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "actions")), plugin);
setup_commands_treeview (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "commands")), plugin);
- /* Callbacks for the OK button sensitivity in the actions dialog */
+ /* Callbacks for the OK button sensitivity in the edit action dialog */
g_signal_connect_after (glade_xml_get_widget (plugin->gxml, "action-name"), "changed",
G_CALLBACK (cb_set_action_dialog_button_ok), plugin);
g_signal_connect_after (glade_xml_get_widget (plugin->gxml, "regex"), "changed",
@@ -1039,7 +1039,7 @@
const GSList *entries;
GtkTreeModel *model;
GtkTreeIter iter;
- gchar *title;
+ gchar *action_name_escaped, *title;
model = gtk_tree_view_get_model (treeview);
gtk_list_store_clear (GTK_LIST_STORE (model));
@@ -1048,10 +1048,12 @@
for (; entries != NULL; entries = entries->next)
{
entry = entries->data;
+ action_name_escaped = g_markup_escape_text (entry->action_name, -1);
- title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>", entry->action_name, g_regex_get_pattern (entry->regex));
+ title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>", action_name_escaped, g_regex_get_pattern (entry->regex));
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, entry, 1, title, -1);
+ g_free (action_name_escaped);
g_free (title);
}
}
@@ -1314,7 +1316,7 @@
GtkWidget *command;
GtkTreeModel *model;
GtkTreeIter iter;
- gchar *title;
+ gchar *command_name_escaped, *title;
command_name = glade_xml_get_widget (plugin->gxml, "command-name");
command = glade_xml_get_widget (plugin->gxml, "command");
@@ -1323,14 +1325,16 @@
|| gtk_entry_get_text (GTK_ENTRY (command))[0] == '\0')
return;
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "commands")));
+ command_name_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command_name)), -1);
title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
- gtk_entry_get_text (GTK_ENTRY (command_name)),
+ command_name_escaped,
gtk_entry_get_text (GTK_ENTRY (command)));
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "commands")));
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, title,
1, gtk_entry_get_text (GTK_ENTRY (command_name)),
2, gtk_entry_get_text (GTK_ENTRY (command)), -1);
+ g_free (command_name_escaped);
g_free (title);
gtk_entry_set_text (GTK_ENTRY (command_name), "");
@@ -1347,7 +1351,7 @@
GtkTreeIter iter;
GtkWidget *command_name;
GtkWidget *command;
- gchar *title;
+ gchar *command_name_escaped, *title;
command_name = glade_xml_get_widget (plugin->gxml, "command-name");
command = glade_xml_get_widget (plugin->gxml, "command");
@@ -1364,12 +1368,14 @@
return;
}
+ command_name_escaped = g_markup_escape_text (gtk_entry_get_text (GTK_ENTRY (command_name)), -1);
title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
- gtk_entry_get_text (GTK_ENTRY (command_name)),
+ command_name_escaped,
gtk_entry_get_text (GTK_ENTRY (command)));
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, title,
1, gtk_entry_get_text (GTK_ENTRY (command_name)),
2, gtk_entry_get_text (GTK_ENTRY (command)), -1);
+ g_free (command_name_escaped);
g_free (title);
gtk_tree_selection_unselect_all (selection);
More information about the Goodies-commits
mailing list