Fixed schema generation
This commit is contained in:
1 parent
9b7ede933a
commit
1ec8b10ef5
7 files changed
+196
-20
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include "name_dialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "application.h"
|
||||
#include "single_automatic_dialog.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QLine>
|
||||
@@ -225,6 +226,8 @@ namespace display {
|
||||
connection), component(component), bus(bus) {
|
||||
updateConnection();
|
||||
|
||||
setCursor(Qt::CrossCursor);
|
||||
|
||||
setHandlesChildEvents(false);
|
||||
}
|
||||
|
||||
@@ -249,23 +252,35 @@ namespace display {
|
||||
QMenu menu;
|
||||
menu.addAction("Ukloni poveznicu", [this]() {});
|
||||
menu.addSeparator();
|
||||
for (int i = 0; i < this->connection->attributes.size(); i++) {
|
||||
auto *attr = &this->connection->attributes[i];
|
||||
bool enabled = attr->attribute.getPopup().has_value();
|
||||
|
||||
auto action = menu.addAction(QString::fromStdString("Izmjeni " + attr->name),
|
||||
[attr]() {
|
||||
auto dialog = new AttributeDialog(attr);
|
||||
dialog->exec();
|
||||
});
|
||||
action->setEnabled(enabled);
|
||||
if(connection->bus->bus.getType() == domain::Bus::SINGLE_AUTOMATIC) {
|
||||
auto &attributes = this->connection->attributes;
|
||||
menu.addAction(QString::fromStdString("Izmjeni poveznicu"),
|
||||
[&attributes]() {
|
||||
auto dialog = new display::SingleAutomaticDialog(attributes);
|
||||
dialog->exec();
|
||||
});
|
||||
} else {
|
||||
for (int i = 0; i < this->connection->attributes.size(); i++) {
|
||||
auto *attr = &this->connection->attributes[i];
|
||||
bool enabled = attr->attribute.getPopup().has_value();
|
||||
|
||||
auto action = menu.addAction(QString::fromStdString("Izmjeni " + attr->name),
|
||||
[attr]() {
|
||||
auto dialog = new AttributeDialog(attr);
|
||||
dialog->exec();
|
||||
});
|
||||
action->setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
menu.exec(event->screenPos());
|
||||
}
|
||||
|
||||
DirectConnection::DirectConnection(domain::DirectConnectionInstance *connection, ComponentGroup *first,
|
||||
ComponentGroup *second): connection(connection), first(first), second(second) {
|
||||
updateConnection();
|
||||
setCursor(Qt::CrossCursor);
|
||||
setHandlesChildEvents(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user