Rename configure window to more generic configure screen

This commit is contained in:
Debanjum Singh Solanky
2022-08-09 22:41:23 +03:00
parent c50ab7c3ad
commit 3c788f1d29
3 changed files with 9 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ from PyQt6 import QtWidgets
from PyQt6.QtCore import Qt from PyQt6.QtCore import Qt
class ConfigureWindow(QtWidgets.QDialog): class ConfigureScreen(QtWidgets.QDialog):
"""Create Window to Configure Khoj """Create Window to Configure Khoj
Allow user to Allow user to
1. Enable/Disable search on 1. org-mode, 2. markdown, 3. beancount or 4. image content types 1. Enable/Disable search on 1. org-mode, 2. markdown, 3. beancount or 4. image content types
@@ -12,7 +12,7 @@ class ConfigureWindow(QtWidgets.QDialog):
""" """
def __init__(self, parent=None): def __init__(self, parent=None):
super(ConfigureWindow, self).__init__(parent=parent) super(ConfigureScreen, self).__init__(parent=parent)
# Initialize Configure Window # Initialize Configure Window
self.setWindowTitle("Khoj - Configure") self.setWindowTitle("Khoj - Configure")

View File

@@ -8,11 +8,11 @@ from PyQt6 import QtGui, QtWidgets
from src.utils import constants from src.utils import constants
def create_system_tray(gui: QtWidgets.QApplication, window: QtWidgets.QMainWindow): def create_system_tray(gui: QtWidgets.QApplication, configure_screen: QtWidgets.QDialog):
"""Create System Tray with Menu """Create System Tray with Menu
Menu Actions should contain Menu Actions should contain
1. option to open search page at localhost:8000/ 1. option to open search page at localhost:8000/
2. option to open config page at localhost:8000/config 2. option to open config screen
3. to quit 3. to quit
""" """
@@ -26,7 +26,7 @@ def create_system_tray(gui: QtWidgets.QApplication, window: QtWidgets.QMainWindo
menu = QtWidgets.QMenu() menu = QtWidgets.QMenu()
menu_actions = [ menu_actions = [
('Search', lambda: webbrowser.open('http://localhost:8000/')), ('Search', lambda: webbrowser.open('http://localhost:8000/')),
('Configure', window.show), ('Configure', configure_screen.show),
('Quit', gui.quit), ('Quit', gui.quit),
] ]

View File

@@ -13,7 +13,7 @@ from src.configure import configure_server
from src.router import router from src.router import router
from src.utils import constants from src.utils import constants
from src.utils.cli import cli from src.utils.cli import cli
from src.interface.desktop.configure_window import ConfigureWindow from src.interface.desktop.configure_screen import ConfigureScreen
from src.interface.desktop.system_tray import create_system_tray from src.interface.desktop.system_tray import create_system_tray
@@ -27,8 +27,8 @@ def run():
# Setup Base GUI # Setup Base GUI
gui = QtWidgets.QApplication([]) gui = QtWidgets.QApplication([])
gui.setQuitOnLastWindowClosed(False) gui.setQuitOnLastWindowClosed(False)
window = ConfigureWindow() configure_screen = ConfigureScreen()
tray = create_system_tray(gui, window) tray = create_system_tray(gui, configure_screen)
tray.show() tray.show()
# Load config from CLI # Load config from CLI
@@ -36,7 +36,7 @@ def run():
# Trigger First Run Experience, if required # Trigger First Run Experience, if required
if args.config is None: if args.config is None:
window.show() configure_screen.show()
gui.exec() gui.exec()
# Reload config after first run # Reload config after first run