Added insert menu entries and insert action code

This commit is contained in:
Veronica K. B. Olsen
2020-08-22 13:20:01 +02:00
parent 27c36f3880
commit 377c9a3d41
3 changed files with 24 additions and 0 deletions
+4
View File
@@ -612,6 +612,10 @@ class GuiDocEditor(QTextEdit):
theText = nwUnicode.U_EMDASH
elif theInsert == nwDocInsert.ELLIPSIS:
theText = nwUnicode.U_HELLIP
elif theInsert == nwDocInsert.MODAPOS_S:
theText = nwUnicode.U_MAPOSS
elif theInsert == nwDocInsert.MODAPOS_D:
theText = nwUnicode.U_MAPOSD
elif theInsert == nwDocInsert.QUOTE_LS:
theText = self.typSQOpen
elif theInsert == nwDocInsert.QUOTE_RS:
+18
View File
@@ -554,6 +554,24 @@ class GuiMainMenu(QMenuBar):
# Insert > Separator
self.insertMenu.addSeparator()
# Insert > Modifier Single Apostrophe
self.aInsMSApos = QAction("Modifier Single Apostrophe", self)
self.aInsMSApos.setStatusTip("Insert unicode modifier letter single apostrophe")
self.aInsMSApos.setShortcut("Ctrl+K, '")
self.aInsMSApos.triggered.connect(lambda: self._docInsert(nwDocInsert.MODAPOS_S))
self.insertMenu.addAction(self.aInsMSApos)
# Insert > Modifier Double Apostrophe
self.aInsMDApos = QAction("Modifier Double Apostrophe", self)
self.aInsMDApos.setStatusTip("Insert unicode modifier letter double apostrophe")
self.aInsMDApos.setShortcut("Ctrl+K, \"")
self.aInsMDApos.triggered.connect(lambda: self._docInsert(nwDocInsert.MODAPOS_D))
self.insertMenu.addAction(self.aInsMDApos)
# Insert > Separator
self.insertMenu.addSeparator()
# Insert > Hard Line Break
# Insert > Hard Line Break
self.aInsHardBreak = QAction("Hard Line Break", self)
self.aInsHardBreak.setStatusTip("Insert a hard line break")
+2
View File
@@ -1039,6 +1039,8 @@ class GuiMain(QMainWindow):
self.addAction(self.mainMenu.aInsQuoteRS)
self.addAction(self.mainMenu.aInsQuoteLD)
self.addAction(self.mainMenu.aInsQuoteRD)
self.addAction(self.mainMenu.aInsMSApos)
self.addAction(self.mainMenu.aInsMDApos)
self.addAction(self.mainMenu.aInsHardBreak)
self.addAction(self.mainMenu.aInsNBSpace)
self.addAction(self.mainMenu.aInsThinSpace)