Clean up GUI text (#969)

* Remove all statustip entries in the menu
* Prune text in Preferences
* Fix class labels
* Remove some redundant tooltips
* Improve some labels and dialogs
* Remove some more tooltips and fix a typo
* Update base ts file
* Fix typo
This commit is contained in:
Veronica Berglyd Olsen
2022-01-18 22:16:25 +01:00
committed by GitHub
parent 25038e6cbb
commit 074718aedc
21 changed files with 597 additions and 1421 deletions
+3 -3
View File
@@ -104,11 +104,11 @@ supported. A document or a folder can be deleted from the :guilabel:`Project` me
.. _a_proj_roots_out: .. _a_proj_roots_out:
Archived Documents (Outtakes) Archived Documents
----------------------------- ------------------
If you don't want to delete a document, or put it in the :guilabel:`Trash` folder where it may be If you don't want to delete a document, or put it in the :guilabel:`Trash` folder where it may be
deleted, but still want it out of your main project tree, you can create an :guilabel:`Outtakes` deleted, but still want it out of your main project tree, you can create an :guilabel:`Archive`
root folder from the :guilabel:`Project` menu. You are not allowed to move entire folders to this root folder from the :guilabel:`Project` menu. You are not allowed to move entire folders to this
root folder, only documents. If you need folders in it to organise your documents, you can of root folder, only documents. If you need folders in it to organise your documents, you can of
course create new ones there. course create new ones there.
+1 -1
View File
@@ -182,7 +182,7 @@ available to change how the documents where formatted on export. These have now
just two layouts: :guilabel:`Novel Document` and :guilabel:`Project Note`. just two layouts: :guilabel:`Novel Document` and :guilabel:`Project Note`.
Novel documents can only live in the :guilabel:`Novel` root folder. You can also move them to Novel documents can only live in the :guilabel:`Novel` root folder. You can also move them to
:guilabel:`Outtakes` and :guilabel:`Trash` of course. Project notes can be added anywhere in the :guilabel:`Archive` and :guilabel:`Trash` of course. Project notes can be added anywhere in the
project. project.
Depending on which icon theme you're using, the project tree can distinguish between the different Depending on which icon theme you're using, the project tree can distinguish between the different
+2 -2
View File
@@ -78,7 +78,7 @@ major or minor character.
Whether a document uses a "Status" or "Importance" flag depends on which root folder it lives in. Whether a document uses a "Status" or "Importance" flag depends on which root folder it lives in.
If it's in the :guilabel:`Novel` folder, it uses the "Status" flag, otherwise it uses an If it's in the :guilabel:`Novel` folder, it uses the "Status" flag, otherwise it uses an
"Importance" flag. Some folders, like :guilabel:`Trash` and :guilabel:`Outtakes` allow both. "Importance" flag. Some folders, like :guilabel:`Trash` and :guilabel:`Archive` allow both.
.. _a_ui_tree_dnd: .. _a_ui_tree_dnd:
@@ -96,7 +96,7 @@ the last move action can be undone by pressing :kbd:`Ctrl`:kbd:`Shift`:kbd:`Z`.
Documents and their folders can be rearranged freely within their root folders. Novel documents Documents and their folders can be rearranged freely within their root folders. Novel documents
cannot be moved out of the :guilabel:`Novel` folder, except to :guilabel:`Trash` and the cannot be moved out of the :guilabel:`Novel` folder, except to :guilabel:`Trash` and the
:guilabel:`Outtakes` folders. Notes can be moved freely between all root folders, but keep in mind :guilabel:`Archive` folders. Notes can be moved freely between all root folders, but keep in mind
that if you move a note into a :guilabel:`Novel`, its "Importance" setting will be reset to the that if you move a note into a :guilabel:`Novel`, its "Importance" setting will be reset to the
default "Status" setting. See :ref:`a_ui_tree_status`. default "Status" setting. See :ref:`a_ui_tree_status`.
+511 -1175
View File
File diff suppressed because it is too large Load Diff
+15 -2
View File
@@ -129,6 +129,19 @@ class nwKeyWords:
class nwLabels(): class nwLabels():
CLASS_NAME = { CLASS_NAME = {
nwItemClass.NO_CLASS: QT_TRANSLATE_NOOP("Constant", "None"),
nwItemClass.NOVEL: QT_TRANSLATE_NOOP("Constant", "Novel"),
nwItemClass.PLOT: QT_TRANSLATE_NOOP("Constant", "Plot"),
nwItemClass.CHARACTER: QT_TRANSLATE_NOOP("Constant", "Character"),
nwItemClass.WORLD: QT_TRANSLATE_NOOP("Constant", "Location"),
nwItemClass.TIMELINE: QT_TRANSLATE_NOOP("Constant", "Timeline"),
nwItemClass.OBJECT: QT_TRANSLATE_NOOP("Constant", "Object"),
nwItemClass.ENTITY: QT_TRANSLATE_NOOP("Constant", "Entity"),
nwItemClass.CUSTOM: QT_TRANSLATE_NOOP("Constant", "Custom"),
nwItemClass.ARCHIVE: QT_TRANSLATE_NOOP("Constant", "Archive"),
nwItemClass.TRASH: QT_TRANSLATE_NOOP("Constant", "Trash"),
}
CLASS_NAME_LBL = {
nwItemClass.NO_CLASS: QT_TRANSLATE_NOOP("Constant", "None"), nwItemClass.NO_CLASS: QT_TRANSLATE_NOOP("Constant", "None"),
nwItemClass.NOVEL: QT_TRANSLATE_NOOP("Constant", "Novel"), nwItemClass.NOVEL: QT_TRANSLATE_NOOP("Constant", "Novel"),
nwItemClass.PLOT: QT_TRANSLATE_NOOP("Constant", "Plot"), nwItemClass.PLOT: QT_TRANSLATE_NOOP("Constant", "Plot"),
@@ -136,9 +149,9 @@ class nwLabels():
nwItemClass.WORLD: QT_TRANSLATE_NOOP("Constant", "Locations"), nwItemClass.WORLD: QT_TRANSLATE_NOOP("Constant", "Locations"),
nwItemClass.TIMELINE: QT_TRANSLATE_NOOP("Constant", "Timeline"), nwItemClass.TIMELINE: QT_TRANSLATE_NOOP("Constant", "Timeline"),
nwItemClass.OBJECT: QT_TRANSLATE_NOOP("Constant", "Objects"), nwItemClass.OBJECT: QT_TRANSLATE_NOOP("Constant", "Objects"),
nwItemClass.ENTITY: QT_TRANSLATE_NOOP("Constant", "Entity"), nwItemClass.ENTITY: QT_TRANSLATE_NOOP("Constant", "Entities"),
nwItemClass.CUSTOM: QT_TRANSLATE_NOOP("Constant", "Custom"), nwItemClass.CUSTOM: QT_TRANSLATE_NOOP("Constant", "Custom"),
nwItemClass.ARCHIVE: QT_TRANSLATE_NOOP("Constant", "Outtakes"), nwItemClass.ARCHIVE: QT_TRANSLATE_NOOP("Constant", "Archive"),
nwItemClass.TRASH: QT_TRANSLATE_NOOP("Constant", "Trash"), nwItemClass.TRASH: QT_TRANSLATE_NOOP("Constant", "Trash"),
} }
CLASS_ICON = { CLASS_ICON = {
+5 -22
View File
@@ -168,7 +168,7 @@ class NWProject():
trashHandle = self.projTree.trashRoot() trashHandle = self.projTree.trashRoot()
if trashHandle is None: if trashHandle is None:
newItem = NWItem(self) newItem = NWItem(self)
newItem.setName(self.tr("Trash")) newItem.setName(trConst(nwLabels.CLASS_NAME[nwItemClass.TRASH]))
newItem.setType(nwItemType.TRASH) newItem.setType(nwItemType.TRASH)
newItem.setClass(nwItemClass.TRASH) newItem.setClass(nwItemClass.TRASH)
self.projTree.append(None, None, newItem) self.projTree.append(None, None, newItem)
@@ -307,7 +307,7 @@ class NWProject():
nHandle = self.newRoot(self.tr("Novel"), nwItemClass.NOVEL) nHandle = self.newRoot(self.tr("Novel"), nwItemClass.NOVEL)
for newRoot in projData.get("addRoots", []): for newRoot in projData.get("addRoots", []):
if newRoot in nwItemClass: if newRoot in nwItemClass:
self.newRoot(trConst(nwLabels.CLASS_NAME[newRoot]), newRoot) self.newRoot(trConst(nwLabels.CLASS_NAME_LBL[newRoot]), newRoot)
# Create a title page # Create a title page
tHandle = self.newFile(self.tr("Title Page"), nwItemClass.NOVEL, nHandle) tHandle = self.newFile(self.tr("Title Page"), nwItemClass.NOVEL, nHandle)
@@ -500,16 +500,6 @@ class NWProject():
self.clearProject() self.clearProject()
return False return False
if fileVersion in ("1.0", "1.1", "1.2"):
self.theParent.makeAlert(self.tr(
"The format of your project will now be updated. You may "
"also have to make a few minor changes to your title page "
"and unnumbered chapters. Please check the 'Project "
"Format Changes > File Format 1.3' section of the "
"documentation for more information. It is available from "
"the Help menu."
), nwAlert.INFO)
# Check novelWriter Version # Check novelWriter Version
# ========================= # =========================
@@ -794,27 +784,20 @@ class NWProject():
logger.info("Backing up project") logger.info("Backing up project")
self.theParent.setStatus(self.tr("Backing up project ...")) self.theParent.setStatus(self.tr("Backing up project ..."))
if self.mainConf.backupPath is None or self.mainConf.backupPath == "": if not (self.mainConf.backupPath and os.path.isdir(self.mainConf.backupPath)):
self.theParent.makeAlert(self.tr( self.theParent.makeAlert(self.tr(
"Cannot backup project because no backup path is set. " "Cannot backup project because no valid backup path is set. "
"Please set a valid backup location in Preferences." "Please set a valid backup location in Preferences."
), nwAlert.ERROR) ), nwAlert.ERROR)
return False return False
if self.projName is None or self.projName == "": if not self.projName:
self.theParent.makeAlert(self.tr( self.theParent.makeAlert(self.tr(
"Cannot backup project because no project name is set. " "Cannot backup project because no project name is set. "
"Please set a Working Title in Project Settings." "Please set a Working Title in Project Settings."
), nwAlert.ERROR) ), nwAlert.ERROR)
return False return False
if not os.path.isdir(self.mainConf.backupPath):
self.theParent.makeAlert(self.tr(
"Cannot backup project because the backup path does not exist. "
"Please set a valid backup location in Preferences."
), nwAlert.ERROR)
return False
cleanName = makeFileNameSafe(self.projName) cleanName = makeFileNameSafe(self.projName)
baseDir = os.path.abspath(os.path.join(self.mainConf.backupPath, cleanName)) baseDir = os.path.abspath(os.path.join(self.mainConf.backupPath, cleanName))
if not os.path.isdir(baseDir): if not os.path.isdir(baseDir):
+28 -32
View File
@@ -168,7 +168,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Main GUI language"), self.tr("Main GUI language"),
self.guiLang, self.guiLang,
self.tr("Changing this requires restarting novelWriter.") self.tr("Requires restart.")
) )
# Select Theme # Select Theme
@@ -184,7 +184,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Main GUI theme"), self.tr("Main GUI theme"),
self.guiTheme, self.guiTheme,
self.tr("Changing this requires restarting novelWriter.") self.tr("Requires restart.")
) )
# Select Icon Theme # Select Icon Theme
@@ -200,7 +200,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Main icon theme"), self.tr("Main icon theme"),
self.guiIcons, self.guiIcons,
self.tr("Changing this requires restarting novelWriter.") self.tr("Requires restart.")
) )
# Font Family # Font Family
@@ -214,7 +214,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Font family"), self.tr("Font family"),
self.guiFont, self.guiFont,
self.tr("Changing this requires restarting novelWriter."), self.tr("Requires restart."),
theButton=self.fontButton theButton=self.fontButton
) )
@@ -227,7 +227,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Font size"), self.tr("Font size"),
self.guiFontSize, self.guiFontSize,
self.tr("Changing this requires restarting novelWriter."), self.tr("Requires restart."),
theUnit=self.tr("pt") theUnit=self.tr("pt")
) )
@@ -240,7 +240,7 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Emphasise partition and chapter labels"), self.tr("Emphasise partition and chapter labels"),
self.emphLabels, self.emphLabels,
self.tr("The novel document labels will be bold and underlined."), self.tr("Makes them stand out in the project tree."),
) )
self.showFullPath = QSwitch() self.showFullPath = QSwitch()
@@ -351,7 +351,7 @@ class GuiPreferencesProjects(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Save document interval"), self.tr("Save document interval"),
self.autoSaveDoc, self.autoSaveDoc,
self.tr("How often the open document is automatically saved."), self.tr("How often the document is automatically saved."),
theUnit=self.tr("seconds") theUnit=self.tr("seconds")
) )
@@ -364,7 +364,7 @@ class GuiPreferencesProjects(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Save project interval"), self.tr("Save project interval"),
self.autoSaveProj, self.autoSaveProj,
self.tr("How often the open project is automatically saved."), self.tr("How often the project is automatically saved."),
theUnit=self.tr("seconds") theUnit=self.tr("seconds")
) )
@@ -514,7 +514,7 @@ class GuiPreferencesDocuments(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Font family"), self.tr("Font family"),
self.textFont, self.textFont,
self.tr("Font for the document editor and viewer."), self.tr("Applies to both document editor and viewer."),
theButton=self.fontButton theButton=self.fontButton
) )
@@ -527,7 +527,7 @@ class GuiPreferencesDocuments(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Font size"), self.tr("Font size"),
self.textSize, self.textSize,
self.tr("Font size for the document editor and viewer."), self.tr("Applies to both document editor and viewer."),
theUnit=self.tr("pt") theUnit=self.tr("pt")
) )
@@ -567,16 +567,16 @@ class GuiPreferencesDocuments(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Hide document footer in \"Focus Mode\""), self.tr("Hide document footer in \"Focus Mode\""),
self.hideFocusFooter, self.hideFocusFooter,
self.tr("Hide the information bar at the bottom of the document.") self.tr("Hide the information bar in the document editor.")
) )
# Justify Text # Justify Text
self.doJustify = QSwitch() self.doJustify = QSwitch()
self.doJustify.setChecked(self.mainConf.doJustify) self.doJustify.setChecked(self.mainConf.doJustify)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Justify the text margins in editor and viewer"), self.tr("Justify the text margins"),
self.doJustify, self.doJustify,
self.tr("Lay out text with straight edges in the editor and viewer.") self.tr("Applies to both document editor and viewer."),
) )
# Document Margins # Document Margins
@@ -586,9 +586,9 @@ class GuiPreferencesDocuments(QWidget):
self.textMargin.setSingleStep(1) self.textMargin.setSingleStep(1)
self.textMargin.setValue(self.mainConf.textMargin) self.textMargin.setValue(self.mainConf.textMargin)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Text margin"), self.tr("Minimum text margin"),
self.textMargin, self.textMargin,
self.tr("The minimum margin around the text in the editor and viewer."), self.tr("Applies to both document editor and viewer."),
theUnit=self.tr("px") theUnit=self.tr("px")
) )
@@ -689,7 +689,7 @@ class GuiPreferencesEditor(QWidget):
self.spellLanguage.setCurrentIndex(spellIdx) self.spellLanguage.setCurrentIndex(spellIdx)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Spell check language ({0})").format("PyEnchant"), self.tr("Spell check language"),
self.spellLanguage, self.spellLanguage,
self.tr("Available languages are determined by your system.") self.tr("Available languages are determined by your system.")
) )
@@ -721,7 +721,6 @@ class GuiPreferencesEditor(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Word count interval"), self.tr("Word count interval"),
self.wordCountTimer, self.wordCountTimer,
self.tr("How often the word count is updated."),
theUnit=self.tr("seconds") theUnit=self.tr("seconds")
) )
@@ -729,9 +728,8 @@ class GuiPreferencesEditor(QWidget):
self.incNotesWCount = QSwitch() self.incNotesWCount = QSwitch()
self.incNotesWCount.setChecked(self.mainConf.incNotesWCount) self.incNotesWCount.setChecked(self.mainConf.incNotesWCount)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Include project notes in total word count"), self.tr("Include project notes in status bar word count"),
self.incNotesWCount, self.incNotesWCount
self.tr("Affects the word count shown on the status bar.")
) )
# Writing Guides # Writing Guides
@@ -743,8 +741,7 @@ class GuiPreferencesEditor(QWidget):
self.showTabsNSpaces.setChecked(self.mainConf.showTabsNSpaces) self.showTabsNSpaces.setChecked(self.mainConf.showTabsNSpaces)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Show tabs and spaces"), self.tr("Show tabs and spaces"),
self.showTabsNSpaces, self.showTabsNSpaces
self.tr("Add symbols to indicate tabs and spaces in the editor.")
) )
# Show Line Endings # Show Line Endings
@@ -752,8 +749,7 @@ class GuiPreferencesEditor(QWidget):
self.showLineEndings.setChecked(self.mainConf.showLineEndings) self.showLineEndings.setChecked(self.mainConf.showLineEndings)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Show line endings"), self.tr("Show line endings"),
self.showLineEndings, self.showLineEndings
self.tr("Add a symbol to indicate line endings in the editor.")
) )
# Scroll Behaviour # Scroll Behaviour
@@ -779,7 +775,7 @@ class GuiPreferencesEditor(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Typewriter style scrolling when you type"), self.tr("Typewriter style scrolling when you type"),
self.autoScroll, self.autoScroll,
self.tr("Try to keep the cursor at a fixed vertical position.") self.tr("Keeps the cursor at a fixed vertical position.")
) )
# Typewriter Position # Typewriter Position
@@ -854,7 +850,7 @@ class GuiPreferencesSyntax(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Highlighting theme"), self.tr("Highlighting theme"),
self.guiSyntax, self.guiSyntax,
self.tr("Colour theme to apply to the editor and viewer.") self.tr("Colour theme for the editor and viewer.")
) )
# Quotes & Dialogue # Quotes & Dialogue
@@ -867,7 +863,7 @@ class GuiPreferencesSyntax(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Highlight text wrapped in quotes"), self.tr("Highlight text wrapped in quotes"),
self.highlightQuotes, self.highlightQuotes,
self.tr("Applies to single, double and straight quotes.") self.tr("Applies to the document editor only.")
) )
self.allowOpenSQuote = QSwitch() self.allowOpenSQuote = QSwitch()
@@ -895,7 +891,7 @@ class GuiPreferencesSyntax(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Add highlight colour to emphasised text"), self.tr("Add highlight colour to emphasised text"),
self.highlightEmph, self.highlightEmph,
self.tr("Applies to emphasis (italic) and strong (bold).") self.tr("Applies to the document editor only.")
) )
# Text Errors # Text Errors
@@ -906,9 +902,9 @@ class GuiPreferencesSyntax(QWidget):
self.showMultiSpaces = QSwitch() self.showMultiSpaces = QSwitch()
self.showMultiSpaces.setChecked(self.mainConf.showMultiSpaces) self.showMultiSpaces.setChecked(self.mainConf.showMultiSpaces)
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Mark redundant spaces"), self.tr("Highlight multiple spaces"),
self.showMultiSpaces, self.showMultiSpaces,
self.tr("Trailing spaces or multiple spaces between words.") self.tr("Applies to the document editor only.")
) )
return return
@@ -997,7 +993,7 @@ class GuiPreferencesAutomation(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Auto-replace single quotes"), self.tr("Auto-replace single quotes"),
self.doReplaceSQuote, self.doReplaceSQuote,
self.tr("Try to guess which is an opening or a closing single quote.") self.tr("Try to guess which is an opening or a closing quote.")
) )
# Auto-Replace Double Quotes # Auto-Replace Double Quotes
@@ -1007,7 +1003,7 @@ class GuiPreferencesAutomation(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
self.tr("Auto-replace double quotes"), self.tr("Auto-replace double quotes"),
self.doReplaceDQuote, self.doReplaceDQuote,
self.tr("Try to guess which is an opening or a closing double quote.") self.tr("Try to guess which is an opening or a closing quote.")
) )
# Auto-Replace Hyphens # Auto-Replace Hyphens
+1 -1
View File
@@ -73,7 +73,7 @@ class GuiProjectDetails(PagedDialog):
self.addTab(self.tabContents, self.tr("Contents")) self.addTab(self.tabContents, self.tr("Contents"))
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Close) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Close)
self.buttonBox.button(QDialogButtonBox.Close).setText(self.tr("Close")) self.buttonBox.button(QDialogButtonBox.Close)
self.buttonBox.rejected.connect(self._doClose) self.buttonBox.rejected.connect(self._doClose)
self.addControls(self.buttonBox) self.addControls(self.buttonBox)
-5
View File
@@ -292,11 +292,9 @@ class GuiProjectEditStatus(QWidget):
# ============= # =============
self.addButton = QPushButton(self.theTheme.getIcon("add"), "") self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
self.addButton.setToolTip(self.tr("Add new entry"))
self.addButton.clicked.connect(self._newItem) self.addButton.clicked.connect(self._newItem)
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "") self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
self.delButton.setToolTip(self.tr("Delete selected entry"))
self.delButton.clicked.connect(self._delItem) self.delButton.clicked.connect(self._delItem)
# Edit Form # Edit Form
@@ -531,11 +529,9 @@ class GuiProjectEditReplace(QWidget):
# ============= # =============
self.addButton = QPushButton(self.theTheme.getIcon("add"), "") self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
self.addButton.setToolTip(self.tr("Add new entry"))
self.addButton.clicked.connect(self._addEntry) self.addButton.clicked.connect(self._addEntry)
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "") self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
self.delButton.setToolTip(self.tr("Delete selected entry"))
self.delButton.clicked.connect(self._delEntry) self.delButton.clicked.connect(self._delEntry)
# Edit Form # Edit Form
@@ -551,7 +547,6 @@ class GuiProjectEditReplace(QWidget):
self.editValue.setMaxLength(80) self.editValue.setMaxLength(80)
self.saveButton = QPushButton(self.tr("Save")) self.saveButton = QPushButton(self.tr("Save"))
self.saveButton.setToolTip(self.tr("Save entry"))
self.saveButton.clicked.connect(self._saveEntry) self.saveButton.clicked.connect(self._saveEntry)
# Assemble # Assemble
-2
View File
@@ -79,11 +79,9 @@ class GuiWordList(QDialog):
self.newEntry = QLineEdit() self.newEntry = QLineEdit()
self.addButton = QPushButton(self.theTheme.getIcon("add"), "") self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
self.addButton.setToolTip(self.tr("Add new entry"))
self.addButton.clicked.connect(self._doAdd) self.addButton.clicked.connect(self._doAdd)
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "") self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
self.delButton.setToolTip(self.tr("Delete selected entry"))
self.delButton.clicked.connect(self._doDelete) self.delButton.clicked.connect(self._doDelete)
self.editBox = QHBoxLayout() self.editBox = QHBoxLayout()
-8
View File
@@ -2215,7 +2215,6 @@ class GuiDocEditSearch(QFrame):
self.resultLabel.setMinimumWidth(self.theTheme.getTextWidth("?/?", self.boxFont)) self.resultLabel.setMinimumWidth(self.theTheme.getTextWidth("?/?", self.boxFont))
self.toggleCase = QAction(self.tr("Case Sensitive"), self) self.toggleCase = QAction(self.tr("Case Sensitive"), self)
self.toggleCase.setToolTip(self.tr("Match case"))
self.toggleCase.setIcon(self.theTheme.getIcon("search_case")) self.toggleCase.setIcon(self.theTheme.getIcon("search_case"))
self.toggleCase.setCheckable(True) self.toggleCase.setCheckable(True)
self.toggleCase.setChecked(self.isCaseSense) self.toggleCase.setChecked(self.isCaseSense)
@@ -2223,7 +2222,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addAction(self.toggleCase) self.searchOpt.addAction(self.toggleCase)
self.toggleWord = QAction(self.tr("Whole Words Only"), self) self.toggleWord = QAction(self.tr("Whole Words Only"), self)
self.toggleWord.setToolTip(self.tr("Match whole words"))
self.toggleWord.setIcon(self.theTheme.getIcon("search_word")) self.toggleWord.setIcon(self.theTheme.getIcon("search_word"))
self.toggleWord.setCheckable(True) self.toggleWord.setCheckable(True)
self.toggleWord.setChecked(self.isWholeWord) self.toggleWord.setChecked(self.isWholeWord)
@@ -2231,7 +2229,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addAction(self.toggleWord) self.searchOpt.addAction(self.toggleWord)
self.toggleRegEx = QAction(self.tr("RegEx Mode"), self) self.toggleRegEx = QAction(self.tr("RegEx Mode"), self)
self.toggleRegEx.setToolTip(self.tr("Search using regular expressions"))
self.toggleRegEx.setIcon(self.theTheme.getIcon("search_regex")) self.toggleRegEx.setIcon(self.theTheme.getIcon("search_regex"))
self.toggleRegEx.setCheckable(True) self.toggleRegEx.setCheckable(True)
self.toggleRegEx.setChecked(self.isRegEx) self.toggleRegEx.setChecked(self.isRegEx)
@@ -2239,7 +2236,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addAction(self.toggleRegEx) self.searchOpt.addAction(self.toggleRegEx)
self.toggleLoop = QAction(self.tr("Loop Search"), self) self.toggleLoop = QAction(self.tr("Loop Search"), self)
self.toggleLoop.setToolTip(self.tr("Loop the search when reaching the end"))
self.toggleLoop.setIcon(self.theTheme.getIcon("search_loop")) self.toggleLoop.setIcon(self.theTheme.getIcon("search_loop"))
self.toggleLoop.setCheckable(True) self.toggleLoop.setCheckable(True)
self.toggleLoop.setChecked(self.doLoop) self.toggleLoop.setChecked(self.doLoop)
@@ -2247,7 +2243,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addAction(self.toggleLoop) self.searchOpt.addAction(self.toggleLoop)
self.toggleProject = QAction(self.tr("Search Next File"), self) self.toggleProject = QAction(self.tr("Search Next File"), self)
self.toggleProject.setToolTip(self.tr("Continue searching in the next file"))
self.toggleProject.setIcon(self.theTheme.getIcon("search_project")) self.toggleProject.setIcon(self.theTheme.getIcon("search_project"))
self.toggleProject.setCheckable(True) self.toggleProject.setCheckable(True)
self.toggleProject.setChecked(self.doNextFile) self.toggleProject.setChecked(self.doNextFile)
@@ -2257,7 +2252,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addSeparator() self.searchOpt.addSeparator()
self.toggleMatchCap = QAction(self.tr("Preserve Case"), self) self.toggleMatchCap = QAction(self.tr("Preserve Case"), self)
self.toggleMatchCap.setToolTip(self.tr("Preserve case on replace"))
self.toggleMatchCap.setIcon(self.theTheme.getIcon("search_preserve")) self.toggleMatchCap.setIcon(self.theTheme.getIcon("search_preserve"))
self.toggleMatchCap.setCheckable(True) self.toggleMatchCap.setCheckable(True)
self.toggleMatchCap.setChecked(self.doMatchCap) self.toggleMatchCap.setChecked(self.doMatchCap)
@@ -2267,7 +2261,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.addSeparator() self.searchOpt.addSeparator()
self.cancelSearch = QAction(self.tr("Close Search"), self) self.cancelSearch = QAction(self.tr("Close Search"), self)
self.cancelSearch.setToolTip(self.tr("Close the search box [{0}]").format("Esc"))
self.cancelSearch.setIcon(self.theTheme.getIcon("search_cancel")) self.cancelSearch.setIcon(self.theTheme.getIcon("search_cancel"))
self.cancelSearch.triggered.connect(self._doClose) self.cancelSearch.triggered.connect(self._doClose)
self.searchOpt.addAction(self.cancelSearch) self.searchOpt.addAction(self.cancelSearch)
@@ -2280,7 +2273,6 @@ class GuiDocEditSearch(QFrame):
self.showReplace = QToolButton(self) self.showReplace = QToolButton(self)
self.showReplace.setArrowType(Qt.RightArrow) self.showReplace.setArrowType(Qt.RightArrow)
self.showReplace.setCheckable(True) self.showReplace.setCheckable(True)
self.showReplace.setToolTip(self.tr("Show/hide the replace text box"))
self.showReplace.setStyleSheet("QToolButton {border: none; background: transparent;}") self.showReplace.setStyleSheet("QToolButton {border: none; background: transparent;}")
self.showReplace.toggled.connect(self._doToggleReplace) self.showReplace.toggled.connect(self._doToggleReplace)
+12 -145
View File
@@ -155,27 +155,23 @@ class GuiMainMenu(QMenuBar):
# Project > New Project # Project > New Project
self.aNewProject = QAction(self.tr("New Project"), self) self.aNewProject = QAction(self.tr("New Project"), self)
self.aNewProject.setStatusTip(self.tr("Create new project"))
self.aNewProject.triggered.connect(lambda: self.theParent.newProject(None)) self.aNewProject.triggered.connect(lambda: self.theParent.newProject(None))
self.projMenu.addAction(self.aNewProject) self.projMenu.addAction(self.aNewProject)
# Project > Open Project # Project > Open Project
self.aOpenProject = QAction(self.tr("Open Project"), self) self.aOpenProject = QAction(self.tr("Open Project"), self)
self.aOpenProject.setStatusTip(self.tr("Open project"))
self.aOpenProject.setShortcut("Ctrl+Shift+O") self.aOpenProject.setShortcut("Ctrl+Shift+O")
self.aOpenProject.triggered.connect(lambda: self.theParent.showProjectLoadDialog()) self.aOpenProject.triggered.connect(lambda: self.theParent.showProjectLoadDialog())
self.projMenu.addAction(self.aOpenProject) self.projMenu.addAction(self.aOpenProject)
# Project > Save Project # Project > Save Project
self.aSaveProject = QAction(self.tr("Save Project"), self) self.aSaveProject = QAction(self.tr("Save Project"), self)
self.aSaveProject.setStatusTip(self.tr("Save project"))
self.aSaveProject.setShortcut("Ctrl+Shift+S") self.aSaveProject.setShortcut("Ctrl+Shift+S")
self.aSaveProject.triggered.connect(lambda: self.theParent.saveProject()) self.aSaveProject.triggered.connect(lambda: self.theParent.saveProject())
self.projMenu.addAction(self.aSaveProject) self.projMenu.addAction(self.aSaveProject)
# Project > Close Project # Project > Close Project
self.aCloseProject = QAction(self.tr("Close Project"), self) self.aCloseProject = QAction(self.tr("Close Project"), self)
self.aCloseProject.setStatusTip(self.tr("Close project"))
self.aCloseProject.setShortcut("Ctrl+Shift+W") self.aCloseProject.setShortcut("Ctrl+Shift+W")
self.aCloseProject.triggered.connect(lambda: self.theParent.closeProject(False)) self.aCloseProject.triggered.connect(lambda: self.theParent.closeProject(False))
self.projMenu.addAction(self.aCloseProject) self.projMenu.addAction(self.aCloseProject)
@@ -185,14 +181,12 @@ class GuiMainMenu(QMenuBar):
# Project > Project Settings # Project > Project Settings
self.aProjectSettings = QAction(self.tr("Project Settings"), self) self.aProjectSettings = QAction(self.tr("Project Settings"), self)
self.aProjectSettings.setStatusTip(self.tr("Project settings"))
self.aProjectSettings.setShortcut("Ctrl+Shift+,") self.aProjectSettings.setShortcut("Ctrl+Shift+,")
self.aProjectSettings.triggered.connect(lambda: self.theParent.showProjectSettingsDialog()) self.aProjectSettings.triggered.connect(lambda: self.theParent.showProjectSettingsDialog())
self.projMenu.addAction(self.aProjectSettings) self.projMenu.addAction(self.aProjectSettings)
# Project > Project Details # Project > Project Details
self.aProjectDetails = QAction(self.tr("Project Details"), self) self.aProjectDetails = QAction(self.tr("Project Details"), self)
self.aProjectDetails.setStatusTip(self.tr("Project details"))
self.aProjectDetails.setShortcut("Shift+F6") self.aProjectDetails.setShortcut("Shift+F6")
self.aProjectDetails.triggered.connect(lambda: self.theParent.showProjectDetailsDialog()) self.aProjectDetails.triggered.connect(lambda: self.theParent.showProjectDetailsDialog())
self.projMenu.addAction(self.aProjectDetails) self.projMenu.addAction(self.aProjectDetails)
@@ -211,7 +205,7 @@ class GuiMainMenu(QMenuBar):
self.rootItems[nwItemClass.OBJECT] = QAction(self.tr("Object Root"), self.rootMenu) self.rootItems[nwItemClass.OBJECT] = QAction(self.tr("Object Root"), self.rootMenu)
self.rootItems[nwItemClass.ENTITY] = QAction(self.tr("Entity Root"), self.rootMenu) self.rootItems[nwItemClass.ENTITY] = QAction(self.tr("Entity Root"), self.rootMenu)
self.rootItems[nwItemClass.CUSTOM] = QAction(self.tr("Custom Root"), self.rootMenu) self.rootItems[nwItemClass.CUSTOM] = QAction(self.tr("Custom Root"), self.rootMenu)
self.rootItems[nwItemClass.ARCHIVE] = QAction(self.tr("Outtakes Root"), self.rootMenu) self.rootItems[nwItemClass.ARCHIVE] = QAction(self.tr("Archive Root"), self.rootMenu)
for n, itemClass in enumerate(self.rootItems.keys()): for n, itemClass in enumerate(self.rootItems.keys()):
self.rootItems[itemClass].triggered.connect( self.rootItems[itemClass].triggered.connect(
lambda n, itemClass=itemClass: self._newTreeItem(nwItemType.ROOT, itemClass) lambda n, itemClass=itemClass: self._newTreeItem(nwItemType.ROOT, itemClass)
@@ -220,7 +214,6 @@ class GuiMainMenu(QMenuBar):
# Project > New Folder # Project > New Folder
self.aCreateFolder = QAction(self.tr("Create Folder"), self) self.aCreateFolder = QAction(self.tr("Create Folder"), self)
self.aCreateFolder.setStatusTip(self.tr("Create folder"))
self.aCreateFolder.setShortcut("Ctrl+Shift+N") self.aCreateFolder.setShortcut("Ctrl+Shift+N")
self.aCreateFolder.triggered.connect(lambda: self._newTreeItem(nwItemType.FOLDER, None)) self.aCreateFolder.triggered.connect(lambda: self._newTreeItem(nwItemType.FOLDER, None))
self.projMenu.addAction(self.aCreateFolder) self.projMenu.addAction(self.aCreateFolder)
@@ -230,42 +223,36 @@ class GuiMainMenu(QMenuBar):
# Project > Edit # Project > Edit
self.aEditItem = QAction(self.tr("Edit Item"), self) self.aEditItem = QAction(self.tr("Edit Item"), self)
self.aEditItem.setStatusTip(self.tr("Change project item settings"))
self.aEditItem.setShortcuts(["Ctrl+E", "F2"]) self.aEditItem.setShortcuts(["Ctrl+E", "F2"])
self.aEditItem.triggered.connect(lambda: self.theParent.editItem(None)) self.aEditItem.triggered.connect(lambda: self.theParent.editItem(None))
self.projMenu.addAction(self.aEditItem) self.projMenu.addAction(self.aEditItem)
# Project > Delete # Project > Delete
self.aDeleteItem = QAction(self.tr("Delete Item"), self) self.aDeleteItem = QAction(self.tr("Delete Item"), self)
self.aDeleteItem.setStatusTip(self.tr("Delete selected project item"))
self.aDeleteItem.setShortcut("Ctrl+Shift+Del") self.aDeleteItem.setShortcut("Ctrl+Shift+Del")
self.aDeleteItem.triggered.connect(lambda: self.theParent.treeView.deleteItem(None)) self.aDeleteItem.triggered.connect(lambda: self.theParent.treeView.deleteItem(None))
self.projMenu.addAction(self.aDeleteItem) self.projMenu.addAction(self.aDeleteItem)
# Project > Move Up # Project > Move Up
self.aMoveUp = QAction(self.tr("Move Item Up"), self) self.aMoveUp = QAction(self.tr("Move Item Up"), self)
self.aMoveUp.setStatusTip(self.tr("Move project item up"))
self.aMoveUp.setShortcut("Ctrl+Up") self.aMoveUp.setShortcut("Ctrl+Up")
self.aMoveUp.triggered.connect(lambda: self._moveTreeItem(-1)) self.aMoveUp.triggered.connect(lambda: self._moveTreeItem(-1))
self.projMenu.addAction(self.aMoveUp) self.projMenu.addAction(self.aMoveUp)
# Project > Move Down # Project > Move Down
self.aMoveDown = QAction(self.tr("Move Item Down"), self) self.aMoveDown = QAction(self.tr("Move Item Down"), self)
self.aMoveDown.setStatusTip(self.tr("Move project item down"))
self.aMoveDown.setShortcut("Ctrl+Down") self.aMoveDown.setShortcut("Ctrl+Down")
self.aMoveDown.triggered.connect(lambda: self._moveTreeItem(1)) self.aMoveDown.triggered.connect(lambda: self._moveTreeItem(1))
self.projMenu.addAction(self.aMoveDown) self.projMenu.addAction(self.aMoveDown)
# Project > Undo Last Action # Project > Undo Last Action
self.aMoveUndo = QAction(self.tr("Undo Last Move"), self) self.aMoveUndo = QAction(self.tr("Undo Last Move"), self)
self.aMoveUndo.setStatusTip(self.tr("Undo last item move"))
self.aMoveUndo.setShortcut("Ctrl+Shift+Z") self.aMoveUndo.setShortcut("Ctrl+Shift+Z")
self.aMoveUndo.triggered.connect(lambda: self.theParent.treeView.undoLastMove()) self.aMoveUndo.triggered.connect(lambda: self.theParent.treeView.undoLastMove())
self.projMenu.addAction(self.aMoveUndo) self.projMenu.addAction(self.aMoveUndo)
# Project > Empty Trash # Project > Empty Trash
self.aEmptyTrash = QAction(self.tr("Empty Trash"), self) self.aEmptyTrash = QAction(self.tr("Empty Trash"), self)
self.aEmptyTrash.setStatusTip(self.tr("Permanently delete all files in the Trash folder"))
self.aEmptyTrash.triggered.connect(lambda: self.theParent.treeView.emptyTrash()) self.aEmptyTrash.triggered.connect(lambda: self.theParent.treeView.emptyTrash())
self.projMenu.addAction(self.aEmptyTrash) self.projMenu.addAction(self.aEmptyTrash)
@@ -274,7 +261,6 @@ class GuiMainMenu(QMenuBar):
# Project > Exit # Project > Exit
self.aExitNW = QAction(self.tr("Exit"), self) self.aExitNW = QAction(self.tr("Exit"), self)
self.aExitNW.setStatusTip(self.tr("Exit novelWriter"))
self.aExitNW.setShortcut("Ctrl+Q") self.aExitNW.setShortcut("Ctrl+Q")
self.aExitNW.setMenuRole(QAction.QuitRole) self.aExitNW.setMenuRole(QAction.QuitRole)
self.aExitNW.triggered.connect(lambda: self.theParent.closeMain()) self.aExitNW.triggered.connect(lambda: self.theParent.closeMain())
@@ -290,28 +276,24 @@ class GuiMainMenu(QMenuBar):
# Document > New # Document > New
self.aNewDoc = QAction(self.tr("New Document"), self) self.aNewDoc = QAction(self.tr("New Document"), self)
self.aNewDoc.setStatusTip(self.tr("Create new document"))
self.aNewDoc.setShortcut("Ctrl+N") self.aNewDoc.setShortcut("Ctrl+N")
self.aNewDoc.triggered.connect(lambda: self._newTreeItem(nwItemType.FILE, None)) self.aNewDoc.triggered.connect(lambda: self._newTreeItem(nwItemType.FILE, None))
self.docuMenu.addAction(self.aNewDoc) self.docuMenu.addAction(self.aNewDoc)
# Document > Open # Document > Open
self.aOpenDoc = QAction(self.tr("Open Document"), self) self.aOpenDoc = QAction(self.tr("Open Document"), self)
self.aOpenDoc.setStatusTip(self.tr("Open selected document"))
self.aOpenDoc.setShortcut("Ctrl+O") self.aOpenDoc.setShortcut("Ctrl+O")
self.aOpenDoc.triggered.connect(lambda: self.theParent.openSelectedItem()) self.aOpenDoc.triggered.connect(lambda: self.theParent.openSelectedItem())
self.docuMenu.addAction(self.aOpenDoc) self.docuMenu.addAction(self.aOpenDoc)
# Document > Save # Document > Save
self.aSaveDoc = QAction(self.tr("Save Document"), self) self.aSaveDoc = QAction(self.tr("Save Document"), self)
self.aSaveDoc.setStatusTip(self.tr("Save current document"))
self.aSaveDoc.setShortcut("Ctrl+S") self.aSaveDoc.setShortcut("Ctrl+S")
self.aSaveDoc.triggered.connect(lambda: self.theParent.saveDocument()) self.aSaveDoc.triggered.connect(lambda: self.theParent.saveDocument())
self.docuMenu.addAction(self.aSaveDoc) self.docuMenu.addAction(self.aSaveDoc)
# Document > Close # Document > Close
self.aCloseDoc = QAction(self.tr("Close Document"), self) self.aCloseDoc = QAction(self.tr("Close Document"), self)
self.aCloseDoc.setStatusTip(self.tr("Close current document"))
self.aCloseDoc.setShortcut("Ctrl+W") self.aCloseDoc.setShortcut("Ctrl+W")
self.aCloseDoc.triggered.connect(lambda: self.theParent.closeDocEditor()) self.aCloseDoc.triggered.connect(lambda: self.theParent.closeDocEditor())
self.docuMenu.addAction(self.aCloseDoc) self.docuMenu.addAction(self.aCloseDoc)
@@ -321,14 +303,12 @@ class GuiMainMenu(QMenuBar):
# Document > Preview # Document > Preview
self.aViewDoc = QAction(self.tr("View Document"), self) self.aViewDoc = QAction(self.tr("View Document"), self)
self.aViewDoc.setStatusTip(self.tr("View document as HTML"))
self.aViewDoc.setShortcut("Ctrl+R") self.aViewDoc.setShortcut("Ctrl+R")
self.aViewDoc.triggered.connect(lambda: self.theParent.viewDocument(None)) self.aViewDoc.triggered.connect(lambda: self.theParent.viewDocument(None))
self.docuMenu.addAction(self.aViewDoc) self.docuMenu.addAction(self.aViewDoc)
# Document > Close Preview # Document > Close Preview
self.aCloseView = QAction(self.tr("Close Document View"), self) self.aCloseView = QAction(self.tr("Close Document View"), self)
self.aCloseView.setStatusTip(self.tr("Close document view pane"))
self.aCloseView.setShortcut("Ctrl+Shift+R") self.aCloseView.setShortcut("Ctrl+Shift+R")
self.aCloseView.triggered.connect(lambda: self.theParent.closeDocViewer()) self.aCloseView.triggered.connect(lambda: self.theParent.closeDocViewer())
self.docuMenu.addAction(self.aCloseView) self.docuMenu.addAction(self.aCloseView)
@@ -338,30 +318,22 @@ class GuiMainMenu(QMenuBar):
# Document > Show File Details # Document > Show File Details
self.aFileDetails = QAction(self.tr("Show File Details"), self) self.aFileDetails = QAction(self.tr("Show File Details"), self)
self.aFileDetails.setStatusTip(
self.tr("Shows a message box with the document location in the project folder")
)
self.aFileDetails.triggered.connect(lambda: self.theParent.docEditor.revealLocation()) self.aFileDetails.triggered.connect(lambda: self.theParent.docEditor.revealLocation())
self.docuMenu.addAction(self.aFileDetails) self.docuMenu.addAction(self.aFileDetails)
# Document > Import From File # Document > Import From File
self.aImportFile = QAction(self.tr("Import from File"), self) self.aImportFile = QAction(self.tr("Import Text from File"), self)
self.aImportFile.setStatusTip(self.tr("Import document from a text or markdown file"))
self.aImportFile.setShortcut("Ctrl+Shift+I") self.aImportFile.setShortcut("Ctrl+Shift+I")
self.aImportFile.triggered.connect(lambda: self.theParent.importDocument()) self.aImportFile.triggered.connect(lambda: self.theParent.importDocument())
self.docuMenu.addAction(self.aImportFile) self.docuMenu.addAction(self.aImportFile)
# Document > Merge Documents # Document > Merge Documents
self.aMergeDocs = QAction(self.tr("Merge Folder to Document"), self) self.aMergeDocs = QAction(self.tr("Merge Folder to Document"), self)
self.aMergeDocs.setStatusTip(self.tr("Merge a folder of documents to a single document"))
self.aMergeDocs.triggered.connect(lambda: self.theParent.mergeDocuments()) self.aMergeDocs.triggered.connect(lambda: self.theParent.mergeDocuments())
self.docuMenu.addAction(self.aMergeDocs) self.docuMenu.addAction(self.aMergeDocs)
# Document > Split Document # Document > Split Document
self.aSplitDoc = QAction(self.tr("Split Document to Folder"), self) self.aSplitDoc = QAction(self.tr("Split Document to Folder"), self)
self.aSplitDoc.setStatusTip(
self.tr("Split a document into a folder of multiple documents")
)
self.aSplitDoc.triggered.connect(lambda: self.theParent.splitDocument()) self.aSplitDoc.triggered.connect(lambda: self.theParent.splitDocument())
self.docuMenu.addAction(self.aSplitDoc) self.docuMenu.addAction(self.aSplitDoc)
@@ -375,14 +347,12 @@ class GuiMainMenu(QMenuBar):
# Edit > Undo # Edit > Undo
self.aEditUndo = QAction(self.tr("Undo"), self) self.aEditUndo = QAction(self.tr("Undo"), self)
self.aEditUndo.setStatusTip(self.tr("Undo last change"))
self.aEditUndo.setShortcut("Ctrl+Z") self.aEditUndo.setShortcut("Ctrl+Z")
self.aEditUndo.triggered.connect(lambda: self._docAction(nwDocAction.UNDO)) self.aEditUndo.triggered.connect(lambda: self._docAction(nwDocAction.UNDO))
self.editMenu.addAction(self.aEditUndo) self.editMenu.addAction(self.aEditUndo)
# Edit > Redo # Edit > Redo
self.aEditRedo = QAction(self.tr("Redo"), self) self.aEditRedo = QAction(self.tr("Redo"), self)
self.aEditRedo.setStatusTip(self.tr("Redo last change"))
self.aEditRedo.setShortcut("Ctrl+Y") self.aEditRedo.setShortcut("Ctrl+Y")
self.aEditRedo.triggered.connect(lambda: self._docAction(nwDocAction.REDO)) self.aEditRedo.triggered.connect(lambda: self._docAction(nwDocAction.REDO))
self.editMenu.addAction(self.aEditRedo) self.editMenu.addAction(self.aEditRedo)
@@ -392,21 +362,18 @@ class GuiMainMenu(QMenuBar):
# Edit > Cut # Edit > Cut
self.aEditCut = QAction(self.tr("Cut"), self) self.aEditCut = QAction(self.tr("Cut"), self)
self.aEditCut.setStatusTip(self.tr("Cut selected text"))
self.aEditCut.setShortcut("Ctrl+X") self.aEditCut.setShortcut("Ctrl+X")
self.aEditCut.triggered.connect(lambda: self._docAction(nwDocAction.CUT)) self.aEditCut.triggered.connect(lambda: self._docAction(nwDocAction.CUT))
self.editMenu.addAction(self.aEditCut) self.editMenu.addAction(self.aEditCut)
# Edit > Copy # Edit > Copy
self.aEditCopy = QAction(self.tr("Copy"), self) self.aEditCopy = QAction(self.tr("Copy"), self)
self.aEditCopy.setStatusTip(self.tr("Copy selected text"))
self.aEditCopy.setShortcut("Ctrl+C") self.aEditCopy.setShortcut("Ctrl+C")
self.aEditCopy.triggered.connect(lambda: self._docAction(nwDocAction.COPY)) self.aEditCopy.triggered.connect(lambda: self._docAction(nwDocAction.COPY))
self.editMenu.addAction(self.aEditCopy) self.editMenu.addAction(self.aEditCopy)
# Edit > Paste # Edit > Paste
self.aEditPaste = QAction(self.tr("Paste"), self) self.aEditPaste = QAction(self.tr("Paste"), self)
self.aEditPaste.setStatusTip(self.tr("Paste text from clipboard"))
self.aEditPaste.setShortcut("Ctrl+V") self.aEditPaste.setShortcut("Ctrl+V")
self.aEditPaste.triggered.connect(lambda: self._docAction(nwDocAction.PASTE)) self.aEditPaste.triggered.connect(lambda: self._docAction(nwDocAction.PASTE))
self.editMenu.addAction(self.aEditPaste) self.editMenu.addAction(self.aEditPaste)
@@ -416,14 +383,12 @@ class GuiMainMenu(QMenuBar):
# Edit > Select All # Edit > Select All
self.aSelectAll = QAction(self.tr("Select All"), self) self.aSelectAll = QAction(self.tr("Select All"), self)
self.aSelectAll.setStatusTip(self.tr("Select all text in document"))
self.aSelectAll.setShortcut("Ctrl+A") self.aSelectAll.setShortcut("Ctrl+A")
self.aSelectAll.triggered.connect(lambda: self._docAction(nwDocAction.SEL_ALL)) self.aSelectAll.triggered.connect(lambda: self._docAction(nwDocAction.SEL_ALL))
self.editMenu.addAction(self.aSelectAll) self.editMenu.addAction(self.aSelectAll)
# Edit > Select Paragraph # Edit > Select Paragraph
self.aSelectPar = QAction(self.tr("Select Paragraph"), self) self.aSelectPar = QAction(self.tr("Select Paragraph"), self)
self.aSelectPar.setStatusTip(self.tr("Select all text in paragraph"))
self.aSelectPar.setShortcut("Ctrl+Shift+A") self.aSelectPar.setShortcut("Ctrl+Shift+A")
self.aSelectPar.triggered.connect(lambda: self._docAction(nwDocAction.SEL_PARA)) self.aSelectPar.triggered.connect(lambda: self._docAction(nwDocAction.SEL_PARA))
self.editMenu.addAction(self.aSelectPar) self.editMenu.addAction(self.aSelectPar)
@@ -437,8 +402,7 @@ class GuiMainMenu(QMenuBar):
self.viewMenu = self.addMenu(self.tr("&View")) self.viewMenu = self.addMenu(self.tr("&View"))
# View > TreeView # View > TreeView
self.aFocusTree = QAction(self.tr("Focus Project Tree"), self) self.aFocusTree = QAction(self.tr("Go to Project Tree"), self)
self.aFocusTree.setStatusTip(self.tr("Move focus to project tree"))
if self.mainConf.osWindows: if self.mainConf.osWindows:
self.aFocusTree.setShortcut("Ctrl+Alt+1") self.aFocusTree.setShortcut("Ctrl+Alt+1")
else: else:
@@ -447,8 +411,7 @@ class GuiMainMenu(QMenuBar):
self.viewMenu.addAction(self.aFocusTree) self.viewMenu.addAction(self.aFocusTree)
# View > Document Pane 1 # View > Document Pane 1
self.aFocusEditor = QAction(self.tr("Focus Document Editor"), self) self.aFocusEditor = QAction(self.tr("Go to Document Editor"), self)
self.aFocusEditor.setStatusTip(self.tr("Move focus to left document pane"))
if self.mainConf.osWindows: if self.mainConf.osWindows:
self.aFocusEditor.setShortcut("Ctrl+Alt+2") self.aFocusEditor.setShortcut("Ctrl+Alt+2")
else: else:
@@ -457,8 +420,7 @@ class GuiMainMenu(QMenuBar):
self.viewMenu.addAction(self.aFocusEditor) self.viewMenu.addAction(self.aFocusEditor)
# View > Document Pane 2 # View > Document Pane 2
self.aFocusView = QAction(self.tr("Focus Document Viewer"), self) self.aFocusView = QAction(self.tr("Go to Document Viewer"), self)
self.aFocusView.setStatusTip(self.tr("Move focus to right document pane"))
if self.mainConf.osWindows: if self.mainConf.osWindows:
self.aFocusView.setShortcut("Ctrl+Alt+3") self.aFocusView.setShortcut("Ctrl+Alt+3")
else: else:
@@ -467,8 +429,7 @@ class GuiMainMenu(QMenuBar):
self.viewMenu.addAction(self.aFocusView) self.viewMenu.addAction(self.aFocusView)
# View > Outline # View > Outline
self.aFocusOutline = QAction(self.tr("Focus Outline"), self) self.aFocusOutline = QAction(self.tr("Go to Outline"), self)
self.aFocusOutline.setStatusTip(self.tr("Move focus to outline"))
if self.mainConf.osWindows: if self.mainConf.osWindows:
self.aFocusOutline.setShortcut("Ctrl+Alt+4") self.aFocusOutline.setShortcut("Ctrl+Alt+4")
else: else:
@@ -480,15 +441,13 @@ class GuiMainMenu(QMenuBar):
self.viewMenu.addSeparator() self.viewMenu.addSeparator()
# View > Go Backward # View > Go Backward
self.aViewPrev = QAction(self.tr("Go Backward"), self) self.aViewPrev = QAction(self.tr("Navigate Backward"), self)
self.aViewPrev.setStatusTip(self.tr("Move backward in the view history of the right pane"))
self.aViewPrev.setShortcut("Alt+Left") self.aViewPrev.setShortcut("Alt+Left")
self.aViewPrev.triggered.connect(lambda: self.theParent.docViewer.navBackward()) self.aViewPrev.triggered.connect(lambda: self.theParent.docViewer.navBackward())
self.viewMenu.addAction(self.aViewPrev) self.viewMenu.addAction(self.aViewPrev)
# View > Go Forward # View > Go Forward
self.aViewNext = QAction(self.tr("Go Forward"), self) self.aViewNext = QAction(self.tr("Navigate Forward"), self)
self.aViewNext.setStatusTip(self.tr("Move forward in the view history of the right pane"))
self.aViewNext.setShortcut("Alt+Right") self.aViewNext.setShortcut("Alt+Right")
self.aViewNext.triggered.connect(lambda: self.theParent.docViewer.navForward()) self.aViewNext.triggered.connect(lambda: self.theParent.docViewer.navForward())
self.viewMenu.addAction(self.aViewNext) self.viewMenu.addAction(self.aViewNext)
@@ -498,9 +457,6 @@ class GuiMainMenu(QMenuBar):
# View > Focus Mode # View > Focus Mode
self.aFocusMode = QAction(self.tr("Focus Mode"), self) self.aFocusMode = QAction(self.tr("Focus Mode"), self)
self.aFocusMode.setStatusTip(
self.tr("Toggles a distraction free mode, only showing text editor")
)
self.aFocusMode.setShortcut("F8") self.aFocusMode.setShortcut("F8")
self.aFocusMode.setCheckable(True) self.aFocusMode.setCheckable(True)
self.aFocusMode.setChecked(self.theParent.isFocusMode) self.aFocusMode.setChecked(self.theParent.isFocusMode)
@@ -509,7 +465,6 @@ class GuiMainMenu(QMenuBar):
# View > Toggle Full Screen # View > Toggle Full Screen
self.aFullScreen = QAction(self.tr("Full Screen Mode"), self) self.aFullScreen = QAction(self.tr("Full Screen Mode"), self)
self.aFullScreen.setStatusTip(self.tr("Maximises the main window"))
self.aFullScreen.setShortcut("F11") self.aFullScreen.setShortcut("F11")
self.aFullScreen.triggered.connect(lambda: self.theParent.toggleFullScreenMode()) self.aFullScreen.triggered.connect(lambda: self.theParent.toggleFullScreenMode())
self.viewMenu.addAction(self.aFullScreen) self.viewMenu.addAction(self.aFullScreen)
@@ -527,30 +482,24 @@ class GuiMainMenu(QMenuBar):
# Insert > Short Dash # Insert > Short Dash
self.aInsENDash = QAction(self.tr("Short Dash"), self) self.aInsENDash = QAction(self.tr("Short Dash"), self)
self.aInsENDash.setStatusTip(self.tr("Insert short dash (en dash)"))
self.aInsENDash.setShortcut("Ctrl+K, -") self.aInsENDash.setShortcut("Ctrl+K, -")
self.aInsENDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_ENDASH)) 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(self.tr("Long Dash"), self) self.aInsEMDash = QAction(self.tr("Long Dash"), self)
self.aInsEMDash.setStatusTip(self.tr("Insert long dash (em dash)"))
self.aInsEMDash.setShortcut("Ctrl+K, _") self.aInsEMDash.setShortcut("Ctrl+K, _")
self.aInsEMDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_EMDASH)) self.aInsEMDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_EMDASH))
self.mInsDashes.addAction(self.aInsEMDash) self.mInsDashes.addAction(self.aInsEMDash)
# Insert > Long Dash # Insert > Long Dash
self.aInsHorBar = QAction(self.tr("Horizontal Bar"), self) self.aInsHorBar = QAction(self.tr("Horizontal Bar"), self)
self.aInsHorBar.setStatusTip(self.tr("Insert a horizontal bar (quotation dash)"))
self.aInsHorBar.setShortcut("Ctrl+K, Ctrl+_") self.aInsHorBar.setShortcut("Ctrl+K, Ctrl+_")
self.aInsHorBar.triggered.connect(lambda: self._docInsert(nwUnicode.U_HBAR)) self.aInsHorBar.triggered.connect(lambda: self._docInsert(nwUnicode.U_HBAR))
self.mInsDashes.addAction(self.aInsHorBar) self.mInsDashes.addAction(self.aInsHorBar)
# Insert > Figure Dash # Insert > Figure Dash
self.aInsFigDash = QAction(self.tr("Figure Dash"), self) self.aInsFigDash = QAction(self.tr("Figure Dash"), self)
self.aInsFigDash.setStatusTip(
self.tr("Insert figure dash (same width as a number character)")
)
self.aInsFigDash.setShortcut("Ctrl+K, ~") self.aInsFigDash.setShortcut("Ctrl+K, ~")
self.aInsFigDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_FGDASH)) self.aInsFigDash.triggered.connect(lambda: self._docInsert(nwUnicode.U_FGDASH))
self.mInsDashes.addAction(self.aInsFigDash) self.mInsDashes.addAction(self.aInsFigDash)
@@ -560,35 +509,30 @@ class GuiMainMenu(QMenuBar):
# Insert > Left Single Quote # Insert > Left Single Quote
self.aInsQuoteLS = QAction(self.tr("Left Single Quote"), self) self.aInsQuoteLS = QAction(self.tr("Left Single Quote"), self)
self.aInsQuoteLS.setStatusTip(self.tr("Insert left single quote"))
self.aInsQuoteLS.setShortcut("Ctrl+K, 1") self.aInsQuoteLS.setShortcut("Ctrl+K, 1")
self.aInsQuoteLS.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_LS)) self.aInsQuoteLS.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_LS))
self.mInsQuotes.addAction(self.aInsQuoteLS) self.mInsQuotes.addAction(self.aInsQuoteLS)
# Insert > Right Single Quote # Insert > Right Single Quote
self.aInsQuoteRS = QAction(self.tr("Right Single Quote"), self) self.aInsQuoteRS = QAction(self.tr("Right Single Quote"), self)
self.aInsQuoteRS.setStatusTip(self.tr("Insert right single quote"))
self.aInsQuoteRS.setShortcut("Ctrl+K, 2") self.aInsQuoteRS.setShortcut("Ctrl+K, 2")
self.aInsQuoteRS.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_RS)) self.aInsQuoteRS.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_RS))
self.mInsQuotes.addAction(self.aInsQuoteRS) self.mInsQuotes.addAction(self.aInsQuoteRS)
# Insert > Left Double Quote # Insert > Left Double Quote
self.aInsQuoteLD = QAction(self.tr("Left Double Quote"), self) self.aInsQuoteLD = QAction(self.tr("Left Double Quote"), self)
self.aInsQuoteLD.setStatusTip(self.tr("Insert left double quote"))
self.aInsQuoteLD.setShortcut("Ctrl+K, 3") self.aInsQuoteLD.setShortcut("Ctrl+K, 3")
self.aInsQuoteLD.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_LD)) self.aInsQuoteLD.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_LD))
self.mInsQuotes.addAction(self.aInsQuoteLD) self.mInsQuotes.addAction(self.aInsQuoteLD)
# Insert > Right Double Quote # Insert > Right Double Quote
self.aInsQuoteRD = QAction(self.tr("Right Double Quote"), self) self.aInsQuoteRD = QAction(self.tr("Right Double Quote"), self)
self.aInsQuoteRD.setStatusTip(self.tr("Insert right double quote"))
self.aInsQuoteRD.setShortcut("Ctrl+K, 4") self.aInsQuoteRD.setShortcut("Ctrl+K, 4")
self.aInsQuoteRD.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_RD)) self.aInsQuoteRD.triggered.connect(lambda: self._docInsert(nwDocInsert.QUOTE_RD))
self.mInsQuotes.addAction(self.aInsQuoteRD) self.mInsQuotes.addAction(self.aInsQuoteRD)
# Insert > Alternative Apostrophe # Insert > Alternative Apostrophe
self.aInsMSApos = QAction(self.tr("Alternative Apostrophe"), self) self.aInsMSApos = QAction(self.tr("Alternative Apostrophe"), self)
self.aInsMSApos.setStatusTip(self.tr("Insert modifier letter single apostrophe"))
self.aInsMSApos.setShortcut("Ctrl+K, '") self.aInsMSApos.setShortcut("Ctrl+K, '")
self.aInsMSApos.triggered.connect(lambda: self._docInsert(nwUnicode.U_MAPOSS)) self.aInsMSApos.triggered.connect(lambda: self._docInsert(nwUnicode.U_MAPOSS))
self.mInsQuotes.addAction(self.aInsMSApos) self.mInsQuotes.addAction(self.aInsMSApos)
@@ -598,21 +542,18 @@ class GuiMainMenu(QMenuBar):
# Insert > Ellipsis # Insert > Ellipsis
self.aInsEllipsis = QAction(self.tr("Ellipsis"), self) self.aInsEllipsis = QAction(self.tr("Ellipsis"), self)
self.aInsEllipsis.setStatusTip(self.tr("Insert ellipsis"))
self.aInsEllipsis.setShortcut("Ctrl+K, .") self.aInsEllipsis.setShortcut("Ctrl+K, .")
self.aInsEllipsis.triggered.connect(lambda: self._docInsert(nwUnicode.U_HELLIP)) self.aInsEllipsis.triggered.connect(lambda: self._docInsert(nwUnicode.U_HELLIP))
self.mInsPunct.addAction(self.aInsEllipsis) self.mInsPunct.addAction(self.aInsEllipsis)
# Insert > Prime # Insert > Prime
self.aInsPrime = QAction(self.tr("Prime"), self) self.aInsPrime = QAction(self.tr("Prime"), self)
self.aInsPrime.setStatusTip(self.tr("Insert a prime symbol"))
self.aInsPrime.setShortcut("Ctrl+K, Ctrl+'") self.aInsPrime.setShortcut("Ctrl+K, Ctrl+'")
self.aInsPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_PRIME)) self.aInsPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_PRIME))
self.mInsPunct.addAction(self.aInsPrime) self.mInsPunct.addAction(self.aInsPrime)
# Insert > Double Prime # Insert > Double Prime
self.aInsDPrime = QAction(self.tr("Double Prime"), self) self.aInsDPrime = QAction(self.tr("Double Prime"), self)
self.aInsDPrime.setStatusTip(self.tr("Insert a double prime symbol"))
self.aInsDPrime.setShortcut("Ctrl+K, Ctrl+\"") self.aInsDPrime.setShortcut("Ctrl+K, Ctrl+\"")
self.aInsDPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_DPRIME)) self.aInsDPrime.triggered.connect(lambda: self._docInsert(nwUnicode.U_DPRIME))
self.mInsPunct.addAction(self.aInsDPrime) self.mInsPunct.addAction(self.aInsDPrime)
@@ -622,21 +563,18 @@ class GuiMainMenu(QMenuBar):
# Insert > Non-Breaking Space # Insert > Non-Breaking Space
self.aInsNBSpace = QAction(self.tr("Non-Breaking Space"), self) self.aInsNBSpace = QAction(self.tr("Non-Breaking Space"), self)
self.aInsNBSpace.setStatusTip(self.tr("Insert a non-breaking space"))
self.aInsNBSpace.setShortcut("Ctrl+K, Space") self.aInsNBSpace.setShortcut("Ctrl+K, Space")
self.aInsNBSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_NBSP)) self.aInsNBSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_NBSP))
self.mInsSpace.addAction(self.aInsNBSpace) self.mInsSpace.addAction(self.aInsNBSpace)
# Insert > Thin Space # Insert > Thin Space
self.aInsThinSpace = QAction(self.tr("Thin Space"), self) self.aInsThinSpace = QAction(self.tr("Thin Space"), self)
self.aInsThinSpace.setStatusTip(self.tr("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(nwUnicode.U_THSP)) self.aInsThinSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_THSP))
self.mInsSpace.addAction(self.aInsThinSpace) self.mInsSpace.addAction(self.aInsThinSpace)
# Insert > Thin Non-Breaking Space # Insert > Thin Non-Breaking Space
self.aInsThinNBSpace = QAction(self.tr("Thin Non-Breaking Space"), self) self.aInsThinNBSpace = QAction(self.tr("Thin Non-Breaking Space"), self)
self.aInsThinNBSpace.setStatusTip(self.tr("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(nwUnicode.U_THNBSP)) self.aInsThinNBSpace.triggered.connect(lambda: self._docInsert(nwUnicode.U_THNBSP))
self.mInsSpace.addAction(self.aInsThinNBSpace) self.mInsSpace.addAction(self.aInsThinNBSpace)
@@ -646,56 +584,48 @@ class GuiMainMenu(QMenuBar):
# Insert > List Bullet # Insert > List Bullet
self.aInsBullet = QAction(self.tr("List Bullet"), self) self.aInsBullet = QAction(self.tr("List Bullet"), self)
self.aInsBullet.setStatusTip(self.tr("Insert a list bullet"))
self.aInsBullet.setShortcut("Ctrl+K, *") self.aInsBullet.setShortcut("Ctrl+K, *")
self.aInsBullet.triggered.connect(lambda: self._docInsert(nwUnicode.U_BULL)) self.aInsBullet.triggered.connect(lambda: self._docInsert(nwUnicode.U_BULL))
self.mInsSymbol.addAction(self.aInsBullet) self.mInsSymbol.addAction(self.aInsBullet)
# Insert > Hyphen Bullet # Insert > Hyphen Bullet
self.aInsHyBull = QAction(self.tr("Hyphen Bullet"), self) self.aInsHyBull = QAction(self.tr("Hyphen Bullet"), self)
self.aInsHyBull.setStatusTip(self.tr("Insert a hyphen bullet (alternative bullet)"))
self.aInsHyBull.setShortcut("Ctrl+K, Ctrl+-") self.aInsHyBull.setShortcut("Ctrl+K, Ctrl+-")
self.aInsHyBull.triggered.connect(lambda: self._docInsert(nwUnicode.U_HYBULL)) self.aInsHyBull.triggered.connect(lambda: self._docInsert(nwUnicode.U_HYBULL))
self.mInsSymbol.addAction(self.aInsHyBull) self.mInsSymbol.addAction(self.aInsHyBull)
# Insert > Flower Mark # Insert > Flower Mark
self.aInsFlower = QAction(self.tr("Flower Mark"), self) self.aInsFlower = QAction(self.tr("Flower Mark"), self)
self.aInsFlower.setStatusTip(self.tr("Insert a flower mark (alternative bullet)"))
self.aInsFlower.setShortcut("Ctrl+K, Ctrl+*") self.aInsFlower.setShortcut("Ctrl+K, Ctrl+*")
self.aInsFlower.triggered.connect(lambda: self._docInsert(nwUnicode.U_FLOWER)) self.aInsFlower.triggered.connect(lambda: self._docInsert(nwUnicode.U_FLOWER))
self.mInsSymbol.addAction(self.aInsFlower) self.mInsSymbol.addAction(self.aInsFlower)
# Insert > Per Mille # Insert > Per Mille
self.aInsPerMille = QAction(self.tr("Per Mille"), self) self.aInsPerMille = QAction(self.tr("Per Mille"), self)
self.aInsPerMille.setStatusTip(self.tr("Insert a per mille symbol"))
self.aInsPerMille.setShortcut("Ctrl+K, %") self.aInsPerMille.setShortcut("Ctrl+K, %")
self.aInsPerMille.triggered.connect(lambda: self._docInsert(nwUnicode.U_PERMIL)) self.aInsPerMille.triggered.connect(lambda: self._docInsert(nwUnicode.U_PERMIL))
self.mInsSymbol.addAction(self.aInsPerMille) self.mInsSymbol.addAction(self.aInsPerMille)
# Insert > Degree Symbol # Insert > Degree Symbol
self.aInsDegree = QAction(self.tr("Degree Symbol"), self) self.aInsDegree = QAction(self.tr("Degree Symbol"), self)
self.aInsDegree.setStatusTip(self.tr("Insert a degree symbol"))
self.aInsDegree.setShortcut("Ctrl+K, Ctrl+O") self.aInsDegree.setShortcut("Ctrl+K, Ctrl+O")
self.aInsDegree.triggered.connect(lambda: self._docInsert(nwUnicode.U_DEGREE)) self.aInsDegree.triggered.connect(lambda: self._docInsert(nwUnicode.U_DEGREE))
self.mInsSymbol.addAction(self.aInsDegree) self.mInsSymbol.addAction(self.aInsDegree)
# Insert > Minus Sign # Insert > Minus Sign
self.aInsMinus = QAction(self.tr("Minus Sign"), self) self.aInsMinus = QAction(self.tr("Minus Sign"), self)
self.aInsMinus.setStatusTip(self.tr("Insert a minus sign (not a hypen or dash)"))
self.aInsMinus.setShortcut("Ctrl+K, Ctrl+M") self.aInsMinus.setShortcut("Ctrl+K, Ctrl+M")
self.aInsMinus.triggered.connect(lambda: self._docInsert(nwUnicode.U_MINUS)) self.aInsMinus.triggered.connect(lambda: self._docInsert(nwUnicode.U_MINUS))
self.mInsSymbol.addAction(self.aInsMinus) self.mInsSymbol.addAction(self.aInsMinus)
# Insert > Times Sign # Insert > Times Sign
self.aInsTimes = QAction(self.tr("Times Sign"), self) self.aInsTimes = QAction(self.tr("Times Sign"), self)
self.aInsTimes.setStatusTip(self.tr("Insert a times sign (multiplication cross)"))
self.aInsTimes.setShortcut("Ctrl+K, Ctrl+X") self.aInsTimes.setShortcut("Ctrl+K, Ctrl+X")
self.aInsTimes.triggered.connect(lambda: self._docInsert(nwUnicode.U_TIMES)) self.aInsTimes.triggered.connect(lambda: self._docInsert(nwUnicode.U_TIMES))
self.mInsSymbol.addAction(self.aInsTimes) self.mInsSymbol.addAction(self.aInsTimes)
# Insert > Division # Insert > Division
self.aInsDivide = QAction(self.tr("Division Sign"), self) self.aInsDivide = QAction(self.tr("Division Sign"), self)
self.aInsDivide.setStatusTip(self.tr("Insert a division sign"))
self.aInsDivide.setShortcut("Ctrl+K, Ctrl+D") self.aInsDivide.setShortcut("Ctrl+K, Ctrl+D")
self.aInsDivide.triggered.connect(lambda: self._docInsert(nwUnicode.U_DIVIDE)) self.aInsDivide.triggered.connect(lambda: self._docInsert(nwUnicode.U_DIVIDE))
self.mInsSymbol.addAction(self.aInsDivide) self.mInsSymbol.addAction(self.aInsDivide)
@@ -726,19 +656,16 @@ class GuiMainMenu(QMenuBar):
# Insert > New Page # Insert > New Page
self.aInsNewPage = QAction(self.tr("Page Break"), self) self.aInsNewPage = QAction(self.tr("Page Break"), self)
self.aInsNewPage.setStatusTip(self.tr("Insert a page break command"))
self.aInsNewPage.triggered.connect(lambda: self._docInsert(nwDocInsert.NEW_PAGE)) self.aInsNewPage.triggered.connect(lambda: self._docInsert(nwDocInsert.NEW_PAGE))
self.mInsBreaks.addAction(self.aInsNewPage) self.mInsBreaks.addAction(self.aInsNewPage)
# Insert > Vertical Space (Single) # Insert > Vertical Space (Single)
self.aInsVSpaceS = QAction(self.tr("Vertical Space (Single)"), self) self.aInsVSpaceS = QAction(self.tr("Vertical Space (Single)"), self)
self.aInsVSpaceS.setStatusTip(self.tr("Insert a vertical space equal to one paragraph"))
self.aInsVSpaceS.triggered.connect(lambda: self._docInsert(nwDocInsert.VSPACE_S)) self.aInsVSpaceS.triggered.connect(lambda: self._docInsert(nwDocInsert.VSPACE_S))
self.mInsBreaks.addAction(self.aInsVSpaceS) self.mInsBreaks.addAction(self.aInsVSpaceS)
# Insert > Vertical Space (Multi) # Insert > Vertical Space (Multi)
self.aInsVSpaceM = QAction(self.tr("Vertical Space (Multi)"), self) self.aInsVSpaceM = QAction(self.tr("Vertical Space (Multi)"), self)
self.aInsVSpaceM.setStatusTip(self.tr("Insert a vertical space equal to n paragraphs"))
self.aInsVSpaceM.triggered.connect(lambda: self._docInsert(nwDocInsert.VSPACE_M)) self.aInsVSpaceM.triggered.connect(lambda: self._docInsert(nwDocInsert.VSPACE_M))
self.mInsBreaks.addAction(self.aInsVSpaceM) self.mInsBreaks.addAction(self.aInsVSpaceM)
@@ -752,21 +679,18 @@ class GuiMainMenu(QMenuBar):
# Format > Emphasis # Format > Emphasis
self.aFmtEmph = QAction(self.tr("Emphasis"), self) self.aFmtEmph = QAction(self.tr("Emphasis"), self)
self.aFmtEmph.setStatusTip(self.tr("Add emphasis to selected text (italic)"))
self.aFmtEmph.setShortcut("Ctrl+I") self.aFmtEmph.setShortcut("Ctrl+I")
self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.EMPH)) self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.EMPH))
self.fmtMenu.addAction(self.aFmtEmph) self.fmtMenu.addAction(self.aFmtEmph)
# Format > Strong Emphasis # Format > Strong Emphasis
self.aFmtStrong = QAction(self.tr("Strong Emphasis"), self) self.aFmtStrong = QAction(self.tr("Strong Emphasis"), self)
self.aFmtStrong.setStatusTip(self.tr("Add strong emphasis to selected text (bold)"))
self.aFmtStrong.setShortcut("Ctrl+B") self.aFmtStrong.setShortcut("Ctrl+B")
self.aFmtStrong.triggered.connect(lambda: self._docAction(nwDocAction.STRONG)) self.aFmtStrong.triggered.connect(lambda: self._docAction(nwDocAction.STRONG))
self.fmtMenu.addAction(self.aFmtStrong) self.fmtMenu.addAction(self.aFmtStrong)
# Format > Strikethrough # Format > Strikethrough
self.aFmtStrike = QAction(self.tr("Strikethrough"), self) self.aFmtStrike = QAction(self.tr("Strikethrough"), self)
self.aFmtStrike.setStatusTip(self.tr("Add strikethrough to selected text"))
self.aFmtStrike.setShortcut("Ctrl+D") 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)
@@ -776,14 +700,12 @@ class GuiMainMenu(QMenuBar):
# Format > Double Quotes # Format > Double Quotes
self.aFmtDQuote = QAction(self.tr("Wrap Double Quotes"), self) self.aFmtDQuote = QAction(self.tr("Wrap Double Quotes"), self)
self.aFmtDQuote.setStatusTip(self.tr("Wrap selected text in double quotes"))
self.aFmtDQuote.setShortcut("Ctrl+\"") 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(self.tr("Wrap Single Quotes"), self) self.aFmtSQuote = QAction(self.tr("Wrap Single Quotes"), self)
self.aFmtSQuote.setStatusTip(self.tr("Wrap selected text in single quotes"))
self.aFmtSQuote.setShortcut("Ctrl+'") 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)
@@ -793,28 +715,24 @@ class GuiMainMenu(QMenuBar):
# Format > Header 1 (Partition) # Format > Header 1 (Partition)
self.aFmtHead1 = QAction(self.tr("Header 1 (Partition)"), self) self.aFmtHead1 = QAction(self.tr("Header 1 (Partition)"), self)
self.aFmtHead1.setStatusTip(self.tr("Set the text block format to Header 1 (Partition)"))
self.aFmtHead1.setShortcut("Ctrl+1") self.aFmtHead1.setShortcut("Ctrl+1")
self.aFmtHead1.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H1)) self.aFmtHead1.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H1))
self.fmtMenu.addAction(self.aFmtHead1) self.fmtMenu.addAction(self.aFmtHead1)
# Format > Header 2 (Chapter) # Format > Header 2 (Chapter)
self.aFmtHead2 = QAction(self.tr("Header 2 (Chapter)"), self) self.aFmtHead2 = QAction(self.tr("Header 2 (Chapter)"), self)
self.aFmtHead2.setStatusTip(self.tr("Set the text block format to Header 2 (Chapter)"))
self.aFmtHead2.setShortcut("Ctrl+2") self.aFmtHead2.setShortcut("Ctrl+2")
self.aFmtHead2.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H2)) self.aFmtHead2.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H2))
self.fmtMenu.addAction(self.aFmtHead2) self.fmtMenu.addAction(self.aFmtHead2)
# Format > Header 3 (Scene) # Format > Header 3 (Scene)
self.aFmtHead3 = QAction(self.tr("Header 3 (Scene)"), self) self.aFmtHead3 = QAction(self.tr("Header 3 (Scene)"), self)
self.aFmtHead3.setStatusTip(self.tr("Set the text block format to Header 3 (Scene)"))
self.aFmtHead3.setShortcut("Ctrl+3") self.aFmtHead3.setShortcut("Ctrl+3")
self.aFmtHead3.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H3)) self.aFmtHead3.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H3))
self.fmtMenu.addAction(self.aFmtHead3) self.fmtMenu.addAction(self.aFmtHead3)
# Format > Header 4 (Section) # Format > Header 4 (Section)
self.aFmtHead4 = QAction(self.tr("Header 4 (Section)"), self) self.aFmtHead4 = QAction(self.tr("Header 4 (Section)"), self)
self.aFmtHead4.setStatusTip(self.tr("Set the text block format to Header 4 (Section)"))
self.aFmtHead4.setShortcut("Ctrl+4") self.aFmtHead4.setShortcut("Ctrl+4")
self.aFmtHead4.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H4)) self.aFmtHead4.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_H4))
self.fmtMenu.addAction(self.aFmtHead4) self.fmtMenu.addAction(self.aFmtHead4)
@@ -824,13 +742,11 @@ class GuiMainMenu(QMenuBar):
# Format > Novel Title # Format > Novel Title
self.aFmtTitle = QAction(self.tr("Novel Title"), self) self.aFmtTitle = QAction(self.tr("Novel Title"), self)
self.aFmtTitle.setStatusTip(self.tr("Set the text block format to Novel Title"))
self.aFmtTitle.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_TTL)) self.aFmtTitle.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_TTL))
self.fmtMenu.addAction(self.aFmtTitle) self.fmtMenu.addAction(self.aFmtTitle)
# Format > Unnumbered Chapter # Format > Unnumbered Chapter
self.aFmtUnNum = QAction(self.tr("Unnumbered Chapter"), self) self.aFmtUnNum = QAction(self.tr("Unnumbered Chapter"), self)
self.aFmtUnNum.setStatusTip(self.tr("Set the text block format to Unnumbered Chapter"))
self.aFmtUnNum.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_UNN)) self.aFmtUnNum.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_UNN))
self.fmtMenu.addAction(self.aFmtUnNum) self.fmtMenu.addAction(self.aFmtUnNum)
@@ -839,21 +755,18 @@ class GuiMainMenu(QMenuBar):
# Format > Align Left # Format > Align Left
self.aFmtAlignLeft = QAction(self.tr("Align Left"), self) self.aFmtAlignLeft = QAction(self.tr("Align Left"), self)
self.aFmtAlignLeft.setStatusTip(self.tr("Left-align the text block"))
self.aFmtAlignLeft.setShortcut("Ctrl+5") self.aFmtAlignLeft.setShortcut("Ctrl+5")
self.aFmtAlignLeft.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_L)) self.aFmtAlignLeft.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_L))
self.fmtMenu.addAction(self.aFmtAlignLeft) self.fmtMenu.addAction(self.aFmtAlignLeft)
# Format > Align Centre # Format > Align Centre
self.aFmtAlignCentre = QAction(self.tr("Align Centre"), self) self.aFmtAlignCentre = QAction(self.tr("Align Centre"), self)
self.aFmtAlignCentre.setStatusTip(self.tr("Centre the text block"))
self.aFmtAlignCentre.setShortcut("Ctrl+6") self.aFmtAlignCentre.setShortcut("Ctrl+6")
self.aFmtAlignCentre.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_C)) self.aFmtAlignCentre.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_C))
self.fmtMenu.addAction(self.aFmtAlignCentre) self.fmtMenu.addAction(self.aFmtAlignCentre)
# Format > Align Right # Format > Align Right
self.aFmtAlignRight = QAction(self.tr("Align Right"), self) self.aFmtAlignRight = QAction(self.tr("Align Right"), self)
self.aFmtAlignRight.setStatusTip(self.tr("Right-align the text block"))
self.aFmtAlignRight.setShortcut("Ctrl+7") self.aFmtAlignRight.setShortcut("Ctrl+7")
self.aFmtAlignRight.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_R)) self.aFmtAlignRight.triggered.connect(lambda: self._docAction(nwDocAction.ALIGN_R))
self.fmtMenu.addAction(self.aFmtAlignRight) self.fmtMenu.addAction(self.aFmtAlignRight)
@@ -863,14 +776,12 @@ class GuiMainMenu(QMenuBar):
# Format > Indent Left # Format > Indent Left
self.aFmtIndentLeft = QAction(self.tr("Indent Left"), self) self.aFmtIndentLeft = QAction(self.tr("Indent Left"), self)
self.aFmtIndentLeft.setStatusTip(self.tr("Increase the text block's left margin"))
self.aFmtIndentLeft.setShortcut("Ctrl+8") self.aFmtIndentLeft.setShortcut("Ctrl+8")
self.aFmtIndentLeft.triggered.connect(lambda: self._docAction(nwDocAction.INDENT_L)) self.aFmtIndentLeft.triggered.connect(lambda: self._docAction(nwDocAction.INDENT_L))
self.fmtMenu.addAction(self.aFmtIndentLeft) self.fmtMenu.addAction(self.aFmtIndentLeft)
# Format > Indent Right # Format > Indent Right
self.aFmtIndentRight = QAction(self.tr("Indent Right"), self) self.aFmtIndentRight = QAction(self.tr("Indent Right"), self)
self.aFmtIndentRight.setStatusTip(self.tr("Increase the text block's right margin"))
self.aFmtIndentRight.setShortcut("Ctrl+9") self.aFmtIndentRight.setShortcut("Ctrl+9")
self.aFmtIndentRight.triggered.connect(lambda: self._docAction(nwDocAction.INDENT_R)) self.aFmtIndentRight.triggered.connect(lambda: self._docAction(nwDocAction.INDENT_R))
self.fmtMenu.addAction(self.aFmtIndentRight) self.fmtMenu.addAction(self.aFmtIndentRight)
@@ -879,15 +790,13 @@ class GuiMainMenu(QMenuBar):
self.fmtMenu.addSeparator() self.fmtMenu.addSeparator()
# Format > Comment # Format > Comment
self.aFmtComment = QAction(self.tr("Comment"), self) self.aFmtComment = QAction(self.tr("Toggle Comment"), self)
self.aFmtComment.setStatusTip(self.tr("Change the text block format to comment"))
self.aFmtComment.setShortcut("Ctrl+/") self.aFmtComment.setShortcut("Ctrl+/")
self.aFmtComment.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_COM)) self.aFmtComment.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_COM))
self.fmtMenu.addAction(self.aFmtComment) self.fmtMenu.addAction(self.aFmtComment)
# Format > Remove Block Format # Format > Remove Block Format
self.aFmtNoFormat = QAction(self.tr("Remove Block Format"), self) self.aFmtNoFormat = QAction(self.tr("Remove Block Format"), self)
self.aFmtNoFormat.setStatusTip(self.tr("Strip text block format"))
self.aFmtNoFormat.setShortcuts(["Ctrl+0", "Ctrl+Shift+/"]) self.aFmtNoFormat.setShortcuts(["Ctrl+0", "Ctrl+Shift+/"])
self.aFmtNoFormat.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_TXT)) self.aFmtNoFormat.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_TXT))
self.fmtMenu.addAction(self.aFmtNoFormat) self.fmtMenu.addAction(self.aFmtNoFormat)
@@ -896,26 +805,17 @@ class GuiMainMenu(QMenuBar):
self.fmtMenu.addSeparator() self.fmtMenu.addSeparator()
# Format > Replace Single Quotes # Format > Replace Single Quotes
self.aFmtReplSng = QAction(self.tr("Replace Single Quotes"), self) self.aFmtReplSng = QAction(self.tr("Convert Single Quotes"), self)
self.aFmtReplSng.setStatusTip(
self.tr("Replace all straight single quotes in the selected text")
)
self.aFmtReplSng.triggered.connect(lambda: self._docAction(nwDocAction.REPL_SNG)) self.aFmtReplSng.triggered.connect(lambda: self._docAction(nwDocAction.REPL_SNG))
self.fmtMenu.addAction(self.aFmtReplSng) self.fmtMenu.addAction(self.aFmtReplSng)
# Format > Replace Double Quotes # Format > Replace Double Quotes
self.aFmtReplDbl = QAction(self.tr("Replace Double Quotes"), self) self.aFmtReplDbl = QAction(self.tr("Convert Double Quotes"), self)
self.aFmtReplDbl.setStatusTip(
self.tr("Replace all straight double quotes in the selected text")
)
self.aFmtReplDbl.triggered.connect(lambda: self._docAction(nwDocAction.REPL_DBL)) self.aFmtReplDbl.triggered.connect(lambda: self._docAction(nwDocAction.REPL_DBL))
self.fmtMenu.addAction(self.aFmtReplDbl) self.fmtMenu.addAction(self.aFmtReplDbl)
# Format > Remove In-Paragraph Breaks # Format > Remove In-Paragraph Breaks
self.aFmtRmBreaks = QAction(self.tr("Remove In-Paragraph Breaks"), self) self.aFmtRmBreaks = QAction(self.tr("Remove In-Paragraph Breaks"), self)
self.aFmtRmBreaks.setStatusTip(
self.tr("Remove all line breaks within paragraphs in the selected text")
)
self.aFmtRmBreaks.triggered.connect(lambda: self._docAction(nwDocAction.RM_BREAKS)) self.aFmtRmBreaks.triggered.connect(lambda: self._docAction(nwDocAction.RM_BREAKS))
self.fmtMenu.addAction(self.aFmtRmBreaks) self.fmtMenu.addAction(self.aFmtRmBreaks)
@@ -929,14 +829,12 @@ class GuiMainMenu(QMenuBar):
# Search > Find # Search > Find
self.aFind = QAction(self.tr("Find"), self) self.aFind = QAction(self.tr("Find"), self)
self.aFind.setStatusTip(self.tr("Find text in document"))
self.aFind.setShortcut("Ctrl+F") self.aFind.setShortcut("Ctrl+F")
self.aFind.triggered.connect(lambda: self.theParent.docEditor.beginSearch()) self.aFind.triggered.connect(lambda: self.theParent.docEditor.beginSearch())
self.srcMenu.addAction(self.aFind) self.srcMenu.addAction(self.aFind)
# Search > Replace # Search > Replace
self.aReplace = QAction(self.tr("Replace"), self) self.aReplace = QAction(self.tr("Replace"), self)
self.aReplace.setStatusTip(self.tr("Replace text in document"))
if self.mainConf.osDarwin: if self.mainConf.osDarwin:
self.aReplace.setShortcut("Ctrl+=") self.aReplace.setShortcut("Ctrl+=")
else: else:
@@ -946,7 +844,6 @@ class GuiMainMenu(QMenuBar):
# Search > Find Next # Search > Find Next
self.aFindNext = QAction(self.tr("Find Next"), self) self.aFindNext = QAction(self.tr("Find Next"), self)
self.aFindNext.setStatusTip(self.tr("Find next occurrence of text in document"))
if self.mainConf.osDarwin: if self.mainConf.osDarwin:
self.aFindNext.setShortcuts(["Ctrl+G", "F3"]) self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
else: else:
@@ -956,7 +853,6 @@ class GuiMainMenu(QMenuBar):
# Search > Find Prev # Search > Find Prev
self.aFindPrev = QAction(self.tr("Find Previous"), self) self.aFindPrev = QAction(self.tr("Find Previous"), self)
self.aFindPrev.setStatusTip(self.tr("Find previous occurrence of text in document"))
if self.mainConf.osDarwin: if self.mainConf.osDarwin:
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"]) self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
else: else:
@@ -966,9 +862,6 @@ class GuiMainMenu(QMenuBar):
# Search > Replace Next # Search > Replace Next
self.aReplaceNext = QAction(self.tr("Replace Next"), self) self.aReplaceNext = QAction(self.tr("Replace Next"), self)
self.aReplaceNext.setStatusTip(
self.tr("Find and replace next occurrence of text in document")
)
self.aReplaceNext.setShortcut("Ctrl+Shift+1") self.aReplaceNext.setShortcut("Ctrl+Shift+1")
self.aReplaceNext.triggered.connect(lambda: self.theParent.docEditor.replaceNext()) self.aReplaceNext.triggered.connect(lambda: self.theParent.docEditor.replaceNext())
self.srcMenu.addAction(self.aReplaceNext) self.srcMenu.addAction(self.aReplaceNext)
@@ -983,7 +876,6 @@ class GuiMainMenu(QMenuBar):
# Tools > Check Spelling # Tools > Check Spelling
self.aSpellCheck = QAction(self.tr("Check Spelling"), self) self.aSpellCheck = QAction(self.tr("Check Spelling"), self)
self.aSpellCheck.setStatusTip(self.tr("Toggle check spelling"))
self.aSpellCheck.setCheckable(True) self.aSpellCheck.setCheckable(True)
self.aSpellCheck.setChecked(self.theProject.spellCheck) self.aSpellCheck.setChecked(self.theProject.spellCheck)
self.aSpellCheck.triggered.connect(self._toggleSpellCheck) # triggered, not toggled! self.aSpellCheck.triggered.connect(self._toggleSpellCheck) # triggered, not toggled!
@@ -992,14 +884,12 @@ class GuiMainMenu(QMenuBar):
# Tools > Re-Run Spell Check # Tools > Re-Run Spell Check
self.aReRunSpell = QAction(self.tr("Re-Run Spell Check"), self) self.aReRunSpell = QAction(self.tr("Re-Run Spell Check"), self)
self.aReRunSpell.setStatusTip(self.tr("Run the spell checker on current document"))
self.aReRunSpell.setShortcut("F7") self.aReRunSpell.setShortcut("F7")
self.aReRunSpell.triggered.connect(lambda: self.theParent.docEditor.spellCheckDocument()) self.aReRunSpell.triggered.connect(lambda: self.theParent.docEditor.spellCheckDocument())
self.toolsMenu.addAction(self.aReRunSpell) self.toolsMenu.addAction(self.aReRunSpell)
# Tools > Project Word List # Tools > Project Word List
self.aEditWordList = QAction(self.tr("Project Word List"), self) self.aEditWordList = QAction(self.tr("Project Word List"), self)
self.aEditWordList.setStatusTip(self.tr("Edit the project's word list"))
self.aEditWordList.triggered.connect(lambda: self.theParent.showProjectWordListDialog()) self.aEditWordList.triggered.connect(lambda: self.theParent.showProjectWordListDialog())
self.toolsMenu.addAction(self.aEditWordList) self.toolsMenu.addAction(self.aEditWordList)
@@ -1008,23 +898,18 @@ class GuiMainMenu(QMenuBar):
# Tools > Rebuild Indices # Tools > Rebuild Indices
self.aRebuildIndex = QAction(self.tr("Rebuild Index"), self) self.aRebuildIndex = QAction(self.tr("Rebuild Index"), self)
self.aRebuildIndex.setStatusTip(self.tr("Rebuild the tag indices and word counts"))
self.aRebuildIndex.setShortcut("F9") self.aRebuildIndex.setShortcut("F9")
self.aRebuildIndex.triggered.connect(lambda: self.theParent.rebuildIndex()) self.aRebuildIndex.triggered.connect(lambda: self.theParent.rebuildIndex())
self.toolsMenu.addAction(self.aRebuildIndex) self.toolsMenu.addAction(self.aRebuildIndex)
# Tools > Rebuild Outline # Tools > Rebuild Outline
self.aRebuildOutline = QAction(self.tr("Rebuild Outline"), self) self.aRebuildOutline = QAction(self.tr("Rebuild Outline"), self)
self.aRebuildOutline.setStatusTip(self.tr("Rebuild the novel outline tree"))
self.aRebuildOutline.setShortcut("F10") self.aRebuildOutline.setShortcut("F10")
self.aRebuildOutline.triggered.connect(lambda: self.theParent.rebuildOutline()) self.aRebuildOutline.triggered.connect(lambda: self.theParent.rebuildOutline())
self.toolsMenu.addAction(self.aRebuildOutline) self.toolsMenu.addAction(self.aRebuildOutline)
# Tools > Toggle Auto Build Outline # Tools > Toggle Auto Build Outline
self.aAutoOutline = QAction(self.tr("Auto-Update Outline"), self) self.aAutoOutline = QAction(self.tr("Auto-Update Outline"), self)
self.aAutoOutline.setStatusTip(
self.tr("Update project outline when a novel file is changed")
)
self.aAutoOutline.setCheckable(True) self.aAutoOutline.setCheckable(True)
self.aAutoOutline.toggled.connect(self._toggleAutoOutline) self.aAutoOutline.toggled.connect(self._toggleAutoOutline)
self.aAutoOutline.setShortcut("Ctrl+F10") self.aAutoOutline.setShortcut("Ctrl+F10")
@@ -1034,28 +919,24 @@ class GuiMainMenu(QMenuBar):
self.toolsMenu.addSeparator() self.toolsMenu.addSeparator()
# Tools > Backup # Tools > Backup
self.aBackupProject = QAction(self.tr("Backup Project Folder"), self) self.aBackupProject = QAction(self.tr("Backup Project"), self)
self.aBackupProject.setStatusTip(self.tr("Backup Project"))
self.aBackupProject.triggered.connect(lambda: self.theProject.zipIt(True)) self.aBackupProject.triggered.connect(lambda: self.theProject.zipIt(True))
self.toolsMenu.addAction(self.aBackupProject) self.toolsMenu.addAction(self.aBackupProject)
# Tools > Export Project # Tools > Export Project
self.aBuildProject = QAction(self.tr("Build Novel Project"), self) self.aBuildProject = QAction(self.tr("Build Novel Project"), self)
self.aBuildProject.setStatusTip(self.tr("Launch the Build novel project tool"))
self.aBuildProject.setShortcut("F5") self.aBuildProject.setShortcut("F5")
self.aBuildProject.triggered.connect(lambda: self.theParent.showBuildProjectDialog()) self.aBuildProject.triggered.connect(lambda: self.theParent.showBuildProjectDialog())
self.toolsMenu.addAction(self.aBuildProject) self.toolsMenu.addAction(self.aBuildProject)
# Tools > Writing Stats # Tools > Writing Stats
self.aWritingStats = QAction(self.tr("Writing Statistics"), self) self.aWritingStats = QAction(self.tr("Writing Statistics"), self)
self.aWritingStats.setStatusTip(self.tr("Show the writing statistics dialogue"))
self.aWritingStats.setShortcut("F6") self.aWritingStats.setShortcut("F6")
self.aWritingStats.triggered.connect(lambda: self.theParent.showWritingStatsDialog()) self.aWritingStats.triggered.connect(lambda: self.theParent.showWritingStatsDialog())
self.toolsMenu.addAction(self.aWritingStats) self.toolsMenu.addAction(self.aWritingStats)
# Tools > Settings # Tools > Settings
self.aPreferences = QAction(self.tr("Preferences"), self) self.aPreferences = QAction(self.tr("Preferences"), self)
self.aPreferences.setStatusTip(self.tr("Preferences"))
self.aPreferences.setShortcut("Ctrl+,") self.aPreferences.setShortcut("Ctrl+,")
self.aPreferences.setMenuRole(QAction.PreferencesRole) self.aPreferences.setMenuRole(QAction.PreferencesRole)
self.aPreferences.triggered.connect(lambda: self.theParent.showPreferencesDialog()) self.aPreferences.triggered.connect(lambda: self.theParent.showPreferencesDialog())
@@ -1071,14 +952,12 @@ class GuiMainMenu(QMenuBar):
# Help > About # Help > About
self.aAboutNW = QAction(self.tr("About novelWriter"), self) self.aAboutNW = QAction(self.tr("About novelWriter"), self)
self.aAboutNW.setStatusTip(self.tr("About novelWriter"))
self.aAboutNW.setMenuRole(QAction.AboutRole) self.aAboutNW.setMenuRole(QAction.AboutRole)
self.aAboutNW.triggered.connect(lambda: self.theParent.showAboutNWDialog()) self.aAboutNW.triggered.connect(lambda: self.theParent.showAboutNWDialog())
self.helpMenu.addAction(self.aAboutNW) self.helpMenu.addAction(self.aAboutNW)
# Help > About Qt5 # Help > About Qt5
self.aAboutQt = QAction(self.tr("About Qt5"), self) self.aAboutQt = QAction(self.tr("About Qt5"), self)
self.aAboutQt.setStatusTip(self.tr("About Qt5"))
self.aAboutQt.setMenuRole(QAction.AboutQtRole) self.aAboutQt.setMenuRole(QAction.AboutQtRole)
self.aAboutQt.triggered.connect(lambda: self.theParent.showAboutQtDialog()) self.aAboutQt.triggered.connect(lambda: self.theParent.showAboutQtDialog())
self.helpMenu.addAction(self.aAboutQt) self.helpMenu.addAction(self.aAboutQt)
@@ -1093,7 +972,6 @@ class GuiMainMenu(QMenuBar):
docUrl = f"{novelwriter.__docurl__}/en/latest/" docUrl = f"{novelwriter.__docurl__}/en/latest/"
self.aHelpDocs = QAction(self.tr("User Manual (Online)"), self) self.aHelpDocs = QAction(self.tr("User Manual (Online)"), self)
self.aHelpDocs.setStatusTip(self.tr("Open documentation in browser"))
self.aHelpDocs.setShortcut("F1") self.aHelpDocs.setShortcut("F1")
self.aHelpDocs.triggered.connect(lambda: self._openWebsite(docUrl)) self.aHelpDocs.triggered.connect(lambda: self._openWebsite(docUrl))
self.helpMenu.addAction(self.aHelpDocs) self.helpMenu.addAction(self.aHelpDocs)
@@ -1101,7 +979,6 @@ class GuiMainMenu(QMenuBar):
# Help > User Manual (PDF) # Help > User Manual (PDF)
if self.mainConf.pdfDocs is not None: if self.mainConf.pdfDocs is not None:
self.aPdfDocs = QAction(self.tr("User Manual (PDF)"), self) self.aPdfDocs = QAction(self.tr("User Manual (PDF)"), self)
self.aPdfDocs.setStatusTip(self.tr("Open PDF documentation"))
self.aPdfDocs.setShortcut("Shift+F1") self.aPdfDocs.setShortcut("Shift+F1")
self.aPdfDocs.triggered.connect(self._openUserManualFile) self.aPdfDocs.triggered.connect(self._openUserManualFile)
self.helpMenu.addAction(self.aPdfDocs) self.helpMenu.addAction(self.aPdfDocs)
@@ -1111,25 +988,16 @@ class GuiMainMenu(QMenuBar):
# Document > Report an Issue # Document > Report an Issue
self.aIssue = QAction(self.tr("Report an Issue (GitHub)"), self) self.aIssue = QAction(self.tr("Report an Issue (GitHub)"), self)
self.aIssue.setStatusTip(
self.tr("Report a bug or issue on GitHub at {0}").format(novelwriter.__issuesurl__)
)
self.aIssue.triggered.connect(lambda: self._openWebsite(novelwriter.__issuesurl__)) self.aIssue.triggered.connect(lambda: self._openWebsite(novelwriter.__issuesurl__))
self.helpMenu.addAction(self.aIssue) self.helpMenu.addAction(self.aIssue)
# Document > Ask a Question # Document > Ask a Question
self.aQuestion = QAction(self.tr("Ask a Question (GitHub)"), self) self.aQuestion = QAction(self.tr("Ask a Question (GitHub)"), self)
self.aQuestion.setStatusTip(
self.tr("Ask a question on GitHub at {0}").format(novelwriter.__helpurl__)
)
self.aQuestion.triggered.connect(lambda: self._openWebsite(novelwriter.__helpurl__)) self.aQuestion.triggered.connect(lambda: self._openWebsite(novelwriter.__helpurl__))
self.helpMenu.addAction(self.aQuestion) self.helpMenu.addAction(self.aQuestion)
# Document > Main Website # Document > Main Website
self.aWebsite = QAction(self.tr("The novelWriter Website"), self) self.aWebsite = QAction(self.tr("The novelWriter Website"), self)
self.aWebsite.setStatusTip(
self.tr("Open the novelWriter website at {0}").format(novelwriter.__url__)
)
self.aWebsite.triggered.connect(lambda: self._openWebsite(novelwriter.__url__)) self.aWebsite.triggered.connect(lambda: self._openWebsite(novelwriter.__url__))
self.helpMenu.addAction(self.aWebsite) self.helpMenu.addAction(self.aWebsite)
@@ -1138,7 +1006,6 @@ class GuiMainMenu(QMenuBar):
# Document > Check for Updates # Document > Check for Updates
self.aUpdates = QAction(self.tr("Check for New Release"), self) self.aUpdates = QAction(self.tr("Check for New Release"), self)
self.aUpdates.setStatusTip(self.tr("Check for latest release of novelWriter"))
self.aUpdates.triggered.connect(lambda: self.theParent.showUpdatesDialog()) self.aUpdates.triggered.connect(lambda: self.theParent.showUpdatesDialog())
self.helpMenu.addAction(self.aUpdates) self.helpMenu.addAction(self.aUpdates)
+3 -1
View File
@@ -206,7 +206,9 @@ class GuiProjectTree(QTreeWidget):
) )
if itemType == nwItemType.ROOT: if itemType == nwItemType.ROOT:
tHandle = self.theProject.newRoot(trConst(nwLabels.CLASS_NAME[itemClass]), itemClass) tHandle = self.theProject.newRoot(
trConst(nwLabels.CLASS_NAME_LBL[itemClass]), itemClass
)
if tHandle is None: if tHandle is None:
logger.error("No root item added") logger.error("No root item added")
return False return False
+1 -1
View File
@@ -359,7 +359,7 @@ class GuiMain(QMainWindow):
if self.hasProject: if self.hasProject:
if not self.closeProject(): if not self.closeProject():
self.makeAlert(self.tr( self.makeAlert(self.tr(
"Cannot create new project when another project is open." "Cannot create a new project when another project is open."
), nwAlert.ERROR) ), nwAlert.ERROR)
return False return False
-6
View File
@@ -343,22 +343,16 @@ class GuiBuildNovel(QDialog):
self.fileGroup.setLayout(self.fileForm) self.fileGroup.setLayout(self.fileForm)
self.novelFiles = QSwitch(width=wS, height=hS) self.novelFiles = QSwitch(width=wS, height=hS)
self.novelFiles.setToolTip(self.tr("Include files with layouts other than 'Note'."))
self.novelFiles.setChecked( self.novelFiles.setChecked(
self.optState.getBool("GuiBuildNovel", "addNovel", True) self.optState.getBool("GuiBuildNovel", "addNovel", True)
) )
self.noteFiles = QSwitch(width=wS, height=hS) self.noteFiles = QSwitch(width=wS, height=hS)
self.noteFiles.setToolTip(self.tr("Include files with layout 'Note'."))
self.noteFiles.setChecked( self.noteFiles.setChecked(
self.optState.getBool("GuiBuildNovel", "addNotes", False) self.optState.getBool("GuiBuildNovel", "addNotes", False)
) )
self.ignoreFlag = QSwitch(width=wS, height=hS) self.ignoreFlag = QSwitch(width=wS, height=hS)
self.ignoreFlag.setToolTip(self.tr(
"Ignore the 'Include when building project' setting and include "
"all files in the output."
))
self.ignoreFlag.setChecked( self.ignoreFlag.setChecked(
self.optState.getBool("GuiBuildNovel", "ignoreFlag", False) self.optState.getBool("GuiBuildNovel", "ignoreFlag", False)
) )
+6 -6
View File
@@ -310,22 +310,22 @@ class ProjWizardCustomPage(QWizardPage):
self.rootGroup.setLayout(self.rootForm) self.rootGroup.setLayout(self.rootForm)
self.lblPlot = QLabel(self.tr("{0} folder").format( self.lblPlot = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.PLOT])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.PLOT]))
) )
self.lblChar = QLabel(self.tr("{0} folder").format( self.lblChar = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.CHARACTER])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.CHARACTER]))
) )
self.lblWorld = QLabel(self.tr("{0} folder").format( self.lblWorld = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.WORLD])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.WORLD]))
) )
self.lblTime = QLabel(self.tr("{0} folder").format( self.lblTime = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.TIMELINE])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.TIMELINE]))
) )
self.lblObject = QLabel(self.tr("{0} folder").format( self.lblObject = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.OBJECT])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.OBJECT]))
) )
self.lblEntity = QLabel(self.tr("{0} folder").format( self.lblEntity = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.ENTITY])) trConst(nwLabels.CLASS_NAME_LBL[nwItemClass.ENTITY]))
) )
self.addPlot = QSwitch() self.addPlot = QSwitch()
+1 -1
View File
@@ -3,4 +3,4 @@
%%~kind: NOVEL/DOCUMENT %%~kind: NOVEL/DOCUMENT
### Discarded Scene ### Discarded Scene
If you have files you no longer want in your main project, you can move them to the “Outtakes” folder. This is equivalent to turning off the “Include when building project” switch, just that you also put the file away, although the switch can be ignored when building the project, this folder cannot. If you have files you no longer want in your main project, you can move them to the “Archive” folder. This is equivalent to turning off the “Include when building project” switch, just that you also put the file away, although the switch can be ignored when building the project, this folder cannot.
+5 -5
View File
@@ -1,13 +1,13 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="1.6-beta1" hexVersion="0x010600b1" fileVersion="1.3" timeStamp="2022-01-18 18:48:36"> <novelWriterXML appVersion="1.6-beta1" hexVersion="0x010600b1" fileVersion="1.3" timeStamp="2022-01-18 20:59:58">
<project> <project>
<name>Sample Project</name> <name>Sample Project</name>
<title>Sample Project</title> <title>Sample Project</title>
<author>Jane Smith</author> <author>Jane Smith</author>
<author>Jay Doh</author> <author>Jay Doh</author>
<saveCount>1283</saveCount> <saveCount>1296</saveCount>
<autoCount>199</autoCount> <autoCount>199</autoCount>
<editTime>63909</editTime> <editTime>64417</editTime>
</project> </project>
<settings> <settings>
<doBackup>False</doBackup> <doBackup>False</doBackup>
@@ -121,7 +121,7 @@
<charCount>2429</charCount> <charCount>2429</charCount>
<wordCount>432</wordCount> <wordCount>432</wordCount>
<paraCount>14</paraCount> <paraCount>14</paraCount>
<cursorPos>2</cursorPos> <cursorPos>219</cursorPos>
</item> </item>
<item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a"> <item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a">
<name>Another Scene</name> <name>Another Scene</name>
@@ -265,7 +265,7 @@
<cursorPos>45</cursorPos> <cursorPos>45</cursorPos>
</item> </item>
<item handle="6827118336ac1" order="3" parent="None"> <item handle="6827118336ac1" order="3" parent="None">
<name>Outtakes</name> <name>Archive</name>
<type>ROOT</type> <type>ROOT</type>
<class>ARCHIVE</class> <class>ARCHIVE</class>
<status>New</status> <status>New</status>
@@ -85,7 +85,7 @@
<expanded>False</expanded> <expanded>False</expanded>
</item> </item>
<item handle="98010bd9270f9" order="0" parent="None"> <item handle="98010bd9270f9" order="0" parent="None">
<name>Entity</name> <name>Entities</name>
<type>ROOT</type> <type>ROOT</type>
<class>ENTITY</class> <class>ENTITY</class>
<status>New</status> <status>New</status>
@@ -85,7 +85,7 @@
<expanded>False</expanded> <expanded>False</expanded>
</item> </item>
<item handle="98010bd9270f9" order="0" parent="None"> <item handle="98010bd9270f9" order="0" parent="None">
<name>Entity</name> <name>Entities</name>
<type>ROOT</type> <type>ROOT</type>
<class>ENTITY</class> <class>ENTITY</class>
<status>New</status> <status>New</status>
+1 -1
View File
@@ -281,7 +281,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI):
assert theIndex.scanText(xHandle, "Hello World!") is False assert theIndex.scanText(xHandle, "Hello World!") is False
# Create the archive root # Create the archive root
aHandle = theProject.newRoot("Outtakes", nwItemClass.ARCHIVE) aHandle = theProject.newRoot("Archive", nwItemClass.ARCHIVE)
assert theProject.projTree[aHandle] is not None assert theProject.projTree[aHandle] is not None
xItem.setParent(aHandle) xItem.setParent(aHandle)
assert theIndex.scanText(xHandle, "Hello World!") is False assert theIndex.scanText(xHandle, "Hello World!") is False