From d424d2628c326e7a3580c8fa896f7bc9dbde69ef Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 12 Dec 2011 17:26:42 +0100 Subject: Option to open links from external apps in new window Initial patch by Pali Rohar. Thanks :D REVIEW: 102330 REVIEWED-BY: adjam --- src/application.cpp | 28 ++++++++++++++++++++-------- src/rekonq.kcfg | 3 +++ src/settings/settings_tabs.ui | 7 +++++++ 3 files changed, 30 insertions(+), 8 deletions(-) (limited to 'src') 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 @@ true + + false + false 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 @@ -197,6 +197,13 @@ + + + + Open external links in a new window + + + -- cgit v1.2.1