summaryrefslogtreecommitdiff
path: root/util/coreboot-configurator/src/application/MainWindow.h
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2021-11-12 08:54:50 +0000
committerMartin Roth <martinroth@google.com>2022-01-27 16:16:23 +0000
commit9c89e3ada2dd30d683c44364e8eea5de757b74eb (patch)
tree30e29cf5094559f82589dd7583aeac89c5a95592 /util/coreboot-configurator/src/application/MainWindow.h
parentaef6de34263694a62f42135be1a97075ec3a2b7a (diff)
util: Add coreboot-configurator
A simple GUI to change settings in coreboot's CBFS, via the nvramtool utility. Test on the StarBook Mk IV running coreboot 4.15 with: * Ubuntu 20.04 * Ubuntu 21.10 * MX Linux 21 * elementary OS 6 * Manjaro 21 Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I491922bf55ed87c2339897099634a38f8d055876 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59256 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util/coreboot-configurator/src/application/MainWindow.h')
-rw-r--r--util/coreboot-configurator/src/application/MainWindow.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/util/coreboot-configurator/src/application/MainWindow.h b/util/coreboot-configurator/src/application/MainWindow.h
new file mode 100644
index 0000000000..bf317a814f
--- /dev/null
+++ b/util/coreboot-configurator/src/application/MainWindow.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#pragma once
+
+#include <Configuration.h>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QMainWindow>
+#include <QString>
+#include <QTableWidget>
+#include <yaml-cpp/yaml.h>
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = nullptr);
+ ~MainWindow();
+
+signals:
+ void updateValue(const QString& key);
+
+private slots:
+ void on_actionSave_triggered(void);
+
+ void on_actionLoad_triggered(void);
+
+ void on_saveButton_clicked(void);
+
+private:
+ void pullSettings(void);
+ void pushSettings(void);
+
+ void generateUi(void);
+ void askForReboot(void);
+
+ void readSettings(const QString& fileName);
+ void writeSettings(const QString& fileName);
+
+ Configuration::Parameters m_parameters;
+ YAML::Node m_categories;
+
+ Ui::MainWindow *ui;
+
+ QComboBox *createComboBox(const QString &key);
+ QCheckBox *createCheckBox(const QString &key);
+
+ QTableWidget *createRawTable();
+};