1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Implement QtWE ScreenCaptureEnabled option

BUG: 431004

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2021-04-05 17:52:24 +02:00
parent fb03989114
commit f7b372098e
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
3 changed files with 12 additions and 0 deletions

View File

@ -976,6 +976,7 @@ void MainApplication::loadSettings()
#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 13, 0)
webSettings->setAttribute(QWebEngineSettings::PdfViewerEnabled, settings.value(QSL("intPDFViewer"), false).toBool());
webSettings->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, settings.value(QSL("screenCaptureEnabled"), false).toBool());
#endif
webSettings->setDefaultTextEncoding(settings.value(QSL("DefaultEncoding"), webSettings->defaultTextEncoding()).toString());

View File

@ -123,8 +123,10 @@ Preferences::Preferences(BrowserWindow* window)
#if QTWEBENGINEWIDGETS_VERSION < QT_VERSION_CHECK(5, 13, 0)
ui->intPDFViewer->setVisible(false);
ui->screenCaptureEnabled->setVisible(false);
#endif
auto setCategoryIcon = [this](int index, const QIcon &icon) {
ui->listWidget->item(index)->setIcon(QIcon(icon.pixmap(32)));
};
@ -302,6 +304,7 @@ Preferences::Preferences(BrowserWindow* window)
ui->dnsPrefetch->setChecked(settings.value("DNSPrefetch", true).toBool());
ui->intPDFViewer->setChecked(settings.value("intPDFViewer", false).toBool());
ui->intPDFViewer->setEnabled(ui->allowPlugins->isChecked());
ui->screenCaptureEnabled->setChecked(settings.value("screenCaptureEnabled", false).toBool());
const auto levels = WebView::zoomLevels();
for (int level : levels) {
@ -972,6 +975,7 @@ void Preferences::saveSettings()
settings.setValue("WebRTCPublicIpOnly", ui->webRTCPublicIpOnly->isChecked());
settings.setValue("DNSPrefetch", ui->dnsPrefetch->isChecked());
settings.setValue("intPDFViewer", ui->intPDFViewer->isChecked());
settings.setValue("screenCaptureEnabled", ui->screenCaptureEnabled->isChecked());
#ifdef Q_OS_WIN
settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked());

View File

@ -1089,6 +1089,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="screenCaptureEnabled">
<property name="text">
<string>Enable screen capture</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">