diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-12-12 17:26:42 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-12-12 17:26:42 +0100 |
commit | d424d2628c326e7a3580c8fa896f7bc9dbde69ef (patch) | |
tree | 624c674f3e7751bcd60affbe02385730bf475239 /src | |
parent | rekonq 0.8.56 (diff) | |
download | rekonq-d424d2628c326e7a3580c8fa896f7bc9dbde69ef.tar.xz |
Option to open links from external apps in new window
Initial patch by Pali Rohar. Thanks :D
REVIEW: 102330
REVIEWED-BY: adjam
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 28 | ||||
-rw-r--r-- | src/rekonq.kcfg | 3 | ||||
-rw-r--r-- | src/settings/settings_tabs.ui | 7 |
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> |