mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Preferences: New option "Automatically switch to newly opened tabs"
- also removed unnecessary option to make tabs movable * everyone wants the tabs to be movable :-) closes #382
This commit is contained in:
parent
38ef828b82
commit
1a5ad1413b
@ -160,10 +160,10 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
||||
|
||||
//TABS
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
ui->makeMovable->setChecked(settings.value("makeTabsMovable", true).toBool());
|
||||
ui->hideTabsOnTab->setChecked(settings.value("hideTabsWithOneTab", false).toBool());
|
||||
ui->activateLastTab->setChecked(settings.value("ActivateLastTabWhenClosingActual", false).toBool());
|
||||
ui->openNewTabAfterActive->setChecked(settings.value("newTabAfterActive", true).toBool());
|
||||
ui->switchToNewTabs->setChecked(settings.value("OpenNewTabsSelected", false).toBool());
|
||||
ui->dontQuitOnTab->setChecked(settings.value("dontQuitWithOneTab", false).toBool());
|
||||
ui->askWhenClosingMultipleTabs->setChecked(settings.value("AskOnClosing", false).toBool());
|
||||
ui->closedInsteadOpened->setChecked(settings.value("closedInsteadOpenedTabs", false).toBool());
|
||||
@ -748,7 +748,6 @@ void Preferences::saveSettings()
|
||||
|
||||
//WINDOW
|
||||
settings.beginGroup("Browser-View-Settings");
|
||||
|
||||
settings.setValue("showStatusbar", ui->showStatusbar->isChecked());
|
||||
settings.setValue("showBookmarksToolbar", ui->showBookmarksToolbar->isChecked());
|
||||
settings.setValue("showNavigationToolbar", ui->showNavigationToolbar->isChecked());
|
||||
@ -760,10 +759,10 @@ void Preferences::saveSettings()
|
||||
|
||||
//TABS
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
settings.setValue("makeTabsMovable", ui->makeMovable->isChecked());
|
||||
settings.setValue("hideTabsWithOneTab", ui->hideTabsOnTab->isChecked());
|
||||
settings.setValue("ActivateLastTabWhenClosingActual", ui->activateLastTab->isChecked());
|
||||
settings.setValue("newTabAfterActive", ui->openNewTabAfterActive->isChecked());
|
||||
settings.setValue("OpenNewTabsSelected", ui->switchToNewTabs->isChecked());
|
||||
settings.setValue("dontQuitWithOneTab", ui->dontQuitOnTab->isChecked());
|
||||
settings.setValue("AskOnClosing", ui->askWhenClosingMultipleTabs->isChecked());
|
||||
settings.setValue("closedInsteadOpenedTabs", ui->closedInsteadOpened->isChecked());
|
||||
|
@ -619,13 +619,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="makeMovable">
|
||||
<property name="text">
|
||||
<string>Make tabs movable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<property name="orientation">
|
||||
@ -639,13 +632,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="showTabPreviews">
|
||||
<property name="text">
|
||||
<string>Show tab previews</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="hideTabsOnTab">
|
||||
<property name="text">
|
||||
@ -667,28 +653,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="dontQuitOnTab">
|
||||
<property name="text">
|
||||
<string>Don't quit upon closing last tab</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="askWhenClosingMultipleTabs">
|
||||
<property name="text">
|
||||
<string>Ask when closing multiple tabs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="closedInsteadOpened">
|
||||
<property name="text">
|
||||
<string>Closed tabs list instead of opened in tab bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="14" column="1">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -701,35 +687,35 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="14" column="0" colspan="2">
|
||||
<item row="15" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string><b>Address Bar behaviour</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1" colspan="2">
|
||||
<item row="16" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="selectAllOnFocus">
|
||||
<property name="text">
|
||||
<string>Select all text by double clicking in address bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="1">
|
||||
<item row="17" column="1">
|
||||
<widget class="QCheckBox" name="selectAllOnClick">
|
||||
<property name="text">
|
||||
<string>Select all text by clicking in address bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="1">
|
||||
<item row="18" column="1">
|
||||
<widget class="QCheckBox" name="addCountryWithAlt">
|
||||
<property name="text">
|
||||
<string>Add .co.uk domain by pressing ALT key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<item row="19" column="1">
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -769,6 +755,20 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="showTabPreviews">
|
||||
<property name="text">
|
||||
<string>Show tab previews</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="switchToNewTabs">
|
||||
<property name="text">
|
||||
<string>Automatically switch to newly opened tab</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="stackedWidgetPage4">
|
||||
@ -2238,7 +2238,6 @@
|
||||
<tabstop>createProfile</tabstop>
|
||||
<tabstop>deleteProfile</tabstop>
|
||||
<tabstop>tabWidget_2</tabstop>
|
||||
<tabstop>makeMovable</tabstop>
|
||||
<tabstop>hideTabsOnTab</tabstop>
|
||||
<tabstop>askWhenClosingMultipleTabs</tabstop>
|
||||
<tabstop>selectAllOnFocus</tabstop>
|
||||
|
@ -80,7 +80,6 @@ void TabBar::loadSettings()
|
||||
Settings settings;
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
|
||||
setMovable(settings.value("makeTabsMovable", true).toBool());
|
||||
m_tabPreview->setAnimationsEnabled(settings.value("tabPreviewAnimationsEnabled", true).toBool());
|
||||
m_showTabPreviews = settings.value("showTabPreviews", true).toBool();
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
int WebSettings::defaultZoom = 100;
|
||||
bool WebSettings::loadTabsOnActivation = false;
|
||||
|
||||
Qz::NewTabPositionFlag WebSettings::newTabPosition;
|
||||
QStringList WebSettings::autoOpenProtocols;
|
||||
QStringList WebSettings::blockedProtocols;
|
||||
|
||||
@ -36,6 +37,10 @@ void WebSettings::loadSettings()
|
||||
blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList();
|
||||
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup("Browser-Tabs-Settings");
|
||||
newTabPosition = settings.value("OpenNewTabsSelected", false).toBool() ? Qz::NT_SelectedTab : Qz::NT_NotSelectedTab;
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
void WebSettings::saveSettings()
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
static int defaultZoom;
|
||||
static bool loadTabsOnActivation;
|
||||
|
||||
static Qz::NewTabPositionFlag newTabPosition;
|
||||
static QStringList autoOpenProtocols;
|
||||
static QStringList blockedProtocols;
|
||||
};
|
||||
|
@ -497,6 +497,16 @@ void WebView::openUrlInBackgroundTab()
|
||||
}
|
||||
}
|
||||
|
||||
void WebView::userDefinedOpenUrlInNewTab(const QUrl &url)
|
||||
{
|
||||
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||
openUrlInNewTab(action->data().toUrl(), WebSettings::newTabPosition);
|
||||
}
|
||||
else {
|
||||
openUrlInNewTab(url, WebSettings::newTabPosition);
|
||||
}
|
||||
}
|
||||
|
||||
void WebView::loadClickedFrame()
|
||||
{
|
||||
QUrl frameUrl = m_clickedFrame->baseUrl();
|
||||
@ -770,7 +780,7 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction(QIcon(":/icons/menu/popup.png"), tr("Open link in new &tab"), this, SLOT(openUrlInBackgroundTab()))->setData(hitTest.linkUrl());
|
||||
menu->addAction(QIcon(":/icons/menu/popup.png"), tr("Open link in new &tab"), this, SLOT(userDefinedOpenUrlInNewTab()))->setData(hitTest.linkUrl());
|
||||
menu->addAction(QIcon::fromTheme("window-new"), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
|
||||
menu->addSeparator();
|
||||
menu->addAction(qIconProvider->fromTheme("user-bookmarks"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(hitTest.linkUrl());
|
||||
@ -791,7 +801,7 @@ void WebView::createImageContextMenu(QMenu* menu, const QWebHitTestResult &hitTe
|
||||
Action* act = new Action(tr("Show i&mage"));
|
||||
act->setData(hitTest.imageUrl());
|
||||
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
|
||||
connect(act, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab()));
|
||||
connect(act, SIGNAL(middleClicked()), this, SLOT(userDefinedOpenUrlInNewTab()));
|
||||
menu->addAction(act);
|
||||
menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(hitTest.imageUrl());
|
||||
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl());
|
||||
@ -845,7 +855,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
|
||||
act->setData(guessedUrl);
|
||||
|
||||
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
|
||||
connect(act, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab()));
|
||||
connect(act, SIGNAL(middleClicked()), this, SLOT(userDefinedOpenUrlInNewTab()));
|
||||
menu->addAction(act);
|
||||
}
|
||||
|
||||
@ -976,7 +986,7 @@ void WebView::mousePressEvent(QMouseEvent* event)
|
||||
if (frame) {
|
||||
const QUrl &link = frame->hitTestContent(event->pos()).linkUrl();
|
||||
if (event->modifiers() == Qt::ControlModifier && isUrlValid(link)) {
|
||||
openUrlInNewTab(link, Qz::NT_NotSelectedTab);
|
||||
userDefinedOpenUrlInNewTab(link);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
@ -1002,7 +1012,7 @@ void WebView::mouseReleaseEvent(QMouseEvent* event)
|
||||
if (frame) {
|
||||
const QUrl &link = frame->hitTestContent(event->pos()).linkUrl();
|
||||
if (m_clickedUrl == link && isUrlValid(link)) {
|
||||
openUrlInNewTab(link, Qz::NT_NotSelectedTab);
|
||||
userDefinedOpenUrlInNewTab(link);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
|
@ -101,6 +101,9 @@ protected slots:
|
||||
void openUrlInSelectedTab();
|
||||
void openUrlInBackgroundTab();
|
||||
|
||||
// To support user's option whether to open in selected or background tab
|
||||
void userDefinedOpenUrlInNewTab(const QUrl &url = QUrl());
|
||||
|
||||
void createSearchEngine();
|
||||
|
||||
// Clicked frame actions
|
||||
|
Loading…
Reference in New Issue
Block a user