From 46d0902a36c8dbe4c7d0dacdb12556f70891df80 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 28 Oct 2020 07:03:48 +0100 Subject: [PATCH] gobjectify provider --- Cargo.lock | 2 +- Cargo.toml | 2 +- data/resources/ui/add_account.ui | 3 + .../2019-09-02-103718_create_accounts/up.sql | 9 +- .../2019-09-02-123920_create_providers/up.sql | 12 +- src/helpers/qrcode.rs | 0 src/main.rs | 2 - src/models/account.rs | 9 +- src/models/algorithm.rs | 38 +++ src/models/database.rs | 23 +- src/models/mod.rs | 4 +- src/models/provider.rs | 288 ++++++++++++++++-- src/models/providers.rs | 54 +++- src/schema.rs | 8 +- src/widgets/accounts/add.rs | 71 ++++- src/widgets/accounts/list.rs | 4 +- src/widgets/providers/list.rs | 3 +- src/widgets/window.rs | 2 +- 18 files changed, 435 insertions(+), 99 deletions(-) create mode 100644 src/helpers/qrcode.rs create mode 100644 src/models/algorithm.rs diff --git a/Cargo.lock b/Cargo.lock index 2555826..56e88a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ dependencies = [ name = "authenticator" version = "0.1.0" dependencies = [ + "anyhow 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", "diesel 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf 0.9.0 (git+https://github.com/gtk-rs/gdk-pixbuf)", "gdk4 0.1.0 (git+https://github.com/gtk-rs/gdk4)", "gettext-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index c396481..1c6a912 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ log = "0.4" gettext-rs= { version = "0.5", features = ["gettext-system"] } pretty_env_logger = "0.3" lazy_static = "1.3" -failure = "0.1" +anyhow = "1.0" diesel = { version = "1.4", features = ["sqlite", "r2d2"] } diesel_migrations = { version = "1.4" , features = ["sqlite"] } serde = "1.0" diff --git a/data/resources/ui/add_account.ui b/data/resources/ui/add_account.ui index 82fa3fb..cba9e40 100644 --- a/data/resources/ui/add_account.ui +++ b/data/resources/ui/add_account.ui @@ -149,6 +149,9 @@ Algorithm + + +