From b18ac632df3ff0fdd5c64f400aaf8df188b5bb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Pejakovi=C4=87?= Date: Fri, 28 Feb 2014 21:12:25 +0100 Subject: [PATCH] [HistoryMenu] Improvements --- src/lib/history/historymenu.cpp | 21 ++++++++++++++------- src/lib/rss/rssmanager.cpp | 2 +- src/lib/webview/tabwidget.cpp | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/lib/history/historymenu.cpp b/src/lib/history/historymenu.cpp index 064fa6f8d..52f73c9bd 100644 --- a/src/lib/history/historymenu.cpp +++ b/src/lib/history/historymenu.cpp @@ -156,6 +156,17 @@ void HistoryMenu::aboutToShowClosedTabs() return; } + QAction* arestore = new QAction(tr("Restore All Closed Tabs"), this); + QAction* aclrlist = new QAction(tr("Clear list"), this); + + connect(arestore, SIGNAL(triggered()), this, SLOT(restoreAllClosedTabs())); + connect(aclrlist, SIGNAL(triggered()), this, SLOT(clearClosedTabsList())); + + m_menuClosedTabs->addAction(arestore); + m_menuClosedTabs->addAction(aclrlist); + + m_menuClosedTabs->addSeparator(); + TabWidget* tabWidget = m_window->tabWidget(); const QLinkedList closedTabs = tabWidget->closedTabsManager()->allClosedTabs(); int i = 0; @@ -166,15 +177,11 @@ void HistoryMenu::aboutToShowClosedTabs() act->setData(i++); } - m_menuClosedTabs->addSeparator(); - - if (m_menuClosedTabs->isEmpty()) { + if (i == 0) { + arestore->setVisible(false); + aclrlist->setVisible(false); m_menuClosedTabs->addAction(tr("Empty"))->setEnabled(false); } - else { - m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), tabWidget, SLOT(restoreAllClosedTabs())); - m_menuClosedTabs->addAction(tr("Clear list"), tabWidget, SLOT(clearClosedTabsList())); - } } void HistoryMenu::historyEntryActivated() diff --git a/src/lib/rss/rssmanager.cpp b/src/lib/rss/rssmanager.cpp index b66600bc3..1fbfbe29d 100644 --- a/src/lib/rss/rssmanager.cpp +++ b/src/lib/rss/rssmanager.cpp @@ -400,7 +400,7 @@ bool RSSManager::addRssFeed(const QUrl &url, const QString &title, const QIcon & QImage image = icon.pixmap(16, 16).toImage(); if (image == qIconProvider->emptyWebImage()) { - image.load(":icons/other/feed.png"); + image.load(":icons/menu/rss.png"); } query.prepare("INSERT INTO rss (address, title, icon) VALUES(?,?,?)"); diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index a51bff3bd..d80b1c5b0 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -820,7 +820,7 @@ void TabWidget::aboutToShowClosedTabsMenu() m_menuTabs->clear(); QAction* arestore = new QAction(tr("Restore All Closed Tabs"), this); - QAction* aclrlist = new QAction(tr("Clear list"), this); + QAction* aclrlist = new QAction(QIcon::fromTheme("user-trash-full"), tr("Clear list"), this); connect(arestore, SIGNAL(triggered()), this, SLOT(restoreAllClosedTabs())); connect(aclrlist, SIGNAL(triggered()), this, SLOT(clearClosedTabsList())); @@ -844,7 +844,7 @@ void TabWidget::aboutToShowClosedTabsMenu() if (i == 0) { arestore->setVisible(false); aclrlist->setVisible(false); - m_menuTabs->addAction(tr("Empty"))->setEnabled(false); + m_menuTabs->addAction(QIcon::fromTheme("user-trash"), tr("Empty"))->setEnabled(false); } } }