feat: merge subscriptions crate into cosmic-settings repo

This commit is contained in:
Michael Aaron Murphy 2025-10-08 08:19:35 +02:00 committed by Michael Murphy
parent a2f53f2239
commit 600720b7d1
47 changed files with 8399 additions and 63 deletions

View file

@ -3,6 +3,7 @@ name = "cosmic-settings"
version = "0.1.0"
edition = "2024"
license = "GPL-3.0-only"
publish = false
[dependencies]
accounts-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
@ -24,7 +25,13 @@ cosmic-randr-shell.workspace = true
cosmic-randr = { workspace = true, optional = true }
cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", optional = true }
cosmic-settings-page = { path = "../page" }
cosmic-settings-subscriptions = { workspace = true, optional = true }
cosmic-settings-accessibility-subscription = { path = "../subscriptions/accessibility", optional = true }
cosmic-settings-a11y-manager-subscription = { path = "../subscriptions/a11y-manager", optional = true }
cosmic-settings-airplane-mode-subscription = { path = "../subscriptions/airplane-mode", optional = true }
cosmic-settings-bluetooth-subscription = { path = "../subscriptions/bluetooth", optional = true }
cosmic-settings-network-manager-subscription = { path = "../subscriptions/network-manager", optional = true }
cosmic-settings-upower-subscription = { path = "../subscriptions/upower", optional = true }
cosmic-settings-sound-subscription = { path = "../subscriptions/sound", optional = true }
cosmic-settings-system = { path = "../pages/system", optional = true }
cosmic-settings-wallpaper = { path = "../pages/wallpapers" }
cosmic-settings-daemon-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", optional = true }
@ -131,12 +138,12 @@ page-accessibility = [
"dep:cosmic-comp-config",
"dep:cosmic-settings-config",
"dep:cosmic-settings-daemon-config",
"cosmic-settings-subscriptions/accessibility",
"cosmic-settings-subscriptions/cosmic_a11y_manager",
"dep:cosmic-settings-accessibility-subscription",
"dep:cosmic-settings-a11y-manager-subscription",
]
page-about = ["dep:cosmic-settings-system", "dep:hostname1-zbus", "dep:zbus"]
page-bluetooth = [
"cosmic-settings-subscriptions/bluetooth",
"dep:cosmic-settings-bluetooth-subscription",
"dep:zbus",
"dep:bluez-zbus",
]
@ -153,14 +160,14 @@ page-input = [
]
page-legacy-applications = ["dep:cosmic-comp-config"]
page-networking = [
"cosmic-settings-subscriptions/network_manager",
"dep:cosmic-settings-network-manager-subscription",
"xdg-portal",
"dep:cosmic-dbus-networkmanager",
"dep:zbus",
]
page-power = ["dep:upower_dbus", "dep:zbus"]
page-region = ["gettext", "dep:locales-rs", "dep:locale1", "dep:zbus"]
page-sound = ["cosmic-settings-subscriptions/sound"]
page-sound = ["dep:cosmic-settings-sound-subscription"]
page-users = ["xdg-portal", "dep:accounts-zbus", "dep:zbus", "dep:zbus_polkit"]
page-window-management = ["dep:cosmic-settings-config"]
page-workspaces = ["dep:cosmic-comp-config"]

View file

@ -8,15 +8,15 @@ use cosmic::{
};
pub use cosmic_comp_config::ZoomMovement;
use cosmic_config::CosmicConfigEntry;
use cosmic_settings_a11y_manager_subscription as cosmic_a11y_manager;
use cosmic_settings_accessibility_subscription::{
DBusRequest, DBusUpdate, subscription as a11y_subscription,
};
use cosmic_settings_daemon_config::CosmicSettingsDaemonConfig;
use cosmic_settings_page::{
self as page, Insert,
section::{self, Section},
};
use cosmic_settings_subscriptions::accessibility::{
DBusRequest, DBusUpdate, subscription as a11y_subscription,
};
use cosmic_settings_subscriptions::cosmic_a11y_manager;
use num_traits::FromPrimitive;
use slotmap::SlotMap;

View file

@ -5,8 +5,8 @@ use cosmic::iced::{Alignment, Length, color};
use cosmic::iced_core::text::Wrapping;
use cosmic::widget::{self, settings, text};
use cosmic::{Apply, Element, Task, theme};
use cosmic_settings_bluetooth_subscription::*;
use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_subscriptions::bluetooth::*;
use futures::StreamExt;
use futures::channel::oneshot;
use slab::Slab;

View file

@ -13,8 +13,8 @@ use cosmic_dbus_networkmanager::{
interface::enums::{DeviceState, DeviceType},
nm::NetworkManager,
};
use cosmic_settings_network_manager_subscription as network_manager;
use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_subscriptions::network_manager;
use futures::StreamExt;
use slotmap::SlotMap;

View file

@ -13,10 +13,10 @@ use cosmic::{
iced_core::text::Wrapping,
widget::{self, icon},
};
use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_subscriptions::network_manager::{
self, NetworkManagerState, UUID, current_networks::ActiveConnectionInfo,
use cosmic_settings_network_manager_subscription::{
self as network_manager, NetworkManagerState, UUID, current_networks::ActiveConnectionInfo,
};
use cosmic_settings_page::{self as page, Section, section};
use futures::{FutureExt, StreamExt};
use indexmap::IndexMap;
use secure_string::SecureString;
@ -219,7 +219,7 @@ impl page::Page<crate::pages::Message> for Page {
Some(vec![sections.insert(devices_view())])
}
fn dialog(&self) -> Option<Element<crate::pages::Message>> {
fn dialog(&'_ self) -> Option<Element<'_, crate::pages::Message>> {
self.dialog.as_ref().map(|dialog| match dialog {
VpnDialog::Error(error_kind, message) => {
let reason = widget::text::body(message.as_str()).wrapping(Wrapping::Word);

View file

@ -14,13 +14,13 @@ use cosmic::{
iced_widget::focus_next,
widget::{self, column, icon},
};
use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_subscriptions::network_manager::{
self, NetworkManagerState,
use cosmic_settings_network_manager_subscription::{
self as network_manager, NetworkManagerState,
available_wifi::{AccessPoint, NetworkType},
current_networks::ActiveConnectionInfo,
hw_address::HwAddress,
};
use cosmic_settings_page::{self as page, Section, section};
use futures::StreamExt;
use secure_string::SecureString;
@ -141,7 +141,7 @@ impl page::Page<crate::pages::Message> for Page {
Some(vec![sections.insert(devices_view())])
}
fn dialog(&self) -> Option<Element<crate::pages::Message>> {
fn dialog(&'_ self) -> Option<Element<'_, crate::pages::Message>> {
self.dialog.as_ref().map(|dialog| match dialog {
WiFiDialog::Password {
password,

View file

@ -11,10 +11,10 @@ use cosmic::{
widget::{self, icon},
};
use cosmic_dbus_networkmanager::interface::enums::DeviceState;
use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_subscriptions::network_manager::{
self, NetworkManagerState, current_networks::ActiveConnectionInfo,
use cosmic_settings_network_manager_subscription::{
self as network_manager, NetworkManagerState, current_networks::ActiveConnectionInfo,
};
use cosmic_settings_page::{self as page, Section, section};
use futures::StreamExt;
pub type ConnectionId = Arc<str>;
@ -118,7 +118,7 @@ impl page::Page<crate::pages::Message> for Page {
Some(vec![sections.insert(devices_view())])
}
fn dialog(&self) -> Option<Element<crate::pages::Message>> {
fn dialog(&'_ self) -> Option<Element<'_, crate::pages::Message>> {
self.dialog.as_ref().map(|dialog| match dialog {
WiredDialog::RemoveProfile(uuid) => {
let primary_action = widget::button::destructive(fl!("remove"))

View file

@ -12,7 +12,7 @@ use cosmic_settings_page::{self as page, Section, section};
use slab::Slab;
use slotmap::SlotMap;
use cosmic_settings_subscriptions::sound as subscription;
use cosmic_settings_sound_subscription as subscription;
const AUDIO_CONFIG: &str = "com.system76.CosmicAudio";
const AMPLIFICATION_SINK: &str = "amplification_sink";