From 2943c0ca93de3db37faf4c5523d2cba97bbcb5cc Mon Sep 17 00:00:00 2001 From: nowrep Date: Mon, 4 Apr 2011 20:04:29 +0200 Subject: [PATCH] =?UTF-8?q?[Fix:]=C2=A0Fixed=20bug=20with=20showing/hiding?= =?UTF-8?q?=20navigation=20bars=20after=20changing=20preferences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mainapplication.cpp | 8 ++----- src/app/qupzilla.cpp | 42 ++++++++++++++++----------------- src/preferences/preferences.cpp | 1 + src/preferences/preferences.ui | 2 +- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index ba1ba3a28..4b758daee 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -457,13 +457,9 @@ bool MainApplication::saveStateSlot() settings.endGroup(); QupZilla* qupzilla_ = getWindow(); - if (qupzilla_) { + if (qupzilla_) qupzilla_->tabWidget()->savePinnedTabs(); - settings.setValue("Browser-View-Settings/showBookmarksToolbar",qupzilla_->bookmarksToolbar()->isVisible()); - settings.setValue("Browser-View-Settings/showNavigationToolbar",qupzilla_->navigationToolbar()->isVisible()); - settings.setValue("Browser-View-Settings/showStatusbar",qupzilla_->statusBar()->isVisible()); - settings.setValue("Browser-View-Settings/showMenubar",qupzilla_->menuBar()->isVisible()); - } + return true; } diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index d67927462..5f4e5e36e 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -544,13 +544,12 @@ void QupZilla::showPageInfo() void QupZilla::showBookmarksToolbar() { - if (m_bookmarksToolbar->isVisible()) { - m_bookmarksToolbar->setVisible(false); - m_actionShowBookmarksToolbar->setChecked(false); - }else{ - m_bookmarksToolbar->setVisible(true); - m_actionShowBookmarksToolbar->setChecked(true); - } + bool status = m_bookmarksToolbar->isVisible(); + m_bookmarksToolbar->setVisible(!status); + m_actionShowBookmarksToolbar->setChecked(!status); + + QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); + settings.setValue("Browser-View-Settings/showBookmarksToolbar", !status); } void QupZilla::showNavigationToolbar() @@ -558,13 +557,12 @@ void QupZilla::showNavigationToolbar() if (!menuBar()->isVisible() && !m_actionShowToolbar->isChecked()) showMenubar(); - if (m_navigation->isVisible()) { - m_navigation->setVisible(false); - m_actionShowToolbar->setChecked(false); - }else{ - m_navigation->setVisible(true); - m_actionShowToolbar->setChecked(true); - } + bool status = m_navigation->isVisible(); + m_navigation->setVisible(!status); + m_actionShowToolbar->setChecked(!status); + + QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); + settings.setValue("Browser-View-Settings/showNavigationToolbar", !status); } void QupZilla::showMenubar() @@ -575,17 +573,19 @@ void QupZilla::showMenubar() menuBar()->setVisible(!menuBar()->isVisible()); m_navigation->actions().at(m_navigation->actions().count()-2)->setVisible(!menuBar()->isVisible()); m_actionShowMenubar->setChecked(menuBar()->isVisible()); + + QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); + settings.setValue("Browser-View-Settings/showMenubar", menuBar()->isVisible()); } void QupZilla::showStatusbar() { - if (statusBar()->isVisible()) { - statusBar()->setVisible(false); - m_actionShowStatusbar->setChecked(false); - }else{ - statusBar()->setVisible(true); - m_actionShowStatusbar->setChecked(true); - } + bool status = statusBar()->isVisible(); + statusBar()->setVisible(!status); + m_actionShowStatusbar->setChecked(!status); + + QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); + settings.setValue("Browser-View-Settings/showStatusbar", !status); } void QupZilla::showInspector() diff --git a/src/preferences/preferences.cpp b/src/preferences/preferences.cpp index 7fcbb4072..8809353ae 100644 --- a/src/preferences/preferences.cpp +++ b/src/preferences/preferences.cpp @@ -466,6 +466,7 @@ void Preferences::deleteProfile() void Preferences::startProfileIndexChanged(QString index) { ui->deleteProfile->setEnabled(m_actProfileName != index); + ui->cannotDeleteActiveProfileLabel->setVisible(m_actProfileName == index); } void Preferences::saveSettings() diff --git a/src/preferences/preferences.ui b/src/preferences/preferences.ui index ebcc28c2c..c9069b7b7 100644 --- a/src/preferences/preferences.ui +++ b/src/preferences/preferences.ui @@ -448,7 +448,7 @@ - + Note: You cannot delete active profile.