QETDiagramEditor : clean some code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3571 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-12-26 19:41:00 +00:00
parent f93b0817d6
commit a3525b466d
2 changed files with 245 additions and 258 deletions

View File

@@ -44,10 +44,12 @@
#include <QMessageBox> #include <QMessageBox>
/** /**
constructeur * @brief QETDiagramEditor::QETDiagramEditor
@param files Liste de fichiers a ouvrir * Constructor
@param parent le widget parent de la fenetre principale * @param files, list of files to open
* @param parent, parent widget
*/ */
QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) : QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
QETMainWindow(parent), QETMainWindow(parent),
@@ -59,10 +61,10 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
m_file_actions_group (this), m_file_actions_group (this),
open_dialog_dir (QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)) open_dialog_dir (QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))
{ {
// mise en place de l'interface MDI au centre de l'application //Setup the mdi area at center of application
setCentralWidget(&workspace); setCentralWidget(&workspace);
// nomme l'objet afin qu'il soit reperable par les feuilles de style //Set object name to be retrieved by the stylesheets
workspace.setBackground(QBrush(Qt::NoBrush)); workspace.setBackground(QBrush(Qt::NoBrush));
workspace.setObjectName("mdiarea"); workspace.setObjectName("mdiarea");
@@ -70,16 +72,11 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
workspace.setTabsClosable(true); workspace.setTabsClosable(true);
#endif #endif
// mise en place du signalmapper //Set the signal mapper
connect(&windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(activateWidget(QWidget *))); connect(&windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(activateWidget(QWidget *)));
// titre de la fenetre setWindowTitle(tr("QElectroTech", "window title"));
setWindowTitle(tr("QElectroTech", "window title"));
// icone de la fenetre
setWindowIcon(QET::Icons::QETLogo); setWindowIcon(QET::Icons::QETLogo);
// barre de statut de la fenetre
statusBar() -> showMessage(tr("QElectroTech", "status bar message")); statusBar() -> showMessage(tr("QElectroTech", "status bar message"));
setUpElementsPanel(); setUpElementsPanel();
@@ -90,38 +87,28 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
tabifyDockWidget(qdw_undo, qdw_pa); tabifyDockWidget(qdw_undo, qdw_pa);
// la fenetre est maximisee par defaut //By default the windows is maximised
setMinimumSize(QSize(500, 350)); setMinimumSize(QSize(500, 350));
setWindowState(Qt::WindowMaximized); setWindowState(Qt::WindowMaximized);
// connexions signaux / slots pour une interface sensee connect (&workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow*)));
connect (&workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(slot_updateWindowsMenu()));
connect (&workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(slot_updateUndoStack()));
connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction())); connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction()));
connect (&undo_group, SIGNAL(cleanChanged(bool)), this, SLOT(activeUndoStackCleanChanged(bool))); connect (&undo_group, SIGNAL(cleanChanged(bool)), this, SLOT(activeUndoStackCleanChanged(bool)));
// lecture des parametres
readSettings(); readSettings();
// affichage
show(); show();
// si des chemins de fichiers valides sont passes en arguments //If valid file path is given as arguments
uint opened_projects = 0; uint opened_projects = 0;
if (files.count()) { if (files.count())
// alors on ouvre ces fichiers {
foreach(QString file, files) { //So we open this files
bool project_opening = openAndAddProject(file, false); foreach(QString file, files)
if (project_opening) { if (openAndAddProject(file, false))
++ opened_projects; ++ opened_projects;
}
}
} }
slot_updateActions(); slot_updateActions();
// si aucun schema n'a ete ouvert jusqu'a maintenant, on ouvre un nouveau schema
//if (!opened_projects) newProject();
} }
/** /**
@@ -1155,38 +1142,36 @@ void QETDiagramEditor::slot_setVisualisationMode() {
} }
/** /**
gere les actions * @brief QETDiagramEditor::slot_updateActions
*/ * Manage actions
void QETDiagramEditor::slot_updateActions() { */
void QETDiagramEditor::slot_updateActions()
{
DiagramView *dv = currentDiagram(); DiagramView *dv = currentDiagram();
ProjectView *pv = currentProject(); ProjectView *pv = currentProject();
bool opened_project = pv; bool opened_project = pv;
bool opened_diagram = dv; bool opened_diagram = dv;
bool editable_project = (pv && !pv -> project() -> isReadOnly()); bool editable_project = (pv && !pv -> project() -> isReadOnly());
bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
// actions ayant juste besoin d'un document ouvert
close_file -> setEnabled(opened_project);
save_file -> setEnabled(editable_project && undo_group.activeStack()->count());
save_file_as -> setEnabled(opened_project);
prj_edit_prop -> setEnabled(opened_project);
prj_add_diagram -> setEnabled(editable_project);
//prj_add_diagram_foliolist -> setEnabled(editable_project);
prj_del_diagram -> setEnabled(editable_project);
prj_clean -> setEnabled(editable_project);
prj_diagramList -> setEnabled(opened_project);
prj_nomenclature -> setEnabled(editable_project);
export_diagram -> setEnabled(opened_diagram);
print -> setEnabled(opened_diagram);
infos_diagram -> setEnabled(opened_diagram);
prj_nomenclature -> setEnabled(editable_project);
m_zoom_actions_group.setEnabled(opened_diagram);
m_select_actions_group.setEnabled(opened_diagram);
m_add_item_actions_group.setEnabled(editable_diagram);
m_row_column_actions_group.setEnabled(editable_diagram);
close_file -> setEnabled(opened_project);
save_file_as -> setEnabled(opened_project);
prj_edit_prop -> setEnabled(opened_project);
prj_add_diagram -> setEnabled(editable_project);
prj_del_diagram -> setEnabled(editable_project);
prj_clean -> setEnabled(editable_project);
prj_diagramList -> setEnabled(opened_project);
prj_nomenclature -> setEnabled(editable_project);
export_diagram -> setEnabled(opened_diagram);
print -> setEnabled(opened_diagram);
infos_diagram -> setEnabled(opened_diagram);
prj_nomenclature -> setEnabled(editable_project);
m_zoom_actions_group. setEnabled(opened_diagram);
m_select_actions_group. setEnabled(opened_diagram);
m_add_item_actions_group. setEnabled(editable_project);
m_row_column_actions_group.setEnabled(editable_project);
slot_updateUndoStack();
slot_updateModeActions(); slot_updateModeActions();
slot_updatePasteAction(); slot_updatePasteAction();
slot_updateComplexActions(); slot_updateComplexActions();
@@ -1196,13 +1181,17 @@ void QETDiagramEditor::slot_updateActions() {
* @brief QETDiagramEditor::slot_updateUndoStack * @brief QETDiagramEditor::slot_updateUndoStack
* Update the undo stack view * Update the undo stack view
*/ */
void QETDiagramEditor::slot_updateUndoStack() { void QETDiagramEditor::slot_updateUndoStack()
{
ProjectView *pv = currentProject(); ProjectView *pv = currentProject();
if (pv) { if (pv)
{
undo_group.setActiveStack(pv->project()->undoStack()); undo_group.setActiveStack(pv->project()->undoStack());
undo -> setEnabled (undo_group.canUndo()); save_file -> setEnabled (undo_group.activeStack() -> count() && !pv -> project() -> isReadOnly());
redo -> setEnabled (undo_group.canRedo()); }
save_file -> setEnabled (undo_group.activeStack()->count() && !pv -> project() -> isReadOnly()); else
{
save_file -> setDisabled(true);
} }
} }
@@ -1308,63 +1297,46 @@ void QETDiagramEditor::slot_updatePasteAction() {
} }
/** /**
Ajoute un projet dans l'espace de travail * @brief QETDiagramEditor::addProjectView
@param project_view Le projet a ajouter dans l'espace de travail * Add a new project view to workspace and
*/ * build the connection between the projectview / project and this QETDiagramEditor.
void QETDiagramEditor::addProjectView(ProjectView *project_view) { * @param project_view, project view to add
*/
void QETDiagramEditor::addProjectView(ProjectView *project_view)
{
if (!project_view) return; if (!project_view) return;
foreach(DiagramView *dv, project_view -> diagrams())
diagramWasAdded(dv);
// on maximise la nouvelle fenetre si la fenetre en cours est inexistante ou bien maximisee //Manage the close event of project
connect(project_view, SIGNAL(projectClosed(ProjectView*)), this, SLOT(projectWasClosed(ProjectView *)));
//Manage the adding of diagram
connect(project_view, SIGNAL(diagramAdded(DiagramView *)), this, SLOT(diagramWasAdded(DiagramView *)));
if (QETProject *project = project_view -> project())
connect(project, SIGNAL(readOnlyChanged(QETProject *, bool)), this, SLOT(slot_updateActions()));
//Manage request for edit or find element and titleblock
connect(project_view, SIGNAL(findElementRequired(const ElementsLocation &)), this, SLOT(findElementInPanel(const ElementsLocation &)));
connect(project_view, SIGNAL(editElementRequired(const ElementsLocation &)), this, SLOT(editElementInEditor(const ElementsLocation &)));
connect(project_view, SIGNAL(editTitleBlockTemplate(const TitleBlockTemplateLocation &, bool)), QETApp::instance(), SLOT(openTitleBlockTemplate(TitleBlockTemplateLocation, bool)));
// display error messages sent by the project view
connect(project_view, SIGNAL(errorEncountered(QString)), this, SLOT(showError(const QString &)));
//We maximise the new window if the current window is inexistent or maximized
QWidget *current_window = workspace.activeSubWindow(); QWidget *current_window = workspace.activeSubWindow();
bool maximise = ((!current_window) || (current_window -> windowState() & Qt::WindowMaximized)); bool maximise = ((!current_window) || (current_window -> windowState() & Qt::WindowMaximized));
// ajoute la fenetre //Add the new window
QMdiSubWindow *sub_window = workspace.addSubWindow(project_view); QMdiSubWindow *sub_window = workspace.addSubWindow(project_view);
sub_window -> setWindowIcon(project_view -> windowIcon()); sub_window -> setWindowIcon(project_view -> windowIcon());
sub_window -> systemMenu() -> clear(); sub_window -> systemMenu() -> clear();
// lie les schemas du projet a l'editeur :
// quand on change de schemas a l'interieur d'un projet, on met a jour les menus
connect(project_view, SIGNAL(diagramActivated(DiagramView *)), this, SLOT(slot_updateWindowsMenu()));
connect(project_view, SIGNAL(diagramActivated(DiagramView *)), this, SLOT(slot_updateActions()));
//connect(project_view->project(), SIGNAL(projectModified(QETProject*,bool)), save_file, SLOT(setEnabled(bool)));
foreach(DiagramView *dv, project_view -> diagrams()) { //Display the new window
diagramWasAdded(dv);
}
// gere la fermeture du projet
connect(project_view, SIGNAL(projectClosed(ProjectView*)), this, SLOT(projectWasClosed(ProjectView *)));
// gere l'ajout et le retrait de schema du projet
connect(project_view, SIGNAL(diagramAdded(DiagramView *)), this, SLOT(diagramWasAdded(DiagramView *)));
connect(project_view, SIGNAL(diagramAdded(DiagramView *)), this, SLOT(slot_updateActions()));
connect(project_view, SIGNAL(diagramRemoved(DiagramView *)), this, SLOT(slot_updateActions()));
if (QETProject *project = project_view -> project()) {
// on met aussi les menus a jour quand un projet passe en lecture seule ou non
connect(project, SIGNAL(readOnlyChanged(QETProject *, bool)), this, SLOT(slot_updateActions()));
}
// gere les demandes consistant a retrouver un element dans le panel
connect(project_view, SIGNAL(findElementRequired(const ElementsLocation &)), this, SLOT(findElementInPanel(const ElementsLocation &)));
// gere les demandes pour l'edition d'un element
connect(project_view, SIGNAL(editElementRequired(const ElementsLocation &)), this, SLOT(editElementInEditor(const ElementsLocation &)));
// handles requests to edit and/or duplicate an existing title block template
connect(
project_view, SIGNAL(editTitleBlockTemplate(const TitleBlockTemplateLocation &, bool)),
QETApp::instance(), SLOT(openTitleBlockTemplate(TitleBlockTemplateLocation, bool))
);
// display error messages sent by the project view
connect(project_view, SIGNAL(errorEncountered(QString)), this, SLOT(showError(const QString &)));
// affiche la fenetre
if (maximise) project_view -> showMaximized(); if (maximise) project_view -> showMaximized();
else project_view -> show(); else project_view -> show();
slot_updateActions();
} }
/** /**
@@ -1912,14 +1884,15 @@ void QETDiagramEditor::removeDiagramFromProject() {
} }
/** /**
Gere l'ajout d'un schema dans un projet * @brief QETDiagramEditor::diagramWasAdded
@param dv DiagramView concerne * Manage the adding of diagram view in a project
*/ * @param dv, added diagram view
void QETDiagramEditor::diagramWasAdded(DiagramView *dv) { */
// quand on change qqc a l'interieur d'un schema, on met a jour les menus void QETDiagramEditor::diagramWasAdded(DiagramView *dv)
connect(dv, SIGNAL(selectionChanged()), this, SLOT(slot_updateComplexActions())); {
connect(dv, SIGNAL(modeChanged()), this, SLOT(slot_updateModeActions())); connect(dv, SIGNAL(selectionChanged()), this, SLOT(slot_updateComplexActions()));
connect(dv, SIGNAL(itemAdded()), this, SLOT(addItemFinish())); connect(dv, SIGNAL(modeChanged()), this, SLOT(slot_updateModeActions()));
connect(dv, SIGNAL(itemAdded()), this, SLOT(addItemFinish()));
} }
/** /**
@@ -2014,6 +1987,19 @@ void QETDiagramEditor::addItemFinish() {
m_add_item_actions_group.checkedAction()->setChecked(false); m_add_item_actions_group.checkedAction()->setChecked(false);
} }
/**
* @brief QETDiagramEditor::subWindowActivated
* Slot used to update menu and undo stack when subwindows of MDIarea was activated
* @param subWindows
*/
void QETDiagramEditor::subWindowActivated(QMdiSubWindow *subWindows)
{
Q_UNUSED(subWindows);
slot_updateActions();
slot_updateWindowsMenu();
}
/** /**
* @brief QETDiagramEditor::activeUndoStackCleanChanged * @brief QETDiagramEditor::activeUndoStackCleanChanged
* Enable the QAction save_file when @clean is set to false * Enable the QAction save_file when @clean is set to false

View File

@@ -79,158 +79,159 @@ class QETDiagramEditor : public QETMainWindow {
QMdiSubWindow *subWindowForWidget(QWidget *) const; QMdiSubWindow *subWindowForWidget(QWidget *) const;
public slots: public slots:
void printDialog(); void printDialog();
void exportDialog(); void exportDialog();
void save(); void save();
void saveAs(); void saveAs();
bool newProject(); bool newProject();
bool openProject(); bool openProject();
bool openRecentFile(const QString &); bool openRecentFile(const QString &);
bool closeProject(ProjectView *); bool closeProject(ProjectView *);
bool closeProject(QETProject *); bool closeProject(QETProject *);
bool closeCurrentProject(); bool closeCurrentProject();
void slot_cut(); void slot_cut();
void slot_copy(); void slot_copy();
void slot_paste(); void slot_paste();
void slot_zoomIn(); void slot_zoomIn();
void slot_zoomOut(); void slot_zoomOut();
void slot_zoomFit(); void slot_zoomFit();
void slot_zoomContent(); void slot_zoomContent();
void slot_zoomReset(); void slot_zoomReset();
void slot_selectAll(); void slot_selectAll();
void slot_selectNothing(); void slot_selectNothing();
void slot_selectInvert(); void slot_selectInvert();
void slot_delete(); void slot_delete();
void slot_rotate(); void slot_rotate();
void slot_rotateTexts(); void slot_rotateTexts();
void slot_setSelectionMode(); void slot_setSelectionMode();
void slot_setVisualisationMode(); void slot_setVisualisationMode();
void slot_updateActions(); void slot_updateActions();
void slot_updateUndoStack(); void slot_updateUndoStack();
void slot_updateModeActions(); void slot_updateModeActions();
void slot_updateComplexActions(); void slot_updateComplexActions();
void slot_updatePasteAction(); void slot_updatePasteAction();
void slot_updateWindowsMenu(); void slot_updateWindowsMenu();
void slot_addColumn(); void slot_addColumn();
void slot_removeColumn(); void slot_removeColumn();
void slot_addRow(); void slot_addRow();
void slot_removeRow(); void slot_removeRow();
void editSelectionProperties(); void editSelectionProperties();
void slot_resetConductors(); void slot_resetConductors();
void slot_addText(); void slot_addText();
void slot_addImage(); void slot_addImage();
void slot_addLine(); void slot_addLine();
void slot_addRectangle(); void slot_addRectangle();
void slot_addEllipse(); void slot_addEllipse();
void slot_addPolyline(); void slot_addPolyline();
void slot_editSelection(); void slot_editSelection();
void setWindowedMode(); void setWindowedMode();
void setTabbedMode(); void setTabbedMode();
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void activateDiagram(Diagram *); void activateDiagram(Diagram *);
void activateProject(QETProject *); void activateProject(QETProject *);
void activateProject(ProjectView *); void activateProject(ProjectView *);
void activateWidget(QWidget *); void activateWidget(QWidget *);
void projectWasClosed(ProjectView *); void projectWasClosed(ProjectView *);
void editCurrentProjectProperties(); void editCurrentProjectProperties();
void editProjectProperties(ProjectView *); void editProjectProperties(ProjectView *);
void editProjectProperties(QETProject *); void editProjectProperties(QETProject *);
void editCurrentDiagramProperties(); void editCurrentDiagramProperties();
void editDiagramProperties(DiagramView *); void editDiagramProperties(DiagramView *);
void editDiagramProperties(Diagram *); void editDiagramProperties(Diagram *);
void addDiagramToProject(); void addDiagramToProject();
void addDiagramFolioListToProject(); void addDiagramFolioListToProject();
void addDiagramToProject(QETProject *); void addDiagramToProject(QETProject *);
void removeDiagram(Diagram *); void removeDiagram(Diagram *);
void removeDiagramFromProject(); void removeDiagramFromProject();
void moveDiagramUp(Diagram *); void moveDiagramUp(Diagram *);
void moveDiagramDown(Diagram *); void moveDiagramDown(Diagram *);
void moveDiagramUpx10(Diagram *); void moveDiagramUpx10(Diagram *);
void moveDiagramDownx10(Diagram *); void moveDiagramDownx10(Diagram *);
void cleanCurrentProject(); void cleanCurrentProject();
void nomenclatureProject(); void nomenclatureProject();
void diagramWasAdded(DiagramView *); void diagramWasAdded(DiagramView *);
void findElementInPanel(const ElementsLocation &); void findElementInPanel(const ElementsLocation &);
void findSelectedElementInPanel(); void findSelectedElementInPanel();
void editElementInEditor(const ElementsLocation &); void editElementInEditor(const ElementsLocation &);
void editSelectedElementInEditor(); void editSelectedElementInEditor();
void showError(const QETResult &); void showError(const QETResult &);
void showError(const QString &); void showError(const QString &);
void addItemFinish(); void addItemFinish();
void subWindowActivated(QMdiSubWindow *subWindows);
private slots: private slots:
void activeUndoStackCleanChanged (bool clean); void activeUndoStackCleanChanged (bool clean);
// attributes // attributes
public: public:
// Actions reachable through menus within QElectroTech // Actions reachable through menus within QElectroTech
QActionGroup *grp_visu_sel; ///< Action group for visualisation vs edition mode QActionGroup *grp_visu_sel; ///< Action group for visualisation vs edition mode
QActionGroup *grp_view_mode; ///< Action group for project QActionGroup *grp_view_mode; ///< Action group for project
QAction *tabbed_view_mode; ///< Display projects as tabs QAction *tabbed_view_mode; ///< Display projects as tabs
QAction *windowed_view_mode; ///< Display projects as windows QAction *windowed_view_mode; ///< Display projects as windows
QAction *mode_selection; ///< Set edition mode QAction *mode_selection; ///< Set edition mode
QAction *mode_visualise; ///< Set visualisation mode QAction *mode_visualise; ///< Set visualisation mode
QAction *export_diagram; ///< Export diagrams of the current project as imagess QAction *export_diagram; ///< Export diagrams of the current project as imagess
QAction *print; ///< Print diagrams of the current project QAction *print; ///< Print diagrams of the current project
QAction *quit_editor; ///< Quit the diagram editor QAction *quit_editor; ///< Quit the diagram editor
QAction *undo; ///< Cancel the latest action QAction *undo; ///< Cancel the latest action
QAction *redo; ///< Redo the latest cancelled operation QAction *redo; ///< Redo the latest cancelled operation
QAction *cut; ///< Cut selection to clipboard QAction *cut; ///< Cut selection to clipboard
QAction *copy; ///< Copy selection to clipboard QAction *copy; ///< Copy selection to clipboard
QAction *paste; ///< Paste clipboard content on the current diagram QAction *paste; ///< Paste clipboard content on the current diagram
QAction *conductor_reset; ///< Reset paths of selected conductors QAction *conductor_reset; ///< Reset paths of selected conductors
QAction *conductor_default; ///< Show a dialog to edit default conductor properties QAction *conductor_default; ///< Show a dialog to edit default conductor properties
QAction *infos_diagram; ///< Show a dialog to edit diagram properties QAction *infos_diagram; ///< Show a dialog to edit diagram properties
QAction *prj_edit_prop; ///< Edit the properties of the current project. QAction *prj_edit_prop; ///< Edit the properties of the current project.
QAction *prj_add_diagram; ///< Add a diagram to the current project. QAction *prj_add_diagram; ///< Add a diagram to the current project.
QAction *prj_del_diagram; ///< Delete a diagram from the current project QAction *prj_del_diagram; ///< Delete a diagram from the current project
QAction *prj_clean; ///< Clean the content of the curent project by removing useless items QAction *prj_clean; ///< Clean the content of the curent project by removing useless items
QAction *prj_diagramList; ///< Sommaire des schemas QAction *prj_diagramList; ///< Sommaire des schemas
QAction *prj_nomenclature; ///< generate nomenclature QAction *prj_nomenclature; ///< generate nomenclature
QAction *tile_window; ///< Show MDI subwindows as tile QAction *tile_window; ///< Show MDI subwindows as tile
QAction *cascade_window; ///< Show MDI subwindows as cascade QAction *cascade_window; ///< Show MDI subwindows as cascade
QAction *prev_window; ///< Switch to the previous document QAction *prev_window; ///< Switch to the previous document
QAction *next_window; ///< Switch to the next document QAction *next_window; ///< Switch to the next document
QAction *edit_selection; ///< To edit selected item QAction *edit_selection; ///< To edit selected item
QActionGroup m_add_item_actions_group; ///Action related to adding (add text image shape...) QActionGroup m_add_item_actions_group; ///Action related to adding (add text image shape...)
QActionGroup m_zoom_actions_group; ///Action related to zoom for diagram QActionGroup m_zoom_actions_group; ///Action related to zoom for diagram
QList <QAction *> m_zoom_action_toolBar; ///Only zoom action must displayed in the toolbar QList <QAction *> m_zoom_action_toolBar; ///Only zoom action must displayed in the toolbar
QActionGroup m_select_actions_group; ///Action related to global selections QActionGroup m_select_actions_group; ///Action related to global selections
QActionGroup m_selection_actions_group; ///Action related to edit a selected item QActionGroup m_selection_actions_group; ///Action related to edit a selected item
QAction *delete_selection; ///< Delete selection QAction *delete_selection; ///< Delete selection
QAction *rotate_selection; ///< Rotate selected elements and text items by 90 degrees QAction *rotate_selection; ///< Rotate selected elements and text items by 90 degrees
QAction *rotate_texts; ///< Direct selected text items to a specific angle QAction *rotate_texts; ///< Direct selected text items to a specific angle
QAction *find_element; ///< Find the selected element in the panel QAction *find_element; ///< Find the selected element in the panel
QAction *selection_prop; ///< Show a dialog describing the selection QAction *selection_prop; ///< Show a dialog describing the selection
QActionGroup m_row_column_actions_group; /// Action related to add/remove rows/column in diagram QActionGroup m_row_column_actions_group; /// Action related to add/remove rows/column in diagram
QActionGroup m_file_actions_group; ///Actions related to file (open, close, save...) QActionGroup m_file_actions_group; ///Actions related to file (open, close, save...)
QAction *close_file; ///< Close current project file QAction *close_file; ///< Close current project file
QAction *save_file; ///< Save current project QAction *save_file; ///< Save current project
QAction *save_file_as; ///< Save current project as a specific file QAction *save_file_as; ///< Save current project as a specific file
private: private:
QMdiArea workspace; QMdiArea workspace;
QSignalMapper windowMapper; QSignalMapper windowMapper;
/// Directory to use for file dialogs such as File > save /// Directory to use for file dialogs such as File > save
QDir open_dialog_dir; QDir open_dialog_dir;
/// Dock for the elements panel /// Dock for the elements panel
QDockWidget *qdw_pa; QDockWidget *qdw_pa;
/// Dock for the undo list /// Dock for the undo list
QDockWidget *qdw_undo; QDockWidget *qdw_undo;
/// Elements panel /// Elements panel
ElementsPanelWidget *pa; ElementsPanelWidget *pa;
QMenu *windows_menu; QMenu *windows_menu;
QToolBar *main_bar; QToolBar *main_bar;
QToolBar *view_bar; QToolBar *view_bar;
QToolBar *diagram_bar; QToolBar *diagram_bar;
QToolBar *m_add_item_toolBar; QToolBar *m_add_item_toolBar;
QUndoGroup undo_group; QUndoGroup undo_group;
}; };
#endif #endif