Filenames are set nwFiles now, and deleted some unused file in nw/gui

This commit is contained in:
Veronica K. B. Olsen
2019-05-26 14:06:48 +02:00
parent 8e9f6ce4c7
commit 601bd3dca6
5 changed files with 22 additions and 86 deletions
-77
View File
@@ -1,77 +0,0 @@
# -*- coding: utf-8 -*-
"""novelWriter GUI About View
novelWriter GUI About View
==============================
Class holding the tab viewing the about information
File History:
Created: 2018-10-02 [0.0.1]
"""
import logging
import nw
from os import path
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QLabel
from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QFont
logger = logging.getLogger(__name__)
class GuiAboutView(QWidget):
def __init__(self):
QWidget.__init__(self)
logger.debug("Initialising AboutView ...")
self.mainConf = nw.CONFIG
self.innerBox = QHBoxLayout()
self.outerBox = QVBoxLayout()
logoPath = path.abspath(path.join(self.mainConf.appPath,"..","novelWriter.svg"))
logger.verbose("Loading image: %s" % logoPath)
nwLogo = QSvgWidget(logoPath)
nwLogo.setFixedSize(QSize(300,300))
nwName = QLabel()
nwName.setText(nw.__package__)
nwName.setAlignment(Qt.AlignCenter)
fnName = QFont()
fnName.setPointSize(22)
fnName.setBold(True)
nwName.setFont(fnName)
nwVersion = QLabel()
nwVersion.setText("Version %s" % nw.__version__)
nwVersion.setAlignment(Qt.AlignCenter)
nwCredits = QLabel()
nwCredits.setText("Created By: %s" % ",".join(nw.__credits__))
nwCredits.setAlignment(Qt.AlignCenter)
nwWebsite = QLabel()
nwWebsite.setText("<a href='%s'>%s</a>" % (nw.__website__,nw.__website__))
nwWebsite.setOpenExternalLinks(True)
nwWebsite.setAlignment(Qt.AlignCenter)
self.outerBox.addStretch(1)
self.innerBox.addStretch(1)
self.innerBox.addWidget(nwLogo)
self.innerBox.addStretch(1)
self.outerBox.addLayout(self.innerBox)
self.outerBox.addWidget(nwName)
self.outerBox.addWidget(nwVersion)
self.outerBox.addWidget(nwCredits)
self.outerBox.addWidget(nwWebsite)
self.outerBox.addStretch(1)
self.setLayout(self.outerBox)
logger.debug("AboutView initialisation complete")
return
# END Class GuiAboutView
+6 -3
View File
@@ -36,6 +36,7 @@ from nw.project.item import NWItem
from nw.convert.tokenizer import Tokenizer
from nw.convert.tohtml import ToHtml
from nw.enum import nwItemType, nwAlert
from nw.constants import nwFiles
logger = logging.getLogger(__name__)
@@ -53,7 +54,7 @@ class GuiMain(QMainWindow):
self.resize(*self.mainConf.winGeometry)
self._setWindowTitle()
self.setWindowIcon(QIcon(path.join(self.mainConf.appPath,"..","novelWriter.svg")))
self.setWindowIcon(QIcon(path.join(self.mainConf.appRoot, nwFiles.APP_ICON)))
self.theTheme.loadTheme()
# Main GUI Elements
@@ -255,7 +256,7 @@ class GuiMain(QMainWindow):
self.theProject.openProject(projFile)
self._setWindowTitle(self.theProject.projName)
self.rebuildTree()
self.docEditor.setPwl(path.join(self.theProject.projMeta,"wordlist.txt"))
self.docEditor.setPwl(path.join(self.theProject.projMeta, nwFiles.PROJ_DICT))
self.docEditor.setSpellCheck(self.theProject.spellCheck)
self.mainMenu.updateMenu()
@@ -394,7 +395,9 @@ class GuiMain(QMainWindow):
dlgOpt = QFileDialog.Options()
dlgOpt |= QFileDialog.DontUseNativeDialog
projFile, _ = QFileDialog.getOpenFileName(
self,"Open novelWriter Project","","novelWriter Project File (nwProject.nwx);;All Files (*)",options=dlgOpt
self, "Open novelWriter Project", "",
"novelWriter Project File (%s);;All Files (*)" % nwFiles.PROJ_FILE,
options=dlgOpt
)
if projFile:
return projFile