[Xfce4-commits] <xfce4-settings:jeromeg/settings-editor> Check if the prop name is valid when editing a prop.

Jérôme Guelfucci noreply at xfce.org
Mon Jan 11 13:10:01 CET 2010


Updating branch refs/heads/jeromeg/settings-editor
         to 629effdbedeb577c83f124fd9cf1eb05773372c7 (commit)
       from f99e5a24695534e8e45b5f42ce0062934a010689 (commit)

commit 629effdbedeb577c83f124fd9cf1eb05773372c7
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Mon Jan 11 13:03:39 2010 +0100

    Check if the prop name is valid when editing a prop.

 xfce4-settings-editor/main_window.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/xfce4-settings-editor/main_window.c b/xfce4-settings-editor/main_window.c
index 3e5a024..d417c32 100644
--- a/xfce4-settings-editor/main_window.c
+++ b/xfce4-settings-editor/main_window.c
@@ -850,6 +850,7 @@ cb_property_edit_button_clicked (GtkButton *button, GtkBuilder *builder)
     if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_APPLY)
     {
         gchar *prop_name;
+        GError *error = NULL;
 
         gtk_widget_hide (GTK_WIDGET (dialog));
         switch (gtk_combo_box_get_active (GTK_COMBO_BOX (prop_type_combo)))
@@ -883,6 +884,18 @@ cb_property_edit_button_clicked (GtkButton *button, GtkBuilder *builder)
 
         prop_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (prop_name_entry)));
 
+        if (!xfconf_property_is_valid (prop_name, &error))
+        {
+            GObject *main_window = gtk_builder_get_object (builder, "main_dialog");
+
+            xfce_dialog_show_error (GTK_WINDOW (main_window), error, _("This property name is not valid."));
+
+            g_error_free (error);
+            g_free (prop_name);
+
+            return;
+        }
+
         if (g_strcmp0 (prop_name, current_property) != 0)
         {
             xfconf_channel_reset_property (current_channel, current_property, FALSE);



More information about the Xfce4-commits mailing list