From 11373742d701166f2580cfe67015eac012cda1a9 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Thu, 21 Dec 2023 12:20:20 -0800 Subject: Fix UI file loading --- src/add_entry_form.py | 3 ++- src/add_group_form.py | 3 ++- src/edit_entry_form.py | 3 ++- src/edit_group_form.py | 3 ++- src/main.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/add_entry_form.py b/src/add_entry_form.py index ff66a19..9a2d260 100644 --- a/src/add_entry_form.py +++ b/src/add_entry_form.py @@ -10,7 +10,8 @@ import src.db_sqlite as DB class addEntryForm(QDialog): def __init__(self, parent): super().__init__() - uic.loadUi(os.path.join("src", "add_entry_form.ui"), self) + uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), + "add_entry_form.ui"), self) self.initializeUI(parent) def initializeUI(self, parent): diff --git a/src/add_group_form.py b/src/add_group_form.py index 0d35777..4a543e4 100644 --- a/src/add_group_form.py +++ b/src/add_group_form.py @@ -13,7 +13,8 @@ class addGroupForm(QDialog): """ def __init__(self): super().__init__() - uic.loadUi(os.path.join("src", "add_group_form.ui"), self) + uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), + "add_group_form.ui"), self) self.initializeUI() def initializeUI(self): diff --git a/src/edit_entry_form.py b/src/edit_entry_form.py index c1d3664..3c7f8c2 100644 --- a/src/edit_entry_form.py +++ b/src/edit_entry_form.py @@ -16,7 +16,8 @@ class editEntryForm(QDialog): def __init__(self, id): self.id = id super().__init__() - uic.loadUi(os.path.join("src", "add_entry_form.ui"), self) + uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), + "add_entry_form.ui"), self) self.initializeUI() def initializeUI(self): diff --git a/src/edit_group_form.py b/src/edit_group_form.py index e29a0fb..cd01162 100644 --- a/src/edit_group_form.py +++ b/src/edit_group_form.py @@ -14,7 +14,8 @@ class editGroupForm(QDialog): def __init__(self, id): self.id = id super().__init__() - uic.loadUi(os.path.join("src", "add_group_form.ui"), self) + uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), + "add_group_form.ui"), self) self.initializeUI() def initializeUI(self): diff --git a/src/main.py b/src/main.py index 91ddeca..88e0cda 100644 --- a/src/main.py +++ b/src/main.py @@ -19,7 +19,8 @@ from src.rules_dialog import RulesDialog class AssignmentList(QMainWindow): def __init__(self): super().__init__() - uic.loadUi(os.path.join("src", "main.ui"), self) + uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), + "main.ui"), self) self.initializeUI() -- cgit