mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-07 18:47:45 +02:00
chore: Code cleanup
This commit is contained in:
parent
eed10e8b63
commit
e1cd11e601
21 changed files with 55 additions and 55 deletions
|
@ -25,9 +25,9 @@ impl WifiAddressEntry {
|
|||
let addr = getValueFromKey(&map, "address");
|
||||
let prefix = getValueFromKey(&map, "prefix-length");
|
||||
|
||||
entryImp.resetAddressAddress.set_text(&*addr);
|
||||
entryImp.resetAddressNetmask.set_text(&*prefix);
|
||||
entryImp.resetAddressRow.set_title(&*format!("{}, {}", addr, prefix));
|
||||
entryImp.resetAddressAddress.set_text(&addr);
|
||||
entryImp.resetAddressNetmask.set_text(&prefix);
|
||||
entryImp.resetAddressRow.set_title(&format!("{}, {}", addr, prefix));
|
||||
}
|
||||
entry
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
use std::collections::HashMap;
|
||||
use std::net::Shutdown::Read;
|
||||
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::components::base::listEntry::ListEntry;
|
||||
|
||||
use crate::components::base::utils::Listeners;
|
||||
use adw::glib;
|
||||
use adw::glib::Object;
|
||||
use adw::prelude::{ListBoxRowExt, PreferencesGroupExt};
|
||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||
use dbus::arg::{AppendAll, ReadAll, RefArg};
|
||||
use dbus::arg::{RefArg};
|
||||
use dbus::blocking::Connection;
|
||||
use dbus::message::SignalArgs;
|
||||
use dbus::Error;
|
||||
|
@ -22,9 +22,9 @@ use gtk::gio;
|
|||
use gtk::glib::Variant;
|
||||
use gtk::prelude::{ActionableExt, WidgetExt};
|
||||
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
|
||||
use ReSet_Lib::signals::{AccessPointAdded, GetVal};
|
||||
use ReSet_Lib::signals::{AccessPointAdded};
|
||||
use ReSet_Lib::signals::{AccessPointChanged, AccessPointRemoved};
|
||||
use ReSet_Lib::utils::Events;
|
||||
|
||||
|
||||
use crate::components::wifi::wifiBoxImpl;
|
||||
use crate::components::wifi::wifiEntry::WifiEntry;
|
||||
|
@ -63,9 +63,9 @@ impl WifiBox {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn scanForWifi(listeners: Arc<Listeners>, wifiBox: Arc<WifiBox>) {
|
||||
pub fn scanForWifi(_listeners: Arc<Listeners>, wifiBox: Arc<WifiBox>) {
|
||||
let wifibox_ref = wifiBox.clone();
|
||||
let wifibox_ref_listener = wifiBox.clone();
|
||||
let _wifibox_ref_listener = wifiBox.clone();
|
||||
let wifiEntries = wifiBox.imp().wifiEntries.clone();
|
||||
let wifiEntriesPath = wifiBox.imp().wifiEntriesPath.clone();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use adw::{ActionRow, ComboRow, NavigationView, PreferencesGroup};
|
|||
use dbus::Path;
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate, ListBox, Switch};
|
||||
use gtk::{glib, CompositeTemplate, Switch};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ use adw::glib::{Object, PropertySet};
|
|||
use adw::prelude::{ActionRowExt, ButtonExt, EditableExt, PopoverExt};
|
||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||
use dbus::blocking::Connection;
|
||||
use dbus::{Error, Path};
|
||||
use glib::{clone, Cast};
|
||||
use dbus::{Error};
|
||||
use glib::{clone};
|
||||
use gtk::prelude::{ListBoxRowExt, WidgetExt};
|
||||
use gtk::{gio, AlertDialog, GestureClick};
|
||||
use gtk::{gio};
|
||||
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
|
||||
|
||||
use crate::components::wifi::wifiBox::getConnectionSettings;
|
||||
|
@ -18,7 +18,7 @@ use crate::components::wifi::wifiBoxImpl::WifiBox;
|
|||
use crate::components::wifi::wifiEntryImpl;
|
||||
use crate::components::wifi::wifiOptions::WifiOptions;
|
||||
|
||||
use super::savedWifiEntry::SavedWifiEntry;
|
||||
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct WifiEntry(ObjectSubclass<wifiEntryImpl::WifiEntry>)
|
||||
|
@ -133,7 +133,7 @@ pub fn click_stored_network(entry: Arc<WifiEntry>) {
|
|||
);
|
||||
glib::spawn_future(async move {
|
||||
glib::idle_add_once(move || {
|
||||
let imp = entry_ref.imp();
|
||||
let _imp = entry_ref.imp();
|
||||
if res.is_err() {
|
||||
println!("wat bro?");
|
||||
result.store(false, std::sync::atomic::Ordering::SeqCst);
|
||||
|
|
|
@ -5,7 +5,7 @@ use adw::glib::Object;
|
|||
use adw::prelude::{ActionRowExt, ComboRowExt, PreferencesGroupExt};
|
||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||
use dbus::arg::PropMap;
|
||||
use glib::{PropertySet, Cast, ObjectExt, clone};
|
||||
use glib::{PropertySet, ObjectExt};
|
||||
use gtk::prelude::{EditableExt, WidgetExt};
|
||||
use ReSet_Lib::network::connection::{Connection, Enum, TypeSettings};
|
||||
|
||||
|
@ -31,13 +31,13 @@ impl WifiOptions {
|
|||
let selfImp = self.imp();
|
||||
let conn = selfImp.connection.borrow();
|
||||
// General
|
||||
selfImp.resetWifiName.set_subtitle(&*conn.settings.name);
|
||||
selfImp.resetWifiName.set_subtitle(&conn.settings.name);
|
||||
selfImp.resetWifiAutoConnect.set_active(conn.settings.autoconnect);
|
||||
selfImp.resetWifiMetered.set_active(if conn.settings.metered != -1 { true } else { false });
|
||||
selfImp.resetWifiMetered.set_active(conn.settings.metered != -1);
|
||||
match &conn.device {
|
||||
TypeSettings::WIFI(wifi) => {}
|
||||
TypeSettings::ETHERNET(ethernet) => {}
|
||||
TypeSettings::VPN(vpn) => {}
|
||||
TypeSettings::WIFI(_wifi) => {}
|
||||
TypeSettings::ETHERNET(_ethernet) => {}
|
||||
TypeSettings::VPN(_vpn) => {}
|
||||
TypeSettings::None => {}
|
||||
};
|
||||
// IPv4
|
||||
|
@ -52,8 +52,8 @@ impl WifiOptions {
|
|||
.join(".")
|
||||
})
|
||||
.collect();
|
||||
selfImp.resetIP4DNS.set_text(&*ipv4Dns.join(", "));
|
||||
selfImp.resetIP4Gateway.set_text(&*conn.ipv4.gateway);
|
||||
selfImp.resetIP4DNS.set_text(&ipv4Dns.join(", "));
|
||||
selfImp.resetIP4Gateway.set_text(&conn.ipv4.gateway);
|
||||
|
||||
if conn.ipv4.address_data.is_empty() {
|
||||
selfImp.resetIP4AddressGroup.add(&WifiAddressEntry::new(None))
|
||||
|
@ -82,8 +82,8 @@ impl WifiOptions {
|
|||
.join(":")
|
||||
})
|
||||
.collect();
|
||||
selfImp.resetIP6DNS.set_text(&*ipv6Dns.join(", "));
|
||||
selfImp.resetIP6Gateway.set_text(&*conn.ipv6.gateway);
|
||||
selfImp.resetIP6DNS.set_text(&ipv6Dns.join(", "));
|
||||
selfImp.resetIP6Gateway.set_text(&conn.ipv6.gateway);
|
||||
|
||||
if conn.ipv6.address_data.is_empty() {
|
||||
selfImp.resetIP6AddressGroup.add(&WifiAddressEntry::new(None))
|
||||
|
|
|
@ -26,11 +26,11 @@ impl WifiRouteEntry {
|
|||
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.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));
|
||||
}
|
||||
entry
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue