mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 00:34:40 +01:00
widgets: Use getters
This commit is contained in:
parent
621fcb0d6c
commit
e54cb27636
2 changed files with 6 additions and 10 deletions
|
@ -167,7 +167,7 @@ impl AccountDetailsPage {
|
|||
let dialog = ProvidersDialog::new(&model);
|
||||
dialog.create_with(&entry.text());
|
||||
dialog.connect_changed(move |_dialog, provider| {
|
||||
entry.set_selected_provider(Some(provider), true);
|
||||
entry.set_provider(Some(provider));
|
||||
});
|
||||
dialog.set_transient_for(window.as_ref());
|
||||
dialog.present();
|
||||
|
@ -188,8 +188,7 @@ impl AccountDetailsPage {
|
|||
if account.provider().method().is_event_based() {
|
||||
imp.counter_spinbutton.set_value(account.counter() as f64);
|
||||
}
|
||||
imp.provider_entry
|
||||
.set_selected_provider(Some(account.provider()), true);
|
||||
imp.provider_entry.set_provider(Some(account.provider()));
|
||||
self.set_provider(account.provider());
|
||||
imp.account_label.set_text(&account.name());
|
||||
imp.account.replace(Some(account.clone()));
|
||||
|
|
|
@ -109,7 +109,7 @@ mod imp {
|
|||
app.set_is_locked(false);
|
||||
app.restart_lock_timeout();
|
||||
win.set_view(View::Accounts);
|
||||
imp.model.get().unwrap().load();
|
||||
win.model().load();
|
||||
} else {
|
||||
imp.error_revealer.popup(&gettext("Wrong Password"));
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ impl Window {
|
|||
imp.deck.set_visible_child_name("accounts");
|
||||
imp.deck.set_can_navigate_back(false);
|
||||
if imp.providers.model().n_items() == 0 {
|
||||
if imp.model.get().unwrap().has_providers() {
|
||||
if self.model().has_providers() {
|
||||
// We do have at least one provider
|
||||
// the 0 items comes from the search filter, so let's show an empty search
|
||||
// page instead
|
||||
|
@ -280,11 +280,8 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn open_add_account(&self, otp_uri: Option<&OTPUri>) {
|
||||
let imp = self.imp();
|
||||
|
||||
let model = imp.model.get().unwrap();
|
||||
|
||||
let dialog = AccountAddDialog::new(model);
|
||||
let model = self.model();
|
||||
let dialog = AccountAddDialog::new(&model);
|
||||
dialog.set_transient_for(Some(self));
|
||||
if let Some(uri) = otp_uri {
|
||||
dialog.set_from_otp_uri(uri);
|
||||
|
|
Loading…
Add table
Reference in a new issue