From e9d45a507a7355af2ae55db36e676bbd8e9e60c7 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Thu, 17 Sep 2015 16:48:05 +0200 Subject: [PATCH] ui: project settings fix * fixed open folder dialog in project settings. * changed foreign key relation of component_access from the element to the edge table. --- src/app/qt/element/QtDirectoryListBox.cpp | 3 +++ src/app/qt/window/QtProjectSetupScreen.cpp | 2 -- src/lib/data/SqliteStorage.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/qt/element/QtDirectoryListBox.cpp b/src/app/qt/element/QtDirectoryListBox.cpp index 9db453bb..2bd52511 100644 --- a/src/app/qt/element/QtDirectoryListBox.cpp +++ b/src/app/qt/element/QtDirectoryListBox.cpp @@ -52,6 +52,9 @@ void QtListItemWidget::handleButtonPress() { QFileDialog dialog(this); QListView *l = dialog.findChild("listView"); + + dialog.setFileMode(QFileDialog::Directory); + if (l) { l->setSelectionMode(QAbstractItemView::SingleSelection); diff --git a/src/app/qt/window/QtProjectSetupScreen.cpp b/src/app/qt/window/QtProjectSetupScreen.cpp index 0166ee85..fdf0d02c 100644 --- a/src/app/qt/window/QtProjectSetupScreen.cpp +++ b/src/app/qt/window/QtProjectSetupScreen.cpp @@ -24,7 +24,6 @@ QtTextLine::QtTextLine(QWidget *parent) m_data = new QtLineEdit(this); m_data->setAttribute(Qt::WA_MacShowFocusRect, 0); m_data->setObjectName("locationField"); - m_data->setReadOnly(true); m_button = new QPushButton("..."); m_button->setObjectName("moreButton"); @@ -33,7 +32,6 @@ QtTextLine::QtTextLine(QWidget *parent) layout->addWidget(m_button); connect(m_button, SIGNAL(clicked()), this, SLOT(handleButtonPress())); - connect(m_data, SIGNAL(focus()), this, SLOT(handleButtonPress())); } QString QtTextLine::getText() diff --git a/src/lib/data/SqliteStorage.cpp b/src/lib/data/SqliteStorage.cpp index 92d24ed2..6a4f5a9a 100644 --- a/src/lib/data/SqliteStorage.cpp +++ b/src/lib/data/SqliteStorage.cpp @@ -707,7 +707,7 @@ void SqliteStorage::setupTables() "edge_id INTEGER, " "type INTEGER NOT NULL, " "PRIMARY KEY(id), " - "FOREIGN KEY(edge_id) REFERENCES element(id) ON DELETE CASCADE);" + "FOREIGN KEY(edge_id) REFERENCES edge(id) ON DELETE CASCADE);" ); }