summaryrefslogtreecommitdiff
path: root/core/apps/helpbrowser/helpbrowser.cpp
authorkergoth <kergoth>2003-08-09 17:42:14 (UTC)
committer kergoth <kergoth>2003-08-09 17:42:14 (UTC)
commit1ab4ca95e4d2cf24d32b38c9031cb6076351e730 (patch) (side-by-side diff)
tree644d196b01c7f280981bd17da23c7592a18e5643 /core/apps/helpbrowser/helpbrowser.cpp
parentec14206f63dd93e9fb84c76cbc76fc1968637590 (diff)
downloadopie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.zip
opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.gz
opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'core/apps/helpbrowser/helpbrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index 48da7c6..531dbff 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -1,10 +1,10 @@
-#/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
@@ -15,24 +15,29 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
+
#include "helpbrowser.h"
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
+#include <qpe/mimetype.h>
+#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qstatusbar.h>
#include <qdragobject.h>
#include <qpixmap.h>
#include <qpopupmenu.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
+#include <qpe/qcopenvelope_qws.h>
#include <qtoolbutton.h>
#include <qiconset.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qstylesheet.h>
#include <qmessagebox.h>
@@ -45,27 +50,31 @@
#include <qdatastream.h>
#include <qprinter.h>
#include <qsimplerichtext.h>
#include <qpaintdevicemetrics.h>
#include <qaction.h>
-#include <ctype.h>
+#include <cctype>
+#include "magictextbrowser.h"
HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ),
selectedURL()
{
init( "index.html" );
}
+
+
void HelpBrowser::init( const QString& _home )
{
- setIcon( Resource::loadPixmap( "help_icon" ) );
+ setIcon( Resource::loadPixmap( "HelpBrowser" ) );
+ setBackgroundMode( PaletteButton );
- browser = new QTextBrowser( this );
+ browser = new MagicTextBrowser( this );
browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
connect( browser, SIGNAL( textChanged() ),
this, SLOT( textChanged() ) );
setCentralWidget( browser );
setToolBarsMovable( FALSE );
@@ -77,61 +86,74 @@ void HelpBrowser::init( const QString& _home )
toolbar->setHorizontalStretchable( TRUE );
QPEMenuBar *menu = new QPEMenuBar( toolbar );
toolbar = new QPEToolBar( this );
// addToolBar( toolbar, "Toolbar");
- //QPopupMenu* go = new QPopupMenu( this );
+ QPopupMenu* go = new QPopupMenu( this );
backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 );
connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) );
connect( browser, SIGNAL( backwardAvailable( bool ) ),
backAction, SLOT( setEnabled( bool ) ) );
- //backAction->addTo( go );
+ backAction->addTo( go );
backAction->addTo( toolbar );
backAction->setEnabled( FALSE );
forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 );
connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) );
connect( browser, SIGNAL( forwardAvailable( bool ) ),
forwardAction, SLOT( setEnabled( bool ) ) );
- //forwardAction->addTo( go );
+ forwardAction->addTo( go );
forwardAction->addTo( toolbar );
forwardAction->setEnabled( FALSE );
- QAction *a = new QAction( tr( "Home" ), Resource::loadPixmap(
-"home" ), QString::null, 0, this, 0 );
+ QAction *a = new QAction( tr( "Home" ), Resource::loadIconSet( "home" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), browser, SLOT( home() ) );
- //a->addTo( go );
+ a->addTo( go );
a->addTo( toolbar );
bookm = new QPopupMenu( this );
bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) );
bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) );
bookm->insertSeparator();
connect( bookm, SIGNAL( activated( int ) ),
this, SLOT( bookmChosen( int ) ) );
readBookmarks();
- //menu->insertItem( tr("Go"), go );
+ menu->insertItem( tr("Go"), go );
menu->insertItem( tr( "Bookmarks" ), bookm );
resize( 240, 300 );
browser->setFocus();
+ browser->setFrameStyle( QFrame::NoFrame );
+
+#if !defined(QT_NO_COP)
+ QCopChannel *addressChannel = new QCopChannel("QPE/HelpBrowser" , this );
+ connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
+ this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
+#endif
connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
this, SLOT(appMessage(const QCString&, const QByteArray&)) );
}
void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
{
+ qDebug("reached appMessage");
if ( msg == "showFile(QString)" ) {
QDataStream ds(data,IO_ReadOnly);
QString fn;
ds >> fn;
setDocument( fn );
+
+ QPEApplication::setKeepRunning();
+
+ showMaximized();
+ setActiveWindow();
+ raise();
}
}
void HelpBrowser::setDocument( const QString &doc )
{
if ( !doc.isEmpty() )