diff options
| author | Michael Biebl <biebl@debian.org> | 2018-05-11 22:08:45 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-05-11 22:08:45 +0200 |
| commit | ee9c73a923909e23a649407be77e25235d769e25 (patch) | |
| tree | e21c923621fa278e737da693df9eb60ea31a6067 /clients/tui | |
| parent | f60117b41d5433be1b4a96d82cd11d0c3dce9b63 (diff) | |
New upstream version 1.10.8 upstream/1.10.8
Diffstat (limited to 'clients/tui')
31 files changed, 100 insertions, 158 deletions
diff --git a/clients/tui/meson.build b/clients/tui/meson.build deleted file mode 100644 index dd472998..00000000 --- a/clients/tui/meson.build +++ /dev/null @@ -1,72 +0,0 @@ -name = 'nmtui' - -deps = [ - newt_dep, - nm_core_dep -] - -cflags = clients_cflags + [ - '-DG_LOG_DOMAIN="@0@"'.format(name), - '-DLOCALEDIR="@0@"'.format(nm_localedir) -] - -subdir('newt') - -sources = files( - 'nm-editor-bindings.c', - 'nm-editor-utils.c', - 'nmt-address-list.c', - 'nmt-connect-connection-list.c', - 'nmt-device-entry.c', - 'nmt-edit-connection-list.c', - 'nmt-editor.c', - 'nmt-editor-grid.c', - 'nmt-editor-page.c', - 'nmt-editor-page-device.c', - 'nmt-editor-section.c', - 'nmt-ip-entry.c', - 'nmt-mac-entry.c', - 'nmt-mtu-entry.c', - 'nmt-page-bond.c', - 'nmt-page-bridge.c', - 'nmt-page-bridge-port.c', - 'nmt-page-dsl.c', - 'nmt-page-ethernet.c', - 'nmt-page-infiniband.c', - 'nmt-page-ip4.c', - 'nmt-page-ip6.c', - 'nmt-page-ip-tunnel.c', - 'nmt-page-ppp.c', - 'nmt-page-team.c', - 'nmt-page-team-port.c', - 'nmt-page-vlan.c', - 'nmt-page-wifi.c', - 'nmt-password-dialog.c', - 'nmt-password-fields.c', - 'nmt-route-editor.c', - 'nmt-route-entry.c', - 'nmt-route-table.c', - 'nmt-slave-list.c', - 'nmtui.c', - 'nmtui-connect.c', - 'nmtui-edit.c', - 'nmtui-hostname.c', - 'nmt-utils.c', - 'nmt-widget-list.c' -) - -deps += [ - libnm_dep, - libnmc_base_dep, - libnmt_newt_dep -] - -executable( - name, - sources, - dependencies: deps, - c_args: cflags, - link_args: ldflags_linker_script_binary, - link_depends: linker_script_binary, - install: true -) diff --git a/clients/tui/newt/meson.build b/clients/tui/newt/meson.build deleted file mode 100644 index aeec39da..00000000 --- a/clients/tui/newt/meson.build +++ /dev/null @@ -1,35 +0,0 @@ -sources = files( - 'nmt-newt-button-box.c', - 'nmt-newt-button.c', - 'nmt-newt-checkbox.c', - 'nmt-newt-component.c', - 'nmt-newt-container.c', - 'nmt-newt-entry.c', - 'nmt-newt-entry-numeric.c', - 'nmt-newt-form.c', - 'nmt-newt-grid.c', - 'nmt-newt-hacks.c', - 'nmt-newt-label.c', - 'nmt-newt-listbox.c', - 'nmt-newt-popup.c', - 'nmt-newt-section.c', - 'nmt-newt-separator.c', - 'nmt-newt-stack.c', - 'nmt-newt-textbox.c', - 'nmt-newt-toggle-button.c', - 'nmt-newt-utils.c', - 'nmt-newt-widget.c' -) - -libnmt_newt = static_library( - 'nmt-newt', - sources: sources + [libnm_enum[1]], - include_directories: libnm_inc, - dependencies: deps, - c_args: cflags -) - -libnmt_newt_dep = declare_dependency( - include_directories: include_directories('.'), - link_with: libnmt_newt -) diff --git a/clients/tui/newt/nmt-newt-section.c b/clients/tui/newt/nmt-newt-section.c index 34073454..38152c96 100644 --- a/clients/tui/newt/nmt-newt-section.c +++ b/clients/tui/newt/nmt-newt-section.c @@ -304,7 +304,7 @@ adjust_border_for_allocation (NmtNewtSectionPrivate *priv, label = nmt_newt_label_new (line_glyph); g_ptr_array_add (priv->border_line_labels, label); nmt_newt_grid_add (NMT_NEWT_GRID (priv->border_grid), label, 0, i + 1); - } else + } else nmt_newt_widget_set_visible (priv->border_line_labels->pdata[i], TRUE); } nmt_newt_widget_set_visible (priv->border_end_label, TRUE); diff --git a/clients/tui/newt/nmt-newt-utils.c b/clients/tui/newt/nmt-newt-utils.c index 112d2599..f37a851e 100644 --- a/clients/tui/newt/nmt-newt-utils.c +++ b/clients/tui/newt/nmt-newt-utils.c @@ -359,11 +359,21 @@ nmt_newt_edit_string (const char *data) goto done; } +#if GLIB_CHECK_VERSION (2, 34, 0) + G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (!g_spawn_check_exit_status (status, &error)) { nmt_newt_message_dialog (_("Editor failed: %s"), error->message); g_error_free (error); goto done; } + G_GNUC_END_IGNORE_DEPRECATIONS +#else + if (WIFEXITED (status)) { + if (WEXITSTATUS (status) != 0) + nmt_newt_message_dialog (_("Editor failed with status %d"), WEXITSTATUS (status)); + } else if (WIFSIGNALED (status)) + nmt_newt_message_dialog (_("Editor failed with signal %d"), WTERMSIG (status)); +#endif if (!g_file_get_contents (filename, &new_data, NULL, &error)) { nmt_newt_message_dialog (_("Could not re-read file: %s"), error->message); @@ -376,5 +386,5 @@ nmt_newt_edit_string (const char *data) g_free (filename); return new_data; -} +} diff --git a/clients/tui/newt/nmt-newt-widget.c b/clients/tui/newt/nmt-newt-widget.c index 94f3011e..5602c062 100644 --- a/clients/tui/newt/nmt-newt-widget.c +++ b/clients/tui/newt/nmt-newt-widget.c @@ -311,7 +311,7 @@ nmt_newt_widget_real_activated (NmtNewtWidget *widget) if (priv->exit_on_activate) nmt_newt_form_quit (nmt_newt_widget_get_form (widget)); -} +} /** * nmt_newt_widget_activated: @@ -363,7 +363,7 @@ nmt_newt_widget_set_exit_on_activate (NmtNewtWidget *widget, priv->exit_on_activate = exit_on_activate; g_object_notify (G_OBJECT (widget), "exit-on-activate"); } -} +} /** * nmt_newt_widget_get_visible: diff --git a/clients/tui/nm-editor-bindings.h b/clients/tui/nm-editor-bindings.h index 72bd91e3..facbf1c6 100644 --- a/clients/tui/nm-editor-bindings.h +++ b/clients/tui/nm-editor-bindings.h @@ -19,6 +19,8 @@ #ifndef NM_EDITOR_BINDINGS_H #define NM_EDITOR_BINDINGS_H +#include "NetworkManager.h" + void nm_editor_bindings_init (void); void nm_editor_bind_ip_addresses_with_prefix_to_strv (int family, diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index 8fecefa8..b71e9fbe 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -27,6 +27,8 @@ #include "nm-default.h" +#include "NetworkManager.h" + #include "nm-editor-utils.h" #if 0 #include "nm-vpn-helpers.h" diff --git a/clients/tui/nm-editor-utils.h b/clients/tui/nm-editor-utils.h index e15cc5e8..6f66edfe 100644 --- a/clients/tui/nm-editor-utils.h +++ b/clients/tui/nm-editor-utils.h @@ -19,6 +19,8 @@ #ifndef NM_EDITOR_UTILS_H #define NM_EDITOR_UTILS_H +#include "NetworkManager.h" + typedef struct { const char *name; GType setting_type; diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c index cced55fc..6e69a04b 100644 --- a/clients/tui/nmt-connect-connection-list.c +++ b/clients/tui/nmt-connect-connection-list.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2013 - 2017 Red Hat, Inc. + * Copyright 2013 Red Hat, Inc. */ /** @@ -28,9 +28,12 @@ #include <stdlib.h> +#include "NetworkManager.h" + +#include "nm-utils/nm-hash-utils.h" + #include "nmtui.h" #include "nmt-connect-connection-list.h" -#include "nm-client-utils.h" G_DEFINE_TYPE (NmtConnectConnectionList, nmt_connect_connection_list, NMT_TYPE_NEWT_LISTBOX) @@ -524,7 +527,7 @@ nmt_connect_connection_list_rebuild (NmtConnectConnectionList *list) if (nmtconn->ap) { guint8 strength = nm_access_point_get_strength (nmtconn->ap); - strength_col = nmc_wifi_strength_bars (strength); + strength_col = nm_utils_wifi_strength_bars (strength); } else strength_col = NULL; diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c index a4d63e4f..be1ad492 100644 --- a/clients/tui/nmt-device-entry.c +++ b/clients/tui/nmt-device-entry.c @@ -40,6 +40,8 @@ #include <sys/socket.h> #include <linux/if_arp.h> +#include "NetworkManager.h" + #include "nmtui.h" #include "nmt-device-entry.h" diff --git a/clients/tui/nmt-device-entry.h b/clients/tui/nmt-device-entry.h index 9c288822..9278244f 100644 --- a/clients/tui/nmt-device-entry.h +++ b/clients/tui/nmt-device-entry.h @@ -21,6 +21,8 @@ #include "nmt-editor-grid.h" +#include "NetworkManager.h" + #define NMT_TYPE_DEVICE_ENTRY (nmt_device_entry_get_type ()) #define NMT_DEVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntry)) #define NMT_DEVICE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryClass)) diff --git a/clients/tui/nmt-edit-connection-list.c b/clients/tui/nmt-edit-connection-list.c index c1756da0..e90140b3 100644 --- a/clients/tui/nmt-edit-connection-list.c +++ b/clients/tui/nmt-edit-connection-list.c @@ -502,7 +502,7 @@ nmt_edit_connection_list_class_init (NmtEditConnectionListClass *list_class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - + /** * NmtEditConnectionListFilter: * @list: the #NmtEditConnectionList diff --git a/clients/tui/nmt-edit-connection-list.h b/clients/tui/nmt-edit-connection-list.h index cb02ea4b..9726e287 100644 --- a/clients/tui/nmt-edit-connection-list.h +++ b/clients/tui/nmt-edit-connection-list.h @@ -21,6 +21,8 @@ #include "nmt-newt.h" +#include "NetworkManager.h" + #define NMT_TYPE_EDIT_CONNECTION_LIST (nmt_edit_connection_list_get_type ()) #define NMT_EDIT_CONNECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDIT_CONNECTION_LIST, NmtEditConnectionList)) #define NMT_EDIT_CONNECTION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDIT_CONNECTION_LIST, NmtEditConnectionListClass)) diff --git a/clients/tui/nmt-editor-grid.c b/clients/tui/nmt-editor-grid.c index 4826ba9b..a57e780b 100644 --- a/clients/tui/nmt-editor-grid.c +++ b/clients/tui/nmt-editor-grid.c @@ -70,7 +70,7 @@ typedef struct { * Creates a new #NmtEditorGrid * * Returns: a new #NmtEditorGrid - */ + */ NmtNewtWidget * nmt_editor_grid_new (void) { diff --git a/clients/tui/nmt-editor-page.h b/clients/tui/nmt-editor-page.h index 687f84a7..93a66155 100644 --- a/clients/tui/nmt-editor-page.h +++ b/clients/tui/nmt-editor-page.h @@ -19,6 +19,8 @@ #ifndef NMT_EDITOR_PAGE_H #define NMT_EDITOR_PAGE_H +#include "NetworkManager.h" + #include "nmt-editor-grid.h" #include "nmt-editor-section.h" diff --git a/clients/tui/nmt-editor.h b/clients/tui/nmt-editor.h index ea51723e..5620c5e8 100644 --- a/clients/tui/nmt-editor.h +++ b/clients/tui/nmt-editor.h @@ -19,6 +19,8 @@ #ifndef NMT_EDITOR_H #define NMT_EDITOR_H +#include "NetworkManager.h" + #include "nmt-newt.h" #define NMT_TYPE_EDITOR (nmt_editor_get_type ()) diff --git a/clients/tui/nmt-mac-entry.c b/clients/tui/nmt-mac-entry.c index 7d492196..b954d2e0 100644 --- a/clients/tui/nmt-mac-entry.c +++ b/clients/tui/nmt-mac-entry.c @@ -32,6 +32,7 @@ #include <string.h> +#include "NetworkManager.h" #include "nm-common-macros.h" diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c index 1629c8b0..e39a4c96 100644 --- a/clients/tui/nmt-page-bond.c +++ b/clients/tui/nmt-page-bond.c @@ -203,21 +203,21 @@ slaves_changed (GObject *object, nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->mode), TRUE); } -#define WIDGET_CHANGED_FUNC(widget, func, option) \ -static void \ -widget ## _widget_changed (GObject *object, \ - GParamSpec *pspec, \ - gpointer user_data) \ -{ \ - NmtPageBond *bond = NMT_PAGE_BOND (user_data); \ - NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (bond); \ - \ - if (priv->updating) \ - return; \ - \ - priv->updating = TRUE; \ - nm_setting_bond_add_option (priv->s_bond, option, func (priv->widget)); \ - priv->updating = FALSE; \ +#define WIDGET_CHANGED_FUNC(widget, func, option) \ +static void \ +widget ## _widget_changed (GObject *object, \ + GParamSpec *pspec, \ + gpointer user_data) \ +{ \ + NmtPageBond *bond = NMT_PAGE_BOND (user_data); \ + NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (bond); \ + \ + if (priv->updating) \ + return; \ + \ + priv->updating = TRUE; \ + nm_setting_bond_add_option (priv->s_bond, option, func (priv->widget)); \ + priv->updating = FALSE; \ } WIDGET_CHANGED_FUNC (primary, nmt_newt_entry_get_text, NM_SETTING_BOND_OPTION_PRIMARY) diff --git a/clients/tui/nmt-page-team-port.c b/clients/tui/nmt-page-team-port.c index 0d40373d..af2221ad 100644 --- a/clients/tui/nmt-page-team-port.c +++ b/clients/tui/nmt-page-team-port.c @@ -68,7 +68,7 @@ edit_clicked (NmtNewtButton *button, NM_SETTING_TEAM_PORT_CONFIG, new_config, NULL); g_free (new_config); -} +} static void nmt_page_team_port_constructed (GObject *object) diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c index cfe12703..2523bd85 100644 --- a/clients/tui/nmt-page-team.c +++ b/clients/tui/nmt-page-team.c @@ -121,7 +121,7 @@ edit_clicked (NmtNewtButton *button, NM_SETTING_TEAM_CONFIG, new_config, NULL); g_free (new_config); -} +} static void nmt_page_team_constructed (GObject *object) diff --git a/clients/tui/nmt-password-dialog.c b/clients/tui/nmt-password-dialog.c index 16920fcf..fb9567e6 100644 --- a/clients/tui/nmt-password-dialog.c +++ b/clients/tui/nmt-password-dialog.c @@ -144,12 +144,12 @@ nmt_password_dialog_constructed (GObject *object) NMSecretAgentSimpleSecret *secret = priv->secrets->pdata[i]; NmtNewtEntryFlags flags; - widget = nmt_newt_label_new (secret->pretty_name); + widget = nmt_newt_label_new (secret->name); nmt_newt_grid_add (secret_grid, widget, 0, i); nmt_newt_widget_set_padding (widget, 4, 0, 1, 0); flags = NMT_NEWT_ENTRY_NONEMPTY; - if (secret->is_secret) + if (secret->password) flags |= NMT_NEWT_ENTRY_PASSWORD; widget = nmt_newt_entry_new (30, flags); if (secret->value) diff --git a/clients/tui/nmt-route-editor.h b/clients/tui/nmt-route-editor.h index d83523bc..8e63830e 100644 --- a/clients/tui/nmt-route-editor.h +++ b/clients/tui/nmt-route-editor.h @@ -19,6 +19,8 @@ #ifndef NMT_ROUTE_EDITOR_H #define NMT_ROUTE_EDITOR_H +#include "NetworkManager.h" + #include "nmt-newt.h" #define NMT_TYPE_ROUTE_EDITOR (nmt_route_editor_get_type ()) diff --git a/clients/tui/nmt-route-entry.c b/clients/tui/nmt-route-entry.c index 109759cc..1b37389f 100644 --- a/clients/tui/nmt-route-entry.c +++ b/clients/tui/nmt-route-entry.c @@ -32,6 +32,8 @@ #include <netinet/in.h> #include <stdlib.h> +#include "NetworkManager.h" + #include "nmt-route-entry.h" #include "nmt-ip-entry.h" @@ -152,7 +154,7 @@ static newtComponent nmt_route_entry_get_focus_component (NmtNewtWidget *widget) { NmtRouteEntryPrivate *priv = NMT_ROUTE_ENTRY_GET_PRIVATE (widget); - + return nmt_newt_widget_get_focus_component (priv->dest); } diff --git a/clients/tui/nmt-route-table.c b/clients/tui/nmt-route-table.c index c2e55542..a63f5205 100644 --- a/clients/tui/nmt-route-table.c +++ b/clients/tui/nmt-route-table.c @@ -30,6 +30,8 @@ #include <netinet/in.h> #include <stdlib.h> +#include "NetworkManager.h" + #include "nmt-route-table.h" #include "nmt-route-entry.h" #include "nmt-widget-list.h" @@ -161,10 +163,12 @@ remove_route (NmtWidgetList *list, gpointer table) { NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table); + NMIPRoute *route; if (num >= priv->routes->len) return; + route = priv->routes->pdata[num]; g_ptr_array_remove_index (priv->routes, num); nmt_widget_list_set_length (list, priv->routes->len); diff --git a/clients/tui/nmt-slave-list.c b/clients/tui/nmt-slave-list.c index 893b7caf..a8c31e05 100644 --- a/clients/tui/nmt-slave-list.c +++ b/clients/tui/nmt-slave-list.c @@ -26,6 +26,8 @@ #include "nm-default.h" +#include "NetworkManager.h" + #include "nmt-slave-list.h" G_DEFINE_TYPE (NmtSlaveList, nmt_slave_list, NMT_TYPE_EDIT_CONNECTION_LIST) diff --git a/clients/tui/nmt-utils.c b/clients/tui/nmt-utils.c index 7cd71be2..a8c1c5f0 100644 --- a/clients/tui/nmt-utils.c +++ b/clients/tui/nmt-utils.c @@ -47,7 +47,7 @@ * * When the async callback is invoked, it should call * nmt_sync_op_complete_boolean() or nmt_sync_op_complete_pointer() to - * return a result or an error to the caller. + * return a result or an error to the caller. * * There is no free/clear function; any memory that needs to be freed * will have been returned to the caller from diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c index 2a954fb8..086e4bd3 100644 --- a/clients/tui/nmtui-connect.c +++ b/clients/tui/nmtui-connect.c @@ -100,38 +100,41 @@ secrets_requested (NMSecretAgentSimple *agent, { NmtNewtForm *form; NMConnection *connection = NM_CONNECTION (user_data); + char *cookie = NULL; + char *gateway = NULL; + char *gwcert = NULL; int i; /* Get secrets for OpenConnect VPN */ - if ( connection - && nm_connection_is_type (connection, NM_SETTING_VPN_SETTING_NAME)) { + if (connection && nm_connection_is_type (connection, NM_SETTING_VPN_SETTING_NAME)) { NMSettingVpn *s_vpn = nm_connection_get_setting_vpn (connection); + const char *vpn_type = nm_setting_vpn_get_service_type (s_vpn); - if (nm_streq0 (nm_setting_vpn_get_service_type (s_vpn), NM_SECRET_AGENT_VPN_TYPE_OPENCONNECT)) { - gs_free char *cookie = NULL; - gs_free char *gateway = NULL; - gs_free char *gwcert = NULL; - + if (!g_strcmp0 (vpn_type, NM_DBUS_INTERFACE ".openconnect")) { openconnect_authenticate (connection, &cookie, &gateway, &gwcert); for (i = 0; i < secrets->len; i++) { NMSecretAgentSimpleSecret *secret = secrets->pdata[i]; - if (secret->secret_type != NM_SECRET_AGENT_SECRET_TYPE_VPN_SECRET) - continue; - if (!nm_streq0 (secret->vpn_type, NM_SECRET_AGENT_VPN_TYPE_OPENCONNECT)) - continue; - if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "cookie")) { - g_free (secret->value); - secret->value = g_steal_pointer (&cookie); - } else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "gateway")) { - g_free (secret->value); - secret->value = g_steal_pointer (&gateway); - } else if (nm_streq0 (secret->entry_id, NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRET "gwcert")) { - g_free (secret->value); - secret->value = g_steal_pointer (&gwcert); + if (!g_strcmp0 (secret->vpn_type, NM_DBUS_INTERFACE ".openconnect")) { + if (!g_strcmp0 (secret->vpn_property, "cookie")) { + g_free (secret->value); + secret->value = cookie; + cookie = NULL; + } else if (!g_strcmp0 (secret->vpn_property, "gateway")) { + g_free (secret->value); + secret->value = gateway; + gateway = NULL; + } else if (!g_strcmp0 (secret->vpn_property, "gwcert")) { + g_free (secret->value); + secret->value = gwcert; + gwcert = NULL; + } } } + g_free (cookie); + g_free (gateway); + g_free (gwcert); } } diff --git a/clients/tui/nmtui-edit.c b/clients/tui/nmtui-edit.c index 657724e3..a92e45a3 100644 --- a/clients/tui/nmtui-edit.c +++ b/clients/tui/nmtui-edit.c @@ -27,6 +27,8 @@ #include <stdlib.h> +#include "NetworkManager.h" + #include "nmtui.h" #include "nmtui-edit.h" #include "nmt-edit-connection-list.h" diff --git a/clients/tui/nmtui-hostname.c b/clients/tui/nmtui-hostname.c index 2c4fb28e..f8005502 100644 --- a/clients/tui/nmtui-hostname.c +++ b/clients/tui/nmtui-hostname.c @@ -112,7 +112,7 @@ nmtui_hostname (gboolean is_top, int argc, char **argv) nmt_sync_op_init (&op); nm_client_save_hostname_async (nm_client, hostname, NULL, hostname_set, &op); if (nmt_sync_op_wait_boolean (&op, &error)) { - /* TRANSLATORS: this indicates the result. ie, "I have set the hostname to ..." */ + /* Translators: this indicates the result. ie, "I have set the hostname to ..." */ nmt_newt_message_dialog (_("Set hostname to '%s'"), hostname); } else { nmt_newt_message_dialog (_("Unable to set hostname: %s"), error->message); diff --git a/clients/tui/nmtui.c b/clients/tui/nmtui.c index f6994f69..70cad5d6 100644 --- a/clients/tui/nmtui.c +++ b/clients/tui/nmtui.c @@ -30,6 +30,8 @@ #include <stdlib.h> #include <string.h> +#include "NetworkManager.h" + #include "nmt-newt.h" #include "nm-editor-bindings.h" diff --git a/clients/tui/nmtui.h b/clients/tui/nmtui.h index 5ef8e82a..efb59622 100644 --- a/clients/tui/nmtui.h +++ b/clients/tui/nmtui.h @@ -19,6 +19,8 @@ #ifndef NMTUI_H #define NMTUI_H +#include "NetworkManager.h" + extern NMClient *nm_client; void nmtui_quit (void); |