Commit 08e17260 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Show a message if the current process is not the shell

If you try to connect via the ssh plugin when an application
is running, we will send the ssh commands to the terminal,
but in programs such as vim or nano this is not what you
want to do.

This patch explains this to the user.
parent 6dad1030
......@@ -402,7 +402,14 @@ void SSHManagerTreeWidget::connectRequested(const QModelIndex &idx)
bool ok = false;
QString processName = info->name(&ok);
if (!ok) {
qDebug() << "Could not get the process name, assume that we can't request a connection";
KMessageBox::messageBox(this,
KMessageBox::DialogType::Sorry,
i18n("Could not get the process name, assume that we can't request a connection"),
i18n("Error issuing SSH Command"),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KStandardGuiItem::cancel(),
QStringLiteral("error_process_name"));
return;
}
......@@ -414,7 +421,14 @@ void SSHManagerTreeWidget::connectRequested(const QModelIndex &idx)
QStringLiteral("ksh"),
QStringLiteral("zsh")})
.contains(processName)) {
qDebug() << "You have an application running on the top of the shell, can't request a connection.";
KMessageBox::messageBox(this,
KMessageBox::DialogType::Sorry,
i18n("Can't issue SSH command outside the shell application (eg, bash, zsh, sh)"),
i18n("Error issuing SSH Command"),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KStandardGuiItem::cancel(),
QStringLiteral("error_process_not_shell"));
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment