mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
This implements a setting to change the languages provided to websites from `navigator.language(s)` and the `Accept-Language` header. Whereas the existing Qt settings dialog allows users to type their language of choice, this setting allows users to select from a predefined list of languages. They may choose any number of languages and their preferred order. This patch only implements the persisted settings and their UI. It does not integrate the choses languages into the WebContent process.
39 lines
921 B
C++
39 lines
921 B
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWebView/WebUI.h>
|
|
|
|
namespace WebView {
|
|
|
|
class SettingsUI : public WebUI {
|
|
WEB_UI(SettingsUI);
|
|
|
|
private:
|
|
virtual void register_interfaces() override;
|
|
|
|
void load_current_settings();
|
|
void restore_default_settings();
|
|
|
|
void set_new_tab_page_url(JsonValue const&);
|
|
void set_languages(JsonValue const&);
|
|
|
|
void load_available_engines();
|
|
void set_search_engine(JsonValue const&);
|
|
void set_autocomplete_engine(JsonValue const&);
|
|
|
|
void load_forcibly_enabled_site_settings();
|
|
void set_site_setting_enabled_globally(JsonValue const&);
|
|
void add_site_setting_filter(JsonValue const&);
|
|
void remove_site_setting_filter(JsonValue const&);
|
|
void remove_all_site_setting_filters(JsonValue const&);
|
|
|
|
void set_do_not_track(JsonValue const&);
|
|
};
|
|
|
|
}
|