diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-22 12:11:22 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-22 12:49:40 +0200 |
commit | 3cd12e3671e5ee108f039cb4350bf885164a8cf5 (patch) | |
tree | 14e34395eae07ebcd7bb864754484b17558ae2b7 /gui/ice40/mainwindow.cc | |
parent | 71176ac5384c696dde1d5601ea1beb5c46f281c6 (diff) | |
download | nextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.tar.gz nextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.tar.bz2 nextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.zip |
Add ability to terminate running tasks
Diffstat (limited to 'gui/ice40/mainwindow.cc')
-rw-r--r-- | gui/ice40/mainwindow.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 934798bb..e36464a0 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -17,18 +17,24 @@ MainWindow::MainWindow(Context *_ctx, QWidget *parent) std::string title = "nextpnr-ice40 - " + ctx->getChipName();
setWindowTitle(title.c_str());
- createMenu();
-
task = new TaskManager(_ctx);
connect(task, SIGNAL(log(std::string)), this, SLOT(writeInfo(std::string)));
+
+ createMenu();
}
-MainWindow::~MainWindow() {}
+MainWindow::~MainWindow() { delete task; }
void MainWindow::createMenu()
{
QMenu *menu_Custom = new QMenu("&ICE 40", menuBar);
menuBar->addAction(menu_Custom->menuAction());
+
+ QAction *actionTerminate = new QAction("Terminate", this);
+ actionTerminate->setStatusTip("Terminate running task");
+ connect(actionTerminate, SIGNAL(triggered()), task,
+ SLOT(terminate_thread()));
+ menu_Custom->addAction(actionTerminate);
}
void MainWindow::open()
@@ -39,7 +45,7 @@ void MainWindow::open() tabWidget->setCurrentWidget(info);
std::string fn = fileName.toStdString();
- task->parsejson(fn);
+ Q_EMIT task->parsejson(fn);
}
}
bool MainWindow::save() { return false; }
\ No newline at end of file |