-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkernelmanager.h
More file actions
209 lines (183 loc) · 6.56 KB
/
kernelmanager.h
File metadata and controls
209 lines (183 loc) · 6.56 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#ifndef KERNELMANAGER_H
#define KERNELMANAGER_H
#include <QWidget>
#include <QListWidget>
#include <QPushButton>
#include <QLabel>
#include <QTextEdit>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QComboBox>
#include <QTabWidget>
#include <QCheckBox>
#include <QSpinBox>
#include <QLineEdit>
#include <QRadioButton>
class SystemManager;
class QProgressDialog;
class KernelManager : public QWidget
{
Q_OBJECT
public:
explicit KernelManager(SystemManager *systemManager, QWidget *parent = nullptr);
// Public accessors for settings
QString getKernelDirectory() const { return m_kernelDirectory; }
void setKernelDirectory(const QString &dir) {
m_kernelDirectory = dir;
m_kernelDirectoryEdit->setText(dir);
}
signals:
// Kernel Management
void setDefaultKernelRequested(const QString &kernelVersion);
void removeKernelRequested(const QString &kernelVersion);
void updateInitramfsRequested(const QString &kernelVersion);
void installKernelRequested(const QString &kernelPackage);
void installKernelToDeviceRequested(const QString &kernelVersion, const QString &devicePath);
// Kernel Patching
void applyPatchRequested(const QString &patchFile);
void revertPatchRequested(const QString &patchName);
void createPatchRequested(const QString &originalFile, const QString &modifiedFile);
// Live Configuration
void applyKernelParameterRequested(const QString ¶meter, const QString &value);
void updateBootParametersRequested(const QStringList ¶meters);
void updateKernelConfigRequested(const QString &configOption, const QString &value);
// Module Management
void loadModuleRequested(const QString &moduleName);
void unloadModuleRequested(const QString &moduleName);
void blacklistModuleRequested(const QString &moduleName);
private slots:
// Kernel Management
void onRefreshKernels();
void onSetDefaultKernel();
void onRemoveKernel();
void onUpdateInitramfs();
void onInstallKernel();
void onKernelSelectionChanged();
void onUpdateGrub();
void onViewKernelConfig();
void onInstallKernelToDevice();
void onUpdateGrubOnDevice();
void onBrowseKernelDirectory();
void onCopyCurrentKernel();
void onBackupKernel();
void onShowJoshuaFixes();
// Patching
void onApplyPatch();
void onRevertPatch();
void onCreatePatch();
void onLoadPatchFile();
void onRefreshPatches();
// Live Configuration
void onApplyKernelParameter();
void onUpdateBootParameters();
void onEditKernelConfig();
void onSaveKernelConfig();
// Module Management
void onLoadModule();
void onUnloadModule();
void onBlacklistModule();
void onRefreshModules();
void onModuleSelectionChanged();
private:
void setupUI();
void createKernelManagementTab();
void createPatchingTab();
void createLiveConfigTab();
void createModuleManagementTab();
void performKernelInstallation(const QString &kernelVersion,
const QString &devicePath,
bool mountRoot,
bool updateGrub,
bool copyModules,
const QString &customMountPoint,
bool isInstalledKernel,
QProgressDialog *progress);
void performGrubUpdate(const QString &mountPoint,
const QString &devicePath,
bool needsMount,
bool updateInitramfs,
QProgressDialog *progress);
// Helper functions
QString cleanKernelVersion(const QString &rawVersion) const;
// UI Components - Main
QTabWidget *m_tabWidget;
QLabel *m_statusLabel;
QString m_kernelDirectory;
QLineEdit *m_kernelDirectoryEdit;
QPushButton *m_browseKernelDirButton;
QPushButton *m_copyCurrentKernelButton;
QPushButton *m_backupKernelButton;
// Kernel Management Tab
QGroupBox *m_kernelListGroup;
QGroupBox *m_kernelActionsGroup;
QGroupBox *m_kernelDetailsGroup;
QListWidget *m_kernelList;
QLabel *m_currentKernelLabel;
QLabel *m_defaultKernelLabel;
QTextEdit *m_kernelDetailsText;
QPushButton *m_refreshButton;
QPushButton *m_setDefaultButton;
QPushButton *m_removeButton;
QPushButton *m_updateInitramfsButton;
QPushButton *m_updateGrubButton;
QPushButton *m_viewConfigButton;
QPushButton *m_installKernelButton;
QPushButton *m_installToDeviceButton;
QPushButton *m_updateGrubOnDeviceButton;
QPushButton *m_joshuaFixesButton;
QComboBox *m_availableKernelsCombo;
// Custom kernel download options
QGroupBox *m_customKernelGroup;
QRadioButton *m_remoteKernelRadio;
QRadioButton *m_localKernelRadio;
QLineEdit *m_remoteKernelEdit;
QLineEdit *m_localKernelEdit;
// Joshua's fixes
QStringList m_selectedJoshuaFixes;
// Patching Tab
QGroupBox *m_patchListGroup;
QGroupBox *m_patchActionsGroup;
QListWidget *m_patchList;
QListWidget *m_appliedPatchesList;
QPushButton *m_loadPatchButton;
QPushButton *m_applyPatchButton;
QPushButton *m_revertPatchButton;
QPushButton *m_createPatchButton;
QTextEdit *m_patchPreviewText;
// Live Configuration Tab
QGroupBox *m_kernelParamsGroup;
QGroupBox *m_bootParamsGroup;
QGroupBox *m_configOptionsGroup;
QListWidget *m_kernelParamsList;
QLineEdit *m_paramNameEdit;
QLineEdit *m_paramValueEdit;
QPushButton *m_applyParamButton;
QTextEdit *m_bootParamsEdit;
QPushButton *m_updateBootParamsButton;
QListWidget *m_configOptionsList;
QTextEdit *m_configEditor;
QPushButton *m_saveConfigButton;
// Module Management Tab
QGroupBox *m_loadedModulesGroup;
QGroupBox *m_availableModulesGroup;
QGroupBox *m_moduleActionsGroup;
QListWidget *m_loadedModulesList;
QListWidget *m_availableModulesList;
QTextEdit *m_moduleInfoText;
QPushButton *m_loadModuleButton;
QPushButton *m_unloadModuleButton;
QPushButton *m_blacklistModuleButton;
QPushButton *m_refreshModulesButton;
QLineEdit *m_moduleSearchEdit;
// Backend
SystemManager *m_systemManager;
QStringList m_installedKernels;
QStringList m_availableKernels;
QStringList m_loadedModules;
QStringList m_availableModules;
QStringList m_appliedPatches;
QString m_currentKernel;
QString m_defaultKernel;
};
#endif // KERNELMANAGER_H