From 907c1750b7d7baa3d497dab85691988a2222d034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Wauthy?= <pollux@xfce.org> Date: Thu, 23 Sep 2004 13:43:07 +0000 Subject: [PATCH] minor fixes (Old svn revision: 11974) --- mcs-plugin/xfwm4_shortcuteditor.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mcs-plugin/xfwm4_shortcuteditor.c b/mcs-plugin/xfwm4_shortcuteditor.c index 89cff0aff..b8a8b3212 100644 --- a/mcs-plugin/xfwm4_shortcuteditor.c +++ b/mcs-plugin/xfwm4_shortcuteditor.c @@ -1095,7 +1095,7 @@ cb_activate_treeview4 (GtkWidget * treeview, GtkTreePath * path, GtkTreeViewColu GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; - gchar *shortcut_name = NULL; + gchar *command = NULL; gchar *shortcut = NULL; GtkWidget *dialog; GtkWidget *hbox; @@ -1104,14 +1104,20 @@ cb_activate_treeview4 (GtkWidget * treeview, GtkTreePath * path, GtkTreeViewColu GtkWidget *label; gchar *dialog_text = NULL; - /* Get shortcut name */ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, COLUMN_COMMAND, &shortcut_name, -1); + gtk_tree_model_get (model, &iter, COLUMN_COMMAND, &command, -1); gtk_tree_model_get (model, &iter, COLUMN_SHORTCUT, &shortcut, -1); - dialog_text = g_strdup_printf ("<i>%s</i>\n<b>%s</b>", _("Compose shortcut for command :"), shortcut_name); + if (strcmp (command, "none") == 0) + { + g_free (shortcut); + g_free (command); + return; + } + + dialog_text = g_strdup_printf ("<i>%s</i>\n<b>%s</b>", _("Compose shortcut for command :"), command); /* Create dialog */ dialog = gtk_dialog_new_with_buttons (_("Compose shortcut"), NULL, GTK_DIALOG_MODAL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); @@ -1147,7 +1153,8 @@ cb_activate_treeview4 (GtkWidget * treeview, GtkTreePath * path, GtkTreeViewColu { g_warning (_("Cannot grab the keyboard")); g_free (dialog_text); - g_free (shortcut_name); + g_free (shortcut); + g_free (command); return; } @@ -1163,7 +1170,7 @@ cb_activate_treeview4 (GtkWidget * treeview, GtkTreePath * path, GtkTreeViewColu gtk_widget_destroy (dialog); g_free (dialog_text); - g_free (shortcut_name); + g_free (command); g_free (shortcut); } } -- GitLab