diff --git a/CHANGELOG b/CHANGELOG index 67dc5f670..56b6de0ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,7 @@ Version 1.5.0 * proxy exceptions now supports wildcards (*, ?) * cancel upload when trying to upload non-readable files * select previous / next engines with ctrl+up/down in websearchbar + * ask user first before closing all but the current tab from tabbar * GreaseMonkey: added icon in statusbar * GreaseMonkey: added support for GM_Settings * GreaseMonkey: fixed userscripts when first loading plugin diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index 0b7259db3..eb1d0c4b7 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -187,6 +188,16 @@ void TabBar::contextMenuRequested(const QPoint &position) p_QupZilla->actionRestoreTab()->setEnabled(true); } +void TabBar::closeAllButCurrent() +{ + QMessageBox::StandardButton button = QMessageBox::question(this, tr("Close Tabs"), tr("Do you really want to close other tabs?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + + if (button == QMessageBox::Yes) { + emit closeAllButCurrent(m_clickedTab); + } +} + QSize TabBar::tabSizeHint(int index) const { if (!isVisible() || !mApp->proxyStyle()) { diff --git a/src/lib/webview/tabbar.h b/src/lib/webview/tabbar.h index 29e3159c1..88c9d5595 100644 --- a/src/lib/webview/tabbar.h +++ b/src/lib/webview/tabbar.h @@ -75,10 +75,10 @@ private slots: void contextMenuRequested(const QPoint &position); void reloadTab() { emit reloadTab(m_clickedTab); } void stopTab() { emit stopTab(m_clickedTab); } - void closeAllButCurrent() { emit closeAllButCurrent(m_clickedTab); } void closeTab() { emit closeTab(m_clickedTab); } void duplicateTab() { emit duplicateTab(m_clickedTab); } void detachTab() { emit detachTab(m_clickedTab); } + void closeAllButCurrent(); void bookmarkTab(); void pinTab(); diff --git a/translations/empty.ts b/translations/empty.ts index e355ace04..e42794b4d 100644 --- a/translations/empty.ts +++ b/translations/empty.ts @@ -3854,7 +3854,7 @@ Please install latest version of QupZilla. - + The file is not an OpenSearch 1.1 file. @@ -3996,7 +3996,7 @@ Please install latest version of QupZilla. - + Close Tab @@ -5172,7 +5172,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla - + Add Search Engine @@ -5195,27 +5195,27 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SearchEnginesManager - + Search Engine Added - + Search Engine "%1" has been successfully added. - + Search Engine is not valid! - + Error - + Error while adding Search Engine <br><b>Error Message: </b> %1 @@ -5773,76 +5773,86 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla TabBar - + &New tab - + &Stop Tab - + &Reload Tab - + &Duplicate Tab - + D&etach Tab - + Un&pin Tab - + &Pin Tab - + Re&load All Tabs - + &Bookmark This Tab - - + + Bookmark &All Tabs - + Close Ot&her Tabs - + Cl&ose - + Reloa&d All Tabs - + Restore &Closed Tab + + + Close Tabs + + + + + Do you really want to close other tabs? + + TabWidget