From d9291c4832e416aae68d15cfbe1e5141a3637e15 Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Sun, 12 Jun 2022 21:10:01 +0200 Subject: fix: #68 --- src/database.rs | 10 ---------- src/gtk/dialogs.ui | 23 ++++++++++++----------- src/ui/window.rs | 5 ----- 3 files changed, 12 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/database.rs b/src/database.rs index 10e4bef..8a8b966 100755 --- a/src/database.rs +++ b/src/database.rs @@ -16,7 +16,6 @@ use chrono::{DateTime, Local}; use directories::ProjectDirs; -use gtk::glib; use rusqlite::{Connection, Result}; use std::convert::TryFrom; use std::fs::create_dir_all; @@ -41,13 +40,9 @@ pub struct Task { Ord, num_derive::FromPrimitive, num_derive::ToPrimitive, - glib::Enum, )] -#[enum_type(name = "SortOrder")] pub enum SortOrder { - #[enum_value(name = "Ascending", nick = "Ascending")] Ascending = 0, - #[enum_value(name = "Descending", nick = "Descending")] Descending, } @@ -86,15 +81,10 @@ impl SortOrder { Ord, num_derive::ToPrimitive, num_derive::FromPrimitive, - glib::Enum, )] -#[enum_type(name = "TaskSort")] pub enum TaskSort { - #[enum_value(name = "StartTime", nick = "Start time")] StartTime, - #[enum_value(name = "StopTime", nick = "Stop time")] StopTime, - #[enum_value(name = "TaskName", nick = "Task name")] TaskName, } diff --git a/src/gtk/dialogs.ui b/src/gtk/dialogs.ui index e419e45..ef141e0 100644 --- a/src/gtk/dialogs.ui +++ b/src/gtk/dialogs.ui @@ -68,26 +68,27 @@ Sort by - - TaskSort + + + Start time + Stop time + Task name + - - - Sort order - - SortOrder + + + Ascending + Descending + - - - @@ -97,4 +98,4 @@ - + \ No newline at end of file diff --git a/src/ui/window.rs b/src/ui/window.rs index 5670696..1371eb1 100755 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -40,8 +40,6 @@ use crate::ui::FurHistoryBox; use crate::FurtheranceApplication; mod imp { - use crate::database::{SortOrder, TaskSort}; - use super::*; #[derive(Debug, Default, CompositeTemplate)] @@ -87,8 +85,6 @@ mod imp { fn class_init(klass: &mut Self::Class) { FurHistoryBox::static_type(); - TaskSort::static_type(); - SortOrder::static_type(); Self::bind_template(klass); } @@ -916,7 +912,6 @@ impl FurtheranceWindow { let imp = imp::FurtheranceWindow::from_instance(self); imp.win_box.set_valign(align); } - } impl Default for FurtheranceWindow { -- cgit 1.4.1