[network-manager-openvpn/nm-1-2] properties: remove the offensive way of indicating an error
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/nm-1-2] properties: remove the offensive way of indicating an error
- Date: Thu, 21 Sep 2017 11:46:44 +0000 (UTC)
commit a40493b3eeea7a08972c6e9af9a7041c954a8878
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.
(cherry picked from commit 440c0ba6ccc228730bfad229e2716c88f906a373)
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]