2022-07-14 06:08:30 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Filiph Sandström <filiph.sandstrom@filfatstudios.com>
|
2023-05-31 11:44:16 +10:00
|
|
|
* Copyright (c) 2023, Cameron Youell <cameronyouell@gmail.com>
|
2022-07-14 06:08:30 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2025-02-22 21:51:15 +13:00
|
|
|
#include <LibURL/Parser.h>
|
2024-03-18 16:22:27 +13:00
|
|
|
#include <LibURL/URL.h>
|
2024-09-22 23:12:36 +01:00
|
|
|
#include <LibWebView/Application.h>
|
2024-11-09 12:50:33 -05:00
|
|
|
#include <UI/Qt/Settings.h>
|
|
|
|
|
#include <UI/Qt/SettingsDialog.h>
|
|
|
|
|
#include <UI/Qt/StringUtils.h>
|
|
|
|
|
|
2022-07-14 06:36:11 +02:00
|
|
|
#include <QLabel>
|
2023-05-31 11:44:16 +10:00
|
|
|
#include <QMenu>
|
2022-07-14 06:36:11 +02:00
|
|
|
|
2023-08-02 11:52:59 -06:00
|
|
|
namespace Ladybird {
|
|
|
|
|
|
2022-07-14 06:08:30 +02:00
|
|
|
SettingsDialog::SettingsDialog(QMainWindow* window)
|
2023-12-04 09:39:22 -05:00
|
|
|
: QDialog(window)
|
|
|
|
|
, m_window(window)
|
2022-07-14 06:08:30 +02:00
|
|
|
{
|
2022-10-01 12:46:24 -06:00
|
|
|
m_layout = new QFormLayout(this);
|
2022-07-14 06:36:11 +02:00
|
|
|
|
2024-07-23 21:11:47 +01:00
|
|
|
m_preferred_languages = new QLineEdit(this);
|
|
|
|
|
m_preferred_languages->setText(Settings::the()->preferred_languages().join(","));
|
|
|
|
|
QObject::connect(m_preferred_languages, &QLineEdit::editingFinished, this, [this] {
|
|
|
|
|
Settings::the()->set_preferred_languages(m_preferred_languages->text().split(","));
|
|
|
|
|
});
|
|
|
|
|
QObject::connect(m_preferred_languages, &QLineEdit::returnPressed, this, [this] {
|
|
|
|
|
close();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
m_layout->addRow(new QLabel("Preferred Language(s)", this), m_preferred_languages);
|
2022-07-14 06:08:30 +02:00
|
|
|
|
|
|
|
|
setWindowTitle("Settings");
|
|
|
|
|
setLayout(m_layout);
|
2023-10-20 09:40:11 -04:00
|
|
|
resize(600, 250);
|
2022-07-14 06:08:30 +02:00
|
|
|
}
|
2022-07-14 06:36:11 +02:00
|
|
|
|
2023-08-02 11:52:59 -06:00
|
|
|
}
|