summaryrefslogtreecommitdiff
path: root/noncore/settings/sshkeys/sshkeys.cpp
blob: 08ce18d43aad73c4e87a23e610193ab240290f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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()
{
	
}