# eric4.Project.ProjectFormsBrowser

Module implementing a class used to display the forms part of the project.

### Classes

ProjectFormsBrowser | A class used to display the forms part of the project.

### Functions

None

## ProjectFormsBrowser

A class used to display the forms part of the project.

#### Signals

appendStderr(string)
  emitted after something was received from a QProcess on stderr
appendStdout(string)
  emitted after something was received from a QProcess on stdout
closeSourceWindow(string)
  emitted after a file has been removed/deleted from the project
menusAboutToBeCreated
  emitted when the context menu are about to be created. This is the right moment to add or remove hook methods.
showMenu(string, QMenu)
  emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given.
sourceFile(string)
  emitted to open a forms file in an editor
trpreview(string list)
  emitted to preview form files in the translations previewer
uipreview(string)
  emitted to preview a forms file

### Derived from

ProjectBaseBrowser

### Methods

ProjectFormsBrowser | Constructor
__TRPreview | Private slot to handle the Preview translations action.
__UIPreview | Private slot to handle the Preview menu action.
__addFormFiles | Private method to add form files to the project.
__addFormsDirectory | Private method to add form files of a directory to the project.
__compileAllForms | Private method to compile all forms to source files.
__compileForm | Private method to compile a form to a source file.
__compileSelectedForms | Private method to compile selected forms to source files.
__compileUI | Privat method to compile a .ui file to a .py/.rb file.
__compileUIDone | Private slot to handle the finished signal of the pyuic/rbuic process.
__deleteFile | Private method to delete a form file from the project.
__generateDialogCode | Private method to generate dialog code for the form (Qt4 only)
__generateSubclass | Private method to generate a subclass for the form (Qt3 only).
__itemsHaveDesignerHeaderFiles | Private method to check, if items contain designer header files.
__newForm | Private slot to handle the New Form menu action.
__newUiForm | Private slot to handle the New Form menu action for Qt-related projects.
__openFile | Private slot to handle the Open menu action.
__openFileInEditor | Private slot to handle the Open in Editor menu action.
__readStderr | Private slot to handle the readyReadStandardError signal of the pyuic/rbuic process.
__readStdout | Private slot to handle the readyReadStandardOutput signal of the pyuic/rbuic process.
__showContextMenu | Private slot called by the menu aboutToShow signal.
__showContextMenuBack | Private slot called by the backMenu aboutToShow signal.
__showContextMenuDir | Private slot called by the dirMenu aboutToShow signal.
__showContextMenuDirMulti | Private slot called by the dirMultiMenu aboutToShow signal.
__showContextMenuMulti | Private slot called by the multiMenu aboutToShow signal.
_contextMenuRequested | Protected slot to show the context menu.
_createPopupMenus | Protected overloaded method to generate the popup menu.
_initHookMethods | Protected method to initialize the hooks dictionary.
_openItem | Protected slot to handle the open popup menu entry.
compileChangedForms | Public method to compile all changed forms to source files.
handlePreferencesChanged | Public slot used to handle the preferencesChanged signal.

#### ProjectFormsBrowser (Constructor)

ProjectFormsBrowser(project, parent = None)

Constructor

project
  reference to the project object
parent
  parent widget of this browser (QWidget)

#### ProjectFormsBrowser.__TRPreview

__TRPreview()

Private slot to handle the Preview translations action.

#### ProjectFormsBrowser.__UIPreview

__UIPreview()

Private slot to handle the Preview menu action.

#### ProjectFormsBrowser.__addFormFiles

__addFormFiles()

Private method to add form files to the project.

#### ProjectFormsBrowser.__addFormsDirectory

__addFormsDirectory()

Private method to add form files of a directory to the project.

#### ProjectFormsBrowser.__compileAllForms

__compileAllForms()

Private method to compile all forms to source files.

#### ProjectFormsBrowser.__compileForm

__compileForm()

Private method to compile a form to a source file.

#### ProjectFormsBrowser.__compileSelectedForms

__compileSelectedForms()

Private method to compile selected forms to source files.

#### ProjectFormsBrowser.__compileUI

__compileUI(fn, noDialog = False, progress = None, subclass = False)

Privat method to compile a .ui file to a .py/.rb file.

fn
  filename of the .ui file to be compiled
noDialog
  flag indicating silent operations
progress
  reference to the progress dialog
subclass
  flag indicating, if a subclass generation is to be done

Returns:
  reference to the compile process (QProcess)

#### ProjectFormsBrowser.__compileUIDone

__compileUIDone(exitCode, exitStatus)

Private slot to handle the finished signal of the pyuic/rbuic process.

exitCode
  exit code of the process (integer)
exitStatus
  exit status of the process (QProcess.ExitStatus)

#### ProjectFormsBrowser.__deleteFile

__deleteFile()

Private method to delete a form file from the project.

#### ProjectFormsBrowser.__generateDialogCode

__generateDialogCode()

Private method to generate dialog code for the form (Qt4 only)

#### ProjectFormsBrowser.__generateSubclass

__generateSubclass()

Private method to generate a subclass for the form (Qt3 only).

#### ProjectFormsBrowser.__itemsHaveDesignerHeaderFiles

__itemsHaveDesignerHeaderFiles(items)

Private method to check, if items contain designer header files.

items
  items to check (list of ProjectBrowserFileItems)

Returns:
  flag indicating designer header files were found (boolean)

#### ProjectFormsBrowser.__newForm

__newForm()

Private slot to handle the New Form menu action.

#### ProjectFormsBrowser.__newUiForm

__newUiForm(path)

Private slot to handle the New Form menu action for Qt-related projects.

path
  full directory path for the new form file (string)

#### ProjectFormsBrowser.__openFile

__openFile()

Private slot to handle the Open menu action.

This uses the projects UI type to determine the Qt Designer version to use.

#### ProjectFormsBrowser.__openFileInEditor

__openFileInEditor()

Private slot to handle the Open in Editor menu action.

#### ProjectFormsBrowser.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal of the pyuic/rbuic process.

#### ProjectFormsBrowser.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal of the pyuic/rbuic process.

#### ProjectFormsBrowser.__showContextMenu

__showContextMenu()

Private slot called by the menu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuBack

__showContextMenuBack()

Private slot called by the backMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuDir

__showContextMenuDir()

Private slot called by the dirMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuDirMulti

__showContextMenuDirMulti()

Private slot called by the dirMultiMenu aboutToShow signal.

#### ProjectFormsBrowser.__showContextMenuMulti

__showContextMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

#### ProjectFormsBrowser._contextMenuRequested

_contextMenuRequested(coord)

Protected slot to show the context menu.

coord
  the position of the mouse pointer (QPoint)

#### ProjectFormsBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

#### ProjectFormsBrowser._initHookMethods

_initHookMethods()

Protected method to initialize the hooks dictionary.

Supported hook methods are:

- compileForm: takes filename as parameter
- compileAllForms: takes list of filenames as parameter
- compileSelectedForms: takes list of filenames as parameter
- compileChangedForms: takes list of filenames as parameter
- generateDialogCode: takes filename as parameter
- newForm: takes full directory path of new file as parameter

Note: Filenames are relative to the project directory, if not specified differently.

#### ProjectFormsBrowser._openItem

_openItem()

Protected slot to handle the open popup menu entry.

#### ProjectFormsBrowser.compileChangedForms

compileChangedForms()

Public method to compile all changed forms to source files.

#### ProjectFormsBrowser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Up