diff options
author | wi <william.os4y@gmail.com> | 2015-05-01 18:37:56 +0200 |
---|---|---|
committer | wi <william.os4y@gmail.com> | 2015-05-01 18:37:56 +0200 |
commit | 390f314e147e9d36ec1bbedf3c52296ca01e956b (patch) | |
tree | 3738660c765898e928f28a3d09e929e2b0f9b87b /lumina-fm/MainUI.cpp | |
parent | Add a contextMenu allowing the user to open a terminal in the selected folder (diff) | |
download | lumina-390f314e147e9d36ec1bbedf3c52296ca01e956b.tar.gz lumina-390f314e147e9d36ec1bbedf3c52296ca01e956b.tar.bz2 lumina-390f314e147e9d36ec1bbedf3c52296ca01e956b.zip |
use the termnial application specified by the user as the default-terminal.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index ce3c4bd2..5446802c 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -1433,13 +1433,19 @@ void MainUI::ViewPropertiesItem(){ void MainUI::openTerminal(){ QFileInfoList sel = getSelectedItems(); QString shell; + //we get the shell has defined in the environment if (getenv("SHELL")) shell = QString(getenv("SHELL")); else shell = QString("/bin/sh"); + //we use the application defined as thate default terminal + QSettings *sessionsettings = new QSettings( QSettings::UserScope, "LuminaDE","sessionsettings", this); + //xterm remains the default + QString defTerminal = sessionsettings->value("default-terminal", "xterm").toString(); if(sel.isEmpty()){ - //TODO: replace xterm by the user's choice - QProcess::startDetached("xterm -e \"cd " + getCurrentDir() + " && " + shell + " \" "); + //-e is the parameter for most of the terminal appliction to execute an external command. + //In your case we start a shell in the selected directory + QProcess::startDetached(defTerminal + " -e \"cd " + getCurrentDir() + " && " + shell + " \" "); } else { - QProcess::startDetached("xterm -e \"cd " + sel[0].absoluteFilePath() + " && " + shell + " \" "); + QProcess::startDetached(defTerminal + " -e \"cd " + sel[0].absoluteFilePath() + " && " + shell + " \" "); } } |