about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xCargo.lock50
-rwxr-xr-xCargo.toml9
-rw-r--r--po/Furtherance.pot18
-rwxr-xr-xsrc/application.rs1
-rwxr-xr-xsrc/gtk/preferences_window.ui1
-rwxr-xr-xsrc/gtk/task_row.ui26
-rwxr-xr-xsrc/ui/preferences_window.rs1
-rwxr-xr-xsrc/ui/task_details.rs24
-rwxr-xr-xsrc/ui/task_row.rs9
-rwxr-xr-xsrc/ui/window.rs3
10 files changed, 89 insertions, 53 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a1b6112..7e20984 100755
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -306,9 +306,9 @@ dependencies = [
 
 [[package]]
 name = "gdk4"
-version = "0.4.7"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4a2fc0bd03d59383fc10b71a8cb731a1fac2998732a36a0c03e9b1de1513218"
+checksum = "4fabb7cf843c26b085a5d68abb95d0c0bf27a9ae2eeff9c4adb503a1eb580876"
 dependencies = [
  "bitflags",
  "cairo-rs",
@@ -322,9 +322,9 @@ dependencies = [
 
 [[package]]
 name = "gdk4-sys"
-version = "0.4.2"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48a39e34abe35ee2cf54a1e29dd983accecd113ad30bdead5050418fa92f2a1b"
+checksum = "efe7dcb44f5c00aeabff3f69abfc5673de46559070f89bd3fbb7b66485d9cef2"
 dependencies = [
  "cairo-sys-rs",
  "gdk-pixbuf-sys",
@@ -479,9 +479,9 @@ dependencies = [
 
 [[package]]
 name = "gsk4"
-version = "0.4.7"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14d5a47a78c682bb67496b562495ed84972c0512ba0654888c4dc92b80a85bd3"
+checksum = "05e9020d333280b3aa38d496495bfa9b50712eebf1ad63f0ec5bcddb5eb61be4"
 dependencies = [
  "bitflags",
  "cairo-rs",
@@ -495,9 +495,9 @@ dependencies = [
 
 [[package]]
 name = "gsk4-sys"
-version = "0.4.2"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e31d21d7ce02ba261bb24c50c4ab238a10b41a2c97c32afffae29471b7cca69b"
+checksum = "7add39ccf60078508c838643a2dcc91f045c46ed63b5ea6ab701b2e25bda3fea"
 dependencies = [
  "cairo-sys-rs",
  "gdk4-sys",
@@ -511,9 +511,9 @@ dependencies = [
 
 [[package]]
 name = "gtk4"
-version = "0.4.6"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e841556e3fe55d8a43ada76b7b08a5f65570bbdfe3b8f72c333053b8832c626"
+checksum = "c64f0c2a3d80e899dc3febddad5bac193ffcf74a0fd7e31037f30dd34d6f7396"
 dependencies = [
  "bitflags",
  "cairo-rs",
@@ -534,23 +534,24 @@ dependencies = [
 
 [[package]]
 name = "gtk4-macros"
-version = "0.4.3"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "573db42bb64973a4d5f718b73caa7204285a1a665308a23b11723d0ee56ec305"
+checksum = "fafbcc920af4eb677d7d164853e7040b9de5a22379c596f570190c675d45f7a7"
 dependencies = [
  "anyhow",
  "proc-macro-crate",
  "proc-macro-error",
  "proc-macro2",
+ "quick-xml",
  "quote",
  "syn",
 ]
 
 [[package]]
 name = "gtk4-sys"
-version = "0.4.5"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c47c075e8f795c38f6e9a47b51a73eab77b325f83c0154979ed4d4245c36490d"
+checksum = "5bc8006eea634b7c72da3ff79e24606e45f21b3b832a3c5a1f543f5f97eb0f63"
 dependencies = [
  "cairo-sys-rs",
  "gdk-pixbuf-sys",
@@ -662,9 +663,9 @@ dependencies = [
 
 [[package]]
 name = "libsqlite3-sys"
-version = "0.23.2"
+version = "0.24.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58"
+checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14"
 dependencies = [
  "pkg-config",
  "vcpkg",
@@ -766,9 +767,9 @@ dependencies = [
 
 [[package]]
 name = "once_cell"
-version = "1.9.0"
+version = "1.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
+checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
 
 [[package]]
 name = "pango"
@@ -866,6 +867,15 @@ dependencies = [
 ]
 
 [[package]]
+name = "quick-xml"
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
 name = "quote"
 version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -912,9 +922,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
 
 [[package]]
 name = "rusqlite"
-version = "0.26.3"
+version = "0.27.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ba4d3462c8b2e4d7f4fcfcf2b296dc6b65404fbbc7b63daa37fd485c149daf7"
+checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a"
 dependencies = [
  "bitflags",
  "fallible-iterator",
diff --git a/Cargo.toml b/Cargo.toml
index 6adf376..97078f2 100755
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,21 +6,20 @@ edition = "2018"
 
 [dependencies]
 gettext-rs = { version = "0.7", features = ["gettext-system"] }
-rusqlite = "0.26.3"
+rusqlite = "0.27.0"
 chrono = "0.4"
 directories = "4.0"
-once_cell = "1.9.0"
+once_cell = "1.12.0"
 dbus = "0.9.5"
 dbus-codegen = "0.10.0"
 log = "0.4"
-gtk4-macros = "=0.4.3"
+gtk4-macros = "0.4.8"
 itertools = "0.10.3"
 
 [dependencies.gtk]
 package = "gtk4"
-version = "=0.4.6"
+version = "0.4.8"
 
 [dependencies.adw]
 package = "libadwaita"
 version = "0.1.1"
-
diff --git a/po/Furtherance.pot b/po/Furtherance.pot
index 154118e..ea2fd5b 100644
--- a/po/Furtherance.pot
+++ b/po/Furtherance.pot
@@ -318,7 +318,7 @@ msgstr ""
 msgid "Delete all"
 msgstr ""
 
-#: src/gtk/task_row.ui:45
+#: src/gtk/task_row.ui:47
 msgid "Time"
 msgstr ""
 
@@ -419,12 +419,12 @@ msgstr ""
 msgid "Edit Task"
 msgstr ""
 
-#: src/ui/task_details.rs:210 src/ui/window.rs:355
-msgid "*Use the format MMM DD YYYY HH:MM:SS"
+#: src/ui/task_details.rs:210
+msgid "*Use your local format XX/XX/XX HH:MM:SS"
 msgstr ""
 
-#: src/ui/task_details.rs:212 src/ui/window.rs:357
-msgid "*Use the format MMM DD YYYY HH:MM"
+#: src/ui/task_details.rs:212
+msgid "*Use your local format XX/XX/XX HH:MM"
 msgstr ""
 
 #: src/ui/task_details.rs:218 src/ui/window.rs:363
@@ -483,6 +483,14 @@ msgstr ""
 msgid "tags"
 msgstr ""
 
+#: src/ui/window.rs:355
+msgid "*Use the format MMM DD YYYY HH:MM:SS"
+msgstr ""
+
+#: src/ui/window.rs:357
+msgid "*Use the format MMM DD YYYY HH:MM"
+msgstr ""
+
 #: src/ui/window.rs:373
 msgid "*Task name cannot be blank."
 msgstr ""
diff --git a/src/application.rs b/src/application.rs
index 6050af3..ad6ee51 100755
--- a/src/application.rs
+++ b/src/application.rs
@@ -302,3 +302,4 @@ impl Default for FurtheranceApplication {
     }
 }
 
+
diff --git a/src/gtk/preferences_window.ui b/src/gtk/preferences_window.ui
index be331b7..e6fd65b 100755
--- a/src/gtk/preferences_window.ui
+++ b/src/gtk/preferences_window.ui
@@ -210,3 +210,4 @@
     </child>
   </template>
 </interface>
+
diff --git a/src/gtk/task_row.ui b/src/gtk/task_row.ui
index f5de3a5..7184bc3 100755
--- a/src/gtk/task_row.ui
+++ b/src/gtk/task_row.ui
@@ -4,8 +4,8 @@
     <child>
       <object class="GtkBox" id="row_box">
         <property name="orientation">horizontal</property>
-        <property name="margin_top">10</property>
-        <property name="margin_bottom">10</property>
+        <property name="margin_top">5</property>
+        <property name="margin_bottom">5</property>
         <property name="margin_end">12</property>
         <property name="margin_start">12</property>
         <property name="hexpand">True</property>
@@ -40,13 +40,23 @@
           </object>
         </child>
         <child>
-          <object class="GtkLabel" id="total_time_label">
+          <object class="GtkBox">
             <property name="halign">end</property>
-            <property name="label" translatable="yes">Time</property>
-            <property name="single_line_mode">True</property>
-            <style>
-              <class name="numeric"/>
-            </style>
+            <child>
+              <object class="GtkLabel" id="total_time_label">
+                <property name="label" translatable="yes">Time</property>
+                <property name="single_line_mode">True</property>
+                <style>
+                  <class name="numeric"/>
+                </style>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton" id="restart_task_btn">
+                <property name="icon-name">view-refresh-symbolic</property>
+                <property name="has-frame">false</property>
+              </object>
+            </child>
           </object>
         </child>
       </object>
diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs
index d034a9f..d9495fd 100755
--- a/src/ui/preferences_window.rs
+++ b/src/ui/preferences_window.rs
@@ -253,3 +253,4 @@ impl FurPreferencesWindow {
     }
 }
 
+
diff --git a/src/ui/task_details.rs b/src/ui/task_details.rs
index 0ca40ce..37eced3 100755
--- a/src/ui/task_details.rs
+++ b/src/ui/task_details.rs
@@ -113,7 +113,7 @@ impl FurTaskDetails {
 
         imp.task_name_label.set_text(&task_group[0].task_name);
         let this_day_str = DateTime::parse_from_rfc3339(&task_group[0].start_time).unwrap();
-        *imp.this_day.borrow_mut() = this_day_str.format("%h %d %Y").to_string();
+        *imp.this_day.borrow_mut() = this_day_str.format("%x").to_string();
         *imp.orig_tags.borrow_mut() = task_group[0].tags.clone();
 
         for task in task_group.clone() {
@@ -193,13 +193,13 @@ impl FurTaskDetails {
                 let times_box = gtk::Box::new(gtk::Orientation::Horizontal, 5);
                 times_box.set_homogeneous(true);
 
-                let mut start_time_w_year = start_time.format("%h %d %Y %H:%M:%S").to_string();
+                let mut start_time_w_year = start_time.format("%x %H:%M:%S").to_string();
                 if !settings_manager::get_bool("show-seconds") {
-                    start_time_w_year = start_time.format("%h %d %Y %H:%M").to_string();
+                    start_time_w_year = start_time.format("%x %H:%M").to_string();
                 }
-                let mut stop_time_w_year = stop_time.format("%h %d %Y %H:%M:%S").to_string();
+                let mut stop_time_w_year = stop_time.format("%x %H:%M:%S").to_string();
                 if !settings_manager::get_bool("show-seconds") {
-                    stop_time_w_year = stop_time.format("%h %d %Y %H:%M").to_string();
+                    stop_time_w_year = stop_time.format("%x %H:%M").to_string();
                 }
                 let start_time_edit = gtk::Entry::new();
                 start_time_edit.set_text(&start_time_w_year);
@@ -207,9 +207,9 @@ impl FurTaskDetails {
                 stop_time_edit.set_text(&stop_time_w_year);
 
                 let instructions = gtk::Label::new(Some(
-                    &gettext("*Use the format MMM DD YYYY HH:MM:SS")));
+                    &gettext("*Use your local format XX/XX/XX HH:MM:SS")));
                 if !settings_manager::get_bool("show-seconds") {
-                    instructions.set_text(&gettext("*Use the format MMM DD YYYY HH:MM"));
+                    instructions.set_text(&gettext("*Use your local format XX/XX/XX HH:MM"));
                 }
                 instructions.set_visible(false);
                 instructions.add_css_class("error_message");
@@ -309,11 +309,11 @@ impl FurTaskDetails {
                                 if settings_manager::get_bool("show-seconds") {
                                     new_start_time = NaiveDateTime::parse_from_str(
                                                         &new_start_time_str,
-                                                        "%h %d %Y %H:%M:%S");
+                                                        "%x %H:%M:%S");
                                 } else {
                                     new_start_time = NaiveDateTime::parse_from_str(
                                                             &new_start_time_str,
-                                                            "%h %d %Y %H:%M");
+                                                            "%x %H:%M");
                                 }
                                 if let Err(_) = new_start_time {
                                     instructions.set_visible(true);
@@ -330,11 +330,11 @@ impl FurTaskDetails {
                                 if settings_manager::get_bool("show-seconds") {
                                     new_stop_time = NaiveDateTime::parse_from_str(
                                                         &new_stop_time_str,
-                                                        "%h %d %Y %H:%M:%S");
+                                                        "%x %H:%M:%S");
                                 } else {
                                     new_stop_time = NaiveDateTime::parse_from_str(
                                                             &new_stop_time_str,
-                                                            "%h %d %Y %H:%M");
+                                                            "%x %H:%M");
                                 }
                                 if let Err(_) = new_stop_time {
                                     instructions.set_visible(true);
@@ -435,7 +435,7 @@ impl FurTaskDetails {
         updated_list.retain(|task| {
             let delete = {
                 let start_time = DateTime::parse_from_rfc3339(&task.start_time).unwrap();
-                let start_time_str = start_time.format("%h %d %Y").to_string();
+                let start_time_str = start_time.format("%x").to_string();
                 if imp.this_day.borrow().to_string() != start_time_str
                     || imp.task_name_label.text() != task.task_name
                     || imp.orig_tags.borrow().to_string() != task.tags {
diff --git a/src/ui/task_row.rs b/src/ui/task_row.rs
index 0e46d81..cccc827 100755
--- a/src/ui/task_row.rs
+++ b/src/ui/task_row.rs
@@ -42,6 +42,8 @@ mod imp {
         pub task_tags_label: TemplateChild<gtk::Label>,
         #[template_child]
         pub total_time_label: TemplateChild<gtk::Label>,
+        #[template_child]
+        pub restart_task_btn: TemplateChild<gtk::Button>,
 
         pub tasks: Lazy<Mutex<Vec<Task>>>,
         pub total_time: RefCell<i64>,
@@ -116,8 +118,6 @@ impl FurTaskRow {
         } else {
             let task_tags = format!("#{}", task_list[0].tags);
             imp.task_tags_label.set_text(&task_tags);
-            imp.row_box.set_margin_top(5);
-            imp.row_box.set_margin_bottom(5);
         }
 
         // Create right-click gesture
@@ -131,6 +131,11 @@ impl FurTaskRow {
 
         self.add_controller(&gesture);
 
+        imp.restart_task_btn.connect_clicked(clone!(@strong task_list => move |_| {
+            let window = FurtheranceWindow::default();
+            window.duplicate_task(task_list[0].clone());
+        }));
+
         // Add up all durations for task of said name to create total_time
         for task in &task_list {
             if task.task_name == task.task_name {
diff --git a/src/ui/window.rs b/src/ui/window.rs
index 5b7d647..992bc9f 100755
--- a/src/ui/window.rs
+++ b/src/ui/window.rs
@@ -752,7 +752,7 @@ impl FurtheranceWindow {
         }
     }
 
-    pub fn refresh_timer (&self) {
+    pub fn refresh_timer(&self) {
         let imp = imp::FurtheranceWindow::from_instance(self);
         if settings_manager::get_bool("pomodoro") {
             let mut mins = settings_manager::get_int("pomodoro-time");
@@ -778,3 +778,4 @@ impl Default for FurtheranceWindow {
             .unwrap()
     }
 }
+