[network-manager-applet/th/validation-error-bgo754832: 13/13] fixup! c-e: show tooltip with validation error
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/th/validation-error-bgo754832: 13/13] fixup! c-e: show tooltip with validation error
- Date: Fri, 11 Sep 2015 08:22:29 +0000 (UTC)
commit 40d1927215df62a8a088636e98c1558b71770b61
Author: Thomas Haller <thaller redhat com>
Date: Fri Sep 11 10:06:34 2015 +0200
fixup! c-e: show tooltip with validation error
Restore printing the validation error, but as message, not warning.
It might still be useful for debugging.
Also, we might want to suggest to a user that he looks at stdout for
messages -- which would also semi-work with prevous version (although
the message being less helpfull).
src/connection-editor/nm-connection-editor.c | 10 ++++++++++
src/connection-editor/nm-connection-editor.h | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 6dca0e2..f09ea7b 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -216,6 +216,14 @@ connection_editor_validate (NMConnectionEditor *editor)
}
done:
+ if (g_strcmp0 (validation_error, editor->last_validation_error) != 0) {
+ if (editor->last_validation_error && !validation_error)
+ g_message ("Connection validates and can be saved");
+ else if (validation_error)
+ g_message ("Cannot save connection due to error: %s", validation_error);
+ g_clear_pointer (&editor->last_validation_error, g_free);
+ editor->last_validation_error = g_strdup (validation_error);
+ }
ce_polkit_button_set_validation_error (CE_POLKIT_BUTTON (editor->ok_button), validation_error);
gtk_widget_set_sensitive (editor->export_button, !!validation_error);
@@ -351,6 +359,8 @@ dispose (GObject *object)
g_signal_handler_disconnect (editor->client, editor->permission_id);
g_object_unref (editor->client);
+ g_clear_pointer (&editor->last_validation_error, g_free);
+
out:
G_OBJECT_CLASS (nm_connection_editor_parent_class)->dispose (object);
}
diff --git a/src/connection-editor/nm-connection-editor.h b/src/connection-editor/nm-connection-editor.h
index 7c953b8..259e8dc 100644
--- a/src/connection-editor/nm-connection-editor.h
+++ b/src/connection-editor/nm-connection-editor.h
@@ -64,6 +64,8 @@ typedef struct {
gboolean busy;
gboolean init_run;
guint validate_id;
+
+ char *last_validation_error;
} NMConnectionEditor;
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]