mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 08:44:40 +01:00
templates: remove uneeded id
the macro defaults to the field name now
This commit is contained in:
parent
cce1be94d6
commit
9de3fd861c
11 changed files with 95 additions and 115 deletions
|
@ -23,47 +23,33 @@ mod imp {
|
|||
pub selected_provider: OnceCell<Provider>,
|
||||
pub actions: gio::SimpleActionGroup,
|
||||
pub image: ProviderImage,
|
||||
|
||||
#[template_child(id = "main_container")]
|
||||
#[template_child]
|
||||
pub main_container: TemplateChild<gtk::Box>,
|
||||
|
||||
#[template_child(id = "username_entry")]
|
||||
#[template_child]
|
||||
pub username_entry: TemplateChild<gtk::Entry>,
|
||||
|
||||
#[template_child(id = "token_entry")]
|
||||
#[template_child]
|
||||
pub token_entry: TemplateChild<gtk::Entry>,
|
||||
|
||||
#[template_child(id = "more_list")]
|
||||
#[template_child]
|
||||
pub more_list: TemplateChild<gtk::ListBox>,
|
||||
|
||||
#[template_child(id = "period_label")]
|
||||
#[template_child]
|
||||
pub period_label: TemplateChild<gtk::Label>,
|
||||
|
||||
#[template_child(id = "digits_label")]
|
||||
#[template_child]
|
||||
pub digits_label: TemplateChild<gtk::Label>,
|
||||
|
||||
#[template_child(id = "provider_entry")]
|
||||
#[template_child]
|
||||
pub provider_entry: TemplateChild<gtk::Entry>,
|
||||
|
||||
#[template_child(id = "method_label")]
|
||||
#[template_child]
|
||||
pub method_label: TemplateChild<gtk::Label>,
|
||||
|
||||
#[template_child(id = "provider_website_row")]
|
||||
#[template_child]
|
||||
pub provider_website_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
||||
#[template_child(id = "provider_help_row")]
|
||||
#[template_child]
|
||||
pub provider_help_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
||||
#[template_child(id = "algorithm_label")]
|
||||
#[template_child]
|
||||
pub algorithm_label: TemplateChild<gtk::Label>,
|
||||
|
||||
#[template_child(id = "counter_row")]
|
||||
#[template_child]
|
||||
pub counter_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
||||
#[template_child(id = "period_row")]
|
||||
#[template_child]
|
||||
pub period_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
||||
#[template_child(id = "provider_completion")]
|
||||
#[template_child]
|
||||
pub provider_completion: TemplateChild<gtk::EntryCompletion>,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ mod imp {
|
|||
|
||||
#[derive(Debug, CompositeTemplate)]
|
||||
pub struct QRCodePage {
|
||||
#[template_child(id = "image")]
|
||||
#[template_child]
|
||||
pub image: TemplateChild<gtk::Image>,
|
||||
#[template_child(id = "provider_label")]
|
||||
#[template_child]
|
||||
pub provider_label: TemplateChild<gtk::Label>,
|
||||
#[template_child(id = "account_label")]
|
||||
#[template_child]
|
||||
pub account_label: TemplateChild<gtk::Label>,
|
||||
#[template_child(id = "provider_website_row")]
|
||||
pub website_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
|
|
@ -24,15 +24,15 @@ mod imp {
|
|||
pub struct AccountRow {
|
||||
pub account: RefCell<Option<Account>>,
|
||||
pub actions: gio::SimpleActionGroup,
|
||||
#[template_child(id = "name_label")]
|
||||
#[template_child]
|
||||
pub name_label: TemplateChild<gtk::Label>,
|
||||
#[template_child(id = "name_entry")]
|
||||
#[template_child]
|
||||
pub name_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child(id = "edit_stack")]
|
||||
#[template_child]
|
||||
pub edit_stack: TemplateChild<gtk::Stack>,
|
||||
#[template_child(id = "copy_btn_stack")]
|
||||
#[template_child]
|
||||
pub copy_btn_stack: TemplateChild<gtk::Stack>,
|
||||
#[template_child(id = "otp_label")]
|
||||
#[template_child]
|
||||
pub otp_label: TemplateChild<gtk::Label>,
|
||||
}
|
||||
|
||||
|
|
|
@ -16,24 +16,18 @@ mod imp {
|
|||
use gtk::subclass::prelude::*;
|
||||
#[derive(CompositeTemplate)]
|
||||
pub struct PasswordPage {
|
||||
pub has_set_password: Cell<bool>,
|
||||
|
||||
#[template_child(id = "current_password_entry")]
|
||||
pub current_password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
|
||||
#[template_child(id = "password_entry")]
|
||||
pub password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
|
||||
#[template_child(id = "confirm_password_entry")]
|
||||
pub confirm_password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
|
||||
#[template_child(id = "current_password_row")]
|
||||
pub current_password_row: TemplateChild<libhandy::ActionRow>,
|
||||
|
||||
#[template_child(id = "password_img")]
|
||||
pub password_img: TemplateChild<gtk::Image>,
|
||||
|
||||
pub actions: OnceCell<gio::SimpleActionGroup>,
|
||||
pub has_set_password: Cell<bool>,
|
||||
#[template_child]
|
||||
pub current_password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
#[template_child]
|
||||
pub password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
#[template_child]
|
||||
pub confirm_password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
#[template_child]
|
||||
pub current_password_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child]
|
||||
pub password_img: TemplateChild<gtk::Image>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for PasswordPage {
|
||||
|
|
|
@ -30,18 +30,18 @@ mod imp {
|
|||
pub actions: gio::SimpleActionGroup,
|
||||
pub backup_actions: gio::SimpleActionGroup,
|
||||
pub restore_actions: gio::SimpleActionGroup,
|
||||
pub file_chooser: RefCell<Option<gtk::FileChooserNative>>,
|
||||
pub password_page: PasswordPage,
|
||||
#[template_child]
|
||||
pub backup_group: TemplateChild<libhandy::PreferencesGroup>,
|
||||
#[template_child]
|
||||
pub restore_group: TemplateChild<libhandy::PreferencesGroup>,
|
||||
#[template_child(id = "auto_lock_switch")]
|
||||
pub auto_lock: TemplateChild<gtk::Switch>,
|
||||
#[template_child(id = "dark_theme_switch")]
|
||||
pub dark_theme: TemplateChild<gtk::Switch>,
|
||||
#[template_child(id = "lock_timeout_spin_btn")]
|
||||
pub lock_timeout: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child(id = "backup_group")]
|
||||
pub backup_group: TemplateChild<libhandy::PreferencesGroup>,
|
||||
#[template_child(id = "restore_group")]
|
||||
pub restore_group: TemplateChild<libhandy::PreferencesGroup>,
|
||||
pub file_chooser: RefCell<Option<gtk::FileChooserNative>>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for PreferencesWindow {
|
||||
|
|
|
@ -16,19 +16,19 @@ mod imp {
|
|||
|
||||
#[derive(CompositeTemplate)]
|
||||
pub struct ProvidersDialog {
|
||||
#[template_child(id = "providers_list")]
|
||||
pub providers_list: TemplateChild<gtk::ListView>,
|
||||
#[template_child(id = "deck")]
|
||||
pub deck: TemplateChild<libhandy::Leaflet>,
|
||||
#[template_child(id = "search_entry")]
|
||||
pub search_entry: TemplateChild<gtk::SearchEntry>,
|
||||
#[template_child(id = "search_bar")]
|
||||
pub search_bar: TemplateChild<gtk::SearchBar>,
|
||||
#[template_child(id = "search_btn")]
|
||||
pub search_btn: TemplateChild<gtk::ToggleButton>,
|
||||
pub page: ProviderPage,
|
||||
pub actions: gio::SimpleActionGroup,
|
||||
pub filter_model: gtk::FilterListModel,
|
||||
#[template_child]
|
||||
pub providers_list: TemplateChild<gtk::ListView>,
|
||||
#[template_child]
|
||||
pub deck: TemplateChild<libhandy::Leaflet>,
|
||||
#[template_child]
|
||||
pub search_entry: TemplateChild<gtk::SearchEntry>,
|
||||
#[template_child]
|
||||
pub search_bar: TemplateChild<gtk::SearchBar>,
|
||||
#[template_child]
|
||||
pub search_btn: TemplateChild<gtk::ToggleButton>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for ProvidersDialog {
|
||||
|
|
|
@ -36,13 +36,13 @@ mod imp {
|
|||
pub struct ProviderImage {
|
||||
pub sender: Sender<ImageAction>,
|
||||
pub receiver: RefCell<Option<Receiver<ImageAction>>>,
|
||||
#[template_child(id = "stack")]
|
||||
pub stack: TemplateChild<gtk::Stack>,
|
||||
#[template_child(id = "image")]
|
||||
pub image: TemplateChild<gtk::Image>,
|
||||
#[template_child(id = "spinner")]
|
||||
pub spinner: TemplateChild<gtk::Spinner>,
|
||||
pub provider: RefCell<Option<Provider>>,
|
||||
#[template_child]
|
||||
pub stack: TemplateChild<gtk::Stack>,
|
||||
#[template_child]
|
||||
pub image: TemplateChild<gtk::Image>,
|
||||
#[template_child]
|
||||
pub spinner: TemplateChild<gtk::Spinner>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for ProviderImage {
|
||||
|
|
|
@ -16,12 +16,12 @@ mod imp {
|
|||
#[derive(Debug, CompositeTemplate)]
|
||||
pub struct ProvidersList {
|
||||
pub sender: OnceCell<Sender<Action>>,
|
||||
#[template_child(id = "providers_list")]
|
||||
pub providers_list: TemplateChild<gtk::ListBox>,
|
||||
#[template_child(id = "empty_img")]
|
||||
pub empty_img: TemplateChild<gtk::Image>,
|
||||
pub filter_model: gtk::FilterListModel,
|
||||
pub sorter: ProviderSorter,
|
||||
#[template_child]
|
||||
pub providers_list: TemplateChild<gtk::ListBox>,
|
||||
#[template_child]
|
||||
pub empty_img: TemplateChild<gtk::Image>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for ProvidersList {
|
||||
|
|
|
@ -22,34 +22,34 @@ mod imp {
|
|||
#[derive(Debug, CompositeTemplate)]
|
||||
pub struct ProviderPage {
|
||||
pub image: ProviderImage,
|
||||
#[template_child(id = "main_container")]
|
||||
pub main_container: TemplateChild<gtk::Box>,
|
||||
#[template_child(id = "name_entry")]
|
||||
pub name_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child(id = "period_spinbutton")]
|
||||
pub period_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child(id = "digits_spinbutton")]
|
||||
pub digits_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child(id = "default_counter_spinbutton")]
|
||||
pub default_counter_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child(id = "provider_website_entry")]
|
||||
pub provider_website_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child(id = "provider_help_entry")]
|
||||
pub provider_help_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child(id = "method_comborow")]
|
||||
pub method_comborow: TemplateChild<libhandy::ComboRow>,
|
||||
#[template_child(id = "algorithm_comborow")]
|
||||
pub algorithm_comborow: TemplateChild<libhandy::ComboRow>,
|
||||
#[template_child(id = "period_row")]
|
||||
pub period_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child(id = "digits_row")]
|
||||
pub digits_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child(id = "default_counter_row")]
|
||||
pub default_counter_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child(id = "title")]
|
||||
pub title: TemplateChild<gtk::Label>,
|
||||
pub methods_model: libhandy::EnumListModel,
|
||||
pub algorithms_model: libhandy::EnumListModel,
|
||||
#[template_child]
|
||||
pub main_container: TemplateChild<gtk::Box>,
|
||||
#[template_child]
|
||||
pub name_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child]
|
||||
pub period_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child]
|
||||
pub digits_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child]
|
||||
pub default_counter_spinbutton: TemplateChild<gtk::SpinButton>,
|
||||
#[template_child]
|
||||
pub provider_website_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child]
|
||||
pub provider_help_entry: TemplateChild<gtk::Entry>,
|
||||
#[template_child]
|
||||
pub method_comborow: TemplateChild<libhandy::ComboRow>,
|
||||
#[template_child]
|
||||
pub algorithm_comborow: TemplateChild<libhandy::ComboRow>,
|
||||
#[template_child]
|
||||
pub period_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child]
|
||||
pub digits_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child]
|
||||
pub default_counter_row: TemplateChild<libhandy::ActionRow>,
|
||||
#[template_child]
|
||||
pub title: TemplateChild<gtk::Label>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for ProviderPage {
|
||||
|
|
|
@ -25,13 +25,13 @@ mod imp {
|
|||
pub struct ProviderRow {
|
||||
pub image: ProviderImage,
|
||||
pub provider: RefCell<Option<Provider>>,
|
||||
#[template_child(id = "name_label")]
|
||||
#[template_child]
|
||||
pub name_label: TemplateChild<gtk::Label>,
|
||||
#[template_child(id = "accounts_list")]
|
||||
#[template_child]
|
||||
pub accounts_list: TemplateChild<gtk::ListBox>,
|
||||
#[template_child(id = "progress")]
|
||||
#[template_child]
|
||||
pub progress: TemplateChild<gtk::ProgressBar>,
|
||||
#[template_child(id = "header")]
|
||||
#[template_child]
|
||||
pub header: TemplateChild<gtk::Box>,
|
||||
}
|
||||
|
||||
|
|
|
@ -40,19 +40,19 @@ mod imp {
|
|||
pub providers: ProvidersList,
|
||||
pub qrcode_page: QRCodePage,
|
||||
pub model: OnceCell<ProvidersModel>,
|
||||
#[template_child(id = "search_entry")]
|
||||
#[template_child]
|
||||
pub search_entry: TemplateChild<gtk::SearchEntry>,
|
||||
#[template_child(id = "deck")]
|
||||
#[template_child]
|
||||
pub deck: TemplateChild<libhandy::Leaflet>,
|
||||
#[template_child(id = "container")]
|
||||
#[template_child]
|
||||
pub container: TemplateChild<gtk::Box>,
|
||||
#[template_child(id = "search_bar")]
|
||||
#[template_child]
|
||||
pub search_bar: TemplateChild<gtk::SearchBar>,
|
||||
#[template_child(id = "search_btn")]
|
||||
#[template_child]
|
||||
pub search_btn: TemplateChild<gtk::ToggleButton>,
|
||||
#[template_child(id = "password_entry")]
|
||||
#[template_child]
|
||||
pub password_entry: TemplateChild<gtk::PasswordEntry>,
|
||||
#[template_child(id = "locked_img")]
|
||||
#[template_child]
|
||||
pub locked_img: TemplateChild<gtk::Image>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue