diff --git a/bin/locale/cs_CZ.qm b/bin/locale/cs_CZ.qm index 131e92e9e..11d367646 100644 Binary files a/bin/locale/cs_CZ.qm and b/bin/locale/cs_CZ.qm differ diff --git a/src/webview/tabbar.cpp b/src/webview/tabbar.cpp index 7ea047703..67d340558 100644 --- a/src/webview/tabbar.cpp +++ b/src/webview/tabbar.cpp @@ -63,34 +63,24 @@ void TabBar::contextMenuRequested(const QPoint &position) WebTab* webTab = qobject_cast(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(); diff --git a/src/webview/tabbar.h b/src/webview/tabbar.h index cdc0e9c97..35f619231 100644 --- a/src/webview/tabbar.h +++ b/src/webview/tabbar.h @@ -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(); diff --git a/src/webview/tabwidget.cpp b/src/webview/tabwidget.cpp index 502ed1aef..b1702732e 100644 --- a/src/webview/tabwidget.cpp +++ b/src/webview/tabwidget.cpp @@ -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()); diff --git a/src/webview/tabwidget.h b/src/webview/tabwidget.h index 8add92ee0..7fda3e44e 100644 --- a/src/webview/tabwidget.h +++ b/src/webview/tabwidget.h @@ -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(); diff --git a/translations/cs_CZ.ts b/translations/cs_CZ.ts index 657006e1f..eb1cb00af 100644 --- a/translations/cs_CZ.ts +++ b/translations/cs_CZ.ts @@ -1058,12 +1058,12 @@ nebyl nalezen! MainApplication - + Last session crashed Poslední relace spadla - + <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? <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? @@ -2773,71 +2773,66 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku.TabBar - + New tab Nový panel - - Back - Zpět - - - - Forward - Vpřed - - - + Stop Tab Zastavit panel - + Reload Tab Obnovit panel - + + Duplicate Tab + Duplikovat panel + + + Unpin Tab Odepnout panel - + Pin Tab Připnout panel - - + + Reload All Tabs Close other tabs Obnovit všechny panely - + Bookmark This Tab Přidat panel do záložek + - Bookmark All Tabs Přidat všechny panely do záložek + - Restore Closed Tab Obnovit zavřený panel - + Close Other Tabs Zavřít ostatní panely - + Close Zavřít @@ -2845,32 +2840,33 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku. TabWidget - + Show list of opened tabs Zobrazit seznam otevřených panelů - + Add Tab Nový panel - + Loading... Načítám... - - + + No Named Page Bezejmenná stránka - + Actually You have %1 opened tabs Dohromady máte otevřeno %1 panelů + New tab Nový panel diff --git a/translations/sk_SK.ts b/translations/sk_SK.ts index eee0dd7b5..0846c3760 100644 --- a/translations/sk_SK.ts +++ b/translations/sk_SK.ts @@ -1060,12 +1060,12 @@ p, li { white-space: pre-wrap; } MainApplication - + Last session crashed Posledná relácia spadla - + <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? <b>QupZilla spadla :-(</b><br/>Oops, posledná relácia QupZilly skončila chybou. Prepáčte. Chcete obnoviť uložený stav? @@ -2773,71 +2773,66 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku.TabBar - + New tab Nový panel - - Back - Späť - - - - Forward - Dopredu - - - + Stop Tab Zastaviť panel - + Reload Tab Obnoviť panel - + + Duplicate Tab + + + + Unpin Tab Odopnúť panel - + Pin Tab Pripnúť panel - + Bookmark This Tab Založiť tento panel + - Bookmark All Tabs Založiť všetky panely + - Restore Closed Tab Obnoviť zavretý panel - + Close Other Tabs Zavrieť ostatné panely - - + + Reload All Tabs Restore closed tab Obnoviť všetky panely - + Close Zavrieť @@ -2845,32 +2840,33 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku. TabWidget - + Show list of opened tabs Zobraziť zoznam otvorených panelov - + Add Tab Pridať panel - + Loading... Nahrávam... - - + + No Named Page Stránka bez mena - + Actually You have %1 opened tabs Momentálne otvorených %1 panelov + New tab Nový panel