Esempio n. 1
0
 def __callForm(self, editor):
     """
     Private method to display a dialog and get the code.
     
     @param editor reference to the current editor
     @return the generated code (string)
     """
     match = self.__pyqtRe.search(editor.text())
     if match is None:
         pyqtVariant = 0    # unknown
     else:
         pyqtVariant = int(match.group(1))   # 4 or 5
     
     from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import \
         FileDialogWizardDialog
     dlg = FileDialogWizardDialog(pyqtVariant, None)
     if dlg.exec_() == QDialog.Accepted:
         line, index = editor.getCursorPosition()
         indLevel = editor.indentation(line) // editor.indentationWidth()
         if editor.indentationsUseTabs():
             indString = '\t'
         else:
             indString = editor.indentationWidth() * ' '
         return (dlg.getCode(indLevel, indString), 1)
     else:
         return (None, 0)
Esempio n. 2
0
 def __callForm(self, editor, variant):
     """
     Private method to display a dialog and get the code.
     
     @param editor reference to the current editor
     @type Editor
     @param variant variant of code to be generated
         (-1 = E5FileDialog, 0 = unknown, 4 = PyQt4, 5 = PyQt5)
     @type int
     @return the generated code (string)
     """
     from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import (
         FileDialogWizardDialog
     )
     dlg = FileDialogWizardDialog(variant, None)
     if dlg.exec_() == QDialog.Accepted:
         line, index = editor.getCursorPosition()
         indLevel = editor.indentation(line) // editor.indentationWidth()
         if editor.indentationsUseTabs():
             indString = '\t'
         else:
             indString = editor.indentationWidth() * ' '
         return (dlg.getCode(indLevel, indString), 1)
     else:
         return (None, 0)
 def __callForm(self, editor):
     """
     Private method to display a dialog and get the code.
     
     @param editor reference to the current editor
     @return the generated code (string)
     """
     match = self.__pyqtRe.search(editor.text())
     if match is None:
         pyqtVariant = 0    # unknown
     else:
         pyqtVariant = int(match.group(1))   # 4 or 5
     
     from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import \
         FileDialogWizardDialog
     dlg = FileDialogWizardDialog(pyqtVariant, None)
     if dlg.exec_() == QDialog.Accepted:
         line, index = editor.getCursorPosition()
         indLevel = editor.indentation(line) // editor.indentationWidth()
         if editor.indentationsUseTabs():
             indString = '\t'
         else:
             indString = editor.indentationWidth() * ' '
         return (dlg.getCode(indLevel, indString), 1)
     else:
         return (None, 0)
 def __callForm(self, editor):
     """
     Private method to display a dialog and get the code.
     
     @param editor reference to the current editor
     @return the generated code (string)
     """
     dlg = FileDialogWizardDialog(None)
     if dlg.exec_() == QDialog.Accepted:
         line, index = editor.getCursorPosition()
         indLevel = editor.indentation(line)/editor.indentationWidth()
         if editor.indentationsUseTabs():
             indString = '\t'
         else:
             indString = editor.indentationWidth() * ' '
         return (dlg.getCode(indLevel, indString), 1)
     else:
         return (None, 0)