diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-08-22 12:11:25 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2022-08-22 13:15:58 +0200 |
commit | 0829d6ff12db95ad31b812fc848aa6738b11d5d8 (patch) | |
tree | 3a5c9c8775502112f01dc06d3e7c7638849bf457 | |
parent | 3f20dc5f3a1386cf5cffedee81e53329bae54cce (diff) |
newt-form: remove escape-exits propertylr/tui-esc
As far as I can tell, all forms we have should be dismissable with the
Escape key. We omitted settings "escape-exits" property by accident
before. Let's just remove it.
-rw-r--r-- | src/libnmt-newt/nmt-newt-form.c | 26 | ||||
-rw-r--r-- | src/libnmt-newt/nmt-newt-popup.c | 2 | ||||
-rw-r--r-- | src/nmtui/nmt-editor.c | 2 | ||||
-rw-r--r-- | src/nmtui/nmt-password-dialog.c | 2 | ||||
-rw-r--r-- | src/nmtui/nmtui-connect.c | 11 | ||||
-rw-r--r-- | src/nmtui/nmtui-edit.c | 16 | ||||
-rw-r--r-- | src/nmtui/nmtui-hostname.c | 2 | ||||
-rw-r--r-- | src/nmtui/nmtui.c | 7 |
8 files changed, 8 insertions, 60 deletions
diff --git a/src/libnmt-newt/nmt-newt-form.c b/src/libnmt-newt/nmt-newt-form.c index 7d28c80e14..de80b42a6c 100644 --- a/src/libnmt-newt/nmt-newt-form.c +++ b/src/libnmt-newt/nmt-newt-form.c @@ -36,7 +36,7 @@ typedef struct { gboolean fixed_width, fixed_height; char *title_lc; - gboolean dirty, escape_exits; + gboolean dirty; NmtNewtWidget *focus; #ifdef HAVE_NEWTFORMGETSCROLLPOSITION int scroll_position = 0; @@ -54,7 +54,6 @@ enum { PROP_WIDTH, PROP_HEIGHT, PROP_PADDING, - PROP_ESCAPE_EXITS, LAST_PROP }; @@ -211,8 +210,7 @@ nmt_newt_form_build(NmtNewtForm *form) } else priv->form = newtForm(NULL, NULL, NEWT_FLAG_NOF12); - if (priv->escape_exits) - newtFormAddHotKey(priv->form, NEWT_KEY_ESCAPE); + newtFormAddHotKey(priv->form, NEWT_KEY_ESCAPE); cos = nmt_newt_widget_get_components(priv->content); for (i = 0; cos[i]; i++) @@ -504,9 +502,6 @@ nmt_newt_form_set_property(GObject *object, guint prop_id, const GValue *value, case PROP_PADDING: priv->padding = g_value_get_uint(value); break; - case PROP_ESCAPE_EXITS: - priv->escape_exits = g_value_get_boolean(value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -540,9 +535,6 @@ nmt_newt_form_get_property(GObject *object, guint prop_id, GValue *value, GParam case PROP_PADDING: g_value_set_uint(value, priv->padding); break; - case PROP_ESCAPE_EXITS: - g_value_set_boolean(value, priv->escape_exits); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -722,18 +714,4 @@ nmt_newt_form_class_init(NmtNewtFormClass *form_class) G_MAXUINT, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); - /** - * NmtNewtForm:escape-exits: - * - * If %TRUE, then hitting the Escape key will cause the form to - * exit. - */ - g_object_class_install_property( - object_class, - PROP_ESCAPE_EXITS, - g_param_spec_boolean("escape-exits", - "", - "", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); } diff --git a/src/libnmt-newt/nmt-newt-popup.c b/src/libnmt-newt/nmt-newt-popup.c index c62951ca5d..8e99ac6580 100644 --- a/src/libnmt-newt/nmt-newt-popup.c +++ b/src/libnmt-newt/nmt-newt-popup.c @@ -162,8 +162,6 @@ nmt_newt_popup_activated(NmtNewtWidget *widget) list_h, "padding", 0, - "escape-exits", - TRUE, NULL); nmt_newt_form_set_content(form, listbox); diff --git a/src/nmtui/nmt-editor.c b/src/nmtui/nmt-editor.c index 0fef4e6c3e..427ac0178b 100644 --- a/src/nmtui/nmt-editor.c +++ b/src/nmtui/nmt-editor.c @@ -107,8 +107,6 @@ nmt_editor_new(NMConnection *connection) _("Edit Connection"), "fullscreen-vertical", TRUE, - "escape-exits", - TRUE, NULL); } diff --git a/src/nmtui/nmt-password-dialog.c b/src/nmtui/nmt-password-dialog.c index 6189997f27..75194d7b99 100644 --- a/src/nmtui/nmt-password-dialog.c +++ b/src/nmtui/nmt-password-dialog.c @@ -71,8 +71,6 @@ nmt_password_dialog_new(const char *request_id, prompt, "secrets", secrets, - "escape-exits", - TRUE, NULL); } diff --git a/src/nmtui/nmtui-connect.c b/src/nmtui/nmtui-connect.c index fb456653fd..8c4625ec6a 100644 --- a/src/nmtui/nmtui-connect.c +++ b/src/nmtui/nmtui-connect.c @@ -241,7 +241,7 @@ activate_connection(NMConnection *connection, NMDevice *device, NMObject *specif GError *error = NULL; ActivateConnectionInfo info = {}; - form = g_object_new(NMT_TYPE_NEWT_FORM, "escape-exits", TRUE, NULL); + form = g_object_new(NMT_TYPE_NEWT_FORM, NULL); label = nmt_newt_label_new(_("Connecting...")); nmt_newt_form_set_content(form, label); @@ -417,14 +417,7 @@ nmt_connect_connection_list(gboolean is_top) newtGetScreenSize(&screen_width, &screen_height); - form = g_object_new(NMT_TYPE_NEWT_FORM, - "y", - 2, - "height", - screen_height - 4, - "escape-exits", - TRUE, - NULL); + form = g_object_new(NMT_TYPE_NEWT_FORM, "y", 2, "height", screen_height - 4, NULL); grid = nmt_newt_grid_new(); diff --git a/src/nmtui/nmtui-edit.c b/src/nmtui/nmtui-edit.c index 954b0cc26d..173e086274 100644 --- a/src/nmtui/nmtui-edit.c +++ b/src/nmtui/nmtui-edit.c @@ -91,14 +91,7 @@ nmt_edit_main_connection_list(gboolean is_top) newtGetScreenSize(&screen_width, &screen_height); - form = g_object_new(NMT_TYPE_NEWT_FORM, - "y", - 2, - "height", - screen_height - 4, - "escape-exits", - TRUE, - NULL); + form = g_object_new(NMT_TYPE_NEWT_FORM, "y", 2, "height", screen_height - 4, NULL); quit = nmt_newt_button_new(is_top ? _("Quit") : _("Back")); nmt_newt_widget_set_exit_on_activate(quit, TRUE); @@ -398,12 +391,7 @@ nmt_add_connection(void) { NmtNewtForm *form; - form = g_object_new(NMT_TYPE_ADD_CONNECTION, - "title", - _("New Connection"), - "escape-exits", - TRUE, - NULL); + form = g_object_new(NMT_TYPE_ADD_CONNECTION, "title", _("New Connection"), NULL); nmt_newt_form_show(form); g_object_unref(form); } diff --git a/src/nmtui/nmtui-hostname.c b/src/nmtui/nmtui-hostname.c index 65af73cc6c..bdb9753bc0 100644 --- a/src/nmtui/nmtui-hostname.c +++ b/src/nmtui/nmtui-hostname.c @@ -28,7 +28,7 @@ nmtui_hostname_run_dialog(void) NmtNewtButtonBox *bbox; char *hostname, *ret = NULL; - form = g_object_new(NMT_TYPE_NEWT_FORM, "title", _("Set Hostname"), "escape-exits", TRUE, NULL); + form = g_object_new(NMT_TYPE_NEWT_FORM, "title", _("Set Hostname"), NULL); widget = nmt_newt_grid_new(); nmt_newt_form_set_content(form, widget); diff --git a/src/nmtui/nmtui.c b/src/nmtui/nmtui.c index c99d1641f1..37c26e9d43 100644 --- a/src/nmtui/nmtui.c +++ b/src/nmtui/nmtui.c @@ -80,12 +80,7 @@ nmtui_main(gboolean is_top, int argc, char **argv) NmtNewtButtonBox *bbox; int i; - form = g_object_new(NMT_TYPE_NEWT_FORM, - "title", - _("NetworkManager TUI"), - "escape-exits", - TRUE, - NULL); + form = g_object_new(NMT_TYPE_NEWT_FORM, "title", _("NetworkManager TUI"), NULL); widget = nmt_newt_grid_new(); nmt_newt_form_set_content(form, widget); |