Connected new dialog to menu
This commit is contained in:
+5
-1
@@ -87,7 +87,11 @@ class OptionState():
|
|||||||
"winWidth",
|
"winWidth",
|
||||||
"winHeight",
|
"winHeight",
|
||||||
"replaceColW",
|
"replaceColW",
|
||||||
}
|
},
|
||||||
|
"GuiProjectDetails": {
|
||||||
|
"winWidth",
|
||||||
|
"winHeight",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -219,6 +219,13 @@ class GuiMainMenu(QMenuBar):
|
|||||||
self.aProjectSettings.triggered.connect(lambda: self.theParent.showProjectSettingsDialog())
|
self.aProjectSettings.triggered.connect(lambda: self.theParent.showProjectSettingsDialog())
|
||||||
self.projMenu.addAction(self.aProjectSettings)
|
self.projMenu.addAction(self.aProjectSettings)
|
||||||
|
|
||||||
|
# Project > Project Details
|
||||||
|
self.aProjectDetails = QAction("Project Details", self)
|
||||||
|
self.aProjectDetails.setStatusTip("Project details")
|
||||||
|
self.aProjectDetails.setShortcut("Ctrl+Shift+E")
|
||||||
|
self.aProjectDetails.triggered.connect(lambda: self.theParent.showProjectDetailsDialog())
|
||||||
|
self.projMenu.addAction(self.aProjectDetails)
|
||||||
|
|
||||||
# Project > Separator
|
# Project > Separator
|
||||||
self.projMenu.addSeparator()
|
self.projMenu.addSeparator()
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,9 @@
|
|||||||
import nw
|
import nw
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtWidgets import QDialogButtonBox
|
||||||
from PyQt5.QtWidgets import (
|
|
||||||
QWidget, QDialogButtonBox, QTreeWidget, QTreeWidgetItem
|
|
||||||
)
|
|
||||||
|
|
||||||
from nw.gui.custom import PagedDialog, QConfigLayout
|
from nw.gui.custom import PagedDialog
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -66,7 +63,7 @@ class GuiProjectDetails(PagedDialog):
|
|||||||
|
|
||||||
# self.addTab(self.tabMain, "Settings")
|
# self.addTab(self.tabMain, "Settings")
|
||||||
|
|
||||||
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok)
|
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Close)
|
||||||
self.buttonBox.rejected.connect(self._doClose)
|
self.buttonBox.rejected.connect(self._doClose)
|
||||||
self.addControls(self.buttonBox)
|
self.addControls(self.buttonBox)
|
||||||
|
|
||||||
|
|||||||
+15
-2
@@ -43,8 +43,8 @@ from nw.gui import (
|
|||||||
GuiAbout, GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit,
|
GuiAbout, GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit,
|
||||||
GuiDocViewDetails, GuiDocViewer, GuiItemDetails, GuiItemEditor,
|
GuiDocViewDetails, GuiDocViewer, GuiItemDetails, GuiItemEditor,
|
||||||
GuiMainMenu, GuiMainStatus, GuiNovelTree, GuiOutline, GuiOutlineDetails,
|
GuiMainMenu, GuiMainStatus, GuiNovelTree, GuiOutline, GuiOutlineDetails,
|
||||||
GuiPreferences, GuiProjectLoad, GuiProjectSettings, GuiProjectTree,
|
GuiPreferences, GuiProjectDetails, GuiProjectLoad, GuiProjectSettings,
|
||||||
GuiProjectWizard, GuiTheme, GuiWritingStats
|
GuiProjectTree, GuiProjectWizard, GuiTheme, GuiWritingStats
|
||||||
)
|
)
|
||||||
from nw.core import NWProject, NWDoc, NWIndex
|
from nw.core import NWProject, NWDoc, NWIndex
|
||||||
from nw.constants import nwItemType, nwItemClass, nwAlert, nwConst
|
from nw.constants import nwItemType, nwItemClass, nwAlert, nwConst
|
||||||
@@ -907,6 +907,19 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def showProjectDetailsDialog(self):
|
||||||
|
"""Open the project details dialog.
|
||||||
|
"""
|
||||||
|
if not self.hasProject:
|
||||||
|
logger.error("No project open")
|
||||||
|
return
|
||||||
|
|
||||||
|
dlgDetails = GuiProjectDetails(self, self.theProject)
|
||||||
|
dlgDetails.setModal(False)
|
||||||
|
dlgDetails.show()
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
def showBuildProjectDialog(self):
|
def showBuildProjectDialog(self):
|
||||||
"""Open the build project dialog.
|
"""Open the build project dialog.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user