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

Merge pull request #1248 from pejakm/stfx

[HistoryMenu] Improvements
This commit is contained in:
David Rosca 2014-02-28 22:15:25 +01:00
commit 2a6896e57f
3 changed files with 17 additions and 10 deletions

View File

@ -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<ClosedTabsManager::Tab> 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()

View File

@ -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(?,?,?)");

View File

@ -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);
}
}
}