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

Edited behaviour of showing bookmarks toolbar section in bookmarks menu

- this section will now be shown in bookmarks menu only when
  bookmarks toolbar is visible

- you are still able to organize bookmarks in toolbar in
  bookmarks manager
This commit is contained in:
nowrep 2011-12-08 18:11:05 +01:00
parent 42079d50b5
commit ec7fc4d6ad
3 changed files with 13 additions and 7 deletions

View File

@ -4,7 +4,7 @@ David Rosca <nowrep@gmail.com>
Contributors:
Daniele Cocca <jmc@chakra-project.org> (added close tabs with middle click feature)
Daniele Cocca <jmc@chakra-project.org> (close tabs with middle click, initial work on speed dial)
Jan Rajnoha <honza.rajny@hotmail.com> (QupZilla icon)
Translators:

View File

@ -88,6 +88,7 @@ QupZilla::QupZilla(StartBehaviour behaviour, QUrl startUrl)
, m_isClosing(false)
, m_startingUrl(startUrl)
, m_startBehaviour(behaviour)
, m_menuBookmarksAction(0)
, m_actionPrivateBrowsing(0)
, m_webInspectorDock(0)
, m_sideBar(0)
@ -545,6 +546,9 @@ void QupZilla::receiveMessage(MainApplication::MessageType mes, bool state)
void QupZilla::aboutToShowBookmarksMenu()
{
if (!m_bookmarksMenuChanged) {
if (m_menuBookmarksAction) {
m_menuBookmarksAction->setVisible(m_bookmarksToolbar->isVisible());
}
return;
}
m_bookmarksMenuChanged = false;
@ -567,8 +571,8 @@ void QupZilla::aboutToShowBookmarksMenu()
m_menuBookmarks->addAction(icon, title, this, SLOT(loadActionUrl()))->setData(url);
}
QMenu* folderBookmarks = new QMenu(tr("Bookmarks In ToolBar"), m_menuBookmarks);
folderBookmarks->setIcon(QIcon(style()->standardIcon(QStyle::SP_DirOpenIcon)));
QMenu* menuBookmarks= new QMenu(tr("Bookmarks In ToolBar"), m_menuBookmarks);
menuBookmarks->setIcon(QIcon(style()->standardIcon(QStyle::SP_DirOpenIcon)));
query.exec("SELECT title, url, icon FROM bookmarks WHERE folder='bookmarksToolbar'");
while (query.next()) {
@ -579,12 +583,12 @@ void QupZilla::aboutToShowBookmarksMenu()
title.truncate(40);
title += "..";
}
folderBookmarks->addAction(icon, title, this, SLOT(loadActionUrl()))->setData(url);
menuBookmarks->addAction(icon, title, this, SLOT(loadActionUrl()))->setData(url);
}
if (folderBookmarks->isEmpty()) {
folderBookmarks->addAction(tr("Empty"));
if (menuBookmarks->isEmpty()) {
menuBookmarks->addAction(tr("Empty"));
}
m_menuBookmarks->addMenu(folderBookmarks);
m_menuBookmarksAction = m_menuBookmarks->addMenu(menuBookmarks);
query.exec("SELECT name FROM folders");
while (query.next()) {
@ -610,6 +614,7 @@ void QupZilla::aboutToShowBookmarksMenu()
m_menuBookmarks->addMenu(tempFolder);
}
m_menuBookmarksAction->setVisible(m_bookmarksToolbar->isVisible());
}
void QupZilla::aboutToShowHistoryMenu(bool loadHistory)

View File

@ -224,6 +224,7 @@ private:
QMenu* m_menuHistory;
QMenu* m_menuClosedTabs;
QMenu* m_menuEncoding;
QAction* m_menuBookmarksAction;
QAction* m_actionShowToolbar;
QAction* m_actionShowBookmarksToolbar;
QAction* m_actionShowStatusbar;