diff --git a/astrodatagui/AstrodataGUI.py b/astrodatagui/AstrodataGUI.py index dc52096..c8de854 100644 --- a/astrodatagui/AstrodataGUI.py +++ b/astrodatagui/AstrodataGUI.py @@ -1,10 +1,26 @@ from PyQt5 import QtWidgets, uic import os +from .db.StarsDB import StarDB + +DB_FILENAME = "stars.db" + class AstrodataGUI(QtWidgets.QMainWindow): def __init__(self): super(AstrodataGUI, self).__init__() classFileDir = os.path.dirname(os.path.abspath(__file__)) absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui") uic.loadUi(absUiFilePath, self) - self.show() \ No newline at end of file + self.show() + + self.loadDB() + + def loadDB(self): + try: + self.starDB = StarDB.getInstance() + except: + self.showErrorMessage("DB Connection failed", + f"Could not connect to local database file {DB_FILENAME}") + + def showErrorMessage(self, title: str, msg: str): + return \ No newline at end of file