Merge branch 'main' into dev
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
[Main]
|
||||
name = Cyberpunk Night
|
||||
author = Anders Lemvigh
|
||||
url = https://github.com/alemvigh
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Syntax]
|
||||
background = 0, 0, 0
|
||||
text = 150, 150, 150
|
||||
link = 77, 077, 255
|
||||
headertext = 255, 255, 255
|
||||
headertag = 50, 0, 180
|
||||
emphasis = 0, 255, 255
|
||||
straightquotes = 7, 27, 219
|
||||
doublequotes = 0, 255, 0
|
||||
singlequotes = 0, 140, 255
|
||||
hidden = 77, 77, 100
|
||||
shortcode = 255, 255, 0
|
||||
keyword = 255, 100, 255
|
||||
value = 255, 150, 10
|
||||
spellcheckline = 242, 72, 23
|
||||
errorline = 186, 218, 4
|
||||
replacetag = 0, 0, 180
|
||||
modifier = 144, 142, 176
|
||||
optional = 180, 180, 180
|
||||
@@ -0,0 +1,23 @@
|
||||
[Main]
|
||||
name = Tango
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
|
||||
[Syntax]
|
||||
background = 48, 48, 47
|
||||
text = 238, 238, 236
|
||||
link = 115, 159, 207
|
||||
headertext = 115, 159, 207
|
||||
headertag = 52, 101, 164
|
||||
emphasis = 196, 160, 0
|
||||
straightquotes = 239, 41, 41
|
||||
doublequotes = 138, 226, 52
|
||||
singlequotes = 252, 233, 79
|
||||
hidden = 143, 143, 141
|
||||
shortcode = 115, 159, 207
|
||||
keyword = 239, 41, 41
|
||||
value = 173, 127, 168
|
||||
optional = 115, 159, 207
|
||||
spellcheckline = 239, 41, 41
|
||||
errorline = 138, 226, 52
|
||||
replacetag = 51, 226, 226
|
||||
modifier = 196, 160, 0
|
||||
@@ -0,0 +1,29 @@
|
||||
[Main]
|
||||
name = Cyberpunk Night
|
||||
description = A taste of the future 80s
|
||||
author = Anders Lemvigh
|
||||
url = https://github.com/alemvigh
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
icontheme = typicons_dark
|
||||
|
||||
[Palette]
|
||||
window = 0, 0, 0
|
||||
windowtext = 150, 150, 150
|
||||
base = 0, 0, 0
|
||||
alternatebase = 30, 20, 45
|
||||
text = 150, 150, 150
|
||||
tooltipbase = 40, 20, 70
|
||||
tooltiptext = 255, 255, 255
|
||||
button = 5, 0, 10
|
||||
buttontext = 150, 150, 150
|
||||
brighttext = 255, 255, 255
|
||||
highlight = 50, 30, 80
|
||||
highlightedtext = 255, 255, 255
|
||||
link = 77, 77, 255
|
||||
linkvisited = 50, 0, 80
|
||||
|
||||
[GUI]
|
||||
statusnone = 50, 50, 50
|
||||
statussaved = 77, 255, 77
|
||||
statusunsaved = 255, 77, 77
|
||||
@@ -183,11 +183,15 @@ class NWStorage:
|
||||
# 2. A full path to an nwProject.nwx file
|
||||
if inPath.is_dir() and inPath != Path.home().resolve():
|
||||
nwxFile = inPath / nwFiles.PROJ_FILE
|
||||
elif inPath.is_file() and inPath.name == nwFiles.PROJ_FILE:
|
||||
nwxFile = inPath
|
||||
elif inPath.is_file():
|
||||
if inPath.name == nwFiles.PROJ_FILE:
|
||||
nwxFile = inPath
|
||||
else:
|
||||
logger.error("Not a novelWriter project")
|
||||
return NWStorageOpen.UNKOWN
|
||||
else:
|
||||
logger.error("Not a novelWriter project")
|
||||
return NWStorageOpen.UNKOWN
|
||||
logger.error("Not found: %s", inPath)
|
||||
return NWStorageOpen.NOT_FOUND
|
||||
|
||||
if not nwxFile.exists():
|
||||
# The .nwx file must exist to continue
|
||||
|
||||
@@ -230,7 +230,6 @@ class GuiMainMenu(QMenuBar):
|
||||
|
||||
# Document > Import From File
|
||||
self.aImportFile = self.docuMenu.addAction(self.tr("Import Text from File"))
|
||||
self.aImportFile.setShortcut("Ctrl+Shift+I")
|
||||
self.aImportFile.triggered.connect(lambda: self.mainGui.importDocument())
|
||||
|
||||
return
|
||||
|
||||
@@ -346,7 +346,7 @@ class GuiTheme:
|
||||
if themeName:
|
||||
self._themeList.append((themeKey, themeName))
|
||||
|
||||
self._themeList = sorted(self._themeList, key=lambda x: x[1])
|
||||
self._themeList = sorted(self._themeList, key=_sortTheme)
|
||||
|
||||
return self._themeList
|
||||
|
||||
@@ -362,7 +362,7 @@ class GuiTheme:
|
||||
if syntaxName:
|
||||
self._syntaxList.append((syntaxKey, syntaxName))
|
||||
|
||||
self._syntaxList = sorted(self._syntaxList, key=lambda x: x[1])
|
||||
self._syntaxList = sorted(self._syntaxList, key=_sortTheme)
|
||||
|
||||
return self._syntaxList
|
||||
|
||||
@@ -729,6 +729,13 @@ class GuiIcons:
|
||||
# Module Functions
|
||||
# =============================================================================================== #
|
||||
|
||||
|
||||
def _sortTheme(data: tuple[str, str]) -> str:
|
||||
"""Key function for theme sorting."""
|
||||
key, name = data
|
||||
return f"*{name}" if key.startswith("default_") else name
|
||||
|
||||
|
||||
def _loadInternalName(confParser: NWConfigParser, confFile: str | Path) -> str:
|
||||
"""Open a conf file and read the 'name' setting."""
|
||||
try:
|
||||
|
||||
@@ -796,7 +796,7 @@ class GuiMain(QMainWindow):
|
||||
def showWelcomeDialog(self) -> None:
|
||||
"""Open the welcome dialog."""
|
||||
dialog = GuiWelcome(self)
|
||||
dialog.openProjectRequest.connect(self._openProject)
|
||||
dialog.openProjectRequest.connect(self._openProjectFromWelcome)
|
||||
dialog.exec_()
|
||||
return
|
||||
|
||||
@@ -1132,10 +1132,12 @@ class GuiMain(QMainWindow):
|
||||
return
|
||||
|
||||
@pyqtSlot(Path)
|
||||
def _openProject(self, path: Path) -> None:
|
||||
"""Handle an open project request."""
|
||||
def _openProjectFromWelcome(self, path: Path) -> None:
|
||||
"""Handle an open project request from the welcome dialog."""
|
||||
qApp.processEvents()
|
||||
self.openProject(path)
|
||||
if not SHARED.hasProject:
|
||||
self.showWelcomeDialog()
|
||||
return
|
||||
|
||||
@pyqtSlot(str, nwDocMode, str, bool)
|
||||
|
||||
Reference in New Issue
Block a user