mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Pass config file for app to configure screen
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user