Commit c2f54b57 authored by Paulo Queiroz's avatar Paulo Queiroz 📦
Browse files

0.9.1 - use patched VTE to enable copying

Temporarily fixes #1
parent 6bd918a2
......@@ -35,8 +35,8 @@
"sources" : [
{
"type" : "archive",
"url" : "https://gitlab.gnome.org/GNOME/vte/-/archive/1398ac862fb10b3cb7cdfc8267be2df5d5f39eb5/vte-1398ac862fb10b3cb7cdfc8267be2df5d5f39eb5.tar.gz",
"sha256": "9d76c963d70b19b48ffcbbf2acaee529fb1ec9c53cf0c1f1884f65b2c860bc1f"
"url" : "https://gitlab.gnome.org/raggesilver/vte/-/archive/c757fc5ca3f21aa0319d4d189f1022be0fde9cee/vte-c757fc5ca3f21aa0319d4d189f1022be0fde9cee.tar.gz",
"sha256": "25245514a86de6a234bfb279fc9a768d9cc753b49849fcb51415e800d83ba078"
}
]
},
......
......@@ -84,6 +84,11 @@
</kudos>
<releases>
<release date="2022-07-02" version="0.9.1">
<description>
<p>Use patched VTE to enable copying.</p>
</description>
</release>
<release date="2022-07-01" version="0.9.0">
<description>
<p>Features:</p>
......
......@@ -81,9 +81,5 @@
<default>false</default>
<summary>If enabled, ctrl+c and ctrl+v will work for copy/paste</summary>
</key>
<key name="warn-copy-not-implemented" type="b">
<default>true</default>
<summary>(temporary) Whether to show a dialog warning copying isn't implemented yet</summary>
</key>
</schema>
</schemalist>
project('blackbox', ['c', 'vala'],
version: '0.9.0',
version: '0.9.1',
meson_version: '>= 0.50.0',
default_options: [ 'warning_level=2',
],
......
......@@ -325,28 +325,6 @@
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes">Other</property>
<child>
<object class="AdwActionRow" id="warn_copy_not_implemented_action_row">
<property name="activatable-widget">warn_copy_not_implemented_switch</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Warn copy not implemented</property>
<property name="subtitle" translatable="yes">Whether or not to warn copying hasn't been implemented yet. &lt;a href="https://gitlab.gnome.org/raggesilver/blackbox/-/issues/1"&gt;See issue&lt;/a&gt;.</property>
<child>
<object class="GtkSwitch" id="warn_copy_not_implemented_switch">
<property name="visible">True</property>
<property name="valign">GTK_ALIGN_CENTER</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="visible">True</property>
......
......@@ -28,7 +28,7 @@ blackbox_deps = [
dependency('gtk4', version: '>= 4.6.2'),
dependency('libadwaita-1'),
dependency('marble', version: '>= 42'),
dependency('vte-2.91-gtk4', version: '>= 0.68.0'),
dependency('vte-2.91-gtk4', version: '>= 0.69.0'),
dependency('json-glib-1.0', version: '>= 1.4.4'),
dependency('libpcre2-8'),
dependency('libxml-2.0', version: '>= 2.9.12'),
......
......@@ -35,9 +35,6 @@ public class Terminal.Settings : Marble.Settings {
public uint window_width { get; set; }
public Variant terminal_padding { get; set; }
// Temporary
public bool warn_copy_not_implemented { get; set; }
public bool floating_controls { get; set; }
public uint floating_controls_hover_area { get; set; }
public uint delay_before_showing_floating_controls { get; set; }
......
......@@ -29,7 +29,6 @@ public class Terminal.PreferencesWindow : Adw.PreferencesWindow {
[GtkChild] unowned Gtk.Switch pixel_scrolling_switch;
[GtkChild] unowned Gtk.Switch remember_window_size_switch;
[GtkChild] unowned Gtk.Switch easy_copy_paste_switch;
[GtkChild] unowned Gtk.Switch warn_copy_not_implemented_switch;
[GtkChild] unowned Gtk.FontButton font_button;
[GtkChild] unowned Gtk.SpinButton padding_spin_button;
[GtkChild] unowned Adw.ComboRow cursor_shape_combo_row;
......@@ -94,13 +93,6 @@ public class Terminal.PreferencesWindow : Adw.PreferencesWindow {
SettingsBindFlags.DEFAULT
);
settings.schema.bind(
"warn-copy-not-implemented",
this.warn_copy_not_implemented_switch,
"active",
SettingsBindFlags.DEFAULT
);
// Scrolling ====
settings.schema.bind (
......
......@@ -415,134 +415,8 @@ public class Terminal.Terminal : Vte.Terminal {
public void do_copy_clipboard () {
if (this.get_has_selection ()) {
var s = Settings.get_default ();
if (!s.warn_copy_not_implemented) {
return;
}
var d = new Gtk.MessageDialog (
this.window,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.WARNING,
Gtk.ButtonsType.OK,
Constants.COPYING_NOT_IMPLEMENTED_WARNING_FMT,
APP_NAME,
APP_NAME
);
var check_button = new Gtk.CheckButton.with_label (
_("Do not remind me again")
);
check_button.can_focus = false;
(d.get_message_area () as Gtk.Box)?.append (check_button);
d.set_default_response (Gtk.ResponseType.OK);
d.response.connect (() => {
s.warn_copy_not_implemented = !check_button.active;
d.close ();
});
d.show ();
Gdk.Display.get_default ().get_clipboard ()
.set_text (this.get_text_selected ());
}
}
// private void on_drag_data_received(
// Gdk.DragContext _context,
// int _x,
// int _y,
// Gtk.SelectionData data,
// uint target_type,
// uint _time
// ) {
// // This function was based on Tilix's code
// // https://github.com/gnunn1/tilix/blob/5008e73a278a97871ca3628ee782fbad445917e7/source/gx/tilix/terminal/terminal.d
// switch (target_type) {
// case DropTargets.URILIST:
// string[] uris = data.get_uris();
// string text;
// File file;
// foreach (string uri in uris) {
// file = File.new_for_uri(uri);
// if (file != null) {
// text = file.get_path();
// }
// else {
// try {
// text = Filename.from_uri(uri, null);
// }
// catch (Error e) {
// warning(e.message);
// text = uri;
// }
// }
// this.feed_child(Shell.quote(text).data);
// this.feed_child(" ".data);
// }
// break;
// case DropTargets.STRING:
// case DropTargets.TEXT:
// string? text = data.get_text();
// if (text != null) {
// this.feed_child(text.data);
// }
// break;
// }
// }
// private bool on_button_press(Gdk.EventButton e) {
// string? url = this.match_check_event(e, null);
// if (
// url != null
// && e.button == Gdk.BUTTON_PRIMARY
// && (e.state & Gdk.ModifierType.CONTROL_MASK) != 0
// ) {
// try {
// Gtk.show_uri_on_window(this.window, url, e.time);
// return true;
// }
// catch (Error e) {
// warning(e.message);
// }
// }
// return false;
// }
// private bool on_key_press(Gdk.EventKey e) {
// if ((e.state & Gdk.ModifierType.CONTROL_MASK) == 0) {
// return false;
// }
// switch (Gdk.keyval_name(e.keyval)) {
// case "C": {
// if (this.get_has_selection())
// this.copy_clipboard();
// return true;
// }
// case "V": {
// this.paste_clipboard();
// return true;
// }
// case "plus": {
// this.font_scale = double.min(10, this.font_scale + 0.1);
// return true;
// }
// case "underscore": {
// this.font_scale = double.max(0.1, this.font_scale - 0.1);
// return true;
// }
// case "N": {
// this.window.activate_action("new_window", null);
// return true;
// }
// case "T": {
// this.window.activate_action("new_tab", null);
// return true;
// }
// }
// return false;
// }
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment