mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
TabContextMenu: Add Load Tab action
This commit is contained in:
parent
13e81d0b21
commit
b5d872f64e
|
@ -44,6 +44,7 @@ TabContextMenu::TabContextMenu(int index, Qt::Orientation orientation, BrowserWi
|
|||
connect(this, SIGNAL(closeToRight(int)), m_tabWidget, SLOT(closeToRight(int)));
|
||||
connect(this, SIGNAL(closeToLeft(int)), m_tabWidget, SLOT(closeToLeft(int)));
|
||||
connect(this, SIGNAL(duplicateTab(int)), m_tabWidget, SLOT(duplicateTab(int)));
|
||||
connect(this, SIGNAL(loadTab(int)), m_tabWidget, SLOT(loadTab(int)));
|
||||
connect(this, SIGNAL(unloadTab(int)), m_tabWidget, SLOT(unloadTab(int)));
|
||||
|
||||
init();
|
||||
|
@ -123,7 +124,9 @@ void TabContextMenu::init()
|
|||
addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, SLOT(pinTab()));
|
||||
addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, SLOT(muteTab()));
|
||||
|
||||
if (webTab->isRestored()) {
|
||||
if (!webTab->isRestored()) {
|
||||
addAction(tr("Load Tab"), this, SLOT(loadTab()));
|
||||
} else {
|
||||
addAction(tr("Unload Tab"), this, SLOT(unloadTab()));
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ signals:
|
|||
void closeToRight(int index);
|
||||
void closeToLeft(int index);
|
||||
void duplicateTab(int index);
|
||||
void loadTab(int index);
|
||||
void unloadTab(int index);
|
||||
|
||||
private slots:
|
||||
|
@ -46,6 +47,7 @@ private slots:
|
|||
void stopTab() { emit stopTab(m_clickedTab); }
|
||||
void closeTab() { emit tabCloseRequested(m_clickedTab); }
|
||||
void duplicateTab() { emit duplicateTab(m_clickedTab); }
|
||||
void loadTab() { emit loadTab(m_clickedTab); }
|
||||
void unloadTab() { emit unloadTab(m_clickedTab); }
|
||||
|
||||
void pinTab();
|
||||
|
|
|
@ -672,6 +672,15 @@ int TabWidget::duplicateTab(int index)
|
|||
return id;
|
||||
}
|
||||
|
||||
void TabWidget::loadTab(int index)
|
||||
{
|
||||
if (!validIndex(index)) {
|
||||
return;
|
||||
}
|
||||
|
||||
weTab(index)->tabActivated();
|
||||
}
|
||||
|
||||
void TabWidget::unloadTab(int index)
|
||||
{
|
||||
if (!validIndex(index)) {
|
||||
|
|
|
@ -116,6 +116,7 @@ public slots:
|
|||
void closeToRight(int index);
|
||||
void closeToLeft(int index);
|
||||
void detachTab(int index);
|
||||
void loadTab(int index);
|
||||
void unloadTab(int index);
|
||||
void restoreClosedTab(QObject* obj = 0);
|
||||
void restoreAllClosedTabs();
|
||||
|
|
Loading…
Reference in New Issue
Block a user