From d72f916e8a8e5f58d7ffd54ad1ef8870861cf255 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr / DashieTM Date: Mon, 1 Apr 2024 13:40:21 +0200 Subject: [PATCH] chore: Format project --- .../audio/input/output_stream_entry.rs | 2 +- .../audio/input/source_box_handlers.rs | 2 +- .../audio/output/input_stream_entry.rs | 2 +- .../audio/output/sink_box_handlers.rs | 2 +- src/components/base/card_entry.rs | 4 ++-- src/components/base/list_entry.rs | 2 +- src/components/base/setting_box.rs | 2 +- src/components/bluetooth/bluetooth_box.rs | 2 +- src/components/mod.rs | 2 +- src/components/plugin/function.rs | 4 +--- src/components/plugin/mod.rs | 2 +- src/components/utils.rs | 2 +- src/components/wifi/saved_wifi_entry.rs | 4 ++-- src/components/wifi/wifi_box.rs | 2 +- src/components/wifi/wifi_entry.rs | 2 +- src/components/wifi/wifi_event_handlers.rs | 2 +- src/components/wifi/wifi_options.rs | 2 +- src/components/window/reset_window.rs | 24 +++++++++++++------ src/components/window/sidebar_entry_impl.rs | 4 ++-- 19 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/components/audio/input/output_stream_entry.rs b/src/components/audio/input/output_stream_entry.rs index 4cb848c..7c02698 100644 --- a/src/components/audio/input/output_stream_entry.rs +++ b/src/components/audio/input/output_stream_entry.rs @@ -9,9 +9,9 @@ use adw::glib::Object; use adw::prelude::{ButtonExt, ComboRowExt, PreferencesRowExt, RangeExt}; use dbus::blocking::Connection; use dbus::Error; +use glib::prelude::Cast; use glib::subclass::types::ObjectSubclassIsExt; use glib::{clone, Propagation}; -use glib::prelude::Cast; use gtk::{gio, StringObject}; use re_set_lib::audio::audio_structures::OutputStream; diff --git a/src/components/audio/input/source_box_handlers.rs b/src/components/audio/input/source_box_handlers.rs index 233108b..f6cbf11 100644 --- a/src/components/audio/input/source_box_handlers.rs +++ b/src/components/audio/input/source_box_handlers.rs @@ -4,8 +4,8 @@ use std::{ }; use adw::prelude::{ComboRowExt, PreferencesRowExt}; -use glib::{subclass::types::ObjectSubclassIsExt, ControlFlow, Propagation}; use glib::prelude::Cast; +use glib::{subclass::types::ObjectSubclassIsExt, ControlFlow, Propagation}; use gtk::{ gio, prelude::{BoxExt, ButtonExt, CheckButtonExt, ListBoxRowExt, RangeExt}, diff --git a/src/components/audio/output/input_stream_entry.rs b/src/components/audio/output/input_stream_entry.rs index c66b26a..432f7a9 100644 --- a/src/components/audio/output/input_stream_entry.rs +++ b/src/components/audio/output/input_stream_entry.rs @@ -9,9 +9,9 @@ use adw::glib::Object; use adw::prelude::{ButtonExt, ComboRowExt, PreferencesRowExt, RangeExt}; use dbus::blocking::Connection; use dbus::Error; +use glib::prelude::Cast; use glib::subclass::types::ObjectSubclassIsExt; use glib::{clone, Propagation}; -use glib::prelude::Cast; use gtk::{gio, StringObject}; use re_set_lib::audio::audio_structures::InputStream; diff --git a/src/components/audio/output/sink_box_handlers.rs b/src/components/audio/output/sink_box_handlers.rs index ea75d03..802e9dc 100644 --- a/src/components/audio/output/sink_box_handlers.rs +++ b/src/components/audio/output/sink_box_handlers.rs @@ -7,8 +7,8 @@ use adw::{ prelude::{ComboRowExt, PreferencesRowExt}, ComboRow, }; -use glib::{subclass::types::ObjectSubclassIsExt, Propagation}; use glib::prelude::Cast; +use glib::{subclass::types::ObjectSubclassIsExt, Propagation}; use gtk::{ gio, prelude::{BoxExt, ButtonExt, CheckButtonExt, ListBoxRowExt, RangeExt}, diff --git a/src/components/base/card_entry.rs b/src/components/base/card_entry.rs index d3f9308..e0e82f1 100644 --- a/src/components/base/card_entry.rs +++ b/src/components/base/card_entry.rs @@ -4,9 +4,9 @@ use adw::glib::Object; use adw::prelude::{ComboRowExt, PreferencesRowExt}; use dbus::blocking::Connection; use dbus::Error; -use glib::subclass::types::ObjectSubclassIsExt; -use glib::{clone}; +use glib::clone; use glib::prelude::Cast; +use glib::subclass::types::ObjectSubclassIsExt; use gtk::{gio, StringList, StringObject}; use components::utils::create_dropdown_label_factory; diff --git a/src/components/base/list_entry.rs b/src/components/base/list_entry.rs index 88e4a87..cba2d19 100644 --- a/src/components/base/list_entry.rs +++ b/src/components/base/list_entry.rs @@ -1,5 +1,5 @@ use crate::components::base::list_entry_impl; -use adw::glib::{Object}; +use adw::glib::Object; use glib::prelude::IsA; use gtk::prelude::ListBoxRowExt; use gtk::Widget; diff --git a/src/components/base/setting_box.rs b/src/components/base/setting_box.rs index 2afff96..dc9259a 100644 --- a/src/components/base/setting_box.rs +++ b/src/components/base/setting_box.rs @@ -1,5 +1,5 @@ use crate::components::base::setting_box_impl; -use adw::glib::{Object}; +use adw::glib::Object; use glib::prelude::IsA; use gtk::prelude::BoxExt; use gtk::Widget; diff --git a/src/components/bluetooth/bluetooth_box.rs b/src/components/bluetooth/bluetooth_box.rs index 0ff6ee9..fa27cb7 100644 --- a/src/components/bluetooth/bluetooth_box.rs +++ b/src/components/bluetooth/bluetooth_box.rs @@ -8,9 +8,9 @@ use adw::subclass::prelude::ObjectSubclassIsExt; use dbus::blocking::Connection; use dbus::message::SignalArgs; use dbus::{Error, Path}; -use glib::{clone, ControlFlow}; use glib::prelude::Cast; use glib::property::PropertySet; +use glib::{clone, ControlFlow}; use gtk::glib::Variant; use gtk::prelude::{ActionableExt, ButtonExt, ListBoxRowExt, WidgetExt}; use gtk::{gio, StringObject}; diff --git a/src/components/mod.rs b/src/components/mod.rs index ad9703a..c3e990c 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -1,7 +1,7 @@ pub mod audio; pub mod base; pub mod bluetooth; +mod plugin; pub mod utils; pub mod wifi; pub mod window; -mod plugin; diff --git a/src/components/plugin/function.rs b/src/components/plugin/function.rs index bdd0b91..82b089c 100644 --- a/src/components/plugin/function.rs +++ b/src/components/plugin/function.rs @@ -50,7 +50,7 @@ impl TSideBarInfo for ReSetSidebarInfo { } fn plugin_click_event(&self) -> PluginClickEvent { - Rc::new(|_,_,_| {}) + Rc::new(|_, _, _| {}) } fn plugin_boxes(&self) -> Option> { @@ -67,7 +67,6 @@ pub struct PluginSidebarInfo { pub plugin_boxes: Vec, } - impl TSideBarInfo for PluginSidebarInfo { fn name(&self) -> &'static str { self.name @@ -93,4 +92,3 @@ impl TSideBarInfo for PluginSidebarInfo { Some(self.plugin_boxes.clone()) } } - diff --git a/src/components/plugin/mod.rs b/src/components/plugin/mod.rs index 7fd349b..2e8545b 100644 --- a/src/components/plugin/mod.rs +++ b/src/components/plugin/mod.rs @@ -1 +1 @@ -pub mod function; \ No newline at end of file +pub mod function; diff --git a/src/components/utils.rs b/src/components/utils.rs index 5f49835..d73e8a9 100644 --- a/src/components/utils.rs +++ b/src/components/utils.rs @@ -1,8 +1,8 @@ use adw::gdk::pango::EllipsizeMode; use adw::prelude::ListModelExtManual; use adw::{ActionRow, ComboRow}; -use glib::{Object}; use glib::prelude::Cast; +use glib::Object; use gtk::prelude::{GObjectPropertyExpressionExt, ListBoxRowExt, ListItemExt, WidgetExt}; use gtk::{Align, SignalListItemFactory, StringObject}; diff --git a/src/components/wifi/saved_wifi_entry.rs b/src/components/wifi/saved_wifi_entry.rs index c365d90..5059a32 100644 --- a/src/components/wifi/saved_wifi_entry.rs +++ b/src/components/wifi/saved_wifi_entry.rs @@ -10,9 +10,9 @@ use adw::glib::Object; use adw::prelude::{ActionRowExt, ButtonExt, PreferencesGroupExt, PreferencesRowExt}; use dbus::blocking::Connection; use dbus::{Error, Path}; -use glib::subclass::types::ObjectSubclassIsExt; -use glib::{clone}; +use glib::clone; use glib::property::PropertySet; +use glib::subclass::types::ObjectSubclassIsExt; use gtk::prelude::{BoxExt, ListBoxRowExt}; use gtk::{gio, Align, Button, Orientation}; diff --git a/src/components/wifi/wifi_box.rs b/src/components/wifi/wifi_box.rs index da6110a..673aab9 100644 --- a/src/components/wifi/wifi_box.rs +++ b/src/components/wifi/wifi_box.rs @@ -14,9 +14,9 @@ use dbus::blocking::Connection; use dbus::message::SignalArgs; use dbus::Error; use dbus::Path; -use glib::{clone, ControlFlow}; use glib::prelude::Cast; use glib::property::PropertySet; +use glib::{clone, ControlFlow}; use gtk::glib::Variant; use gtk::prelude::ActionableExt; use gtk::{gio, StringList, StringObject}; diff --git a/src/components/wifi/wifi_entry.rs b/src/components/wifi/wifi_entry.rs index e2d3b5d..07779d9 100644 --- a/src/components/wifi/wifi_entry.rs +++ b/src/components/wifi/wifi_entry.rs @@ -4,7 +4,7 @@ use std::time::Duration; use crate::components::utils::{BASE, DBUS_PATH, WIRELESS}; use crate::components::wifi::utils::get_connection_settings; -use adw::glib::{Object}; +use adw::glib::Object; use adw::prelude::{ActionRowExt, ButtonExt, EditableExt, PopoverExt, PreferencesRowExt}; use adw::subclass::prelude::ObjectSubclassIsExt; use dbus::blocking::Connection; diff --git a/src/components/wifi/wifi_event_handlers.rs b/src/components/wifi/wifi_event_handlers.rs index 8a83a0a..6cea57c 100644 --- a/src/components/wifi/wifi_event_handlers.rs +++ b/src/components/wifi/wifi_event_handlers.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use adw::prelude::{ComboRowExt, PreferencesGroupExt, PreferencesRowExt}; -use glib::{subclass::types::ObjectSubclassIsExt}; use glib::property::PropertySet; +use glib::subclass::types::ObjectSubclassIsExt; use gtk::prelude::WidgetExt; use re_set_lib::{ network::network_structures::WifiStrength, diff --git a/src/components/wifi/wifi_options.rs b/src/components/wifi/wifi_options.rs index e58f36e..0adbb60 100644 --- a/src/components/wifi/wifi_options.rs +++ b/src/components/wifi/wifi_options.rs @@ -10,7 +10,7 @@ use adw::prelude::{ActionRowExt, ComboRowExt, PreferencesGroupExt}; use adw::subclass::prelude::ObjectSubclassIsExt; use dbus::arg::PropMap; use dbus::{Error, Path}; -use glib::{clone}; +use glib::clone; use glib::property::PropertySet; use gtk::prelude::{ActionableExt, ButtonExt, EditableExt, ListBoxRowExt, WidgetExt}; use re_set_lib::network::connection::{ diff --git a/src/components/window/reset_window.rs b/src/components/window/reset_window.rs index fff7064..42e8deb 100644 --- a/src/components/window/reset_window.rs +++ b/src/components/window/reset_window.rs @@ -2,13 +2,16 @@ use std::cell::RefCell; use std::rc::Rc; use std::sync::Arc; -use adw::BreakpointCondition; use adw::glib::clone; use adw::subclass::prelude::ObjectSubclassIsExt; +use adw::BreakpointCondition; use glib::Object; -use gtk::{AccessibleRole, Align, Application, FlowBox, FlowBoxChild, Frame, gio, ListBoxRow, Orientation, StateFlags}; -use gtk::{DirectionType, prelude::*}; use gtk::gio::ActionEntry; +use gtk::{ + gio, AccessibleRole, Align, Application, FlowBox, FlowBoxChild, Frame, ListBoxRow, Orientation, + StateFlags, +}; +use gtk::{prelude::*, DirectionType}; use re_set_lib::utils::plugin_setup::FRONTEND_PLUGINS; use crate::components::base::setting_box::SettingBox; @@ -157,17 +160,24 @@ impl ReSetWindow { (plugin.frontend_startup)(); let event = Rc::new( - move |reset_main: FlowBox, position: Rc>, boxes: Vec| { - if handle_init(listeners.clone(), position, Position::Custom(String::from(sidebar_info.name))) { + move |reset_main: FlowBox, + position: Rc>, + boxes: Vec| { + if handle_init( + listeners.clone(), + position, + Position::Custom(String::from(sidebar_info.name)), + ) { return; } reset_main.remove_all(); for plugin_box in &boxes { - let frame = wrap_in_flow_box_child(SettingBox::new(&plugin_box.clone())); + let frame = + wrap_in_flow_box_child(SettingBox::new(&plugin_box.clone())); reset_main.insert(&frame, -1); } reset_main.set_max_children_per_line(boxes.len() as u32); - } + }, ); plugin_sidebar_list.push(PluginSidebarInfo { diff --git a/src/components/window/sidebar_entry_impl.rs b/src/components/window/sidebar_entry_impl.rs index f583b49..3eff0dc 100644 --- a/src/components/window/sidebar_entry_impl.rs +++ b/src/components/window/sidebar_entry_impl.rs @@ -3,8 +3,8 @@ use std::rc::Rc; use std::sync::Arc; use glib::subclass::InitializingObject; -use gtk::{CompositeTemplate, FlowBox, Image, Label, ListBoxRow}; use gtk::subclass::prelude::*; +use gtk::{CompositeTemplate, FlowBox, Image, Label, ListBoxRow}; use crate::components::base::utils::{Listeners, Position}; use crate::components::window::handle_sidebar_click::HANDLE_HOME; @@ -41,7 +41,7 @@ impl Default for SidebarAction { fn default() -> Self { Self { on_click_event: Some(HANDLE_HOME), - on_plugin_click_event: Rc::new(|_,_,_|{}), + on_plugin_click_event: Rc::new(|_, _, _| {}), } } }