summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/helpme.cpp
blob: 53e02365e8fe2ca0372adf3da01515eac88c6a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/***************************************************************************
                          helpme.cpp  -  description
                             -------------------
    begin                : Tue Jul 25 2000
    begin                : Sat Dec 4 1999
    copyright            : (C) 2000 -2004 by llornkcor
    email                : ljp@llornkcor.com
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "helpme.h"
#include "helpwindow.h"

/* OPIE */
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <opie2/odebug.h>

/* QT */
#include <qprogressdialog.h>
#include <qlayout.h>

/* STD */
#include <sys/stat.h>
#include <unistd.h>

HelpMe::HelpMe(QWidget *parent,  QString name ) : QDialog(parent,name)
{
    local_library = ( QDir::homeDirPath ())+"/Applications/gutenbrowser/";
    setCaption(tr("Gutenbrowser About " VERSION));

  QGridLayout *layout = new QGridLayout( this );
    layout->setSpacing( 4 );
    layout->setMargin( 4 );

    Edit = new QMultiLineEdit(this, "");
    Edit->setReadOnly(true);
    Edit->append(tr("Based on gutenbook.pl, available from http://www.gutenbook.org"));
    Edit->append(tr("Much appreciation to Lee Burgess,"));
    Edit->append(tr("for the original idea and concept of gutenbook.\n"));
    Edit->append(tr("A list of current Gutenberg ftp sites is at http://promo.net/pg/index.html\n"));
    Edit->append(tr("For bug reports, comments or questions about Gutenbrowser, email"));
    Edit->append(tr("ljp@llornkcor.com\n"));
    Edit->append(tr("\nMade using Qt, Qt Embedded, and Qtopia, a cross platform development API\nhttp://www.trolltech.com\n\n"));
    Edit->append(tr("Arnold's Laws of Documentation:"));
    Edit->append(tr("(1) If it should exist, it doesn't."));
    Edit->append(tr("(2) If it does exist, it's out of date."));
    Edit->append(tr("(3) Only documentation for"));
    Edit->append(tr("useless programs transcends the"));
    Edit->append(tr("first two laws.\n"));
    Edit->append(tr("Everything is temporary, anyway....\n :o)"));
    Edit->setWordWrap(QMultiLineEdit::WidgetWidth);
  QString pixDir;
  pixDir=QPEApplication::qpeDir()+"/pics/";
    QPushButton *help;
    help = new QPushButton(this);
    help->setPixmap( QPixmap( pixDir+"gutenbrowser/help.png"));
    help->setText("Help");
    connect( help,SIGNAL(clicked()),this,SLOT( help() ));

/*    QPushButton *ok;
    ok = new QPushButton(this);
    ok->setPixmap(  QPixmap( pixDir+"/gutenbrowser/exit.png"));
    ok->setText("ok");
    connect(ok,SIGNAL(clicked()),this,SLOT(accept() ));
*/
    help->setFixedHeight(25);
//    ok->setFixedHeight(25);

//  layout->addMultiCellWidget( ok, 0, 0, 4, 4 );
  layout->addMultiCellWidget( help, 0, 0, 4, 4 );
  layout->addMultiCellWidget( Edit, 1, 1, 0, 4 );
}

HelpMe::~HelpMe()
{
//delete Edit;

}

void HelpMe::goToURL()
{

    url = "http://www.llornkcor.com/";
    goGetit( url);
}

void HelpMe::goToURL2()
{
    url = "http://www.gutenberg.org";
    goGetit( url);
}

void HelpMe::goToURL3()
{
    url = "http://www.gutenbook.org";
    goGetit( url);
}

void HelpMe::goGetit( QString url)
{
     HelpWindow *help = new HelpWindow( url, ".", 0, "gutenbrowser");
     help->setCaption("Qt Example - Helpviewer");
     help->showMaximized();
     help->show();
}

void HelpMe::help()
{
    QString msg ;
    msg=QPEApplication::qpeDir()+"help/html/gutenbrowser-index.html"; // or where ever this ends up to be
odebug << msg << oendl;
    QString url = "file://"+msg;
    goGetit( url);

//       QCopEnvelope e("QPE/Application/helpbrowser", "setDocument(QString)" );
//       e << msg;

//    goGetit( msg);
}