network: Make broken configuration entries red

When a configuration setting is wrong, set the entry or file chooser
that contains the incorrect information to be surrounded by red.

This makes it easier for users to find where the error was made that
disallows them to click the "Apply" button.

https://bugzilla.gnome.org/show_bug.cgi?id=734446
This commit is contained in:
Bastien Nocera 2014-08-07 18:32:34 +02:00
parent d107518404
commit 62db29b387
16 changed files with 202 additions and 25 deletions

View file

@ -31,6 +31,7 @@
#include "firewall-helpers.h"
#include "ce-page-ethernet.h"
#include "ui-helpers.h"
G_DEFINE_TYPE (CEPageEthernet, ce_page_ethernet, CE_TYPE_PAGE)
@ -167,17 +168,23 @@ validate (CEPage *page,
entry = gtk_bin_get_child (GTK_BIN (self->device_mac));
if (entry) {
ignore = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_ETHER, &invalid);
if (invalid)
if (invalid) {
widget_set_error (entry);
return FALSE;
}
if (ignore)
g_byte_array_free (ignore, TRUE);
widget_unset_error (entry);
}
ignore = ce_page_entry_to_mac (self->cloned_mac, ARPHRD_ETHER, &invalid);
if (invalid)
if (invalid) {
widget_set_error (GTK_WIDGET (self->cloned_mac));
return FALSE;
}
if (ignore)
g_byte_array_free (ignore, TRUE);
widget_unset_error (GTK_WIDGET (self->cloned_mac));
ui_to_setting (self);