use gtk::{CompositeTemplate, glib, ListBox, Switch}; use gtk::prelude::*; use gtk::subclass::prelude::*; use crate::bluetooth::BluetoothEntry; #[allow(non_snake_case)] #[derive(Default, CompositeTemplate)] #[template(resource = "/org/xetibo/reset/resetBluetooth.ui")] pub struct BluetoothBox { #[template_child] pub resetBluetoothSwitch: TemplateChild, #[template_child] pub resetBluetoothAvailableDevices: TemplateChild, #[template_child] pub resetBluetoothConnectedDevices: TemplateChild, } #[glib::object_subclass] impl ObjectSubclass for BluetoothBox { const NAME: &'static str = "resetBluetooth"; type Type = super::BluetoothBox; type ParentType = gtk::Box; fn class_init(klass: &mut Self::Class) { BluetoothEntry::ensure_type(); klass.bind_template(); } fn instance_init(obj: &glib::subclass::InitializingObject) { obj.init_template(); } } impl ObjectImpl for BluetoothBox { fn constructed(&self) { self.parent_constructed(); } } impl BoxImpl for BluetoothBox {} impl WidgetImpl for BluetoothBox {} impl WindowImpl for BluetoothBox {} impl ApplicationWindowImpl for BluetoothBox {}