Added splash screen info while loading
This commit is contained in:
parent
ecc4c3fa7b
commit
8e12ae2cfe
@ -9,5 +9,6 @@
|
|||||||
<file>resources/resultset_previous.png</file>
|
<file>resources/resultset_previous.png</file>
|
||||||
<file>resources/resultset_next.png</file>
|
<file>resources/resultset_next.png</file>
|
||||||
<file>resources/resultset_last.png</file>
|
<file>resources/resultset_last.png</file>
|
||||||
|
<file>resources/splash.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
@ -61,15 +62,10 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
|||||||
|
|
||||||
setCentralWidget(centralWidget);
|
setCentralWidget(centralWidget);
|
||||||
|
|
||||||
DesignWidget *designview = new DesignWidget();
|
designview = new DesignWidget();
|
||||||
designview->setMinimumWidth(300);
|
designview->setMinimumWidth(300);
|
||||||
splitter_h->addWidget(designview);
|
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();
|
tabWidget = new QTabWidget();
|
||||||
|
|
||||||
console = new PythonTab();
|
console = new PythonTab();
|
||||||
@ -87,12 +83,34 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
|||||||
connect(designview, SIGNAL(highlight(std::vector<DecalXY>, int)), fpgaView,
|
connect(designview, SIGNAL(highlight(std::vector<DecalXY>, int)), fpgaView,
|
||||||
SLOT(onHighlightGroupChanged(std::vector<DecalXY>, int)));
|
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(centralTabWidget);
|
||||||
splitter_v->addWidget(tabWidget);
|
splitter_v->addWidget(tabWidget);
|
||||||
|
displaySplash();
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseMainWindow::~BaseMainWindow() {}
|
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::writeInfo(std::string text) { console->info(text); }
|
||||||
|
|
||||||
void BaseMainWindow::createMenusAndBars()
|
void BaseMainWindow::createMenusAndBars()
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
#include <QSplashScreen>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
@ -36,6 +37,7 @@ Q_DECLARE_METATYPE(NEXTPNR_NAMESPACE_PREFIX DecalXY)
|
|||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class PythonTab;
|
class PythonTab;
|
||||||
|
class DesignWidget;
|
||||||
|
|
||||||
class BaseMainWindow : public QMainWindow
|
class BaseMainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
@ -48,9 +50,11 @@ class BaseMainWindow : public QMainWindow
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createMenusAndBars();
|
void createMenusAndBars();
|
||||||
|
void displaySplash();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void writeInfo(std::string text);
|
void writeInfo(std::string text);
|
||||||
|
void displaySplashMessage(std::string msg);
|
||||||
|
|
||||||
virtual void new_proj() = 0;
|
virtual void new_proj() = 0;
|
||||||
virtual void open_proj() = 0;
|
virtual void open_proj() = 0;
|
||||||
@ -72,6 +76,8 @@ class BaseMainWindow : public QMainWindow
|
|||||||
QAction *actionNew;
|
QAction *actionNew;
|
||||||
QAction *actionOpen;
|
QAction *actionOpen;
|
||||||
QProgressBar *progressBar;
|
QProgressBar *progressBar;
|
||||||
|
QSplashScreen *splash;
|
||||||
|
DesignWidget *designview;
|
||||||
};
|
};
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -230,6 +230,7 @@ void DesignWidget::newContext(Context *ctx)
|
|||||||
bel_root->setText(0, "Bels");
|
bel_root->setText(0, "Bels");
|
||||||
treeWidget->insertTopLevelItem(0, bel_root);
|
treeWidget->insertTopLevelItem(0, bel_root);
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
|
Q_EMIT contextLoadStatus("Configuring bels...");
|
||||||
for (auto bel : ctx->getBels()) {
|
for (auto bel : ctx->getBels()) {
|
||||||
auto id = ctx->getBelName(bel);
|
auto id = ctx->getBelName(bel);
|
||||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||||
@ -262,6 +263,7 @@ void DesignWidget::newContext(Context *ctx)
|
|||||||
wire_root->setText(0, "Wires");
|
wire_root->setText(0, "Wires");
|
||||||
treeWidget->insertTopLevelItem(0, wire_root);
|
treeWidget->insertTopLevelItem(0, wire_root);
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
|
Q_EMIT contextLoadStatus("Configuring wires...");
|
||||||
for (auto wire : ctx->getWires()) {
|
for (auto wire : ctx->getWires()) {
|
||||||
auto id = ctx->getWireName(wire);
|
auto id = ctx->getWireName(wire);
|
||||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||||
@ -293,6 +295,7 @@ void DesignWidget::newContext(Context *ctx)
|
|||||||
pip_root->setText(0, "Pips");
|
pip_root->setText(0, "Pips");
|
||||||
treeWidget->insertTopLevelItem(0, pip_root);
|
treeWidget->insertTopLevelItem(0, pip_root);
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
|
Q_EMIT contextLoadStatus("Configuring pips...");
|
||||||
for (auto pip : ctx->getPips()) {
|
for (auto pip : ctx->getPips()) {
|
||||||
auto id = ctx->getPipName(pip);
|
auto id = ctx->getPipName(pip);
|
||||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||||
@ -328,6 +331,8 @@ void DesignWidget::newContext(Context *ctx)
|
|||||||
cells_root = new QTreeWidgetItem(treeWidget);
|
cells_root = new QTreeWidgetItem(treeWidget);
|
||||||
cells_root->setText(0, "Cells");
|
cells_root->setText(0, "Cells");
|
||||||
treeWidget->insertTopLevelItem(0, cells_root);
|
treeWidget->insertTopLevelItem(0, cells_root);
|
||||||
|
|
||||||
|
Q_EMIT finishContextLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignWidget::updateTree()
|
void DesignWidget::updateTree()
|
||||||
|
@ -65,6 +65,8 @@ class DesignWidget : public QWidget
|
|||||||
void info(std::string text);
|
void info(std::string text);
|
||||||
void selected(std::vector<DecalXY> decal);
|
void selected(std::vector<DecalXY> decal);
|
||||||
void highlight(std::vector<DecalXY> decal, int group);
|
void highlight(std::vector<DecalXY> decal, int group);
|
||||||
|
void finishContextLoad();
|
||||||
|
void contextLoadStatus(std::string text);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void prepareMenuProperty(const QPoint &pos);
|
void prepareMenuProperty(const QPoint &pos);
|
||||||
|
@ -226,6 +226,7 @@ void MainWindow::new_proj()
|
|||||||
ctx = std::unique_ptr<Context>(new Context(chipArgs));
|
ctx = std::unique_ptr<Context>(new Context(chipArgs));
|
||||||
actionLoadJSON->setEnabled(true);
|
actionLoadJSON->setEnabled(true);
|
||||||
|
|
||||||
|
Q_EMIT displaySplash();
|
||||||
Q_EMIT contextChanged(ctx.get());
|
Q_EMIT contextChanged(ctx.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
gui/resources/splash.png
Normal file
BIN
gui/resources/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Loading…
Reference in New Issue
Block a user