From c9cab47ce0f1656267ba4431fe3704e04b85600b Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 20 Feb 2021 13:40:26 +0100 Subject: [PATCH] Minor code changes for consistency --- nw/core/project.py | 2 +- nw/core/tomd.py | 2 +- nw/gui/projload.py | 4 ++-- nw/gui/projwizard.py | 6 +++--- nw/guimain.py | 9 +++------ 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/nw/core/project.py b/nw/core/project.py index ad43e817..b5f1bafd 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -583,7 +583,7 @@ class NWProject(): if errList: self.makeAlert(errList, nwAlert.ERROR) - # Clean up old files + # Clean up no longer used files self._deprecatedFiles() # Update recent projects diff --git a/nw/core/tomd.py b/nw/core/tomd.py index b45d2e6c..3167b204 100644 --- a/nw/core/tomd.py +++ b/nw/core/tomd.py @@ -77,7 +77,7 @@ class ToMarkdown(Tokenizer): self.FMT_D_B : "", self.FMT_D_E : "", } else: - # GitHub and novelWriter + # GitHub mdTags = { self.FMT_B_B : "**", self.FMT_B_E : "**", self.FMT_I_B : "_", self.FMT_I_E : "_", diff --git a/nw/gui/projload.py b/nw/gui/projload.py index bb5bedfe..5a5e8de4 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -186,10 +186,10 @@ class GuiProjectLoad(QDialog): logger.verbose("GuiProjectLoad browse button clicked") extFilter = [ self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE), - self.tr("All files ({0})").format("*.*"), + self.tr("All files ({0})").format("*"), ] projFile, _ = QFileDialog.getOpenFileName( - self, self.tr("Open novelWriter Project"), "", filter=";;".join(extFilter) + self, self.tr("Open Project"), "", filter=";;".join(extFilter) ) if projFile: thePath = os.path.abspath(os.path.dirname(projFile)) diff --git a/nw/gui/projwizard.py b/nw/gui/projwizard.py index 6689a31e..951b8211 100644 --- a/nw/gui/projwizard.py +++ b/nw/gui/projwizard.py @@ -409,9 +409,9 @@ class ProjWizardFinalPage(QWizardPage): self.setTitle(self.tr("Finished")) self.theText = QLabel( - "
{done}
{help}
".format( - done = self.tr("All done."), - help = self.tr("Press '{0}' to create the new project.").format( + "%s
%s
" % ( + self.tr("All done."), + self.tr("Press '{0}' to create the new project.").format( self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish") ) ) diff --git a/nw/guimain.py b/nw/guimain.py index 3ea15162..ded0579c 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -550,12 +550,9 @@ class GuiMain(QMainWindow): logger.error("No project open") return False - if self.theProject.projPath is None: - return False - self.treeView.saveTreeOrder() - self.theProject.saveProject(autoSave=autoSave) - self.theIndex.saveIndex() + if self.theProject.saveProject(autoSave=autoSave): + self.theIndex.saveIndex() return True @@ -700,7 +697,7 @@ class GuiMain(QMainWindow): self.tr("Text files ({0})").format("*.txt"), self.tr("Markdown files ({0})").format("*.md"), self.tr("novelWriter files ({0})").format("*.nwd"), - self.tr("All files ({0})").format("*.*"), + self.tr("All files ({0})").format("*"), ] loadFile, _ = QFileDialog.getOpenFileName( self, self.tr("Import File"), lastPath, filter=";;".join(extFilter)