mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13ce881429 | |||
| 61d8ba2c79 |
@@ -7,8 +7,6 @@
|
|||||||
- Improve firmware attributes handling
|
- Improve firmware attributes handling
|
||||||
- Very good looking UI restyling from @shevchenko0013
|
- Very good looking UI restyling from @shevchenko0013
|
||||||
- Added support for GA402NV matrix: thanks @Ghoul4500
|
- Added support for GA402NV matrix: thanks @Ghoul4500
|
||||||
- Fixed aura CLI interface
|
|
||||||
- Fixed LEDs handling in rogcc
|
|
||||||
|
|
||||||
## [6.3.1]
|
## [6.3.1]
|
||||||
|
|
||||||
|
|||||||
@@ -359,6 +359,15 @@
|
|||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar, Logo],
|
power_zones: [Keyboard, Lightbar, Logo],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "G835L",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "g835l-per-key",
|
||||||
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: PerKey,
|
||||||
|
power_zones: [Keyboard, Lightbar, Logo],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "G712LI",
|
device_name: "G712LI",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
@@ -575,15 +584,6 @@
|
|||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
||||||
),
|
),
|
||||||
(
|
|
||||||
device_name: "G835L",
|
|
||||||
product_id: "",
|
|
||||||
layout_name: "g814ji-per-key",
|
|
||||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
|
||||||
basic_zones: [],
|
|
||||||
advanced_type: PerKey,
|
|
||||||
power_zones: [Keyboard, Lightbar, Logo],
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
device_name: "GA401I",
|
device_name: "GA401I",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
|
|||||||
@@ -3,11 +3,7 @@ pub mod setup_aura;
|
|||||||
pub mod setup_fans;
|
pub mod setup_fans;
|
||||||
pub mod setup_system;
|
pub mod setup_system;
|
||||||
|
|
||||||
use std::sync::atomic::{AtomicU64, Ordering};
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
static TOAST_SEQ: AtomicU64 = AtomicU64::new(0);
|
|
||||||
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
@@ -74,45 +70,15 @@ pub fn show_toast(
|
|||||||
handle: Weak<MainWindow>,
|
handle: Weak<MainWindow>,
|
||||||
result: zbus::Result<()>,
|
result: zbus::Result<()>,
|
||||||
) {
|
) {
|
||||||
// bump sequence so that any previously spawned timers won't clear newer toasts
|
|
||||||
let seq = TOAST_SEQ.fetch_add(1, Ordering::SeqCst) + 1;
|
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
let delayed_handle = handle.clone();
|
slint::invoke_from_event_loop(move || handle.unwrap().invoke_show_toast(success)).ok()
|
||||||
let delayed_text = success.clone();
|
|
||||||
slint::invoke_from_event_loop(move || handle.unwrap().invoke_show_toast(success)).ok();
|
|
||||||
tokio::spawn(async move {
|
|
||||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
|
||||||
if TOAST_SEQ.load(Ordering::SeqCst) == seq {
|
|
||||||
slint::invoke_from_event_loop(move || {
|
|
||||||
delayed_handle
|
|
||||||
.unwrap()
|
|
||||||
.invoke_clear_toast_if_matches(delayed_text)
|
|
||||||
})
|
|
||||||
.ok();
|
|
||||||
}
|
}
|
||||||
});
|
Err(e) => slint::invoke_from_event_loop(move || {
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
let delayed_handle = handle.clone();
|
|
||||||
let delayed_text = fail.clone();
|
|
||||||
slint::invoke_from_event_loop(move || {
|
|
||||||
log::warn!("{fail}: {e}");
|
log::warn!("{fail}: {e}");
|
||||||
handle.unwrap().invoke_show_toast(fail)
|
handle.unwrap().invoke_show_toast(fail)
|
||||||
})
|
})
|
||||||
.ok();
|
.ok(),
|
||||||
tokio::spawn(async move {
|
|
||||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
|
||||||
if TOAST_SEQ.load(Ordering::SeqCst) == seq {
|
|
||||||
slint::invoke_from_event_loop(move || {
|
|
||||||
delayed_handle
|
|
||||||
.unwrap()
|
|
||||||
.invoke_clear_toast_if_matches(delayed_text)
|
|
||||||
})
|
|
||||||
.ok();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,6 @@ export component MainWindow inherits Window {
|
|||||||
toast = text != "";
|
toast = text != "";
|
||||||
toast_text = text;
|
toast_text = text;
|
||||||
}
|
}
|
||||||
callback clear_toast_if_matches(string);
|
|
||||||
clear_toast_if_matches(text) => {
|
|
||||||
if (toast && toast_text == text) {
|
|
||||||
toast = false;
|
|
||||||
toast_text = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
callback exit-app();
|
callback exit-app();
|
||||||
callback show_notification(bool);
|
callback show_notification(bool);
|
||||||
show_notification(yes) => {
|
show_notification(yes) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user