summaryrefslogtreecommitdiff
path: root/tui
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-12-19 12:44:23 -0500
committerDan Winship <danw@gnome.org>2014-01-16 09:19:06 -0500
commitc1017d04dfbcfd1ceb1be75ee70bbcc8e06b4457 (patch)
treed2b4064c5153134599b41efabd069ce715a34152 /tui
parenteb9cd6da0811eff70379c6a825176290c3e0bf2b (diff)
downloadNetworkManager-c1017d04dfbcfd1ceb1be75ee70bbcc8e06b4457.tar.gz
tui: rename nmt_newt_error_dialog() to nmt_newt_message_dialog()
Diffstat (limited to 'tui')
-rw-r--r--tui/newt/nmt-newt-utils.c16
-rw-r--r--tui/newt/nmt-newt-utils.h4
-rw-r--r--tui/nmt-connect-connection-list.c2
-rw-r--r--tui/nmt-editor.c20
-rw-r--r--tui/nmtui-connect.c2
-rw-r--r--tui/nmtui-edit.c11
-rw-r--r--tui/nmtui-hostname.c4
7 files changed, 28 insertions, 31 deletions
diff --git a/tui/newt/nmt-newt-utils.c b/tui/newt/nmt-newt-utils.c
index 9ab1a9dfcc..d7e0eeaee9 100644
--- a/tui/newt/nmt-newt-utils.c
+++ b/tui/newt/nmt-newt-utils.c
@@ -146,18 +146,16 @@ nmt_newt_finished (void)
}
/**
- * nmt_newt_error_dialog:
+ * nmt_newt_message_dialog:
* @message: a printf()-style message format
* @...: arguments
*
* Displays the given message in a dialog box with a single "OK"
* button, and returns after the user clicks "OK".
- *
- * FIXME: it's not just for errors any more!
*/
void
-nmt_newt_error_dialog (const char *message,
- ...)
+nmt_newt_message_dialog (const char *message,
+ ...)
{
va_list ap;
char *msg, *msg_lc, *ok_lc;
@@ -284,7 +282,7 @@ nmt_newt_edit_string (const char *data)
fd = g_file_open_tmp ("XXXXXX.json", &filename, &error);
if (fd == -1) {
- nmt_newt_error_dialog (_("Could not create temporary file: %s"), error->message);
+ nmt_newt_message_dialog (_("Could not create temporary file: %s"), error->message);
g_error_free (error);
return NULL;
}
@@ -316,19 +314,19 @@ nmt_newt_edit_string (const char *data)
newtResume ();
if (error) {
- nmt_newt_error_dialog (_("Could not create temporary file: %s"), error->message);
+ nmt_newt_message_dialog (_("Could not create temporary file: %s"), error->message);
g_error_free (error);
goto done;
}
if (!g_spawn_check_exit_status (status, &error)) {
- nmt_newt_error_dialog (_("Editor failed: %s"), error->message);
+ nmt_newt_message_dialog (_("Editor failed: %s"), error->message);
g_error_free (error);
goto done;
}
if (!g_file_get_contents (filename, &new_data, NULL, &error)) {
- nmt_newt_error_dialog (_("Could not re-read file: %s"), error->message);
+ nmt_newt_message_dialog (_("Could not re-read file: %s"), error->message);
g_error_free (error);
goto done;
}
diff --git a/tui/newt/nmt-newt-utils.h b/tui/newt/nmt-newt-utils.h
index 1823e3c2a7..c71a6b77f1 100644
--- a/tui/newt/nmt-newt-utils.h
+++ b/tui/newt/nmt-newt-utils.h
@@ -37,8 +37,8 @@ typedef enum {
char *nmt_newt_locale_to_utf8 (const char *str_lc);
char *nmt_newt_locale_from_utf8 (const char *str_utf8);
-void nmt_newt_error_dialog (const char *message,
- ...);
+void nmt_newt_message_dialog (const char *message,
+ ...);
int nmt_newt_choice_dialog (const char *button1,
const char *button2,
const char *message,
diff --git a/tui/nmt-connect-connection-list.c b/tui/nmt-connect-connection-list.c
index 261a4a5780..975ed1ea28 100644
--- a/tui/nmt-connect-connection-list.c
+++ b/tui/nmt-connect-connection-list.c
@@ -702,7 +702,7 @@ nmt_connect_connection_list_activated (NmtNewtWidget *widget)
activate_nmt_connection_async (NMT_CONNECT_CONNECTION_LIST (widget), nmtconn,
activate_complete, &op);
if (!nmt_sync_op_wait_boolean (&op, &error)) {
- nmt_newt_error_dialog (_("Could not activate connection: %s"), error->message);
+ nmt_newt_message_dialog (_("Could not activate connection: %s"), error->message);
g_error_free (error);
}
}
diff --git a/tui/nmt-editor.c b/tui/nmt-editor.c
index 7aa2276ab7..1f2231a27a 100644
--- a/tui/nmt-editor.c
+++ b/tui/nmt-editor.c
@@ -78,12 +78,12 @@ nmt_editor_new (NMConnection *connection)
s_con = nm_connection_get_setting_connection (connection);
if (s_con) {
- nmt_newt_error_dialog (_("Could not create editor for connection '%s' of type '%s'."),
- nm_connection_get_id (connection),
- nm_setting_connection_get_connection_type (s_con));
+ nmt_newt_message_dialog (_("Could not create editor for connection '%s' of type '%s'."),
+ nm_connection_get_id (connection),
+ nm_setting_connection_get_connection_type (s_con));
} else {
- nmt_newt_error_dialog (_("Could not create editor for invalid connection '%s'."),
- nm_connection_get_id (connection));
+ nmt_newt_message_dialog (_("Could not create editor for invalid connection '%s'."),
+ nm_connection_get_id (connection));
}
return NULL;
@@ -131,7 +131,7 @@ save_connection_and_exit (NmtNewtButton *button,
if (!nm_connection_replace_settings_from_connection (priv->orig_connection,
priv->edit_connection,
&error)) {
- nmt_newt_error_dialog (_("Error saving connection: %s"), error->message);
+ nmt_newt_message_dialog (_("Error saving connection: %s"), error->message);
g_error_free (error);
return;
}
@@ -141,8 +141,8 @@ save_connection_and_exit (NmtNewtButton *button,
nm_remote_connection_commit_changes (NM_REMOTE_CONNECTION (priv->orig_connection),
connection_updated, &op);
if (!nmt_sync_op_wait_boolean (&op, &error)) {
- nmt_newt_error_dialog (_("Unable to save connection: %s"),
- error->message);
+ nmt_newt_message_dialog (_("Unable to save connection: %s"),
+ error->message);
g_error_free (error);
return;
}
@@ -155,8 +155,8 @@ save_connection_and_exit (NmtNewtButton *button,
nm_remote_settings_add_connection (nm_settings, priv->orig_connection,
connection_added, &op);
if (!nmt_sync_op_wait_boolean (&op, &error)) {
- nmt_newt_error_dialog (_("Unable to add new connection: %s"),
- error->message);
+ nmt_newt_message_dialog (_("Unable to add new connection: %s"),
+ error->message);
g_error_free (error);
return;
}
diff --git a/tui/nmtui-connect.c b/tui/nmtui-connect.c
index 76b1400479..8f3ad666e0 100644
--- a/tui/nmtui-connect.c
+++ b/tui/nmtui-connect.c
@@ -69,7 +69,7 @@ nmt_connect_connection (const char *identifier)
nmt_connect_connection_list_activate_async (NMT_CONNECT_CONNECTION_LIST (list), identifier,
connect_complete, &op);
if (!nmt_sync_op_wait_boolean (&op, &error)) {
- nmt_newt_error_dialog (_("Could not activate connection: %s"), error->message);
+ nmt_newt_message_dialog (_("Could not activate connection: %s"), error->message);
g_error_free (error);
nmtui_quit ();
}
diff --git a/tui/nmtui-edit.c b/tui/nmtui-edit.c
index cda9b8c0fe..e457fbd427 100644
--- a/tui/nmtui-edit.c
+++ b/tui/nmtui-edit.c
@@ -440,9 +440,8 @@ connection_deleted_callback (NMRemoteConnection *connection,
ConnectionDeleteData *data = user_data;
if (error) {
- nmt_newt_error_dialog (_("OK"),
- _("Unable to delete connection: %s"),
- error->message);
+ nmt_newt_message_dialog (_("Unable to delete connection: %s"),
+ error->message);
} else
data->got_callback = TRUE;
@@ -484,8 +483,8 @@ nmt_remove_connection (NMRemoteConnection *connection)
nm_remote_connection_delete (connection, connection_deleted_callback, &data);
if (!nmt_sync_op_wait_boolean (&data.op, &error)) {
- nmt_newt_error_dialog (_("Could not delete connection: %s"),
- error->message);
+ nmt_newt_message_dialog (_("Could not delete connection: %s"),
+ error->message);
g_error_free (error);
}
@@ -517,7 +516,7 @@ nmtui_edit (int argc, char **argv)
}
if (!conn) {
- nmt_newt_error_dialog ("%s: no such connection '%s'\n", argv[0], argv[1]);
+ nmt_newt_message_dialog ("%s: no such connection '%s'\n", argv[0], argv[1]);
nmtui_quit ();
return;
}
diff --git a/tui/nmtui-hostname.c b/tui/nmtui-hostname.c
index 11216bc6ce..b600d4e447 100644
--- a/tui/nmtui-hostname.c
+++ b/tui/nmtui-hostname.c
@@ -111,9 +111,9 @@ nmtui_hostname (int argc, char **argv)
nm_remote_settings_save_hostname (nm_settings, hostname, hostname_set, &op);
if (nmt_sync_op_wait_boolean (&op, &error)) {
/* Translators: this indicates the result. ie, "I have set the hostname to ..." */
- nmt_newt_error_dialog (_("Set hostname to '%s'"), hostname);
+ nmt_newt_message_dialog (_("Set hostname to '%s'"), hostname);
} else {
- nmt_newt_error_dialog (_("Unable to set hostname: %s"), error->message);
+ nmt_newt_message_dialog (_("Unable to set hostname: %s"), error->message);
g_error_free (error);
}