mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-12 08:28:32 +02:00
chore: Prelease
This commit is contained in:
parent
83d31000eb
commit
42477b9b02
|
@ -5,8 +5,8 @@ edition = "2021"
|
||||||
description = "A wip universal Linux settings application."
|
description = "A wip universal Linux settings application."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reset_daemon = "0.4.6"
|
reset_daemon = "0.4.9"
|
||||||
re_set-lib = { git = "https://github.com/Xetibo/ReSet-Lib", branch = "main" }
|
re_set-lib = "0.7.9"
|
||||||
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] }
|
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] }
|
||||||
dbus = "0.9.7"
|
dbus = "0.9.7"
|
||||||
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] }
|
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] }
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub struct BluetoothEntry {
|
||||||
pub remove_device_button: RefCell<Button>,
|
pub remove_device_button: RefCell<Button>,
|
||||||
pub connecting_label: RefCell<Label>,
|
pub connecting_label: RefCell<Label>,
|
||||||
pub device_name: RefCell<String>,
|
pub device_name: RefCell<String>,
|
||||||
pub bluetooth_device: RefCell<BluetoothDevice>
|
pub bluetooth_device: RefCell<BluetoothDevice>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
pub mod audio_box;
|
||||||
pub mod input_stream_entry;
|
pub mod input_stream_entry;
|
||||||
pub mod input_stream_entry_impl;
|
pub mod input_stream_entry_impl;
|
||||||
pub mod sink_box;
|
pub mod sink_box;
|
||||||
pub mod sink_box_impl;
|
pub mod sink_box_impl;
|
||||||
pub mod sink_entry;
|
pub mod sink_entry;
|
||||||
pub mod sink_entry_impl;
|
pub mod sink_entry_impl;
|
||||||
pub mod audio_box;
|
|
||||||
|
|
|
@ -2,18 +2,18 @@ use std::rc::Rc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::components::wifi::saved_wifi_entry_impl;
|
use crate::components::wifi::saved_wifi_entry_impl;
|
||||||
|
use crate::components::wifi::utils::get_connection_settings;
|
||||||
use crate::components::wifi::wifi_box_impl::WifiBox;
|
use crate::components::wifi::wifi_box_impl::WifiBox;
|
||||||
|
use crate::components::wifi::wifi_options::WifiOptions;
|
||||||
use adw::glib;
|
use adw::glib;
|
||||||
use adw::glib::Object;
|
use adw::glib::Object;
|
||||||
use adw::prelude::{ActionRowExt, ButtonExt, PreferencesRowExt, PreferencesGroupExt};
|
use adw::prelude::{ActionRowExt, ButtonExt, PreferencesGroupExt, PreferencesRowExt};
|
||||||
use dbus::blocking::Connection;
|
use dbus::blocking::Connection;
|
||||||
use dbus::{Error, Path};
|
use dbus::{Error, Path};
|
||||||
use glib::subclass::types::ObjectSubclassIsExt;
|
use glib::subclass::types::ObjectSubclassIsExt;
|
||||||
use glib::{clone, PropertySet};
|
use glib::{clone, PropertySet};
|
||||||
use gtk::{Align, Button, gio, Orientation};
|
|
||||||
use gtk::prelude::{BoxExt, ListBoxRowExt};
|
use gtk::prelude::{BoxExt, ListBoxRowExt};
|
||||||
use crate::components::wifi::utils::get_connection_settings;
|
use gtk::{gio, Align, Button, Orientation};
|
||||||
use crate::components::wifi::wifi_options::WifiOptions;
|
|
||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
pub struct SavedWifiEntry(ObjectSubclass<saved_wifi_entry_impl::SavedWifiEntry>)
|
pub struct SavedWifiEntry(ObjectSubclass<saved_wifi_entry_impl::SavedWifiEntry>)
|
||||||
|
|
|
@ -10,7 +10,7 @@ use adw::prelude::PreferencesRowExt;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use glib::subclass::prelude::ObjectSubclassIsExt;
|
use glib::subclass::prelude::ObjectSubclassIsExt;
|
||||||
use gtk::prelude::{ButtonExt, EditableExt, WidgetExt};
|
use gtk::prelude::{ButtonExt, EditableExt, WidgetExt};
|
||||||
use re_set_lib::network::connection::{Connection};
|
use re_set_lib::network::connection::Connection;
|
||||||
|
|
||||||
use crate::components::wifi::utils::IpProtocol;
|
use crate::components::wifi::utils::IpProtocol;
|
||||||
use crate::components::wifi::wifi_address_entry_impl;
|
use crate::components::wifi::wifi_address_entry_impl;
|
||||||
|
|
|
@ -17,7 +17,7 @@ use dbus::Path;
|
||||||
use glib::{clone, Cast, PropertySet};
|
use glib::{clone, Cast, PropertySet};
|
||||||
use gtk::glib::Variant;
|
use gtk::glib::Variant;
|
||||||
use gtk::prelude::{ActionableExt, WidgetExt};
|
use gtk::prelude::{ActionableExt, WidgetExt};
|
||||||
use gtk::{gio, StringObject, StringList};
|
use gtk::{gio, StringList, StringObject};
|
||||||
use re_set_lib::network::network_structures::{AccessPoint, WifiDevice, WifiStrength};
|
use re_set_lib::network::network_structures::{AccessPoint, WifiDevice, WifiStrength};
|
||||||
use re_set_lib::signals::{AccessPointAdded, WifiDeviceChanged};
|
use re_set_lib::signals::{AccessPointAdded, WifiDeviceChanged};
|
||||||
use re_set_lib::signals::{AccessPointChanged, AccessPointRemoved};
|
use re_set_lib::signals::{AccessPointChanged, AccessPointRemoved};
|
||||||
|
@ -394,12 +394,18 @@ pub fn start_event_listener(listeners: Arc<Listeners>, wifi_box: Arc<WifiBox>) {
|
||||||
WifiStrength::None => Some("network-wireless-signal-none-symbolic"),
|
WifiStrength::None => Some("network-wireless-signal-none-symbolic"),
|
||||||
});
|
});
|
||||||
if !ir.access_point.stored {
|
if !ir.access_point.stored {
|
||||||
entry_imp.reset_wifi_edit_button.borrow().set_sensitive(false);
|
entry_imp
|
||||||
|
.reset_wifi_edit_button
|
||||||
|
.borrow()
|
||||||
|
.set_sensitive(false);
|
||||||
}
|
}
|
||||||
if ir.access_point.dbus_path
|
if ir.access_point.dbus_path
|
||||||
== imp.reset_current_wifi_device.borrow().active_access_point
|
== imp.reset_current_wifi_device.borrow().active_access_point
|
||||||
{
|
{
|
||||||
entry_imp.reset_wifi_connected.borrow().set_text("Connected");
|
entry_imp
|
||||||
|
.reset_wifi_connected
|
||||||
|
.borrow()
|
||||||
|
.set_text("Connected");
|
||||||
} else {
|
} else {
|
||||||
entry_imp.reset_wifi_connected.borrow().set_text("");
|
entry_imp.reset_wifi_connected.borrow().set_text("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||||
use dbus::blocking::Connection;
|
use dbus::blocking::Connection;
|
||||||
use dbus::Error;
|
use dbus::Error;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::{Align, Button, gio, Image, Orientation};
|
|
||||||
use gtk::prelude::{BoxExt, ListBoxRowExt, WidgetExt};
|
use gtk::prelude::{BoxExt, ListBoxRowExt, WidgetExt};
|
||||||
|
use gtk::{gio, Align, Button, Image, Orientation};
|
||||||
use re_set_lib::network::network_structures::{AccessPoint, WifiStrength};
|
use re_set_lib::network::network_structures::{AccessPoint, WifiStrength};
|
||||||
|
|
||||||
use crate::components::wifi::wifi_box_impl::WifiBox;
|
use crate::components::wifi::wifi_box_impl::WifiBox;
|
||||||
|
@ -40,27 +40,33 @@ impl WifiEntry {
|
||||||
entry_imp.wifi_strength.set(strength);
|
entry_imp.wifi_strength.set(strength);
|
||||||
entry.set_title(name);
|
entry.set_title(name);
|
||||||
entry_imp.connected.set(connected);
|
entry_imp.connected.set(connected);
|
||||||
entry_imp.reset_wifi_edit_button.replace(Button::builder()
|
entry_imp.reset_wifi_edit_button.replace(
|
||||||
.icon_name("document-edit-symbolic")
|
Button::builder()
|
||||||
.valign(Align::Center)
|
.icon_name("document-edit-symbolic")
|
||||||
.build());
|
.valign(Align::Center)
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
|
|
||||||
// TODO handle encryption thing
|
// TODO handle encryption thing
|
||||||
let wifi_strength = Image::builder().icon_name(match strength {
|
let wifi_strength = Image::builder()
|
||||||
WifiStrength::Excellent => "network-wireless-signal-excellent-symbolic",
|
.icon_name(match strength {
|
||||||
WifiStrength::Ok => "network-wireless-signal-ok-symbolic",
|
WifiStrength::Excellent => "network-wireless-signal-excellent-symbolic",
|
||||||
WifiStrength::Weak => "network-wireless-signal-weak-symbolic",
|
WifiStrength::Ok => "network-wireless-signal-ok-symbolic",
|
||||||
WifiStrength::None => "network-wireless-signal-none-symbolic",
|
WifiStrength::Weak => "network-wireless-signal-weak-symbolic",
|
||||||
}).build();
|
WifiStrength::None => "network-wireless-signal-none-symbolic",
|
||||||
|
})
|
||||||
|
.build();
|
||||||
|
|
||||||
let prefix_box = gtk::Box::new(Orientation::Horizontal, 0);
|
let prefix_box = gtk::Box::new(Orientation::Horizontal, 0);
|
||||||
prefix_box.append(&wifi_strength);
|
prefix_box.append(&wifi_strength);
|
||||||
prefix_box.append(&Image::builder()
|
prefix_box.append(
|
||||||
.icon_name("system-lock-screen-symbolic")
|
&Image::builder()
|
||||||
.valign(Align::End)
|
.icon_name("system-lock-screen-symbolic")
|
||||||
.pixel_size(9)
|
.valign(Align::End)
|
||||||
.margin_bottom(12)
|
.pixel_size(9)
|
||||||
.build());
|
.margin_bottom(12)
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
entry.add_prefix(&prefix_box);
|
entry.add_prefix(&prefix_box);
|
||||||
|
|
||||||
let suffix_box = gtk::Box::new(Orientation::Horizontal, 5);
|
let suffix_box = gtk::Box::new(Orientation::Horizontal, 5);
|
||||||
|
@ -69,10 +75,16 @@ impl WifiEntry {
|
||||||
entry.add_suffix(&suffix_box);
|
entry.add_suffix(&suffix_box);
|
||||||
|
|
||||||
if !access_point.stored {
|
if !access_point.stored {
|
||||||
entry_imp.reset_wifi_edit_button.borrow().set_sensitive(false);
|
entry_imp
|
||||||
|
.reset_wifi_edit_button
|
||||||
|
.borrow()
|
||||||
|
.set_sensitive(false);
|
||||||
}
|
}
|
||||||
if connected {
|
if connected {
|
||||||
entry_imp.reset_wifi_connected.borrow().set_text("Connected");
|
entry_imp
|
||||||
|
.reset_wifi_connected
|
||||||
|
.borrow()
|
||||||
|
.set_text("Connected");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let mut wifi_name = entry_imp.wifi_name.borrow_mut();
|
let mut wifi_name = entry_imp.wifi_name.borrow_mut();
|
||||||
|
|
|
@ -4,15 +4,17 @@ use std::str::FromStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use adw::{gio, glib};
|
|
||||||
use adw::glib::Object;
|
use adw::glib::Object;
|
||||||
use adw::prelude::{ActionRowExt, ComboRowExt, PreferencesGroupExt};
|
use adw::prelude::{ActionRowExt, ComboRowExt, PreferencesGroupExt};
|
||||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||||
use dbus::{Error, Path};
|
use adw::{gio, glib};
|
||||||
use dbus::arg::PropMap;
|
use dbus::arg::PropMap;
|
||||||
|
use dbus::{Error, Path};
|
||||||
use glib::{clone, PropertySet};
|
use glib::{clone, PropertySet};
|
||||||
use gtk::prelude::{ActionableExt, ButtonExt, EditableExt, ListBoxRowExt, WidgetExt};
|
use gtk::prelude::{ActionableExt, ButtonExt, EditableExt, ListBoxRowExt, WidgetExt};
|
||||||
use re_set_lib::network::connection::{Connection, DNSMethod4, DNSMethod6, Enum, KeyManagement, TypeSettings};
|
use re_set_lib::network::connection::{
|
||||||
|
Connection, DNSMethod4, DNSMethod6, Enum, KeyManagement, TypeSettings,
|
||||||
|
};
|
||||||
|
|
||||||
use IpProtocol::{IPv4, IPv6};
|
use IpProtocol::{IPv4, IPv6};
|
||||||
|
|
||||||
|
@ -51,7 +53,6 @@ impl WifiOptions {
|
||||||
ip4_route_length = conn.ipv4.route_data.len();
|
ip4_route_length = conn.ipv4.route_data.len();
|
||||||
ip6_address_length = conn.ipv4.address_data.len();
|
ip6_address_length = conn.ipv4.address_data.len();
|
||||||
ip6_route_length = conn.ipv4.route_data.len();
|
ip6_route_length = conn.ipv4.route_data.len();
|
||||||
// dbg!(&conn);
|
|
||||||
// General
|
// General
|
||||||
self_imp
|
self_imp
|
||||||
.reset_wifi_auto_connect
|
.reset_wifi_auto_connect
|
||||||
|
@ -104,10 +105,13 @@ impl WifiOptions {
|
||||||
.map(|addr| Ipv4Addr::from(*addr))
|
.map(|addr| Ipv4Addr::from(*addr))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
self_imp.reset_ip4_dns.set_text(&ipv4_dns.iter()
|
self_imp.reset_ip4_dns.set_text(
|
||||||
.map(|ip| ip.to_string())
|
&ipv4_dns
|
||||||
.collect::<Vec<String>>()
|
.iter()
|
||||||
.join(", "));
|
.map(|ip| ip.to_string())
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
.join(", "),
|
||||||
|
);
|
||||||
self_imp.reset_ip4_gateway.set_text(&conn.ipv4.gateway);
|
self_imp.reset_ip4_gateway.set_text(&conn.ipv4.gateway);
|
||||||
// IPv6
|
// IPv6
|
||||||
self_imp
|
self_imp
|
||||||
|
@ -132,7 +136,7 @@ impl WifiOptions {
|
||||||
|
|
||||||
// Security
|
// Security
|
||||||
|
|
||||||
match &conn.security.key_management {
|
match &conn.security.key_management {
|
||||||
KeyManagement::NONE => {
|
KeyManagement::NONE => {
|
||||||
self_imp.reset_wifi_security_dropdown.set_selected(0);
|
self_imp.reset_wifi_security_dropdown.set_selected(0);
|
||||||
self_imp.reset_wifi_password.set_visible(false);
|
self_imp.reset_wifi_password.set_visible(false);
|
||||||
|
@ -141,9 +145,7 @@ impl WifiOptions {
|
||||||
KeyManagement::WPAPSK => {
|
KeyManagement::WPAPSK => {
|
||||||
self_imp.reset_wifi_security_dropdown.set_selected(1);
|
self_imp.reset_wifi_security_dropdown.set_selected(1);
|
||||||
self_imp.reset_wifi_password.set_visible(true);
|
self_imp.reset_wifi_password.set_visible(true);
|
||||||
self_imp
|
self_imp.reset_wifi_password.set_text(&conn.security.psk);
|
||||||
.reset_wifi_password
|
|
||||||
.set_text(&conn.security.psk);
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +244,6 @@ fn setup_callbacks(wifi_options: &Arc<WifiOptions>, path: Path<'static>) {
|
||||||
imp.wifi_options_apply_button
|
imp.wifi_options_apply_button
|
||||||
.connect_clicked(clone!(@weak imp => move |_| {
|
.connect_clicked(clone!(@weak imp => move |_| {
|
||||||
let prop = imp.connection.borrow().convert_to_propmap();
|
let prop = imp.connection.borrow().convert_to_propmap();
|
||||||
dbg!(&prop);
|
|
||||||
set_connection_settings(path.clone(), prop);
|
set_connection_settings(path.clone(), prop);
|
||||||
}));
|
}));
|
||||||
// IPv4
|
// IPv4
|
||||||
|
@ -367,16 +368,17 @@ fn setup_callbacks(wifi_options: &Arc<WifiOptions>, path: Path<'static>) {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
imp.reset_wifi_password.connect_changed(clone!(@weak imp => move |entry| {
|
imp.reset_wifi_password
|
||||||
let password_input = entry.text();
|
.connect_changed(clone!(@weak imp => move |entry| {
|
||||||
if password_input.len() < 8 && !password_input.is_empty() {
|
let password_input = entry.text();
|
||||||
entry.add_css_class("error");
|
if password_input.len() < 8 && !password_input.is_empty() {
|
||||||
} else {
|
entry.add_css_class("error");
|
||||||
entry.remove_css_class("error");
|
} else {
|
||||||
}
|
entry.remove_css_class("error");
|
||||||
let mut conn = imp.connection.borrow_mut();
|
}
|
||||||
conn.security.psk = password_input.to_string();
|
let mut conn = imp.connection.borrow_mut();
|
||||||
}));
|
conn.security.psk = password_input.to_string();
|
||||||
|
}));
|
||||||
|
|
||||||
imp.reset_available_networks.set_activatable(true);
|
imp.reset_available_networks.set_activatable(true);
|
||||||
imp.reset_available_networks
|
imp.reset_available_networks
|
||||||
|
|
|
@ -55,7 +55,6 @@ impl WifiRouteEntry {
|
||||||
fn setup_callbacks(&self, connection: Rc<RefCell<Connection>>) {
|
fn setup_callbacks(&self, connection: Rc<RefCell<Connection>>) {
|
||||||
let self_imp = self.imp();
|
let self_imp = self.imp();
|
||||||
let conn = connection.clone();
|
let conn = connection.clone();
|
||||||
dbg!(conn.borrow());
|
|
||||||
self_imp.reset_route_address.connect_changed(clone!(@weak self_imp => move |entry| {
|
self_imp.reset_route_address.connect_changed(clone!(@weak self_imp => move |entry| {
|
||||||
let address_input = entry.text();
|
let address_input = entry.text();
|
||||||
let mut conn = conn.borrow_mut();
|
let mut conn = conn.borrow_mut();
|
||||||
|
|
|
@ -2,8 +2,8 @@ use gtk::prelude::FrameExt;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::hint::spin_loop;
|
use std::hint::spin_loop;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::components::base::setting_box::SettingBox;
|
use crate::components::base::setting_box::SettingBox;
|
||||||
use crate::components::base::utils::{start_audio_listener, Listeners, Position};
|
use crate::components::base::utils::{start_audio_listener, Listeners, Position};
|
||||||
|
|
|
@ -77,9 +77,6 @@ async fn daemon_check() {
|
||||||
});
|
});
|
||||||
let res = handle.join();
|
let res = handle.join();
|
||||||
if res.unwrap().is_err() {
|
if res.unwrap().is_err() {
|
||||||
println!("Daemon was not running");
|
|
||||||
run_daemon().await;
|
run_daemon().await;
|
||||||
} else {
|
}
|
||||||
println!("Daemon was running");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue