AstrodataGUI: connect to db
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
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__()
|
||||
@@ -8,3 +12,15 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
||||
absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui")
|
||||
uic.loadUi(absUiFilePath, self)
|
||||
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
|
||||
Reference in New Issue
Block a user