Add the Build Manuscript tool and connect it to the main menu
This commit is contained in:
@@ -830,9 +830,9 @@ class GuiMainMenu(QMenuBar):
|
||||
self.toolsMenu.addAction(self.aBackupProject)
|
||||
|
||||
# Tools > Export Project
|
||||
self.aBuildProject = QAction(self.tr("Build Novel Project"), self)
|
||||
self.aBuildProject = QAction(self.tr("Build Manuscript"), self)
|
||||
self.aBuildProject.setShortcut("F5")
|
||||
self.aBuildProject.triggered.connect(lambda: self.mainGui.showBuildProjectDialog())
|
||||
self.aBuildProject.triggered.connect(self.mainGui.showBuildManuscriptDialog)
|
||||
self.toolsMenu.addAction(self.aBuildProject)
|
||||
|
||||
# Tools > Writing Stats
|
||||
|
||||
@@ -57,6 +57,7 @@ from novelwriter.dialogs.projdetails import GuiProjectDetails
|
||||
from novelwriter.dialogs.projsettings import GuiProjectSettings
|
||||
from novelwriter.tools.build import GuiBuildNovel
|
||||
from novelwriter.tools.lipsum import GuiLipsum
|
||||
from novelwriter.tools.mbuild import GuiBuildManuscript
|
||||
from novelwriter.tools.projwizard import GuiProjectWizard
|
||||
from novelwriter.tools.writingstats import GuiWritingStats
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -1009,6 +1010,26 @@ class GuiMain(QMainWindow):
|
||||
|
||||
return True
|
||||
|
||||
@pyqtSlot()
|
||||
def showBuildManuscriptDialog(self):
|
||||
"""Open the build manuscript dialog.
|
||||
"""
|
||||
if not self.hasProject:
|
||||
logger.error("No project open")
|
||||
return False
|
||||
|
||||
dlgBuild = getGuiItem("GuiBuildManuscript")
|
||||
if dlgBuild is None:
|
||||
dlgBuild = GuiBuildManuscript(self)
|
||||
assert isinstance(dlgBuild, GuiBuildManuscript)
|
||||
|
||||
dlgBuild.setModal(False)
|
||||
dlgBuild.show()
|
||||
dlgBuild.raise_()
|
||||
qApp.processEvents()
|
||||
|
||||
return True
|
||||
|
||||
def showLoremIpsumDialog(self):
|
||||
"""Open the insert lorem ipsum text dialog.
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
"""
|
||||
novelWriter – GUI Build Manuscript
|
||||
==================================
|
||||
GUI classes for the Manuscript build tool
|
||||
|
||||
File History:
|
||||
Created: 2023-02-13 [2.1-a0]
|
||||
|
||||
This file is a part of novelWriter
|
||||
Copyright 2018–2023, 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 novelwriter
|
||||
|
||||
from PyQt5.QtWidgets import QDialog
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GuiBuildManuscript(QDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
self.theProject = mainGui.theProject
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiBuildManuscript
|
||||
Reference in New Issue
Block a user