Merge branch 'release' into release_1.1rc1
This commit is contained in:
@@ -2,9 +2,9 @@ name: flake8
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checkSyntax:
|
checkSyntax:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Linux (3.6)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testLinux36:
|
testLinux36:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Linux (3.7)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testLinux37:
|
testLinux37:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Linux (3.8)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testLinux38:
|
testLinux38:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Linux (3.9)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testLinux39:
|
testLinux39:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: macOS (3.8)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testMac38:
|
testMac38:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Windows (3.8)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, dev ]
|
branches: [ main, dev, release ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testWin38:
|
testWin38:
|
||||||
|
|||||||
@@ -344,12 +344,12 @@ Most features are available as keyboard shortcuts. These are as follows:
|
|||||||
":kbd:`Alt`:kbd:`1`", "Switch focus to the project tree."
|
":kbd:`Alt`:kbd:`1`", "Switch focus to the project tree."
|
||||||
":kbd:`Alt`:kbd:`2`", "Switch focus to document editor."
|
":kbd:`Alt`:kbd:`2`", "Switch focus to document editor."
|
||||||
":kbd:`Alt`:kbd:`3`", "Switch focus to document viewer."
|
":kbd:`Alt`:kbd:`3`", "Switch focus to document viewer."
|
||||||
|
":kbd:`Alt`:kbd:`4`", "Switch focus to outline view."
|
||||||
":kbd:`Alt`:kbd:`Left`", "Move backward in the view history of the document viewer."
|
":kbd:`Alt`:kbd:`Left`", "Move backward in the view history of the document viewer."
|
||||||
":kbd:`Alt`:kbd:`Right`", "Move forward in the view history of the document viewer."
|
":kbd:`Alt`:kbd:`Right`", "Move forward in the view history of the document viewer."
|
||||||
":kbd:`Ctrl`:kbd:`.`", "Open menu to correct word under cursor."
|
":kbd:`Ctrl`:kbd:`.`", "Open menu to correct word under cursor."
|
||||||
":kbd:`Ctrl`:kbd:`,`", "Open the :guilabel:`Preferences` dialog."
|
":kbd:`Ctrl`:kbd:`,`", "Open the :guilabel:`Preferences` dialog."
|
||||||
":kbd:`Ctrl`:kbd:`/`", "Change block format to comment."
|
":kbd:`Ctrl`:kbd:`/`", "Change block format to comment."
|
||||||
":kbd:`Ctrl`:kbd:`-`", "Strikethrough selected text, or word under cursor."
|
|
||||||
":kbd:`Ctrl`:kbd:`0`", "Remove block formatting for block under cursor."
|
":kbd:`Ctrl`:kbd:`0`", "Remove block formatting for block under cursor."
|
||||||
":kbd:`Ctrl`:kbd:`1`", "Change block format to header level 1."
|
":kbd:`Ctrl`:kbd:`1`", "Change block format to header level 1."
|
||||||
":kbd:`Ctrl`:kbd:`2`", "Change block format to header level 2."
|
":kbd:`Ctrl`:kbd:`2`", "Change block format to header level 2."
|
||||||
@@ -358,7 +358,7 @@ Most features are available as keyboard shortcuts. These are as follows:
|
|||||||
":kbd:`Ctrl`:kbd:`A`", "Select all text in the document."
|
":kbd:`Ctrl`:kbd:`A`", "Select all text in the document."
|
||||||
":kbd:`Ctrl`:kbd:`B`", "Format selected text, or word under cursor, with strong emphasis (bold)."
|
":kbd:`Ctrl`:kbd:`B`", "Format selected text, or word under cursor, with strong emphasis (bold)."
|
||||||
":kbd:`Ctrl`:kbd:`C`", "Copy selected text to clipboard."
|
":kbd:`Ctrl`:kbd:`C`", "Copy selected text to clipboard."
|
||||||
":kbd:`Ctrl`:kbd:`D`", "Wrap selected text, or word under cursor, in double quotes."
|
":kbd:`Ctrl`:kbd:`D`", "Strikethrough selected text, or word under cursor."
|
||||||
":kbd:`Ctrl`:kbd:`E`", "If in the project tree, edit a document or folder settings. (Same as :kbd:`F2`.)"
|
":kbd:`Ctrl`:kbd:`E`", "If in the project tree, edit a document or folder settings. (Same as :kbd:`F2`.)"
|
||||||
":kbd:`Ctrl`:kbd:`F`", "Open the search bar and search for the selected word, if any is selected."
|
":kbd:`Ctrl`:kbd:`F`", "Open the search bar and search for the selected word, if any is selected."
|
||||||
":kbd:`Ctrl`:kbd:`G`", "Find next occurrence of search word in current document. (Same as :kbd:`F3`.)"
|
":kbd:`Ctrl`:kbd:`G`", "Find next occurrence of search word in current document. (Same as :kbd:`F3`.)"
|
||||||
@@ -378,12 +378,13 @@ Most features are available as keyboard shortcuts. These are as follows:
|
|||||||
":kbd:`Ctrl`:kbd:`F7`", "Toggle spell checking."
|
":kbd:`Ctrl`:kbd:`F7`", "Toggle spell checking."
|
||||||
":kbd:`Ctrl`:kbd:`F10`", "Toggle automatic updating of project outline."
|
":kbd:`Ctrl`:kbd:`F10`", "Toggle automatic updating of project outline."
|
||||||
":kbd:`Ctrl`:kbd:`Del`", "If in the project tree, move a document to trash, or delete a folder."
|
":kbd:`Ctrl`:kbd:`Del`", "If in the project tree, move a document to trash, or delete a folder."
|
||||||
|
":kbd:`Ctrl`:kbd:`'`", "Wrap selected text, or word under cursor, in single quotes."
|
||||||
|
":kbd:`Ctrl`:kbd:`""`", "Wrap selected text, or word under cursor, in double quotes."
|
||||||
":kbd:`Ctrl`:kbd:`Enter`", "Open the tag or reference under the cursor in the Viewer."
|
":kbd:`Ctrl`:kbd:`Enter`", "Open the tag or reference under the cursor in the Viewer."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`,`", "Open the :guilabel:`Project Settings` dialog."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`,`", "Open the :guilabel:`Project Settings` dialog."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`/`", "Remove block formatting for block under cursor."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`/`", "Remove block formatting for block under cursor."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`1`", "Replace occurrence of search word in current document, and search for next occurrence."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`1`", "Replace occurrence of search word in current document, and search for next occurrence."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`A`", "Select all text in current paragraph."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`A`", "Select all text in current paragraph."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`D`", "Wrap selected text, or word under cursor, in single quotes."
|
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`G`", "Find previous occurrence of search word in current document. (Same as :kbd:`Shift`:kbd:`F3`.)"
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`G`", "Find previous occurrence of search word in current document. (Same as :kbd:`Shift`:kbd:`F3`.)"
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`I`", "Import text to the current document from a text file."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`I`", "Import text to the current document from a text file."
|
||||||
":kbd:`Ctrl`:kbd:`Shift`:kbd:`N`", "Create new folder."
|
":kbd:`Ctrl`:kbd:`Shift`:kbd:`N`", "Create new folder."
|
||||||
@@ -427,18 +428,29 @@ a key or key combination for the inserted content.
|
|||||||
:widths: 40, 60
|
:widths: 40, 60
|
||||||
:class: "tight-table"
|
:class: "tight-table"
|
||||||
|
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`-`", "Insert a short dash (en dash)."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`−`", "Insert a short dash (en dash)."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`_`", "Insert a long dash (em dash)."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`_`", "Insert a long dash (em dash)."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`.`", "Insert an ellipsis."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`_`", "Insert a horizontal bar (quotation dash)."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`~`", "Insert a figure dash (same width as a number)."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`1`", "Insert a left single quote."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`1`", "Insert a left single quote."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`2`", "Insert a right single quote."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`2`", "Insert a right single quote."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`3`", "Insert a left double quote."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`3`", "Insert a left double quote."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`4`", "Insert a right double quote."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`4`", "Insert a right double quote."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`'`", "Insert a modifier apostrophe."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`'`", "Insert a modifier apostrophe."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`.`", "Insert an ellipsis."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`'`", "Insert a prime."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`""`", "Insert a double prime."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`Return`", "Insert a hard line break."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Return`", "Insert a hard line break."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`Space`", "Insert a non-breaking space."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Space`", "Insert a non-breaking space."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`Shift`:kbd:`Space`", "Insert a thin space."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Shift`:kbd:`Space`", "Insert a thin space."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`Space`", "Insert a thin non-breaking space."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`Space`", "Insert a thin non-breaking space."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`*`", "Insert a list bullet."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`−`", "Insert a hyphen bullet (alternative bullet)."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`*`", "Insert a flower mark (alternative bullet)."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`%`", "Insert a per mille symbol."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`O`", "Insert a degree symbol."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`X`", "Insert a times sign."
|
||||||
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`D`", "Insert a division sign."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`G`", "Insert a ``@tag`` keyword."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`G`", "Insert a ``@tag`` keyword."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`V`", "Insert a ``@pov`` keyword."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`V`", "Insert a ``@pov`` keyword."
|
||||||
":kbd:`Ctrl`:kbd:`K`, :kbd:`C`", "Insert a ``@char`` keyword."
|
":kbd:`Ctrl`:kbd:`K`, :kbd:`C`", "Insert a ``@char`` keyword."
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ automatically to short and long dashes, and three dots to ellipsis. The last aut
|
|||||||
always be reverted with the undo command :kbd:`Ctrl`:kbd:`Z`, reverting the text to what you typed
|
always be reverted with the undo command :kbd:`Ctrl`:kbd:`Z`, reverting the text to what you typed
|
||||||
before the automatic replacement occurred.
|
before the automatic replacement occurred.
|
||||||
|
|
||||||
|
The symbols are available in the :guilabel:`Insert` menu. In addition, "Figure Dash" is also
|
||||||
|
available. The Figure Dash is a dash that has the same width as the numbers of the same font, which
|
||||||
|
tend to be the same width so that numbers align nicely in columns.
|
||||||
|
|
||||||
|
|
||||||
Single and Double Quotes
|
Single and Double Quotes
|
||||||
------------------------
|
------------------------
|
||||||
@@ -48,6 +52,19 @@ re-format a selected section of text with the correct quote symbols.
|
|||||||
.. _Quotation Mark: https://en.wikipedia.org/wiki/Quotation_mark
|
.. _Quotation Mark: https://en.wikipedia.org/wiki/Quotation_mark
|
||||||
|
|
||||||
|
|
||||||
|
Single and Double Prime
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Both single and double prime symbols are available in the :guilabel:`Insert` menu. These symbols
|
||||||
|
are the correct symbols to use for unit symbols for feet, inches, minutes and seconds. The usage of
|
||||||
|
these is described in more detail on the Wikipedia Prime_ page. They look very similar to single
|
||||||
|
and double straight quotes, but may be renderred similarly by the font, but they have different
|
||||||
|
codes. Using these correctly will also prevent the auto-replace and dialogue highlighting features
|
||||||
|
to understand their meaning in the text.
|
||||||
|
|
||||||
|
.. _Prime: https://en.wikipedia.org/wiki/Prime_(symbol)
|
||||||
|
|
||||||
|
|
||||||
Modifier Letter Apostrophe
|
Modifier Letter Apostrophe
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
|||||||
+9
-10
@@ -157,7 +157,7 @@ def main(sysArgs=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
debugLevel = logging.WARN
|
logLevel = logging.WARN
|
||||||
logFormat = "{levelname:8} {message:}"
|
logFormat = "{levelname:8} {message:}"
|
||||||
confPath = None
|
confPath = None
|
||||||
dataPath = None
|
dataPath = None
|
||||||
@@ -186,12 +186,12 @@ def main(sysArgs=None):
|
|||||||
)
|
)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif inOpt == "--info":
|
elif inOpt == "--info":
|
||||||
debugLevel = logging.INFO
|
logLevel = logging.INFO
|
||||||
elif inOpt == "--debug":
|
elif inOpt == "--debug":
|
||||||
debugLevel = logging.DEBUG
|
logLevel = logging.DEBUG
|
||||||
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
||||||
elif inOpt == "--verbose":
|
elif inOpt == "--verbose":
|
||||||
debugLevel = VERBOSE
|
logLevel = VERBOSE
|
||||||
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
||||||
elif inOpt == "--style":
|
elif inOpt == "--style":
|
||||||
qtStyle = inArg
|
qtStyle = inArg
|
||||||
@@ -203,17 +203,16 @@ def main(sysArgs=None):
|
|||||||
testMode = True
|
testMode = True
|
||||||
|
|
||||||
# Set Config Options
|
# Set Config Options
|
||||||
CONFIG.debugInfo = debugLevel < logging.INFO
|
|
||||||
CONFIG.cmdOpen = cmdOpen
|
CONFIG.cmdOpen = cmdOpen
|
||||||
|
|
||||||
# Set Logging
|
# Set Logging
|
||||||
logFmt = logging.Formatter(fmt=logFormat, style="{")
|
|
||||||
cHandle = logging.StreamHandler()
|
cHandle = logging.StreamHandler()
|
||||||
cHandle.setLevel(debugLevel)
|
cHandle.setFormatter(logging.Formatter(fmt=logFormat, style="{"))
|
||||||
cHandle.setFormatter(logFmt)
|
|
||||||
logger.addHandler(cHandle)
|
pkgLogger = logging.getLogger(__package__)
|
||||||
|
pkgLogger.addHandler(cHandle)
|
||||||
|
pkgLogger.setLevel(logLevel)
|
||||||
|
|
||||||
logger.setLevel(debugLevel)
|
|
||||||
logger.info("Starting novelWriter %s (%s) %s" % (
|
logger.info("Starting novelWriter %s (%s) %s" % (
|
||||||
__version__, __hexversion__, __date__
|
__version__, __hexversion__, __date__
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -55,9 +55,6 @@ class Config:
|
|||||||
self.appName = "novelWriter"
|
self.appName = "novelWriter"
|
||||||
self.appHandle = self.appName.lower()
|
self.appHandle = self.appName.lower()
|
||||||
|
|
||||||
# Debug Settings
|
|
||||||
self.debugInfo = False # True if log level is DEBUG or VERBOSE
|
|
||||||
|
|
||||||
# Config Error Handling
|
# Config Error Handling
|
||||||
self.hasError = False # True if the config class encountered an error
|
self.hasError = False # True if the config class encountered an error
|
||||||
self.errData = [] # List of error messages
|
self.errData = [] # List of error messages
|
||||||
|
|||||||
@@ -268,10 +268,14 @@ class nwUnicode:
|
|||||||
U_RECQUO = "\u300f" # Right white corner bracket
|
U_RECQUO = "\u300f" # Right white corner bracket
|
||||||
|
|
||||||
## Punctuation
|
## Punctuation
|
||||||
|
U_FGDASH = "\u2012" # Figure dash
|
||||||
U_ENDASH = "\u2013" # Short dash
|
U_ENDASH = "\u2013" # Short dash
|
||||||
U_EMDASH = "\u2014" # Long dash
|
U_EMDASH = "\u2014" # Long dash
|
||||||
|
U_HBAR = "\u2015" # Horizontal bar
|
||||||
U_HELLIP = "\u2026" # Ellipsis
|
U_HELLIP = "\u2026" # Ellipsis
|
||||||
U_MAPOSS = "\u02bc" # Modifier letter single apostrophe
|
U_MAPOSS = "\u02bc" # Modifier letter single apostrophe
|
||||||
|
U_PRIME = "\u2032" # Prime
|
||||||
|
U_DPRIME = "\u2033" # Double prime
|
||||||
|
|
||||||
## Spaces and Lines
|
## Spaces and Lines
|
||||||
U_NBSP = "\u00a0" # Non-breaking space
|
U_NBSP = "\u00a0" # Non-breaking space
|
||||||
@@ -284,8 +288,16 @@ class nwUnicode:
|
|||||||
|
|
||||||
## Symbols
|
## Symbols
|
||||||
U_CHECK = "\u2714" # Heavy check mark
|
U_CHECK = "\u2714" # Heavy check mark
|
||||||
U_MULT = "\u2715" # Multiplication x
|
U_CROSS = "\u2715" # Heavy cross mark
|
||||||
U_BULL = "\u2022" # List bullet
|
U_BULL = "\u2022" # List bullet
|
||||||
|
U_TRBULL = "\u2023" # Triangle bullet
|
||||||
|
U_HYBULL = "\u2043" # Hyphen bullet
|
||||||
|
U_FLOWER = "\u2055" # Flower punctuation mark
|
||||||
|
U_PERMIL = "\u2030" # Per mille sign
|
||||||
|
U_DEGREE = "\u00b0" # Degree symbol
|
||||||
|
U_MINUS = "\u2212" # Minus sign
|
||||||
|
U_TIMES = "\u00d7" # Multiplaction sign
|
||||||
|
U_DIVIDE = "\u00f7" # Division sign
|
||||||
|
|
||||||
## Arrows
|
## Arrows
|
||||||
U_UTRI = "\u25b2" # Up-pointing triangle
|
U_UTRI = "\u25b2" # Up-pointing triangle
|
||||||
@@ -322,10 +334,14 @@ class nwUnicode:
|
|||||||
H_LWCQUO = "『"
|
H_LWCQUO = "『"
|
||||||
|
|
||||||
## Punctuation
|
## Punctuation
|
||||||
|
H_FGDASH = "‒"
|
||||||
H_ENDASH = "–"
|
H_ENDASH = "–"
|
||||||
H_EMDASH = "—"
|
H_EMDASH = "—"
|
||||||
|
H_HBAR = "―"
|
||||||
H_HELLIP = "…"
|
H_HELLIP = "…"
|
||||||
H_MAPOSS = "ʼ"
|
H_MAPOSS = "ʼ"
|
||||||
|
H_PRIME = "′"
|
||||||
|
H_DPRIME = "″"
|
||||||
|
|
||||||
## Spaces
|
## Spaces
|
||||||
H_NBSP = " "
|
H_NBSP = " "
|
||||||
@@ -336,8 +352,16 @@ class nwUnicode:
|
|||||||
|
|
||||||
## Symbols
|
## Symbols
|
||||||
H_CHECK = "✔"
|
H_CHECK = "✔"
|
||||||
H_MULT = "✕"
|
H_CROSS = "✕"
|
||||||
H_BULL = "•"
|
H_BULL = "•"
|
||||||
|
H_TRBULL = "‣"
|
||||||
|
H_HYBULL = "⁃"
|
||||||
|
H_FLOWER = "⁕"
|
||||||
|
H_PERMIL = "‰"
|
||||||
|
H_DEGREE = "°"
|
||||||
|
H_MINUS = "−"
|
||||||
|
H_TIMES = "×"
|
||||||
|
H_DIVIDE = "÷"
|
||||||
|
|
||||||
## Arrows
|
## Arrows
|
||||||
H_UTRI = "▲"
|
H_UTRI = "▲"
|
||||||
|
|||||||
+4
-11
@@ -101,17 +101,10 @@ class nwDocInsert(Enum):
|
|||||||
|
|
||||||
NO_INSERT = 0
|
NO_INSERT = 0
|
||||||
HARD_BREAK = 1
|
HARD_BREAK = 1
|
||||||
NB_SPACE = 2
|
QUOTE_LS = 2
|
||||||
THIN_SPACE = 3
|
QUOTE_RS = 3
|
||||||
THIN_NB_SPACE = 4
|
QUOTE_LD = 4
|
||||||
SHORT_DASH = 5
|
QUOTE_RD = 5
|
||||||
LONG_DASH = 6
|
|
||||||
ELLIPSIS = 7
|
|
||||||
QUOTE_LS = 8
|
|
||||||
QUOTE_RS = 9
|
|
||||||
QUOTE_LD = 10
|
|
||||||
QUOTE_RD = 11
|
|
||||||
MODAPOS_S = 12
|
|
||||||
|
|
||||||
# END Enum nwDocInsert
|
# END Enum nwDocInsert
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -571,8 +571,9 @@ class GuiBuildNovel(QDialog):
|
|||||||
makeHtml.setJustify(justifyText)
|
makeHtml.setJustify(justifyText)
|
||||||
makeHtml.setStyles(not noStyling)
|
makeHtml.setStyles(not noStyling)
|
||||||
|
|
||||||
# Make sure the tree order is correct
|
# Make sure the project and document is up to date
|
||||||
self.theParent.treeView.flushTreeOrder()
|
self.theParent.treeView.flushTreeOrder()
|
||||||
|
self.theParent.saveDocument()
|
||||||
|
|
||||||
self.buildProgress.setMaximum(len(self.theProject.projTree))
|
self.buildProgress.setMaximum(len(self.theProject.projTree))
|
||||||
self.buildProgress.setValue(0)
|
self.buildProgress.setValue(0)
|
||||||
@@ -968,11 +969,6 @@ class GuiBuildNovel(QDialog):
|
|||||||
"""
|
"""
|
||||||
buildCache = os.path.join(self.theProject.projCache, nwFiles.BUILD_CACHE)
|
buildCache = os.path.join(self.theProject.projCache, nwFiles.BUILD_CACHE)
|
||||||
|
|
||||||
if self.mainConf.debugInfo:
|
|
||||||
nIndent = 2
|
|
||||||
else:
|
|
||||||
nIndent = None
|
|
||||||
|
|
||||||
logger.debug("Saving build cache")
|
logger.debug("Saving build cache")
|
||||||
try:
|
try:
|
||||||
with open(buildCache, mode="w+", encoding="utf8") as outFile:
|
with open(buildCache, mode="w+", encoding="utf8") as outFile:
|
||||||
@@ -981,7 +977,7 @@ class GuiBuildNovel(QDialog):
|
|||||||
"htmlStyle" : self.htmlStyle,
|
"htmlStyle" : self.htmlStyle,
|
||||||
"nwdText" : self.nwdText,
|
"nwdText" : self.nwdText,
|
||||||
"buildTime" : self.buildTime,
|
"buildTime" : self.buildTime,
|
||||||
}, indent=nIndent))
|
}, indent=2))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Failed to save build cache")
|
logger.error("Failed to save build cache")
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
|
|||||||
+1
-1
@@ -303,7 +303,7 @@ class QSwitch(QAbstractButton):
|
|||||||
trackBrush = qPalette.dark()
|
trackBrush = qPalette.dark()
|
||||||
thumbBrush = qPalette.light()
|
thumbBrush = qPalette.light()
|
||||||
textColor = qPalette.dark().color()
|
textColor = qPalette.dark().color()
|
||||||
thumbText = nwUnicode.U_MULT
|
thumbText = nwUnicode.U_CROSS
|
||||||
|
|
||||||
if self.isEnabled():
|
if self.isEnabled():
|
||||||
trackOpacity = 1.0
|
trackOpacity = 1.0
|
||||||
|
|||||||
@@ -734,20 +734,6 @@ class GuiDocEditor(QTextEdit):
|
|||||||
elif isinstance(theInsert, nwDocInsert):
|
elif isinstance(theInsert, nwDocInsert):
|
||||||
if theInsert == nwDocInsert.HARD_BREAK:
|
if theInsert == nwDocInsert.HARD_BREAK:
|
||||||
theText = " \n"
|
theText = " \n"
|
||||||
elif theInsert == nwDocInsert.NB_SPACE:
|
|
||||||
theText = nwUnicode.U_NBSP
|
|
||||||
elif theInsert == nwDocInsert.THIN_SPACE:
|
|
||||||
theText = nwUnicode.U_THSP
|
|
||||||
elif theInsert == nwDocInsert.THIN_NB_SPACE:
|
|
||||||
theText = nwUnicode.U_THNBSP
|
|
||||||
elif theInsert == nwDocInsert.SHORT_DASH:
|
|
||||||
theText = nwUnicode.U_ENDASH
|
|
||||||
elif theInsert == nwDocInsert.LONG_DASH:
|
|
||||||
theText = nwUnicode.U_EMDASH
|
|
||||||
elif theInsert == nwDocInsert.ELLIPSIS:
|
|
||||||
theText = nwUnicode.U_HELLIP
|
|
||||||
elif theInsert == nwDocInsert.MODAPOS_S:
|
|
||||||
theText = nwUnicode.U_MAPOSS
|
|
||||||
elif theInsert == nwDocInsert.QUOTE_LS:
|
elif theInsert == nwDocInsert.QUOTE_LS:
|
||||||
theText = self.typSQOpen
|
theText = self.typSQOpen
|
||||||
elif theInsert == nwDocInsert.QUOTE_RS:
|
elif theInsert == nwDocInsert.QUOTE_RS:
|
||||||
|
|||||||
+119
-21
@@ -32,7 +32,8 @@ from PyQt5.QtGui import QDesktopServices
|
|||||||
from PyQt5.QtWidgets import QMenuBar, QAction
|
from PyQt5.QtWidgets import QMenuBar, QAction
|
||||||
|
|
||||||
from nw.constants import (
|
from nw.constants import (
|
||||||
nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwKeyWords, nwLabels
|
nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwKeyWords, nwLabels,
|
||||||
|
nwUnicode
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -467,6 +468,13 @@ class GuiMainMenu(QMenuBar):
|
|||||||
self.aFocusView.triggered.connect(lambda: self.theParent.setFocus(3))
|
self.aFocusView.triggered.connect(lambda: self.theParent.setFocus(3))
|
||||||
self.viewMenu.addAction(self.aFocusView)
|
self.viewMenu.addAction(self.aFocusView)
|
||||||
|
|
||||||
|
# View > Outline
|
||||||
|
self.aFocusOutline = QAction("Focus Outline", self)
|
||||||
|
self.aFocusOutline.setStatusTip("Move focus to outline")
|
||||||
|
self.aFocusOutline.setShortcut("Alt+4")
|
||||||
|
self.aFocusOutline.triggered.connect(lambda: self.theParent.setFocus(4))
|
||||||
|
self.viewMenu.addAction(self.aFocusOutline)
|
||||||
|
|
||||||
# View > Separator
|
# View > Separator
|
||||||
self.viewMenu.addSeparator()
|
self.viewMenu.addSeparator()
|
||||||
|
|
||||||
@@ -511,29 +519,36 @@ class GuiMainMenu(QMenuBar):
|
|||||||
# Insert
|
# Insert
|
||||||
self.insertMenu = self.addMenu("&Insert")
|
self.insertMenu = self.addMenu("&Insert")
|
||||||
|
|
||||||
# Insert > Dashes and Dots
|
# Insert > Dashes
|
||||||
self.mInsDashes = self.insertMenu.addMenu("Dashes and Dots")
|
self.mInsDashes = self.insertMenu.addMenu("Dashes")
|
||||||
|
|
||||||
# Insert > Short Dash
|
# Insert > Short Dash
|
||||||
self.aInsENDash = QAction("Short Dash", self)
|
self.aInsENDash = QAction("Short Dash", self)
|
||||||
self.aInsENDash.setStatusTip("Insert short dash")
|
self.aInsENDash.setStatusTip("Insert short dash (en dash)")
|
||||||
self.aInsENDash.setShortcut("Ctrl+K, -")
|
self.aInsENDash.setShortcut("Ctrl+K, -")
|
||||||
self.aInsENDash.triggered.connect(lambda: self._docInsert(nwDocInsert.SHORT_DASH))
|
self.aInsENDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_ENDASH))
|
||||||
self.mInsDashes.addAction(self.aInsENDash)
|
self.mInsDashes.addAction(self.aInsENDash)
|
||||||
|
|
||||||
# Insert > Long Dash
|
# Insert > Long Dash
|
||||||
self.aInsEMDash = QAction("Long Dash", self)
|
self.aInsEMDash = QAction("Long Dash", self)
|
||||||
self.aInsEMDash.setStatusTip("Insert long dash")
|
self.aInsEMDash.setStatusTip("Insert long dash (em dash)")
|
||||||
self.aInsEMDash.setShortcut("Ctrl+K, _")
|
self.aInsEMDash.setShortcut("Ctrl+K, _")
|
||||||
self.aInsEMDash.triggered.connect(lambda: self._docInsert(nwDocInsert.LONG_DASH))
|
self.aInsEMDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_EMDASH))
|
||||||
self.mInsDashes.addAction(self.aInsEMDash)
|
self.mInsDashes.addAction(self.aInsEMDash)
|
||||||
|
|
||||||
# Insert > Ellipsis
|
# Insert > Long Dash
|
||||||
self.aInsEllipsis = QAction("Ellipsis", self)
|
self.aInsHorBar = QAction("Horizontal Bar", self)
|
||||||
self.aInsEllipsis.setStatusTip("Insert ellipsis")
|
self.aInsHorBar.setStatusTip("Insert a horizontal bar (quotation dash)")
|
||||||
self.aInsEllipsis.setShortcut("Ctrl+K, .")
|
self.aInsHorBar.setShortcut("Ctrl+K, Ctrl+_")
|
||||||
self.aInsEllipsis.triggered.connect(lambda: self._docInsert(nwDocInsert.ELLIPSIS))
|
self.aInsHorBar.triggered.connect(lambda: self._docInsert(nwUnicode.U_HBAR))
|
||||||
self.mInsDashes.addAction(self.aInsEllipsis)
|
self.mInsDashes.addAction(self.aInsHorBar)
|
||||||
|
|
||||||
|
# Insert > Figure Dash
|
||||||
|
self.aInsFigDash = QAction("Figure Dash", self)
|
||||||
|
self.aInsFigDash.setStatusTip("Insert figure dash (same width as a number character)")
|
||||||
|
self.aInsFigDash.setShortcut("Ctrl+K, ~")
|
||||||
|
self.aInsFigDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_FGDASH))
|
||||||
|
self.mInsDashes.addAction(self.aInsFigDash)
|
||||||
|
|
||||||
# Insert > Quote Marks
|
# Insert > Quote Marks
|
||||||
self.mInsQuotes = self.insertMenu.addMenu("Quote Marks")
|
self.mInsQuotes = self.insertMenu.addMenu("Quote Marks")
|
||||||
@@ -568,11 +583,35 @@ class GuiMainMenu(QMenuBar):
|
|||||||
|
|
||||||
# Insert > Alternative Apostrophe
|
# Insert > Alternative Apostrophe
|
||||||
self.aInsMSApos = QAction("Alternative Apostrophe", self)
|
self.aInsMSApos = QAction("Alternative Apostrophe", self)
|
||||||
self.aInsMSApos.setStatusTip("Insert unicode modifier letter single apostrophe")
|
self.aInsMSApos.setStatusTip("Insert modifier letter single apostrophe")
|
||||||
self.aInsMSApos.setShortcut("Ctrl+K, '")
|
self.aInsMSApos.setShortcut("Ctrl+K, '")
|
||||||
self.aInsMSApos.triggered.connect(lambda: self._docInsert(nwDocInsert.MODAPOS_S))
|
self.aInsMSApos.triggered.connect(lambda: self._docInsert(nwUnicode.U_MAPOSS))
|
||||||
self.mInsQuotes.addAction(self.aInsMSApos)
|
self.mInsQuotes.addAction(self.aInsMSApos)
|
||||||
|
|
||||||
|
# Insert > Symbols
|
||||||
|
self.mInsPunct = self.insertMenu.addMenu("General Punctuation")
|
||||||
|
|
||||||
|
# Insert > Ellipsis
|
||||||
|
self.aInsEllipsis = QAction("Ellipsis", self)
|
||||||
|
self.aInsEllipsis.setStatusTip("Insert ellipsis")
|
||||||
|
self.aInsEllipsis.setShortcut("Ctrl+K, .")
|
||||||
|
self.aInsEllipsis.triggered.connect(lambda: self._docInsert(nwUnicode.U_HELLIP))
|
||||||
|
self.mInsPunct.addAction(self.aInsEllipsis)
|
||||||
|
|
||||||
|
# Insert > Prime
|
||||||
|
self.aInsPrime = QAction("Prime", self)
|
||||||
|
self.aInsPrime.setStatusTip("Insert a prime symbol")
|
||||||
|
self.aInsPrime.setShortcut("Ctrl+K, Ctrl+'")
|
||||||
|
self.aInsPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_PRIME))
|
||||||
|
self.mInsPunct.addAction(self.aInsPrime)
|
||||||
|
|
||||||
|
# Insert > Double Prime
|
||||||
|
self.aInsDPrime = QAction("Double Prime", self)
|
||||||
|
self.aInsDPrime.setStatusTip("Insert a double prime symbol")
|
||||||
|
self.aInsDPrime.setShortcut("Ctrl+K, Ctrl+\"")
|
||||||
|
self.aInsDPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_DPRIME))
|
||||||
|
self.mInsPunct.addAction(self.aInsDPrime)
|
||||||
|
|
||||||
# Insert > Breaks and Spaces
|
# Insert > Breaks and Spaces
|
||||||
self.mInsBreaks = self.insertMenu.addMenu("Breaks and Spaces")
|
self.mInsBreaks = self.insertMenu.addMenu("Breaks and Spaces")
|
||||||
|
|
||||||
@@ -587,23 +626,82 @@ class GuiMainMenu(QMenuBar):
|
|||||||
self.aInsNBSpace = QAction("Non-Breaking Space", self)
|
self.aInsNBSpace = QAction("Non-Breaking Space", self)
|
||||||
self.aInsNBSpace.setStatusTip("Insert a non-breaking space")
|
self.aInsNBSpace.setStatusTip("Insert a non-breaking space")
|
||||||
self.aInsNBSpace.setShortcut("Ctrl+K, Space")
|
self.aInsNBSpace.setShortcut("Ctrl+K, Space")
|
||||||
self.aInsNBSpace.triggered.connect(lambda: self._docInsert(nwDocInsert.NB_SPACE))
|
self.aInsNBSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_NBSP))
|
||||||
self.mInsBreaks.addAction(self.aInsNBSpace)
|
self.mInsBreaks.addAction(self.aInsNBSpace)
|
||||||
|
|
||||||
# Insert > Thin Space
|
# Insert > Thin Space
|
||||||
self.aInsThinSpace = QAction("Thin Space", self)
|
self.aInsThinSpace = QAction("Thin Space", self)
|
||||||
self.aInsThinSpace.setStatusTip("Insert a thin space")
|
self.aInsThinSpace.setStatusTip("Insert a thin space")
|
||||||
self.aInsThinSpace.setShortcut("Ctrl+K, Shift+Space")
|
self.aInsThinSpace.setShortcut("Ctrl+K, Shift+Space")
|
||||||
self.aInsThinSpace.triggered.connect(lambda: self._docInsert(nwDocInsert.THIN_SPACE))
|
self.aInsThinSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_THSP))
|
||||||
self.mInsBreaks.addAction(self.aInsThinSpace)
|
self.mInsBreaks.addAction(self.aInsThinSpace)
|
||||||
|
|
||||||
# Insert > Thin Non-Breaking Space
|
# Insert > Thin Non-Breaking Space
|
||||||
self.aInsThinNBSpace = QAction("Thin Non-Breaking Space", self)
|
self.aInsThinNBSpace = QAction("Thin Non-Breaking Space", self)
|
||||||
self.aInsThinNBSpace.setStatusTip("Insert a thin non-breaking space")
|
self.aInsThinNBSpace.setStatusTip("Insert a thin non-breaking space")
|
||||||
self.aInsThinNBSpace.setShortcut("Ctrl+K, Ctrl+Space")
|
self.aInsThinNBSpace.setShortcut("Ctrl+K, Ctrl+Space")
|
||||||
self.aInsThinNBSpace.triggered.connect(lambda: self._docInsert(nwDocInsert.THIN_NB_SPACE))
|
self.aInsThinNBSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_THNBSP))
|
||||||
self.mInsBreaks.addAction(self.aInsThinNBSpace)
|
self.mInsBreaks.addAction(self.aInsThinNBSpace)
|
||||||
|
|
||||||
|
# Insert > Symbols
|
||||||
|
self.mInsSymbol = self.insertMenu.addMenu("Other Symbols")
|
||||||
|
|
||||||
|
# Insert > List Bullet
|
||||||
|
self.aInsBullet = QAction("List Bullet", self)
|
||||||
|
self.aInsBullet.setStatusTip("Insert a list bullet")
|
||||||
|
self.aInsBullet.setShortcut("Ctrl+K, *")
|
||||||
|
self.aInsBullet.triggered.connect(lambda: self._docInsert(nwUnicode.U_BULL))
|
||||||
|
self.mInsSymbol.addAction(self.aInsBullet)
|
||||||
|
|
||||||
|
# Insert > Hyphen Bullet
|
||||||
|
self.aInsHyBull = QAction("Hyphen Bullet", self)
|
||||||
|
self.aInsHyBull.setStatusTip("Insert a hyphen bullet (alternative bullet)")
|
||||||
|
self.aInsHyBull.setShortcut("Ctrl+K, Ctrl+-")
|
||||||
|
self.aInsHyBull.triggered.connect(lambda: self._docInsert(nwUnicode.U_HYBULL))
|
||||||
|
self.mInsSymbol.addAction(self.aInsHyBull)
|
||||||
|
|
||||||
|
# Insert > Flower Mark
|
||||||
|
self.aInsFlower = QAction("Flower Mark", self)
|
||||||
|
self.aInsFlower.setStatusTip("Insert a flower mark (alternative bullet)")
|
||||||
|
self.aInsFlower.setShortcut("Ctrl+K, Ctrl+*")
|
||||||
|
self.aInsFlower.triggered.connect(lambda: self._docInsert(nwUnicode.U_FLOWER))
|
||||||
|
self.mInsSymbol.addAction(self.aInsFlower)
|
||||||
|
|
||||||
|
# Insert > Per Mille
|
||||||
|
self.aInsPerMille = QAction("Per Mille", self)
|
||||||
|
self.aInsPerMille.setStatusTip("Insert a per mille symbol")
|
||||||
|
self.aInsPerMille.setShortcut("Ctrl+K, %")
|
||||||
|
self.aInsPerMille.triggered.connect(lambda: self._docInsert(nwUnicode.U_PERMIL))
|
||||||
|
self.mInsSymbol.addAction(self.aInsPerMille)
|
||||||
|
|
||||||
|
# Insert > Degree Symbol
|
||||||
|
self.aInsDegree = QAction("Degree Symbol", self)
|
||||||
|
self.aInsDegree.setStatusTip("Insert a degree symbol")
|
||||||
|
self.aInsDegree.setShortcut("Ctrl+K, Ctrl+O")
|
||||||
|
self.aInsDegree.triggered.connect(lambda: self._docInsert(nwUnicode.U_DEGREE))
|
||||||
|
self.mInsSymbol.addAction(self.aInsDegree)
|
||||||
|
|
||||||
|
# Insert > Minus Sign
|
||||||
|
self.aInsMinus = QAction("Minus Sign", self)
|
||||||
|
self.aInsMinus.setStatusTip("Insert a minus sign (not a hypen or dash)")
|
||||||
|
self.aInsMinus.setShortcut("Ctrl+K, Ctrl+M")
|
||||||
|
self.aInsMinus.triggered.connect(lambda: self._docInsert(nwUnicode.U_MINUS))
|
||||||
|
self.mInsSymbol.addAction(self.aInsMinus)
|
||||||
|
|
||||||
|
# Insert > Times Sign
|
||||||
|
self.aInsTimes = QAction("Times Sign", self)
|
||||||
|
self.aInsTimes.setStatusTip("Insert a times sign (multiplication cross)")
|
||||||
|
self.aInsTimes.setShortcut("Ctrl+K, Ctrl+X")
|
||||||
|
self.aInsTimes.triggered.connect(lambda: self._docInsert(nwUnicode.U_TIMES))
|
||||||
|
self.mInsSymbol.addAction(self.aInsTimes)
|
||||||
|
|
||||||
|
# Insert > Division
|
||||||
|
self.aInsDivide = QAction("Division Sign", self)
|
||||||
|
self.aInsDivide.setStatusTip("Insert a division sign")
|
||||||
|
self.aInsDivide.setShortcut("Ctrl+K, Ctrl+D")
|
||||||
|
self.aInsDivide.triggered.connect(lambda: self._docInsert(nwUnicode.U_DIVIDE))
|
||||||
|
self.mInsSymbol.addAction(self.aInsDivide)
|
||||||
|
|
||||||
# Insert > Separator
|
# Insert > Separator
|
||||||
self.insertMenu.addSeparator()
|
self.insertMenu.addSeparator()
|
||||||
|
|
||||||
@@ -704,7 +802,7 @@ class GuiMainMenu(QMenuBar):
|
|||||||
# Format > Strikethrough
|
# Format > Strikethrough
|
||||||
self.aFmtStrike = QAction("Strikethrough", self)
|
self.aFmtStrike = QAction("Strikethrough", self)
|
||||||
self.aFmtStrike.setStatusTip("Add strikethrough to selected text")
|
self.aFmtStrike.setStatusTip("Add strikethrough to selected text")
|
||||||
self.aFmtStrike.setShortcut("Ctrl+-")
|
self.aFmtStrike.setShortcut("Ctrl+D")
|
||||||
self.aFmtStrike.triggered.connect(lambda: self._docAction(nwDocAction.STRIKE))
|
self.aFmtStrike.triggered.connect(lambda: self._docAction(nwDocAction.STRIKE))
|
||||||
self.fmtMenu.addAction(self.aFmtStrike)
|
self.fmtMenu.addAction(self.aFmtStrike)
|
||||||
|
|
||||||
@@ -714,14 +812,14 @@ class GuiMainMenu(QMenuBar):
|
|||||||
# Format > Double Quotes
|
# Format > Double Quotes
|
||||||
self.aFmtDQuote = QAction("Wrap Double Quotes", self)
|
self.aFmtDQuote = QAction("Wrap Double Quotes", self)
|
||||||
self.aFmtDQuote.setStatusTip("Wrap selected text in double quotes")
|
self.aFmtDQuote.setStatusTip("Wrap selected text in double quotes")
|
||||||
self.aFmtDQuote.setShortcut("Ctrl+D")
|
self.aFmtDQuote.setShortcut("Ctrl+\"")
|
||||||
self.aFmtDQuote.triggered.connect(lambda: self._docAction(nwDocAction.D_QUOTE))
|
self.aFmtDQuote.triggered.connect(lambda: self._docAction(nwDocAction.D_QUOTE))
|
||||||
self.fmtMenu.addAction(self.aFmtDQuote)
|
self.fmtMenu.addAction(self.aFmtDQuote)
|
||||||
|
|
||||||
# Format > Single Quotes
|
# Format > Single Quotes
|
||||||
self.aFmtSQuote = QAction("Wrap Single Quotes", self)
|
self.aFmtSQuote = QAction("Wrap Single Quotes", self)
|
||||||
self.aFmtSQuote.setStatusTip("Wrap selected text in single quotes")
|
self.aFmtSQuote.setStatusTip("Wrap selected text in single quotes")
|
||||||
self.aFmtSQuote.setShortcut("Ctrl+Shift+D")
|
self.aFmtSQuote.setShortcut("Ctrl+'")
|
||||||
self.aFmtSQuote.triggered.connect(lambda: self._docAction(nwDocAction.S_QUOTE))
|
self.aFmtSQuote.triggered.connect(lambda: self._docAction(nwDocAction.S_QUOTE))
|
||||||
self.fmtMenu.addAction(self.aFmtSQuote)
|
self.fmtMenu.addAction(self.aFmtSQuote)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""novelWriter GUI Project Details
|
"""
|
||||||
|
|
||||||
novelWriter – GUI Project Details
|
novelWriter – GUI Project Details
|
||||||
===================================
|
=================================
|
||||||
Class holding the project details dialog
|
Class holding the project details dialog
|
||||||
|
|
||||||
File History:
|
File History:
|
||||||
Created: 2021-01-03 [1.0a0]
|
Created: 2021-01-03 [1.1a0]
|
||||||
|
|
||||||
This file is a part of novelWriter
|
This file is a part of novelWriter
|
||||||
Copyright 2018–2021, Veronica Berglyd Olsen
|
Copyright 2018–2021, Veronica Berglyd Olsen
|
||||||
@@ -33,7 +32,7 @@ from PyQt5.QtCore import Qt, QSize
|
|||||||
from PyQt5.QtGui import QFont
|
from PyQt5.QtGui import QFont
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QWidget, QDialogButtonBox, QVBoxLayout, QTreeWidget, QTreeWidgetItem,
|
QWidget, QDialogButtonBox, QVBoxLayout, QTreeWidget, QTreeWidgetItem,
|
||||||
QLabel, QSpinBox, QGridLayout, QHBoxLayout, QLineEdit
|
QLabel, QSpinBox, QGridLayout, QHBoxLayout, QLineEdit, QAbstractItemView
|
||||||
)
|
)
|
||||||
|
|
||||||
from nw.gui.custom import PagedDialog, QSwitch
|
from nw.gui.custom import PagedDialog, QSwitch
|
||||||
@@ -271,6 +270,7 @@ class GuiProjectDetailsContents(QWidget):
|
|||||||
self.tocTree.setIconSize(QSize(iPx, iPx))
|
self.tocTree.setIconSize(QSize(iPx, iPx))
|
||||||
self.tocTree.setIndentation(0)
|
self.tocTree.setIndentation(0)
|
||||||
self.tocTree.setColumnCount(6)
|
self.tocTree.setColumnCount(6)
|
||||||
|
self.tocTree.setSelectionMode(QAbstractItemView.NoSelection)
|
||||||
self.tocTree.setHeaderLabels(["Title", "Words", "Pages", "Page", "Progress", ""])
|
self.tocTree.setHeaderLabels(["Title", "Words", "Pages", "Page", "Progress", ""])
|
||||||
|
|
||||||
treeHeadItem = self.tocTree.headerItem()
|
treeHeadItem = self.tocTree.headerItem()
|
||||||
|
|||||||
+19
-2
@@ -1128,14 +1128,19 @@ class GuiMain(QMainWindow):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def setFocus(self, paneNo):
|
def setFocus(self, paneNo):
|
||||||
"""Switch focus to one of the three main GUI panes.
|
"""Switch focus between main GUI views.
|
||||||
"""
|
"""
|
||||||
if paneNo == 1:
|
if paneNo == 1:
|
||||||
self.treeView.setFocus()
|
self.treeView.setFocus()
|
||||||
elif paneNo == 2:
|
elif paneNo == 2:
|
||||||
|
self.mainTabs.setCurrentWidget(self.splitDocs)
|
||||||
self.docEditor.setFocus()
|
self.docEditor.setFocus()
|
||||||
elif paneNo == 3:
|
elif paneNo == 3:
|
||||||
|
self.mainTabs.setCurrentWidget(self.splitDocs)
|
||||||
self.docViewer.setFocus()
|
self.docViewer.setFocus()
|
||||||
|
elif paneNo == 4:
|
||||||
|
self.mainTabs.setCurrentWidget(self.splitOutline)
|
||||||
|
self.projView.setFocus()
|
||||||
return
|
return
|
||||||
|
|
||||||
def closeDocEditor(self):
|
def closeDocEditor(self):
|
||||||
@@ -1240,16 +1245,28 @@ class GuiMain(QMainWindow):
|
|||||||
# Insert
|
# Insert
|
||||||
self.addAction(self.mainMenu.aInsENDash)
|
self.addAction(self.mainMenu.aInsENDash)
|
||||||
self.addAction(self.mainMenu.aInsEMDash)
|
self.addAction(self.mainMenu.aInsEMDash)
|
||||||
self.addAction(self.mainMenu.aInsEllipsis)
|
self.addAction(self.mainMenu.aInsHorBar)
|
||||||
|
self.addAction(self.mainMenu.aInsFigDash)
|
||||||
self.addAction(self.mainMenu.aInsQuoteLS)
|
self.addAction(self.mainMenu.aInsQuoteLS)
|
||||||
self.addAction(self.mainMenu.aInsQuoteRS)
|
self.addAction(self.mainMenu.aInsQuoteRS)
|
||||||
self.addAction(self.mainMenu.aInsQuoteLD)
|
self.addAction(self.mainMenu.aInsQuoteLD)
|
||||||
self.addAction(self.mainMenu.aInsQuoteRD)
|
self.addAction(self.mainMenu.aInsQuoteRD)
|
||||||
self.addAction(self.mainMenu.aInsMSApos)
|
self.addAction(self.mainMenu.aInsMSApos)
|
||||||
|
self.addAction(self.mainMenu.aInsEllipsis)
|
||||||
|
self.addAction(self.mainMenu.aInsPrime)
|
||||||
|
self.addAction(self.mainMenu.aInsDPrime)
|
||||||
self.addAction(self.mainMenu.aInsHardBreak)
|
self.addAction(self.mainMenu.aInsHardBreak)
|
||||||
self.addAction(self.mainMenu.aInsNBSpace)
|
self.addAction(self.mainMenu.aInsNBSpace)
|
||||||
self.addAction(self.mainMenu.aInsThinSpace)
|
self.addAction(self.mainMenu.aInsThinSpace)
|
||||||
self.addAction(self.mainMenu.aInsThinNBSpace)
|
self.addAction(self.mainMenu.aInsThinNBSpace)
|
||||||
|
self.addAction(self.mainMenu.aInsBullet)
|
||||||
|
self.addAction(self.mainMenu.aInsHyBull)
|
||||||
|
self.addAction(self.mainMenu.aInsFlower)
|
||||||
|
self.addAction(self.mainMenu.aInsPerMille)
|
||||||
|
self.addAction(self.mainMenu.aInsDegree)
|
||||||
|
self.addAction(self.mainMenu.aInsMinus)
|
||||||
|
self.addAction(self.mainMenu.aInsTimes)
|
||||||
|
self.addAction(self.mainMenu.aInsDivide)
|
||||||
|
|
||||||
for mAction, _ in self.mainMenu.mInsKWItems.values():
|
for mAction, _ in self.mainMenu.mInsKWItems.values():
|
||||||
self.addAction(mAction)
|
self.addAction(mAction)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
"lipsum.com"
|
"lipsum.com"
|
||||||
],
|
],
|
||||||
"buildTime": 1611491561
|
"buildTime": 1611662802
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
"css": [
|
"css": [
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ def testBaseInit_Options(monkeypatch, tmpDir):
|
|||||||
# Defaults w/None Args
|
# Defaults w/None Args
|
||||||
nwGUI = nw.main()
|
nwGUI = nw.main()
|
||||||
assert nw.logger.getEffectiveLevel() == logging.WARNING
|
assert nw.logger.getEffectiveLevel() == logging.WARNING
|
||||||
assert nw.CONFIG.debugInfo is False
|
|
||||||
assert nwGUI.closeMain() == "closeMain"
|
assert nwGUI.closeMain() == "closeMain"
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
@@ -86,7 +85,6 @@ def testBaseInit_Options(monkeypatch, tmpDir):
|
|||||||
["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir, "--style=Fusion"]
|
["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir, "--style=Fusion"]
|
||||||
)
|
)
|
||||||
assert nw.logger.getEffectiveLevel() == logging.WARNING
|
assert nw.logger.getEffectiveLevel() == logging.WARNING
|
||||||
assert nw.CONFIG.debugInfo is False
|
|
||||||
assert nwGUI.closeMain() == "closeMain"
|
assert nwGUI.closeMain() == "closeMain"
|
||||||
|
|
||||||
# Log Levels
|
# Log Levels
|
||||||
@@ -94,21 +92,18 @@ def testBaseInit_Options(monkeypatch, tmpDir):
|
|||||||
["--testmode", "--info", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
["--testmode", "--info", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
||||||
)
|
)
|
||||||
assert nw.logger.getEffectiveLevel() == logging.INFO
|
assert nw.logger.getEffectiveLevel() == logging.INFO
|
||||||
assert nw.CONFIG.debugInfo is False
|
|
||||||
assert nwGUI.closeMain() == "closeMain"
|
assert nwGUI.closeMain() == "closeMain"
|
||||||
|
|
||||||
nwGUI = nw.main(
|
nwGUI = nw.main(
|
||||||
["--testmode", "--debug", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
["--testmode", "--debug", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
||||||
)
|
)
|
||||||
assert nw.logger.getEffectiveLevel() == logging.DEBUG
|
assert nw.logger.getEffectiveLevel() == logging.DEBUG
|
||||||
assert nw.CONFIG.debugInfo is True
|
|
||||||
assert nwGUI.closeMain() == "closeMain"
|
assert nwGUI.closeMain() == "closeMain"
|
||||||
|
|
||||||
nwGUI = nw.main(
|
nwGUI = nw.main(
|
||||||
["--testmode", "--verbose", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
["--testmode", "--verbose", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
|
||||||
)
|
)
|
||||||
assert nw.logger.getEffectiveLevel() == 5
|
assert nw.logger.getEffectiveLevel() == 5
|
||||||
assert nw.CONFIG.debugInfo is True
|
|
||||||
assert nwGUI.closeMain() == "closeMain"
|
assert nwGUI.closeMain() == "closeMain"
|
||||||
|
|
||||||
# Help and Version
|
# Help and Version
|
||||||
|
|||||||
@@ -392,8 +392,12 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
|||||||
assert nwGUI.docEditor.getText() == nwUnicode.U_EMDASH
|
assert nwGUI.docEditor.getText() == nwUnicode.U_EMDASH
|
||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
nwGUI.mainMenu.aInsEllipsis.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsHorBar.activate(QAction.Trigger)
|
||||||
assert nwGUI.docEditor.getText() == nwUnicode.U_HELLIP
|
assert nwGUI.docEditor.getText() == nwUnicode.U_HBAR
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsFigDash.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_FGDASH
|
||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
nwGUI.mainMenu.aInsQuoteLS.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsQuoteLS.activate(QAction.Trigger)
|
||||||
@@ -416,6 +420,50 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
|||||||
assert nwGUI.docEditor.getText() == nwUnicode.U_MAPOSS
|
assert nwGUI.docEditor.getText() == nwUnicode.U_MAPOSS
|
||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsEllipsis.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_HELLIP
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsPrime.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_PRIME
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsDPrime.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_DPRIME
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsBullet.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_BULL
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsHyBull.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_HYBULL
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsFlower.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_FLOWER
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsPerMille.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_PERMIL
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsDegree.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_DEGREE
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsMinus.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_MINUS
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsTimes.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_TIMES
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
|
nwGUI.mainMenu.aInsDivide.activate(QAction.Trigger)
|
||||||
|
assert nwGUI.docEditor.getText() == nwUnicode.U_DIVIDE
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
nwGUI.mainMenu.aInsHardBreak.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsHardBreak.activate(QAction.Trigger)
|
||||||
assert nwGUI.docEditor.getText() == " \n"
|
assert nwGUI.docEditor.getText() == " \n"
|
||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user