Pass config file for app to configure screen

This commit is contained in:
Debanjum Singh Solanky 2022-08-10 22:42:32 +03:00
parent 82a7059b6a
commit f63f11186f
2 changed files with 6 additions and 5 deletions

View file

@ -15,8 +15,9 @@ class ConfigureScreen(QtWidgets.QDialog):
3. Save the configuration to khoj.yml and start the server
"""
def __init__(self, parent=None):
def __init__(self, config_file, parent=None):
super(ConfigureScreen, self).__init__(parent=parent)
self.config_file = config_file
# Initialize Configure Window
self.setWindowFlags(Qt.WindowType.WindowStaysOnTopHint)

View file

@ -24,16 +24,16 @@ app.include_router(router)
def run():
# Load config from CLI
args = cli(sys.argv[1:])
# Setup Base GUI
gui = QtWidgets.QApplication([])
gui.setQuitOnLastWindowClosed(False)
configure_screen = ConfigureScreen()
configure_screen = ConfigureScreen(args.config_file)
tray = create_system_tray(gui, configure_screen)
tray.show()
# Load config from CLI
args = cli(sys.argv[1:])
# Trigger First Run Experience, if required
if args.config is None:
configure_screen.show()