summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp5
-rw-r--r--core/apps/helpbrowser/opie-helpbrowser.control2
-rw-r--r--core/apps/helpbrowser/pics/home.pngbin0 -> 693 bytes
3 files changed, 4 insertions, 3 deletions
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index d32fc0b..e20d49b 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -1,49 +1,49 @@
1/********************************************************************** 1#/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "helpbrowser.h" 21#include "helpbrowser.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/global.h> 25#include <qpe/global.h>
26 26
27#include <qstatusbar.h> 27#include <qstatusbar.h>
28#include <qdragobject.h> 28#include <qdragobject.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30#include <qpopupmenu.h> 30#include <qpopupmenu.h>
31#include <qpe/qpemenubar.h> 31#include <qpe/qpemenubar.h>
32#include <qpe/qpetoolbar.h> 32#include <qpe/qpetoolbar.h>
33#include <qtoolbutton.h> 33#include <qtoolbutton.h>
34#include <qiconset.h> 34#include <qiconset.h>
35#include <qfile.h> 35#include <qfile.h>
36#include <qtextstream.h> 36#include <qtextstream.h>
37#include <qstylesheet.h> 37#include <qstylesheet.h>
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39#include <qfiledialog.h> 39#include <qfiledialog.h>
40#include <qevent.h> 40#include <qevent.h>
41#include <qlineedit.h> 41#include <qlineedit.h>
42#include <qobjectlist.h> 42#include <qobjectlist.h>
43#include <qfileinfo.h> 43#include <qfileinfo.h>
44#include <qfile.h> 44#include <qfile.h>
45#include <qdatastream.h> 45#include <qdatastream.h>
46#include <qprinter.h> 46#include <qprinter.h>
47#include <qsimplerichtext.h> 47#include <qsimplerichtext.h>
48#include <qpaintdevicemetrics.h> 48#include <qpaintdevicemetrics.h>
49#include <qaction.h> 49#include <qaction.h>
@@ -52,97 +52,98 @@
52 52
53 53
54HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) 54HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f )
55 : QMainWindow( parent, name, f ), 55 : QMainWindow( parent, name, f ),
56 selectedURL() 56 selectedURL()
57{ 57{
58 init( "index.html" ); 58 init( "index.html" );
59} 59}
60 60
61void HelpBrowser::init( const QString& _home ) 61void HelpBrowser::init( const QString& _home )
62{ 62{
63 setIcon( Resource::loadPixmap( "help_icon" ) ); 63 setIcon( Resource::loadPixmap( "help_icon" ) );
64 64
65 browser = new QTextBrowser( this ); 65 browser = new QTextBrowser( this );
66 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 66 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
67 connect( browser, SIGNAL( textChanged() ), 67 connect( browser, SIGNAL( textChanged() ),
68 this, SLOT( textChanged() ) ); 68 this, SLOT( textChanged() ) );
69 69
70 setCentralWidget( browser ); 70 setCentralWidget( browser );
71 setToolBarsMovable( FALSE ); 71 setToolBarsMovable( FALSE );
72 72
73 if ( !_home.isEmpty() ) 73 if ( !_home.isEmpty() )
74 browser->setSource( _home ); 74 browser->setSource( _home );
75 75
76 QPEToolBar* toolbar = new QPEToolBar( this ); 76 QPEToolBar* toolbar = new QPEToolBar( this );
77 toolbar->setHorizontalStretchable( TRUE ); 77 toolbar->setHorizontalStretchable( TRUE );
78 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 78 QPEMenuBar *menu = new QPEMenuBar( toolbar );
79 79
80 toolbar = new QPEToolBar( this ); 80 toolbar = new QPEToolBar( this );
81 // addToolBar( toolbar, "Toolbar"); 81 // addToolBar( toolbar, "Toolbar");
82 82
83 //QPopupMenu* go = new QPopupMenu( this ); 83 //QPopupMenu* go = new QPopupMenu( this );
84 backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); 84 backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 );
85 connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) ); 85 connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) );
86 connect( browser, SIGNAL( backwardAvailable( bool ) ), 86 connect( browser, SIGNAL( backwardAvailable( bool ) ),
87 backAction, SLOT( setEnabled( bool ) ) ); 87 backAction, SLOT( setEnabled( bool ) ) );
88 //backAction->addTo( go ); 88 //backAction->addTo( go );
89 backAction->addTo( toolbar ); 89 backAction->addTo( toolbar );
90 backAction->setEnabled( FALSE ); 90 backAction->setEnabled( FALSE );
91 91
92 forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 ); 92 forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 );
93 connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) ); 93 connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) );
94 connect( browser, SIGNAL( forwardAvailable( bool ) ), 94 connect( browser, SIGNAL( forwardAvailable( bool ) ),
95 forwardAction, SLOT( setEnabled( bool ) ) ); 95 forwardAction, SLOT( setEnabled( bool ) ) );
96 //forwardAction->addTo( go ); 96 //forwardAction->addTo( go );
97 forwardAction->addTo( toolbar ); 97 forwardAction->addTo( toolbar );
98 forwardAction->setEnabled( FALSE ); 98 forwardAction->setEnabled( FALSE );
99 99
100 QAction *a = new QAction( tr( "Home" ), Resource::loadPixmap( "home" ), QString::null, 0, this, 0 ); 100 QAction *a = new QAction( tr( "Home" ), Resource::loadPixmap(
101"helpbrowser/home" ), QString::null, 0, this, 0 );
101 connect( a, SIGNAL( activated() ), browser, SLOT( home() ) ); 102 connect( a, SIGNAL( activated() ), browser, SLOT( home() ) );
102 //a->addTo( go ); 103 //a->addTo( go );
103 a->addTo( toolbar ); 104 a->addTo( toolbar );
104 105
105 bookm = new QPopupMenu( this ); 106 bookm = new QPopupMenu( this );
106 bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); 107 bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) );
107 bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) ); 108 bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) );
108 bookm->insertSeparator(); 109 bookm->insertSeparator();
109 connect( bookm, SIGNAL( activated( int ) ), 110 connect( bookm, SIGNAL( activated( int ) ),
110 this, SLOT( bookmChosen( int ) ) ); 111 this, SLOT( bookmChosen( int ) ) );
111 112
112 readBookmarks(); 113 readBookmarks();
113 114
114 //menu->insertItem( tr("Go"), go ); 115 //menu->insertItem( tr("Go"), go );
115 menu->insertItem( tr( "Bookmarks" ), bookm ); 116 menu->insertItem( tr( "Bookmarks" ), bookm );
116 117
117 resize( 240, 300 ); 118 resize( 240, 300 );
118 browser->setFocus(); 119 browser->setFocus();
119 120
120 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 121 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
121 this, SLOT(appMessage(const QCString&, const QByteArray&)) ); 122 this, SLOT(appMessage(const QCString&, const QByteArray&)) );
122} 123}
123 124
124void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data) 125void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
125{ 126{
126 if ( msg == "showFile(QString)" ) { 127 if ( msg == "showFile(QString)" ) {
127 QDataStream ds(data,IO_ReadOnly); 128 QDataStream ds(data,IO_ReadOnly);
128 QString fn; 129 QString fn;
129 ds >> fn; 130 ds >> fn;
130 setDocument( fn ); 131 setDocument( fn );
131 } 132 }
132} 133}
133 134
134void HelpBrowser::setDocument( const QString &doc ) 135void HelpBrowser::setDocument( const QString &doc )
135{ 136{
136 if ( !doc.isEmpty() ) 137 if ( !doc.isEmpty() )
137 browser->setSource( doc ); 138 browser->setSource( doc );
138 raise(); 139 raise();
139} 140}
140 141
141 142
142void HelpBrowser::textChanged() 143void HelpBrowser::textChanged()
143{ 144{
144 if ( browser->documentTitle().isNull() ) 145 if ( browser->documentTitle().isNull() )
145 setCaption( tr("Help Browser") ); 146 setCaption( tr("Help Browser") );
146 else 147 else
147 setCaption( browser->documentTitle() ) ; 148 setCaption( browser->documentTitle() ) ;
148 149
diff --git a/core/apps/helpbrowser/opie-helpbrowser.control b/core/apps/helpbrowser/opie-helpbrowser.control
index a9eff38..e4fbf40 100644
--- a/core/apps/helpbrowser/opie-helpbrowser.control
+++ b/core/apps/helpbrowser/opie-helpbrowser.control
@@ -1,10 +1,10 @@
1Files: bin/helpbrowser apps/Applications/helpbrowser.desktop docs 1Files: bin/helpbrowser apps/Applications/helpbrowser.desktop docs pics/helpbrowser/*
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Warwick Allison <warwick@trolltech.com> 4Maintainer: Warwick Allison <warwick@trolltech.com>
5Architecture: arm 5Architecture: arm
6Arch: iPAQ 6Arch: iPAQ
7Version: $QPE_VERSION-$SUB_VERSION 7Version: $QPE_VERSION-$SUB_VERSION
8Depends: opie-base ($QPE_VERSION) 8Depends: opie-base ($QPE_VERSION)
9Description: Browse HTML help documents 9Description: Browse HTML help documents
10 The HTML help browser for the Opie environment. 10 The HTML help browser for the Opie environment.
diff --git a/core/apps/helpbrowser/pics/home.png b/core/apps/helpbrowser/pics/home.png
new file mode 100644
index 0000000..e9ba024
--- a/dev/null
+++ b/core/apps/helpbrowser/pics/home.png
Binary files differ