Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

helpme.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           helpme.cpp  -  description
00003                              -------------------
00004     begin                : Tue Jul 25 2000
00005     begin                : Sat Dec 4 1999
00006     copyright            : (C) 2000 -2004 by llornkcor
00007     email                : ljp@llornkcor.com
00008  ***************************************************************************/
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "helpme.h"
00019 #include "helpwindow.h"
00020 
00021 /* OPIE */
00022 #include <qpe/qcopenvelope_qws.h>
00023 #include <qpe/qpeapplication.h>
00024 #include <opie2/odebug.h>
00025 
00026 /* QT */
00027 #include <qprogressdialog.h>
00028 #include <qlayout.h>
00029 
00030 /* STD */
00031 #include <sys/stat.h>
00032 #include <unistd.h>
00033 
00034 HelpMe::HelpMe(QWidget *parent,  QString name ) : QDialog(parent,name)
00035 {
00036     local_library = ( QDir::homeDirPath ())+"/Applications/gutenbrowser/";
00037     setCaption(tr("Gutenbrowser About " VERSION));
00038 
00039   QGridLayout *layout = new QGridLayout( this );
00040     layout->setSpacing( 4 );
00041     layout->setMargin( 4 );
00042 
00043     Edit = new QMultiLineEdit(this, "");
00044     Edit->setReadOnly(true);
00045     Edit->append(tr("Based on gutenbook.pl, available from http://www.gutenbook.org"));
00046     Edit->append(tr("Much appreciation to Lee Burgess,"));
00047     Edit->append(tr("for the original idea and concept of gutenbook.\n"));
00048     Edit->append(tr("A list of current Gutenberg ftp sites is at http://promo.net/pg/index.html\n"));
00049     Edit->append(tr("For bug reports, comments or questions about Gutenbrowser, email"));
00050     Edit->append(tr("ljp@llornkcor.com\n"));
00051     Edit->append(tr("\nMade using Qt, Qt Embedded, and Qtopia, a cross platform development API\nhttp://www.trolltech.com\n\n"));
00052     Edit->append(tr("Arnold's Laws of Documentation:"));
00053     Edit->append(tr("(1) If it should exist, it doesn't."));
00054     Edit->append(tr("(2) If it does exist, it's out of date."));
00055     Edit->append(tr("(3) Only documentation for"));
00056     Edit->append(tr("useless programs transcends the"));
00057     Edit->append(tr("first two laws.\n"));
00058     Edit->append(tr("Everything is temporary, anyway....\n :o)"));
00059     Edit->setWordWrap(QMultiLineEdit::WidgetWidth);
00060   QString pixDir;
00061   pixDir=QPEApplication::qpeDir()+"pics/";
00062     QPushButton *help;
00063     help = new QPushButton(this);
00064     help->setPixmap( QPixmap( pixDir+"gutenbrowser/help.png"));
00065     help->setText("Help");
00066     connect( help,SIGNAL(clicked()),this,SLOT( help() ));
00067 
00068 /*    QPushButton *ok;
00069     ok = new QPushButton(this);
00070     ok->setPixmap(  QPixmap( pixDir+"/gutenbrowser/exit.png"));
00071     ok->setText("ok");
00072     connect(ok,SIGNAL(clicked()),this,SLOT(accept() ));
00073 */
00074     help->setFixedHeight(25);
00075 //    ok->setFixedHeight(25);
00076 
00077 //  layout->addMultiCellWidget( ok, 0, 0, 4, 4 );
00078   layout->addMultiCellWidget( help, 0, 0, 4, 4 );
00079   layout->addMultiCellWidget( Edit, 1, 1, 0, 4 );
00080 }
00081 
00082 HelpMe::~HelpMe()
00083 {
00084 //delete Edit;
00085 
00086 }
00087 
00088 void HelpMe::goToURL()
00089 {
00090 
00091     url = "http://www.llornkcor.com/";
00092     goGetit( url);
00093 }
00094 
00095 void HelpMe::goToURL2()
00096 {
00097     url = "http://www.gutenberg.org";
00098     goGetit( url);
00099 }
00100 
00101 void HelpMe::goToURL3()
00102 {
00103     url = "http://www.gutenbook.org";
00104     goGetit( url);
00105 }
00106 
00107 void HelpMe::goGetit( QString url)
00108 {
00109      HelpWindow *help = new HelpWindow( url, ".", 0, "gutenbrowser");
00110      help->setCaption("Qt Example - Helpviewer");
00111      help->showMaximized();
00112      help->show();
00113 }
00114 
00115 void HelpMe::help()
00116 {
00117     QString msg ;
00118     msg=QPEApplication::qpeDir()+"help/html/gutenbrowser-index.html"; // or where ever this ends up to be
00119 odebug << msg << oendl;
00120     QString url = "file://"+msg;
00121     goGetit( url);
00122 
00123 //       QCopEnvelope e("QPE/Application/helpbrowser", "setDocument(QString)" );
00124 //       e << msg;
00125 
00126 //    goGetit( msg);
00127 }

Generated on Sat Nov 5 16:16:52 2005 for OPIE by  doxygen 1.4.2