mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-09-16 22:59:16 +02:00
chore: snake_case all but UI templates
This commit is contained in:
parent
9f0ca6e8bf
commit
391182607d
55 changed files with 1471 additions and 1427 deletions
|
@ -10,14 +10,14 @@ use glib::{clone, Cast};
|
|||
use gtk::{gio, StringList, StringObject};
|
||||
use ReSet_Lib::audio::audio::Card;
|
||||
|
||||
use components::utils::createDropdownLabelFactory;
|
||||
use components::utils::create_dropdown_label_factory;
|
||||
|
||||
use crate::components;
|
||||
|
||||
use super::cardEntryImpl;
|
||||
use super::card_entry_impl;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct CardEntry(ObjectSubclass<cardEntryImpl::CardEntry>)
|
||||
pub struct CardEntry(ObjectSubclass<card_entry_impl::CardEntry>)
|
||||
@extends adw::ComboRow, gtk::Widget,
|
||||
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable, adw::PreferencesRow;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ impl CardEntry {
|
|||
let entry: CardEntry = Object::builder().build();
|
||||
{
|
||||
let imp = entry.imp();
|
||||
let mut map = imp.resetCardMap.borrow_mut();
|
||||
let mut map = imp.reset_card_map.borrow_mut();
|
||||
entry.set_title(&card.name);
|
||||
let mut index: u32 = 0;
|
||||
let list = StringList::new(&[]);
|
||||
|
@ -52,11 +52,11 @@ impl CardEntry {
|
|||
let selected = selected.unwrap();
|
||||
let selected = selected.downcast_ref::<StringObject>().unwrap();
|
||||
let selected = selected.string().to_string();
|
||||
let map = imp.resetCardMap.borrow();
|
||||
let map = imp.reset_card_map.borrow();
|
||||
let (device_index, profile_name) = map.get(&selected).unwrap();
|
||||
set_card_profile_of_device(*device_index, profile_name.clone());
|
||||
}));
|
||||
entry.set_factory(Some(&createDropdownLabelFactory()));
|
||||
entry.set_factory(Some(&create_dropdown_label_factory()));
|
||||
}
|
||||
entry
|
||||
}
|
|
@ -8,22 +8,21 @@ use std::collections::HashMap;
|
|||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate};
|
||||
|
||||
use super::cardEntry;
|
||||
use super::card_entry;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetCardEntry.ui")]
|
||||
pub struct CardEntry {
|
||||
// first string is the alias name, the first return string is the index of the adapter and the
|
||||
// second the name of the profile
|
||||
pub resetCardMap: RefCell<HashMap<String, (u32, String)>>,
|
||||
pub reset_card_map: RefCell<HashMap<String, (u32, String)>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for CardEntry {
|
||||
const ABSTRACT: bool = false;
|
||||
const NAME: &'static str = "resetCardEntry";
|
||||
type Type = cardEntry::CardEntry;
|
||||
type Type = card_entry::CardEntry;
|
||||
type ParentType = ComboRow;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
|
@ -1,11 +1,11 @@
|
|||
use crate::components::base::listEntryImpl;
|
||||
use crate::components::base::list_entry_impl;
|
||||
use adw::glib;
|
||||
use adw::glib::{IsA, Object};
|
||||
use gtk::prelude::ListBoxRowExt;
|
||||
use gtk::Widget;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct ListEntry(ObjectSubclass<listEntryImpl::ListEntry>)
|
||||
pub struct ListEntry(ObjectSubclass<list_entry_impl::ListEntry>)
|
||||
@extends gtk::ListBoxRow, gtk::Widget,
|
||||
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
use crate::components::base::listEntry;
|
||||
use crate::components::base::list_entry;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate};
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetListBoxRow.ui")]
|
||||
pub struct ListEntry {}
|
||||
|
@ -11,7 +10,7 @@ pub struct ListEntry {}
|
|||
impl ObjectSubclass for ListEntry {
|
||||
const ABSTRACT: bool = false;
|
||||
const NAME: &'static str = "resetListBoxRow";
|
||||
type Type = listEntry::ListEntry;
|
||||
type Type = list_entry::ListEntry;
|
||||
type ParentType = gtk::ListBoxRow;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
|
@ -1,9 +1,9 @@
|
|||
pub mod cardEntry;
|
||||
pub mod cardEntryImpl;
|
||||
pub mod listEntry;
|
||||
pub mod listEntryImpl;
|
||||
pub mod card_entry;
|
||||
pub mod card_entry_impl;
|
||||
pub mod list_entry;
|
||||
pub mod list_entry_impl;
|
||||
pub mod popup;
|
||||
pub mod popupImpl;
|
||||
pub mod settingBox;
|
||||
pub mod settingBoxImpl;
|
||||
pub mod popup_impl;
|
||||
pub mod setting_box;
|
||||
pub mod setting_box_impl;
|
||||
pub mod utils;
|
||||
|
|
|
@ -2,10 +2,10 @@ use adw::glib;
|
|||
use adw::glib::Object;
|
||||
use gtk::{gdk, Editable, Popover};
|
||||
|
||||
use super::popupImpl;
|
||||
use super::popup_impl;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct Popup(ObjectSubclass<popupImpl::Popup>)
|
||||
pub struct Popup(ObjectSubclass<popup_impl::Popup>)
|
||||
@extends Popover, gtk::Widget,
|
||||
@implements Editable,gdk::Popup, gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ pub struct Popup {
|
|||
pub resetPopupEntry: TemplateChild<PasswordEntry>,
|
||||
#[template_child]
|
||||
pub resetPopupButton: TemplateChild<Button>,
|
||||
pub resetPopupText: Arc<RefCell<PasswordEntryBuffer>>,
|
||||
pub reset_popup_text: Arc<RefCell<PasswordEntryBuffer>>,
|
||||
}
|
||||
|
||||
unsafe impl Send for Popup {}
|
|
@ -1,11 +1,11 @@
|
|||
use crate::components::base::settingBoxImpl;
|
||||
use crate::components::base::setting_box_impl;
|
||||
use adw::glib;
|
||||
use adw::glib::{IsA, Object};
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Widget;
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct SettingBox(ObjectSubclass<settingBoxImpl::SettingBox>)
|
||||
pub struct SettingBox(ObjectSubclass<setting_box_impl::SettingBox>)
|
||||
@extends gtk::Box, gtk::Widget,
|
||||
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
use crate::components::base::settingBox;
|
||||
use crate::components::base::setting_box;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate};
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetSettingBox.ui")]
|
||||
pub struct SettingBox {}
|
||||
|
@ -11,7 +10,7 @@ pub struct SettingBox {}
|
|||
impl ObjectSubclass for SettingBox {
|
||||
const ABSTRACT: bool = false;
|
||||
const NAME: &'static str = "resetSettingBox";
|
||||
type Type = settingBox::SettingBox;
|
||||
type Type = setting_box::SettingBox;
|
||||
type ParentType = gtk::Box;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
|
@ -19,8 +19,8 @@ use ReSet_Lib::{
|
|||
};
|
||||
|
||||
use crate::components::{
|
||||
input::sourceBox::{start_input_box_listener, SourceBox},
|
||||
output::sinkBox::{start_output_box_listener, SinkBox},
|
||||
input::source_box::{start_input_box_listener, SourceBox},
|
||||
output::sink_box::{start_output_box_listener, SinkBox},
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue