From 9531c6bf733a018babadfff70d91463356587173 Mon Sep 17 00:00:00 2001 From: Demi <2e3s19@gmail.com> Date: Thu, 5 Sep 2019 01:09:56 -0400 Subject: [PATCH] Reorganize settings page into a container --- Makefile | 1 + TODO.md | 10 +- spytrack/analyze/stats.py | 2 +- spytrack/config/default_config.py | 2 +- spytrack/gui/ui/main.ui | 331 ++++++++++++++++-------------- 5 files changed, 180 insertions(+), 166 deletions(-) diff --git a/Makefile b/Makefile index 2e08d84..43ef410 100644 --- a/Makefile +++ b/Makefile @@ -18,3 +18,4 @@ build-all: python setup.py sdist python setup.py clean rm -rf ./Spytrack.egg-info + zip -9 -r ./dist/spytrack.zip dist/spytrack diff --git a/TODO.md b/TODO.md index 3432c3f..b0ee0a5 100644 --- a/TODO.md +++ b/TODO.md @@ -13,15 +13,13 @@ ## Optimization - (1) Don't re-render if the window is hidden -- (1) Move out computations to a separate window +- (1) Move out computations to a separate thread - (1) Reduce memory footprint by [optimizing](https://habr.com/ru/post/455722/) events - (3) Don't intersect all events, only after the last intersected one - (3) Don't aggregate on all events, add to the intersection only the last events ## Configuration -- (1) The config file should be create from the default one -- (2) Put the configuration file to the local directory - (1) Add stop-list for app tracker - (2) Wildcard rules and special syntax for regexp rules - (1) Validate input forms @@ -29,13 +27,13 @@ ## UI - (2) Icon should change depending on the current project -- (4) Projects should be added, removed and edited in a separated UI rather than a config - (3) Change tray icon depending on a project and its completion - (2) "Add a rule" dialog to on double-click on project's event - (3) Inclusive and exclusive filtering for events on the selected project (for analyzing mismatches). Maybe a normal string with ES-like syntax: `+search1 +"search2 complex" -"search exclude"` for simplicity -- (2) Make projects settings collapsable +- (1) Make projects settings collapsable - (2) Edit start of the day +- (2) Add https://github.com/ActivityWatch/aw-webui to compensate the lack of features ## Projects @@ -45,8 +43,8 @@ # Planned fixes - (1) List of projects and their events should be updated after any start-end time change -- (2) Make AW web-ui link configurable - (2) Redraw chart on Today checkbox or date change +- (3) Regexp validation ## Refactoring diff --git a/spytrack/analyze/stats.py b/spytrack/analyze/stats.py index b1c59c6..349bd12 100644 --- a/spytrack/analyze/stats.py +++ b/spytrack/analyze/stats.py @@ -3,7 +3,7 @@ class PieChartData: - data: Dict[str, int] + data: Dict[str, float] def __init__(self) -> None: self.data = {} diff --git a/spytrack/config/default_config.py b/spytrack/config/default_config.py index f6d91c9..44e4d7b 100644 --- a/spytrack/config/default_config.py +++ b/spytrack/config/default_config.py @@ -1,7 +1,7 @@ default_yaml = """ daemon: host: http://localhost - port: 9011 + port: 5600 gui: interval: 5 projects: diff --git a/spytrack/gui/ui/main.ui b/spytrack/gui/ui/main.ui index 49fb09a..3bff1c9 100755 --- a/spytrack/gui/ui/main.ui +++ b/spytrack/gui/ui/main.ui @@ -68,188 +68,203 @@ - - - QFrame::NoFrame - - - QFrame::Plain - - + + 0 - - Qt::ScrollBarAlwaysOff - - - QAbstractScrollArea::AdjustIgnored - - - true - - + 0 0 768 - 599 + 535 - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - + + ActivityWatch server + + + + + + Port - - false + + + + + + 65535 - - ActivityWatch server + + + + + + Interval - - Qt::AlignCenter + + Qt::PlainText - - - QFormLayout::ExpandingFieldsGrow - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - Host - - - - - - - http://localhost - - - - - - - Port - - - - - - - 65535 - - - - - - - Interval - - - Qt::PlainText - - - - - - - QAbstractSpinBox::UpDownArrows - - - false - - - 10000 - - - - - - - Run local server - - - true - - - false - - - - - - - - - 0 - 0 - + + + + + + QAbstractSpinBox::UpDownArrows + + + false + + + 10000 + + + + + + + seconds + + + + + + + + + Run local server - - - 0 - 80 - + + true - - Projects + + false + + + + + + + Host - - Qt::AlignCenter + + + + + + http://localhost - + + + + + + 0 + 0 + 768 + 535 + + + + Projects + + - - - Qt::Vertical + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 - - - 20 - 40 - + + Qt::ScrollBarAlwaysOff - + + QAbstractScrollArea::AdjustIgnored + + + true + + + + + 0 + 0 + 756 + 523 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 80 + + + + Projects + + + Qt::AlignCenter + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + +