mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
Ladybird: Move Qt-specific classes and functions to a Qt subdirectory
This will help a lot with developing chromes for different UI frameworks where we can see which helper classes and processes are really using Qt vs just using it to get at helper data. As a bonus, remove Qt dependency from WebDriver.
This commit is contained in:
parent
ccaa423372
commit
391beef707
53 changed files with 160 additions and 157 deletions
50
Ladybird/Qt/SettingsDialog.cpp
Normal file
50
Ladybird/Qt/SettingsDialog.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Filiph Sandström <filiph.sandstrom@filfatstudios.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "SettingsDialog.h"
|
||||
#include "Settings.h"
|
||||
#include <QCloseEvent>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
extern Settings* s_settings;
|
||||
|
||||
SettingsDialog::SettingsDialog(QMainWindow* window)
|
||||
: m_window(window)
|
||||
{
|
||||
m_layout = new QFormLayout(this);
|
||||
m_new_tab_page = new QLineEdit(this);
|
||||
m_ok_button = new QPushButton("&Save", this);
|
||||
|
||||
m_layout->addRow(new QLabel("Page on New Tab", this), m_new_tab_page);
|
||||
m_layout->addWidget(m_ok_button);
|
||||
|
||||
QObject::connect(m_ok_button, &QPushButton::released, this, [this] {
|
||||
close();
|
||||
});
|
||||
|
||||
setWindowTitle("Settings");
|
||||
setFixedWidth(300);
|
||||
setFixedHeight(150);
|
||||
setLayout(m_layout);
|
||||
show();
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void SettingsDialog::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
save();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void SettingsDialog::save()
|
||||
{
|
||||
// FIXME: Validate data.
|
||||
s_settings->set_new_tab_page(m_new_tab_page->text());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue