1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

[TabBar] Ask user before closing all other tabs.

Closes #1088
This commit is contained in:
nowrep 2013-11-21 18:37:59 +01:00
parent a49e574f83
commit 4f3aba95ff
4 changed files with 46 additions and 24 deletions

View File

@ -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

View File

@ -31,6 +31,7 @@
#include <QMenu>
#include <QMimeData>
#include <QMouseEvent>
#include <QMessageBox>
#include <QStyleOption>
#include <QApplication>
#include <QTimer>
@ -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()) {

View File

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

View File

@ -3854,7 +3854,7 @@ Please install latest version of QupZilla.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/opensearch/opensearchreader.cpp" line="108"/>
<location filename="../src/lib/opensearch/opensearchreader.cpp" line="104"/>
<source>The file is not an OpenSearch 1.1 file.</source>
<translation type="unfinished"></translation>
</message>
@ -3996,7 +3996,7 @@ Please install latest version of QupZilla.</source>
</message>
<message>
<location filename="../src/lib/app/qupzilla.cpp" line="416"/>
<location filename="../src/lib/webview/tabbar.cpp" line="703"/>
<location filename="../src/lib/webview/tabbar.cpp" line="714"/>
<source>Close Tab</source>
<translation type="unfinished"></translation>
</message>
@ -5172,7 +5172,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
</message>
<message>
<location filename="../src/lib/opensearch/searchenginesdialog.cpp" line="48"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="313"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="314"/>
<source>Add Search Engine</source>
<translation type="unfinished"></translation>
</message>
@ -5195,27 +5195,27 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
<context>
<name>SearchEnginesManager</name>
<message>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="399"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="400"/>
<source>Search Engine Added</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="399"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="400"/>
<source>Search Engine &quot;%1&quot; has been successfully added.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="406"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="407"/>
<source>Search Engine is not valid!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="407"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="408"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="407"/>
<location filename="../src/lib/opensearch/searchenginesmanager.cpp" line="408"/>
<source>Error while adding Search Engine &lt;br&gt;&lt;b&gt;Error Message: &lt;/b&gt; %1</source>
<translation type="unfinished"></translation>
</message>
@ -5773,76 +5773,86 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
<context>
<name>TabBar</name>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="139"/>
<location filename="../src/lib/webview/tabbar.cpp" line="140"/>
<source>&amp;New tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="148"/>
<location filename="../src/lib/webview/tabbar.cpp" line="149"/>
<source>&amp;Stop Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="151"/>
<location filename="../src/lib/webview/tabbar.cpp" line="152"/>
<source>&amp;Reload Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="154"/>
<location filename="../src/lib/webview/tabbar.cpp" line="155"/>
<source>&amp;Duplicate Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="157"/>
<location filename="../src/lib/webview/tabbar.cpp" line="158"/>
<source>D&amp;etach Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="160"/>
<location filename="../src/lib/webview/tabbar.cpp" line="161"/>
<source>Un&amp;pin Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="160"/>
<location filename="../src/lib/webview/tabbar.cpp" line="161"/>
<source>&amp;Pin Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="162"/>
<location filename="../src/lib/webview/tabbar.cpp" line="163"/>
<source>Re&amp;load All Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="163"/>
<location filename="../src/lib/webview/tabbar.cpp" line="164"/>
<source>&amp;Bookmark This Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="164"/>
<location filename="../src/lib/webview/tabbar.cpp" line="176"/>
<location filename="../src/lib/webview/tabbar.cpp" line="165"/>
<location filename="../src/lib/webview/tabbar.cpp" line="177"/>
<source>Bookmark &amp;All Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="170"/>
<location filename="../src/lib/webview/tabbar.cpp" line="171"/>
<source>Close Ot&amp;her Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="171"/>
<location filename="../src/lib/webview/tabbar.cpp" line="172"/>
<source>Cl&amp;ose</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="175"/>
<location filename="../src/lib/webview/tabbar.cpp" line="176"/>
<source>Reloa&amp;d All Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="178"/>
<location filename="../src/lib/webview/tabbar.cpp" line="179"/>
<source>Restore &amp;Closed Tab</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="193"/>
<source>Close Tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/webview/tabbar.cpp" line="193"/>
<source>Do you really want to close other tabs?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TabWidget</name>