diff options
author | Ricky Kresslein <rk@lakoliu.com> | 2022-04-22 10:34:46 +0300 |
---|---|---|
committer | Ricky Kresslein <rk@lakoliu.com> | 2022-04-22 10:34:46 +0300 |
commit | 57a9ac96492ed141796dcf31a5e1199ea352fe35 (patch) | |
tree | 9e36c1439442ae7cc011a6563f12136211583927 /src/ui | |
parent | e3bb347a12ad929619a51b37f0ca48dcfe46b731 (diff) | |
download | Furtherance-57a9ac96492ed141796dcf31a5e1199ea352fe35.tar.zst |
Remove unnecessary function
Diffstat (limited to 'src/ui')
-rwxr-xr-x | src/ui/window.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/ui/window.rs b/src/ui/window.rs index 964cf64..2d3f9d4 100755 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -120,13 +120,6 @@ impl FurtheranceWindow { } } - // TODO remove function, just use set_sensitive - fn activate_task_input(&self, sensitive: bool) { - // Deactivate task_input while timer is running - let imp = imp::FurtheranceWindow::from_instance(self); - imp.task_input.set_sensitive(sensitive); - } - fn save_task(&self, start_time: DateTime<Local>, mut stop_time: DateTime<Local>) { // Save the most recent task to the database and clear the task_input field let imp = imp::FurtheranceWindow::from_instance(self); @@ -214,7 +207,7 @@ impl FurtheranceWindow { *imp2.running.lock().unwrap() = true; *start_time.borrow_mut() = Local::now(); - this.activate_task_input(false); + imp2.task_input.set_sensitive(false); let duration = Duration::new(1,0); timeout_add_local(duration, clone!(@strong this as this_clone => move || { let imp3 = imp::FurtheranceWindow::from_instance(&this_clone); @@ -239,7 +232,7 @@ impl FurtheranceWindow { *imp2.running.lock().unwrap() = false; button.set_icon_name("media-playback-start-symbolic"); this.set_watch_time("00:00:00"); - this.activate_task_input(true); + imp2.task_input.set_sensitive(true); this.save_task(*start_time.borrow(), *stop_time.borrow()); } })); |