From 390f314e147e9d36ec1bbedf3c52296ca01e956b Mon Sep 17 00:00:00 2001 From: wi Date: Fri, 1 May 2015 18:37:56 +0200 Subject: use the termnial application specified by the user as the default-terminal. --- lumina-fm/MainUI.cpp | 12 +++++++++--- 1 file 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 + " \" "); } } -- cgit