diff --git a/auratext/Components/ProjectManager.py b/auratext/Components/ProjectManager.py index 1a3a7d0..6b23117 100644 --- a/auratext/Components/ProjectManager.py +++ b/auratext/Components/ProjectManager.py @@ -94,8 +94,11 @@ def __init__(self, parent=None): self.main_layout.addWidget(self.scroll_area) + self.load_todos() + days_rem_till_bday = 5 + self.addCard_V(QIcon(f"{self.localappdata}/icons/explorer_filled.png"), f"{days_rem_till_bday}", "days remaining till birthday") @@ -106,3 +109,9 @@ def addCard_V(self, icon=None, title=None, content=None): def remove_project_from_recent(self): pass + + def load_todos(self): + self.cursor.execute('SELECT id, time, description, status FROM todos WHERE date = ?', (self.date,)) + todos = self.cursor.fetchall() + for name, path in todos: + self.addCard_V(QIcon(f"{self.localappdata}/icons/explorer_filled.png"), name, path) diff --git a/auratext/Core/window.py b/auratext/Core/window.py index 609aeaf..2330ab5 100644 --- a/auratext/Core/window.py +++ b/auratext/Core/window.py @@ -65,14 +65,14 @@ def __init__(self): # self._terminal_history = "" # project manager db init - self.conn = sqlite3.connect(f"{self.localappdata}/data/ProjectManager.db") + self.conn = sqlite3.connect(f"{self.local_app_data}/data/ProjectManager.db") self.dbcursor = self.conn.cursor() self.dbcursor.execute(''' - CREATE TABLE IF NOT EXISTS projects ( + CREATE TABLE IF NOT EXISTS projects( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, - path TEXT, + path TEXT ) ''')