Diffstat (limited to 'noncore/apps/opie-gutenbrowser/helpme.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/helpme.cpp | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/noncore/apps/opie-gutenbrowser/helpme.cpp b/noncore/apps/opie-gutenbrowser/helpme.cpp new file mode 100644 index 0000000..6a9b8c0 --- a/dev/null +++ b/noncore/apps/opie-gutenbrowser/helpme.cpp | |||
@@ -0,0 +1,122 @@ | |||
1 | /*************************************************************************** | ||
2 | helpme.cpp - description | ||
3 | ------------------- | ||
4 | begin : Tue Jul 25 2000 | ||
5 | begin : Sat Dec 4 1999 | ||
6 | copyright : (C) 2000 -2004 by llornkcor | ||
7 | email : ljp@llornkcor.com | ||
8 | ***************************************************************************/ | ||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | #include <qpe/qcopenvelope_qws.h> | ||
18 | #include <qpe/qpeapplication.h> | ||
19 | |||
20 | #include "helpme.h" | ||
21 | #include "helpwindow.h" | ||
22 | |||
23 | #include <qprogressdialog.h> | ||
24 | #include <qlayout.h> | ||
25 | |||
26 | #include <sys/stat.h> | ||
27 | #include <unistd.h> | ||
28 | |||
29 | HelpMe::HelpMe(QWidget *parent, QString name ) : QDialog(parent,name) | ||
30 | { | ||
31 | local_library = ( QDir::homeDirPath ())+"/Applications/gutenbrowser/"; | ||
32 | setCaption(tr("Gutenbrowser About " VERSION)); | ||
33 | |||
34 | QGridLayout *layout = new QGridLayout( this ); | ||
35 | layout->setSpacing( 4 ); | ||
36 | layout->setMargin( 4 ); | ||
37 | |||
38 | Edit = new QMultiLineEdit(this, ""); | ||
39 | Edit->setReadOnly(true); | ||
40 | Edit->append(tr("Based on gutenbook.pl, available from http://www.gutenbook.org")); | ||
41 | Edit->append(tr("Much appreciation to Lee Burgess,")); | ||
42 | Edit->append(tr("for the original idea and concept of gutenbook.\n")); | ||
43 | Edit->append(tr("A list of current Gutenberg ftp sites is at http://promo.net/pg/index.html\n")); | ||
44 | Edit->append(tr("For bug reports, comments or questions about Gutenbrowser, email")); | ||
45 | Edit->append(tr("ljp@llornkcor.com\n")); | ||
46 | Edit->append(tr("\nMade using Qt, Qt Embedded, and Qtopia, a cross platform development API\nhttp://www.trolltech.com\n\n")); | ||
47 | Edit->append(tr("Arnold's Laws of Documentation:")); | ||
48 | Edit->append(tr("(1) If it should exist, it doesn't.")); | ||
49 | Edit->append(tr("(2) If it does exist, it's out of date.")); | ||
50 | Edit->append(tr("(3) Only documentation for")); | ||
51 | Edit->append(tr("useless programs transcends the")); | ||
52 | Edit->append(tr("first two laws.\n")); | ||
53 | Edit->append(tr("Everything is temporary, anyway....\n :o)")); | ||
54 | Edit->setWordWrap(QMultiLineEdit::WidgetWidth); | ||
55 | QString pixDir; | ||
56 | pixDir=QPEApplication::qpeDir()+"/pics/"; | ||
57 | QPushButton *help; | ||
58 | help = new QPushButton(this); | ||
59 | help->setPixmap( QPixmap( pixDir+"gutenbrowser/help.png")); | ||
60 | help->setText("Help"); | ||
61 | connect( help,SIGNAL(clicked()),this,SLOT( help() )); | ||
62 | |||
63 | /* QPushButton *ok; | ||
64 | ok = new QPushButton(this); | ||
65 | ok->setPixmap( QPixmap( pixDir+"/gutenbrowser/exit.png")); | ||
66 | ok->setText("ok"); | ||
67 | connect(ok,SIGNAL(clicked()),this,SLOT(accept() )); | ||
68 | */ | ||
69 | help->setFixedHeight(25); | ||
70 | // ok->setFixedHeight(25); | ||
71 | |||
72 | // layout->addMultiCellWidget( ok, 0, 0, 4, 4 ); | ||
73 | layout->addMultiCellWidget( help, 0, 0, 4, 4 ); | ||
74 | layout->addMultiCellWidget( Edit, 1, 1, 0, 4 ); | ||
75 | } | ||
76 | |||
77 | HelpMe::~HelpMe() | ||
78 | { | ||
79 | //delete Edit; | ||
80 | |||
81 | } | ||
82 | |||
83 | void HelpMe::goToURL() | ||
84 | { | ||
85 | |||
86 | url = "http://www.llornkcor.com/"; | ||
87 | goGetit( url); | ||
88 | } | ||
89 | |||
90 | void HelpMe::goToURL2() | ||
91 | { | ||
92 | url = "http://www.gutenberg.org"; | ||
93 | goGetit( url); | ||
94 | } | ||
95 | |||
96 | void HelpMe::goToURL3() | ||
97 | { | ||
98 | url = "http://www.gutenbook.org"; | ||
99 | goGetit( url); | ||
100 | } | ||
101 | |||
102 | void HelpMe::goGetit( QString url) | ||
103 | { | ||
104 | HelpWindow *help = new HelpWindow( url, ".", 0, "gutenbrowser"); | ||
105 | help->setCaption("Qt Example - Helpviewer"); | ||
106 | help->showMaximized(); | ||
107 | help->show(); | ||
108 | } | ||
109 | |||
110 | void HelpMe::help() | ||
111 | { | ||
112 | QString msg ; | ||
113 | msg=QPEApplication::qpeDir()+"help/html/gutenbrowser-index.html"; // or where ever this ends up to be | ||
114 | qDebug(msg); | ||
115 | QString url = "file://"+msg; | ||
116 | goGetit( url); | ||
117 | |||
118 | // QCopEnvelope e("QPE/Application/helpbrowser", "setDocument(QString)" ); | ||
119 | // e << msg; | ||
120 | |||
121 | // goGetit( msg); | ||
122 | } | ||