newt-form: remove escape-exits property

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.
This commit is contained in:
Lubomir Rintel 2022-08-22 12:11:25 +02:00
parent 3f20dc5f3a
commit 0829d6ff12
8 changed files with 8 additions and 60 deletions

View file

@ -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));
}

View file

@ -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);

View file

@ -107,8 +107,6 @@ nmt_editor_new(NMConnection *connection)
_("Edit Connection"),
"fullscreen-vertical",
TRUE,
"escape-exits",
TRUE,
NULL);
}

View file

@ -71,8 +71,6 @@ nmt_password_dialog_new(const char *request_id,
prompt,
"secrets",
secrets,
"escape-exits",
TRUE,
NULL);
}

View file

@ -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();

View file

@ -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);
}

View file

@ -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);

View file

@ -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);