mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +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
|
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)
|
super(ConfigureScreen, self).__init__(parent=parent)
|
||||||
|
self.config_file = config_file
|
||||||
|
|
||||||
# Initialize Configure Window
|
# Initialize Configure Window
|
||||||
self.setWindowFlags(Qt.WindowType.WindowStaysOnTopHint)
|
self.setWindowFlags(Qt.WindowType.WindowStaysOnTopHint)
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ app.include_router(router)
|
|||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
# Load config from CLI
|
||||||
|
args = cli(sys.argv[1:])
|
||||||
|
|
||||||
# Setup Base GUI
|
# Setup Base GUI
|
||||||
gui = QtWidgets.QApplication([])
|
gui = QtWidgets.QApplication([])
|
||||||
gui.setQuitOnLastWindowClosed(False)
|
gui.setQuitOnLastWindowClosed(False)
|
||||||
configure_screen = ConfigureScreen()
|
configure_screen = ConfigureScreen(args.config_file)
|
||||||
tray = create_system_tray(gui, configure_screen)
|
tray = create_system_tray(gui, configure_screen)
|
||||||
tray.show()
|
tray.show()
|
||||||
|
|
||||||
# Load config from CLI
|
|
||||||
args = cli(sys.argv[1:])
|
|
||||||
|
|
||||||
# Trigger First Run Experience, if required
|
# Trigger First Run Experience, if required
|
||||||
if args.config is None:
|
if args.config is None:
|
||||||
configure_screen.show()
|
configure_screen.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user