Commit 5e50b9a4 authored by Andrea Scarpino's avatar Andrea Scarpino

Allow to run SSH from HostIsDown

parent b4fb9d23
......@@ -76,6 +76,11 @@ ListItem {
text: qsTr("Forget")
onClicked: forget(host)
}
MenuItem {
text: qsTr("Open SSH")
onClicked: manager.openSSH(host)
}
}
onClicked: {
......
* Wed Jul 19 2016 Andrea Scarpino <me@andreascarpino.it> 0.6.3-1
- Do not allow host names with non standard characters
- Allow to run SSH from HostIsDown
* Wed Jul 13 2016 Andrea Scarpino <me@andreascarpino.it> 0.6.2-1
- Add Serbian translation
- Fix memory leak
......
......@@ -13,7 +13,7 @@ Name: harbour-hostisdown
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Check if the desired host is up or not
Version: 0.6.2
Version: 0.6.3
Release: 1
Group: Qt/Qt
License: MIT
......
Name: harbour-hostisdown
Summary: Check if the desired host is up or not
Version: 0.6.2
Version: 0.6.3
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
......
......@@ -27,6 +27,7 @@
#include <QCoreApplication>
#include <QDebug>
#include <QEventLoop>
#include <QProcess>
#include <QSettings>
#include <QSqlRecord>
#include <QTimer>
......@@ -54,6 +55,11 @@ HostsManager::~HostsManager()
delete m_db;
delete m_settings;
delete m_timer;
Q_FOREACH (QProcess *p, m_sshProcesses) {
p->kill();
delete p;
}
}
void HostsManager::clearHistory()
......@@ -68,6 +74,17 @@ void HostsManager::forget(const QString &host)
m_model->refresh();
}
void HostsManager::openSSH(const QString &host)
{
const QProcessEnvironment env;
const QString terminal = env.value(QLatin1Literal("TERMINAL"), QLatin1Literal("fingerterm"));
QProcess *ssh = new QProcess();
ssh->start(QStringLiteral("%1 -e \"ssh %2\"").arg(terminal).arg(host));
m_sshProcesses.append(ssh);
}
void HostsManager::pingAll()
{
QVariantMap pairs;
......
......@@ -30,6 +30,7 @@
#include "hostssqlmodel.h"
class DBManager;
class QProcess;
class QSettings;
class QTimer;
......@@ -42,11 +43,13 @@ public:
Q_INVOKABLE void clearHistory();
Q_INVOKABLE void forget(const QString &host);
Q_INVOKABLE void openSSH(const QString &host);
Q_INVOKABLE void ping(const QString &host, const bool ipv6);
Q_INVOKABLE void pingAll();
Q_INVOKABLE void pingLast();
Q_INVOKABLE quint16 getPoller() const;
Q_INVOKABLE void setPoller(const quint16 minutes);
HostsSqlModel* recentHosts();
Q_SIGNALS:
......@@ -60,6 +63,7 @@ private:
QSettings* m_settings;
QTimer* m_timer;
quint16 m_poller;
QList<QProcess *> m_sshProcesses;
};
......
......@@ -47,7 +47,12 @@
<translation>Dimentica</translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="87"/>
<location filename="../qml/pages/HostDelegate.qml" line="81"/>
<source>Open SSH</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="92"/>
<source>Deleting</source>
<translation>Sto cancellando...</translation>
</message>
......@@ -95,17 +100,17 @@
<translation>Un indirizzo IP o hostname</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Use IPv6</source>
<translation>Usa IPv6</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="148"/>
<location filename="../qml/pages/MainPage.qml" line="149"/>
<source>Ping it</source>
<translation>Manda un ping</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="156"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<source>History</source>
<translation>Cronologia</translation>
</message>
......@@ -125,7 +130,7 @@
<message>
<location filename="../qml/pages/Settings.qml" line="43"/>
<source>Pings every N minutes all hosts in the history</source>
<translation>Effettua un ping ogni N minuti su ogni host nella cronologia</translation>
<translation>Manda un ping ogni N minuti agli host in cronologia</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="51"/>
......
......@@ -47,7 +47,12 @@
<translation>Заборави</translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="87"/>
<location filename="../qml/pages/HostDelegate.qml" line="81"/>
<source>Open SSH</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="92"/>
<source>Deleting</source>
<translation>Брисање</translation>
</message>
......@@ -95,17 +100,17 @@
<translation>ИП адреса или хост-име</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Use IPv6</source>
<translation>Користи ИПв6</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="148"/>
<location filename="../qml/pages/MainPage.qml" line="149"/>
<source>Ping it</source>
<translation>Пингуј</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="156"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<source>History</source>
<translation>Историја</translation>
</message>
......
......@@ -47,7 +47,12 @@
<translation>Glöm</translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="87"/>
<location filename="../qml/pages/HostDelegate.qml" line="81"/>
<source>Open SSH</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="92"/>
<source>Deleting</source>
<translation>Tar bort</translation>
</message>
......@@ -72,7 +77,7 @@
<message>
<location filename="../qml/pages/MainPage.qml" line="66"/>
<source>Settings</source>
<translation type="unfinished"></translation>
<translation>Inställningar</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="73"/>
......@@ -95,17 +100,17 @@
<translation>En IP-adress eller ett värdnamn</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Use IPv6</source>
<translation type="unfinished"></translation>
<translation>Använd IPv6</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="148"/>
<location filename="../qml/pages/MainPage.qml" line="149"/>
<source>Ping it</source>
<translation>Pinga den</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="156"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<source>History</source>
<translation>Historik</translation>
</message>
......@@ -115,22 +120,22 @@
<message>
<location filename="../qml/pages/Settings.qml" line="36"/>
<source>Settings</source>
<translation type="unfinished"></translation>
<translation>Inställningar</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="42"/>
<source>Enable poller</source>
<translation type="unfinished"></translation>
<translation>Aktivera efterfrågningsmodul</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="43"/>
<source>Pings every N minutes all hosts in the history</source>
<translation type="unfinished"></translation>
<translation>Pingar varje värd i historiken med x minuters mellanrum</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="51"/>
<source>Poller interval in minutes</source>
<translation type="unfinished"></translation>
<translation>Efterfågningsintervall i minuter</translation>
</message>
</context>
</TS>
......@@ -47,7 +47,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="87"/>
<location filename="../qml/pages/HostDelegate.qml" line="81"/>
<source>Open SSH</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/HostDelegate.qml" line="92"/>
<source>Deleting</source>
<translation type="unfinished"></translation>
</message>
......@@ -95,17 +100,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="132"/>
<location filename="../qml/pages/MainPage.qml" line="133"/>
<source>Use IPv6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="148"/>
<location filename="../qml/pages/MainPage.qml" line="149"/>
<source>Ping it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="156"/>
<location filename="../qml/pages/MainPage.qml" line="157"/>
<source>History</source>
<translation type="unfinished"></translation>
</message>
......
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