Add a summary entry to the insert menu (#1619)

This commit is contained in:
Veronica Berglyd Olsen
2023-11-25 23:51:30 +01:00
parent 53aa970427
commit bedd71b105
4 changed files with 42 additions and 29 deletions
+27 -26
View File
@@ -90,6 +90,8 @@ Text Formatting Shortcuts
.. csv-table::
:header: "Shortcut", "Description"
":kbd:`Ctrl+'`", "Wrap selected text, or word under cursor, in single quotes"
":kbd:`Ctrl+""`", "Wrap selected text, or word under cursor, in double quotes"
":kbd:`Ctrl+/`", "Toggle block format as comment"
":kbd:`Ctrl+0`", "Remove block formatting for block under cursor"
":kbd:`Ctrl+1`", "Change block format to header level 1"
@@ -104,8 +106,6 @@ Text Formatting Shortcuts
":kbd:`Ctrl+B`", "Format selected text, or word under cursor, with strong emphasis (bold)"
":kbd:`Ctrl+D`", "Strikethrough selected text, or word under cursor"
":kbd:`Ctrl+I`", "Format selected text, or word under cursor, with emphasis (italic)"
":kbd:`Ctrl+'`", "Wrap selected text, or word under cursor, in single quotes"
":kbd:`Ctrl+""`", "Wrap selected text, or word under cursor, in double quotes"
":kbd:`Ctrl+Shift+/`", "Remove block formatting for block under cursor"
@@ -127,10 +127,10 @@ Other Editor Shortcuts
":kbd:`Ctrl+X`", "Cut selected text to clipboard"
":kbd:`Ctrl+Y`", "Redo latest undo"
":kbd:`Ctrl+Z`", "Undo latest changes"
":kbd:`Ctrl+Del`", "Delete the word after the cursor"
":kbd:`Ctrl+Backspace`", "Delete the word before the cursor"
":kbd:`Ctrl+Return`", "Open the tag or reference under the cursor in the viewer"
":kbd:`Ctrl+Del`", "Delete the word after the cursor"
":kbd:`Ctrl+F7`", "Toggle spell checking"
":kbd:`Ctrl+Return`", "Open the tag or reference under the cursor in the viewer"
":kbd:`Ctrl+Shift+A`", "Select all text in the current paragraph"
":kbd:`Ctrl+Shift+I`", "Import text to the current document from a text file"
@@ -147,39 +147,40 @@ a key or key combination for the inserted content.
.. csv-table::
:header: "Shortcut", "Description"
":kbd:`Ctrl+K`, :kbd:``", "Insert a short dash (en dash)"
":kbd:`Ctrl+K`, :kbd:`Space`", "Insert a non-breaking space"
":kbd:`Ctrl+K`, :kbd:`_`", "Insert a long dash (em dash)"
":kbd:`Ctrl+K`, :kbd:`Ctrl+_`", "Insert a horizontal bar (quotation dash)"
":kbd:`Ctrl+K`, :kbd:`.`", "Insert an ellipsis"
":kbd:`Ctrl+K`, :kbd:`'`", "Insert a modifier apostrophe"
":kbd:`Ctrl+K`, :kbd:`*`", "Insert a list bullet"
":kbd:`Ctrl+K`, :kbd:`%`", "Insert a per mille symbol"
":kbd:`Ctrl+K`, :kbd:`~`", "Insert a figure dash (same width as a number)"
":kbd:`Ctrl+K`, :kbd:``", "Insert a short dash (en dash)"
":kbd:`Ctrl+K`, :kbd:`1`", "Insert a left single quote"
":kbd:`Ctrl+K`, :kbd:`2`", "Insert a right single quote"
":kbd:`Ctrl+K`, :kbd:`3`", "Insert a left double quote"
":kbd:`Ctrl+K`, :kbd:`4`", "Insert a right double quote"
":kbd:`Ctrl+K`, :kbd:`'`", "Insert a modifier apostrophe"
":kbd:`Ctrl+K`, :kbd:`.`", "Insert an ellipsis"
":kbd:`Ctrl+K`, :kbd:`Ctrl+'`", "Insert a prime"
":kbd:`Ctrl+K`, :kbd:`Ctrl+""`", "Insert a double prime"
":kbd:`Ctrl+K`, :kbd:`Space`", "Insert a non-breaking space"
":kbd:`Ctrl+K`, :kbd:`Shift+Space`", "Insert a thin space"
":kbd:`Ctrl+K`, :kbd:`Ctrl+Space`", "Insert a thin non-breaking space"
":kbd:`Ctrl+K`, :kbd:`*`", "Insert a list bullet"
":kbd:`Ctrl+K`, :kbd:`Ctrl+`", "Insert a hyphen bullet (alternative bullet)"
":kbd:`Ctrl+K`, :kbd:`Ctrl+*`", "Insert a flower mark (alternative bullet)"
":kbd:`Ctrl+K`, :kbd:`%`", "Insert a per mille symbol"
":kbd:`Ctrl+K`, :kbd:`Ctrl+O`", "Insert a degree symbol"
":kbd:`Ctrl+K`, :kbd:`Ctrl+X`", "Insert a times sign"
":kbd:`Ctrl+K`, :kbd:`Ctrl+D`", "Insert a division sign"
":kbd:`Ctrl+K`, :kbd:`G`", "Insert a ``@tag`` keyword"
":kbd:`Ctrl+K`, :kbd:`V`", "Insert a ``@pov`` keyword"
":kbd:`Ctrl+K`, :kbd:`F`", "Insert a ``@focus`` keyword"
":kbd:`Ctrl+K`, :kbd:`C`", "Insert a ``@char`` keyword"
":kbd:`Ctrl+K`, :kbd:`E`", "Insert an ``@entity`` keyword"
":kbd:`Ctrl+K`, :kbd:`F`", "Insert a ``@focus`` keyword"
":kbd:`Ctrl+K`, :kbd:`G`", "Insert a ``@tag`` keyword"
":kbd:`Ctrl+K`, :kbd:`L`", "Insert a ``@location`` keyword"
":kbd:`Ctrl+K`, :kbd:`O`", "Insert an ``@object`` keyword"
":kbd:`Ctrl+K`, :kbd:`P`", "Insert a ``@plot`` keyword"
":kbd:`Ctrl+K`, :kbd:`S`", "Insert a synopsis comment"
":kbd:`Ctrl+K`, :kbd:`T`", "Insert a ``@time`` keyword"
":kbd:`Ctrl+K`, :kbd:`L`", "Insert a ``@location`` keyword"
":kbd:`Ctrl+K`, :kbd:`O`", "Insert an ``@object`` keyword"
":kbd:`Ctrl+K`, :kbd:`E`", "Insert an ``@entity`` keyword"
":kbd:`Ctrl+K`, :kbd:`U`", "Insert a summary comment"
":kbd:`Ctrl+K`, :kbd:`V`", "Insert a ``@pov`` keyword"
":kbd:`Ctrl+K`, :kbd:`X`", "Insert a ``@custom`` keyword"
":kbd:`Ctrl+K`, :kbd:`Ctrl+Space`", "Insert a thin non-breaking space"
":kbd:`Ctrl+K`, :kbd:`Ctrl+_`", "Insert a horizontal bar (quotation dash)"
":kbd:`Ctrl+K`, :kbd:`Ctrl+'`", "Insert a prime"
":kbd:`Ctrl+K`, :kbd:`Ctrl+""`", "Insert a double prime"
":kbd:`Ctrl+K`, :kbd:`Ctrl+*`", "Insert a flower mark (alternative bullet)"
":kbd:`Ctrl+K`, :kbd:`Ctrl+`", "Insert a hyphen bullet (alternative bullet)"
":kbd:`Ctrl+K`, :kbd:`Ctrl+D`", "Insert a division sign"
":kbd:`Ctrl+K`, :kbd:`Ctrl+O`", "Insert a degree symbol"
":kbd:`Ctrl+K`, :kbd:`Ctrl+X`", "Insert a times sign"
":kbd:`Ctrl+K`, :kbd:`Shift+Space`", "Insert a thin space"
.. _a_kb_viewer:
+4 -3
View File
@@ -136,9 +136,10 @@ class nwDocInsert(Enum):
QUOTE_LD = 3
QUOTE_RD = 4
SYNOPSIS = 5
NEW_PAGE = 6
VSPACE_S = 7
VSPACE_M = 8
SUMMARY = 6
NEW_PAGE = 7
VSPACE_S = 8
VSPACE_M = 9
# END Enum nwDocInsert
+4
View File
@@ -834,6 +834,10 @@ class GuiDocEditor(QPlainTextEdit):
text = "% Synopsis: "
newBlock = True
goAfter = True
elif insert == nwDocInsert.SUMMARY:
text = "% Summary: "
newBlock = True
goAfter = True
elif insert == nwDocInsert.NEW_PAGE:
text = "[newpage]"
newBlock = True
+7
View File
@@ -564,6 +564,13 @@ class GuiMainMenu(QMenuBar):
lambda: self.requestDocInsert.emit(nwDocInsert.SYNOPSIS)
)
# Insert > Summary Comment
self.aInsSynopsis = self.mInsComments.addAction(self.tr("Summary Comment"))
self.aInsSynopsis.setShortcut("Ctrl+K, U")
self.aInsSynopsis.triggered.connect(
lambda: self.requestDocInsert.emit(nwDocInsert.SUMMARY)
)
# Insert > Symbols
self.mInsBreaks = self.insMenu.addMenu(self.tr("Page Break and Space"))