This commit introduces `__init__.py` files to the `timelogix` and
`timelogix/ui` directories, enabling Python to recognize them as
packages.
- Added empty `__init__.py` files to `timelogix` and `timelogix/ui`.
This commit creates a dedicated entry point `main.py`, instantiates
the application components, and handles the WM_DELETE_WINDOW protocol.
- Removed window creation and mainloop from previous file.
- Created a dedicated entry point with basic error handling.
- Implemented an on_closing protocol to properly close db and exit application
- Implemented the loading of database objects.
This commit refactors the main application window into a `MainWindow`
class. This improves code organization and facilitates unit testing
of the UI.
- Created `MainWindow` class inheriting from `ctk.CTk`.
- Moved UI elements and logic into the `MainWindow` class.
- Modified methods to use the Database and PDFExporter classes.
- Implemented load_log_entries to refresh log entries
This commit centralizes the creation of common UI components into
`ui/components.py`, promoting code reuse and consistency.
- Created functions for creating labels, entries, buttons, combos,
and text boxes.
- Replaced direct widget creation in MainWindow with calls to
these functions.
This commit introduces a `PDFExporter` class to handle PDF invoice
generation logic. This separates PDF creation from the main
application logic, improving modularity.
- Created PDFExporter class with methods for generating PDF invoices.
- Moved PDF generation code from MainWindow to PDFExporter.
- Added attributes for company and client information.
This commit introduces a `Database` class to encapsulate all
database-related operations. This improves code organization,
testability, and maintainability.
- Created Database class with methods for creating tables,
loading/saving projects, log entries, and settings.
- Added error handling for database connection and operations.
- Implemented methods to load and save invoice numbers.
- Replaced direct database access with Database class methods.
- Added `invoice_file` attribute to store the filename where the invoice number is persisted.
- Implemented `load_invoice_number` to read the last invoice number from the file on app startup. If the file doesn't exist or contains an invalid number, it defaults to 1.
- Implemented `save_invoice_number` to persist the incremented invoice number to the file after generating a PDF.
- Modified `export_to_pdf` to increment and save the invoice number after successful PDF generation.