mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Update JavaScriptOptions dialog for QtWebEngine
This commit is contained in:
parent
b817c19081
commit
e7144ca78c
@ -49,10 +49,6 @@ void QzSettings::loadSettings()
|
||||
loadTabsOnActivation = settings.value("LoadTabsOnActivation", true).toBool();
|
||||
autoOpenProtocols = settings.value("AutomaticallyOpenProtocols", QStringList()).toStringList();
|
||||
blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList();
|
||||
allowJsGeometryChange = settings.value("allowJavaScriptGeometryChange", true).toBool();
|
||||
allowJsHideMenuBar = settings.value("allowJavaScriptHideMenuBar", true).toBool();
|
||||
allowJsHideStatusBar = settings.value("allowJavaScriptHideStatusBar", true).toBool();
|
||||
allowJsHideToolBar = settings.value("allowJavaScriptHideToolBar", true).toBool();
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
|
@ -49,10 +49,6 @@ public:
|
||||
// Web-Browser-Settings
|
||||
int defaultZoomLevel;
|
||||
bool loadTabsOnActivation;
|
||||
bool allowJsGeometryChange;
|
||||
bool allowJsHideMenuBar;
|
||||
bool allowJsHideStatusBar;
|
||||
bool allowJsHideToolBar;
|
||||
|
||||
QStringList autoOpenProtocols;
|
||||
QStringList blockedProtocols;
|
||||
|
@ -220,9 +220,8 @@ void PopupWindow::titleChanged()
|
||||
|
||||
void PopupWindow::setWindowGeometry(QRect newRect)
|
||||
{
|
||||
if (!qzSettings->allowJsGeometryChange) {
|
||||
if (!Settings().value("allowJavaScriptGeometryChange", true).toBool())
|
||||
return;
|
||||
}
|
||||
|
||||
// left/top was set while width/height not
|
||||
if (!newRect.topLeft().isNull() && newRect.size().isNull()) {
|
||||
@ -243,20 +242,3 @@ void PopupWindow::setWindowGeometry(QRect newRect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopupWindow::setStatusBarVisibility(bool visible)
|
||||
{
|
||||
m_statusBar->setVisible(qzSettings->allowJsHideStatusBar ? visible : true);
|
||||
}
|
||||
|
||||
void PopupWindow::setMenuBarVisibility(bool visible)
|
||||
{
|
||||
m_menuBar->setVisible(qzSettings->allowJsHideMenuBar ? visible : true);
|
||||
}
|
||||
|
||||
void PopupWindow::setToolBarVisibility(bool visible)
|
||||
{
|
||||
// Does nothing now
|
||||
// m_toolBar->setVisible(qzSettings->allowJsHideToolBar ? visible : true);
|
||||
Q_UNUSED(visible)
|
||||
}
|
||||
|
@ -46,9 +46,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void setWindowGeometry(QRect newRect);
|
||||
void setStatusBarVisibility(bool visible);
|
||||
void setMenuBarVisibility(bool visible);
|
||||
void setToolBarVisibility(bool visible);
|
||||
|
||||
private slots:
|
||||
void titleChanged();
|
||||
|
@ -21,9 +21,6 @@
|
||||
#include "mainapplication.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QWebEnginePage> // QTWEBKIT_VERSION_CHECK macro
|
||||
#include <QFileDialog>
|
||||
|
||||
JsOptions::JsOptions(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::JsOptions)
|
||||
@ -34,29 +31,18 @@ JsOptions::JsOptions(QWidget* parent)
|
||||
|
||||
Settings settings;
|
||||
settings.beginGroup("Web-Browser-Settings");
|
||||
ui->jscanCloseWindow->setChecked(settings.value("allowJavaScriptCloseWindow", false).toBool());
|
||||
ui->jscanOpenWindow->setChecked(settings.value("allowJavaScriptOpenWindow", false).toBool());
|
||||
ui->jscanChangeSize->setChecked(settings.value("allowJavaScriptGeometryChange", true).toBool());
|
||||
ui->jscanHideMenu->setChecked(settings.value("allowJavaScriptHideMenuBar", true).toBool());
|
||||
ui->jscanHideStatus->setChecked(settings.value("allowJavaScriptHideStatusBar", true).toBool());
|
||||
ui->jscanHideTool->setChecked(settings.value("allowJavaScriptHideToolBar", true).toBool());
|
||||
ui->jscanAccessClipboard->setChecked(settings.value("allowJavaScriptAccessClipboard", false).toBool());
|
||||
settings.endGroup();
|
||||
|
||||
// Disable for now, as it does not do anything (yet)
|
||||
ui->jscanHideTool->setHidden(true);
|
||||
}
|
||||
|
||||
void JsOptions::accept()
|
||||
{
|
||||
Settings settings;
|
||||
settings.beginGroup("Web-Browser-Settings");
|
||||
settings.setValue("allowJavaScriptCloseWindow", ui->jscanCloseWindow->isChecked());
|
||||
settings.setValue("allowJavaScriptOpenWindow", ui->jscanOpenWindow->isChecked());
|
||||
settings.setValue("allowJavaScriptGeometryChange", ui->jscanChangeSize->isChecked());
|
||||
settings.setValue("allowJavaScriptHideMenuBar", ui->jscanHideMenu->isChecked());
|
||||
settings.setValue("allowJavaScriptHideStatusBar", ui->jscanHideStatus->isChecked());
|
||||
settings.setValue("allowJavaScriptHideToolBar", ui->jscanHideTool->isChecked());
|
||||
settings.setValue("allowJavaScriptAccessClipboard", ui->jscanAccessClipboard->isChecked());
|
||||
settings.endGroup();
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>214</width>
|
||||
<height>261</height>
|
||||
<height>193</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -23,26 +23,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanCloseWindow">
|
||||
<property name="text">
|
||||
<string>Close windows</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanOpenWindow">
|
||||
<property name="text">
|
||||
@ -57,27 +37,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanHideMenu">
|
||||
<property name="text">
|
||||
<string>Hide menu bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanHideStatus">
|
||||
<property name="text">
|
||||
<string>Hide status bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanHideTool">
|
||||
<property name="text">
|
||||
<string>Hide tool bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="jscanAccessClipboard">
|
||||
<property name="text">
|
||||
|
Loading…
Reference in New Issue
Block a user