diff --git a/AUTHORS b/AUTHORS index 8c232ccf3..4934d9d7a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,7 +4,7 @@ David Rosca Contributors: -Daniele Cocca (added close tabs with middle click feature) +Daniele Cocca (close tabs with middle click, initial work on speed dial) Jan Rajnoha (QupZilla icon) Translators: diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index 75da08742..b1b3d2e61 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -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) diff --git a/src/app/qupzilla.h b/src/app/qupzilla.h index e5e55b978..08364a564 100644 --- a/src/app/qupzilla.h +++ b/src/app/qupzilla.h @@ -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;