summaryrefslogtreecommitdiff
path: root/noncore/settings/sshkeys
authordwmw2 <dwmw2>2002-09-19 20:44:40 (UTC)
committer dwmw2 <dwmw2>2002-09-19 20:44:40 (UTC)
commitf4162d2283ebf0327645e0ac66b539cf87565d0b (patch) (unidiff)
treee15f52a57ad9af4ab9581d63a35cee05510742c9 /noncore/settings/sshkeys
parent9c39f0983a3b8d280ee651d578593ed2196f2607 (diff)
downloadopie-f4162d2283ebf0327645e0ac66b539cf87565d0b.zip
opie-f4162d2283ebf0327645e0ac66b539cf87565d0b.tar.gz
opie-f4162d2283ebf0327645e0ac66b539cf87565d0b.tar.bz2
Initial import of half-finished ssh-agent key management tool.
Diffstat (limited to 'noncore/settings/sshkeys') (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 @@
1
2#include <qpe/qpeapplication.h>
3#include "sshkeys.h"
4
5int main(int argc, char *argv[])
6{
7 QPEApplication a(argc, argv);
8 SSHKeysApp app;
9
10 a.showMainWidget(&app);
11
12 return a.exec();
13}
14
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 @@
1Files: bin/sshkeys
2Priority: optional
3Section: opie/settings
4Maintainer: David Woodhouse <dwmw2@infradead.org>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION), ssh, opie-sh-ssh-askpass
8Description: 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 @@
1#include "sshkeys.h"
2
3#include <qpe/qpeapplication.h>
4#include <opie/oprocess.h>
5#include <qmultilineedit.h>
6#include <qpushbutton.h>
7#include <qtable.h>
8
9SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
10 : SSHKeysBase( parent, name, fl )
11{
12
13 connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
14 connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
15 connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));
16
17 KeyList->horizontalHeader()->setLabel(0, tr("Key"));
18 KeyList->horizontalHeader()->setLabel(1, tr("Size"));
19 KeyList->horizontalHeader()->setLabel(2, tr("Fingerprint"));
20
21 doRefreshListButton();
22}
23
24SSHKeysApp::~SSHKeysApp()
25{
26}
27
28void SSHKeysApp::doRefreshListButton()
29{
30 OProcess sshadd_process;
31
32 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
33 this, SLOT(get_list_keys_output(OProcess*,char*,int)));
34
35 TextOutput->append("Running ssh-add -l\n");
36 sshadd_process << "ssh-add" << "-l";
37 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
38 if (!ret)
39 TextOutput->append("Error running ssh-add\n");
40 KeyList->setText(0, 0, "dwmw2@infradead.org (RSA v1)");
41 KeyList->setText(0, 1, "1024");
42 KeyList->setText(0, 2, "78:24:04:95:40:fc:b2:80:9b:94:d5:ae:19:56:19:65");
43}
44
45void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen)
46{
47 TextOutput->append(buffer);
48}
49
50
51void SSHKeysApp::doAddButton()
52{
53
54}
55void SSHKeysApp::doRemoveAllButton()
56{
57
58}
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 @@
1
2#ifndef SSHKEYSAPP_H
3#define SSHKEYSAPP_H
4
5#include "sshkeysbase.h"
6
7class OProcess;
8
9class SSHKeysApp : public SSHKeysBase
10{
11 Q_OBJECT
12
13 public:
14 SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
15 ~SSHKeysApp();
16
17 private:
18 void sshadd(char **args);
19
20 private slots:
21 void doAddButton();
22 void doRefreshListButton();
23 void doRemoveAllButton();
24 void get_list_keys_output(OProcess *proc, char *buffer, int buflen);
25};
26#endif
27
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 @@
1TEMPLATE = app
2CONFIG += qt warn_on release
3HEADERS = sshkeys.h
4SOURCES = main.cpp sshkeys.cpp
5TARGET = sshkeys
6INTERFACES = sshkeysbase.ui
7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopie
10DESTDIR = $(OPIEDIR)/bin
11
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 @@
1<!DOCTYPE UI><UI>
2<class>SSHKeysBase</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>SSHKeysBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>736</width>
15 <height>446</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>SSH Keys</string>
21 </property>
22 <grid>
23 <property stdset="1">
24 <name>margin</name>
25 <number>11</number>
26 </property>
27 <property stdset="1">
28 <name>spacing</name>
29 <number>6</number>
30 </property>
31 <widget row="0" column="1" rowspan="1" colspan="2" >
32 <class>QComboBox</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>KeyFileName</cstring>
36 </property>
37 <property stdset="1">
38 <name>sizePolicy</name>
39 <sizepolicy>
40 <hsizetype>7</hsizetype>
41 <vsizetype>0</vsizetype>
42 </sizepolicy>
43 </property>
44 <property stdset="1">
45 <name>editable</name>
46 <bool>true</bool>
47 </property>
48 </widget>
49 <widget row="0" column="0" >
50 <class>QPushButton</class>
51 <property stdset="1">
52 <name>name</name>
53 <cstring>AddButton</cstring>
54 </property>
55 <property stdset="1">
56 <name>sizePolicy</name>
57 <sizepolicy>
58 <hsizetype>1</hsizetype>
59 <vsizetype>0</vsizetype>
60 </sizepolicy>
61 </property>
62 <property stdset="1">
63 <name>text</name>
64 <string>Add Keys:</string>
65 </property>
66 </widget>
67 <widget row="1" column="0" >
68 <class>QPushButton</class>
69 <property stdset="1">
70 <name>name</name>
71 <cstring>RefreshListButton</cstring>
72 </property>
73 <property stdset="1">
74 <name>text</name>
75 <string>Refresh</string>
76 </property>
77 </widget>
78 <widget row="1" column="1" >
79 <class>QPushButton</class>
80 <property stdset="1">
81 <name>name</name>
82 <cstring>RemoveAllButton</cstring>
83 </property>
84 <property stdset="1">
85 <name>enabled</name>
86 <bool>false</bool>
87 </property>
88 <property stdset="1">
89 <name>text</name>
90 <string>Clear Keys</string>
91 </property>
92 </widget>
93 <widget row="3" column="0" rowspan="1" colspan="3" >
94 <class>QMultiLineEdit</class>
95 <property stdset="1">
96 <name>name</name>
97 <cstring>TextOutput</cstring>
98 </property>
99 <property stdset="1">
100 <name>sizePolicy</name>
101 <sizepolicy>
102 <hsizetype>7</hsizetype>
103 <vsizetype>1</vsizetype>
104 </sizepolicy>
105 </property>
106 <property stdset="1">
107 <name>readOnly</name>
108 <bool>true</bool>
109 </property>
110 </widget>
111 <widget row="2" column="0" rowspan="1" colspan="3" >
112 <class>QTable</class>
113 <property stdset="1">
114 <name>name</name>
115 <cstring>KeyList</cstring>
116 </property>
117 <property stdset="1">
118 <name>font</name>
119 <font>
120 <family>adobe-helvetica</family>
121 <pointsize>9</pointsize>
122 </font>
123 </property>
124 <property stdset="1">
125 <name>resizePolicy</name>
126 <enum>AutoOneFit</enum>
127 </property>
128 <property stdset="1">
129 <name>numRows</name>
130 <number>1</number>
131 </property>
132 <property stdset="1">
133 <name>numCols</name>
134 <number>3</number>
135 </property>
136 <property stdset="1">
137 <name>showGrid</name>
138 <bool>false</bool>
139 </property>
140 </widget>
141 </grid>
142</widget>
143</UI>