Diffstat (limited to 'core/apps/helpbrowser/helpbrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/helpbrowser/helpbrowser.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp index 4bd9565..c2059c0 100644 --- a/core/apps/helpbrowser/helpbrowser.cpp +++ b/core/apps/helpbrowser/helpbrowser.cpp | |||
@@ -16,85 +16,90 @@ | |||
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 | #define QTOPIA_INTERNAL_LANGLIST | 21 | #define QTOPIA_INTERNAL_LANGLIST |
22 | 22 | ||
23 | #include "helpbrowser.h" | 23 | #include "helpbrowser.h" |
24 | #include "magictextbrowser.h" | 24 | #include "magictextbrowser.h" |
25 | 25 | ||
26 | /* OPIE */ | 26 | /* OPIE */ |
27 | #include <opie2/odebug.h> | 27 | #include <opie2/odebug.h> |
28 | #include <opie2/oresource.h> | ||
29 | |||
28 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
29 | #include <qpe/resource.h> | 31 | |
30 | using namespace Opie::Core; | 32 | using namespace Opie::Core; |
31 | 33 | ||
32 | /* QT */ | 34 | /* QT */ |
33 | #include <qmenubar.h> | 35 | #include <qmenubar.h> |
34 | #include <qtoolbar.h> | 36 | #include <qtoolbar.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
36 | #include <qfileinfo.h> | 38 | #include <qfileinfo.h> |
37 | #include <qaction.h> | 39 | #include <qaction.h> |
38 | 40 | ||
39 | HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) | 41 | HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) |
40 | : QMainWindow( parent, name, f ), | 42 | : QMainWindow( parent, name, f ), |
41 | selectedURL() | 43 | selectedURL() |
42 | { | 44 | { |
43 | init( "index.html" ); | 45 | init( "index.html" ); |
44 | } | 46 | } |
45 | 47 | ||
46 | 48 | ||
47 | 49 | ||
48 | void HelpBrowser::init( const QString& _home ) | 50 | void HelpBrowser::init( const QString& _home ) |
49 | { | 51 | { |
50 | setIcon( Resource::loadPixmap( "HelpBrowser" ) ); | 52 | setIcon( Opie::Core::OResource::loadPixmap( "HelpBrowser", Opie::Core::OResource::SmallIcon ) ); |
51 | setBackgroundMode( PaletteButton ); | 53 | setBackgroundMode( PaletteButton ); |
52 | 54 | ||
53 | browser = new MagicTextBrowser( this ); | 55 | browser = new MagicTextBrowser( this ); |
54 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 56 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
55 | connect( browser, SIGNAL( textChanged() ), | 57 | connect( browser, SIGNAL( textChanged() ), |
56 | this, SLOT( textChanged() ) ); | 58 | this, SLOT( textChanged() ) ); |
57 | 59 | ||
58 | setCentralWidget( browser ); | 60 | setCentralWidget( browser ); |
59 | setToolBarsMovable( FALSE ); | 61 | setToolBarsMovable( FALSE ); |
60 | 62 | ||
61 | if ( !_home.isEmpty() ) | 63 | if ( !_home.isEmpty() ) |
62 | browser->setSource( _home ); | 64 | browser->setSource( _home ); |
63 | 65 | ||
64 | QToolBar* toolbar = new QToolBar( this ); | 66 | QToolBar* toolbar = new QToolBar( this ); |
65 | toolbar->setHorizontalStretchable( TRUE ); | 67 | toolbar->setHorizontalStretchable( TRUE ); |
66 | QMenuBar *menu = new QMenuBar( toolbar ); | 68 | QMenuBar *menu = new QMenuBar( toolbar ); |
67 | 69 | ||
68 | toolbar = new QToolBar( this ); | 70 | toolbar = new QToolBar( this ); |
69 | // addToolBar( toolbar, "Toolbar"); | 71 | // addToolBar( toolbar, "Toolbar"); |
70 | 72 | ||
71 | QPopupMenu* go = new QPopupMenu( this ); | 73 | QPopupMenu* go = new QPopupMenu( this ); |
72 | backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); | 74 | backAction = new QAction( tr( "Backward" ), Opie::Core::OResource::loadPixmap( "back", Opie::Core::OResource::SmallIcon ), |
75 | QString::null, 0, this, 0 ); | ||
73 | connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) ); | 76 | connect( backAction, SIGNAL( activated() ), browser, SLOT( backward() ) ); |
74 | connect( browser, SIGNAL( backwardAvailable(bool) ), | 77 | connect( browser, SIGNAL( backwardAvailable(bool) ), |
75 | backAction, SLOT( setEnabled(bool) ) ); | 78 | backAction, SLOT( setEnabled(bool) ) ); |
76 | backAction->addTo( go ); | 79 | backAction->addTo( go ); |
77 | backAction->addTo( toolbar ); | 80 | backAction->addTo( toolbar ); |
78 | backAction->setEnabled( FALSE ); | 81 | backAction->setEnabled( FALSE ); |
79 | 82 | ||
80 | forwardAction = new QAction( tr( "Forward" ), Resource::loadIconSet( "forward" ), QString::null, 0, this, 0 ); | 83 | forwardAction = new QAction( tr( "Forward" ), Opie::Core::OResource::loadPixmap( "forward", Opie::Core::OResource::SmallIcon ), |
84 | QString::null, 0, this, 0 ); | ||
81 | connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) ); | 85 | connect( forwardAction, SIGNAL( activated() ), browser, SLOT( forward() ) ); |
82 | connect( browser, SIGNAL( forwardAvailable(bool) ), | 86 | connect( browser, SIGNAL( forwardAvailable(bool) ), |
83 | forwardAction, SLOT( setEnabled(bool) ) ); | 87 | forwardAction, SLOT( setEnabled(bool) ) ); |
84 | forwardAction->addTo( go ); | 88 | forwardAction->addTo( go ); |
85 | forwardAction->addTo( toolbar ); | 89 | forwardAction->addTo( toolbar ); |
86 | forwardAction->setEnabled( FALSE ); | 90 | forwardAction->setEnabled( FALSE ); |
87 | 91 | ||
88 | QAction *a = new QAction( tr( "Home" ), Resource::loadIconSet( "home" ), QString::null, 0, this, 0 ); | 92 | QAction *a = new QAction( tr( "Home" ), Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ), |
93 | QString::null, 0, this, 0 ); | ||
89 | connect( a, SIGNAL( activated() ), browser, SLOT( home() ) ); | 94 | connect( a, SIGNAL( activated() ), browser, SLOT( home() ) ); |
90 | a->addTo( go ); | 95 | a->addTo( go ); |
91 | a->addTo( toolbar ); | 96 | a->addTo( toolbar ); |
92 | 97 | ||
93 | bookm = new QPopupMenu( this ); | 98 | bookm = new QPopupMenu( this ); |
94 | bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); | 99 | bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); |
95 | bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) ); | 100 | bookm->insertItem( tr( "Remove from Bookmarks" ), this, SLOT( removeBookmark() ) ); |
96 | bookm->insertSeparator(); | 101 | bookm->insertSeparator(); |
97 | connect( bookm, SIGNAL( activated(int) ), | 102 | connect( bookm, SIGNAL( activated(int) ), |
98 | this, SLOT( bookmChosen(int) ) ); | 103 | this, SLOT( bookmChosen(int) ) ); |
99 | 104 | ||
100 | readBookmarks(); | 105 | readBookmarks(); |