00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 void PocketReader::init() {
00028 if(cmd->text().isEmpty())
00029 cmd->setText("/usr/local/bin/pocketreader -batch -d /dev/ttyS0");
00030 }
00031
00032 void PocketReader::start()
00033 {
00034 debug("PocketReader::start()");
00035 QProcess proc(QString("sh"), this);
00036 proc.addArgument(QString("-c"));
00037 proc.addArgument(QString(cmd->text()));
00038 if(!proc.start()) {
00039 QMessageBox::warning(this, "Pocket Reader", "Cannot execute command!");
00040 return;
00041 }
00042
00043 while(proc.isRunning()) qApp->processEvents();
00044
00045 while(proc.canReadLineStderr())
00046 result->append(proc.readLineStderr());
00047
00048 while(proc.canReadLineStdout())
00049 result->append(proc.readLineStdout());
00050
00051 if(spellcheck->isChecked()) {
00052 QString s=result->text();
00053 KSpell::modalCheck(s);
00054 result->setText(s);
00055 }
00056 }
00057
00058
00059 void PocketReader::configSpellchecker()
00060 {
00061 debug("PocketReader::configSpellchecker()");
00062 KSpellConfig s(0, "configspellcheck", 0, false);
00063 s.show();
00064 }