aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-12 16:05:12 +0100
committerAkshay <[email protected]>2020-07-12 16:05:12 +0100
commit2b3ba619402a9d6a5408d35bb38ef31f7e488ec5 (patch)
tree2651b4271a4b6048ec2dc3d1c703f9d3b5f02395 /src/main.rs
parentf2b87509ac4b08444499a7bc61a9bc4a100c414b (diff)
remove unused imports, upgrade to cursive v0.15
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/main.rs b/src/main.rs
index 387dc64..2313201 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,5 @@
1#![allow(unused_must_use)] 1#![allow(unused_must_use)]
2 2
3use std::default::Default;
4
5mod app; 3mod app;
6mod command; 4mod command;
7mod habit; 5mod habit;
@@ -11,48 +9,18 @@ mod views;
11 9
12use crate::app::App; 10use crate::app::App;
13use crate::command::{open_command_window, Command}; 11use crate::command::{open_command_window, Command};
14use crate::habit::{Bit, Count, Habit};
15use crate::utils::{load_configuration_file, AppConfig}; 12use crate::utils::{load_configuration_file, AppConfig};
16 13
17use chrono::NaiveDate; 14use cursive::crossterm;
18use cursive::theme::{BaseColor, Color};
19use cursive::views::NamedView; 15use cursive::views::NamedView;
20use cursive::Cursive;
21use lazy_static::lazy_static; 16use lazy_static::lazy_static;
22use serde::{Deserialize, Serialize};
23 17
24lazy_static! { 18lazy_static! {
25 pub static ref CONFIGURATION: AppConfig = load_configuration_file(); 19 pub static ref CONFIGURATION: AppConfig = load_configuration_file();
26} 20}
27 21
28fn main() { 22fn main() {
29 let mut s = Cursive::crossterm().unwrap(); 23 let mut s = crossterm().unwrap();
30
31 // let mut gymming = Count::new("gym", 5);
32 // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 11), 7);
33 // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 12), 8);
34 // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 13), 9);
35 // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 14), 10);
36 // gymming.insert_entry(NaiveDate::from_ymd(2020, 5, 15), 11);
37
38 // let mut reading = Bit::new("read");
39 // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 11), true.into());
40 // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 12), false.into());
41 // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 13), true.into());
42 // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 14), false.into());
43 // reading.insert_entry(NaiveDate::from_ymd(2020, 5, 15), true.into());
44
45 // let mut walking = Bit::new("walk");
46 // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 11), true.into());
47 // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 12), false.into());
48 // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 13), true.into());
49 // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 14), false.into());
50 // walking.insert_entry(NaiveDate::from_ymd(2020, 5, 15), true.into());
51
52 // app.add_habit(Box::new(gymming));
53 // app.add_habit(Box::new(reading));
54 // app.add_habit(Box::new(walking));
55
56 let app = App::load_state(); 24 let app = App::load_state();
57 s.add_layer(NamedView::new("Main", app)); 25 s.add_layer(NamedView::new("Main", app));
58 s.add_global_callback(':', |s| open_command_window(s)); 26 s.add_global_callback(':', |s| open_command_window(s));