Update dependencies

This commit is contained in:
Jeremy Soller 2024-05-17 09:11:50 -06:00
parent d637688699
commit d11501c43d
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
4 changed files with 520 additions and 495 deletions

865
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -21,13 +21,13 @@ xdg = "2.5.2"
tokio = { workspace = true, features = ["full"] }
wayland-client = "0.31.2"
# For network status using networkmanager feature
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "3644bc909984842f35adb1057ef6e0a277c1aa6a", optional = true }
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "badfc6a", optional = true }
# For logind integration using logind feature
logind-zbus = { version = "3.1.2", optional = true }
logind-zbus = { version = "4", optional = true }
# Fix zbus compilation by manually adding nix with user feature
nix = { workspace = true, optional = true }
# For power status with upower feature
upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "3644bc909984842f35adb1057ef6e0a277c1aa6a", optional = true }
upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "badfc6a", optional = true }
# Required for some features
zbus = { workspace = true, optional = true }
# Internationalization
@ -58,7 +58,7 @@ pwd = "1.4.0"
ron = "0.8"
serde = "1"
tokio = "1.33.0"
zbus = "3.14.1"
zbus = "4"
[workspace.dependencies.cosmic-bg-config]
git = "https://github.com/pop-os/cosmic-bg"

View file

@ -738,8 +738,7 @@ impl cosmic::Application for App {
Message::DialogCancel => {
self.dialog_page_opt = None;
}
Message::DialogConfirm => {
match self.dialog_page_opt.take() {
Message::DialogConfirm => match self.dialog_page_opt.take() {
Some(DialogPage::Restart(_)) => {
#[cfg(feature = "logind")]
return Command::perform(
@ -754,7 +753,7 @@ impl cosmic::Application for App {
},
|x| x,
);
},
}
Some(DialogPage::Shutdown(_)) => {
#[cfg(feature = "logind")]
return Command::perform(
@ -769,10 +768,9 @@ impl cosmic::Application for App {
},
|x| x,
);
},
}
None => {}
}
}
},
Message::Suspend => {
#[cfg(feature = "logind")]
return Command::perform(
@ -794,16 +792,14 @@ impl cosmic::Application for App {
Message::Shutdown => {
self.dialog_page_opt = Some(DialogPage::Shutdown(Instant::now()));
}
Message::Heartbeat => {
match self.dialog_page_opt {
Message::Heartbeat => match self.dialog_page_opt {
Some(DialogPage::Restart(instant)) | Some(DialogPage::Shutdown(instant)) => {
if DialogPage::remaining(instant).is_none() {
return self.update(Message::DialogConfirm);
}
},
}
None => {}
}
}
},
Message::Exit => {
let mut commands = Vec::new();
for (_output, surface_id) in self.surface_ids.drain() {
@ -1111,13 +1107,17 @@ impl cosmic::Application for App {
widget::dialog(fl!("restart-now"))
.icon(widget::icon::from_name("system-restart-symbolic").size(64))
.body(fl!("restart-timeout", seconds = remaining.as_secs()))
.primary_action(widget::button::suggested(fl!("restart")).on_press(Message::DialogConfirm))
.primary_action(
widget::button::suggested(fl!("restart"))
.on_press(Message::DialogConfirm),
)
.secondary_action(
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
widget::button::standard(fl!("cancel"))
.on_press(Message::DialogCancel),
),
)
.into()
},
}
Some(DialogPage::Shutdown(instant)) => {
let remaining = DialogPage::remaining(instant).unwrap_or_default();
popover
@ -1125,13 +1125,17 @@ impl cosmic::Application for App {
widget::dialog(fl!("shutdown-now"))
.icon(widget::icon::from_name("system-shutdown-symbolic").size(64))
.body(fl!("shutdown-timeout", seconds = remaining.as_secs()))
.primary_action(widget::button::suggested(fl!("shutdown")).on_press(Message::DialogConfirm))
.primary_action(
widget::button::suggested(fl!("shutdown"))
.on_press(Message::DialogConfirm),
)
.secondary_action(
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
widget::button::standard(fl!("cancel"))
.on_press(Message::DialogCancel),
),
)
.into()
},
}
None => popover.into(),
}
}

View file

@ -6,13 +6,7 @@ use logind_zbus::{
manager::{InhibitType, ManagerProxy},
session::SessionProxy,
};
use std::{
any::TypeId,
error::Error,
os::fd::{FromRawFd, IntoRawFd, OwnedFd},
process,
sync::Arc,
};
use std::{any::TypeId, error::Error, os::fd::OwnedFd, process, sync::Arc};
use tokio::time;
use zbus::Connection;
@ -47,7 +41,7 @@ async fn inhibit(manager: &ManagerProxy<'_>) -> zbus::Result<OwnedFd> {
.call("Inhibit", &(what, who, why, mode))
.await?;
// Have to convert to std type to avoid leaking zbus dependency
Ok(unsafe { OwnedFd::from_raw_fd(fd.into_raw_fd()) })
Ok(fd.into())
}
pub fn subscription() -> Subscription<Message> {