diff --git a/nw/gui/configeditor.py b/nw/gui/configeditor.py index 69376a78..016040c6 100644 --- a/nw/gui/configeditor.py +++ b/nw/gui/configeditor.py @@ -68,7 +68,7 @@ class GuiConfigEditor(QDialog): self.show() - logger.debug("ProjectEditor ConfigEditor complete") + logger.debug("ConfigEditor initialisation complete") return diff --git a/nw/gui/export.py b/nw/gui/export.py new file mode 100644 index 00000000..86b249ab --- /dev/null +++ b/nw/gui/export.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +"""novelWriter GUI Export Tools + + novelWriter – GUI Export Tool +================================ + Tool for exporting project files to other formats + + File History: + Created: 2019-10-13 [0.2.3] + +""" + +import logging +import nw + +from os import path + +from PyQt5.QtCore import Qt, QSize +from PyQt5.QtSvg import QSvgWidget +from PyQt5.QtWidgets import ( + QDialog, QHBoxLayout, QVBoxLayout, QWidget, QTabWidget, QDialogButtonBox +) + +logger = logging.getLogger(__name__) + +class GuiExport(QDialog): + + def __init__(self, theParent, theProject): + QDialog.__init__(self, theParent) + + logger.debug("Initialising GuiExport ...") + + self.mainConf = nw.CONFIG + self.theParent = theParent + self.theProject = theProject + + self.outerBox = QHBoxLayout() + self.innerBox = QVBoxLayout() + self.setWindowTitle("Export Project") + self.setLayout(self.outerBox) + + self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","gear.svg")) + self.svgGradient = QSvgWidget(self.gradPath) + self.svgGradient.setFixedSize(QSize(64,64)) + + self.theProject.countStatus() + self.tabMain = GuiExportMain(self.theParent, self.theProject) + + self.tabWidget = QTabWidget() + self.tabWidget.addTab(self.tabMain, "Settings") + + self.outerBox.addWidget(self.svgGradient, 0, Qt.AlignTop) + self.outerBox.addLayout(self.innerBox) + + self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) + # self.buttonBox.accepted.connect(self._doSave) + # self.buttonBox.rejected.connect(self._doClose) + + self.innerBox.addWidget(self.tabWidget) + self.innerBox.addWidget(self.buttonBox) + + self.show() + + logger.debug("GuiExport initialisation complete") + + return + +# END Class GuiExport + +class GuiExportMain(QWidget): + + def __init__(self, theParent, theProject): + QWidget.__init__(self, theParent) + + self.theParent = theParent + self.theProject = theProject + + return + +# END Class GuiExportMain diff --git a/nw/gui/exports.py b/nw/gui/exports.py deleted file mode 100644 index 1e9babc8..00000000 --- a/nw/gui/exports.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -"""novelWriter GUI Export Tools - - novelWriter – GUI Export Tool -================================ - Tool for exporting project files to other formats - - File History: - Created: 2019-10-13 [0.2.3] - -""" - -import logging -import nw - -from os import path - -from PyQt5.QtWidgets import QDialog - -logger = logging.getLogger(__name__) - -class GuiExport(QDialog): - -# END Class GuiExport diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index c319dc20..a5d77820 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -192,6 +192,13 @@ class GuiMainMenu(QMenuBar): menuItem.triggered.connect(self.theParent.editProjectDialog) self.projMenu.addAction(menuItem) + # Project > Export Project + menuItem = QAction("Export Project", self) + menuItem.setStatusTip("Export project") + menuItem.setShortcut("F5") + menuItem.triggered.connect(self.theParent.exportProjectDialog) + self.projMenu.addAction(menuItem) + # Project > Separator self.projMenu.addSeparator() diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 8dee5c41..7d3d0aa8 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -30,6 +30,7 @@ from nw.gui.searchbar import GuiSearchBar from nw.gui.mainmenu import GuiMainMenu from nw.gui.configeditor import GuiConfigEditor from nw.gui.projecteditor import GuiProjectEditor +from nw.gui.export import GuiExport from nw.gui.itemeditor import GuiItemEditor from nw.gui.statusbar import GuiMainStatus from nw.gui.timelineview import GuiTimeLineView @@ -511,6 +512,12 @@ class GuiMain(QMainWindow): self._setWindowTitle(self.theProject.projName) return True + def exportProjectDialog(self): + if self.hasProject: + dlgExport = GuiExport(self, self.theProject) + dlgExport.exec_() + return True + def showTimeLineDialog(self): if self.hasProject: dlgTLine = GuiTimeLineView(self, self.theProject, self.theIndex)