# eric7.Project.ProjectBrowser

Module implementing the project browser part of the eric UI.

### Global Attributes

None

### Classes

ProjectBrowser | Class implementing the project browser part of the eric UI.

### Functions

None

## ProjectBrowser

Class implementing the project browser part of the eric UI.

It generates a widget with up to seven tabs. The individual tabs contain the project sources browser, the project forms browser, the project resources browser, the project translations browser, the project interfaces (IDL) browser and a browser for stuff, that doesn't fit these categories. Optionally it contains an additional tab with the file system browser.

Note: The following signals are defined here to proxy the individual browser signals.

### Signals

appendStderr(str)
  emitted after something was received from a QProcess on stderr
appendStdout(str)
  emitted after something was received from a QProcess on stdout
binaryFile(filename)
  emitted to open a file as binary (str)
closeSourceWindow(str)
  emitted to close a source file
designerFile(filename)
  emitted to open a Qt-Designer file (str)
linguistFile(filename)
  emitted to open a Qt-Linguist (*.ts) file (str)
pdfFile(filename)
  emitted to open a PDF file (str)
pixmapEditFile(filename)
  emitted to edit a pixmap file (str)
pixmapFile(filename)
  emitted to open a pixmap file (str)
preferencesChanged()
  emitted when the preferences have been changed
processChangedProjectFiles()
  emitted to indicate, that changed project files should be processed
sourceFile(filename)
  emitted to open a Python file at a line (str)
sourceFile(filename, lineno)
  emitted to open a Python file at a line (str, int)
sourceFile(filename, lineno, type)
  emitted to open a Python file at a line giving an explicit file type (str, int, str)
sourceFile(filename, linenos)
  emitted to open a Python file giving a list of lines(str, list)
svgFile(filename)
  emitted to open a SVG file (str)
testFile(filename)
  emitted to open a Python file for a unit test (str)
trpreview(filenames)
  emitted to preview Qt-Linguist (*.qm) files (list of str)
trpreview(filenames, ignore)
  emitted to preview Qt-Linguist (*.qm) files indicating whether non-existent files shall be ignored (list of str, bool)
uipreview(str)
  emitted to preview a forms file
umlFile(filename)
  emitted to open an eric UML file (str)

### Derived from

EricTabWidget

### Class Attributes

None

### Class Methods

None

### Methods

ProjectBrowser | Constructor
__currentChanged | Private slot to handle the currentChanged(int) signal.
__newProject | Private slot to handle the newProject signal.
__projectClosed | Private slot to handle the projectClosed signal.
__projectOpened | Private slot to handle the projectOpened signal.
__projectPropertiesChanged | Private slot to handle the projectPropertiesChanged signal.
__setBrowsersAvailable | Private method to add selected browsers to the project browser.
__setSourcesIcon | Private method to set the right icon for the sources browser tab.
__vcsStateChanged | Private slot to handle a change in the vcs state.
__vcsStatusIndicatorClicked | Private slot to react upon clicks on the VCS indicator LED.
addTypedProjectBrowser | Public method to add a project browser type to the browser repository.
getProjectBrowser | Public method to get a reference to the project browser of given type.
getProjectBrowserFilter | Public method to get the project browser file filter for a file category.
getProjectBrowserIcon | Public method to get the icon for a project browser.
getProjectBrowserNames | Public method to get the types of the various project browsers.
getProjectBrowserType | Public method to get the project browser type for a file category.
getProjectBrowserUserStrings | Public method to get a dictionary of defined project browser user strings.
getProjectBrowsers | Public method to get references to the individual project browsers.
handleEditorChanged | Public slot to handle the editorChanged signal.
handleEditorLineChanged | Public slot to handle the editorLineChanged signal.
handlePreferencesChanged | Public slot used to handle the preferencesChanged signal.
removeTypedProjectBrowser | Public method to remove a browser type from the browsers repository.

### Static Methods

None

#### ProjectBrowser (Constructor)

ProjectBrowser(project, parent=None)

Constructor

project (Project)
  reference to the project object
parent (QWidget)
  parent widget

#### ProjectBrowser.__currentChanged

__currentChanged(index)

Private slot to handle the currentChanged(int) signal.

index (int)
  index of the tab

#### ProjectBrowser.__newProject

__newProject()

Private slot to handle the newProject signal.

#### ProjectBrowser.__projectClosed

__projectClosed()

Private slot to handle the projectClosed signal.

#### ProjectBrowser.__projectOpened

__projectOpened()

Private slot to handle the projectOpened signal.

#### ProjectBrowser.__projectPropertiesChanged

__projectPropertiesChanged()

Private slot to handle the projectPropertiesChanged signal.

#### ProjectBrowser.__setBrowsersAvailable

__setBrowsersAvailable(browsersList)

Private method to add selected browsers to the project browser.

browsersList (list of str)
  list of project browsers to be shown

#### ProjectBrowser.__setSourcesIcon

__setSourcesIcon()

Private method to set the right icon for the sources browser tab.

#### ProjectBrowser.__vcsStateChanged

__vcsStateChanged(state)

Private slot to handle a change in the vcs state.

state (str)
  new vcs state

#### ProjectBrowser.__vcsStatusIndicatorClicked

__vcsStatusIndicatorClicked(pos)

Private slot to react upon clicks on the VCS indicator LED.

pos (QPoint)
  position of the click

#### ProjectBrowser.addTypedProjectBrowser

addTypedProjectBrowser(browserType, projectBrowserItem)

Public method to add a project browser type to the browser repository.

browserType (str)
  type of the project browser
projectBrowserItem (ProjectBrowserRepositoryItem)
  data structure containing the type specific data

Raises TypeError:
  raised to signal a wrong type for the project browser item

#### ProjectBrowser.getProjectBrowser

getProjectBrowser(browserType)

Public method to get a reference to the project browser of given type.

browserType (str)
  type of the requested project browser

Return:
  reference to the requested browser or None

Return Type:
  ProjectBaseBrowser or None

#### ProjectBrowser.getProjectBrowserFilter

getProjectBrowserFilter(fileCategory)

Public method to get the project browser file filter for a file category.

fileCategory (str)
  file category

Return:
  project browser file filter

Return Type:
  str

#### ProjectBrowser.getProjectBrowserIcon

getProjectBrowserIcon(browserType)

Public method to get the icon for a project browser.

browserType (str)
  type of the project browser

Return:
  icon for the project browser

Return Type:
  QIcon

#### ProjectBrowser.getProjectBrowserNames

getProjectBrowserNames()

Public method to get the types of the various project browsers.

Return:
  list of project browser types

Return Type:
  list of str

#### ProjectBrowser.getProjectBrowserType

getProjectBrowserType(fileCategory)

Public method to get the project browser type for a file category.

fileCategory (str)
  file category

Return:
  project browser type

Return Type:
  str

#### ProjectBrowser.getProjectBrowserUserStrings

getProjectBrowserUserStrings()

Public method to get a dictionary of defined project browser user strings.

Return:
  dictionary of defined project browser user strings

Return Type:
  dict

#### ProjectBrowser.getProjectBrowsers

getProjectBrowsers()

Public method to get references to the individual project browsers.

Return:
  list of references to project browsers

Return Type:
  list of ProjectBaseBrowser

#### ProjectBrowser.handleEditorChanged

handleEditorChanged(fn)

Public slot to handle the editorChanged signal.

fn (str)
  filename of the changed file

#### ProjectBrowser.handleEditorLineChanged

handleEditorLineChanged(fn, lineno)

Public slot to handle the editorLineChanged signal.

fn (str)
  filename of the changed file
lineno (int)
  one based line number of the item

#### ProjectBrowser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

#### ProjectBrowser.removeTypedProjectBrowser

removeTypedProjectBrowser(browserType)

Public method to remove a browser type from the browsers repository.

Note: If the browser type is not contained in the repository, the request to remove it will be ignored silently.

browserType (str)
  project browser type

Up