summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-11-06 01:08:45 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-11-09 12:28:17 (GMT)
commita30be88f3bd62b84b1c4760cf7fa3fbef32ef23e (patch)
tree429435855cdc49c9ee3df220158490b922c4a970
parent3ff022527e53cd5daa6fe8589de81b5988457945 (diff)
Add setting for using multiple instances
Adds a setting for forcing the use of multiple instances instead of running all instances in the same process. This way all terminals don't go down when one instance crashes. REVIEW: 129345
-rw-r--r--src/main.cpp6
-rw-r--r--src/settings/GeneralSettings.ui20
-rw-r--r--src/settings/konsole.kcfg5
3 files changed, 29 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c9c36c0..26d3da9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,6 +21,7 @@
#include "Application.h"
#include "MainWindow.h"
#include "config-konsole.h"
+#include "KonsoleSettings.h"
// OS specific
#include <qplatformdefs.h>
@@ -116,6 +117,11 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])
parser->process(*app);
about.processCommandLine(parser.data());
+ // Enable user to force multiple instances
+ if (!Konsole::KonsoleSettings::useSingleInstance()) {
+ startupOption = KDBusService::Multiple;
+ }
+
atexit(deleteQApplication);
// Ensure that we only launch a new instance if we need to
// If there is already an instance running, we will quit here
diff --git a/src/settings/GeneralSettings.ui b/src/settings/GeneralSettings.ui
index ecfec94..8d19101 100644
--- a/src/settings/GeneralSettings.ui
+++ b/src/settings/GeneralSettings.ui
@@ -71,6 +71,22 @@
</widget>
</item>
<item row="3" column="0">
+ <widget class="QCheckBox" name="kcfg_UseSingleInstance">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>When launching Konsole re-use existing process if possible</string>
+ </property>
+ <property name="text">
+ <string>Run all Konsole windows in a single process</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
<widget class="QCheckBox" name="kcfg_AllowMenuAccelerators">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -83,7 +99,7 @@
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QCheckBox" name="kcfg_ShowWindowTitleOnTitleBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -96,7 +112,7 @@
</property>
</widget>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<widget class="QCheckBox" name="kcfg_ShowAppNameOnTitleBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
diff --git a/src/settings/konsole.kcfg b/src/settings/konsole.kcfg
index 932a38c..075d2f7 100644
--- a/src/settings/konsole.kcfg
+++ b/src/settings/konsole.kcfg
@@ -35,6 +35,11 @@
<tooltip>The window size will be saved upon exiting Konsole</tooltip>
<default>true</default>
</entry>
+ <entry name="UseSingleInstance" type="Bool">
+ <label>Run all Konsole windows in a single process</label>
+ <tooltip>When launching Konsole re-use existing process if possible</tooltip>
+ <default>false</default>
+ </entry>
</group>
<group name="TabBar">
<entry name="TabBarVisibility" type="Enum">