Added the Build Project dialog and connected it to the GUI in place of the Export tool
This commit is contained in:
+8
-6
@@ -1,15 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Qt Additions
|
||||
from nw.gui.additions.qconfiglayout import QConfigLayout
|
||||
from nw.gui.additions.qswitch import QSwitch
|
||||
|
||||
# Main Window Elements
|
||||
from nw.gui.build import GuiBuildNovel
|
||||
from nw.gui.icons import GuiIcons
|
||||
from nw.gui.mainmenu import GuiMainMenu
|
||||
from nw.gui.statusbar import GuiMainStatus
|
||||
from nw.gui.theme import GuiTheme
|
||||
|
||||
# Qt Additions
|
||||
from nw.gui.additions.qconfiglayout import QConfigLayout
|
||||
from nw.gui.additions.qswitch import QSwitch
|
||||
|
||||
# Dialogs
|
||||
from nw.gui.dialogs.configeditor import GuiConfigEditor
|
||||
from nw.gui.dialogs.docmerge import GuiDocMerge
|
||||
@@ -37,12 +38,13 @@ from nw.gui.tools.optionstate import OptionState
|
||||
from nw.gui.tools.wordcounter import WordCounter
|
||||
|
||||
__all__ = [
|
||||
"QConfigLayout",
|
||||
"QSwitch",
|
||||
"GuiBuildNovel",
|
||||
"GuiIcons",
|
||||
"GuiMainMenu",
|
||||
"GuiMainStatus",
|
||||
"GuiTheme",
|
||||
"QConfigLayout",
|
||||
"QSwitch",
|
||||
"GuiConfigEditor",
|
||||
"GuiDocMerge",
|
||||
"GuiDocSplit",
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""novelWriter GUI Build Novel
|
||||
|
||||
novelWriter – GUI Build Novel
|
||||
===============================
|
||||
Class holding the build novel window
|
||||
|
||||
File History:
|
||||
Created: 2020-05-09 [0.5]
|
||||
|
||||
This file is a part of novelWriter
|
||||
Copyright 2020, Veronica Berglyd Olsen
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import nw
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog
|
||||
)
|
||||
|
||||
from nw.constants import nwConst, nwFiles, nwAlert
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class GuiBuildNovel(QDialog):
|
||||
|
||||
def __init__(self, theParent, theProject):
|
||||
QDialog.__init__(self, theParent)
|
||||
|
||||
logger.debug("Initialising GuiBuildNovel ...")
|
||||
|
||||
self.mainConf = nw.CONFIG
|
||||
self.theProject = theProject
|
||||
self.theParent = theParent
|
||||
self.optState = self.theProject.optState
|
||||
|
||||
self.show()
|
||||
|
||||
logger.debug("GuiBuildNovel initialisation complete")
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiBuildNovel
|
||||
+5
-5
@@ -225,11 +225,11 @@ class GuiMainMenu(QMenuBar):
|
||||
self.projMenu.addAction(self.aProjectSettings)
|
||||
|
||||
# Project > Export Project
|
||||
self.aExportProject = QAction("Export Project", self)
|
||||
self.aExportProject.setStatusTip("Export project")
|
||||
self.aExportProject.setShortcut("F5")
|
||||
self.aExportProject.triggered.connect(self.theParent.exportProjectDialog)
|
||||
self.projMenu.addAction(self.aExportProject)
|
||||
self.aBuildProject = QAction("Build Project", self)
|
||||
self.aBuildProject.setStatusTip("Build project")
|
||||
self.aBuildProject.setShortcut("F5")
|
||||
self.aBuildProject.triggered.connect(self.theParent.buildProjectDialog)
|
||||
self.projMenu.addAction(self.aBuildProject)
|
||||
|
||||
# Project > Session Log
|
||||
self.aSessionLog = QAction("Session Log", self)
|
||||
|
||||
+4
-4
@@ -40,10 +40,10 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from nw.gui import (
|
||||
GuiMainMenu, GuiMainStatus, GuiTheme, GuiDocTree, GuiDocEditor, GuiExport,
|
||||
GuiMainMenu, GuiMainStatus, GuiTheme, GuiDocTree, GuiDocEditor,
|
||||
GuiDocViewer, GuiDocDetails, GuiSearchBar, GuiNoticeBar, GuiDocViewDetails,
|
||||
GuiConfigEditor, GuiProjectEditor, GuiItemEditor, GuiProjectOutline,
|
||||
GuiSessionLogView, GuiDocMerge, GuiDocSplit, GuiProjectLoad
|
||||
GuiSessionLogView, GuiDocMerge, GuiDocSplit, GuiProjectLoad, GuiBuildNovel
|
||||
)
|
||||
from nw.core import NWProject, NWDoc, NWIndex, countWords
|
||||
from nw.constants import nwFiles, nwItemType, nwAlert
|
||||
@@ -755,9 +755,9 @@ class GuiMain(QMainWindow):
|
||||
self._setWindowTitle(self.theProject.projName)
|
||||
return True
|
||||
|
||||
def exportProjectDialog(self):
|
||||
def buildProjectDialog(self):
|
||||
if self.hasProject:
|
||||
dlgExport = GuiExport(self, self.theProject)
|
||||
dlgExport = GuiBuildNovel(self, self.theProject)
|
||||
dlgExport.exec_()
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user