Connected the preferences dialog to the menu and main gui

This commit is contained in:
Veronica K. B. Olsen
2019-06-10 12:51:37 +02:00
parent e0ce894c4f
commit c30886732a
2 changed files with 12 additions and 4 deletions
+6 -4
View File
@@ -492,10 +492,12 @@ class GuiMainMenu(QMenuBar):
menuItem.triggered.connect(self.theParent.rebuildIndex) menuItem.triggered.connect(self.theParent.rebuildIndex)
self.toolsMenu.addAction(menuItem) self.toolsMenu.addAction(menuItem)
# # Tools > Settings # Tools > Settings
# menuItem = QAction(QIcon.fromTheme("preferences-system"), "Preferences", self) menuItem = QAction(QIcon.fromTheme("preferences-system"), "Preferences", self)
# menuItem.setStatusTip("Preferences") menuItem.setStatusTip("Preferences")
# self.toolsMenu.addAction(menuItem) menuItem.setShortcut("Ctrl+,")
menuItem.triggered.connect(self.theParent.editConfigDialog)
self.toolsMenu.addAction(menuItem)
return return
+6
View File
@@ -27,6 +27,7 @@ from nw.gui.doceditor import GuiDocEditor
from nw.gui.docviewer import GuiDocViewer from nw.gui.docviewer import GuiDocViewer
from nw.gui.docdetails import GuiDocDetails from nw.gui.docdetails import GuiDocDetails
from nw.gui.mainmenu import GuiMainMenu from nw.gui.mainmenu import GuiMainMenu
from nw.gui.configeditor import GuiConfigEditor
from nw.gui.projecteditor import GuiProjectEditor from nw.gui.projecteditor import GuiProjectEditor
from nw.gui.itemeditor import GuiItemEditor from nw.gui.itemeditor import GuiItemEditor
from nw.gui.statusbar import GuiMainStatus from nw.gui.statusbar import GuiMainStatus
@@ -454,6 +455,11 @@ class GuiMain(QMainWindow):
return projPath return projPath
return None return None
def editConfigDialog(self):
dlgProj = GuiConfigEditor(self, self.theProject)
dlgProj.exec_()
return True
def editProjectDialog(self): def editProjectDialog(self):
if self.hasProject: if self.hasProject:
dlgProj = GuiProjectEditor(self, self.theProject) dlgProj = GuiProjectEditor(self, self.theProject)