From 04c7e73decdb89caae48eab9b86b64cdb5c8f3d4 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 29 Jun 2022 12:00:18 -0700 Subject: [PATCH] Update uses of relm4-macros to relm4 next branch --- Cargo.lock | 18 ++++++++++++++---- applets/cosmic-app-list/Cargo.toml | 2 +- applets/cosmic-applet-graphics/Cargo.toml | 2 +- applets/cosmic-applet-graphics/src/main.rs | 3 ++- applets/cosmic-applet-network/Cargo.toml | 4 ++-- .../src/ui/available_wifi.rs | 3 ++- applets/cosmic-applet-power/Cargo.toml | 2 +- applets/cosmic-applet-power/src/main.rs | 3 ++- applets/cosmic-applet-power/src/ui/session.rs | 6 ++++-- applets/cosmic-applet-power/src/ui/system.rs | 3 ++- 10 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb3a64c7..f7acee1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,7 +301,7 @@ dependencies = [ "libcosmic", "once_cell", "pretty_env_logger", - "relm4-macros 0.4.4", + "relm4-macros 0.5.0-beta.1", "rust-embed", "serde", "serde_json", @@ -335,7 +335,7 @@ dependencies = [ "cosmic-panel-config", "gtk4", "once_cell", - "relm4-macros 0.4.4", + "relm4-macros 0.5.0-beta.1", "tokio", "zbus", ] @@ -351,7 +351,7 @@ dependencies = [ "itertools", "libcosmic-widgets", "once_cell", - "relm4-macros 0.4.4", + "relm4-macros 0.5.0-beta.1", "slotmap", "tokio", "zbus", @@ -382,7 +382,7 @@ dependencies = [ "logind-zbus", "nix 0.24.1", "once_cell", - "relm4-macros 0.4.4", + "relm4-macros 0.5.0-beta.1", "tokio", "zbus", ] @@ -2183,6 +2183,16 @@ dependencies = [ "syn", ] +[[package]] +name = "relm4-macros" +version = "0.5.0-beta.1" +source = "git+https://github.com/Relm4/Relm4.git?branch=next#d85111b03ba80e5132f79e2fa21b69899aab4c46" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "remove_dir_all" version = "0.5.3" diff --git a/applets/cosmic-app-list/Cargo.toml b/applets/cosmic-app-list/Cargo.toml index 1b5dace7..ae582b00 100644 --- a/applets/cosmic-app-list/Cargo.toml +++ b/applets/cosmic-app-list/Cargo.toml @@ -10,7 +10,7 @@ cascade = "1.0.0" gtk4 = { version = "0.4.5", features = ["v4_4"] } gio = "0.15.3" libcosmic = { git = "https://github.com/pop-os/libcosmic" } -relm4-macros = "0.4.4" +relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } serde = "1.0.136" serde_json = "1.0.78" tokio = { version = "1.16.1", features = ["sync"] } diff --git a/applets/cosmic-applet-graphics/Cargo.toml b/applets/cosmic-applet-graphics/Cargo.toml index 0fdb1f42..19e80c2c 100644 --- a/applets/cosmic-applet-graphics/Cargo.toml +++ b/applets/cosmic-applet-graphics/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] gtk4 = { version = "0.4.6", features = ["v4_2"] } once_cell = "1.9.0" -relm4-macros = "0.4.4" +relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } tokio = { version = "1.16.1", features = ["full"] } zbus = "2.1.1" cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", features = ["gtk4"]} diff --git a/applets/cosmic-applet-graphics/src/main.rs b/applets/cosmic-applet-graphics/src/main.rs index 6200700b..267e457c 100644 --- a/applets/cosmic-applet-graphics/src/main.rs +++ b/applets/cosmic-applet-graphics/src/main.rs @@ -123,7 +123,8 @@ fn build_ui(application: >k4::Application) { set_visible: false, add_css_class: "loading-overlay", }, - set_child: main_box = Some(>k4::Box) { + #[wrap(Some)] + set_child: main_box = >k4::Box { set_orientation: Orientation::Vertical, set_spacing: 10, set_margin_top: 20, diff --git a/applets/cosmic-applet-network/Cargo.toml b/applets/cosmic-applet-network/Cargo.toml index e56c8dce..ad1ae1bb 100644 --- a/applets/cosmic-applet-network/Cargo.toml +++ b/applets/cosmic-applet-network/Cargo.toml @@ -10,9 +10,9 @@ futures-util = "0.3.21" gtk4 = "0.4.6" itertools = "0.10.3" once_cell = "1.9.0" -relm4-macros = "0.4.4" +relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } slotmap = "1.0.6" tokio = { version = "1.15.0", features = ["full"] } zbus = "2.0.1" libcosmic-widgets = { git = "https://github.com/pop-os/libcosmic" } -cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", features = ["gtk4"]} \ No newline at end of file +cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", features = ["gtk4"]} diff --git a/applets/cosmic-applet-network/src/ui/available_wifi.rs b/applets/cosmic-applet-network/src/ui/available_wifi.rs index ae14c559..f316e96d 100644 --- a/applets/cosmic-applet-network/src/ui/available_wifi.rs +++ b/applets/cosmic-applet-network/src/ui/available_wifi.rs @@ -59,7 +59,8 @@ fn build_aps_list( for ap in aps { view! { entry = ListBoxRow { - set_child: entry_box = Some(>k4::Box) { + #[wrap(Some)] + set_child: entry_box = >k4::Box { container_add: labeled_item = &LabeledItem { set_title: &ap.ssid, set_child: icon = &Image { diff --git a/applets/cosmic-applet-power/Cargo.toml b/applets/cosmic-applet-power/Cargo.toml index 636bcf8a..4afae05e 100644 --- a/applets/cosmic-applet-power/Cargo.toml +++ b/applets/cosmic-applet-power/Cargo.toml @@ -10,7 +10,7 @@ gtk4 = "0.4.6" logind-zbus = "3.0.1" nix = "0.24.1" once_cell = "1.9.0" -relm4-macros = "0.4.4" +relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } tokio = { version = "1.15.0", features = ["full"] } zbus = "2.0.1" cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", features = ["gtk4"]} diff --git a/applets/cosmic-applet-power/src/main.rs b/applets/cosmic-applet-power/src/main.rs index 0d33a754..c9cbdbd0 100644 --- a/applets/cosmic-applet-power/src/main.rs +++ b/applets/cosmic-applet-power/src/main.rs @@ -79,7 +79,8 @@ fn build_ui(application: >k4::Application) { set_margin_start: 24, set_margin_end: 24, append: settings_button = &Button { - set_child = Some(&Label) { + #[wrap(Some)] + set_child = &Label { set_label: "Settings...", set_halign: Align::Start, set_hexpand: true diff --git a/applets/cosmic-applet-power/src/ui/session.rs b/applets/cosmic-applet-power/src/ui/session.rs index 1d81b6e7..a2868b47 100644 --- a/applets/cosmic-applet-power/src/ui/session.rs +++ b/applets/cosmic-applet-power/src/ui/session.rs @@ -46,7 +46,8 @@ pub fn build() -> gtk4::Box { set_orientation: Orientation::Vertical, set_spacing: 5, append: lock_screen_button = &Button { - set_child: lock_screen_box = Some(>k4::Box) { + #[wrap(Some)] + set_child: lock_screen_box = >k4::Box { set_orientation: Orientation::Horizontal, set_spacing: 10, append: lock_screen_icon = &Image { @@ -64,7 +65,8 @@ pub fn build() -> gtk4::Box { } }, append: log_out_button = &Button { - set_child: log_out_box = Some(>k4::Box) { + #[wrap(Some)] + set_child: log_out_box = >k4::Box { set_orientation: Orientation::Horizontal, set_spacing: 10, append: log_out_icon = &Image { diff --git a/applets/cosmic-applet-power/src/ui/system.rs b/applets/cosmic-applet-power/src/ui/system.rs index f87308e1..61197222 100644 --- a/applets/cosmic-applet-power/src/ui/system.rs +++ b/applets/cosmic-applet-power/src/ui/system.rs @@ -57,7 +57,8 @@ pub fn build() -> gtk4::Box { pub fn create_button(name: &str, icon_name: &str) -> Button { view! { button = Button { - set_child: inner_box = Some(>k4::Box) { + #[wrap(Some)] + set_child: inner_box = >k4::Box { set_orientation: Orientation::Vertical, set_spacing: 8, set_margin_start: 8,