mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-13 05:07:45 +02:00
some things
This commit is contained in:
parent
593c6b7627
commit
a3866294af
9 changed files with 105 additions and 146 deletions
|
@ -16,7 +16,7 @@ use dbus::Error;
|
|||
use dbus::Path;
|
||||
use glib::{clone, Cast, PropertySet};
|
||||
use gtk::glib::Variant;
|
||||
use gtk::prelude::{ActionableExt, WidgetExt};
|
||||
use gtk::prelude::{ActionableExt, WidgetExt, BoxExt};
|
||||
use gtk::{gio, StringObject};
|
||||
use ReSet_Lib::network::network::{AccessPoint, WifiDevice, WifiStrength};
|
||||
use ReSet_Lib::signals::{AccessPointAdded, WifiDeviceChanged};
|
||||
|
@ -373,12 +373,9 @@ pub fn start_event_listener(listeners: Arc<Listeners>, wifi_box: Arc<WifiBox>) {
|
|||
if ir.access_point.dbus_path
|
||||
== imp.resetCurrentWifiDevice.borrow().active_access_point
|
||||
{
|
||||
entryImp
|
||||
.resetWifiConnected
|
||||
.get()
|
||||
.set_from_icon_name(Some("network-wireless-connected-symbolic"));
|
||||
entryImp.resetWifiConnected.set_text("Connected");
|
||||
} else {
|
||||
entryImp.resetWifiConnected.get().set_from_icon_name(None);
|
||||
entryImp.resetWifiConnected.set_text("");
|
||||
}
|
||||
{
|
||||
let mut wifiName = entryImp.wifiName.borrow_mut();
|
||||
|
|
|
@ -55,9 +55,7 @@ impl WifiEntry {
|
|||
}
|
||||
if connected {
|
||||
entryImp
|
||||
.resetWifiConnected
|
||||
.get()
|
||||
.set_from_icon_name(Some("network-wireless-connected-symbolic"));
|
||||
.resetWifiConnected.set_text("Connected");
|
||||
}
|
||||
{
|
||||
let mut wifiName = entryImp.wifiName.borrow_mut();
|
||||
|
@ -110,7 +108,7 @@ pub fn click_disconnect(entry: Arc<WifiEntry>) {
|
|||
imp.connected.replace(false);
|
||||
return;
|
||||
}
|
||||
imp.resetWifiConnected.get().set_from_icon_name(None);
|
||||
imp.resetWifiConnected.set_text("");
|
||||
imp.connected.replace(false);
|
||||
glib::spawn_future(async move {
|
||||
glib::idle_add_once(move || {
|
||||
|
@ -152,9 +150,7 @@ pub fn click_stored_network(entry: Arc<WifiEntry>) {
|
|||
return;
|
||||
}
|
||||
let imp = entry_ref.imp();
|
||||
imp.resetWifiConnected
|
||||
.get()
|
||||
.set_from_icon_name(Some("network-wireless-connected-symbolic"));
|
||||
imp.resetWifiConnected.set_text("Connected");
|
||||
imp.connected.replace(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct WifiEntry {
|
|||
#[template_child]
|
||||
pub resetWifiEditButton: TemplateChild<Button>,
|
||||
#[template_child]
|
||||
pub resetWifiConnected: TemplateChild<Image>,
|
||||
pub resetWifiConnected: TemplateChild<Label>,
|
||||
#[template_child]
|
||||
pub resetWifiPopup: TemplateChild<Popup>,
|
||||
pub wifiName: RefCell<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue