[network-manager-openvpn/lr/cert-chooser: 2/6] properties: remove the offensive way of indicating an error



commit 43203a3ef37ee4f7c2256d253d1b2bb411e37a1a
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Wed Mar 8 14:27:53 2017 +0100

    properties: remove the offensive way of indicating an error
    
    The frame should be red, not the background.

 properties/nm-openvpn-editor.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/properties/nm-openvpn-editor.c b/properties/nm-openvpn-editor.c
index f8acb9f..c8fe8a4 100644
--- a/properties/nm-openvpn-editor.c
+++ b/properties/nm-openvpn-editor.c
@@ -118,7 +118,6 @@ check_validity (OpenvpnEditor *self, GError **error)
        GtkTreeModel *model;
        GtkTreeIter iter;
        const char *contype = NULL;
-       GdkRGBA rgba;
        gboolean gateway_valid;
        gboolean success;
 
@@ -126,10 +125,10 @@ check_validity (OpenvpnEditor *self, GError **error)
        str = gtk_entry_get_text (GTK_ENTRY (widget));
        gateway_valid = check_gateway_entry (str);
        /* Change entry background colour while editing */
-       if (!gateway_valid)
-               gdk_rgba_parse (&rgba, "red3");
-       gtk_widget_override_background_color (widget, GTK_STATE_FLAG_NORMAL, !gateway_valid ? &rgba : NULL);
-       if (!gateway_valid) {
+       if (gateway_valid) {
+               gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "error");
+       } else {
+               gtk_style_context_add_class (gtk_widget_get_style_context (widget), "error");
                g_set_error (error,
                             NMV_EDITOR_PLUGIN_ERROR,
                             NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]