MCPcopy Create free account
hub / github.com/alpha-liu-01/SpeedyNote / ControlPanelDialog

Method ControlPanelDialog

source/ControlPanelDialog.cpp:157–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155} // namespace
156
157ControlPanelDialog::ControlPanelDialog(MainWindow *mainWindow, QWidget *parent)
158 : QDialog(parent), mainWindowRef(mainWindow) {
159
160 setWindowTitle(tr("Settings"));
161 resize(450, 400);
162
163 tabWidget = new QTabWidget(this);
164
165 // === Working Tabs ===
166 createBackgroundTab(); // Background settings (first tab for importance)
167 createToolsTab(); // Stroke tool settings
168 createShortcutsTab(); // Phase 5.1: Keyboard shortcuts tab
169
170#ifdef SPEEDYNOTE_CONTROLLER_SUPPORT
171 // Note: createButtonMappingTab() removed - dial system was deleted (MW7.2)
172 createControllerMappingTab();
173#endif
174
175 createThemeTab();
176 createLanguageTab();
177#ifdef Q_OS_LINUX
178 createStylusTab();
179#endif
180 createCacheTab();
181 createAboutTab();
182
183 // === Buttons ===
184 applyButton = new QPushButton(tr("Apply"));
185 okButton = new QPushButton(tr("OK"));
186 cancelButton = new QPushButton(tr("Cancel"));
187
188 connect(applyButton, &QPushButton::clicked, this, &ControlPanelDialog::applyChanges);
189 connect(okButton, &QPushButton::clicked, this, [this]() {
190 applyChanges();
191 accept();
192 });
193 connect(cancelButton, &QPushButton::clicked, this, &ControlPanelDialog::reject);
194
195 // === Layout ===
196 QHBoxLayout *buttonLayout = new QHBoxLayout();
197 buttonLayout->addStretch();
198 buttonLayout->addWidget(applyButton);
199 buttonLayout->addWidget(okButton);
200 buttonLayout->addWidget(cancelButton);
201
202 QVBoxLayout *mainLayout = new QVBoxLayout(this);
203 mainLayout->addWidget(tabWidget);
204 mainLayout->addLayout(buttonLayout);
205
206 // Load current settings into UI
207 loadSettings();
208}
209
210void ControlPanelDialog::switchToKeyboardShortcutsTab()
211{

Callers

nothing calls this directly

Calls 3

connectFunction · 0.85
addWidgetMethod · 0.80
addStretchMethod · 0.45

Tested by

no test coverage detected