diff --git a/src/bluetooth/bluetoothBox.rs b/src/bluetooth/bluetoothBox.rs new file mode 100644 index 0000000..fee523b --- /dev/null +++ b/src/bluetooth/bluetoothBox.rs @@ -0,0 +1,46 @@ +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 {} diff --git a/src/bluetooth/bluetoothEntry.rs b/src/bluetooth/bluetoothEntry.rs new file mode 100644 index 0000000..75da27f --- /dev/null +++ b/src/bluetooth/bluetoothEntry.rs @@ -0,0 +1,43 @@ +use gtk::{Button, CompositeTemplate, glib, Image, Label}; +use gtk::subclass::prelude::*; + +#[allow(non_snake_case)] +#[derive(Default, CompositeTemplate)] +#[template(resource = "/org/xetibo/reset/resetBluetoothEntry.ui")] +pub struct BluetoothEntry { + #[template_child] + pub resetBluetoothDeviceType: TemplateChild, + #[template_child] + pub resetBluetoothLabel: TemplateChild