summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sshkeys/main.cpp14
-rw-r--r--noncore/settings/sshkeys/opie-sshkeys.control8
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp58
-rw-r--r--noncore/settings/sshkeys/sshkeys.h27
-rw-r--r--noncore/settings/sshkeys/sshkeys.pro11
-rw-r--r--noncore/settings/sshkeys/sshkeysbase.ui143
6 files changed, 261 insertions, 0 deletions
diff --git a/noncore/settings/sshkeys/main.cpp b/noncore/settings/sshkeys/main.cpp
new file mode 100644
index 0000000..37be8bf
--- a/dev/null
+++ b/noncore/settings/sshkeys/main.cpp
@@ -0,0 +1,14 @@
+
+#include <qpe/qpeapplication.h>
+#include "sshkeys.h"
+
+int main(int argc, char *argv[])
+{
+ QPEApplication a(argc, argv);
+ SSHKeysApp app;
+
+ a.showMainWidget(&app);
+
+ return a.exec();
+}
+
diff --git a/noncore/settings/sshkeys/opie-sshkeys.control b/noncore/settings/sshkeys/opie-sshkeys.control
new file mode 100644
index 0000000..1f4b669
--- a/dev/null
+++ b/noncore/settings/sshkeys/opie-sshkeys.control
@@ -0,0 +1,8 @@
+Files: bin/sshkeys
+Priority: optional
+Section: opie/settings
+Maintainer: David Woodhouse <dwmw2@infradead.org>
+Architecture: arm
+Version: $QPE_VERSION-$SUB_VERSION
+Depends: opie-base ($QPE_VERSION), ssh, opie-sh-ssh-askpass
+Description: Utility for managing ssh-agent keys.
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
new file mode 100644
index 0000000..08ce18d
--- a/dev/null
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -0,0 +1,58 @@
+#include "sshkeys.h"
+
+#include <qpe/qpeapplication.h>
+#include <opie/oprocess.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qtable.h>
+
+SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
+ : SSHKeysBase( parent, name, fl )
+{
+
+ connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
+ connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
+ connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));
+
+ KeyList->horizontalHeader()->setLabel(0, tr("Key"));
+ KeyList->horizontalHeader()->setLabel(1, tr("Size"));
+ KeyList->horizontalHeader()->setLabel(2, tr("Fingerprint"));
+
+ doRefreshListButton();
+}
+
+SSHKeysApp::~SSHKeysApp()
+{
+}
+
+void SSHKeysApp::doRefreshListButton()
+{
+ OProcess sshadd_process;
+
+ connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ this, SLOT(get_list_keys_output(OProcess*,char*,int)));
+
+ TextOutput->append("Running ssh-add -l\n");
+ sshadd_process << "ssh-add" << "-l";
+ bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
+ if (!ret)
+ TextOutput->append("Error running ssh-add\n");
+ KeyList->setText(0, 0, "dwmw2@infradead.org (RSA v1)");
+ KeyList->setText(0, 1, "1024");
+ KeyList->setText(0, 2, "78:24:04:95:40:fc:b2:80:9b:94:d5:ae:19:56:19:65");
+}
+
+void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen)
+{
+ TextOutput->append(buffer);
+}
+
+
+void SSHKeysApp::doAddButton()
+{
+
+}
+void SSHKeysApp::doRemoveAllButton()
+{
+
+}
diff --git a/noncore/settings/sshkeys/sshkeys.h b/noncore/settings/sshkeys/sshkeys.h
new file mode 100644
index 0000000..4a9f2fe
--- a/dev/null
+++ b/noncore/settings/sshkeys/sshkeys.h
@@ -0,0 +1,27 @@
+
+#ifndef SSHKEYSAPP_H
+#define SSHKEYSAPP_H
+
+#include "sshkeysbase.h"
+
+class OProcess;
+
+class SSHKeysApp : public SSHKeysBase
+{
+ Q_OBJECT
+
+ public:
+ SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~SSHKeysApp();
+
+ private:
+ void sshadd(char **args);
+
+ private slots:
+ void doAddButton();
+ void doRefreshListButton();
+ void doRemoveAllButton();
+ void get_list_keys_output(OProcess *proc, char *buffer, int buflen);
+};
+#endif
+
diff --git a/noncore/settings/sshkeys/sshkeys.pro b/noncore/settings/sshkeys/sshkeys.pro
new file mode 100644
index 0000000..33155e3
--- a/dev/null
+++ b/noncore/settings/sshkeys/sshkeys.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS = sshkeys.h
+SOURCES = main.cpp sshkeys.cpp
+TARGET = sshkeys
+INTERFACES = sshkeysbase.ui
+INCLUDEPATH += $(OPIEDIR)/include
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe -lopie
+DESTDIR = $(OPIEDIR)/bin
+
diff --git a/noncore/settings/sshkeys/sshkeysbase.ui b/noncore/settings/sshkeys/sshkeysbase.ui
new file mode 100644
index 0000000..dc1df28
--- a/dev/null
+++ b/noncore/settings/sshkeys/sshkeysbase.ui
@@ -0,0 +1,143 @@
+<!DOCTYPE UI><UI>
+<class>SSHKeysBase</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SSHKeysBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>736</width>
+ <height>446</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>SSH Keys</string>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="1" rowspan="1" colspan="2" >
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>KeyFileName</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>editable</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddButton</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Add Keys:</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RefreshListButton</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Refresh</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RemoveAllButton</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Clear Keys</string>
+ </property>
+ </widget>
+ <widget row="3" column="0" rowspan="1" colspan="3" >
+ <class>QMultiLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextOutput</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>readOnly</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="2" column="0" rowspan="1" colspan="3" >
+ <class>QTable</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>KeyList</cstring>
+ </property>
+ <property stdset="1">
+ <name>font</name>
+ <font>
+ <family>adobe-helvetica</family>
+ <pointsize>9</pointsize>
+ </font>
+ </property>
+ <property stdset="1">
+ <name>resizePolicy</name>
+ <enum>AutoOneFit</enum>
+ </property>
+ <property stdset="1">
+ <name>numRows</name>
+ <number>1</number>
+ </property>
+ <property stdset="1">
+ <name>numCols</name>
+ <number>3</number>
+ </property>
+ <property stdset="1">
+ <name>showGrid</name>
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+</widget>
+</UI>