Add Lorem Ipsum tool (#1028)
* Add a Lorem Ipsum dialog * Add the Lorem Ipsum text and insert action * Add test coverage
This commit is contained in:
committed by
GitHub
parent
99cc3635f7
commit
a04b44d890
+21
-1
@@ -47,7 +47,9 @@ from novelwriter.dialogs import (
|
||||
GuiProjectDetails, GuiProjectLoad, GuiProjectSettings, GuiUpdates,
|
||||
GuiWordList
|
||||
)
|
||||
from novelwriter.tools import GuiBuildNovel, GuiProjectWizard, GuiWritingStats
|
||||
from novelwriter.tools import (
|
||||
GuiBuildNovel, GuiLipsum, GuiProjectWizard, GuiWritingStats
|
||||
)
|
||||
from novelwriter.core import NWProject, NWIndex
|
||||
from novelwriter.enum import (
|
||||
nwItemType, nwItemClass, nwAlert, nwWidget, nwState
|
||||
@@ -1050,6 +1052,24 @@ class GuiMain(QMainWindow):
|
||||
|
||||
return True
|
||||
|
||||
def showLoremIpsumDialog(self):
|
||||
"""Open the insert lorem ipsum text dialog.
|
||||
"""
|
||||
if not self.hasProject:
|
||||
logger.error("No project open")
|
||||
return False
|
||||
|
||||
dlgLipsum = getGuiItem("GuiLipsum")
|
||||
if dlgLipsum is None:
|
||||
dlgLipsum = GuiLipsum(self)
|
||||
|
||||
dlgLipsum.setModal(False)
|
||||
dlgLipsum.show()
|
||||
dlgLipsum.raise_()
|
||||
qApp.processEvents()
|
||||
|
||||
return True
|
||||
|
||||
def showProjectWordListDialog(self):
|
||||
"""Open the project word list dialog.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user