summaryrefslogtreecommitdiff
path: root/util/coreboot-configurator/src/application/MainWindow.h
blob: bf317a814fae7be8c2775abe02b54c820f78e11c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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();
};