aboutsummaryrefslogtreecommitdiffstats
path: root/gui/basewindow.cc
diff options
context:
space:
mode:
authorSerge Bazanski <serge@bazanski.pl>2018-07-15 21:57:42 +0100
committerSerge Bazanski <serge@bazanski.pl>2018-07-15 21:57:42 +0100
commitf3c6c76fff90d89dd65af2c02124c098dab63892 (patch)
tree48aad4eb072d9972a5a1c298c9fde7922038d74d /gui/basewindow.cc
parent91db413c60c965b6b7cc095f53c8d03a1658566e (diff)
parent5531546d6bcf188c27449b6256108c6c722b5b5b (diff)
downloadnextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.tar.gz
nextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.tar.bz2
nextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/lock-2-electric-boogaloo
Diffstat (limited to 'gui/basewindow.cc')
-rw-r--r--gui/basewindow.cc44
1 files changed, 33 insertions, 11 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index 0c7632ee..07b71105 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -18,6 +18,7 @@
*/
#include <QAction>
+#include <QCoreApplication>
#include <QFileDialog>
#include <QGridLayout>
#include <QIcon>
@@ -61,15 +62,10 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
setCentralWidget(centralWidget);
- DesignWidget *designview = new DesignWidget();
+ designview = new DesignWidget();
designview->setMinimumWidth(300);
splitter_h->addWidget(designview);
- connect(this, SIGNAL(contextChanged(Context *)), designview, SLOT(newContext(Context *)));
- connect(this, SIGNAL(updateTreeView()), designview, SLOT(updateTree()));
-
- connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string)));
-
tabWidget = new QTabWidget();
console = new PythonTab();
@@ -81,38 +77,64 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
centralTabWidget->addTab(fpgaView, "Graphics");
connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *)));
- connect(designview, SIGNAL(selected(std::vector<DecalXY>)), fpgaView, SLOT(onSelectedArchItem(std::vector<DecalXY>)));
+ connect(designview, SIGNAL(selected(std::vector<DecalXY>)), fpgaView,
+ SLOT(onSelectedArchItem(std::vector<DecalXY>)));
+
+ connect(designview, SIGNAL(highlight(std::vector<DecalXY>, int)), fpgaView,
+ SLOT(onHighlightGroupChanged(std::vector<DecalXY>, int)));
+
+ connect(this, SIGNAL(contextChanged(Context *)), designview, SLOT(newContext(Context *)));
+ connect(this, SIGNAL(updateTreeView()), designview, SLOT(updateTree()));
+
+ connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string)));
splitter_v->addWidget(centralTabWidget);
splitter_v->addWidget(tabWidget);
+ displaySplash();
}
BaseMainWindow::~BaseMainWindow() {}
+void BaseMainWindow::displaySplash()
+{
+ splash = new QSplashScreen();
+ splash->setPixmap(QPixmap(":/icons/resources/splash.png"));
+ splash->show();
+ connect(designview, SIGNAL(finishContextLoad()), splash, SLOT(close()));
+ connect(designview, SIGNAL(contextLoadStatus(std::string)), this, SLOT(displaySplashMessage(std::string)));
+ QCoreApplication::instance()->processEvents();
+}
+
+void BaseMainWindow::displaySplashMessage(std::string msg)
+{
+ splash->showMessage(msg.c_str(), Qt::AlignCenter | Qt::AlignBottom, Qt::white);
+ QCoreApplication::instance()->processEvents();
+}
+
void BaseMainWindow::writeInfo(std::string text) { console->info(text); }
void BaseMainWindow::createMenusAndBars()
{
- actionNew = new QAction("New", this);
+ actionNew = new QAction("New", this);
actionNew->setIcon(QIcon(":/icons/resources/new.png"));
actionNew->setShortcuts(QKeySequence::New);
actionNew->setStatusTip("New project file");
connect(actionNew, SIGNAL(triggered()), this, SLOT(new_proj()));
- actionOpen = new QAction("Open", this);
+ actionOpen = new QAction("Open", this);
actionOpen->setIcon(QIcon(":/icons/resources/open.png"));
actionOpen->setShortcuts(QKeySequence::Open);
actionOpen->setStatusTip("Open an existing project file");
connect(actionOpen, SIGNAL(triggered()), this, SLOT(open_proj()));
- QAction *actionSave = new QAction("Save", this);
+ QAction *actionSave = new QAction("Save", this);
actionSave->setIcon(QIcon(":/icons/resources/save.png"));
actionSave->setShortcuts(QKeySequence::Save);
actionSave->setStatusTip("Save existing project to disk");
actionSave->setEnabled(false);
connect(actionSave, SIGNAL(triggered()), this, SLOT(save_proj()));
- QAction *actionExit = new QAction("Exit", this);
+ QAction *actionExit = new QAction("Exit", this);
actionExit->setIcon(QIcon(":/icons/resources/exit.png"));
actionExit->setShortcuts(QKeySequence::Quit);
actionExit->setStatusTip("Exit the application");