Commit Graph

31 Commits

Author SHA1 Message Date
9e7350b087 Add an about page that calls out gtk-rs and the GUI development book 2024-02-19 18:41:38 -05:00
55b6327d42 Open the welcome screen if the database is not available 2024-02-19 16:27:11 -05:00
c14b20b79e Set up an application quit action group
This ties together a menu item, closing the main window, and Ctrl-Q into
the same action, which is to quit the application.
2024-02-19 11:58:01 -05:00
56ff5527ba Quit the application when the user clicks the header bar X 2024-02-19 09:49:20 -05:00
4acf034b8d Clean up warnings and remove printlns 2024-02-08 19:01:56 -05:00
1aff203afc Reload data when the user saves on the DayEdit panel
This required some big overhauls. The view model no longer takes records. It only takes the date that it is responsible for, and it will ask the database for records pertaining to that date. This means that once the view model has saved all of its records, it can simply reload those records from the database. This has the effect that as soon as the user moves from DayEdit back to DayDetail, all of the interesting information has been repopulated.
2024-02-08 19:01:56 -05:00
792e20d44b Add buttons with icons to represent workouts 2024-02-08 09:13:54 -05:00
9727d35116 Resolve clippy warnings
Warnings were mounting up. It was time to resolve them before attempting a massive rebase.
2024-02-07 23:36:03 -05:00
24276d172b Introduce the RecordProvider interface
DayDetailViewModel needs testing. I've worked out an improved API, and a set of tests to go along with it, and those can be made more easily with a mockable RecordProvider. So, in addition to stubbing out a bunch of tests, I've also created RecordProvider, mocked it, and implemented it for App.
2024-02-01 10:12:35 -05:00
96317f5692 Finish removing the previous record grouping
Now that the DayDetailViewModel knows to retrieve its own records, the grouping functions, and passing groups of records around, no longer make sens.
2024-02-01 10:08:18 -05:00
c1e797f3ae DayDetailViewModel now ignores records and directly retrieves data from App
This is preparatory work. Having the view model directly retrieve data both adds a degree of symmetry (it both gets data from and sends data to the app) and makes it possible for the view model to refresh itself when needing to revert data or after saving data.
2024-02-01 09:27:40 -05:00
7ec48ded5d Make the day summary use the view model 2024-01-20 17:04:20 -05:00
9bedb7a76c Tons of linting and get tests running again 2024-01-20 15:04:46 -05:00
1fe318068b Set up a view model for the day detail view 2024-01-20 11:16:31 -05:00
18e7e4fe2f Start setting up the day detail view model
I've created the view model and added a getter function for the weight.
I'm passing the view model now to the DayDetailView, DayDetail, and
DayEdit.

I'm starting to set up the Save function for the view model, draining
all of the updated records and saving them.

None of the components yet save any updates to the view model, so
updated_records is always going to be empty until I figure that out.
2024-01-18 09:00:08 -05:00
1e6555ef61 Create a day detail view
DayDetail, the component, I used to use as a view. Now I'm swapping
things out so that DayDetailView handles the view itself. The DayDetail
component will still show the details of the day, but I'll create a
DayEditComponent which is dedicated to showing the edit interface for
everything in a day.

The swapping will now happen in DayDetailView, not in DayDetail or an
even deeper component.
2024-01-15 15:53:01 -05:00
7bd4885b09 Save new information to the day detail view and to the historical view 2023-12-29 09:24:37 -05:00
f422e233a1 Record data to the database
This isn't recording real data. It's basically discarding all
information from the weight edit field. But it is creating a record.
2023-12-28 22:43:56 -05:00
04a48574d3 Develop a pattern to detect clicking outside of a focused child
Be able to respond to blur events and potentially be able to record weight.
2023-12-28 22:34:09 -05:00
383f809191 Open and style the day detail view and add it to the navigation stack 2023-12-28 22:31:07 -05:00
d269924827 Refactorings and dead code removal 2023-12-28 22:20:30 -05:00
8049859816 Clean up showing the welcome and historical screens
Swapping is now done in dedicated functions instead of a big pattern
match.

After selecting a database, the app window will apply the configuration
by opening the database, saving the path to configuration, and switching
to the historical view.
2023-12-28 21:45:55 -05:00
ac343a2af6 Switch from channel-based communication to async calls into the core 2023-12-28 19:09:12 -05:00
5cd0e822c6 Update to adwaita 1.4, and add a navigation page stack 2023-12-28 13:21:42 -05:00
fe5e4ed044 Save the views as their original widgets
This allows me to directly reference functions that occur on those
widgets without losing them behind a gtk::Widget upcast or needing to
later downcast them.
2023-12-28 12:59:29 -05:00
e30668ca8e Drop DateTimeTz from fitnesstrax 2023-12-28 12:51:50 -05:00
af8f9b0244 Generate some random data and feed it into hte historical view 2023-12-24 19:13:49 -05:00
1b3ca7439d Add styling to the day summary 2023-12-24 12:00:12 -05:00
43cd408e2c Start elaborating upon the HistoricalView
I've created the DaySummary structure and set up a list view to go into
the historical view. One hard-coded date is visible as a placeholder to
start filling things into the day summary.
2023-12-22 17:32:45 -05:00
3a728a51b4 Extract the application loop from the main file 2023-12-22 15:17:22 -05:00
f19090311b Extract all of the UI components into dedicated files 2023-12-22 15:17:22 -05:00