mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-07 10:37:46 +02:00
Big restructuring
This commit is contained in:
parent
c4c95df8d3
commit
13084ed86d
22 changed files with 638 additions and 595 deletions
|
@ -1,5 +1,5 @@
|
|||
#![allow(non_snake_case)]
|
||||
mod wifiBox;
|
||||
mod wifiBoxImpl;
|
||||
mod wifiEntryImpl;
|
||||
mod wifiEntry;
|
||||
pub mod wifiBox;
|
||||
pub mod wifiBoxImpl;
|
||||
pub mod wifiEntry;
|
||||
pub mod wifiEntryImpl;
|
|
@ -1,10 +1,19 @@
|
|||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use adw::glib;
|
||||
use adw::glib::clone;
|
||||
use adw::glib::Object;
|
||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||
use dbus::blocking::Connection;
|
||||
use dbus::Error;
|
||||
|
||||
use crate::components::wifi::wifiBoxImpl;
|
||||
use crate::components::wifi::wifiEntry::WifiEntry;
|
||||
use crate::components::wifi::wifiEntryImpl::WifiStrength;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct WifiBox(ObjectSubclass<wifiBox::WifiBox>)
|
||||
pub struct WifiBox(ObjectSubclass<wifiBoxImpl::WifiBox>)
|
||||
@extends gtk::Box, gtk::Widget,
|
||||
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
|
||||
}
|
||||
|
@ -17,7 +26,7 @@ impl WifiBox {
|
|||
pub fn setupCallbacks(&self) {
|
||||
let selfImp = self.imp();
|
||||
|
||||
selfImp.resetWifiDetails.connect_row_activated(clone!(@ weak selfImp as window => move |_, y| {
|
||||
selfImp.resetWifiDetails.connect_row_activated(clone!(@ weak selfImp as window => move |_, _y| {
|
||||
// let result = y.downcast_ref()::<WifiEntry>().unwrap(); no worky smh
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@ use std::cell::RefCell;
|
|||
use gtk::{CompositeTemplate, glib, ListBox, ListBoxRow, Switch};
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::prelude::*;
|
||||
use crate::components::wifi::wifiBox;
|
||||
|
||||
use crate::components::wifi::WifiEntry;
|
||||
use crate::components::wifi::wifiEntry::WifiEntry;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
|
@ -23,7 +24,7 @@ pub struct WifiBox {
|
|||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for WifiBox {
|
||||
const NAME: &'static str = "resetWifi";
|
||||
type Type = super::WifiBox;
|
||||
type Type = wifiBox::WifiBox;
|
||||
type ParentType = gtk::Box;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
use crate::components::wifi::wifiEntryImpl;
|
||||
use adw::glib;
|
||||
use adw::glib::{Object, PropertySet};
|
||||
use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||
use gtk::prelude::WidgetExt;
|
||||
use crate::components::wifi::wifiEntryImpl::WifiStrength;
|
||||
|
||||
glib::wrapper! {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::cell::RefCell;
|
||||
use gtk::{Button, CompositeTemplate, glib, Image, Label};
|
||||
use gtk::subclass::prelude::*;
|
||||
use crate::components::wifi::wifiEntry;
|
||||
|
||||
#[derive(Default, Copy, Clone)]
|
||||
pub enum WifiStrength {
|
||||
|
@ -30,7 +31,7 @@ pub struct WifiEntry {
|
|||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for WifiEntry {
|
||||
const NAME: &'static str = "resetWifiEntry";
|
||||
type Type = super::WifiEntry;
|
||||
type Type = wifiEntry::WifiEntry;
|
||||
type ParentType = gtk::ListBoxRow;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue