diff --git a/CHANGES.md b/CHANGES.md index 5287d94c..152800ec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.2.1] - 2024-02-11 +- Moved services bar to the top of the sidebar. +- Task details can now be expanded from within each task. + ## [0.2.0] - 2023-09-22 - Fixed issue where async tasks would overlap the results in the UI. - Implemented token refreshing for Microsoft To Do. diff --git a/Cargo.lock b/Cargo.lock index 982cd8f2..8d47a022 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,12 +538,13 @@ dependencies = [ [[package]] name = "done" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow", "chrono", "core_done", "derive-new", + "dirs", "futures", "gettext-rs", "glib", diff --git a/Cargo.toml b/Cargo.toml index b51bccea..a8e525a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "done" -version = "0.2.0" +version = "0.2.1" edition = "2021" authors = ["Eduardo Flores "] license = "MPL 2.0" @@ -26,6 +26,7 @@ tracing-subscriber = "0.3.16" reqwest = "0.11.18" futures = "0.3.28" libset = "0.1.6" +dirs = "5.0.1" [dependencies.relm4-icons] version = "0.7.0-alpha.1" diff --git a/PKGBUILD b/PKGBUILD index 32136f40..3af35b12 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=done-git pkgrel=1 -pkgver=0.2.0 +pkgver=0.2.1 pkgdesc="Done is a simple to do app that lets you combine your existing set of task providers into one database, easily." arch=('x86_64') url="https://github.com/edfloreshz/done" diff --git a/README.md b/README.md index c67a9aa5..9f59d6cf 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Our user-friendly app allows you to effortlessly consolidate your existing tasks |------------|-----------------------------------------| | Flathub | | | AUR | | +| Snap | Get it from the Snap Store| # Build diff --git a/core/src/models/task.rs b/core/src/models/task.rs index 662f238d..49d44647 100644 --- a/core/src/models/task.rs +++ b/core/src/models/task.rs @@ -72,7 +72,7 @@ impl From for Task { priority: task.importance.into(), sub_tasks: task .checklist_items - .unwrap_or(vec![]) + .unwrap_or_default() .iter() .map(|item| item.clone().into()) .collect(), diff --git a/core/src/services/local/database/mod.rs b/core/src/services/local/database/mod.rs index 5f48a184..058737d2 100644 --- a/core/src/services/local/database/mod.rs +++ b/core/src/services/local/database/mod.rs @@ -7,6 +7,8 @@ use diesel_migrations::{ }; use libset::Config; +use crate::services::microsoft::service::APP_ID; + pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations"); pub const DATABASE_NAME: &str = "dev.edfloreshz.Done.db"; @@ -14,7 +16,7 @@ pub struct Database; impl Database { fn database_url() -> Result { - let url = Config::new("dev.edfloreshz.done", 1, Some("database"))? + let url = Config::new(APP_ID, 1, Some("database"))? .path(DATABASE_NAME, libset::FileType::Plain)?; Ok(url.display().to_string()) } diff --git a/core/src/services/microsoft/service.rs b/core/src/services/microsoft/service.rs index bcecb5b5..f192fadb 100644 --- a/core/src/services/microsoft/service.rs +++ b/core/src/services/microsoft/service.rs @@ -17,7 +17,7 @@ use graph_rs_sdk::{ use reqwest::StatusCode; use url::Url; -const APP_ID: &str = "dev.edfloreshz.Done"; +pub const APP_ID: &str = "dev.edfloreshz.Done"; const CLIENT_ID: &str = "75d8509b-cf9b-4245-9550-1e5f1d7c66e4"; const REDIRECT_URI: &str = "done://msft"; @@ -89,7 +89,7 @@ impl MicrosoftService { fn store_token(&mut self, token: AccessToken) -> Result<()> { keytar::set_password( - "dev.edfloreshz.Done", + APP_ID, "access_token", &serde_json::to_string(&token)?, ); @@ -165,7 +165,7 @@ impl TodoProvider for MicrosoftService { } fn logout(&self) -> anyhow::Result<()> { - keytar::delete_password("dev.edfloreshz.Done", "access_token")?; + keytar::delete_password(APP_ID, "access_token")?; Ok(()) } diff --git a/data/dev.edfloreshz.Done.metainfo.xml.in.in b/data/dev.edfloreshz.Done.metainfo.xml.in.in index 3ab7c98b..1628f021 100644 --- a/data/dev.edfloreshz.Done.metainfo.xml.in.in +++ b/data/dev.edfloreshz.Done.metainfo.xml.in.in @@ -45,6 +45,15 @@ https://hughsie.github.io/oars/index.html --> + + +

New design!

+
    +
  • Moved services bar to the top of the sidebar.
  • +
  • Task details can now be expanded from within each task.
  • +
+
+

Bug fixes

diff --git a/data/resources/screenshots/about.png b/data/resources/screenshots/about.png index ebb67ac3..e4810612 100644 Binary files a/data/resources/screenshots/about.png and b/data/resources/screenshots/about.png differ diff --git a/data/resources/screenshots/dark.png b/data/resources/screenshots/dark.png index 72b2a840..c325f92f 100644 Binary files a/data/resources/screenshots/dark.png and b/data/resources/screenshots/dark.png differ diff --git a/data/resources/screenshots/dark_details.png b/data/resources/screenshots/dark_details.png index 521aebf8..ca1a3efc 100644 Binary files a/data/resources/screenshots/dark_details.png and b/data/resources/screenshots/dark_details.png differ diff --git a/data/resources/screenshots/task_details.png b/data/resources/screenshots/task_details.png index e9ece644..39bcf804 100644 Binary files a/data/resources/screenshots/task_details.png and b/data/resources/screenshots/task_details.png differ diff --git a/data/resources/screenshots/tasks.png b/data/resources/screenshots/tasks.png index 3b7211b7..1e11d1a8 100644 Binary files a/data/resources/screenshots/tasks.png and b/data/resources/screenshots/tasks.png differ diff --git a/docs/index.html b/docs/index.html index fd815938..aba007ee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -101,7 +101,7 @@

diff --git a/meson.build b/meson.build index 85a9106f..5dc3c186 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('done', 'rust', - version: '0.2.0', + version: '0.2.1', license: ['MPL-2.0'], meson_version: '>= 0.59.0', default_options: [ 'warning_level=2'], diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a6f39e02..bfe7ce18 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -11,17 +11,17 @@ parts: plugin: rust source: . rust-channel: "1.76" - override-build: '' - override-prime: + override-build: "" + override-prime: done: after: [rustup] plugin: meson source: https://github.com/done-devs/done.git - source-tag: 'v0.2.0' + source-tag: "v0.2.1" source-depth: 1 build-environment: - - PATH: ${HOME}/.cargo/bin:$PATH + - PATH: ${HOME}/.cargo/bin:$PATH meson-parameters: - --prefix=/snap/done/current/usr parse-info: [usr/share/metainfo/dev.edfloreshz.Done.metainfo.xml] diff --git a/src/app/components/preferences.rs b/src/app/components/preferences.rs index 2abd135d..69a9840e 100644 --- a/src/app/components/preferences.rs +++ b/src/app/components/preferences.rs @@ -12,8 +12,8 @@ use relm4::{ gtk, AsyncComponentSender, }; -use crate::app::config::appearance::ColorScheme; use crate::app::config::preferences::Preferences; +use crate::app::config::{appearance::ColorScheme, info::APP_ID}; use crate::fl; #[derive(Debug)] @@ -115,12 +115,11 @@ impl AsyncComponent for PreferencesComponentModel { root: Self::Root, sender: AsyncComponentSender, ) -> AsyncComponentParts { - let preferences = - if let Ok(config) = Config::new("dev.edfloreshz.done", 1, None) { - config.get_json("preferences").unwrap_or(Preferences::new()) - } else { - Preferences::new() - }; + let preferences = if let Ok(config) = Config::new(APP_ID, 1, None) { + config.get_json("preferences").unwrap_or(Preferences::new()) + } else { + Preferences::new() + }; let model = Self { preferences }; @@ -187,7 +186,7 @@ impl AsyncComponent for PreferencesComponentModel { } fn update_preferences(preferences: &Preferences) -> Result<()> { - Config::new("dev.edfloreshz.done", 1, None)? + Config::new(APP_ID, 1, None)? .set_json::("preferences", preferences.to_owned())?; Ok(()) } diff --git a/src/app/config/appearance.rs b/src/app/config/appearance.rs index 1933f19b..84da35f3 100644 --- a/src/app/config/appearance.rs +++ b/src/app/config/appearance.rs @@ -3,7 +3,7 @@ use libset::Config; use relm4::adw; use serde::{Deserialize, Serialize}; -use super::preferences::Preferences; +use super::{info::APP_ID, preferences::Preferences}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub enum ColorScheme { @@ -19,7 +19,7 @@ impl Default for ColorScheme { } pub(crate) fn init() -> Result<()> { - let project = Config::new("dev.edfloreshz.done", 1, None).unwrap(); + let project = Config::new(APP_ID, 1, None).unwrap(); match project.get_json::("preferences") { Ok(preferences) => { let color_scheme = match preferences.color_scheme { diff --git a/src/app/config/info.rs b/src/app/config/info.rs index 6775e67f..9a6b3a33 100644 --- a/src/app/config/info.rs +++ b/src/app/config/info.rs @@ -7,4 +7,4 @@ pub const PROFILE: &str = ""; #[allow(dead_code)] pub const RESOURCES_FILE: &str = concat!("/usr/local/share/done", "/resources.gresource"); -pub const VERSION: &str = "0.2.0"; +pub const VERSION: &str = "0.2.1"; diff --git a/src/app/config/settings.rs b/src/app/config/settings.rs index 08f35c75..21b97498 100644 --- a/src/app/config/settings.rs +++ b/src/app/config/settings.rs @@ -2,15 +2,28 @@ use anyhow::Result; use core_done::services::local::database::{Database, DATABASE_NAME}; use libset::{Config, FileType}; -use super::preferences::Preferences; +use super::{info::APP_ID, preferences::Preferences}; pub(crate) fn init() -> Result<()> { - let config = Config::new("dev.edfloreshz.done", 1, None)?; - let database = Config::new("dev.edfloreshz.done", 1, Some("database"))?; + let config = Config::new(APP_ID, 1, None)?; + let database = Config::new(APP_ID, 1, Some("database"))?; + let database_path = database.path(DATABASE_NAME, FileType::Plain)?; + + let previous_database_path = dirs::data_dir() + .unwrap() + .join("done") + .join("dev.edfloreshz.Done.db"); + + if previous_database_path.exists() { + let db = std::fs::read(&previous_database_path)?; + std::fs::write(&database_path, db)?; + std::fs::remove_dir_all(previous_database_path.parent().unwrap())?; + } + if !config.path("preferences", FileType::Json)?.exists() { config.set_json("preferences", Preferences::new())?; } - if !database.path(DATABASE_NAME, FileType::Plain)?.exists() { + if !database_path.exists() { database.set_plain(DATABASE_NAME, String::new())?; } @@ -20,6 +33,6 @@ pub(crate) fn init() -> Result<()> { } pub(crate) fn refresh() -> Result<()> { - Config::new("dev.edfloreshz.done", 1, None)?.clean()?; + Config::new(APP_ID, 1, None)?.clean()?; init() } diff --git a/src/app/factories/task.rs b/src/app/factories/task.rs index f81bf280..e2d01b12 100644 --- a/src/app/factories/task.rs +++ b/src/app/factories/task.rs @@ -331,7 +331,7 @@ impl AsyncFactoryComponent for TaskModel { set_spacing: 6, gtk::SpinButton { set_adjustment: >k::Adjustment::new( - self.task.reminder_date.unwrap_or_default().time().hour().try_into().unwrap_or(0.0), 0.0, 23.0, 1.0, 1.0, 0.0 + self.task.reminder_date.unwrap_or_default().time().hour() as f64, 0.0, 23.0, 1.0, 1.0, 0.0 ), set_orientation: gtk::Orientation::Vertical, set_wrap: true, @@ -349,7 +349,7 @@ impl AsyncFactoryComponent for TaskModel { }, gtk::SpinButton { set_adjustment: >k::Adjustment::new( - self.task.reminder_date.unwrap_or_default().time().minute().try_into().unwrap_or(0.0), 0.0, 59.0, 1.0, 1.0, 0.0 + self.task.reminder_date.unwrap_or_default().time().minute() as f64, 0.0, 59.0, 1.0, 1.0, 0.0 ), set_orientation: gtk::Orientation::Vertical, set_wrap: true,