# eric6.Project.ProjectResourcesBrowser

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

### Global Attributes

None

### Classes

ProjectResourcesBrowser | A class used to display the resources part of the project.

### Functions

None

## ProjectResourcesBrowser

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

### Signals

appendStderr(str)
  emitted after something was received from a QProcess on stderr
showMenu(str, QMenu)
  emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given.

### Derived from

ProjectBaseBrowser

### Class Attributes

RCFilenameFormatPython
RCFilenameFormatRuby

### Class Methods

None

### Methods

ProjectResourcesBrowser | Constructor
__addResourceFiles | Private method to add resource files to the project.
__addResourcesDirectory | Private method to add resource files of a directory to the project.
__checkResourcesNewer | Private method to check, if any file referenced in a resource file is newer than a given time.
__compileAllResources | Private method to compile all resources to source files.
__compileQRC | Private method to compile a .qrc file to a .py file.
__compileQRCDone | Private slot to handle the finished signal of the compile process.
__compileResource | Private method to compile a resource to a source file.
__compileSelectedResources | Private method to compile selected resources to source files.
__configureRccCompiler | Private slot to configure some non-common rcc compiler options.
__deleteFile | Private method to delete a resource file from the project.
__newResource | Private slot to handle the New Resource menu action.
__openFile | Private slot to handle the Open menu action.
__readStderr | Private slot to handle the readyReadStandardError signal of the pyrcc4/pyrcc5/pyside-rcc/pyside2-rcc/rbrcc process.
__readStdout | Private slot to handle the readyReadStandardOutput signal of the pyrcc4/pyrcc5/pyside-rcc/pyside2-rcc/rbrcc 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.
compileChangedResources | Public method to compile all changed resources to source files.
handlePreferencesChanged | Public slot used to handle the preferencesChanged signal.

### Static Methods

None

#### ProjectResourcesBrowser (Constructor)

ProjectResourcesBrowser(project, parent=None)

Constructor

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

#### ProjectResourcesBrowser.__addResourceFiles

__addResourceFiles()

Private method to add resource files to the project.

#### ProjectResourcesBrowser.__addResourcesDirectory

__addResourcesDirectory()

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

#### ProjectResourcesBrowser.__checkResourcesNewer

__checkResourcesNewer(filename, mtime)

Private method to check, if any file referenced in a resource file is newer than a given time.

filename
  filename of the resource file (string)
mtime
  modification time to check against

Returns:
  flag indicating some file is newer (boolean)

#### ProjectResourcesBrowser.__compileAllResources

__compileAllResources()

Private method to compile all resources to source files.

#### ProjectResourcesBrowser.__compileQRC

__compileQRC(fn, noDialog=False, progress=None)

Private method to compile a .qrc file to a .py file.

fn
  filename of the .ui file to be compiled
noDialog
  flag indicating silent operations
progress
  reference to the progress dialog

Returns:
  reference to the compile process (QProcess)

#### ProjectResourcesBrowser.__compileQRCDone

__compileQRCDone(exitCode, exitStatus)

Private slot to handle the finished signal of the compile process.

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

#### ProjectResourcesBrowser.__compileResource

__compileResource()

Private method to compile a resource to a source file.

#### ProjectResourcesBrowser.__compileSelectedResources

__compileSelectedResources()

Private method to compile selected resources to source files.

#### ProjectResourcesBrowser.__configureRccCompiler

__configureRccCompiler()

Private slot to configure some non-common rcc compiler options.

#### ProjectResourcesBrowser.__deleteFile

__deleteFile()

Private method to delete a resource file from the project.

#### ProjectResourcesBrowser.__newResource

__newResource()

Private slot to handle the New Resource menu action.

#### ProjectResourcesBrowser.__openFile

__openFile()

Private slot to handle the Open menu action.

#### ProjectResourcesBrowser.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal of the pyrcc4/pyrcc5/pyside-rcc/pyside2-rcc/rbrcc process.

#### ProjectResourcesBrowser.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal of the pyrcc4/pyrcc5/pyside-rcc/pyside2-rcc/rbrcc process.

#### ProjectResourcesBrowser.__showContextMenu

__showContextMenu()

Private slot called by the menu aboutToShow signal.

#### ProjectResourcesBrowser.__showContextMenuBack

__showContextMenuBack()

Private slot called by the backMenu aboutToShow signal.

#### ProjectResourcesBrowser.__showContextMenuDir

__showContextMenuDir()

Private slot called by the dirMenu aboutToShow signal.

#### ProjectResourcesBrowser.__showContextMenuDirMulti

__showContextMenuDirMulti()

Private slot called by the dirMultiMenu aboutToShow signal.

#### ProjectResourcesBrowser.__showContextMenuMulti

__showContextMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

#### ProjectResourcesBrowser._contextMenuRequested

_contextMenuRequested(coord)

Protected slot to show the context menu.

coord
  the position of the mouse pointer (QPoint)

#### ProjectResourcesBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

#### ProjectResourcesBrowser._initHookMethods

_initHookMethods()

Protected method to initialize the hooks dictionary.

Supported hook methods are:

- compileResource: takes filename as parameter
- compileAllResources: takes list of filenames as parameter
- compileChangedResources: takes list of filenames as parameter
- compileSelectedResources: takes list of all form filenames as parameter
- newResource: takes full directory path of new file as parameter

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

#### ProjectResourcesBrowser._openItem

_openItem()

Protected slot to handle the open popup menu entry.

#### ProjectResourcesBrowser.compileChangedResources

compileChangedResources()

Public method to compile all changed resources to source files.

#### ProjectResourcesBrowser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Up