From a15af3057874646da4579bebe0cf6d6e0395f331 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 20:45:24 +0200 Subject: [PATCH] Renamed italic and bold to emphasis and strong emphasis --- nw/constants/enum.py | 6 +++--- nw/gui/doceditor.py | 6 +++--- nw/gui/mainmenu.py | 40 ++++++++++++++++++++-------------------- nw/guimain.py | 7 ++++--- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/nw/constants/enum.py b/nw/constants/enum.py index 7177223c..2431d80f 100644 --- a/nw/constants/enum.py +++ b/nw/constants/enum.py @@ -74,9 +74,9 @@ class nwDocAction(Enum): CUT = 3 COPY = 4 PASTE = 5 - ITALIC = 6 - BOLD = 7 - BOLDITALIC = 8 + ENPH = 6 + STRONG = 7 + STRONGEMPH = 8 STRIKE = 9 S_QUOTE = 10 D_QUOTE = 11 diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 5c23e513..d140ae4c 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -514,11 +514,11 @@ class GuiDocEditor(QTextEdit): self.copy() elif theAction == nwDocAction.PASTE: self.paste() - elif theAction == nwDocAction.ITALIC: + elif theAction == nwDocAction.ENPH: self._toggleEmph(1) - elif theAction == nwDocAction.BOLD: + elif theAction == nwDocAction.STRONG: self._toggleEmph(2) - elif theAction == nwDocAction.BOLDITALIC: + elif theAction == nwDocAction.STRONGEMPH: self._toggleEmph(3) elif theAction == nwDocAction.STRIKE: self._toggleStrike() diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index b6ce5275..9fefd21c 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -526,30 +526,30 @@ class GuiMainMenu(QMenuBar): # Format self.fmtMenu = self.addMenu("&Format") - # Format > Italic Text - self.aFmtItalic = QAction("Italic Text", self) - self.aFmtItalic.setStatusTip("Make selected text italic") - self.aFmtItalic.setShortcut("Ctrl+I") - self.aFmtItalic.triggered.connect(lambda: self._docAction(nwDocAction.ITALIC)) - self.fmtMenu.addAction(self.aFmtItalic) + # Format > Emphasis + self.aFmtEmph = QAction("Emphasis", self) + self.aFmtEmph.setStatusTip("Add emphasis to selected text (italic)") + self.aFmtEmph.setShortcut("Ctrl+I") + self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.ENPH)) + self.fmtMenu.addAction(self.aFmtEmph) - # Format > Bold Text - self.aFmtBold = QAction("Bold Text", self) - self.aFmtBold.setStatusTip("Make selected text bold") - self.aFmtBold.setShortcut("Ctrl+B") - self.aFmtBold.triggered.connect(lambda: self._docAction(nwDocAction.BOLD)) - self.fmtMenu.addAction(self.aFmtBold) + # Format > Strong Emphasis + self.aFmtStrong = QAction("Strong Emphasis", self) + self.aFmtStrong.setStatusTip("Add strong emphasis to selected text (bold)") + self.aFmtStrong.setShortcut("Ctrl+B") + self.aFmtStrong.triggered.connect(lambda: self._docAction(nwDocAction.STRONG)) + self.fmtMenu.addAction(self.aFmtStrong) - # Format > Underline Text - self.aFmtBoldIt = QAction("Bold Italic Text", self) - self.aFmtBoldIt.setStatusTip("Make selected text bold and italic") - self.aFmtBoldIt.setShortcut("Ctrl+Shift+B") - self.aFmtBoldIt.triggered.connect(lambda: self._docAction(nwDocAction.BOLDITALIC)) - self.fmtMenu.addAction(self.aFmtBoldIt) + # Format > Very Strong Emphasis + self.aFmtStrongEmph = QAction("Very Strong Emphasis", self) + self.aFmtStrongEmph.setStatusTip("Add very strong emphasis to selected text (bold and italic)") + self.aFmtStrongEmph.setShortcut("Ctrl+Shift+B") + self.aFmtStrongEmph.triggered.connect(lambda: self._docAction(nwDocAction.STRONGEMPH)) + self.fmtMenu.addAction(self.aFmtStrongEmph) # Format > Strikethrough - self.aFmtStrike = QAction("Strikethrough Text", self) - self.aFmtStrike.setStatusTip("Strikethrough selected text") + self.aFmtStrike = QAction("Strikethrough", self) + self.aFmtStrike.setStatusTip("Add strikethrough to selected text") self.aFmtStrike.setShortcut("Ctrl+-") self.aFmtStrike.triggered.connect(lambda: self._docAction(nwDocAction.STRIKE)) self.fmtMenu.addAction(self.aFmtStrike) diff --git a/nw/guimain.py b/nw/guimain.py index 0e04a56d..1777cf1c 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -1003,9 +1003,10 @@ class GuiMain(QMainWindow): self.addAction(self.mainMenu.aInsThinNBSpace) # Format - self.addAction(self.mainMenu.aFmtItalic) - self.addAction(self.mainMenu.aFmtBold) - self.addAction(self.mainMenu.aFmtBoldIt) + self.addAction(self.mainMenu.aFmtEmph) + self.addAction(self.mainMenu.aFmtStrong) + self.addAction(self.mainMenu.aFmtStrongEmph) + self.addAction(self.mainMenu.aFmtStrike) self.addAction(self.mainMenu.aFmtDQuote) self.addAction(self.mainMenu.aFmtSQuote) self.addAction(self.mainMenu.aFmtHead1)