00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "helpme.h"
00019 #include "helpwindow.h"
00020
00021
00022 #include <qpe/qcopenvelope_qws.h>
00023 #include <qpe/qpeapplication.h>
00024 #include <opie2/odebug.h>
00025
00026
00027 #include <qprogressdialog.h>
00028 #include <qlayout.h>
00029
00030
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
00069
00070
00071
00072
00073
00074 help->setFixedHeight(25);
00075
00076
00077
00078 layout->addMultiCellWidget( help, 0, 0, 4, 4 );
00079 layout->addMultiCellWidget( Edit, 1, 1, 0, 4 );
00080 }
00081
00082 HelpMe::~HelpMe()
00083 {
00084
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";
00119 odebug << msg << oendl;
00120 QString url = "file://"+msg;
00121 goGetit( url);
00122
00123
00124
00125
00126
00127 }