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

Small changes in JsOptionsDialog

This commit is contained in:
nowrep 2013-01-09 13:52:12 +01:00
parent 993c4edc04
commit 151bba6293
6 changed files with 17 additions and 25 deletions

View File

@ -65,19 +65,25 @@ void PopupWebPage::slotGeometryChangeRequested(const QRect &rect)
void PopupWebPage::slotMenuBarVisibilityChangeRequested(bool visible)
{
if (!qzSettings->allowJsHideMenuBar) return;
if (!qzSettings->allowJsHideMenuBar) {
return;
}
m_menuBarVisible = visible;
}
void PopupWebPage::slotStatusBarVisibilityChangeRequested(bool visible)
{
if (!qzSettings->allowJsHideStatusBar) return;
if (!qzSettings->allowJsHideStatusBar) {
return;
}
m_statusBarVisible = visible;
}
void PopupWebPage::slotToolBarVisibilityChangeRequested(bool visible)
{
if (!qzSettings->allowJsHideToolBar) return;
if (!qzSettings->allowJsHideToolBar) {
return;
}
m_toolBarVisible = visible;
}

View File

@ -26,7 +26,6 @@ JsOptions::JsOptions(QWidget* parent)
: QDialog(parent)
, ui(new Ui::JsOptions)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
Settings settings;
@ -39,8 +38,6 @@ JsOptions::JsOptions(QWidget* parent)
ui->jscanHideTool->setChecked(settings.value("allowJavaScriptHideToolBar", true).toBool());
ui->jscanAccessClipboard->setChecked(settings.value("allowJavaScriptAccessClipboard", false).toBool());
settings.endGroup();
connect(ui->jsoptsbbox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
}
void JsOptions::accept()
@ -55,7 +52,7 @@ void JsOptions::accept()
settings.setValue("allowJavaScriptHideToolBar", ui->jscanHideTool->isChecked());
settings.setValue("allowJavaScriptAccessClipboard", ui->jscanAccessClipboard->isChecked());
settings.endGroup();
QDialog::close();
}

View File

@ -31,15 +31,14 @@ class QT_QUPZILLA_EXPORT JsOptions : public QDialog
{
Q_OBJECT
public slots:
void accept();
public:
explicit JsOptions(QWidget* parent = 0);
~JsOptions();
private:
public slots:
void accept();
private:
Ui::JsOptions* ui;
};

View File

@ -252,10 +252,6 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->defaultZoom->setValue(settings.value("DefaultZoom", 100).toInt());
ui->xssAuditing->setChecked(settings.value("XSSAuditing", false).toBool());
if (!ui->allowJavaScript->isChecked()) {
ui->jsOptionsButton->setEnabled(false);
}
connect(ui->allowJavaScript, SIGNAL(toggled(bool)), this, SLOT(allowJavaScriptChanged(bool)));
//Cache
ui->pagesInCache->setValue(settings.value("maximumCachedPages", 3).toInt());
connect(ui->pagesInCache, SIGNAL(valueChanged(int)), this, SLOT(pageCacheValueChanged(int)));
@ -602,11 +598,6 @@ void Preferences::setManualProxyConfigurationEnabled(bool state)
ui->useHttpsProxy->setEnabled(state);
}
void Preferences::allowJavaScriptChanged(bool state)
{
ui->jsOptionsButton->setEnabled(state);
}
void Preferences::saveHistoryChanged(bool stat)
{
ui->deleteHistoryOnClose->setEnabled(stat);
@ -639,8 +630,8 @@ void Preferences::openSslManager()
void Preferences::openJsOptions()
{
JsOptions* m = new JsOptions(this);
m->show();
JsOptions options(this);
options.exec();
}
void Preferences::showAcceptLanguage()

View File

@ -63,7 +63,6 @@ private slots:
void openUserAgentManager();
void openJsOptions();
void allowJavaScriptChanged(bool state);
void saveHistoryChanged(bool state);
void saveCookiesChanged(bool state);
void allowHtml5storageChanged(bool state);

View File

@ -39,7 +39,7 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
const RestoreManager::WindowData &wd = data.at(i);
QTreeWidgetItem* root = new QTreeWidgetItem(ui->treeWidget);
root->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsTristate);
root->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsTristate);
root->setText(0, tr("Window %1").arg((i + 1)));
root->setCheckState(0, Qt::Checked);
@ -47,7 +47,7 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
const WebTab::SavedTab &st = wd.tabsState.at(tab);
QTreeWidgetItem* child = new QTreeWidgetItem(root);
child->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled);
child->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
child->setCheckState(0, Qt::Checked);
child->setIcon(0, st.icon);
child->setText(0, st.title);