summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp28
-rw-r--r--src/rekonq.kcfg3
-rw-r--r--src/settings/settings_tabs.ui7
3 files changed, 30 insertions, 8 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 5c6e9659..b76e52c1 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -212,6 +212,7 @@ int Application::newInstance()
urlList += KUrl(args->arg(i)); // "rekonq kde.org" || "rekonq kde:kdialog" case
}
+ // first argument: 99% of the time we have just that...
if (isFirstLoad && !isRekonqCrashed)
{
// No windows in the current desktop? No windows at all?
@@ -220,26 +221,37 @@ int Application::newInstance()
}
else
{
- if (ReKonfig::openTabNoWindow())
+ if (!ReKonfig::openExternalLinksInNewWindow())
{
loadUrl(urlList.at(0), Rekonq::NewTab);
- if (!mainWindow()->isActiveWindow())
- KWindowSystem::demandAttention(mainWindow()->winId(), true);
}
else
+ {
loadUrl(urlList.at(0), Rekonq::NewWindow);
+ }
+
+ if (!mainWindow()->isActiveWindow())
+ KWindowSystem::demandAttention(mainWindow()->winId(), true);
}
- for (int i = 1; i < urlList.count(); ++i)
- loadUrl(urlList.at(i), Rekonq::NewTab);
+ // following arguments: what's best behavior here? I'm pretty sure no one has real opinion here
+ if (!ReKonfig::openExternalLinksInNewWindow())
+ {
+ for (int i = 1; i < urlList.count(); ++i)
+ loadUrl(urlList.at(i), Rekonq::NewTab);
+ }
+ else
+ {
+ for (int i = 1; i < urlList.count(); ++i)
+ loadUrl(urlList.at(i), Rekonq::NewWindow);
+ }
KStartupInfo::appStarted();
-
}
else
{
-
- if (isFirstLoad && !isRekonqCrashed) // we are starting rekonq, for the first time with no args: use startup behaviour
+ // we are starting rekonq, for the first time with no args: use startup behaviour
+ if (isFirstLoad && !isRekonqCrashed)
{
switch (ReKonfig::startupBehaviour())
{
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index fcff5bbb..08bae46b 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -117,6 +117,9 @@
<entry name="openTabNoWindow" type="Bool">
<default>true</default>
</entry>
+ <entry name="openExternalLinksInNewWindow" type="Bool">
+ <default>false</default>
+ </entry>
<entry name="lastTabClosesWindow" type="Bool">
<default>false</default>
</entry>
diff --git a/src/settings/settings_tabs.ui b/src/settings/settings_tabs.ui
index 2591fb4d..d9a79d18 100644
--- a/src/settings/settings_tabs.ui
+++ b/src/settings/settings_tabs.ui
@@ -198,6 +198,13 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="kcfg_openExternalLinksInNewWindow">
+ <property name="text">
+ <string>Open external links in a new window</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="kcfg_lastTabClosesWindow">
<property name="text">
<string>Closing last tab closes window</string>