summaryrefslogtreecommitdiff
authordwmw2 <dwmw2>2002-09-20 13:02:13 (UTC)
committer dwmw2 <dwmw2>2002-09-20 13:02:13 (UTC)
commitcc311b771843c289fadbe9a301e432963b906208 (patch) (unidiff)
tree02665007b0be38bc29f840e497c5c14757c1f4b0
parent6cbf7b19d7bb3fcd2471dbaa531a7b2ae05f0fcc (diff)
downloadopie-cc311b771843c289fadbe9a301e432963b906208.zip
opie-cc311b771843c289fadbe9a301e432963b906208.tar.gz
opie-cc311b771843c289fadbe9a301e432963b906208.tar.bz2
tr()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index 5095d16..701356a 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -56,49 +56,49 @@ SSHKeysApp::~SSHKeysApp()
56void SSHKeysApp::doRefreshListButton() 56void SSHKeysApp::doRefreshListButton()
57{ 57{
58 OProcess sshadd_process; 58 OProcess sshadd_process;
59 QListViewItem *t = KeyList->firstChild(); 59 QListViewItem *t = KeyList->firstChild();
60 60
61 while(t) { 61 while(t) {
62 QListViewItem *next = t->nextSibling(); 62 QListViewItem *next = t->nextSibling();
63 KeyList->takeItem(t); 63 KeyList->takeItem(t);
64 delete(t); 64 delete(t);
65 t = next; 65 t = next;
66 } 66 }
67 67
68 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), 68 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
69 this, SLOT(get_list_keys_output(OProcess*,char*,int))); 69 this, SLOT(get_list_keys_output(OProcess*,char*,int)));
70 70
71 keystate = KeySize; 71 keystate = KeySize;
72 incoming_keyname=""; 72 incoming_keyname="";
73 incoming_keysize=""; 73 incoming_keysize="";
74 incoming_keyfingerprint=""; 74 incoming_keyfingerprint="";
75 75
76 //log_text("Running ssh-add -l"); 76 //log_text("Running ssh-add -l");
77 sshadd_process << "ssh-add" << "-l"; 77 sshadd_process << "ssh-add" << "-l";
78 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); 78 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
79 if (!ret) { 79 if (!ret) {
80 log_text("Error running ssh-add"); 80 log_text(tr("Error running ssh-add"));
81 return; 81 return;
82 } 82 }
83 83
84} 84}
85 85
86void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen) 86void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen)
87{ 87{
88 int i; 88 int i;
89 (void) proc; 89 (void) proc;
90 90
91 for (i=0; i<buflen; i++) { 91 for (i=0; i<buflen; i++) {
92 switch(keystate) { 92 switch(keystate) {
93 case Noise: 93 case Noise:
94 noise: 94 noise:
95 if (buffer[i] == '\n') { 95 if (buffer[i] == '\n') {
96 log_text(incoming_noise.local8Bit()); 96 log_text(incoming_noise.local8Bit());
97 incoming_noise = ""; 97 incoming_noise = "";
98 keystate = KeySize; 98 keystate = KeySize;
99 } else { 99 } else {
100 incoming_noise += buffer[i]; 100 incoming_noise += buffer[i];
101 } 101 }
102 break; 102 break;
103 103
104 case KeySize: 104 case KeySize:
@@ -146,82 +146,82 @@ void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen)
146 keystate = Noise; 146 keystate = Noise;
147 goto noise; 147 goto noise;
148 } 148 }
149 break; 149 break;
150 } 150 }
151 } 151 }
152} 152}
153 153
154void SSHKeysApp::log_sshadd_output(OProcess *proc, char *buffer, int buflen) 154void SSHKeysApp::log_sshadd_output(OProcess *proc, char *buffer, int buflen)
155{ 155{
156 (void)proc; 156 (void)proc;
157 (void)buflen; 157 (void)buflen;
158 158
159 log_text(buffer); 159 log_text(buffer);
160} 160}
161 161
162void SSHKeysApp::ssh_add_exited(OProcess *proc) 162void SSHKeysApp::ssh_add_exited(OProcess *proc)
163{ 163{
164 (void)proc; 164 (void)proc;
165 165
166 doRefreshListButton(); 166 doRefreshListButton();
167 setEnabled(TRUE); 167 setEnabled(TRUE);
168 if (proc->exitStatus()) { 168 if (proc->exitStatus()) {
169 169
170 log_text(QString("ssh-add failed")); 170 log_text(QString(tr("ssh-add failed")));
171 } 171 }
172} 172}
173 173
174void SSHKeysApp::add_text_changed(const QString &text) 174void SSHKeysApp::add_text_changed(const QString &text)
175{ 175{
176 struct stat sbuf; 176 struct stat sbuf;
177 177
178 if (!text.length() || (!access(text.ascii(), R_OK) && 178 if (!text.length() || (!access(text.ascii(), R_OK) &&
179 !stat(text.ascii(), &sbuf) && 179 !stat(text.ascii(), &sbuf) &&
180 S_ISREG(sbuf.st_mode))) 180 S_ISREG(sbuf.st_mode)))
181 AddButton->setEnabled(TRUE); 181 AddButton->setEnabled(TRUE);
182 else 182 else
183 AddButton->setEnabled(FALSE); 183 AddButton->setEnabled(FALSE);
184} 184}
185 185
186void SSHKeysApp::doAddButton() 186void SSHKeysApp::doAddButton()
187{ 187{
188 addprocess.clearArguments(); 188 addprocess.clearArguments();
189 189
190 setEnabled(FALSE); 190 setEnabled(FALSE);
191 191
192 if (KeyFileName->currentText().length()) { 192 if (KeyFileName->currentText().length()) {
193 addprocess << "ssh-add" << "--" << KeyFileName->currentText(); 193 addprocess << "ssh-add" << "--" << KeyFileName->currentText();
194 log_text(QString("Running ssh-add -- ") + KeyFileName->currentText()); 194 log_text(QString(tr("Running ssh-add -- ")) + KeyFileName->currentText());
195 } else { 195 } else {
196 addprocess << "ssh-add"; 196 addprocess << "ssh-add";
197 log_text("Running ssh-add"); 197 log_text(tr("Running ssh-add"));
198 } 198 }
199 bool ret = addprocess.start(OProcess::NotifyOnExit, OProcess::AllOutput); 199 bool ret = addprocess.start(OProcess::NotifyOnExit, OProcess::AllOutput);
200 if (!ret) { 200 if (!ret) {
201 log_text("Error running ssh-add"); 201 log_text(tr("Error running ssh-add"));
202 doRefreshListButton(); 202 doRefreshListButton();
203 setEnabled(TRUE); 203 setEnabled(TRUE);
204 } 204 }
205} 205}
206 206
207void SSHKeysApp::log_text(const char *text) 207void SSHKeysApp::log_text(const char *text)
208{ 208{
209 TextOutput->append(text); 209 TextOutput->append(text);
210 TextOutput->setCursorPosition(TextOutput->numLines()+1, 0, FALSE); 210 TextOutput->setCursorPosition(TextOutput->numLines()+1, 0, FALSE);
211} 211}
212 212
213void SSHKeysApp::doRemoveAllButton() 213void SSHKeysApp::doRemoveAllButton()
214{ 214{
215 OProcess sshadd_process; 215 OProcess sshadd_process;
216 216
217 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), 217 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
218 this, SLOT(log_sshadd_output(OProcess*,char*,int))); 218 this, SLOT(log_sshadd_output(OProcess*,char*,int)));
219 219
220 log_text("Running ssh-add -D"); 220 log_text(tr("Running ssh-add -D"));
221 sshadd_process << "ssh-add" << "-D"; 221 sshadd_process << "ssh-add" << "-D";
222 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); 222 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
223 if (!ret) { 223 if (!ret) {
224 log_text("Error running ssh-add"); 224 log_text(tr("Error running ssh-add"));
225 } 225 }
226 doRefreshListButton(); 226 doRefreshListButton();
227} 227}