diff --git a/src/lib/popupwindow/popupwebpage.cpp b/src/lib/popupwindow/popupwebpage.cpp index 1e1dcd750..4a1fe04fb 100644 --- a/src/lib/popupwindow/popupwebpage.cpp +++ b/src/lib/popupwindow/popupwebpage.cpp @@ -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; } diff --git a/src/lib/preferences/jsoptions.cpp b/src/lib/preferences/jsoptions.cpp index 4eb27d95f..b16bae7c9 100644 --- a/src/lib/preferences/jsoptions.cpp +++ b/src/lib/preferences/jsoptions.cpp @@ -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(); } diff --git a/src/lib/preferences/jsoptions.h b/src/lib/preferences/jsoptions.h index 9259bcacb..402affccf 100644 --- a/src/lib/preferences/jsoptions.h +++ b/src/lib/preferences/jsoptions.h @@ -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; }; diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index a851dd7db..b251d80a2 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -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() diff --git a/src/lib/preferences/preferences.h b/src/lib/preferences/preferences.h index 72fa68cb6..9449fa98b 100644 --- a/src/lib/preferences/preferences.h +++ b/src/lib/preferences/preferences.h @@ -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); diff --git a/src/lib/session/recoverywidget.cpp b/src/lib/session/recoverywidget.cpp index 8f465d834..68b24bcee 100644 --- a/src/lib/session/recoverywidget.cpp +++ b/src/lib/session/recoverywidget.cpp @@ -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);