Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

pocketreader.ui.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   pocketreader.ui.h                                                             *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   Read the file COPYING for details.                                    *
00011  *                                                                         *
00012  *   copyright: (C) 2003 by Jan Mueller                                    *
00013  *   email: janmueller7@hotmail.com                                        *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 /****************************************************************************
00018 ** ui.h extension file, included from the uic-generated form implementation.
00019 **
00020 ** If you wish to add, delete or rename functions or slots use
00021 ** Qt Designer which will update this file, preserving your code. Create an
00022 ** init() function in place of a constructor, and a destroy() function in
00023 ** place of a destructor.
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 }

Generated on Sat Mar 27 19:20:42 2004 for Literature by doxygen 1.3.6-20040222