|
6 | 6 | */
|
7 | 7 |
|
8 | 8 | #include "BrowserWindow.h"
|
| 9 | +#include "Settings.h" |
| 10 | +#include "SettingsDialog.h" |
9 | 11 | #include "WebView.h"
|
10 | 12 | #include <LibCore/EventLoop.h>
|
11 | 13 | #include <QAction>
|
| 14 | +#include <QDialog> |
12 | 15 | #include <QPlainTextEdit>
|
13 | 16 | #include <QMessageBox>
|
14 | 17 |
|
15 | 18 | extern String s_serenity_resource_root;
|
| 19 | +extern Browser::Settings* s_settings; |
16 | 20 |
|
17 | 21 | BrowserWindow::BrowserWindow(Core::EventLoop& event_loop)
|
18 | 22 | : m_event_loop(event_loop)
|
@@ -100,7 +104,6 @@ BrowserWindow::BrowserWindow(Core::EventLoop& event_loop)
|
100 | 104 | auto* preferences_action = new QAction("Prefe&rences");
|
101 | 105 | preferences_action->setIcon(QIcon(QString("%1/res/icons/16x16/settings.png").arg(s_serenity_resource_root.characters())));
|
102 | 106 | preferences_action->setShortcut(QKeySequence(QKeySequence::Preferences)); // "Ctrl+, (macOS)"
|
103 |
| - preferences_action->setEnabled(false); |
104 | 107 | edit_menu->addAction(preferences_action);
|
105 | 108 |
|
106 | 109 | auto* view_menu = menuBar()->addMenu("&View");
|
@@ -263,6 +266,9 @@ BrowserWindow::BrowserWindow(Core::EventLoop& event_loop)
|
263 | 266 | about_action->setIcon(QIcon(QString("../icons/16x16/app-coccinellidae.png")));
|
264 | 267 | help_menu->addAction(about_action);
|
265 | 268 |
|
| 269 | + QObject::connect(preferences_action, &QAction::triggered, this, [this] { |
| 270 | + new SettingsDialog(this); |
| 271 | + }); |
266 | 272 | QObject::connect(about_action, &QAction::triggered, this, &BrowserWindow::about);
|
267 | 273 |
|
268 | 274 | QObject::connect(new_tab_action, &QAction::triggered, this, &BrowserWindow::new_tab);
|
|
0 commit comments