aboutsummaryrefslogtreecommitdiffstats
path: root/gui/ice40/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ice40/mainwindow.cc')
-rw-r--r--gui/ice40/mainwindow.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc
index 3744cdc7..dafd92e9 100644
--- a/gui/ice40/mainwindow.cc
+++ b/gui/ice40/mainwindow.cc
@@ -1,5 +1,6 @@
#include "mainwindow.h"
#include <QAction>
+#include <QFileDialog>
#include <QIcon>
#include "bitstream.h"
#include "design_utils.h"
@@ -17,6 +18,10 @@ MainWindow::MainWindow(Context *_ctx, QWidget *parent)
setWindowTitle(title.c_str());
createMenu();
+
+ task = new TaskManager(_ctx);
+ connect(task, SIGNAL(log(std::string)), this,
+ SLOT(writeInfo(std::string)));
}
MainWindow::~MainWindow() {}
@@ -26,3 +31,19 @@ void MainWindow::createMenu()
QMenu *menu_Custom = new QMenu("&ICE 40", menuBar);
menuBar->addAction(menu_Custom->menuAction());
}
+
+void MainWindow::open()
+{
+ QString fileName = QFileDialog::getOpenFileName(this, QString(), QString(),
+ QString("*.json"));
+ if (!fileName.isEmpty()) {
+ tabWidget->setCurrentWidget(info);
+
+ std::string fn = fileName.toStdString();
+ task->parsejson(fn);
+ }
+}
+bool MainWindow::save()
+{
+ return false;
+} \ No newline at end of file