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_next.png</file>
|
||||
<file>resources/resultset_last.png</file>
|
||||
<file>resources/splash.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -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();
|
||||
@ -87,12 +83,34 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
||||
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()
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QProgressBar>
|
||||
#include <QSplashScreen>
|
||||
#include <QStatusBar>
|
||||
#include <QTabWidget>
|
||||
#include <QToolBar>
|
||||
@ -36,6 +37,7 @@ Q_DECLARE_METATYPE(NEXTPNR_NAMESPACE_PREFIX DecalXY)
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class PythonTab;
|
||||
class DesignWidget;
|
||||
|
||||
class BaseMainWindow : public QMainWindow
|
||||
{
|
||||
@ -48,9 +50,11 @@ class BaseMainWindow : public QMainWindow
|
||||
|
||||
protected:
|
||||
void createMenusAndBars();
|
||||
void displaySplash();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void writeInfo(std::string text);
|
||||
void displaySplashMessage(std::string msg);
|
||||
|
||||
virtual void new_proj() = 0;
|
||||
virtual void open_proj() = 0;
|
||||
@ -72,6 +76,8 @@ class BaseMainWindow : public QMainWindow
|
||||
QAction *actionNew;
|
||||
QAction *actionOpen;
|
||||
QProgressBar *progressBar;
|
||||
QSplashScreen *splash;
|
||||
DesignWidget *designview;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -230,6 +230,7 @@ void DesignWidget::newContext(Context *ctx)
|
||||
bel_root->setText(0, "Bels");
|
||||
treeWidget->insertTopLevelItem(0, bel_root);
|
||||
if (ctx) {
|
||||
Q_EMIT contextLoadStatus("Configuring bels...");
|
||||
for (auto bel : ctx->getBels()) {
|
||||
auto id = ctx->getBelName(bel);
|
||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||
@ -262,6 +263,7 @@ void DesignWidget::newContext(Context *ctx)
|
||||
wire_root->setText(0, "Wires");
|
||||
treeWidget->insertTopLevelItem(0, wire_root);
|
||||
if (ctx) {
|
||||
Q_EMIT contextLoadStatus("Configuring wires...");
|
||||
for (auto wire : ctx->getWires()) {
|
||||
auto id = ctx->getWireName(wire);
|
||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||
@ -293,6 +295,7 @@ void DesignWidget::newContext(Context *ctx)
|
||||
pip_root->setText(0, "Pips");
|
||||
treeWidget->insertTopLevelItem(0, pip_root);
|
||||
if (ctx) {
|
||||
Q_EMIT contextLoadStatus("Configuring pips...");
|
||||
for (auto pip : ctx->getPips()) {
|
||||
auto id = ctx->getPipName(pip);
|
||||
QStringList items = QString(id.c_str(ctx)).split("/");
|
||||
@ -328,6 +331,8 @@ void DesignWidget::newContext(Context *ctx)
|
||||
cells_root = new QTreeWidgetItem(treeWidget);
|
||||
cells_root->setText(0, "Cells");
|
||||
treeWidget->insertTopLevelItem(0, cells_root);
|
||||
|
||||
Q_EMIT finishContextLoad();
|
||||
}
|
||||
|
||||
void DesignWidget::updateTree()
|
||||
|
@ -65,6 +65,8 @@ class DesignWidget : public QWidget
|
||||
void info(std::string text);
|
||||
void selected(std::vector<DecalXY> decal);
|
||||
void highlight(std::vector<DecalXY> decal, int group);
|
||||
void finishContextLoad();
|
||||
void contextLoadStatus(std::string text);
|
||||
|
||||
private Q_SLOTS:
|
||||
void prepareMenuProperty(const QPoint &pos);
|
||||
|
@ -226,6 +226,7 @@ void MainWindow::new_proj()
|
||||
ctx = std::unique_ptr<Context>(new Context(chipArgs));
|
||||
actionLoadJSON->setEnabled(true);
|
||||
|
||||
Q_EMIT displaySplash();
|
||||
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