1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Added aboutToShow to Toolbars menu

This commit is contained in:
nowrep 2011-04-22 07:55:31 +02:00
parent ee47f976eb
commit 04e0149025
3 changed files with 24 additions and 25 deletions

View File

@ -261,6 +261,7 @@ void QupZilla::setupMenu()
toolbarsMenu->addAction(m_actionShowToolbar); toolbarsMenu->addAction(m_actionShowToolbar);
toolbarsMenu->addAction(m_actionShowBookmarksToolbar); toolbarsMenu->addAction(m_actionShowBookmarksToolbar);
toolbarsMenu->addAction(m_actionShowStatusbar); toolbarsMenu->addAction(m_actionShowStatusbar);
connect(toolbarsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolbarsMenu()));
QMenu* sidebarsMenu = new QMenu(tr("Sidebars")); QMenu* sidebarsMenu = new QMenu(tr("Sidebars"));
sidebarsMenu->addAction(m_actionShowBookmarksSideBar); sidebarsMenu->addAction(m_actionShowBookmarksSideBar);
sidebarsMenu->addAction(m_actionShowHistorySideBar); sidebarsMenu->addAction(m_actionShowHistorySideBar);

View File

@ -115,15 +115,8 @@ void QupZilla::loadSettings()
m_adblockIcon->setEnabled(adBlockEnabled); m_adblockIcon->setEnabled(adBlockEnabled);
statusBar()->setVisible(showStatusBar); statusBar()->setVisible(showStatusBar);
m_actionShowStatusbar->setChecked(showStatusBar);
m_bookmarksToolbar->setVisible(showBookmarksToolbar); m_bookmarksToolbar->setVisible(showBookmarksToolbar);
m_actionShowBookmarksToolbar->setChecked(showBookmarksToolbar);
m_navigation->setVisible(showNavigationToolbar); m_navigation->setVisible(showNavigationToolbar);
m_actionShowToolbar->setChecked(showNavigationToolbar);
m_actionShowMenubar->setChecked(showMenuBar);
menuBar()->setVisible(showMenuBar); menuBar()->setVisible(showMenuBar);
m_navigation->actions().at(m_navigation->actions().count()-2)->setVisible(!showMenuBar); m_navigation->actions().at(m_navigation->actions().count()-2)->setVisible(!showMenuBar);
@ -446,6 +439,28 @@ void QupZilla::aboutToShowEncodingMenu()
m_menuEncoding->addMenu(menuOther); m_menuEncoding->addMenu(menuOther);
} }
void QupZilla::aboutToShowSidebarsMenu()
{
if (!m_sideBar) {
m_actionShowBookmarksSideBar->setChecked(false);
m_actionShowHistorySideBar->setChecked(false);
m_actionShowRssSideBar->setChecked(false);
} else {
SideBar::SideWidget actWidget = m_sideBar->activeWidget();
m_actionShowBookmarksSideBar->setChecked(actWidget == SideBar::Bookmarks);
m_actionShowHistorySideBar->setChecked(actWidget == SideBar::History);
m_actionShowRssSideBar->setChecked(actWidget == SideBar::RSS);
}
}
void QupZilla::aboutToShowToolbarsMenu()
{
m_actionShowToolbar->setChecked(m_navigation->isVisible());
m_actionShowMenubar->setChecked(menuBar()->isVisible());
m_actionShowStatusbar->setChecked(statusBar()->isVisible());
m_actionShowBookmarksToolbar->setChecked(m_bookmarksToolbar->isVisible());
}
void QupZilla::changeEncoding() void QupZilla::changeEncoding()
{ {
if (QAction* action = qobject_cast<QAction*>(sender())) { if (QAction* action = qobject_cast<QAction*>(sender())) {
@ -549,7 +564,6 @@ void QupZilla::showBookmarksToolbar()
{ {
bool status = m_bookmarksToolbar->isVisible(); bool status = m_bookmarksToolbar->isVisible();
m_bookmarksToolbar->setVisible(!status); m_bookmarksToolbar->setVisible(!status);
m_actionShowBookmarksToolbar->setChecked(!status);
QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat);
settings.setValue("Browser-View-Settings/showBookmarksToolbar", !status); settings.setValue("Browser-View-Settings/showBookmarksToolbar", !status);
@ -581,20 +595,6 @@ void QupZilla::showHistorySideBar()
} }
} }
void QupZilla::aboutToShowSidebarsMenu()
{
if (!m_sideBar) {
m_actionShowBookmarksSideBar->setChecked(false);
m_actionShowHistorySideBar->setChecked(false);
m_actionShowRssSideBar->setChecked(false);
} else {
SideBar::SideWidget actWidget = m_sideBar->activeWidget();
m_actionShowBookmarksSideBar->setChecked(actWidget == SideBar::Bookmarks);
m_actionShowHistorySideBar->setChecked(actWidget == SideBar::History);
m_actionShowRssSideBar->setChecked(actWidget == SideBar::RSS);
}
}
void QupZilla::showNavigationToolbar() void QupZilla::showNavigationToolbar()
{ {
if (!menuBar()->isVisible() && !m_actionShowToolbar->isChecked()) if (!menuBar()->isVisible() && !m_actionShowToolbar->isChecked())
@ -602,7 +602,6 @@ void QupZilla::showNavigationToolbar()
bool status = m_navigation->isVisible(); bool status = m_navigation->isVisible();
m_navigation->setVisible(!status); m_navigation->setVisible(!status);
m_actionShowToolbar->setChecked(!status);
QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat);
settings.setValue("Browser-View-Settings/showNavigationToolbar", !status); settings.setValue("Browser-View-Settings/showNavigationToolbar", !status);
@ -615,7 +614,6 @@ void QupZilla::showMenubar()
menuBar()->setVisible(!menuBar()->isVisible()); menuBar()->setVisible(!menuBar()->isVisible());
m_navigation->actions().at(m_navigation->actions().count()-2)->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); QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat);
settings.setValue("Browser-View-Settings/showMenubar", menuBar()->isVisible()); settings.setValue("Browser-View-Settings/showMenubar", menuBar()->isVisible());
@ -625,7 +623,6 @@ void QupZilla::showStatusbar()
{ {
bool status = statusBar()->isVisible(); bool status = statusBar()->isVisible();
statusBar()->setVisible(!status); statusBar()->setVisible(!status);
m_actionShowStatusbar->setChecked(!status);
QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat); QSettings settings(activeProfil()+"settings.ini", QSettings::IniFormat);
settings.setValue("Browser-View-Settings/showStatusbar", !status); settings.setValue("Browser-View-Settings/showStatusbar", !status);

View File

@ -150,6 +150,7 @@ private slots:
void aboutToShowViewMenu(); void aboutToShowViewMenu();
void aboutToShowEncodingMenu(); void aboutToShowEncodingMenu();
void aboutToShowSidebarsMenu(); void aboutToShowSidebarsMenu();
void aboutToShowToolbarsMenu();
void searchOnPage(); void searchOnPage();
void showCookieManager(); void showCookieManager();