diff options
-rw-r--r-- | data/ui/remmina_preferences.glade | 54 | ||||
-rw-r--r-- | src/remmina_connection_window.c | 10 | ||||
-rw-r--r-- | src/remmina_pref.c | 6 | ||||
-rw-r--r-- | src/remmina_pref.h | 1 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 3 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 1 |
6 files changed, 54 insertions, 21 deletions
diff --git a/data/ui/remmina_preferences.glade b/data/ui/remmina_preferences.glade index 1f56ce0af..d944946e9 100644 --- a/data/ui/remmina_preferences.glade +++ b/data/ui/remmina_preferences.glade @@ -106,7 +106,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">8</property> <property name="width">3</property> </packing> </child> @@ -119,7 +119,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">0</property> </packing> </child> <child> @@ -134,7 +134,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">0</property> <property name="width">2</property> </packing> </child> @@ -147,7 +147,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> </packing> </child> <child> @@ -164,7 +164,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> <property name="width">2</property> </packing> </child> @@ -177,7 +177,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -188,7 +188,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">5</property> <property name="width">2</property> </packing> </child> @@ -201,7 +201,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -213,7 +213,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -226,7 +226,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">2</property> - <property name="top_attach">5</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -238,7 +238,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -251,7 +251,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">8</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -264,7 +264,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">8</property> + <property name="top_attach">7</property> <property name="width">2</property> </packing> </child> @@ -277,7 +277,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -291,7 +291,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">2</property> <property name="width">2</property> </packing> </child> @@ -305,7 +305,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">7</property> + <property name="top_attach">6</property> <property name="width">2</property> </packing> </child> @@ -315,6 +315,7 @@ Author: Antenore Gatta <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="halign">start</property> <property name="hexpand">True</property> <property name="draw_indicator">True</property> </object> @@ -333,7 +334,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -349,10 +350,27 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">4</property> + <property name="top_attach">3</property> <property name="width">2</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="checkbutton_options_deny_screenshot_clipboard"> + <property name="label" translatable="yes">Deny Copy Screenshot to clipboard</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">If you check this button, when generating a screenshot it will only be saved on a file and not in the clipboard.</property> + <property name="halign">start</property> + <property name="hexpand">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">10</property> + <property name="width">3</property> + </packing> + </child> </object> </child> </object> diff --git a/src/remmina_connection_window.c b/src/remmina_connection_window.c index f0d183783..b79c4445e 100644 --- a/src/remmina_connection_window.c +++ b/src/remmina_connection_window.c @@ -1807,8 +1807,10 @@ static void remmina_connection_holder_toolbar_screenshot(GtkWidget* widget, Remm srcsurface = cairo_image_surface_create_for_data(rpsd.buffer, cairo_format, width, height, stride); // Transfer the PixBuf in the main clipboard selection - gtk_clipboard_set_image (c, gdk_pixbuf_get_from_surface ( - srcsurface, 0, 0, width, height)); + if (!remmina_pref.deny_screenshot_clipboard) { + gtk_clipboard_set_image (c, gdk_pixbuf_get_from_surface ( + srcsurface, 0, 0, width, height)); + } surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); cr = cairo_create(surface); cairo_set_source_surface(cr, srcsurface, 0, 0); @@ -1842,7 +1844,9 @@ static void remmina_connection_holder_toolbar_screenshot(GtkWidget* widget, Remm g_print("gdk_pixbuf_get_from_window failed\n"); // Transfer the PixBuf in the main clipboard selection - gtk_clipboard_set_image (c, screenshot); + if (!remmina_pref.deny_screenshot_clipboard) { + gtk_clipboard_set_image (c, screenshot); + } // Prepare the destination cairo surface. surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height); cr = cairo_create(surface); diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 35cb22e86..205b273cf 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -399,6 +399,11 @@ void remmina_pref_init(void) else remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL)) + remmina_pref.deny_screenshot_clipboard = g_key_file_get_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL); + else + remmina_pref.deny_screenshot_clipboard = TRUE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_path", NULL)) { remmina_pref.screenshot_path = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_path", NULL); }else{ @@ -672,6 +677,7 @@ gboolean remmina_pref_save(void) g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL); g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode); + g_key_file_set_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", remmina_pref.deny_screenshot_clipboard); g_key_file_set_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", remmina_pref.floating_toolbar_placement); g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement); g_key_file_set_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", remmina_pref.prevent_snap_welcome_message); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index c9cd2ebc6..66098c6fa 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -113,6 +113,7 @@ typedef struct _RemminaPref { gboolean save_view_mode; gint default_action; gint scale_quality; + gboolean deny_screenshot_clipboard; const gchar *screenshot_path; const gchar *screenshot_name; gint auto_scroll_step; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 0ab353bfe..68089fa0e 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -161,6 +161,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) gboolean rebuild_remmina_icon = FALSE; remmina_pref.save_view_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_remember_last_view_mode)); + remmina_pref.deny_screenshot_clipboard = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard)); remmina_pref.fullscreen_on_auto = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto)); remmina_pref.always_show_tab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs)); remmina_pref.hide_connection_toolbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar)); @@ -379,6 +380,7 @@ static void remmina_pref_dialog_init(void) gtk_dialog_set_default_response(GTK_DIALOG(remmina_pref_dialog->dialog), GTK_RESPONSE_CLOSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_remember_last_view_mode), remmina_pref.save_view_mode); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard), remmina_pref.deny_screenshot_clipboard); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto), remmina_pref.fullscreen_on_auto); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs), remmina_pref.always_show_tab); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar), remmina_pref.hide_connection_toolbar); @@ -547,6 +549,7 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->checkbutton_options_remember_last_view_mode = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_remember_last_view_mode")); remmina_pref_dialog->checkbutton_options_save_settings = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_save_settings")); + remmina_pref_dialog->checkbutton_options_deny_screenshot_clipboard = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_deny_screenshot_clipboard")); remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_fullscreen_on_auto")); remmina_pref_dialog->checkbutton_appearance_show_tabs = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_show_tabs")); remmina_pref_dialog->checkbutton_appearance_hide_toolbar = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_hide_toolbar")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index f22c35090..102508c78 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -49,6 +49,7 @@ typedef struct _RemminaPrefDialog { GtkNotebook *notebook_preferences; GtkCheckButton *checkbutton_options_remember_last_view_mode; + GtkCheckButton *checkbutton_options_deny_screenshot_clipboard; GtkCheckButton *checkbutton_options_save_settings; GtkCheckButton *checkbutton_appearance_fullscreen_on_auto; GtkCheckButton *checkbutton_appearance_show_tabs; |