forked from QupZilla/qupzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New option "Open new empty tabs after active tab".
Closes QupZilla#544
- Loading branch information
Showing
8 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* ============================================================ | ||
* QupZilla - WebKit based browser | ||
* Copyright (C) 2010-2012 David Rosca <[email protected]> | ||
* Copyright (C) 2010-2013 David Rosca <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -75,7 +75,9 @@ enum NewTabPositionFlag { | |
NT_NotSelectedTab = 2, | ||
NT_CleanTab = 4, | ||
NT_TabAtTheEnd = 8, | ||
NT_NewEmptyTab = 16, | ||
|
||
NT_SelectedNewEmptyTab = NT_SelectedTab | NT_TabAtTheEnd | NT_NewEmptyTab, | ||
NT_SelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd, | ||
NT_NotSelectedTabAtTheEnd = NT_NotSelectedTab | NT_TabAtTheEnd, | ||
NT_CleanSelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd | NT_CleanTab, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* ============================================================ | ||
* QupZilla - WebKit based browser | ||
* Copyright (C) 2010-2012 David Rosca <[email protected]> | ||
* Copyright (C) 2010-2013 David Rosca <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -64,7 +64,7 @@ void AddTabButton::mouseReleaseEvent(QMouseEvent* event) | |
QUrl guessedUrl = WebView::guessUrlFromString(selectionClipboard); | ||
|
||
if (!guessedUrl.isEmpty()) { | ||
m_tabWidget->addView(guessedUrl, Qz::NT_SelectedTabAtTheEnd); | ||
m_tabWidget->addView(guessedUrl, Qz::NT_SelectedNewEmptyTab); | ||
} | ||
} | ||
|
||
|
@@ -93,7 +93,7 @@ void AddTabButton::dropEvent(QDropEvent* event) | |
} | ||
|
||
foreach(const QUrl & url, mime->urls()) { | ||
m_tabWidget->addView(url, Qz::NT_SelectedTabAtTheEnd); | ||
m_tabWidget->addView(url, Qz::NT_SelectedNewEmptyTab); | ||
} | ||
} | ||
|
||
|
@@ -151,6 +151,7 @@ void TabWidget::loadSettings() | |
m_dontQuitWithOneTab = settings.value("dontQuitWithOneTab", false).toBool(); | ||
m_closedInsteadOpened = settings.value("closedInsteadOpenedTabs", false).toBool(); | ||
m_newTabAfterActive = settings.value("newTabAfterActive", true).toBool(); | ||
m_newEmptyTabAfterActive = settings.value("newEmptyTabAfterActive", false).toBool(); | ||
settings.endGroup(); | ||
|
||
settings.beginGroup("Web-URL-Settings"); | ||
|
@@ -288,7 +289,13 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT | |
url = m_urlOnNewTab; | ||
} | ||
|
||
if (position == -1 && m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd)) { | ||
bool openAfterActive = m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd); | ||
|
||
if (openFlags == Qz::NT_SelectedNewEmptyTab && m_newEmptyTabAfterActive) { | ||
openAfterActive = true; | ||
} | ||
|
||
if (openAfterActive && position == -1) { | ||
// If we are opening newBgTab from pinned tab, make sure it won't be | ||
// opened between other pinned tabs | ||
if (openFlags & Qz::NT_NotSelectedTab && m_lastBackgroundTabIndex != -1) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* ============================================================ | ||
* QupZilla - WebKit based browser | ||
* Copyright (C) 2010-2012 David Rosca <[email protected]> | ||
* Copyright (C) 2010-2013 David Rosca <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -140,6 +140,7 @@ private slots: | |
bool m_dontQuitWithOneTab; | ||
bool m_closedInsteadOpened; | ||
bool m_newTabAfterActive; | ||
bool m_newEmptyTabAfterActive; | ||
QUrl m_urlOnNewTab; | ||
QupZilla* p_QupZilla; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* ============================================================ | ||
* Mouse Gestures plugin for QupZilla | ||
* Copyright (C) 2012 David Rosca <[email protected]> | ||
* Copyright (C) 2013 David Rosca <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -135,7 +135,7 @@ void MouseGestures::downGestured() | |
return; | ||
} | ||
|
||
m_view.data()->openUrlInNewTab(QUrl(), Qz::NT_SelectedTabAtTheEnd); | ||
m_view.data()->openUrlInNewTab(QUrl(), Qz::NT_SelectedNewEmptyTab); | ||
} | ||
|
||
void MouseGestures::leftGestured() | ||
|