diff --git a/Cargo.lock b/Cargo.lock
index ce7a86c..4b9611a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -752,6 +752,7 @@ name = "turnon"
version = "1.6.2"
dependencies = [
"async-channel",
+ "bitflags",
"futures-util",
"glib",
"glob",
diff --git a/Cargo.toml b/Cargo.toml
index ade9f17..1817fda 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,6 +21,7 @@ macaddr = { version = "1.0.1", default-features = false }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
socket2 = "0.5.7"
+bitflags = "2.6.0"
[build-dependencies]
glob = "0.3.1"
diff --git a/resources/de.swsnr.turnon.metainfo.xml.in b/resources/de.swsnr.turnon.metainfo.xml.in
index c6ea789..2549bea 100644
--- a/resources/de.swsnr.turnon.metainfo.xml.in
+++ b/resources/de.swsnr.turnon.metainfo.xml.in
@@ -10,8 +10,9 @@
Features:
- Add devices to turn on.
- - Turn on devices with magic Wake On LAN (WoL) packets.
+ - Discover devices in the local network.
- Monitor device status.
+ - Turn on devices with magic Wake On LAN (WoL) packets.
- Turn on devices from GNOME Shell search.
- Turn on devices from the command line.
@@ -30,6 +31,17 @@
https://github.com/swsnr/turnon
de.swsnr.turnon.desktop
+
+
+ Add a toolbar button to enable or disable network scanning.
+ When network scanning is enabled show devices from the system's ARP cache.
+ Add a button to directly add devices discovered from network scanning.
+
+
+ GH-4
+
+ https://github.com/swsnr/turnon/releases/tag/next
+
The dialog to add a new device now uses success and error styles for the validity indicators.
diff --git a/resources/icons/scalable/actions/waves-and-screen-symbolic.svg b/resources/icons/scalable/actions/waves-and-screen-symbolic.svg
new file mode 100644
index 0000000..1a472a5
--- /dev/null
+++ b/resources/icons/scalable/actions/waves-and-screen-symbolic.svg
@@ -0,0 +1,2 @@
+
+
diff --git a/resources/resources.gresource.xml b/resources/resources.gresource.xml
index cc983d0..7afe63f 100644
--- a/resources/resources.gresource.xml
+++ b/resources/resources.gresource.xml
@@ -11,10 +11,12 @@
gtk/help-overlay.ui
icons/scalable/actions/sonar-symbolic.svg
+ icons/scalable/actions/waves-and-screen-symbolic.svg
icons/scalable/apps/de.swsnr.turnon.svg
icons/scalable/apps/de.swsnr.turnon-symbolic.svg
icons/scalable/apps/de.swsnr.turnon.Devel.svg
+ style.css
de.swsnr.turnon.metainfo.xml
diff --git a/resources/style.css b/resources/style.css
new file mode 100644
index 0000000..b817fc0
--- /dev/null
+++ b/resources/style.css
@@ -0,0 +1,5 @@
+/* Dim labels of discovered devices */
+row.discovered .title > .title,
+row.discovered .suffixes .title {
+ opacity: var(--dim-opacity);
+}
diff --git a/resources/ui/device-row.blp b/resources/ui/device-row.blp
index 318fdfc..d342c5d 100644
--- a/resources/ui/device-row.blp
+++ b/resources/ui/device-row.blp
@@ -12,7 +12,7 @@ template $DeviceRow: Adw.ActionRow {
[prefix]
Gtk.Stack {
- visible-child-name: bind $device_state_name(template.is_device_online) as ;
+ visible-child-name: bind $device_state_name(template.is-device-online) as ;
Gtk.StackPage {
name: "offline";
@@ -48,12 +48,12 @@ template $DeviceRow: Adw.ActionRow {
label: bind (template.device as <$Device>).host;
styles [
- "dim-label"
+ "title"
]
}
Gtk.Stack {
- visible-child-name: bind template.suffix_mode;
+ visible-child-name: bind template.suffix-mode;
margin-start: 12;
hhomogeneous: false;
transition-type: slide_left_right;
@@ -64,11 +64,24 @@ template $DeviceRow: Adw.ActionRow {
child: Gtk.Box {
orientation: horizontal;
+ Gtk.Button {
+ icon-name: "list-add-symbolic";
+ tooltip-text: C_("device-row.action.row.add.tooltip", "Add this device");
+ action-name: "row.add";
+ valign: center;
+ visible: bind template.can-add;
+
+ styles [
+ "flat"
+ ]
+ }
+
Gtk.Button {
icon-name: "document-edit-symbolic";
tooltip-text: C_("device-row.action.row.edit.tooltip", "Edit this device");
action-name: "row.edit";
valign: center;
+ visible: bind template.can-edit;
styles [
"flat"
@@ -81,6 +94,7 @@ template $DeviceRow: Adw.ActionRow {
action-name: "row.ask_delete";
margin-start: 6;
valign: center;
+ visible: bind template.can-delete;
styles [
"flat"
diff --git a/resources/ui/device-row.ui b/resources/ui/device-row.ui
index d4fd889..fb64cb6 100644
--- a/resources/ui/device-row.ui
+++ b/resources/ui/device-row.ui
@@ -26,7 +26,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.