diff --git a/Cargo.lock b/Cargo.lock index 119a440..21d97db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -289,7 +289,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2183,7 +2183,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -2326,7 +2326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4482,7 +4482,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a1886916523694cd6ea3d175f03a1e5010699a2a4cc13696d83d7bea1d80638" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -5043,9 +5043,9 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nmrs" -version = "3.5.0" +version = "3.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84eac3f02c7970440ee58eeedc085b44ea4ad7161d7763457ae2389b415a84c8" +checksum = "aa84a0ad51eda83c8817099a0b613847599c712d049e89d892cca53ed6c4a337" dependencies = [ "async-trait", "base64", @@ -5137,7 +5137,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -6472,7 +6472,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -6942,7 +6942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -7187,10 +7187,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.3", + "getrandom 0.3.4", "once_cell", "rustix 1.1.4", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -7602,7 +7602,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" dependencies = [ "memoffset", "tempfile", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -8272,7 +8272,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] diff --git a/cosmic-settings/Cargo.toml b/cosmic-settings/Cargo.toml index 5fcb12d..491dea7 100644 --- a/cosmic-settings/Cargo.toml +++ b/cosmic-settings/Cargo.toml @@ -55,7 +55,7 @@ locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = sysinfo = { version = "=0.38.0", optional = true } mime-apps = { package = "cosmic-mime-apps", git = "https://github.com/pop-os/cosmic-mime-apps", features = ["tokio"], optional = true } notify = "8.2.0" -nmrs = { version = "3.4.2", optional = true } +nmrs = { version = "3.5.2", optional = true } regex = "1.13.1" ron = "0.12" rust-embed = "8.12.0" diff --git a/cosmic-settings/src/app.rs b/cosmic-settings/src/app.rs index a54eb81..5268ecf 100644 --- a/cosmic-settings/src/app.rs +++ b/cosmic-settings/src/app.rs @@ -65,6 +65,7 @@ pub struct SettingsApp { pages: page::Binder, search_active: bool, search_id: cosmic::widget::Id, + search_scroll_id: cosmic::iced::id::Id, search_input: String, search_selections: Vec<(page::Entity, section::Entity)>, context_title: Option, @@ -209,6 +210,7 @@ impl cosmic::Application for SettingsApp { pages: page::Binder::default(), search_active: false, search_id: cosmic::widget::Id::unique(), + search_scroll_id: cosmic::iced::id::Id::new("COSMIC_search_results_scrollable"), search_input: String::new(), search_selections: Vec::default(), context_title: None, @@ -1221,6 +1223,7 @@ impl SettingsApp { self.page_container(settings::view_column(sections)) .apply(scrollable) + .apply(|w| id_container(w, self.search_scroll_id.clone())) .into() } diff --git a/cosmic-settings/src/pages/bluetooth/mod.rs b/cosmic-settings/src/pages/bluetooth/mod.rs index 66319e4..12bb73f 100644 --- a/cosmic-settings/src/pages/bluetooth/mod.rs +++ b/cosmic-settings/src/pages/bluetooth/mod.rs @@ -37,6 +37,10 @@ enum Dialog { device: String, pincode: String, }, + RenameDevice { + path: OwnedObjectPath, + name: String, + }, } #[derive(Default)] @@ -353,6 +357,29 @@ impl page::Page for Page { Some(dialog) } + + Dialog::RenameDevice { name, .. } => { + let is_valid = is_valid_bluetooth_alias(name); + let input = widget::text_input("", name) + .on_input(|value| Message::RenameDeviceInput(value)) + .on_submit(|_| Message::RenameDeviceConfirm); + + let rename_button = widget::button::suggested(fl!("rename")) + .on_press_maybe(is_valid.then_some(Message::RenameDeviceConfirm)); + + let cancel_button = + widget::button::standard(fl!("cancel")).on_press(Message::RenameDeviceCancel); + + let dialog = widget::dialog() + .title(fl!("bluetooth-rename-device")) + .control(input) + .primary_action(rename_button) + .secondary_action(cancel_button) + .apply(Element::from) + .map(Into::into); + + Some(dialog) + } } } } @@ -369,6 +396,10 @@ pub enum Message { PinConfirm, PopupDevice(Option), PopupSetting(bool), + RenameDevice(OwnedObjectPath), + RenameDeviceInput(String), + RenameDeviceConfirm, + RenameDeviceCancel, SelectAdapter(Option), ServiceActivate, ServiceEnable, @@ -630,6 +661,10 @@ impl Page { _ => (), } } + + Event::DeviceRenameFailed(path) => { + tracing::warn!("Failed to rename device {path}"); + } }, Message::PinCancel => { @@ -836,6 +871,42 @@ impl Page { } } + Message::RenameDevice(path) => { + self.model.popup_device = None; + let name = self + .model + .devices + .get(&path) + .map_or_else(String::new, |d| d.alias_or_addr().to_owned()); + self.dialog = Some(Dialog::RenameDevice { path, name }); + } + + Message::RenameDeviceInput(new_name) => { + if let Some(Dialog::RenameDevice { name, .. }) = &mut self.dialog { + *name = new_name; + } + } + + Message::RenameDeviceCancel => { + if matches!(self.dialog, Some(Dialog::RenameDevice { .. })) { + self.dialog = None; + } + } + + Message::RenameDeviceConfirm => { + if let Some(Dialog::RenameDevice { path, name }) = self.dialog.take() { + if let Some(connection) = self.connection.clone() { + return cosmic::task::future(rename_device( + connection, + path, + name.trim().into(), + )); + } else { + tracing::warn!("No DBus connection ready"); + } + } + } + Message::ServiceActivate => { let activate_future = self.service_manager.activate(); return cosmic::task::future(async move { @@ -934,6 +1005,11 @@ fn status() -> Section { }) } +fn is_valid_bluetooth_alias(name: &str) -> bool { + let trimmed = name.trim(); + !trimmed.is_empty() && trimmed.len() <= 248 +} + fn popup_button(message: Option, text: &str) -> Element<'_, Message> { let spacing = theme::spacing(); widget::text::body(text) @@ -954,6 +1030,7 @@ fn connected_devices() -> Section { device_connect = fl!("bluetooth", "connect"); device_disconnect = fl!("bluetooth", "disconnect"); device_forget = fl!("bluetooth", "forget"); + device_rename = fl!("rename"); }); Section::default() @@ -991,13 +1068,17 @@ fn connected_devices() -> Section { .position(widget::popover::Position::Bottom) .on_close(Message::PopupDevice(None)) .popup( - widget::column::with_capacity(2) + widget::column::with_capacity(3) .push_maybe(device.is_connected().then(|| { popup_button( Some(Message::DisconnectDevice(path.clone())), &descriptions[device_disconnect], ) })) + .push(popup_button( + Some(Message::RenameDevice(path.clone())), + &descriptions[device_rename], + )) .push_maybe(device.paired.then(|| { popup_button( Some(Message::ForgetDevice(path.clone())), diff --git a/cosmic-settings/src/pages/display/arrangement.rs b/cosmic-settings/src/pages/display/arrangement.rs index 0f8fe89..d97cde8 100644 --- a/cosmic-settings/src/pages/display/arrangement.rs +++ b/cosmic-settings/src/pages/display/arrangement.rs @@ -197,6 +197,7 @@ impl Widget for Arrangement<'_ ); shell.capture_event(); + shell.request_redraw(); } } } diff --git a/cosmic-settings/src/pages/networking/backend.rs b/cosmic-settings/src/pages/networking/backend.rs index db0e3be..050d085 100644 --- a/cosmic-settings/src/pages/networking/backend.rs +++ b/cosmic-settings/src/pages/networking/backend.rs @@ -14,8 +14,8 @@ use nmrs::agent::{SecretAgent, SecretAgentFlags, SecretRequest, SecretResponder, use nmrs::raw::zbus; use nmrs::raw::zvariant::{Dict, OwnedObjectPath, OwnedValue, Str, Value}; use nmrs::{ - ActiveConnection, ConnectType, ConnectionOptions, EapOptions, NetworkEvent, NetworkManager, - SavedConnection, SettingsSummary, WifiKeyMgmt, WifiSecurity, + ActiveConnection, ConnectByUuidConfig, ConnectType, ConnectionOptions, EapOptions, + NetworkEvent, NetworkManager, SavedConnection, SettingsSummary, WifiKeyMgmt, WifiSecurity, }; use secure_string::SecureString; use tokio::sync::oneshot; @@ -620,7 +620,10 @@ async fn handle_request(nm: &NetworkManager, req: Request) -> Event { ) .await .is_ok(), - Request::ActivateVpn(uuid) => nm.connect_vpn_by_uuid(uuid).await.is_ok(), + Request::ActivateVpn(uuid) => nm + .connect_by_uuid(uuid, ConnectByUuidConfig::default()) + .await + .is_ok(), Request::Deactivate(uuid) => deactivate_by_uuid(nm, uuid).await.is_ok(), Request::Disconnect(ssid) => disconnect_wifi_by_ssid(nm, ssid).await.is_ok(), Request::Forget(ssid) => nm.forget(ssid).await.is_ok(), @@ -907,7 +910,7 @@ async fn disconnect_wifi_by_ssid(nm: &NetworkManager, ssid: &str) -> Result<(), } async fn deactivate_by_uuid(nm: &NetworkManager, uuid: &str) -> Result<(), Error> { - if nm.disconnect_vpn_by_uuid(uuid).await.is_ok() { + if nm.disconnect_by_uuid(uuid).await.is_ok() { return Ok(()); } diff --git a/cosmic-settings/src/pages/sound/applications.rs b/cosmic-settings/src/pages/sound/applications.rs index dbe69da..4796d6e 100644 --- a/cosmic-settings/src/pages/sound/applications.rs +++ b/cosmic-settings/src/pages/sound/applications.rs @@ -5,8 +5,7 @@ use super::model; use cosmic::desktop::{ DesktopEntryCache, DesktopLookupContext, DesktopResolveOptions, resolve_desktop_entry, }; -use cosmic::iced::futures; -use cosmic::iced::{self, Alignment, Length, window}; +use cosmic::iced::{self, Alignment, Length, futures, window}; use cosmic::widget::space::horizontal as horizontal_space; use cosmic::{Apply, Element, surface, widget}; use cosmic_config::{Config, ConfigGet}; diff --git a/i18n/da/cosmic_settings.ftl b/i18n/da/cosmic_settings.ftl index d51ae03..6009cc4 100644 --- a/i18n/da/cosmic_settings.ftl +++ b/i18n/da/cosmic_settings.ftl @@ -807,3 +807,38 @@ full-name = Fulde navn invalid-username = Ugyldigt brugernavn. password-mismatch = Adgangskode og bekræftelse skal være ens. save = Gem +xdg-entry-bluetooth-comment = Håndter Bluetoothenheder +xdg-entry-default-apps-comment = Standardwebbrowser, mailklient, filhåndtering og andre programmer +xdg-entry-appearance-keywords = COSMIC;Accent;Farve;Ikon;Skrifttype;Tema +xdg-entry-dock-keywords = COSMIC;Dock;Panel;Applet +xdg-entry-a11y = Tilgængelighed +xdg-entry-desktop-keywords = COSMIC;Skrivebord; +xdg-entry-displays-comment = Administrer skærmkonfigurationsindstillinger +xdg-entry-default-apps = Standardprogrammer +xdg-entry-applications-comment = Standardprogrammer, opstartsprogrammer og X11 program kompatibilitetsindstillinger +xdg-entry-about-keywords = COSMIC;Om +xdg-entry-a11y-keywords = COSMIC;Tilgængelighed;A11y;Skærm;Oplæser;Forstørrelse;Kontrast;Farve; +xdg-entry-desktop = Skrivebord +xdg-entry-date-time-keywords = COSMIC;Tid;Zone; +xdg-entry-keyboard = Tastatur +xdg-entry-a11y-comment = Skærmoplæsning, forstørrelse, høj kontrast og farvefiltre +xdg-entry-displays = Skærme +xdg-entry-date-time = Dato & tid +xdg-entry-input-comment = Tastatur- og museindstillinger +xdg-entry-bluetooth-keywords = COSMIC;Bluetooth; +xdg-entry-dock = Dock +xdg-entry-about-comment = Enhedsnavn, hardwareoplysninger og standardindstillinger for operativsystemet +xdg-entry-appearance-comment = Accentfarver og temaer +xdg-entry-input-keywords = COSMIC;Input;Tastatur;Mus;Mus; +xdg-entry-comment = Indstillingsprogram for COSMIC skrivebord +xdg-entry-applications = Applikationer +xdg-entry-default-apps-keywords = COSMIC;Standard;Program +xdg-entry-keywords = COSMIC;Indstillinger; +xdg-entry-about = Om +xdg-entry-input = Inputenheder +xdg-entry-applications-keywords = COSMIC;Standard;Program;Opstart;X11;Kompatibilitet +xdg-entry-appearance = Udseende +xdg-entry-displays-keywords = COSMIC;Skærm; +xdg-entry-date-time-comment = Tidszone, automatiske ur-indstillinger og tidsformat +xdg-entry-desktop-comment = Baggrund, udseende, panel, dock, vindueshåndtering og arbejdsområder +xdg-entry-dock-comment = En valgfri bjælke til apps og applets diff --git a/i18n/el/cosmic_settings.ftl b/i18n/el/cosmic_settings.ftl index 9aff722..eff3178 100644 --- a/i18n/el/cosmic_settings.ftl +++ b/i18n/el/cosmic_settings.ftl @@ -96,7 +96,7 @@ system-shortcut = Σύστημα .home-folder = Άνοιγμα προσωπικού φακέλου .keyboard-brightness-down = Μείωση φωτεινότητας πληκτρολογίου .keyboard-brightness-up = Αύξηση φωτεινότητας πληκτρολογίου - .launcher = Άνοιγμα εκκινητή + .launcher = Άνοιγμα γραμμής εκκίνησης .log-out = Αποσύνδεση .lock-screen = Κλείδωμα οθόνης .mute = Σίγαση εξόδου ήχου @@ -116,7 +116,7 @@ system-shortcut = Σύστημα .window-switcher-previous = Εναλλαγή μεταξύ των ανοικτών παραθύρων (αντίστροφα) .workspace-overview = Άνοιγμα επισκόπησης χώρων εργασίας super-key = Ενέργεια πλήκτρου Super - .launcher = Άνοιγμα μενού εκκίνησης + .launcher = Άνοιγμα γραμμής εκκίνησης .workspaces = Άνοιγμα χώρων εργασίας .applications = Άνοιγμα εφαρμογών .none = Καμία @@ -164,7 +164,7 @@ all-displays = Όλες οι οθόνες scheduling = Προγραμματισμός .manual = Χειροκίνητο πρόγραμμα frosted = Εφέ ημιδιαφανούς γυαλιού στο περιβάλλον συστήματος - .desc = Εφαρμόζει θόλωση του φόντου της γραμμής συστήματος, της μπάρας εφαρμογών, του μενού εκκίνησης και της βιβλιοθήκης εφαρμογών + .desc = Εφαρμόζει θόλωση του φόντου της γραμμής συστήματος, της μπάρας εφαρμογών, της γραμμής εκκίνησης και της βιβλιοθήκης εφαρμογών about-hardware = Υλικό .model = Μοντέλο υλικού .memory = Μνήμη @@ -227,6 +227,8 @@ accessibility = Προσβασιμότητα .high-contrast = Λειτουργία υψηλής αντίθεσης .invert-colors = Αναστροφή χρωμάτων .color-filters = Φίλτρα χρωμάτων + .shake-cursor = Ανακίνηση για εντοπισμό του κέρσορα + .shake-cursor-desc = Ανακινήστε γρήγορα το ποντίκι για να μεγεθυνθεί προσωρινά ο κέρσορας container-background = Φόντο πλαισίων .desc-detail = Το χρώμα φόντου πλαισίων χρησιμοποιείται για την πλαϊνή στήλη πλοήγησης, το πλευρικό συρτάρι, τα παράθυρα διαλόγων και παρόμοια γραφικά στοιχεία. Από προεπιλογή, το χρώμα φόντου πλαισίων προκύπτει αυτόματα από το φόντο των παραθύρων. .reset = Επαναφορά στο αυτόματο @@ -380,7 +382,7 @@ style = Στυλ .square = Τετράγωνο .frosted-glass = Ημιδιαφανές γυαλί .frosted-system-interface = Περιβάλλον συστήματος - .frosted-system-interface-desc = Εφαρμόζει το εφέ ημιδιαφανούς γυαλιού στο μενού εκκίνησης, τη βιβλιοθήκη εφαρμογών, την επισκόπηση χώρων εργασίας και τα στοιχεία ελέγχου στην οθόνη + .frosted-system-interface-desc = Εφαρμόζει το εφέ ημιδιαφανούς γυαλιού στη γραμμή εκκίνησης, τη βιβλιοθήκη εφαρμογών, την επισκόπηση χώρων εργασίας και τα στοιχεία ελέγχου στην οθόνη .frosted-windows = Παράθυρα .frosted-windows-desc = Εφαρμόζει το εφέ ημιδιαφανούς γυαλιού στα παράθυρα και τους διαλόγους .frosted-panels = Γραμμές συστήματος @@ -390,7 +392,7 @@ style = Στυλ .frosted-thickness = Βαθμός θολότητας .less = λίγο .more = πολύ - .glass-opacity = Διαφάνεια γυαλιού + .glass-opacity = Αδιαφάνεια γυαλιού panel-applets = Διαμόρφωση .dock-desc = Διαμόρφωση των μικροεφαρμογών της μπάρας εφαρμογών .desc = Διαμόρφωση των μικροεφαρμογών της γραμμής συστήματος @@ -653,7 +655,7 @@ color = Χρώμα .profile = Προφίλ χρωμάτων .sidebar = Προφίλ χρωμάτων .temperature = Θερμοκρασία χρωμάτων -hex = Δεκαεξαδικό +hex = 16αδικό magnifier = Μεγεθυντικός φακός .controls = Ή χρησιμοποιήστε αυτές τις συντομεύσεις: { $zoom_in -> @@ -694,7 +696,7 @@ sound-device-port-unplugged = Αποσυνδεδεμένο workspaces-overview = Επισκόπηση χώρων εργασίας .action-on-typing = Ενέργεια κατά την πληκτρολόγηση .none = Καμία - .launcher = Άνοιγμα μενού εκκίνησης + .launcher = Άνοιγμα γραμμής εκκίνησης .applications = Άνοιγμα εφαρμογών time-region = Περιοχή και γλώσσα power = Ενέργεια και μπαταρία diff --git a/i18n/en/cosmic_settings.ftl b/i18n/en/cosmic_settings.ftl index 32bff21..ed24379 100644 --- a/i18n/en/cosmic_settings.ftl +++ b/i18n/en/cosmic_settings.ftl @@ -233,6 +233,7 @@ online-accounts = Online accounts activate = Activate confirm = Confirm enable = Enable +rename = Rename bluetooth = Bluetooth .status = This system is visible as { $aliases } while Bluetooth settings are open. @@ -260,6 +261,8 @@ bluetooth-display-passkey = Bluetooth Pairing bluetooth-display-pin = Bluetooth Pairing .description = Please type the following PIN on { $device }, then press Enter +bluetooth-rename-device = Rename Device + bluetooth-available = Nearby devices bluetooth-adapters = Bluetooth adapters diff --git a/i18n/fil/cosmic_settings.ftl b/i18n/fil/cosmic_settings.ftl new file mode 100644 index 0000000..e69de29 diff --git a/i18n/hu/cosmic_settings.ftl b/i18n/hu/cosmic_settings.ftl index bb0f814..98a27d3 100644 --- a/i18n/hu/cosmic_settings.ftl +++ b/i18n/hu/cosmic_settings.ftl @@ -284,7 +284,7 @@ container-background = Felületi elemek háttere .desc = Navigációs oldalsávhoz, oldalsó menühöz, párbeszédablakhoz és hasonló modulokhoz használandó control-tint = Vezérlőelemek színezése .desc = Szabványos gombok hátterére, keresési bemenetekre, szövegbevitelre és hasonló összetevőkre használandó -frosted = Tejüveghatás a rendszerfelületen +frosted = Mattüveghatás a rendszerfelületen .desc = A háttér elmosását alkalmazza a panelre, a dokkra, a kisalkalmazásokra, az indítóra és az alkalmazáskönyvtárra enable-export = Jelenlegi téma alkalmazása a GNOME-alkalmazásokra .desc = Nem minden eszközkészlet támogatja az automatikus váltást. Előfordulhat, hogy a téma módosítása után újra kell indítani a nem COSMIC-alkalmazásokat. @@ -296,15 +296,15 @@ style = Stílus .round = Lekerekített .slightly-round = Enyhén lekerekített .square = Szögletes - .frosted-glass = Tejüveghatás + .frosted-glass = Mattüveghatás .frosted-system-interface = Rendszerfelület - .frosted-system-interface-desc = Tejüveghatás alkalmazása az Indítóra, az alkalmazáskönyvtárra, a munkaterület-áttekintőre és a képernyőn megjelenő vezérlőkre + .frosted-system-interface-desc = Mattüveghatás alkalmazása az Indítóra, az alkalmazáskönyvtárra, a munkaterület-áttekintőre és a képernyőn megjelenő vezérlőkre .frosted-windows = Ablakok - .frosted-windows-desc = Tejüveghatás alkalmazása az ablakokra és a párbeszédablakokra + .frosted-windows-desc = Mattüveghatás alkalmazása az ablakokra és a párbeszédablakokra .frosted-panels = Panelek - .frosted-panels-desc = Tejüveghatás alkalmazása a panelre és a dokkra + .frosted-panels-desc = Mattüveghatás alkalmazása a panelre és a dokkra .frosted-applets = Kisalkalmazások - .frosted-applets-desc = Tejüveghatás alkalmazása a panelen és a dokkon lévő kisalkalmazások menüire + .frosted-applets-desc = Mattüveghatás alkalmazása a panelen és a dokkon lévő kisalkalmazások menüire .frosted-thickness = Homályosítás mértéke .less = kevesebb .more = több diff --git a/i18n/kmr/cosmic_settings.ftl b/i18n/kmr/cosmic_settings.ftl index 671252e..7878207 100644 --- a/i18n/kmr/cosmic_settings.ftl +++ b/i18n/kmr/cosmic_settings.ftl @@ -249,7 +249,7 @@ hearing = Guhdarîkirin preferred-languages = Zimanên bijarte .desc = Rêza zimanan diyar dike ka kîjan ziman ji bo navrûya bikarhêner tê bikaranîn. Guhertin di têketina din de dikevin bandorê. sound-hd-audio = Dengê HD -network-and-wireless = Tor & Bêtêlî +network-and-wireless = Tor panel-style = Şêwaz .anchor-gap = Valahiya di navbera destgeh û qeraxên dîmenderê de .dock-anchor-gap = Valahiya di navbera bender û qeraxên dîmenderê de @@ -742,7 +742,7 @@ xdg-entry-wallpaper = Wêneya dîwêr xdg-entry-keyboard = Kilîtdank xdg-entry-a11y-comment = Xwînerê dîmenderê, mezinker, berevajiya bilind, û parzûnên rengan xdg-entry-displays = Dîmender -xdg-entry-network = Tor & Bêtêlî +xdg-entry-network = Tor sound = Deng xdg-entry-date-time = Dîrok & Dem notifications = Agahdarî diff --git a/i18n/nl/cosmic_settings.ftl b/i18n/nl/cosmic_settings.ftl index 8c3edfc..9514256 100644 --- a/i18n/nl/cosmic_settings.ftl +++ b/i18n/nl/cosmic_settings.ftl @@ -499,14 +499,14 @@ battery = Batterij } connected-devices = Verbonden apparaten .unknown = Onbekend apparaat -power-mode = Energieverbruik +power-mode = Prestaties en energieverbruik .battery = Energiebesparing - .battery-desc = Verminderd energieverbruik en stille prestaties. + .battery-desc = Verminderde prestaties en lager energieverbruik. .balanced = Gebalanceerd - .balanced-desc = Normale prestaties en batterieverbruik. - .performance = Hoge Prestatie - .performance-desc = Hoge prestatie en energieverbruik. - .no-backend = Backend niet gevonden. Installeer system76-power of power-profiles-daemon. + .balanced-desc = Normale prestaties en matig energieverbruik. + .performance = Krachtige prestaties + .performance-desc = Maximale prestaties en hoger energieverbruik. + .no-backend = Backend niet gevonden. Installeer "system76-power" of "power-profiles-daemon". power-saving = Energiebesparingsopties .turn-off-screen-after = Beeldscherm uitschakelen na .auto-suspend = Automatische slaapstand @@ -739,11 +739,11 @@ time-date = Datum en tijd time-zone = Tijdzone .auto = Tijdzone automatisch bepalen .auto-info = Vereist locatiebepaling en internettoegang -time-format = Datum- en tijdweergave - .twenty-four = 24-uurs tijd - .show-seconds = Laat seconden zien +time-format = Datum- en tijdnotatie + .twenty-four = 24‑uursnotatie + .show-seconds = Seconden weergeven .first = De week begint op - .show-date = Datum weergeven op het paneel boven + .show-date = Datum weergeven op het paneel .friday = Vrijdag .saturday = Zaterdag .sunday = Zondag diff --git a/subscriptions/bluetooth/src/device.rs b/subscriptions/bluetooth/src/device.rs index 2ba1854..6e4b21b 100644 --- a/subscriptions/bluetooth/src/device.rs +++ b/subscriptions/bluetooth/src/device.rs @@ -32,7 +32,7 @@ fn device_type_to_icon(device_type: &str) -> &'static str { #[derive(Default, Debug, Clone)] pub struct Device { - alias: Option, + pub alias: Option, pub address: String, pub adapter: OwnedObjectPath, pub enabled: Active, @@ -46,7 +46,7 @@ impl Device { let (address, adapter, alias) = join!( proxy.device.address(), proxy.device.adapter(), - proxy.device.name() + proxy.device.alias() ); let address = address?; if address.is_empty() { @@ -56,7 +56,10 @@ impl Device { if adapter.is_empty() { return Err(zbus::Error::Failure("Device has no adapter".to_owned())); } - let alias = alias.ok(); + let alias = match alias { + Ok(alias) if !alias.is_empty() && alias != address.replace(':', "-") => Some(alias), + _ => proxy.device.name().await.ok(), + }; let device_type: String = proxy.icon().await; let paired = proxy.device.paired().await.unwrap_or(false); let enabled = if proxy.device.connected().await.unwrap_or(false) { @@ -309,6 +312,33 @@ pub async fn forget_device(connection: zbus::Connection, device_path: OwnedObjec } } +pub async fn rename_device( + connection: zbus::Connection, + device_path: OwnedObjectPath, + name: String, +) -> Event { + let proxy = match bluez_zbus::get_device(&connection, device_path.clone()).await { + Err(why) => { + tracing::error!("Unable to get the device: {why}"); + return Event::DeviceFailed(device_path); + } + Ok(proxy) => proxy, + }; + + for attempt in 1..5 { + let result = proxy.device.set_alias(&name).await; + + if let Err(why) = result { + tracing::warn!("Unable to rename device: {why}"); + tokio::time::sleep(Duration::from_millis(1000 * attempt)).await; + } else { + return Event::Ok; + } + } + + Event::DeviceRenameFailed(device_path) +} + pub async fn get_devices(connection: zbus::Connection, adapter_path: OwnedObjectPath) -> Event { // TODO error handling let result: zbus::Result> = async { diff --git a/subscriptions/bluetooth/src/lib.rs b/subscriptions/bluetooth/src/lib.rs index f4263ac..e6f0636 100644 --- a/subscriptions/bluetooth/src/lib.rs +++ b/subscriptions/bluetooth/src/lib.rs @@ -21,6 +21,7 @@ pub enum Event { DBusError(zbus::Error), DBusServiceUnknown, DeviceFailed(OwnedObjectPath), + DeviceRenameFailed(OwnedObjectPath), Ok, NameHasNoOwner, RemovedAdapter(OwnedObjectPath),