aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-09-20 23:49:16 +0000
committerdam <dam@gudinoff>2022-09-20 23:49:16 +0000
commit48e32f34ecaab1bbe653cc84557f01b09a7f9efe (patch)
treeef072e04a35ab748b814c58e68f46ef919213397
parent4d7f6246b796352f87d4e62a1aec9a7eae283e43 (diff)
downloadtask-time-tracker-48e32f34ecaab1bbe653cc84557f01b09a7f9efe.tar.zst
task-time-tracker-48e32f34ecaab1bbe653cc84557f01b09a7f9efe.zip
Show symbol when viewing the archive.
-rw-r--r--main.c10
-rw-r--r--readme.md6
2 files changed, 8 insertions, 8 deletions
diff --git a/main.c b/main.c
index 87f9a4a..695498e 100644
--- a/main.c
+++ b/main.c
@@ -591,8 +591,6 @@ void update_total_timers(database_t *db) {
int64_t *d6 = &db->total_times[6];
memset(db->total_times, 7, sizeof(int64_t));
-// for (task_t *task = db->tasks; task < db->tasks + db->count; task++) {
-// int64_t *times = task->times;
for (size_t idx = 0; idx < db->count; idx++) {
int64_t *times = db->tasks[idx].times;
*d0 = add_time(*d0, times[0]);
@@ -603,7 +601,6 @@ void update_total_timers(database_t *db) {
*d5 = add_time(*d5, times[5]);
*d6 = add_time(*d6, times[6]);
}
-
}
@@ -727,6 +724,11 @@ void draw_tui(database_t *db) {
// Draw outer border.
box(stdscr, 0, 0);
+ // Draw edit symbol on title when in archive mode.
+ if (db == &archive) {
+ mvaddch(0, 0, ACS_DIAMOND);
+ }
+
// Draw column grids.
int x = 0;
for (int idx = 0; idx < NUM_OF_COLUMNS - 1; idx++) {
@@ -748,7 +750,7 @@ void draw_tui(database_t *db) {
if (idx_fdow > 0 && idx_fdow < 8) {
idx_fdow = ((idx - 1) + FIRST_DAY_OF_WEEK) % 7 + 1;
}
- int header_position = x + layout->alignment_offsets[idx_fdow];
+ int header_position = x + layout->alignment_offsets[idx_fdow];
mvaddstr(0, header_position, layout->table_headers[idx_fdow]);
x += layout->column_widths[idx_fdow];
}
diff --git a/readme.md b/readme.md
index 3624b9a..67d6809 100644
--- a/readme.md
+++ b/readme.md
@@ -28,10 +28,8 @@ Task Time Tracker
- Create function to recalculate them. Shouldn't take so long, right?
- Decide when this will run.
- check for overflow/underflow when adding/subtracting times;
-- [ ] How to show we're working with database or archive?
- - When showing archive, change the 1st column name from "TTT v1" to "Archive". Maybe include this on the layout types?
- - Maybe add a "app_mode" flag;
-- [ ] Maybe rename database to something else that goes along with archive.
+- [x] Show a symbol to let the user know when we're seeing the archive.
+- [ ] Maybe rename database to something else that goes along with archive: main_db;
- [ ] Cleanup `draw_tui`:
- Selected and active tasks should be drawn after everything else.
- Try printing each row;