diff options
-rw-r--r-- | src/rcw.c | 22 | ||||
-rw-r--r-- | src/remmina.1 | 2 | ||||
-rw-r--r-- | src/remmina.c | 6 | ||||
-rw-r--r-- | src/remmina_pref.c | 9 | ||||
-rw-r--r-- | src/remmina_pref.h | 1 |
5 files changed, 29 insertions, 11 deletions
@@ -4051,7 +4051,7 @@ static gboolean rcw_hostkey_func(RemminaProtocolWidget *gp, guint keyval, gboole } } - if (keyval == remmina_pref.shortcutkey_fullscreen) { + if (keyval == remmina_pref.shortcutkey_fullscreen && !extrahardening) { switch (priv->view_mode) { case SCROLLED_WINDOW_MODE: rcw_switch_viewmode(cnnobj->cnnwin, priv->fss_view_mode); @@ -4063,20 +4063,20 @@ static gboolean rcw_hostkey_func(RemminaProtocolWidget *gp, guint keyval, gboole default: break; } - } else if (keyval == remmina_pref.shortcutkey_autofit) { + } else if (keyval == remmina_pref.shortcutkey_autofit && !extrahardening) { if (priv->toolitem_autofit && gtk_widget_is_sensitive(GTK_WIDGET(priv->toolitem_autofit))) rcw_toolbar_autofit(GTK_TOOL_ITEM(gp), cnnobj->cnnwin); - } else if (keyval == remmina_pref.shortcutkey_nexttab) { + } else if (keyval == remmina_pref.shortcutkey_nexttab && !extrahardening) { i = gtk_notebook_get_current_page(GTK_NOTEBOOK(priv->notebook)) + 1; if (i >= gtk_notebook_get_n_pages(GTK_NOTEBOOK(priv->notebook))) i = 0; gtk_notebook_set_current_page(GTK_NOTEBOOK(priv->notebook), i); - } else if (keyval == remmina_pref.shortcutkey_prevtab) { + } else if (keyval == remmina_pref.shortcutkey_prevtab && !extrahardening) { i = gtk_notebook_get_current_page(GTK_NOTEBOOK(priv->notebook)) - 1; if (i < 0) i = gtk_notebook_get_n_pages(GTK_NOTEBOOK(priv->notebook)) - 1; gtk_notebook_set_current_page(GTK_NOTEBOOK(priv->notebook), i); - } else if (keyval == remmina_pref.shortcutkey_scale) { + } else if (keyval == remmina_pref.shortcutkey_scale && !extrahardening) { if (gtk_widget_is_sensitive(GTK_WIDGET(priv->toolitem_scale))) { gtk_toggle_tool_button_set_active( GTK_TOGGLE_TOOL_BUTTON(priv->toolitem_scale), @@ -4084,25 +4084,25 @@ static gboolean rcw_hostkey_func(RemminaProtocolWidget *gp, guint keyval, gboole GTK_TOGGLE_TOOL_BUTTON( priv->toolitem_scale))); } - } else if (keyval == remmina_pref.shortcutkey_grab) { + } else if (keyval == remmina_pref.shortcutkey_grab && !extrahardening) { gtk_toggle_tool_button_set_active( GTK_TOGGLE_TOOL_BUTTON(priv->toolitem_grab), !gtk_toggle_tool_button_get_active( GTK_TOGGLE_TOOL_BUTTON( priv->toolitem_grab))); - } else if (keyval == remmina_pref.shortcutkey_minimize) { + } else if (keyval == remmina_pref.shortcutkey_minimize && !extrahardening) { rcw_toolbar_minimize(GTK_TOOL_ITEM(gp), cnnobj->cnnwin); - } else if (keyval == remmina_pref.shortcutkey_viewonly) { + } else if (keyval == remmina_pref.shortcutkey_viewonly && !extrahardening) { remmina_file_set_int(cnnobj->remmina_file, "viewonly", (remmina_file_get_int(cnnobj->remmina_file, "viewonly", 0) == 0) ? 1 : 0); - } else if (keyval == remmina_pref.shortcutkey_screenshot) { + } else if (keyval == remmina_pref.shortcutkey_screenshot && !extrahardening) { rcw_toolbar_screenshot(GTK_TOOL_ITEM(gp), cnnobj->cnnwin); - } else if (keyval == remmina_pref.shortcutkey_disconnect) { + } else if (keyval == remmina_pref.shortcutkey_disconnect && !extrahardening) { rco_disconnect_current_page(cnnobj); - } else if (keyval == remmina_pref.shortcutkey_toolbar) { + } else if (keyval == remmina_pref.shortcutkey_toolbar && !extrahardening) { if (priv->view_mode == SCROLLED_WINDOW_MODE) { remmina_pref.hide_connection_toolbar = !remmina_pref.hide_connection_toolbar; diff --git a/src/remmina.1 b/src/remmina.1 index 68e53862b..9c7fe3904 100644 --- a/src/remmina.1 +++ b/src/remmina.1 @@ -82,6 +82,8 @@ Disable news notification Disable toolbar .It --enable-fullscreen\fR Enable fullscreen +.It --enable-extra-hardening\fR +Enable extra hardening (disable closing confirmation, disable unsafe shortcut keys, hide tabs, hide search bar) .El .Sh EXAMPLES .Lp diff --git a/src/remmina.c b/src/remmina.c index b6e05973e..5013a1356 100644 --- a/src/remmina.c +++ b/src/remmina.c @@ -84,6 +84,7 @@ gboolean kioskmode; gboolean disablenews; gboolean disabletoolbar; gboolean fullscreen; +gboolean extrahardening; static GOptionEntry remmina_options[] = { @@ -127,6 +128,7 @@ static GOptionEntry remmina_options[] = { "disable-news", 0, 0, G_OPTION_ARG_NONE, NULL, N_("Disable news notification"), NULL }, { "disable-toolbar", 0, 0, G_OPTION_ARG_NONE, NULL, N_("Disable toolbar"), NULL }, { "enable-fullscreen", 0, 0, G_OPTION_ARG_NONE, NULL, N_("Enable fullscreen"), NULL }, + { "enable-extra-hardening", 0, 0, G_OPTION_ARG_NONE, NULL, N_("Enable extra hardening (disable closing confirmation, disable unsafe shortcut keys, hide tabs, hide search bar)"), NULL }, { NULL } }; @@ -172,6 +174,10 @@ static gint remmina_on_command_line(GApplication *app, GApplicationCommandLine * fullscreen = TRUE; } + if (g_variant_dict_lookup_value(opts, "enable-extra-hardening", NULL)) { + extrahardening = TRUE; + } + remmina_pref_init(); if (g_variant_dict_lookup_value(opts, "quit", NULL)) { diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 3ec5066c6..811a5827b 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -288,6 +288,9 @@ void remmina_pref_init(void) else remmina_pref.confirm_close = TRUE; + if (extrahardening) + remmina_pref.confirm_close = FALSE; + 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)) @@ -360,6 +363,9 @@ void remmina_pref_init(void) else remmina_pref.always_show_tab = TRUE; + if (extrahardening) + remmina_pref.always_show_tab = FALSE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_connection_toolbar", NULL)) remmina_pref.hide_connection_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", NULL); @@ -375,6 +381,9 @@ void remmina_pref_init(void) else remmina_pref.hide_searchbar = FALSE; + if (extrahardening) + remmina_pref.hide_searchbar = TRUE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL)) remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL); else diff --git a/src/remmina_pref.h b/src/remmina_pref.h index 25b82fcf0..c888a8d47 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -256,6 +256,7 @@ extern gchar *remmina_colors_file; extern RemminaPref remmina_pref; extern gboolean disabletoolbar; extern gboolean fullscreen; +extern gboolean extrahardening; void remmina_pref_init(void); gboolean remmina_pref_is_rw(void); |