# eric4.UI.UserInterface

Module implementing the main user interface.

### Classes

Redirector | Helper class used to redirect stdout and stderr to the log window
UserInterface | Class implementing the main user interface.

### Functions

None

## Redirector

Helper class used to redirect stdout and stderr to the log window

#### Signals

appendStderr(string)
  emitted to write data to stderr logger
appendStdout(string)
  emitted to write data to stdout logger

### Derived from

QObject

### Methods

Redirector | Constructor
__bufferedWrite | Private method returning number of characters to write.
__nWrite | Private method used to write data.
flush | Public method used to flush the buffered data.
write | Public method used to write data.

#### Redirector (Constructor)

Redirector(stderr)

Constructor

stderr
  flag indicating stderr is being redirected

#### Redirector.__bufferedWrite

__bufferedWrite()

Private method returning number of characters to write.

Returns:
  number of characters buffered or length of buffered line

#### Redirector.__nWrite

__nWrite(n)

Private method used to write data.

n
  max numebr of bytes to write

#### Redirector.flush

flush()

Public method used to flush the buffered data.

#### Redirector.write

write(s)

Public method used to write data.

s
  data to be written (it must support the str-method)

Up

## UserInterface

Class implementing the main user interface.

#### Signals

appendStderr(QString)
  emitted to write data to stderr logger
appendStdout(QString)
  emitted to write data to stdout logger
preferencesChanged()
  emitted after the preferences were changed
reloadAPIs()
  emitted to reload the api information

### Derived from

QMainWindow

### Methods

UserInterface | Constructor
__TBMenuTriggered | Private method to handle the toggle of a toolbar.
__TRPreviewer | Private slot to start the Translation Previewer executable.
__UIPreviewer | Private slot to start the UI Previewer executable.
__about | Private slot to handle the About dialog.
__aboutKde | Private slot to handle the About KDE dialog.
__aboutQt | Private slot to handle the About Qt dialog.
__activateBrowser | Private slot to handle the activation of the file browser.
__activateDebugViewer | Private slot to handle the activation of the debug browser.
__activateLogViewer | Private slot to handle the activation of the Log Viewer.
__activateProjectBrowser | Private slot to handle the activation of the project browser.
__activateShell | Private slot to handle the activation of the Shell window.
__activateTaskViewer | Private slot to handle the activation of the Task Viewer.
__activateTemplateViewer | Private slot to handle the activation of the Template Viewer.
__activateViewProfile | Private slot to activate a view profile.
__activateViewmanager | Private slot to handle the activation of the current editor.
__assistant | Private slot to start the Qt-Assistant executable.
__assistant4 | Private slot to start the Qt-Assistant 4 executable.
__checkActions | Private slot to check some actions for their enable/disable status.
__chmViewer | Private slot to start the win32 help viewer to show *.chm files.
__compareFiles | Private slot to handle the Compare Files dialog.
__compareFilesSbs | Private slot to handle the Compare Files dialog.
__configShortcuts | Private slot to configure the keyboard shortcuts.
__configViewProfiles | Private slot to configure the various view profiles.
__createDockWindow | Private method to create a dock window with common properties.
__createLayout | Private method to create the layout of the various windows.
__customViewer | Private slot to start a custom viewer.
__deleteScript | Private slot to delete a script.
__designer | Private slot to start the Qt-Designer executable.
__designer4 | Private slot to start the Qt-Designer 4 executable.
__editorOpened | Private slot to handle the editorOpened signal.
__executeDocumentAsScript | Private slot to handle the execute document as script menu action.
__executeScript | Private slot to execute a script.
__exportShortcuts | Private slot to export the keyboard shortcuts.
__firstScriptAdded | Private slot to handle the firstScriptAdded signal
__getFloatingGeometry | Private method to get the geometry of a floating windows.
__helpClosed | Private slot to handle the helpClosed signal of the help window.
__helpViewer | Private slot to start an empty help viewer.
__importShortcuts | Private slot to import the keyboard shortcuts.
__initActions | Private method to define the user interface actions.
__initEricDocAction | Private slot to initialize the action to show the eric4 documentation.
__initMenus | Private slot to create the menus.
__initPythonDocAction | Private slot to initilize the action to show the Python documentation.
__initQtDocActions | Private slot to initilize the action to show the Qt documentation.
__initStatusbar | Private slot to set up the status bar.
__initToolbars | Private slot to create the toolbars.
__lastEditorClosed | Private slot to handle the lastEditorClosed signal.
__lastScriptDeleted | Private slot to handle the lastScriptDeleted signal
__linguist | Private slot to start the Qt-Linguist executable.
__linguist4 | Private slot to start the Qt-Linguist 4 executable.
__loadScript | Private slot to handle the load script menu action.
__newProject | Private slot to handle the NewProject signal.
__nextTab | Private slot used to show the next tab.
__preferences | Private slot to set the preferences.
__preferencesChanged | Private slot to handle a change of the preferences.
__prevTab | Private slot used to show the previous tab.
__processToolStderr | Private slot to handle the readyReadStderr signal of a tool process.
__processToolStdout | Private slot to handle the readyReadStdout signal of a tool process.
__programChange | Private slot to handle the programChange signal.
__projectClosed | Private slot to handle the projectClosed signal.
__projectOpened | Private slot to handle the projectOpened signal.
__quit | Private method to quit the application.
__readTasks | Private slot to read in the tasks file (.e4t)
__reloadAPIs | Private slot to reload the api information.
__reportBug | Private slot to handle the Report Bug dialog.
__saveCurrentViewProfile | Private slot to save the window geometries of the active profile.
__setEditProfile | Private slot to activate the edit view profile.
__setStyle | Private slot to set the style of the interface.
__setWindowCaption | Private method to set the caption of the Main Window.
__setupDockWindow | Private method to configure the dock window created with __createDockWindow().
__showChartables | Private slot to show the character tables dialog.
__showEricDoc | Private slot to show the Eric documentation.
__showExternalTools | Private slot to display a dialog show a list of external tools used by eric4.
__showHelpMenu | Private slot to display the Help menu.
__showPixmap | Private slot to show a pixmap in a dialog.
__showPyQt4Doc | Private slot to show the PyQt4 documentation.
__showPythonDoc | Private slot to show the Python documentation.
__showQt4Doc | Private slot to show the Qt4 documentation.
__showQtDoc | Private slot to show the Qt documentation.
__showToolGroupsMenu | Private slot to display the Tool Groups menu.
__showToolbarsMenu | Private slot to display the Toolbars menu.
__showToolsMenu | Private slot to display the Tools menu.
__showVersions | Private slot to handle the Versions dialog.
__showWindowMenu | Private slot to display the Window menu.
__shutdown | Private method to perform all neccessary steps to close down the IDE.
__toggleBrowser | Private slot to handle the toggle of the File Browser window.
__toggleDebugViewer | Private slot to handle the toggle of the debug viewer.
__toggleLogViewer | Private slot to handle the toggle of the Log Viewer window.
__toggleProjectBrowser | Private slot to handle the toggle of the Project Browser window.
__toggleShell | Private slot to handle the toggle of the Shell window .
__toggleTaskViewer | Private slot to handle the toggle of the Task Viewer window.
__toggleTemplateViewer | Private slot to handle the toggle of the Template Viewer window.
__toggleWindow | Private method to toggle a workspace editor window.
__toolExecute | Private slot to execute a particular tool.
__toolFinished | Private slot to handle the finished signal of a tool process.
__toolGroupSelected | Private slot to set the current tool group.
__toolGroupsConfiguration | Private slot to handle the tool groups configuration menu entry.
__toolsConfiguration | Private slot to handle the tools configuration menu entry.
__unittest | Private slot for displaying the unittest dialog.
__unittestProject | Private slot for displaying the unittest dialog and run the current project.
__unittestRestart | Private slot to display the unittest dialog and rerun the last test.
__unittestScript | Private slot for displaying the unittest dialog and run the current script.
__versionsDownloadCanceled | Private method called to cancel the version check.
__versionsDownloadDone | Private method called, after the versions file has been downloaded from the internet.
__webBrowser | Private slot to start a web browser executable.
__whatsThis | Private slot called in to enter Whats This mode.
__writeTasks | Private slot to write the tasks data to an XML file (.e4t).
checkConfigurationStatus | Public method to check, if eric4 has been configured.
closeEvent | Private event handler for the close event.
dragEnterEvent | Protected method to handle the drag enter event.
dragLeaveEvent | Protected method to handle the drag leave event.
dragMoveEvent | Protected method to handle the drag move event.
dropEvent | Protected method to handle the drop event.
getActions | Public method to get a list of all actions.
getViewProfile | Public method to get the current view profile.
launchHelpViewer | Public slot to start the help viewer.
performVersionCheck | Public method to check the internet for an eric4 update.
processArgs | Public method to process the command line args passed to the UI.
setDebugProfile | Public slot to activate the debug view profile.
showLogTab | Public method to show a particular Log-Viewer tab.

#### UserInterface (Constructor)

UserInterface(locale, splash)

Constructor

locale
  locale to be used by the UI (string)
splash
  reference to the splashscreen (UI.SplashScreen.SplashScreen)

#### UserInterface.__TBMenuTriggered

__TBMenuTriggered(act)

Private method to handle the toggle of a toolbar.

act
  reference to the action that was triggered (QAction)

#### UserInterface.__TRPreviewer

__TRPreviewer(fileNames = None, ignore = False)

Private slot to start the Translation Previewer executable.

fileNames
  filenames of forms and/or translations to be previewed
ignore
  flag indicating non existing files should be ignored (boolean)

#### UserInterface.__UIPreviewer

__UIPreviewer(fn=None)

Private slot to start the UI Previewer executable.

fn
  filename of the form to be previewed

#### UserInterface.__about

__about()

Private slot to handle the About dialog.

#### UserInterface.__aboutKde

__aboutKde()

Private slot to handle the About KDE dialog.

#### UserInterface.__aboutQt

__aboutQt()

Private slot to handle the About Qt dialog.

#### UserInterface.__activateBrowser

__activateBrowser()

Private slot to handle the activation of the file browser.

#### UserInterface.__activateDebugViewer

__activateDebugViewer()

Private slot to handle the activation of the debug browser.

#### UserInterface.__activateLogViewer

__activateLogViewer()

Private slot to handle the activation of the Log Viewer.

#### UserInterface.__activateProjectBrowser

__activateProjectBrowser()

Private slot to handle the activation of the project browser.

#### UserInterface.__activateShell

__activateShell()

Private slot to handle the activation of the Shell window.

#### UserInterface.__activateTaskViewer

__activateTaskViewer()

Private slot to handle the activation of the Task Viewer.

#### UserInterface.__activateTemplateViewer

__activateTemplateViewer()

Private slot to handle the activation of the Template Viewer.

#### UserInterface.__activateViewProfile

__activateViewProfile(name, save = True)

Private slot to activate a view profile.

name
  name of the profile to be activated (string)
save
  flag indicating that the current profile should be saved (boolean)

#### UserInterface.__activateViewmanager

__activateViewmanager()

Private slot to handle the activation of the current editor.

#### UserInterface.__assistant

__assistant(home = None, version = 3)

Private slot to start the Qt-Assistant executable.

home
  full pathname of a file to display (string or QString)
version
  indication for the requested version (Qt 3 or Qt 4) (integer)

#### UserInterface.__assistant4

__assistant4()

Private slot to start the Qt-Assistant 4 executable.

#### UserInterface.__checkActions

__checkActions(editor)

Private slot to check some actions for their enable/disable status.

editor
  editor window

#### UserInterface.__chmViewer

__chmViewer(home=None)

Private slot to start the win32 help viewer to show *.chm files.

home
  full pathname of a file to display (string or QString)

#### UserInterface.__compareFiles

__compareFiles()

Private slot to handle the Compare Files dialog.

#### UserInterface.__compareFilesSbs

__compareFilesSbs()

Private slot to handle the Compare Files dialog.

#### UserInterface.__configShortcuts

__configShortcuts()

Private slot to configure the keyboard shortcuts.

#### UserInterface.__configViewProfiles

__configViewProfiles()

Private slot to configure the various view profiles.

#### UserInterface.__createDockWindow

__createDockWindow(name)

Private method to create a dock window with common properties.

name
  object name of the new dock window (string or QString)

Returns:
  the generated dock window (QDockWindow)

#### UserInterface.__createLayout

__createLayout(debugServer)

Private method to create the layout of the various windows.

debugServer
  reference to the debug server object

#### UserInterface.__customViewer

__customViewer(home = None)

Private slot to start a custom viewer.

home
  full pathname of a file to display (string or QString)

#### UserInterface.__deleteScript

__deleteScript()

Private slot to delete a script.

#### UserInterface.__designer

__designer(fn = None, version = 0)

Private slot to start the Qt-Designer executable.

fn
  filename of the form to be opened
version
  indication for the requested version (Qt 3 or Qt 4) (integer)

#### UserInterface.__designer4

__designer4()

Private slot to start the Qt-Designer 4 executable.

#### UserInterface.__editorOpened

__editorOpened(fn)

Private slot to handle the editorOpened signal.

fn
  filename of the opened editor (QString)

#### UserInterface.__executeDocumentAsScript

__executeDocumentAsScript()

Private slot to handle the execute document as script menu action.

#### UserInterface.__executeScript

__executeScript()

Private slot to execute a script.

#### UserInterface.__exportShortcuts

__exportShortcuts()

Private slot to export the keyboard shortcuts.

#### UserInterface.__firstScriptAdded

__firstScriptAdded()

Private slot to handle the firstScriptAdded signal

#### UserInterface.__getFloatingGeometry

__getFloatingGeometry(w)

Private method to get the geometry of a floating windows.

w
  reference to the widget to be saved (QWidget)

Returns:
  list giving the widget's geometry and it's visibility

#### UserInterface.__helpClosed

__helpClosed()

Private slot to handle the helpClosed signal of the help window.

#### UserInterface.__helpViewer

__helpViewer()

Private slot to start an empty help viewer.

#### UserInterface.__importShortcuts

__importShortcuts()

Private slot to import the keyboard shortcuts.

#### UserInterface.__initActions

__initActions()

Private method to define the user interface actions.

#### UserInterface.__initEricDocAction

__initEricDocAction()

Private slot to initialize the action to show the eric4 documentation.

#### UserInterface.__initMenus

__initMenus()

Private slot to create the menus.

#### UserInterface.__initPythonDocAction

__initPythonDocAction()

Private slot to initilize the action to show the Python documentation.

#### UserInterface.__initQtDocActions

__initQtDocActions()

Private slot to initilize the action to show the Qt documentation.

#### UserInterface.__initStatusbar

__initStatusbar()

Private slot to set up the status bar.

#### UserInterface.__initToolbars

__initToolbars()

Private slot to create the toolbars.

#### UserInterface.__lastEditorClosed

__lastEditorClosed()

Private slot to handle the lastEditorClosed signal.

#### UserInterface.__lastScriptDeleted

__lastScriptDeleted()

Private slot to handle the lastScriptDeleted signal

#### UserInterface.__linguist

__linguist(fn = None, version = 3)

Private slot to start the Qt-Linguist executable.

fn
  filename of the translation file to be opened
version
  indication for the requested version (Qt 3 or Qt 4) (integer)

#### UserInterface.__linguist4

__linguist4(fn = None)

Private slot to start the Qt-Linguist 4 executable.

fn
  filename of the translation file to be opened

#### UserInterface.__loadScript

__loadScript()

Private slot to handle the load script menu action.

#### UserInterface.__newProject

__newProject()

Private slot to handle the NewProject signal.

#### UserInterface.__nextTab

__nextTab()

Private slot used to show the next tab.

#### UserInterface.__preferences

__preferences(pageName = None)

Private slot to set the preferences.

pageName
  name of the configuration page to show (string or QString)

#### UserInterface.__preferencesChanged

__preferencesChanged()

Private slot to handle a change of the preferences.

#### UserInterface.__prevTab

__prevTab()

Private slot used to show the previous tab.

#### UserInterface.__processToolStderr

__processToolStderr()

Private slot to handle the readyReadStderr signal of a tool process.

#### UserInterface.__processToolStdout

__processToolStdout()

Private slot to handle the readyReadStdout signal of a tool process.

#### UserInterface.__programChange

__programChange(fn)

Private slot to handle the programChange signal.

This primarily is here to set the currentProg variable.

fn
  filename to be set as current prog (QString)

#### UserInterface.__projectClosed

__projectClosed()

Private slot to handle the projectClosed signal.

#### UserInterface.__projectOpened

__projectOpened()

Private slot to handle the projectOpened signal.

#### UserInterface.__quit

__quit()

Private method to quit the application.

#### UserInterface.__readTasks

__readTasks()

Private slot to read in the tasks file (.e4t)

#### UserInterface.__reloadAPIs

__reloadAPIs()

Private slot to reload the api information.

#### UserInterface.__reportBug

__reportBug()

Private slot to handle the Report Bug dialog.

#### UserInterface.__saveCurrentViewProfile

__saveCurrentViewProfile(save)

Private slot to save the window geometries of the active profile.

save
  flag indicating that the current profile should be saved (boolean)

#### UserInterface.__setEditProfile

__setEditProfile(save = True)

Private slot to activate the edit view profile.

save
  flag indicating that the current profile should be saved (boolean)

#### UserInterface.__setStyle

__setStyle()

Private slot to set the style of the interface.

#### UserInterface.__setWindowCaption

__setWindowCaption(editor = None, project = None)

Private method to set the caption of the Main Window.

editor
  filename to be displayed (string or QString)
project
  project name to be displayed (string or QString)

#### UserInterface.__setupDockWindow

__setupDockWindow(dock, where, widget, caption)

Private method to configure the dock window created with __createDockWindow().

dock
  the dock window (QDockWindow)
where
  dock area to be docked to (Qt.DockWidgetArea)
widget
  widget to be shown in the dock window (QWidget)
caption
  caption of the dock window (string or QString)

#### UserInterface.__showChartables

__showChartables()

Private slot to show the character tables dialog.

#### UserInterface.__showEricDoc

__showEricDoc()

Private slot to show the Eric documentation.

#### UserInterface.__showExternalTools

__showExternalTools()

Private slot to display a dialog show a list of external tools used by eric4.

#### UserInterface.__showHelpMenu

__showHelpMenu()

Private slot to display the Help menu.

#### UserInterface.__showPixmap

__showPixmap(fn)

Private slot to show a pixmap in a dialog.

#### UserInterface.__showPyQt4Doc

__showPyQt4Doc()

Private slot to show the PyQt4 documentation.

#### UserInterface.__showPythonDoc

__showPythonDoc()

Private slot to show the Python documentation.

#### UserInterface.__showQt4Doc

__showQt4Doc()

Private slot to show the Qt4 documentation.

#### UserInterface.__showQtDoc

__showQtDoc()

Private slot to show the Qt documentation.

#### UserInterface.__showToolGroupsMenu

__showToolGroupsMenu()

Private slot to display the Tool Groups menu.

#### UserInterface.__showToolbarsMenu

__showToolbarsMenu()

Private slot to display the Toolbars menu.

#### UserInterface.__showToolsMenu

__showToolsMenu()

Private slot to display the Tools menu.

#### UserInterface.__showVersions

__showVersions()

Private slot to handle the Versions dialog.

#### UserInterface.__showWindowMenu

__showWindowMenu()

Private slot to display the Window menu.

#### UserInterface.__shutdown

__shutdown()

Private method to perform all neccessary steps to close down the IDE.

Returns:
  flag indicating success

#### UserInterface.__toggleBrowser

__toggleBrowser()

Private slot to handle the toggle of the File Browser window.

#### UserInterface.__toggleDebugViewer

__toggleDebugViewer()

Private slot to handle the toggle of the debug viewer.

#### UserInterface.__toggleLogViewer

__toggleLogViewer()

Private slot to handle the toggle of the Log Viewer window.

#### UserInterface.__toggleProjectBrowser

__toggleProjectBrowser()

Private slot to handle the toggle of the Project Browser window.

#### UserInterface.__toggleShell

__toggleShell()

Private slot to handle the toggle of the Shell window .

#### UserInterface.__toggleTaskViewer

__toggleTaskViewer()

Private slot to handle the toggle of the Task Viewer window.

#### UserInterface.__toggleTemplateViewer

__toggleTemplateViewer()

Private slot to handle the toggle of the Template Viewer window.

#### UserInterface.__toggleWindow

__toggleWindow(w)

Private method to toggle a workspace editor window.

w
  reference to the workspace editor window

#### UserInterface.__toolExecute

__toolExecute(act)

Private slot to execute a particular tool.

act
  reference to the action that was triggered (QAction)

#### UserInterface.__toolFinished

__toolFinished(exitCode, exitStatus)

Private slot to handle the finished signal of a tool process.

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

#### UserInterface.__toolGroupSelected

__toolGroupSelected(act)

Private slot to set the current tool group.

act
  reference to the action that was triggered (QAction)

#### UserInterface.__toolGroupsConfiguration

__toolGroupsConfiguration()

Private slot to handle the tool groups configuration menu entry.

#### UserInterface.__toolsConfiguration

__toolsConfiguration()

Private slot to handle the tools configuration menu entry.

#### UserInterface.__unittest

__unittest()

Private slot for displaying the unittest dialog.

#### UserInterface.__unittestProject

__unittestProject()

Private slot for displaying the unittest dialog and run the current project.

#### UserInterface.__unittestRestart

__unittestRestart()

Private slot to display the unittest dialog and rerun the last test.

#### UserInterface.__unittestScript

__unittestScript(prog = None)

Private slot for displaying the unittest dialog and run the current script.

prog
  the python program to be opened

#### UserInterface.__versionsDownloadCanceled

__versionsDownloadCanceled()

Private method called to cancel the version check.

#### UserInterface.__versionsDownloadDone

__versionsDownloadDone(error)

Private method called, after the versions file has been downloaded from the internet.

error
  flag indicating an error condition (boolean)

#### UserInterface.__webBrowser

__webBrowser(home = None)

Private slot to start a web browser executable.

home
  full pathname of a file to display (string or QString)

#### UserInterface.__whatsThis

__whatsThis()

Private slot called in to enter Whats This mode.

#### UserInterface.__writeTasks

__writeTasks()

Private slot to write the tasks data to an XML file (.e4t).

#### UserInterface.checkConfigurationStatus

checkConfigurationStatus()

Public method to check, if eric4 has been configured. If it is not, the configuration dialog is shown.

#### UserInterface.closeEvent

closeEvent(event)

Private event handler for the close event.

This event handler saves the preferences.

event
  close event (QCloseEvent)

#### UserInterface.dragEnterEvent

dragEnterEvent(event)

Protected method to handle the drag enter event.

event
  the drag enter event (QDragEnterEvent)

#### UserInterface.dragLeaveEvent

dragLeaveEvent(event)

Protected method to handle the drag leave event.

event
  the drag leave event (QDragLeaveEvent)

#### UserInterface.dragMoveEvent

dragMoveEvent(event)

Protected method to handle the drag move event.

event
  the drag move event (QDragMoveEvent)

#### UserInterface.dropEvent

dropEvent(event)

Protected method to handle the drop event.

event
  the drop event (QDropEvent)

#### UserInterface.getActions

getActions()

Public method to get a list of all actions.

Returns:
  list of all actions (list of E4Action)

#### UserInterface.getViewProfile

getViewProfile()

Public method to get the current view profile.

Returns:
  the name of the current view profile (string)

#### UserInterface.launchHelpViewer

launchHelpViewer(home)

Public slot to start the help viewer.

home
  filename of file to be shown

#### UserInterface.performVersionCheck

performVersionCheck(manual = True, alternative = 0)

Public method to check the internet for an eric4 update.

manual
  flag indicating an invocation via the menu (boolean)

#### UserInterface.processArgs

processArgs(args)

Public method to process the command line args passed to the UI.

args
  list of files to open
  The args are processed one at a time. All arguments after a '--' option are considered debug arguments to the program for the debugger. All files named before the '--' option are opened in a text editor, unless the argument ends in .e3p, .e3pz, .e4p or .e4pz, then it is opened as a project file.

#### UserInterface.setDebugProfile

setDebugProfile(save = True)

Public slot to activate the debug view profile.

save
  flag indicating that the current profile should be saved (boolean)

#### UserInterface.showLogTab

showLogTab(tabname)

Public method to show a particular Log-Viewer tab.

tabname
  string naming the tab to be shown (string)

Up