LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ControlPanel Class Referencefinal

The ControlPanel class. More...

#include <controlpanel.h>

Inherits QMainWindow.

+ Collaboration diagram for ControlPanel:

Public Slots

void showControlPanel () noexcept
 
void openProjectLibraryUpdater (const FilePath &project) noexcept
 

Public Member Functions

 ControlPanel (workspace::Workspace &workspace)
 
 ~ControlPanel ()
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
 

Private Slots

void openProjectsPassedByCommandLine () noexcept
 
void projectEditorClosed () noexcept
 
void on_actionNew_Project_triggered ()
 
void on_actionOpen_Project_triggered ()
 
void on_actionOpen_Library_Manager_triggered ()
 
void on_actionClose_all_open_projects_triggered ()
 
void on_actionSwitch_Workspace_triggered ()
 
void on_projectTreeView_clicked (const QModelIndex &index)
 
void on_projectTreeView_doubleClicked (const QModelIndex &index)
 
void on_projectTreeView_customContextMenuRequested (const QPoint &pos)
 
void on_recentProjectsListView_entered (const QModelIndex &index)
 
void on_favoriteProjectsListView_entered (const QModelIndex &index)
 
void on_recentProjectsListView_clicked (const QModelIndex &index)
 
void on_favoriteProjectsListView_clicked (const QModelIndex &index)
 
void on_recentProjectsListView_customContextMenuRequested (const QPoint &pos)
 
void on_favoriteProjectsListView_customContextMenuRequested (const QPoint &pos)
 
void on_actionRescanLibrary_triggered ()
 

Private Member Functions

 ControlPanel ()
 
 ControlPanel (const ControlPanel &other)
 
ControlPaneloperator= (const ControlPanel &rhs)
 
void saveSettings ()
 
void loadSettings ()
 
void showProjectReadmeInBrowser (const FilePath &projectFilePath) noexcept
 
project::editor::ProjectEditornewProject (const FilePath &parentDir) noexcept
 
project::editor::ProjectEditoropenProject (project::Project &project) noexcept
 Open a project with the editor (or bring an already opened editor to front) More...
 
project::editor::ProjectEditoropenProject (const FilePath &filepath) noexcept
 Open a project with the editor (or bring an already opened editor to front) More...
 
bool closeProject (project::editor::ProjectEditor &editor, bool askForSave) noexcept
 Close an opened project editor. More...
 
bool closeProject (const FilePath &filepath, bool askForSave) noexcept
 Close an opened project editor. More...
 
bool closeAllProjects (bool askForSave) noexcept
 Close all open project editors. More...
 
project::editor::ProjectEditorgetOpenProject (const FilePath &filepath) const noexcept
 Get the pointer to an already open project editor by its project filepath. More...
 
void openLibraryEditor (QSharedPointer< library::Library > lib) noexcept
 
void libraryEditorDestroyed () noexcept
 
bool closeAllLibraryEditors (bool askForSave) noexcept
 Close all open library editors. More...
 

Private Attributes

workspace::WorkspacemWorkspace
 
QScopedPointer< Ui::ControlPanel > mUi
 
QScopedPointer
< library::manager::LibraryManager
mLibraryManager
 
QHash< QString,
project::editor::ProjectEditor * > 
mOpenProjectEditors
 
QHash< library::Library
*, library::editor::LibraryEditor * > 
mOpenLibraryEditors
 
QScopedPointer
< ProjectLibraryUpdater
mProjectLibraryUpdater
 

Friends

class ProjectLibraryUpdater
 

Detailed Description

The ControlPanel class.

Author
ubruhin
Date
2014-06-23

Constructor & Destructor Documentation

ControlPanel ( workspace::Workspace workspace)
explicit

+ Here is the call graph for this function:

ControlPanel ( )
private
ControlPanel ( const ControlPanel other)
private

Member Function Documentation

void showControlPanel ( )
slotnoexcept
void openProjectLibraryUpdater ( const FilePath project)
slotnoexcept
void closeEvent ( QCloseEvent *  event)
protectedvirtual
void openProjectsPassedByCommandLine ( )
privateslotnoexcept

+ Here is the call graph for this function:

void projectEditorClosed ( )
privateslotnoexcept

+ Here is the call graph for this function:

void on_actionNew_Project_triggered ( )
privateslot
void on_actionOpen_Project_triggered ( )
privateslot

+ Here is the call graph for this function:

void on_actionOpen_Library_Manager_triggered ( )
privateslot

+ Here is the caller graph for this function:

void on_actionClose_all_open_projects_triggered ( )
privateslot
void on_actionSwitch_Workspace_triggered ( )
privateslot

+ Here is the call graph for this function:

void on_projectTreeView_clicked ( const QModelIndex &  index)
privateslot
void on_projectTreeView_doubleClicked ( const QModelIndex &  index)
privateslot
void on_projectTreeView_customContextMenuRequested ( const QPoint &  pos)
privateslot

+ Here is the call graph for this function:

void on_recentProjectsListView_entered ( const QModelIndex &  index)
privateslot
void on_favoriteProjectsListView_entered ( const QModelIndex &  index)
privateslot
void on_recentProjectsListView_clicked ( const QModelIndex &  index)
privateslot
void on_favoriteProjectsListView_clicked ( const QModelIndex &  index)
privateslot
void on_recentProjectsListView_customContextMenuRequested ( const QPoint &  pos)
privateslot

+ Here is the call graph for this function:

void on_favoriteProjectsListView_customContextMenuRequested ( const QPoint &  pos)
privateslot

+ Here is the call graph for this function:

void on_actionRescanLibrary_triggered ( )
privateslot
ControlPanel& operator= ( const ControlPanel rhs)
private
void saveSettings ( )
private
void loadSettings ( )
private

+ Here is the call graph for this function:

void showProjectReadmeInBrowser ( const FilePath projectFilePath)
privatenoexcept

+ Here is the call graph for this function:

ProjectEditor * newProject ( const FilePath parentDir)
privatenoexcept

+ Here is the call graph for this function:

ProjectEditor * openProject ( project::Project project)
privatenoexcept

Open a project with the editor (or bring an already opened editor to front)

Parameters
projectAn already opened project (but without the editor)
Returns
The pointer to the opened project editor (nullptr on error)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ProjectEditor * openProject ( const FilePath filepath)
privatenoexcept

Open a project with the editor (or bring an already opened editor to front)

Parameters
filepathThe filepath to the *.lpp project file to open
Returns
The pointer to the opened project editor (nullptr on error)

+ Here is the call graph for this function:

bool closeProject ( project::editor::ProjectEditor editor,
bool  askForSave 
)
privatenoexcept

Close an opened project editor.

Parameters
editorThe reference to the open project editor
askForSaveIf true, the user will be asked to save the projects
Return values
trueif the project was successfully closed, false otherwise
bool closeProject ( const FilePath filepath,
bool  askForSave 
)
privatenoexcept

Close an opened project editor.

Parameters
filepathThe filepath to the *.lpp project file to close
askForSaveIf true, the user will be asked to save the projects
Return values
trueif the project was successfully closed, false otherwise
bool closeAllProjects ( bool  askForSave)
privatenoexcept

Close all open project editors.

Parameters
askForSaveIf true, the user will be asked to save all modified projects
Return values
trueif all projects successfully closed, false otherwise
ProjectEditor * getOpenProject ( const FilePath filepath) const
privatenoexcept

Get the pointer to an already open project editor by its project filepath.

This method can also be used to check whether a project (by its filepath) is already open or not.

Parameters
filepathThe filepath to a *.lpp project file
Returns
The pointer to the open project editor, or nullptr if the project is not open

+ Here is the caller graph for this function:

void openLibraryEditor ( QSharedPointer< library::Library lib)
privatenoexcept

+ Here is the call graph for this function:

void libraryEditorDestroyed ( )
privatenoexcept
bool closeAllLibraryEditors ( bool  askForSave)
privatenoexcept

Close all open library editors.

Parameters
askForSaveIf true, the user will be asked to save all modified libraries
Return values
trueif all library editors successfully closed, false otherwise

Friends And Related Function Documentation

friend class ProjectLibraryUpdater
friend

Member Data Documentation

workspace::Workspace& mWorkspace
private
QScopedPointer<Ui::ControlPanel> mUi
private
QScopedPointer<library::manager::LibraryManager> mLibraryManager
private
QHash<QString, project::editor::ProjectEditor*> mOpenProjectEditors
private
QHash<library::Library*, library::editor::LibraryEditor*> mOpenLibraryEditors
private
QScopedPointer<ProjectLibraryUpdater> mProjectLibraryUpdater
private

The documentation for this class was generated from the following files: