From 7931fa48e8ec31d5ce4595aa985e24c0880c9295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 26 Feb 2025 13:11:30 -0800 Subject: [PATCH 01/13] Update deps --- .github/workflows/main.yml | 2 +- README.md | 4 ++-- meson.build | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ec4d5d..fec90d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y libgranite-dev meson valac + apt install -y libgranite-7-dev meson valac - name: Build env: DESTDIR: out diff --git a/README.md b/README.md index 969f993..0080f2f 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Send and receive files via Bluetooth You'll need the following dependencies: - libgranite-dev >= 6.0.0 - libgtk3-dev + libgranite-7-dev + libgtk4-dev meson valac diff --git a/meson.build b/meson.build index 5142ead..67d540f 100644 --- a/meson.build +++ b/meson.build @@ -10,8 +10,8 @@ add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), lan gnome = import('gnome') i18n = import('i18n') -granite_dep = dependency ('granite') -gtk_dep = dependency ('gtk+-3.0') +granite_dep = dependency ('granite-7') +gtk_dep = dependency ('gtk4') subdir('data') subdir('po') From 67bc34ad457b1e54995a22c5bc048a560fad1818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 17 Apr 2026 13:35:53 -0700 Subject: [PATCH 02/13] More minor syntax --- src/Dialog/ReceiverDialog.vala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Dialog/ReceiverDialog.vala b/src/Dialog/ReceiverDialog.vala index 6d05164..31a4cbb 100644 --- a/src/Dialog/ReceiverDialog.vala +++ b/src/Dialog/ReceiverDialog.vala @@ -32,7 +32,8 @@ public class ReceiverDialog : Granite.Dialog { notification = new GLib.Notification ("bluetooth"); notification.set_priority (NotificationPriority.NORMAL); - var icon_image = new Gtk.Image.from_icon_name ("io.elementary.bluetooth", Gtk.IconSize.DIALOG) { + var icon_image = new Gtk.Image.from_icon_name ("io.elementary.bluetooth") { + pixel_size = 48, valign = END, halign = END }; @@ -54,7 +55,7 @@ public class ReceiverDialog : Granite.Dialog { wrap = true, xalign = 0 }; - device_label.get_style_context ().add_class ("primary"); + device_label.add_css_class ("primary"); directory_label = new Gtk.Label (null) { max_width_chars = 45, @@ -102,12 +103,12 @@ public class ReceiverDialog : Granite.Dialog { message_grid.attach (progressbar, 1, 4); message_grid.attach (progress_label, 1, 5); - get_content_area ().add (message_grid); + get_content_area ().append (message_grid); add_button (_("Close"), Gtk.ResponseType.CLOSE); var suggested_button = add_button (_("Reject"), Gtk.ResponseType.ACCEPT); - suggested_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + suggested_button.add_css_class (Granite.CssClass.DESTRUCTIVE); response.connect ((response_id) => { if (response_id == Gtk.ResponseType.ACCEPT) { From 211fbfbc58239012ba5510465ee70e760f1df6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 17 Apr 2026 15:16:44 -0700 Subject: [PATCH 03/13] No more show_all --- src/Dialog/ReceiverDialog.vala | 1 - src/Dialog/SenderDialog.vala | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Dialog/ReceiverDialog.vala b/src/Dialog/ReceiverDialog.vala index bd6ca1d..31a4cbb 100644 --- a/src/Dialog/ReceiverDialog.vala +++ b/src/Dialog/ReceiverDialog.vala @@ -102,7 +102,6 @@ public class ReceiverDialog : Granite.Dialog { message_grid.attach (rate_label, 1, 3); message_grid.attach (progressbar, 1, 4); message_grid.attach (progress_label, 1, 5); - message_grid.show_all (); get_content_area ().append (message_grid); diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index 153468d..73bcb2d 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -107,7 +107,6 @@ public class SenderDialog : Granite.Dialog { message_grid.attach (rate_label, 1, 3); message_grid.attach (progressbar, 1, 4); message_grid.attach (progress_label, 1, 5); - message_grid.show_all (); get_content_area ().append (message_grid); From 2dd506449876fbca54198c371edfad74891166bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 17 Apr 2026 15:25:18 -0700 Subject: [PATCH 04/13] destroy connect --- src/Application.vala | 6 +++--- src/Dialog/DeviceRow.vala | 2 +- src/Dialog/ReceiverDialog.vala | 4 ++-- src/Dialog/ScanDialog.vala | 2 +- src/Dialog/SenderDialog.vala | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index 577984d..977751e 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -48,7 +48,7 @@ public class BluetoothApp : Gtk.Application { if (bt_scan == null) { bt_scan = new ScanDialog (this, object_manager); - bt_scan.destroy.connect (() => { + ((Gtk.Widget) bt_scan).destroy.connect (() => { bt_scan = null; }); @@ -58,7 +58,7 @@ public class BluetoothApp : Gtk.Application { bt_sender.add_files (files, device); bt_senders.append (bt_sender); bt_sender.present (); - bt_sender.destroy.connect (() => { + ((Gtk.Widget) bt_sender).destroy.connect (() => { bt_senders.foreach ((sender) => { if (sender.device == bt_sender.device) { bt_senders.remove_link (bt_senders.find (sender)); @@ -234,7 +234,7 @@ public class BluetoothApp : Gtk.Application { bt_receiver = new ReceiverDialog (this); bt_receivers.append (bt_receiver); - bt_receiver.destroy.connect (() => { + ((Gtk.Widget) bt_receiver).destroy.connect (() => { bt_receivers.foreach ((receiver) => { if (receiver.transfer.session == bt_receiver.session) { bt_receivers.remove_link (bt_receivers.find (receiver)); diff --git a/src/Dialog/DeviceRow.vala b/src/Dialog/DeviceRow.vala index a02a351..792b088 100644 --- a/src/Dialog/DeviceRow.vala +++ b/src/Dialog/DeviceRow.vala @@ -40,7 +40,7 @@ public class DeviceRow : Gtk.ListBoxRow { var state_label = new Gtk.Label (null) { xalign = 0 }; - state_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + state_label.add_css_class (Granite.CssClass.SMALL); var overlay = new Gtk.Overlay () { child = image, diff --git a/src/Dialog/ReceiverDialog.vala b/src/Dialog/ReceiverDialog.vala index 31a4cbb..f4ecd68 100644 --- a/src/Dialog/ReceiverDialog.vala +++ b/src/Dialog/ReceiverDialog.vala @@ -119,11 +119,11 @@ public class ReceiverDialog : Granite.Dialog { } destroy (); } else { - hide_on_delete (); + hide (); } }); - delete_event.connect (() => { + close_request.connect (() => { if (transfer.status == "active") { return hide_on_delete (); } else { diff --git a/src/Dialog/ScanDialog.vala b/src/Dialog/ScanDialog.vala index a56e66d..2c3182d 100644 --- a/src/Dialog/ScanDialog.vala +++ b/src/Dialog/ScanDialog.vala @@ -45,7 +45,7 @@ public class ScanDialog : Granite.Dialog { }; var empty_alert = new Granite.Placeholder (_("No Devices Found")) { - secondary_text = _("Please ensure that your devices are visible and ready for pairing.") + description = _("Please ensure that your devices are visible and ready for pairing.") }; list_box = new Gtk.ListBox () { diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index 73bcb2d..8c80b8c 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -113,7 +113,7 @@ public class SenderDialog : Granite.Dialog { add_button (_("Close"), Gtk.ResponseType.CLOSE); var reject_transfer = add_button (_("Cancel"), Gtk.ResponseType.CANCEL); - reject_transfer.add_css_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + reject_transfer.add_css_class (Granite.CssClass.DESTRUCTIVE); response.connect ((response_id) => { if (response_id == Gtk.ResponseType.CANCEL) { @@ -127,17 +127,17 @@ public class SenderDialog : Granite.Dialog { remove_session.begin (); } } - destroy (); + } else { if (transfer.status == "active") { - hide_on_delete (); + hide (); } else { destroy (); } } }); - delete_event.connect (() => { + close_request.connect (() => { if (transfer.status == "active") { return hide_on_delete (); } else { @@ -241,7 +241,7 @@ public class SenderDialog : Granite.Dialog { ); send_file.begin (); } catch (Error e) { - hide_on_delete (); + hide (); var bt_retry = new Granite.MessageDialog ( _("Connecting to '%s' failed.").printf (device.alias), "%s\n%s".printf ( @@ -308,7 +308,7 @@ public class SenderDialog : Granite.Dialog { private void tranfer_progress () { switch (transfer.status) { case "error": - hide_on_delete (); + hide (); var bt_retry = new Granite.MessageDialog ( _("The transfer of '%s' failed.").printf (file_path.get_basename ()), "%s\n%s".printf ( From 6cb2cd2aec7f99b1ddb1f8d3f17b4dc60e2db48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 09:28:12 -0700 Subject: [PATCH 05/13] Don't bind, transfer can be null --- src/Dialog/ReceiverDialog.vala | 9 ++++----- src/Dialog/SenderDialog.vala | 11 +++-------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Dialog/ReceiverDialog.vala b/src/Dialog/ReceiverDialog.vala index 676ae29..1d78cb3 100644 --- a/src/Dialog/ReceiverDialog.vala +++ b/src/Dialog/ReceiverDialog.vala @@ -117,13 +117,10 @@ public class ReceiverDialog : Granite.Dialog { } catch (Error e) { GLib.warning (e.message); } - destroy (); - } else { - hide (); } - }); - transfer.bind_property ("status", this, "hide-on-close",SYNC_CREATE); + close (); + }); } public void set_transfer (string devicename, string deviceicon, string objectpath) { @@ -146,6 +143,8 @@ public class ReceiverDialog : Granite.Dialog { } private void tranfer_progress () { + hide_on_close = transfer.status == "active"; + try { switch (transfer.status) { case "error": diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index 52a1e52..a027c8a 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -127,17 +127,10 @@ public class SenderDialog : Granite.Dialog { remove_session.begin (); } } - } else { - if (transfer.status == "active") { - hide (); - } else { - destroy (); - } + close (); } }); - - transfer.bind_property ("status", this, "hide-on-close",SYNC_CREATE); } public void add_files (Gee.ArrayList files, Bluetooth.Device device) { @@ -300,6 +293,8 @@ public class SenderDialog : Granite.Dialog { } private void tranfer_progress () { + hide_on_close = transfer.status == "active"; + switch (transfer.status) { case "error": hide (); From 6ba8364aec91d2b663ea0700373c89550e4df99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 09:30:39 -0700 Subject: [PATCH 06/13] Close, not destroy --- src/Dialog/ReceiverDialog.vala | 4 ++-- src/Dialog/SenderDialog.vala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Dialog/ReceiverDialog.vala b/src/Dialog/ReceiverDialog.vala index 1d78cb3..960dbf6 100644 --- a/src/Dialog/ReceiverDialog.vala +++ b/src/Dialog/ReceiverDialog.vala @@ -152,7 +152,7 @@ public class ReceiverDialog : Granite.Dialog { notification.set_title (_("File transfer failed")); notification.set_body (GLib.Markup.printf_escaped (_("%s File: %s not received"), device_label.get_label (), transfer.name)); Application.get_default ().send_notification ("io.elementary.bluetooth", notification); - destroy (); + close (); break; case "queued": break; @@ -165,7 +165,7 @@ public class ReceiverDialog : Granite.Dialog { break; case "complete": move_to_folder (path_folder); - destroy (); + close (); break; } } catch (Error e) { diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index a027c8a..cb46dc7 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -251,7 +251,7 @@ public class SenderDialog : Granite.Dialog { create_session.begin (); present (); } else { - destroy (); + close (); } bt_retry.destroy (); @@ -339,7 +339,7 @@ public class SenderDialog : Granite.Dialog { send_notify (); if (!next_file ()) { remove_session.begin (); - destroy (); + close (); } break; } From ade0ec9f34a151222085ad254476e37e9870fa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 20 Aug 2026 15:30:48 -0700 Subject: [PATCH 07/13] SenderDialog: always close on response --- src/Dialog/SenderDialog.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index cb46dc7..7a406d7 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -127,9 +127,11 @@ public class SenderDialog : Granite.Dialog { remove_session.begin (); } } - } else { - close (); + + } + + close (); }); } From eb99dd154a09a9faf32eafa3d55d6d45f65c626c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 21 Aug 2026 09:18:53 -0700 Subject: [PATCH 08/13] Fix destory cycle --- src/Application.vala | 3 ++- src/Dialog/ScanDialog.vala | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index 977751e..c1925cf 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -48,8 +48,9 @@ public class BluetoothApp : Gtk.Application { if (bt_scan == null) { bt_scan = new ScanDialog (this, object_manager); - ((Gtk.Widget) bt_scan).destroy.connect (() => { + bt_scan.close_request.connect (() => { bt_scan = null; + return Gdk.EVENT_PROPAGATE; }); bt_scan.send_file.connect ((device) => { diff --git a/src/Dialog/ScanDialog.vala b/src/Dialog/ScanDialog.vala index 2c3182d..a16044e 100644 --- a/src/Dialog/ScanDialog.vala +++ b/src/Dialog/ScanDialog.vala @@ -100,7 +100,7 @@ public class ScanDialog : Granite.Dialog { response.connect ((response_id) => { manager.stop_discovery.begin (); - destroy (); + close (); }); } From 3074d490aa7a694b51483a7e708ee6d139ae33be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 21 Aug 2026 09:20:25 -0700 Subject: [PATCH 09/13] Close request connect --- src/Application.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Application.vala b/src/Application.vala index c1925cf..fd3919e 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -59,12 +59,13 @@ public class BluetoothApp : Gtk.Application { bt_sender.add_files (files, device); bt_senders.append (bt_sender); bt_sender.present (); - ((Gtk.Widget) bt_sender).destroy.connect (() => { + bt_sender.close_request.connect (() => { bt_senders.foreach ((sender) => { if (sender.device == bt_sender.device) { bt_senders.remove_link (bt_senders.find (sender)); } }); + return Gdk.EVENT_PROPAGATE; }); } }); From 8b3dd14f6ce887b962e2b5e3199269cdaf5716b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 21 Aug 2026 09:21:10 -0700 Subject: [PATCH 10/13] Remove extra whitespace --- src/Dialog/SenderDialog.vala | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index 7a406d7..c3c3164 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -127,8 +127,6 @@ public class SenderDialog : Granite.Dialog { remove_session.begin (); } } - - } close (); From 2a2dbe044e8d935d74fedcb3b64b90dc2c3431a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 21 Aug 2026 09:21:43 -0700 Subject: [PATCH 11/13] Fix some extra nesting --- src/Dialog/SenderDialog.vala | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Dialog/SenderDialog.vala b/src/Dialog/SenderDialog.vala index c3c3164..2ebbd33 100644 --- a/src/Dialog/SenderDialog.vala +++ b/src/Dialog/SenderDialog.vala @@ -117,15 +117,13 @@ public class SenderDialog : Granite.Dialog { response.connect ((response_id) => { if (response_id == Gtk.ResponseType.CANCEL) { - if (transfer != null) { - if (transfer.status == "active") { - try { - transfer.cancel (); - } catch (Error e) { - GLib.warning (e.message); - } - remove_session.begin (); + if (transfer != null && transfer.status == "active") { + try { + transfer.cancel (); + } catch (Error e) { + GLib.warning (e.message); } + remove_session.begin (); } } From eb5e1dbb386d0562a6406212c0540e36b67a7c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 24 Aug 2026 09:50:13 -0700 Subject: [PATCH 12/13] Fix README deps --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00287f8..37fdb4c 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Send and receive files via Bluetooth You'll need the following dependencies: - libgranite-7-dev >= 6.0.0 - libgtk4-dev + libgranite-7-dev >= 7.7.0 + libgtk-4-dev systemd-dev meson valac From 5f3512bf8a91fbef74534b6d0bd66c022e505edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 24 Aug 2026 09:51:38 -0700 Subject: [PATCH 13/13] Name required granite version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f1d5687..9f8785f 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,7 @@ i18n = import('i18n') prefix = get_option('prefix') bindir = prefix / get_option('bindir') -granite_dep = dependency ('granite-7') +granite_dep = dependency ('granite-7', version: '>=7.7.0') gtk_dep = dependency ('gtk4') posix_dep = meson.get_compiler('vala').find_library('posix')