# eric3.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.
flush | Public method used to flush the buffered data.
nWrite | Private method used to write 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.flush

flush()

Public method used to flush the buffered data.

### Redirector.nWrite

nWrite(n)

Private method used to write data.

n
  max numebr of bytes to write

### 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(string)
  emitted to write data to stderr logger
appendStdout(string)
  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
__nextTab | Private slot used to show the next tab.
__prevTab | Private slot used to show the previous tab.
activateViewProfile | Private slot to activate a view profile.
checkActions | Private slot to check some actions for their enable/disable status.
closeEvent | Private event handler for the close event.
compactPath | Private method to generate a compacted path name.
createDockWindow | Private method to create a dock window with common properties.
createLayout | Private method to create the layout of the various windows.
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.
getDebugServer | Public method to retrieve the debug server object.
getDebugger | Public method to retrieve the debugger object
getFloatingGeometry | Private function to get the geometry of a floating windows.
getProject | Public method to retrieve the project object.
getProjectBrowser | Public method to retrieve the project browser object.
getRefactoring | Public method to retrieve the refactoring object
getShell | Public method to retrieve the shell object
getTaskViewer | Public method to retrieve the taskviewer object
getTemplateViewer | Public method to retrieve the templateviewer object
getViewManager | Public method to retrieve the viewmanager object.
getViewProfile | Public method to get the current view profile.
getWizards | Public method to retrieve the wizards object
handleAbout | Private slot to handle the About dialog.
handleAboutKde | Private slot to handle the About KDE dialog.
handleAboutQt | Private slot to handle the About Qt dialog.
handleAssistant | Private slot to start the Qt-Assistant executable.
handleAssistant4 | Private slot to start the Qt-Assistant 4 executable.
handleBrowser | Private slot to handle the toggle of the File Browser window.
handleBrowserActivate | Private slot to handle the activation of the file browser.
handleCHM | Private slot to start the win32 help viewer to show *.chm files.
handleCompareFiles | Private slot to handle the Compare Files dialog.
handleCompareFilesSbs | Private slot to handle the Compare Files dialog.
handleConfigShortcuts | Private slot to configure the keyboard shortcuts.
handleConfigViewProfiles | Private method to configure the various view profiles.
handleCustomViewer | Private slot to start a custom viewer.
handleDeleteScript | Public method to delete a script.
handleDesigner | Private slot to start the Qt-Designer executable.
handleDesigner4 | Private slot to start the Qt-Designer 4 executable.
handleEditorOpened | Public slot to handle the editorOpened signal.
handleEricDoc | Private slot to show the Eric documentation.
handleExecuteDocumentAsScript | Private slot to handle the execute document as script menu action.
handleExecuteScript | Public method to execute a script.
handleExportShortcuts | Private slot to export the keyboard shortcuts.
handleFirstScriptAdded | Private slot to handle the firstScriptAdded signal
handleHelpViewer | Private slot to start an empty help viewer.
handleImportShortcuts | Private slot to import the keyboard shortcuts.
handleLastEditorClosed | Public slot to handle the lastEditorClosed signal.
handleLastScriptDeleted | Private slot to handle the lastScriptDeleted signal
handleLineUpTBs | Private slot to handle the line up toolbars menu entry.
handleLinguist | Private slot to start the Qt-Linguist executable.
handleLinguist4 | Private slot to start the Qt-Linguist 4 executable.
handleLoadScript | Private slot to handle the load script menu action.
handleLogViewer | Private slot to handle the toggle of the Log Viewer window.
handleLogViewerActivate | Private slot to handle the activation of the Log Viewer.
handleNewProject | Public slot to handle the NewProject signal.
handlePixmap | Private slot to show a pixmap in a dialog.
handlePreferences | Private slot to set the preferences.
handlePreferencesChanged | Private method to handle a change of the preferences.
handleProgramChange | Public slot to handle the programChange signal.
handleProjectBrowser | Private slot to handle the toggle of the Project Browser window.
handleProjectBrowserActivate | Private slot to handle the activation of the project browser.
handleProjectClosed | Public slot to handle the projectClosed signal.
handleProjectOpened | Public slot to handle the projectOpened signal.
handlePythonDoc | Private slot to show the Python documentation.
handleQt4Doc | Private slot to show the Qt4 documentation.
handleQtDoc | Private slot to show the Qt documentation.
handleQuit | Private method to quit the application.
handleReloadAPIs | Public slot to reload the api information.
handleReportBug | Private slot to handle the Report Bug dialog.
handleSBV | Private slot to handle the toggle of the Shell/Browser/Variables window.
handleSBVActivate | Private slot to handle the activation of the debug browser.
handleSetDebugProfile | Public slot to activate the debug view profile.
handleSetEditProfile | Public slot to activate the edit view profile.
handleShell | Private slot to handle the toggle of the Shell window .
handleShellActivate | Private slot to handle the activation of the Shell window.
handleShowToolbarsMenu | Private slot to display the Toolbars menu.
handleShowToolsMenu | Private slot to display the Tools menu.
handleShowWindowMenu | Private slot to display the Window menu.
handleTBMenu | Private method to handle the toggle of a toolbar.
handleTRPreviewer | Private slot to start the Translation Previewer executable.
handleTaskViewer | Private slot to handle the toggle of the Task Viewer window.
handleTaskViewerActivate | Private slot to handle the activation of the Task Viewer.
handleTemplateViewer | Private slot to handle the toggle of the Template Viewer window.
handleTemplateViewerActivate | Private slot to handle the activation of the Template Viewer.
handleToolExecute | Private slot to execute a particular tool.
handleToolExited | Private slot to handle the processExited signal of a tool process.
handleToolStderr | Private slot to handle the readyReadStderr signal of a tool process.
handleToolStdout | Private slot to handle the readyReadStdout signal of a tool process.
handleToolsConfiguration | Private slot to handle the tools configuration menu entry.
handleUIPreviewer | Private slot to start the UI Previewer executable.
handleUnittest | Private slot for displaying the unittest dialog.
handleUnittestProject | Private slot for displaying the unittest dialog and run the current project.
handleUnittestRestart | Private slot to display the unittest dialog and rerun the last test.
handleUnittestScript | Private slot for displaying the unittest dialog and run the current script.
handleVersions | Private slot to handle the Versions dialog.
handleViewmanagerActivate | Private slot to handle the activation of the current editor.
handleWebBrowser | Private slot to start a web browser executable.
initActions | Private method to define the user interface actions.
initEricDocAction | Private slot to initialize the action to show the eric3 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.
launchHelpViewer | Private slot to start the help viewer.
processArgs | Public method to process the command line args passed to the UI.
readTasks | Private method to read in the tasks file (.e3t)
readTemplates | Public method to read in the templates file (.e3c)
setWindowCaption | Private method to set the caption of the Main Window.
setupDockWindow | Private method to configure the dock window created with createDockWindow().
showLogTab | Public method to show a particular Log-Viewer tab.
shutdown | Private method to perform all neccessary steps to close down the IDE.
sizeLayout | Private method to setup the layout of the various windows.
toggleWindow | Private method to toggle a workspace editor window.
writeTasks | Public method to write the tasks data to an XML file (.e3t).
writeTemplates | Public method to write the templates data to an XML file (.e3c).

### UserInterface (Constructor)

UserInterface(loc, splash)

Constructor

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

### UserInterface.__nextTab

__nextTab()

Private slot used to show the next tab.

### UserInterface.__prevTab

__prevTab()

Private slot used to show the previous tab.

### UserInterface.activateViewProfile

activateViewProfile(name, save = 1)

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.checkActions

checkActions(editor)

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

editor
  editor window

### UserInterface.closeEvent

closeEvent(event)

Private event handler for the close event.

This event handler saves the preferences.

event
  close event (QCloseEvent)

### UserInterface.compactPath

compactPath(path)

Private method to generate a compacted path name.

path
  path name to be compacted (string or QString)

Returns:
  compacted path name (string)

### UserInterface.createDockWindow

createDockWindow()

Private method to create a dock window with common properties.

Returns:
  the generated dock window (QDockWindow)

### UserInterface.createLayout

createLayout(dbs)

Private method to create the layout of the various windows.

dbs
  reference to the debug server object

### 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 E3Action)

### UserInterface.getDebugServer

getDebugServer()

Public method to retrieve the debug server object.

Returns:
  reference to the debug server object

### UserInterface.getDebugger

getDebugger()

Public method to retrieve the debugger object

Returns:
  reference to the debug UI object

### UserInterface.getFloatingGeometry

getFloatingGeometry(w)

Private function to get the geometry of a floating windows.

This function handles the upper left corner differently on win32 systems.

w
  reference to the widget to be saved (QWidget)

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

### UserInterface.getProject

getProject()

Public method to retrieve the project object.

Returns:
  reference to the project object

### UserInterface.getProjectBrowser

getProjectBrowser()

Public method to retrieve the project browser object.

Returns:
  reference to the project browser object

### UserInterface.getRefactoring

getRefactoring()

Public method to retrieve the refactoring object

Returns:
  reference to the refactoring object

### UserInterface.getShell

getShell()

Public method to retrieve the shell object

Returns:
  reference to the shell object

### UserInterface.getTaskViewer

getTaskViewer()

Public method to retrieve the taskviewer object

Returns:
  reference to the taskviewer object

### UserInterface.getTemplateViewer

getTemplateViewer()

Public method to retrieve the templateviewer object

Returns:
  reference to the templateviewer object

### UserInterface.getViewManager

getViewManager()

Public method to retrieve the viewmanager object.

Returns:
  reference to the viewmanager object

### UserInterface.getViewProfile

getViewProfile()

Public method to get the current view profile.

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

### UserInterface.getWizards

getWizards()

Public method to retrieve the wizards object

Returns:
  reference to the wizards object

### UserInterface.handleAbout

handleAbout()

Private slot to handle the About dialog.

### UserInterface.handleAboutKde

handleAboutKde()

Private slot to handle the About KDE dialog.

### UserInterface.handleAboutQt

handleAboutQt()

Private slot to handle the About Qt dialog.

### UserInterface.handleAssistant

handleAssistant(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.handleAssistant4

handleAssistant4()

Private slot to start the Qt-Assistant 4 executable.

### UserInterface.handleBrowser

handleBrowser()

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

### UserInterface.handleBrowserActivate

handleBrowserActivate()

Private slot to handle the activation of the file browser.

### UserInterface.handleCHM

handleCHM(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.handleCompareFiles

handleCompareFiles()

Private slot to handle the Compare Files dialog.

### UserInterface.handleCompareFilesSbs

handleCompareFilesSbs()

Private slot to handle the Compare Files dialog.

### UserInterface.handleConfigShortcuts

handleConfigShortcuts()

Private slot to configure the keyboard shortcuts.

### UserInterface.handleConfigViewProfiles

handleConfigViewProfiles()

Private method to configure the various view profiles.

### UserInterface.handleCustomViewer

handleCustomViewer(home=None)

Private slot to start a custom viewer.

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

### UserInterface.handleDeleteScript

handleDeleteScript()

Public method to delete a script.

### UserInterface.handleDesigner

handleDesigner(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.handleDesigner4

handleDesigner4()

Private slot to start the Qt-Designer 4 executable.

### UserInterface.handleEditorOpened

handleEditorOpened(fn)

Public slot to handle the editorOpened signal.

fn
  filename of the opened editor (string)

### UserInterface.handleEricDoc

handleEricDoc()

Private slot to show the Eric documentation.

### UserInterface.handleExecuteDocumentAsScript

handleExecuteDocumentAsScript()

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

### UserInterface.handleExecuteScript

handleExecuteScript()

Public method to execute a script.

### UserInterface.handleExportShortcuts

handleExportShortcuts()

Private slot to export the keyboard shortcuts.

### UserInterface.handleFirstScriptAdded

handleFirstScriptAdded()

Private slot to handle the firstScriptAdded signal

### UserInterface.handleHelpViewer

handleHelpViewer()

Private slot to start an empty help viewer.

### UserInterface.handleImportShortcuts

handleImportShortcuts()

Private slot to import the keyboard shortcuts.

### UserInterface.handleLastEditorClosed

handleLastEditorClosed()

Public slot to handle the lastEditorClosed signal.

### UserInterface.handleLastScriptDeleted

handleLastScriptDeleted()

Private slot to handle the lastScriptDeleted signal

### UserInterface.handleLineUpTBs

handleLineUpTBs()

Private slot to handle the line up toolbars menu entry.

### UserInterface.handleLinguist

handleLinguist(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.handleLinguist4

handleLinguist4()

Private slot to start the Qt-Linguist 4 executable.

### UserInterface.handleLoadScript

handleLoadScript()

Private slot to handle the load script menu action.

### UserInterface.handleLogViewer

handleLogViewer()

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

### UserInterface.handleLogViewerActivate

handleLogViewerActivate()

Private slot to handle the activation of the Log Viewer.

### UserInterface.handleNewProject

handleNewProject()

Public slot to handle the NewProject signal.

### UserInterface.handlePixmap

handlePixmap(fn)

Private slot to show a pixmap in a dialog.

### UserInterface.handlePreferences

handlePreferences()

Private slot to set the preferences.

### UserInterface.handlePreferencesChanged

handlePreferencesChanged()

Private method to handle a change of the preferences.

### UserInterface.handleProgramChange

handleProgramChange(fn)

Public slot to handle the programChange signal.

This primarily is here to set the currentProg variable.

fn
  filename to be set as current prog (string)

### UserInterface.handleProjectBrowser

handleProjectBrowser()

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

### UserInterface.handleProjectBrowserActivate

handleProjectBrowserActivate()

Private slot to handle the activation of the project browser.

### UserInterface.handleProjectClosed

handleProjectClosed()

Public slot to handle the projectClosed signal.

### UserInterface.handleProjectOpened

handleProjectOpened()

Public slot to handle the projectOpened signal.

### UserInterface.handlePythonDoc

handlePythonDoc()

Private slot to show the Python documentation.

### UserInterface.handleQt4Doc

handleQt4Doc()

Private slot to show the Qt4 documentation.

### UserInterface.handleQtDoc

handleQtDoc()

Private slot to show the Qt documentation.

### UserInterface.handleQuit

handleQuit()

Private method to quit the application.

### UserInterface.handleReloadAPIs

handleReloadAPIs()

Public slot to reload the api information.

### UserInterface.handleReportBug

handleReportBug()

Private slot to handle the Report Bug dialog.

### UserInterface.handleSBV

handleSBV()

Private slot to handle the toggle of the Shell/Browser/Variables window.

### UserInterface.handleSBVActivate

handleSBVActivate()

Private slot to handle the activation of the debug browser.

### UserInterface.handleSetDebugProfile

handleSetDebugProfile(save = 1)

Public slot to activate the debug view profile.

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

### UserInterface.handleSetEditProfile

handleSetEditProfile(save = 1)

Public slot to activate the edit view profile.

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

### UserInterface.handleShell

handleShell()

Private slot to handle the toggle of the Shell window .

### UserInterface.handleShellActivate

handleShellActivate()

Private slot to handle the activation of the Shell window.

### UserInterface.handleShowToolbarsMenu

handleShowToolbarsMenu()

Private slot to display the Toolbars menu.

### UserInterface.handleShowToolsMenu

handleShowToolsMenu()

Private slot to display the Tools menu.

### UserInterface.handleShowWindowMenu

handleShowWindowMenu()

Private slot to display the Window menu.

### UserInterface.handleTBMenu

handleTBMenu(idx)

Private method to handle the toggle of a toolbar.

idx
  index of the selected toolbar (integer)

### UserInterface.handleTRPreviewer

handleTRPreviewer(fileNames=None)

Private slot to start the Translation Previewer executable.

fileNames
  filenames of forms and/or translations to be previewed

### UserInterface.handleTaskViewer

handleTaskViewer()

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

### UserInterface.handleTaskViewerActivate

handleTaskViewerActivate()

Private slot to handle the activation of the Task Viewer.

### UserInterface.handleTemplateViewer

handleTemplateViewer()

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

### UserInterface.handleTemplateViewerActivate

handleTemplateViewerActivate()

Private slot to handle the activation of the Template Viewer.

### UserInterface.handleToolExecute

handleToolExecute(idx)

Private slot to execute a particular tool.

idx
  index into the list of configured tools

### UserInterface.handleToolExited

handleToolExited()

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

### UserInterface.handleToolStderr

handleToolStderr()

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

### UserInterface.handleToolStdout

handleToolStdout()

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

### UserInterface.handleToolsConfiguration

handleToolsConfiguration()

Private slot to handle the tools configuration menu entry.

### UserInterface.handleUIPreviewer

handleUIPreviewer(fn=None)

Private slot to start the UI Previewer executable.

fn
  filename of the form to be previewed

### UserInterface.handleUnittest

handleUnittest()

Private slot for displaying the unittest dialog.

### UserInterface.handleUnittestProject

handleUnittestProject()

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

### UserInterface.handleUnittestRestart

handleUnittestRestart()

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

### UserInterface.handleUnittestScript

handleUnittestScript(prog = None)

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

prog
  the python program to be opened

### UserInterface.handleVersions

handleVersions()

Private slot to handle the Versions dialog.

### UserInterface.handleViewmanagerActivate

handleViewmanagerActivate()

Private slot to handle the activation of the current editor.

### UserInterface.handleWebBrowser

handleWebBrowser(home=None)

Private slot to start a web browser executable.

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

### UserInterface.initActions

initActions()

Private method to define the user interface actions.

### UserInterface.initEricDocAction

initEricDocAction()

Private slot to initialize the action to show the eric3 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.launchHelpViewer

launchHelpViewer(home)

Private slot to start the help viewer.

home
  filename of to be shown

### 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 or .e3pz, then it is opened as a project file.

### UserInterface.readTasks

readTasks()

Private method to read in the tasks file (.e3t)

### UserInterface.readTemplates

readTemplates(filename=None)

Public method to read in the templates file (.e3c)

filename
  name of a templates file to read (string or QString)

### 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 (QDockArea)
widget
  widget to be shown in the dock window (QWidget)
caption
  caption of the dock window (string or QString)

### UserInterface.showLogTab

showLogTab(tabname)

Public method to show a particular Log-Viewer tab.

tabname
  string naming the tab to be shown (string)

### UserInterface.shutdown

shutdown()

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

Returns:
  flag indicating success

### UserInterface.sizeLayout

sizeLayout()

Private method to setup the layout of the various windows.

### UserInterface.toggleWindow

toggleWindow(w)

Private method to toggle a workspace editor window.

w
  reference to the workspace editor window

### UserInterface.writeTasks

writeTasks()

Public method to write the tasks data to an XML file (.e3t).

### UserInterface.writeTemplates

writeTemplates(filename=None)

Public method to write the templates data to an XML file (.e3c).

filename
  name of a templates file to read (string or QString)

Up