mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Version bump. Add early-error display
This commit is contained in:
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- `rog-control-center` has now been moved in to the main workspace due to
|
||||
the heavy dependencies on most of the rog crates
|
||||
- Preliminary support of TUF RGB keyboards + power states
|
||||
- Support for G713RW LED modes (Author: jarvis2709)
|
||||
- Support for G713IC LED modes
|
||||
### Changed
|
||||
- The udev rules have been changed to make asusd load with all gamer variants when asus-nb-wmi is loaded
|
||||
- TUF, ROG, Zephyrus, Strix
|
||||
|
||||
## [4.3.0] - 2022-07-21
|
||||
### Added
|
||||
|
||||
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -89,7 +89,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusctl"
|
||||
version = "4.3.0"
|
||||
version = "4.3.3"
|
||||
dependencies = [
|
||||
"daemon",
|
||||
"gif",
|
||||
@@ -542,7 +542,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
|
||||
|
||||
[[package]]
|
||||
name = "daemon"
|
||||
version = "4.3.2"
|
||||
version = "4.3.3"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"env_logger",
|
||||
@@ -1953,7 +1953,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog-control-center"
|
||||
version = "0.1.4"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"dirs 3.0.2",
|
||||
"eframe",
|
||||
@@ -1992,7 +1992,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_aura"
|
||||
version = "1.2.1"
|
||||
version = "1.2.2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "asusctl"
|
||||
version = "4.3.0"
|
||||
version = "4.3.3"
|
||||
authors = ["Luke D Jones <luke@ljones.dev>"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "daemon"
|
||||
version = "4.3.2"
|
||||
version = "4.3.3"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
authors = ["Luke <luke@ljones.dev>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rog_aura"
|
||||
version = "1.2.1"
|
||||
version = "1.2.2"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
authors = ["Luke <luke@ljones.dev>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rog-control-center"
|
||||
version = "0.1.4"
|
||||
version = "1.0.0"
|
||||
authors = ["Luke D. Jones <luke@ljones.dev>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ pub mod mocking;
|
||||
pub mod notify;
|
||||
pub mod page_states;
|
||||
pub mod pages;
|
||||
pub mod startup_error;
|
||||
pub mod widgets;
|
||||
|
||||
#[cfg(feature = "mocking")]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use rog_aura::layouts::KeyLayout;
|
||||
use rog_control_center::{
|
||||
config::Config, get_ipc_file, notify::start_notifications, on_tmp_dir_exists,
|
||||
page_states::PageDataStates, RogApp, RogDbusClientBlocking, SHOW_GUI,
|
||||
page_states::PageDataStates, startup_error::AppErrorShow, RogApp, RogDbusClientBlocking,
|
||||
SHOW_GUI,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@@ -23,6 +24,24 @@ const DATA_DIR: &str = env!("CARGO_MANIFEST_DIR");
|
||||
const BOARD_NAME: &str = "/sys/class/dmi/id/board_name";
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let native_options = eframe::NativeOptions {
|
||||
decorated: false,
|
||||
transparent: false,
|
||||
min_window_size: Some(egui::vec2(840.0, 600.0)),
|
||||
max_window_size: Some(egui::vec2(840.0, 600.0)),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let (dbus, _) = RogDbusClientBlocking::new()
|
||||
.map_err(|e| {
|
||||
eframe::run_native(
|
||||
"ROG Control Center",
|
||||
native_options.clone(),
|
||||
Box::new(move |_| Box::new(AppErrorShow::new(e.to_string()))),
|
||||
);
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
// Startup
|
||||
let mut config = Config::load()?;
|
||||
let start_closed = config.startup_in_background;
|
||||
@@ -76,8 +95,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let notifs_enabled = Arc::new(AtomicBool::new(config.enable_notifications));
|
||||
|
||||
let states = {
|
||||
let (dbus, _) = RogDbusClientBlocking::new()?;
|
||||
let supported = dbus.proxies().supported().supported_functions().unwrap();
|
||||
let supported = dbus
|
||||
.proxies()
|
||||
.supported()
|
||||
.supported_functions()
|
||||
.map_err(|e| {
|
||||
eframe::run_native(
|
||||
"ROG Control Center",
|
||||
native_options.clone(),
|
||||
Box::new(move |_| Box::new(AppErrorShow::new(e.to_string()))),
|
||||
);
|
||||
})
|
||||
.unwrap();
|
||||
PageDataStates::new(
|
||||
layout,
|
||||
notifs_enabled.clone(),
|
||||
@@ -114,14 +143,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
Err(_) => on_tmp_dir_exists().unwrap(),
|
||||
};
|
||||
|
||||
let native_options = eframe::NativeOptions {
|
||||
decorated: false,
|
||||
transparent: false,
|
||||
min_window_size: Some(egui::vec2(840.0, 600.0)),
|
||||
max_window_size: Some(egui::vec2(840.0, 600.0)),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let should_show_gui = Arc::new(AtomicBool::new(!start_closed));
|
||||
let should = should_show_gui.clone();
|
||||
spawn(move || {
|
||||
|
||||
@@ -18,7 +18,7 @@ impl<'a> RogApp<'a> {
|
||||
egui::ScrollArea::vertical().show(ui, |ui| {
|
||||
ui.spacing_mut().item_spacing = egui::vec2(8.0, 10.0);
|
||||
let rect = ui.available_rect_before_wrap();
|
||||
egui::Grid::new("id_source")
|
||||
egui::Grid::new("grid_of_bits")
|
||||
.min_col_width(rect.width() / 2.0)
|
||||
.show(ui, |ui| {
|
||||
ui.vertical(|ui| {
|
||||
|
||||
36
rog-control-center/src/startup_error.rs
Normal file
36
rog-control-center/src/startup_error.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use egui::{Button, RichText};
|
||||
|
||||
pub struct AppErrorShow {
|
||||
error: String,
|
||||
}
|
||||
|
||||
impl AppErrorShow {
|
||||
pub fn new(error: String) -> Self {
|
||||
Self { error }
|
||||
}
|
||||
}
|
||||
|
||||
impl eframe::App for AppErrorShow {
|
||||
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ui.heading("ROG ERROR");
|
||||
|
||||
ui.centered_and_justified(|ui| {
|
||||
ui.label(RichText::new(format!("The error was: {:?}", self.error)).size(22.0));
|
||||
});
|
||||
|
||||
egui::TopBottomPanel::bottom("error_bar_2")
|
||||
.default_height(26.0)
|
||||
.show(ctx, |ui| {
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
|
||||
if ui
|
||||
.add(Button::new(RichText::new("Okay").size(20.0)))
|
||||
.clicked()
|
||||
{
|
||||
frame.quit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ pub fn fan_graphs(
|
||||
let line = Line::new(PlotPoints::from_iter(points.clone())).width(2.0);
|
||||
let points = Points::new(PlotPoints::from_iter(points)).radius(3.0);
|
||||
|
||||
Plot::new("my_plot")
|
||||
Plot::new("fan_curves")
|
||||
.view_aspect(1.666)
|
||||
// .center_x_axis(true)
|
||||
// .center_y_axis(true)
|
||||
|
||||
Reference in New Issue
Block a user