Merge pull request #777 from YosysHQ/gatecat/gui-fixes
gui: Add about box and fix some small typos
This commit is contained in:
commit
ef3be26a69
@ -56,6 +56,7 @@ inline void assert_fail_impl_str(std::string message, const char *expr_str, cons
|
|||||||
#define NPNR_ASSERT_FALSE(msg) (assert_fail_impl(msg, "false", __FILE__, __LINE__))
|
#define NPNR_ASSERT_FALSE(msg) (assert_fail_impl(msg, "false", __FILE__, __LINE__))
|
||||||
#define NPNR_ASSERT_FALSE_STR(msg) (assert_fail_impl_str(msg, "false", __FILE__, __LINE__))
|
#define NPNR_ASSERT_FALSE_STR(msg) (assert_fail_impl_str(msg, "false", __FILE__, __LINE__))
|
||||||
|
|
||||||
|
#define NPNR_STRINGIFY_MACRO(x) NPNR_STRINGIFY(x)
|
||||||
#define NPNR_STRINGIFY(x) #x
|
#define NPNR_STRINGIFY(x) #x
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -34,6 +34,7 @@ add_library(gui_${family} STATIC ${GUI_SOURCE_FILES} ${PYTHON_CONSOLE_SRC} ${GUI
|
|||||||
include(${family}/family.cmake)
|
include(${family}/family.cmake)
|
||||||
|
|
||||||
target_include_directories(gui_${family} PRIVATE ../${family} ${family} ../3rdparty/QtPropertyBrowser/src ../3rdparty/imgui ../3rdparty/qtimgui/)
|
target_include_directories(gui_${family} PRIVATE ../${family} ${family} ../3rdparty/QtPropertyBrowser/src ../3rdparty/imgui ../3rdparty/qtimgui/)
|
||||||
|
target_include_directories(gui_${family} PRIVATE ${CMAKE_BINARY_DIR}/generated)
|
||||||
if (BUILD_PYTHON)
|
if (BUILD_PYTHON)
|
||||||
target_include_directories(gui_${family} PRIVATE ../3rdparty/python-console ../3rdparty/python-console/modified)
|
target_include_directories(gui_${family} PRIVATE ../3rdparty/python-console ../3rdparty/python-console/modified)
|
||||||
endif()
|
endif()
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "pythontab.h"
|
#include "pythontab.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
static void initBasenameResource() { Q_INIT_RESOURCE(base); }
|
static void initBasenameResource() { Q_INIT_RESOURCE(base); }
|
||||||
|
|
||||||
@ -129,6 +130,15 @@ void BaseMainWindow::closeTab(int index) { delete centralTabWidget->widget(index
|
|||||||
|
|
||||||
void BaseMainWindow::writeInfo(std::string text) { console->info(text); }
|
void BaseMainWindow::writeInfo(std::string text) { console->info(text); }
|
||||||
|
|
||||||
|
void BaseMainWindow::about()
|
||||||
|
{
|
||||||
|
QString msg;
|
||||||
|
QTextStream out(&msg);
|
||||||
|
out << "nextpnr-" << NPNR_STRINGIFY_MACRO(ARCHNAME) << "\n";
|
||||||
|
out << "Version " << GIT_DESCRIBE_STR;
|
||||||
|
QMessageBox::information(this, "About nextpnr", msg);
|
||||||
|
}
|
||||||
|
|
||||||
void BaseMainWindow::createMenusAndBars()
|
void BaseMainWindow::createMenusAndBars()
|
||||||
{
|
{
|
||||||
// File menu / project toolbar actions
|
// File menu / project toolbar actions
|
||||||
@ -140,6 +150,7 @@ void BaseMainWindow::createMenusAndBars()
|
|||||||
|
|
||||||
// Help menu actions
|
// Help menu actions
|
||||||
QAction *actionAbout = new QAction("About", this);
|
QAction *actionAbout = new QAction("About", this);
|
||||||
|
connect(actionAbout, &QAction::triggered, this, &BaseMainWindow::about);
|
||||||
|
|
||||||
// Gile menu options
|
// Gile menu options
|
||||||
actionNew = new QAction("New", this);
|
actionNew = new QAction("New", this);
|
||||||
@ -169,7 +180,7 @@ void BaseMainWindow::createMenusAndBars()
|
|||||||
|
|
||||||
actionAssignBudget = new QAction("Assign Budget", this);
|
actionAssignBudget = new QAction("Assign Budget", this);
|
||||||
actionAssignBudget->setIcon(QIcon(":/icons/resources/time_add.png"));
|
actionAssignBudget->setIcon(QIcon(":/icons/resources/time_add.png"));
|
||||||
actionAssignBudget->setStatusTip("Assign time budget for current design");
|
actionAssignBudget->setStatusTip("Assign timing budget for current design");
|
||||||
actionAssignBudget->setEnabled(false);
|
actionAssignBudget->setEnabled(false);
|
||||||
connect(actionAssignBudget, &QAction::triggered, this, &BaseMainWindow::budget);
|
connect(actionAssignBudget, &QAction::triggered, this, &BaseMainWindow::budget);
|
||||||
|
|
||||||
|
@ -87,6 +87,8 @@ class BaseMainWindow : public QMainWindow
|
|||||||
void saveMovie();
|
void saveMovie();
|
||||||
void saveSVG();
|
void saveSVG();
|
||||||
|
|
||||||
|
void about();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void contextChanged(Context *ctx);
|
void contextChanged(Context *ctx);
|
||||||
void updateTreeView();
|
void updateTreeView();
|
||||||
|
@ -655,8 +655,8 @@ void DesignWidget::onSelectionChanged(int num, const QItemSelection &, const QIt
|
|||||||
DelayQuad delay = ctx->getWireDelay(wire);
|
DelayQuad delay = ctx->getWireDelay(wire);
|
||||||
|
|
||||||
QtProperty *delayItem = addSubGroup(topItem, "Delay");
|
QtProperty *delayItem = addSubGroup(topItem, "Delay");
|
||||||
addProperty(delayItem, QVariant::Double, "Min Raise", delay.minRiseDelay());
|
addProperty(delayItem, QVariant::Double, "Min Rise", delay.minRiseDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Max Raise", delay.maxRiseDelay());
|
addProperty(delayItem, QVariant::Double, "Max Rise", delay.maxRiseDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Min Fall", delay.minFallDelay());
|
addProperty(delayItem, QVariant::Double, "Min Fall", delay.minFallDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Max Fall", delay.maxFallDelay());
|
addProperty(delayItem, QVariant::Double, "Max Fall", delay.maxFallDelay());
|
||||||
|
|
||||||
@ -724,8 +724,8 @@ void DesignWidget::onSelectionChanged(int num, const QItemSelection &, const QIt
|
|||||||
DelayQuad delay = ctx->getPipDelay(pip);
|
DelayQuad delay = ctx->getPipDelay(pip);
|
||||||
|
|
||||||
QtProperty *delayItem = addSubGroup(topItem, "Delay");
|
QtProperty *delayItem = addSubGroup(topItem, "Delay");
|
||||||
addProperty(delayItem, QVariant::Double, "Min Raise", delay.minRiseDelay());
|
addProperty(delayItem, QVariant::Double, "Min Rise", delay.minRiseDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Max Raise", delay.maxRiseDelay());
|
addProperty(delayItem, QVariant::Double, "Max Rise", delay.maxRiseDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Min Fall", delay.minFallDelay());
|
addProperty(delayItem, QVariant::Double, "Min Fall", delay.minFallDelay());
|
||||||
addProperty(delayItem, QVariant::Double, "Max Fall", delay.maxFallDelay());
|
addProperty(delayItem, QVariant::Double, "Max Fall", delay.maxFallDelay());
|
||||||
} else if (type == ElementType::NET) {
|
} else if (type == ElementType::NET) {
|
||||||
|
Loading…
Reference in New Issue
Block a user