Moved the about dialog functions to main gui class
This commit is contained in:
@@ -401,8 +401,6 @@ class GuiBuildNovel(QDialog):
|
|||||||
self.setLayout(self.outerBox)
|
self.setLayout(self.outerBox)
|
||||||
self.buildNovel.setFocus()
|
self.buildNovel.setFocus()
|
||||||
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
logger.debug("GuiBuildNovel initialisation complete")
|
logger.debug("GuiBuildNovel initialisation complete")
|
||||||
|
|
||||||
# Load from Cache
|
# Load from Cache
|
||||||
|
|||||||
+3
-21
@@ -28,13 +28,10 @@
|
|||||||
import logging
|
import logging
|
||||||
import nw
|
import nw
|
||||||
|
|
||||||
from os import path
|
|
||||||
|
|
||||||
from PyQt5.QtCore import QUrl, QProcess
|
from PyQt5.QtCore import QUrl, QProcess
|
||||||
from PyQt5.QtGui import QDesktopServices
|
from PyQt5.QtGui import QDesktopServices
|
||||||
from PyQt5.QtWidgets import QMenuBar, QAction, QMessageBox
|
from PyQt5.QtWidgets import QMenuBar, QAction
|
||||||
|
|
||||||
from nw.gui.about import GuiAbout
|
|
||||||
from nw.constants import nwItemType, nwItemClass, nwDocAction, nwDocInsert
|
from nw.constants import nwItemType, nwItemClass, nwDocAction, nwDocInsert
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -150,21 +147,6 @@ class GuiMainMenu(QMenuBar):
|
|||||||
self.theProject.setAutoOutline(theMode)
|
self.theProject.setAutoOutline(theMode)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _showAbout(self):
|
|
||||||
"""Show the about dialog.
|
|
||||||
"""
|
|
||||||
if self.mainConf.showGUI:
|
|
||||||
msgAbout = GuiAbout(self.theParent)
|
|
||||||
msgAbout.exec_()
|
|
||||||
return True
|
|
||||||
|
|
||||||
def _showAboutQt(self):
|
|
||||||
"""Show Qt's own About dialog.
|
|
||||||
"""
|
|
||||||
msgBox = QMessageBox()
|
|
||||||
msgBox.aboutQt(self.theParent,"About Qt")
|
|
||||||
return True
|
|
||||||
|
|
||||||
def _openAssistant(self):
|
def _openAssistant(self):
|
||||||
"""Open the documentation in Qt Assistant.
|
"""Open the documentation in Qt Assistant.
|
||||||
"""
|
"""
|
||||||
@@ -853,13 +835,13 @@ class GuiMainMenu(QMenuBar):
|
|||||||
# Help > About
|
# Help > About
|
||||||
self.aAboutNW = QAction("About %s" % self.mainConf.appName, self)
|
self.aAboutNW = QAction("About %s" % self.mainConf.appName, self)
|
||||||
self.aAboutNW.setStatusTip("About %s" % self.mainConf.appName)
|
self.aAboutNW.setStatusTip("About %s" % self.mainConf.appName)
|
||||||
self.aAboutNW.triggered.connect(self._showAbout)
|
self.aAboutNW.triggered.connect(self.theParent.showAboutNWDialog)
|
||||||
self.helpMenu.addAction(self.aAboutNW)
|
self.helpMenu.addAction(self.aAboutNW)
|
||||||
|
|
||||||
# Help > About Qt5
|
# Help > About Qt5
|
||||||
self.aAboutQt = QAction("About Qt5", self)
|
self.aAboutQt = QAction("About Qt5", self)
|
||||||
self.aAboutQt.setStatusTip("About Qt5")
|
self.aAboutQt.setStatusTip("About Qt5")
|
||||||
self.aAboutQt.triggered.connect(self._showAboutQt)
|
self.aAboutQt.triggered.connect(self.theParent.showAboutQtDialog)
|
||||||
self.helpMenu.addAction(self.aAboutQt)
|
self.helpMenu.addAction(self.aAboutQt)
|
||||||
|
|
||||||
# Help > Separator
|
# Help > Separator
|
||||||
|
|||||||
+17
-1
@@ -43,7 +43,7 @@ from nw.gui import (
|
|||||||
GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, GuiDocViewDetails,
|
GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, GuiDocViewDetails,
|
||||||
GuiDocViewer, GuiItemDetails, GuiItemEditor, GuiMainMenu, GuiMainStatus,
|
GuiDocViewer, GuiItemDetails, GuiItemEditor, GuiMainMenu, GuiMainStatus,
|
||||||
GuiOutline, GuiOutlineDetails, GuiPreferences, GuiProjectLoad, GuiTheme,
|
GuiOutline, GuiOutlineDetails, GuiPreferences, GuiProjectLoad, GuiTheme,
|
||||||
GuiProjectSettings, GuiProjectTree, GuiWritingStats
|
GuiProjectSettings, GuiProjectTree, GuiWritingStats, GuiAbout
|
||||||
)
|
)
|
||||||
from nw.core import NWProject, NWDoc, NWIndex
|
from nw.core import NWProject, NWDoc, NWIndex
|
||||||
from nw.constants import nwFiles, nwItemType, nwAlert
|
from nw.constants import nwFiles, nwItemType, nwAlert
|
||||||
@@ -817,6 +817,22 @@ class GuiMain(QMainWindow):
|
|||||||
dlgStats.show()
|
dlgStats.show()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def showAboutNWDialog(self):
|
||||||
|
"""Show the about dialog for novelWriter.
|
||||||
|
"""
|
||||||
|
if self.mainConf.showGUI:
|
||||||
|
dlgAbout = GuiAbout(self)
|
||||||
|
dlgAbout.exec_()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def showAboutQtDialog(self):
|
||||||
|
"""Show the about dialog for Qt.
|
||||||
|
"""
|
||||||
|
if self.mainConf.showGUI:
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.aboutQt(self, "About Qt")
|
||||||
|
return True
|
||||||
|
|
||||||
def makeAlert(self, theMessage, theLevel=nwAlert.INFO):
|
def makeAlert(self, theMessage, theLevel=nwAlert.INFO):
|
||||||
"""Alert both the user and the logger at the same time. Message
|
"""Alert both the user and the logger at the same time. Message
|
||||||
can be either a string or an array of strings. Severity level is
|
can be either a string or an array of strings. Severity level is
|
||||||
|
|||||||
Reference in New Issue
Block a user