forked from CachyOS/kernel-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf-window.hpp
More file actions
87 lines (74 loc) · 2.84 KB
/
conf-window.hpp
File metadata and controls
87 lines (74 loc) · 2.84 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright (C) 2022-2025 Vladislav Nepogodin
//
// This file is part of CachyOS kernel manager.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#ifndef CONFWINDOW_HPP_
#define CONFWINDOW_HPP_
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wfloat-conversion"
#pragma clang diagnostic ignored "-Wdouble-promotion"
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuseless-cast"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
#endif
#include <ui_conf-window.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <QMainWindow>
#include <QProcess>
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
class ConfWindow final : public QMainWindow {
Q_OBJECT
Q_DISABLE_COPY_MOVE(ConfWindow)
public:
explicit ConfWindow(QWidget* parent = nullptr);
~ConfWindow() = default;
void reset_patches_data_tab() noexcept;
protected:
void closeEvent(QCloseEvent* event) override;
private:
void on_cancel() noexcept;
void on_execute() noexcept;
void on_save() noexcept;
void on_load() noexcept;
void finished_proc(int exit_code, QProcess::ExitStatus exit_status) noexcept;
bool m_running{};
QProcess m_cmd{};
std::string m_build_conf_path{};
std::vector<std::string> m_previously_set_options{};
std::unique_ptr<Ui::ConfWindow> m_ui = std::make_unique<Ui::ConfWindow>();
void run_cmd_async(std::string cmd, const std::string& working_path) noexcept;
auto get_all_set_values() const noexcept -> std::string;
void clear_patches_data_tab() noexcept;
void connect_all_checkboxes() noexcept;
};
#endif // CONFWINDOW_HPP_