eric7/Plugins/PluginWizardEricMessageBox.py

branch
eric7
changeset 8366
2a9f5153c438
parent 8364
2d72d4d11771
child 8367
907860ca00d6
equal deleted inserted replaced
8365:cde9bde830ea 8366:2a9f5153c438
97 Private method to display a dialog and get the code. 97 Private method to display a dialog and get the code.
98 98
99 @param editor reference to the current editor 99 @param editor reference to the current editor
100 @return the generated code (string) 100 @return the generated code (string)
101 """ 101 """
102 from WizardPlugins.EricMessageBoxWizard.EricMessageBoxWizardDialog import ( 102 from WizardPlugins.EricMessageBoxWizard.EricMessageBoxWizardDialog \
103 EricMessageBoxWizardDialog 103 import EricMessageBoxWizardDialog
104 )
105 dlg = EricMessageBoxWizardDialog(None) 104 dlg = EricMessageBoxWizardDialog(None)
106 if dlg.exec() == QDialog.DialogCode.Accepted: 105 if dlg.exec() == QDialog.DialogCode.Accepted:
107 line, index = editor.getCursorPosition() 106 line, index = editor.getCursorPosition()
108 indLevel = editor.indentation(line) // editor.indentationWidth() 107 indLevel = editor.indentation(line) // editor.indentationWidth()
109 if editor.indentationsUseTabs(): 108 if editor.indentationsUseTabs():
131 line, index = editor.getCursorPosition() 130 line, index = editor.getCursorPosition()
132 # It should be done on this way to allow undo 131 # It should be done on this way to allow undo
133 editor.beginUndoAction() 132 editor.beginUndoAction()
134 editor.insertAt(code, line, index) 133 editor.insertAt(code, line, index)
135 editor.endUndoAction() 134 editor.endUndoAction()
135
136 #
137 # eflag: noqa = M841

eric ide

mercurial