mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 08:40:53 +01:00
Double clicking on a title block template now opens a dedicated editor.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1414 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -842,6 +842,10 @@ void ElementsPanel::slot_doubleClick(QTreeWidgetItem *qtwi, int) {
|
|||||||
emit(requestForDiagram(diagram));
|
emit(requestForDiagram(diagram));
|
||||||
} else if (ElementsCollectionItem *item = collectionItemForItem(qtwi)) {
|
} else if (ElementsCollectionItem *item = collectionItemForItem(qtwi)) {
|
||||||
emit(requestForCollectionItem(item));
|
emit(requestForCollectionItem(item));
|
||||||
|
} else if (itemIsATitleBlockTemplate(qtwi)) {
|
||||||
|
if (QETProject *project = projectForTitleBlockTemplate(qtwi)) {
|
||||||
|
emit(requestForTitleBlockTemplate(project, nameOfTitleBlockTemplate(qtwi)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class ElementsPanel : public QTreeWidget {
|
|||||||
void requestForDiagram(Diagram *);
|
void requestForDiagram(Diagram *);
|
||||||
void requestForCollectionItem(ElementsCollectionItem *);
|
void requestForCollectionItem(ElementsCollectionItem *);
|
||||||
void requestForMoveElements(ElementsCollectionItem *, ElementsCollectionItem *, QPoint);
|
void requestForMoveElements(ElementsCollectionItem *, ElementsCollectionItem *, QPoint);
|
||||||
|
void requestForTitleBlockTemplate(QETProject *, const QString &);
|
||||||
void readingAboutToBegin();
|
void readingAboutToBegin();
|
||||||
void readingFinished();
|
void readingFinished();
|
||||||
void loadingProgressed(int, int);
|
void loadingProgressed(int, int);
|
||||||
|
|||||||
@@ -128,6 +128,12 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
|||||||
SLOT(handleMoveElementsRequest(ElementsCollectionItem *, ElementsCollectionItem *, const QPoint &)),
|
SLOT(handleMoveElementsRequest(ElementsCollectionItem *, ElementsCollectionItem *, const QPoint &)),
|
||||||
Qt::QueuedConnection
|
Qt::QueuedConnection
|
||||||
);
|
);
|
||||||
|
connect(
|
||||||
|
elements_panel,
|
||||||
|
SIGNAL(requestForTitleBlockTemplate(QETProject *, const QString &)),
|
||||||
|
QETApp::instance(),
|
||||||
|
SLOT(openTitleBlockTemplate(QETProject *, const QString &))
|
||||||
|
);
|
||||||
connect(elements_panel, SIGNAL(loadingProgressed(int, int)), this, SLOT(updateProgressBar(int, int)));
|
connect(elements_panel, SIGNAL(loadingProgressed(int, int)), this, SLOT(updateProgressBar(int, int)));
|
||||||
connect(elements_panel, SIGNAL(readingAboutToBegin()), this, SLOT(collectionsRead()));
|
connect(elements_panel, SIGNAL(readingAboutToBegin()), this, SLOT(collectionsRead()));
|
||||||
connect(elements_panel, SIGNAL(readingFinished()), this, SLOT(collectionsReadFinished()));
|
connect(elements_panel, SIGNAL(readingFinished()), this, SLOT(collectionsReadFinished()));
|
||||||
@@ -377,7 +383,6 @@ void ElementsPanelWidget::updateButtons() {
|
|||||||
setElementsActionEnabled(false);
|
setElementsActionEnabled(false);
|
||||||
} else if (elements_panel -> selectedItemIsATitleBlockTemplate()) {
|
} else if (elements_panel -> selectedItemIsATitleBlockTemplate()) {
|
||||||
bool is_writable = !(elements_panel -> projectForTitleBlockTemplate(elements_panel -> currentItem()) -> isReadOnly());
|
bool is_writable = !(elements_panel -> projectForTitleBlockTemplate(elements_panel -> currentItem()) -> isReadOnly());
|
||||||
tbt_add -> setEnabled(is_writable);
|
|
||||||
tbt_edit -> setEnabled(is_writable);
|
tbt_edit -> setEnabled(is_writable);
|
||||||
tbt_remove -> setEnabled(is_writable);
|
tbt_remove -> setEnabled(is_writable);
|
||||||
setElementsActionEnabled(false);
|
setElementsActionEnabled(false);
|
||||||
@@ -469,7 +474,6 @@ void ElementsPanelWidget::handleContextMenu(const QPoint &pos) {
|
|||||||
} else if (elements_panel -> itemIsATitleBlockTemplatesDirectory(item)) {
|
} else if (elements_panel -> itemIsATitleBlockTemplatesDirectory(item)) {
|
||||||
context_menu -> addAction(tbt_add);
|
context_menu -> addAction(tbt_add);
|
||||||
} else if (elements_panel -> itemIsATitleBlockTemplate(item)) {
|
} else if (elements_panel -> itemIsATitleBlockTemplate(item)) {
|
||||||
context_menu -> addAction(tbt_add);
|
|
||||||
context_menu -> addAction(tbt_edit);
|
context_menu -> addAction(tbt_edit);
|
||||||
context_menu -> addAction(tbt_remove);
|
context_menu -> addAction(tbt_remove);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user