aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-25 12:06:51 +0100
committergatecat <gatecat@ds0.me>2021-07-25 12:06:51 +0100
commit0e3b25468cb839039b7a49f0c5b5aba3db19f580 (patch)
treeee9aa03a4898d0ab7aff8b3aa33770889a1b4114 /gui
parent5212e38512586a6aea0a3b075d30cd172026cd3e (diff)
downloadnextpnr-0e3b25468cb839039b7a49f0c5b5aba3db19f580.tar.gz
nextpnr-0e3b25468cb839039b7a49f0c5b5aba3db19f580.tar.bz2
nextpnr-0e3b25468cb839039b7a49f0c5b5aba3db19f580.zip
gui: Implement about dialog
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'gui')
-rw-r--r--gui/CMakeLists.txt1
-rw-r--r--gui/basewindow.cc11
-rw-r--r--gui/basewindow.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 1deffcfb..110251b9 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -34,6 +34,7 @@ add_library(gui_${family} STATIC ${GUI_SOURCE_FILES} ${PYTHON_CONSOLE_SRC} ${GUI
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 ${CMAKE_BINARY_DIR}/generated)
if (BUILD_PYTHON)
target_include_directories(gui_${family} PRIVATE ../3rdparty/python-console ../3rdparty/python-console/modified)
endif()
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index e93428cf..6e64bf6f 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -35,6 +35,7 @@
#include "log.h"
#include "mainwindow.h"
#include "pythontab.h"
+#include "version.h"
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::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()
{
// File menu / project toolbar actions
@@ -140,6 +150,7 @@ void BaseMainWindow::createMenusAndBars()
// Help menu actions
QAction *actionAbout = new QAction("About", this);
+ connect(actionAbout, &QAction::triggered, this, &BaseMainWindow::about);
// Gile menu options
actionNew = new QAction("New", this);
diff --git a/gui/basewindow.h b/gui/basewindow.h
index 0b63dd73..4e3cdcb8 100644
--- a/gui/basewindow.h
+++ b/gui/basewindow.h
@@ -87,6 +87,8 @@ class BaseMainWindow : public QMainWindow
void saveMovie();
void saveSVG();
+ void about();
+
Q_SIGNALS:
void contextChanged(Context *ctx);
void updateTreeView();