mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-08 22:52:01 +02:00
chore: Code cleanup
This commit is contained in:
parent
921d5e7fe6
commit
c921e14c03
|
@ -2,7 +2,6 @@ mod base;
|
|||
pub mod bluetooth;
|
||||
mod input;
|
||||
pub mod output;
|
||||
pub mod utils;
|
||||
pub mod wifi;
|
||||
pub mod window;
|
||||
pub mod utils;
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
#![allow(non_snake_case)]
|
||||
pub mod savedWifiEntry;
|
||||
pub mod savedWifiEntryImpl;
|
||||
pub mod utils;
|
||||
pub mod wifiAddressEntry;
|
||||
pub mod wifiAddressEntryImpl;
|
||||
pub mod wifiBox;
|
||||
pub mod wifiBoxImpl;
|
||||
pub mod wifiEntry;
|
||||
pub mod wifiEntryImpl;
|
||||
pub mod wifiOptions;
|
||||
pub mod wifiOptionsImpl;
|
||||
pub mod wifiAddressEntry;
|
||||
pub mod wifiAddressEntryImpl;
|
||||
pub mod wifiRouteEntry;
|
||||
pub mod wifiRouteEntryImpl;
|
||||
pub mod utils;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::cell::RefCell;
|
||||
use adw::ActionRow;
|
||||
use adw::subclass::preferences_row::PreferencesRowImpl;
|
||||
use adw::subclass::prelude::ActionRowImpl;
|
||||
use adw::ActionRow;
|
||||
use std::cell::RefCell;
|
||||
|
||||
use dbus::Path;
|
||||
use gtk::subclass::prelude::*;
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::sync::atomic::AtomicBool;
|
|||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::components::wifi::utils::getConnectionSettings;
|
||||
use adw::glib;
|
||||
use adw::glib::{Object, PropertySet};
|
||||
use adw::prelude::{ActionRowExt, ButtonExt, EditableExt, PopoverExt};
|
||||
|
@ -12,7 +13,6 @@ use glib::clone;
|
|||
use gtk::gio;
|
||||
use gtk::prelude::{ListBoxRowExt, WidgetExt};
|
||||
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
|
||||
use crate::components::wifi::utils::getConnectionSettings;
|
||||
|
||||
use crate::components::wifi::wifiBoxImpl::WifiBox;
|
||||
use crate::components::wifi::wifiEntryImpl;
|
||||
|
@ -99,8 +99,11 @@ pub fn click_disconnect(entry: Arc<WifiEntry>) {
|
|||
"/org/Xetibo/ReSetDaemon",
|
||||
Duration::from_millis(10000),
|
||||
);
|
||||
let res: Result<(bool,), Error> =
|
||||
proxy.method_call("org.Xetibo.ReSetWireless", "DisconnectFromCurrentAccessPoint", ());
|
||||
let res: Result<(bool,), Error> = proxy.method_call(
|
||||
"org.Xetibo.ReSetWireless",
|
||||
"DisconnectFromCurrentAccessPoint",
|
||||
(),
|
||||
);
|
||||
if res.is_err() {
|
||||
println!("res of disconnect was error bro");
|
||||
return;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use crate::components::base::popup::Popup;
|
||||
use crate::components::wifi::wifiEntry;
|
||||
use adw::subclass::preferences_row::PreferencesRowImpl;
|
||||
use adw::subclass::prelude::ActionRowImpl;
|
||||
use adw::ActionRow;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, Button, CompositeTemplate, Image, Label};
|
||||
use std::cell::RefCell;
|
||||
use adw::ActionRow;
|
||||
use adw::subclass::preferences_row::PreferencesRowImpl;
|
||||
use adw::subclass::prelude::ActionRowImpl;
|
||||
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::components::wifi::wifiOptions;
|
||||
use adw::subclass::prelude::NavigationPageImpl;
|
||||
use adw::{ActionRow, ComboRow, EntryRow, NavigationPage, PreferencesGroup, SwitchRow};
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, Button, CompositeTemplate};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use adw::{ActionRow, ComboRow, EntryRow, NavigationPage, PreferencesGroup, SwitchRow};
|
||||
use adw::subclass::prelude::NavigationPageImpl;
|
||||
use crate::components::wifi::{wifiOptions};
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate, Button};
|
||||
use ReSet_Lib::network::connection::Connection;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
@ -58,7 +58,7 @@ pub struct WifiOptions {
|
|||
// Misc
|
||||
#[template_child]
|
||||
pub wifiOptionsApplyButton: TemplateChild<Button>,
|
||||
pub connection: Rc<RefCell<Connection>>
|
||||
pub connection: Rc<RefCell<Connection>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::components::wifi::wifiOptions::getValueFromKey;
|
||||
use adw::glib;
|
||||
use adw::glib::Object;
|
||||
use adw::prelude::PreferencesRowExt;
|
||||
use glib::subclass::prelude::ObjectSubclassIsExt;
|
||||
use gtk::prelude::EditableExt;
|
||||
use ReSet_Lib::network::connection::Address;
|
||||
use crate::components::wifi::wifiOptions::getValueFromKey;
|
||||
|
||||
use crate::components::wifi::wifiRouteEntryImpl;
|
||||
|
||||
|
@ -22,17 +22,18 @@ impl WifiRouteEntry {
|
|||
let map = address.to_map();
|
||||
|
||||
let addr = getValueFromKey(&map, "address");
|
||||
let prefix = getValueFromKey(&map, "prefix-length");
|
||||
let gateway = getValueFromKey(&map, "gateway");
|
||||
let metric = getValueFromKey(&map, "metric");
|
||||
let prefix = getValueFromKey(&map, "prefix-length");
|
||||
let gateway = getValueFromKey(&map, "gateway");
|
||||
let metric = getValueFromKey(&map, "metric");
|
||||
|
||||
entryImp.resetRouteAddress.set_text(&addr);
|
||||
entryImp.resetRouteNetmask.set_text(&prefix);
|
||||
entryImp.resetRouteGateway.set_text(&gateway);
|
||||
entryImp.resetRouteMetric.set_text(&metric);
|
||||
entryImp.resetRouteRow.set_title(&format!("{}, {}, {}, {}", addr, prefix, gateway, metric));
|
||||
entryImp
|
||||
.resetRouteRow
|
||||
.set_title(&format!("{}, {}, {}, {}", addr, prefix, gateway, metric));
|
||||
}
|
||||
entry
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use adw::{EntryRow, ExpanderRow};
|
||||
use crate::components::wifi::wifiRouteEntry;
|
||||
use adw::{EntryRow, ExpanderRow};
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate, Button};
|
||||
use gtk::{glib, Button, CompositeTemplate};
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
|
|
Loading…
Reference in a new issue