mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Added Duplicate Tab feature
This commit is contained in:
parent
caf0b70a6d
commit
ceccb7a4e0
Binary file not shown.
@ -63,34 +63,24 @@ void TabBar::contextMenuRequested(const QPoint &position)
|
||||
WebTab* webTab = qobject_cast<WebTab*>(tabWidget->widget(m_clickedTab));
|
||||
if (!webTab)
|
||||
return;
|
||||
menu.addAction(
|
||||
#ifdef Q_WS_X11
|
||||
style()->standardIcon(QStyle::SP_ArrowBack)
|
||||
#else
|
||||
QIcon(":/icons/faenza/back.png")
|
||||
#endif
|
||||
,tr("Back"), this, SLOT(backTab()));
|
||||
menu.addAction(
|
||||
#ifdef Q_WS_X11
|
||||
style()->standardIcon(QStyle::SP_ArrowForward)
|
||||
#else
|
||||
QIcon(":/icons/faenza/forward.png")
|
||||
#endif
|
||||
,tr("Forward"), this, SLOT(forwardTab()));
|
||||
menu.addAction(
|
||||
if (p_QupZilla->weView(m_clickedTab)->isLoading()) {
|
||||
menu.addAction(
|
||||
#ifdef Q_WS_X11
|
||||
style()->standardIcon(QStyle::SP_BrowserStop)
|
||||
#else
|
||||
QIcon(":/icons/faenza/stop.png")
|
||||
#endif
|
||||
,tr("Stop Tab"), this, SLOT(stopTab()));
|
||||
menu.addAction(
|
||||
} else {
|
||||
menu.addAction(
|
||||
#ifdef Q_WS_X11
|
||||
style()->standardIcon(QStyle::SP_BrowserReload)
|
||||
#else
|
||||
QIcon(":/icons/faenza/reload.png")
|
||||
#endif
|
||||
,tr("Reload Tab"), this, SLOT(reloadTab()));
|
||||
}
|
||||
menu.addAction(tr("Duplicate Tab"), this, SLOT(duplicateTab()));
|
||||
menu.addAction(webTab->isPinned() ? tr("Unpin Tab") : tr("Pin Tab"), this, SLOT(pinTab()));
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Reload All Tabs"), tabWidget, SLOT(reloadAllTabs()));
|
||||
@ -103,16 +93,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
|
||||
menu.addAction(tr("Close Other Tabs"), this, SLOT(closeAllButCurrent()));
|
||||
menu.addAction(QIcon::fromTheme("window-close"),tr("Close"), this, SLOT(closeTab()));
|
||||
menu.addSeparator();
|
||||
|
||||
if (!p_QupZilla->weView(m_clickedTab)->history()->canGoBack())
|
||||
menu.actions().at(2)->setEnabled(false);
|
||||
|
||||
if (!p_QupZilla->weView(m_clickedTab)->history()->canGoForward())
|
||||
menu.actions().at(3)->setEnabled(false);
|
||||
|
||||
if (!p_QupZilla->weView(m_clickedTab)->isLoading())
|
||||
menu.actions().at(4)->setEnabled(false);
|
||||
}else{
|
||||
} else {
|
||||
menu.addAction(tr("Reload All Tabs"), tabWidget, SLOT(reloadAllTabs()));
|
||||
menu.addAction(tr("Bookmark All Tabs"), p_QupZilla, SLOT(bookmarkAllTabs()));
|
||||
menu.addSeparator();
|
||||
|
@ -47,6 +47,7 @@ signals:
|
||||
void forwardTab(int index);
|
||||
void closeAllButCurrent(int index);
|
||||
void closeTab(int index);
|
||||
void duplicateTab(int index);
|
||||
|
||||
public slots:
|
||||
|
||||
@ -58,6 +59,7 @@ private slots:
|
||||
void forwardTab() { emit forwardTab(m_clickedTab); }
|
||||
void closeAllButCurrent() { emit closeAllButCurrent(m_clickedTab); }
|
||||
void closeTab() { emit closeTab(m_clickedTab); }
|
||||
void duplicateTab() { emit duplicateTab(m_clickedTab); }
|
||||
void bookmarkTab();
|
||||
void pinTab();
|
||||
void closeCurrentTab();
|
||||
|
@ -121,6 +121,7 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent) :
|
||||
connect(m_tabBar, SIGNAL(stopTab(int)), this, SLOT(stopTab(int)));
|
||||
connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(closeTab(int)));
|
||||
connect(m_tabBar, SIGNAL(closeAllButCurrent(int)), this, SLOT(closeAllButCurrent(int)));
|
||||
connect(m_tabBar, SIGNAL(duplicateTab(int)), this, SLOT(duplicateTab(int)));
|
||||
|
||||
m_buttonListTabs = new TabListButton(this);
|
||||
m_menuTabs = new QMenu();
|
||||
@ -328,6 +329,18 @@ void TabWidget::closeAllButCurrent(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void TabWidget::duplicateTab(int index)
|
||||
{
|
||||
QUrl url = weView(index)->url();
|
||||
QByteArray history;
|
||||
QDataStream tabHistoryStream(&history, QIODevice::WriteOnly);
|
||||
tabHistoryStream << *weView(index)->history();
|
||||
|
||||
int id = addView(url, tr("New tab"), TabWidget::NewSelectedTab);
|
||||
QDataStream historyStream(history);
|
||||
historyStream >> *weView(id)->history();
|
||||
}
|
||||
|
||||
void TabWidget::restoreClosedTab()
|
||||
{
|
||||
if (m_lastTabUrl.isEmpty())
|
||||
@ -460,8 +473,6 @@ bool TabWidget::restoreState(const QByteArray &state)
|
||||
stream >> currentTab;
|
||||
stream >> tabHistory;
|
||||
|
||||
qDebug() << "restoring: " << openTabs;
|
||||
|
||||
for (int i = 0; i < openTabs.count(); ++i) {
|
||||
QUrl url = QUrl::fromEncoded(openTabs.at(i).toUtf8());
|
||||
|
||||
|
@ -61,6 +61,7 @@ public slots:
|
||||
void stopTab(int index) { weView(index)->stop(); }
|
||||
void backTab(int index) { weView(index)->back(); }
|
||||
void forwardTab(int index) { weView(index)->forward(); }
|
||||
void duplicateTab(int index);
|
||||
void closeAllButCurrent(int index);
|
||||
void restoreClosedTab();
|
||||
|
||||
|
@ -1058,12 +1058,12 @@ nebyl nalezen!</translation>
|
||||
<context>
|
||||
<name>MainApplication</name>
|
||||
<message>
|
||||
<location filename="../src/app/mainapplication.cpp" line="478"/>
|
||||
<location filename="../src/app/mainapplication.cpp" line="479"/>
|
||||
<source>Last session crashed</source>
|
||||
<translation>Poslední relace spadla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/app/mainapplication.cpp" line="479"/>
|
||||
<location filename="../src/app/mainapplication.cpp" line="480"/>
|
||||
<source><b>QupZilla crashed :-(</b><br/>Oops, last session of QupZilla ends with its crash. We are very sorry. Would you try to restore saved state?</source>
|
||||
<translation><b>QupZilla spadla :-(</b><br/>Oops, poslední relace QupZilly skončila jejím pádem. Velice se omlouváme. Přejete si obnovit uložený stav?</translation>
|
||||
</message>
|
||||
@ -2773,71 +2773,66 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku.</
|
||||
<name>TabBar</name>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="60"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="236"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="217"/>
|
||||
<source>New tab</source>
|
||||
<translation>Nový panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="72"/>
|
||||
<source>Back</source>
|
||||
<translation>Zpět</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="79"/>
|
||||
<source>Forward</source>
|
||||
<translation>Vpřed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="86"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="73"/>
|
||||
<source>Stop Tab</source>
|
||||
<translation>Zastavit panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="93"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="81"/>
|
||||
<source>Reload Tab</source>
|
||||
<translation>Obnovit panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="83"/>
|
||||
<source>Duplicate Tab</source>
|
||||
<translation>Duplikovat panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="84"/>
|
||||
<source>Unpin Tab</source>
|
||||
<translation>Odepnout panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="84"/>
|
||||
<source>Pin Tab</source>
|
||||
<translation>Připnout panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="96"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="116"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="86"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="97"/>
|
||||
<source>Reload All Tabs</source>
|
||||
<oldsource>Close other tabs</oldsource>
|
||||
<translation>Obnovit všechny panely</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="97"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="87"/>
|
||||
<source>Bookmark This Tab</source>
|
||||
<translation>Přidat panel do záložek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="88"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="98"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="117"/>
|
||||
<source>Bookmark All Tabs</source>
|
||||
<translation>Přidat všechny panely do záložek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="90"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="100"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="119"/>
|
||||
<source>Restore Closed Tab</source>
|
||||
<translation>Obnovit zavřený panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="103"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="93"/>
|
||||
<source>Close Other Tabs</source>
|
||||
<translation>Zavřít ostatní panely</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="104"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
@ -2845,32 +2840,33 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku.</
|
||||
<context>
|
||||
<name>TabWidget</name>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="129"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="130"/>
|
||||
<source>Show list of opened tabs</source>
|
||||
<translation>Zobrazit seznam otevřených panelů</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="134"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="135"/>
|
||||
<source>Add Tab</source>
|
||||
<translation>Nový panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="170"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="171"/>
|
||||
<source>Loading...</source>
|
||||
<translation>Načítám...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="173"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="289"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="174"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="290"/>
|
||||
<source>No Named Page</source>
|
||||
<translation>Bezejmenná stránka</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="189"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="190"/>
|
||||
<source>Actually You have %1 opened tabs</source>
|
||||
<translation>Dohromady máte otevřeno %1 panelů</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="339"/>
|
||||
<location filename="../src/webview/tabwidget.h" line="58"/>
|
||||
<source>New tab</source>
|
||||
<translation>Nový panel</translation>
|
||||
|
@ -1060,12 +1060,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>MainApplication</name>
|
||||
<message>
|
||||
<location filename="../src/app/mainapplication.cpp" line="478"/>
|
||||
<location filename="../src/app/mainapplication.cpp" line="479"/>
|
||||
<source>Last session crashed</source>
|
||||
<translation>Posledná relácia spadla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/app/mainapplication.cpp" line="479"/>
|
||||
<location filename="../src/app/mainapplication.cpp" line="480"/>
|
||||
<source><b>QupZilla crashed :-(</b><br/>Oops, last session of QupZilla ends with its crash. We are very sorry. Would you try to restore saved state?</source>
|
||||
<translation><b>QupZilla spadla :-(</b><br/>Oops, posledná relácia QupZilly skončila chybou. Prepáčte. Chcete obnoviť uložený stav?</translation>
|
||||
</message>
|
||||
@ -2773,71 +2773,66 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku.</tran
|
||||
<name>TabBar</name>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="60"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="236"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="217"/>
|
||||
<source>New tab</source>
|
||||
<translation>Nový panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="72"/>
|
||||
<source>Back</source>
|
||||
<translation>Späť</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="79"/>
|
||||
<source>Forward</source>
|
||||
<translation>Dopredu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="86"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="73"/>
|
||||
<source>Stop Tab</source>
|
||||
<translation>Zastaviť panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="93"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="81"/>
|
||||
<source>Reload Tab</source>
|
||||
<translation>Obnoviť panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="83"/>
|
||||
<source>Duplicate Tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="84"/>
|
||||
<source>Unpin Tab</source>
|
||||
<translation>Odopnúť panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="84"/>
|
||||
<source>Pin Tab</source>
|
||||
<translation>Pripnúť panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="97"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="87"/>
|
||||
<source>Bookmark This Tab</source>
|
||||
<translation>Založiť tento panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="88"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="98"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="117"/>
|
||||
<source>Bookmark All Tabs</source>
|
||||
<translation>Založiť všetky panely</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="90"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="100"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="119"/>
|
||||
<source>Restore Closed Tab</source>
|
||||
<translation>Obnoviť zavretý panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="103"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="93"/>
|
||||
<source>Close Other Tabs</source>
|
||||
<translation>Zavrieť ostatné panely</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="96"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="116"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="86"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="97"/>
|
||||
<source>Reload All Tabs</source>
|
||||
<oldsource>Restore closed tab</oldsource>
|
||||
<translation>Obnoviť všetky panely</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabbar.cpp" line="104"/>
|
||||
<location filename="../src/webview/tabbar.cpp" line="94"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavrieť</translation>
|
||||
</message>
|
||||
@ -2845,32 +2840,33 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku.</tran
|
||||
<context>
|
||||
<name>TabWidget</name>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="129"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="130"/>
|
||||
<source>Show list of opened tabs</source>
|
||||
<translation>Zobraziť zoznam otvorených panelov</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="134"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="135"/>
|
||||
<source>Add Tab</source>
|
||||
<translation>Pridať panel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="170"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="171"/>
|
||||
<source>Loading...</source>
|
||||
<translation>Nahrávam...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="173"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="289"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="174"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="290"/>
|
||||
<source>No Named Page</source>
|
||||
<translation>Stránka bez mena</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="189"/>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="190"/>
|
||||
<source>Actually You have %1 opened tabs</source>
|
||||
<translation>Momentálne otvorených %1 panelov</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/webview/tabwidget.cpp" line="339"/>
|
||||
<location filename="../src/webview/tabwidget.h" line="58"/>
|
||||
<source>New tab</source>
|
||||
<translation>Nový panel</translation>
|
||||
|
Loading…
Reference in New Issue
Block a user