diff --git a/src/Dialogs/UnsafePasteDialog.vala b/src/Dialogs/UnsafePasteDialog.vala index 53b13bd3de..fa14fe1b56 100644 --- a/src/Dialogs/UnsafePasteDialog.vala +++ b/src/Dialogs/UnsafePasteDialog.vala @@ -42,7 +42,6 @@ public class Terminal.UnsafePasteDialog : Granite.MessageDialog { var ignore_button = (Gtk.Button) add_button (_("Paste Anyway"), Gtk.ResponseType.ACCEPT); ignore_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); - ignore_button.clicked.connect (on_ignore); set_default_response (Gtk.ResponseType.CANCEL); @@ -50,11 +49,4 @@ public class Terminal.UnsafePasteDialog : Granite.MessageDialog { "unsafe-paste-alert", show_protection_warnings, "active", SettingsBindFlags.DEFAULT ); } - - private void on_ignore () { - var terminal_window = get_transient_for (); - if (terminal_window is MainWindow) { - ((MainWindow) terminal_window).unsafe_ignored = true; - } - } } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 9d3db77c95..073550e2b0 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -54,7 +54,6 @@ namespace Terminal { private const int MAXIMIZED = 1; private const int FULLSCREEN = 2; - public bool unsafe_ignored; public bool focus_restored_tabs { get; construct; default = true; } public bool recreate_tabs { get; construct; default = true; } public Menu context_menu_model { get; private set; } diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index 5fca58d0cf..94cdfdd40e 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -526,10 +526,7 @@ namespace Terminal { // Check pasted and dropped text before feeding to child; private void validated_feed (string? text) { if (text != null && text.validate ()) { - unowned var toplevel = (MainWindow) get_toplevel (); - if (!toplevel.unsafe_ignored && - Application.settings.get_boolean ("unsafe-paste-alert")) { - + if (Application.settings.get_boolean ("unsafe-paste-alert")) { string? warn_text = null; if ("\n" in text) { warn_text = _("The pasted text may contain multiple commands"); @@ -538,6 +535,7 @@ namespace Terminal { } if (warn_text != null) { + unowned var toplevel = (MainWindow) get_toplevel (); var dialog = new UnsafePasteDialog (toplevel, warn_text, text.strip ()); dialog.response.connect ((res) => { dialog.destroy ();