Refactoring: added the class GenericPanel, which provides most functions for ElementsPanel, ElementsCategoriesList, and any future panel-like widget.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1490 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-02-06 21:21:43 +00:00
parent 4adbba85df
commit 7ca84724ae
16 changed files with 1558 additions and 1150 deletions

View File

@@ -27,6 +27,7 @@
#include "qeticons.h"
#include "qetelementeditor.h"
#include "qetmessagebox.h"
#include "genericpanel.h"
/**
constructeur
@@ -967,20 +968,6 @@ void QETDiagramEditor::activateWidget(QWidget *widget) {
}
}
/**
@param project_view Projet concerne
@param from Index de l'onglet avant le deplacement
@param to Index de l'onglet apres le deplacement
*/
void QETDiagramEditor::diagramOrderChanged(ProjectView *project_view, int from, int to) {
if (!project_view) return;
QETProject *project = project_view -> project();
if (!project) return;
pa -> elementsPanel().diagramOrderChanged(project, from, to);
}
/**
Effectue l'action "couper" sur le schema en cours
*/
@@ -1252,16 +1239,10 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view) {
connect(project_view, SIGNAL(diagramRemoved(DiagramView *)), this, SLOT(diagramWasRemoved(DiagramView *)));
connect(project_view, SIGNAL(diagramRemoved(DiagramView *)), this, SLOT(slot_updateActions()));
if (QETProject *project = project_view -> project()) {
connect(project, SIGNAL(diagramAdded (QETProject *, Diagram*)), &(pa -> elementsPanel()), SLOT(diagramWasAdded (QETProject *, Diagram*)));
connect(project, SIGNAL(diagramRemoved(QETProject *, Diagram*)), &(pa -> elementsPanel()), SLOT(diagramWasRemoved(QETProject *, Diagram*)));
// 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 changements de l'ordre des schemas dans le projet
connect(project_view, SIGNAL(diagramOrderChanged(ProjectView *, int, int)), this, SLOT(diagramOrderChanged(ProjectView *, int, int)));
// gere les demandes consistant a retrouver un element dans le panel
connect(project_view, SIGNAL(findElementRequired(const ElementsLocation &)), this, SLOT(findElementInPanel(const ElementsLocation &)));
@@ -1694,7 +1675,6 @@ void QETDiagramEditor::diagramWasAdded(DiagramView *dv) {
connect(dv, SIGNAL(selectionChanged()), this, SLOT(slot_updateComplexActions()));
connect(dv, SIGNAL(modeChanged()), this, SLOT(slot_updateModeActions()));
connect(dv, SIGNAL(textAdded(bool)), add_text, SLOT(setChecked(bool)));
connect(dv, SIGNAL(titleChanged(DiagramView *, const QString &)), this, SLOT(diagramTitleChanged(DiagramView *)));
}
/**
@@ -1715,18 +1695,6 @@ void QETDiagramEditor::diagramWasRemoved(DiagramView *dv) {
can_update_actions = true;
}
/**
Gere le changement de titre d'un schema dans un projet
@param dv DiagramView concerne
*/
void QETDiagramEditor::diagramTitleChanged(DiagramView *dv) {
if (Diagram *diagram = dv -> diagram()) {
if (QETProject *project = diagram -> project()) {
pa -> elementsPanel().diagramTitleChanged(project, diagram);
}
}
}
/**
@param location Emplacement de l'element a retrouver dans le panel
d'elements.