Implement QtWE ScreenCaptureEnabled option

BUG: 431004

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
remotes/origin/Falkon/3.2
Juraj Oravec 5 years ago
parent fb03989114
commit f7b372098e
No known key found for this signature in database
GPG Key ID: 13660A3F1D9F093B
  1. 1
      src/lib/app/mainapplication.cpp
  2. 4
      src/lib/preferences/preferences.cpp
  3. 7
      src/lib/preferences/preferences.ui

@ -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());

@ -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());

@ -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">

Loading…
Cancel
Save