Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntenore Gatta (tmow) <antenore@simbiosi.org>2022-03-02 16:21:02 +0300
committerAntenore Gatta (tmow) <antenore@simbiosi.org>2022-03-02 16:21:02 +0300
commit297caed269938c2833e7ec09f4dfb0b48e8a6ca1 (patch)
treeca8b8194ad9480cdcbda179e2f262b4eb65e7552 /src
parentdd0b67ff3cd66220caae90ad87dd1e3c36d3a7f3 (diff)
Optional close confirmation
This patch ammend the commit dbd73dcbfea559fec974de9af68a986d53ca3f93 adding an option for those not wanting to confirm. Fixes #2122 comment note_848622269 @emmguyot FYI Signed-off-by: Antenore Gatta (tmow) <antenore@simbiosi.org>
Diffstat (limited to 'src')
-rw-r--r--src/rcw.c17
-rw-r--r--src/remmina_pref.c6
-rw-r--r--src/remmina_pref.h1
-rw-r--r--src/remmina_pref_dialog.c3
-rw-r--r--src/remmina_pref_dialog.h1
5 files changed, 20 insertions, 8 deletions
diff --git a/src/rcw.c b/src/rcw.c
index b750a16cb..6f3cb2f18 100644
--- a/src/rcw.c
+++ b/src/rcw.c
@@ -660,14 +660,15 @@ gboolean rcw_delete(RemminaConnectionWindow *cnnwin)
return FALSE;
}
else {
- dialog = gtk_message_dialog_new(GTK_WINDOW(cnnwin), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Are you sure you want to close this last active connection?"));
- i = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
- if (i != GTK_RESPONSE_YES)
- return FALSE;
-
+ if (remmina_pref.confirm_close) {
+ dialog = gtk_message_dialog_new(GTK_WINDOW(cnnwin), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ _("Are you sure you want to close this last active connection?"));
+ i = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ if (i != GTK_RESPONSE_YES)
+ return FALSE;
+ }
}
}
rcw_close_all_connections(cnnwin);
diff --git a/src/remmina_pref.c b/src/remmina_pref.c
index ff5ee2f8d..601e0f74a 100644
--- a/src/remmina_pref.c
+++ b/src/remmina_pref.c
@@ -283,6 +283,11 @@ void remmina_pref_init(void)
else
remmina_pref.save_view_mode = TRUE;
+ if (g_key_file_has_key(gkeyfile, "remmina_pref", "confirm_close", NULL))
+ remmina_pref.confirm_close = g_key_file_get_boolean(gkeyfile, "remmina_pref", "confirm_close", NULL);
+ else
+ remmina_pref.confirm_close = TRUE;
+
if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_master_password", NULL)) {
remmina_pref.use_primary_password = g_key_file_get_boolean(gkeyfile, "remmina_pref", "use_master_password", NULL);
} else if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_primary_password", NULL))
@@ -788,6 +793,7 @@ gboolean remmina_pref_save(void)
g_key_file_set_string(gkeyfile, "remmina_pref", "screenshot_name", remmina_pref.screenshot_name);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", remmina_pref.deny_screenshot_clipboard);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode);
+ g_key_file_set_boolean(gkeyfile, "remmina_pref", "confirm_close", remmina_pref.confirm_close);
if (g_key_file_remove_key (gkeyfile, "remmina_pref", "use_master_password", NULL))
REMMINA_DEBUG("use_master_password removed…");
else
diff --git a/src/remmina_pref.h b/src/remmina_pref.h
index 7e90d01b9..112abf564 100644
--- a/src/remmina_pref.h
+++ b/src/remmina_pref.h
@@ -143,6 +143,7 @@ typedef struct _RemminaPref {
gint recent_maximum;
gchar * resolutions;
gchar * keystrokes;
+ gboolean confirm_close;
/* In RemminaPrefDialog appearance tab */
gboolean dark_theme;
gboolean list_refresh_workaround;
diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c
index 90c00d447..b49eeccdd 100644
--- a/src/remmina_pref_dialog.c
+++ b/src/remmina_pref_dialog.c
@@ -230,6 +230,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data)
remmina_pref.screenshot_name = gtk_entry_get_text(remmina_pref_dialog->entry_options_screenshot_name);
remmina_pref.deny_screenshot_clipboard = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_options_deny_screenshot_clipboard));
remmina_pref.save_view_mode = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_options_remember_last_view_mode));
+ remmina_pref.confirm_close = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_options_confirm_close));
remmina_pref.use_primary_password = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_security_use_primary_password));
remmina_pref.lock_connect = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_security_lock_connect));
remmina_pref.lock_edit = gtk_switch_get_active(GTK_SWITCH(remmina_pref_dialog->switch_security_lock_edit));
@@ -461,6 +462,7 @@ static void remmina_pref_dialog_init(void)
#endif
gtk_switch_set_active(GTK_SWITCH(remmina_pref_dialog->switch_options_remember_last_view_mode), remmina_pref.save_view_mode);
+ gtk_switch_set_active(GTK_SWITCH(remmina_pref_dialog->switch_options_confirm_close), remmina_pref.confirm_close);
#if SODIUM_VERSION_INT >= 90200
gtk_switch_set_active(GTK_SWITCH(remmina_pref_dialog->switch_security_use_primary_password), remmina_pref.use_primary_password);
gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->switch_security_use_primary_password), TRUE);
@@ -706,6 +708,7 @@ GtkWidget *remmina_pref_dialog_new(gint default_tab, GtkWindow *parent)
remmina_pref_dialog->entry_options_screenshot_name = GTK_ENTRY(GET_OBJECT("entry_options_screenshot_name"));
remmina_pref_dialog->switch_options_deny_screenshot_clipboard = GTK_SWITCH(GET_OBJECT("switch_options_deny_screenshot_clipboard"));
remmina_pref_dialog->switch_options_remember_last_view_mode = GTK_SWITCH(GET_OBJECT("switch_options_remember_last_view_mode"));
+ remmina_pref_dialog->switch_options_confirm_close = GTK_SWITCH(GET_OBJECT("switch_options_confirm_close"));
remmina_pref_dialog->switch_security_use_primary_password = GTK_SWITCH(GET_OBJECT("switch_security_use_primary_password"));
remmina_pref_dialog->unlock_timeout = GTK_ENTRY(GET_OBJECT("unlock_timeout"));
remmina_pref_dialog->switch_security_lock_connect = GTK_SWITCH(GET_OBJECT("switch_security_lock_connect"));
diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h
index 346a8f9d0..60382f4f1 100644
--- a/src/remmina_pref_dialog.h
+++ b/src/remmina_pref_dialog.h
@@ -56,6 +56,7 @@ typedef struct _RemminaPrefDialog {
GtkSwitch * switch_appearance_grab_color;
GtkSwitch * switch_options_deny_screenshot_clipboard;
GtkSwitch * switch_options_remember_last_view_mode;
+ GtkSwitch * switch_options_confirm_close;
GtkSwitch * switch_security_use_primary_password;
GtkEntry * unlock_timeout;
GtkSwitch * switch_security_lock_connect;