summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp15
-rw-r--r--core/apps/textedit/textedit.cpp31
2 files changed, 26 insertions, 20 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
30using namespace Opie::Core; 32using 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
39HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f ) 41HelpBrowser::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
48void HelpBrowser::init( const QString& _home ) 50void 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();
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 63709dd..ca760bb 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -11,25 +11,26 @@
11** 11**
12**********************************************************************/ 12**********************************************************************/
13// changes added by L. J. Potter Sun 02-17-2002 21:31:31 13// changes added by L. J. Potter Sun 02-17-2002 21:31:31
14 14
15#include "textedit.h" 15#include "textedit.h"
16#include "filePermissions.h" 16#include "filePermissions.h"
17 17
18/* OPIE */ 18/* OPIE */
19#include <opie2/odebug.h> 19#include <opie2/odebug.h>
20#include <opie2/ofileselector.h> 20#include <opie2/ofileselector.h>
21#include <opie2/ofiledialog.h> 21#include <opie2/ofiledialog.h>
22#include <opie2/ofontselector.h> 22#include <opie2/ofontselector.h>
23#include <qpe/resource.h> 23#include <opie2/oresource.h>
24
24#include <qpe/config.h> 25#include <qpe/config.h>
25#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
26 27
27 28
28/* QT */ 29/* QT */
29#include <qmenubar.h> 30#include <qmenubar.h>
30#include <qtoolbar.h> 31#include <qtoolbar.h>
31#include <qtextstream.h> 32#include <qtextstream.h>
32#include <qclipboard.h> 33#include <qclipboard.h>
33#include <qaction.h> 34#include <qaction.h>
34#include <qlineedit.h> 35#include <qlineedit.h>
35#include <qmessagebox.h> 36#include <qmessagebox.h>
@@ -160,97 +161,97 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
160{ 161{
161 doc = 0; 162 doc = 0;
162 edited=false; 163 edited=false;
163 fromSetDocument=false; 164 fromSetDocument=false;
164 165
165 setToolBarsMovable( false ); 166 setToolBarsMovable( false );
166 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 167 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
167 168
168 channel = new QCopChannel( "QPE/Application/textedit", this ); 169 channel = new QCopChannel( "QPE/Application/textedit", this );
169 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), 170 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
170 this, SLOT(receive(const QCString&,const QByteArray&)) ); 171 this, SLOT(receive(const QCString&,const QByteArray&)) );
171 172
172 setIcon( Resource::loadPixmap( "textedit/TextEditor" ) ); 173 setIcon( Opie::Core::OResource::loadPixmap( "textedit/TextEditor", Opie::Core::OResource::SmallIcon ) );
173 174
174 QToolBar *bar = new QToolBar( this ); 175 QToolBar *bar = new QToolBar( this );
175 bar->setHorizontalStretchable( true ); 176 bar->setHorizontalStretchable( true );
176 menu = bar; 177 menu = bar;
177 178
178 QMenuBar *mb = new QMenuBar( bar ); 179 QMenuBar *mb = new QMenuBar( bar );
179 QPopupMenu *file = new QPopupMenu( this ); 180 QPopupMenu *file = new QPopupMenu( this );
180 QPopupMenu *edit = new QPopupMenu( this ); 181 QPopupMenu *edit = new QPopupMenu( this );
181 QPopupMenu *advancedMenu = new QPopupMenu(this); 182 QPopupMenu *advancedMenu = new QPopupMenu(this);
182 183
183 font = new QPopupMenu( this ); 184 font = new QPopupMenu( this );
184 185
185 bar = new QToolBar( this ); 186 bar = new QToolBar( this );
186 editBar = bar; 187 editBar = bar;
187 188
188 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), 189 QAction *a = new QAction( tr( "New" ), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
189 QString::null, 0, this, 0 ); 190 QString::null, 0, this, 0 );
190 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 191 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
191// a->addTo( bar ); 192// a->addTo( bar );
192 a->addTo( file ); 193 a->addTo( file );
193 194
194 a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), 195 a = new QAction( tr( "Open" ), Opie::Core::OResource::loadPixmap( "fileopen", Opie::Core::OResource::SmallIcon ),
195 QString::null, 0, this, 0 ); 196 QString::null, 0, this, 0 );
196 connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); 197 connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
197 a->addTo( bar ); 198 a->addTo( bar );
198 a->addTo( file ); 199 a->addTo( file );
199 200
200 a = new QAction( tr( "Save" ), Resource::loadPixmap("save") , 201 a = new QAction( tr( "Save" ), Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ),
201 QString::null, 0, this, 0 ); 202 QString::null, 0, this, 0 );
202 connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); 203 connect( a, SIGNAL( activated() ), this, SLOT( save() ) );
203 file->insertSeparator(); 204 file->insertSeparator();
204 a->addTo( bar ); 205 a->addTo( bar );
205 a->addTo( file ); 206 a->addTo( file );
206 207
207 a = new QAction( tr( "Save As" ), Resource::loadPixmap("save") , 208 a = new QAction( tr( "Save As" ), Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ),
208 QString::null, 0, this, 0 ); 209 QString::null, 0, this, 0 );
209 connect( a, SIGNAL( activated() ), this, SLOT( saveAs() ) ); 210 connect( a, SIGNAL( activated() ), this, SLOT( saveAs() ) );
210 a->addTo( file ); 211 a->addTo( file );
211 212
212 a = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), 213 a = new QAction( tr( "Cut" ), Opie::Core::OResource::loadPixmap( "cut", Opie::Core::OResource::SmallIcon ),
213 QString::null, 0, this, 0 ); 214 QString::null, 0, this, 0 );
214 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); 215 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
215 a->addTo( editBar ); 216 a->addTo( editBar );
216 a->addTo( edit ); 217 a->addTo( edit );
217 218
218 a = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), 219 a = new QAction( tr( "Copy" ), Opie::Core::OResource::loadPixmap( "copy", Opie::Core::OResource::SmallIcon ),
219 QString::null, 0, this, 0 ); 220 QString::null, 0, this, 0 );
220 connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); 221 connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
221 a->addTo( editBar ); 222 a->addTo( editBar );
222 a->addTo( edit ); 223 a->addTo( edit );
223 224
224 a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), 225 a = new QAction( tr( "Paste" ), Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ),
225 QString::null, 0, this, 0 ); 226 QString::null, 0, this, 0 );
226 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); 227 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
227 a->addTo( editBar ); 228 a->addTo( editBar );
228 a->addTo( edit ); 229 a->addTo( edit );
229 230
230 231
231#ifndef QT_NO_CLIPBOARD 232#ifndef QT_NO_CLIPBOARD
232 a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ), 233 a = new QAction( tr( "Insert Time and Date" ), Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ),
233 QString::null, 0, this, 0 ); 234 QString::null, 0, this, 0 );
234 connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) ); 235 connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) );
235 a->addTo( edit ); 236 a->addTo( edit );
236#endif 237#endif
237 238
238 a = new QAction( tr( "Goto Line..." ), Resource::loadPixmap( "find" ), 239 a = new QAction( tr( "Goto Line..." ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
239 QString::null, 0, this, 0 ); 240 QString::null, 0, this, 0 );
240 connect( a, SIGNAL( activated() ), this, SLOT( gotoLine() ) ); 241 connect( a, SIGNAL( activated() ), this, SLOT( gotoLine() ) );
241 edit->insertSeparator(); 242 edit->insertSeparator();
242 a->addTo( edit ); 243 a->addTo( edit );
243 244
244 a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), 245 a = new QAction( tr( "Find..." ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
245 QString::null, 0, this, 0 ); 246 QString::null, 0, this, 0 );
246 connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); 247 connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) );
247 a->addTo( bar ); 248 a->addTo( bar );
248 a->addTo( edit ); 249 a->addTo( edit );
249 250
250 zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); 251 zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 );
251 connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); 252 connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) );
252 zin->addTo( font ); 253 zin->addTo( font );
253 254
254 zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); 255 zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 );
255 connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); 256 connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) );
256 zout->addTo( font ); 257 zout->addTo( font );
@@ -322,37 +323,37 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
322 mb->insertItem( tr( "View" ), font ); 323 mb->insertItem( tr( "View" ), font );
323 324
324 searchBar = new QToolBar(this); 325 searchBar = new QToolBar(this);
325 addToolBar( searchBar, "Search", QMainWindow::Top, true ); 326 addToolBar( searchBar, "Search", QMainWindow::Top, true );
326 327
327 searchBar->setHorizontalStretchable( true ); 328 searchBar->setHorizontalStretchable( true );
328 329
329 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 330 searchEdit = new QLineEdit( searchBar, "searchEdit" );
330 searchBar->setStretchableWidget( searchEdit ); 331 searchBar->setStretchableWidget( searchEdit );
331 connect( searchEdit, SIGNAL( textChanged(const QString&) ), 332 connect( searchEdit, SIGNAL( textChanged(const QString&) ),
332 this, SLOT( search() ) ); 333 this, SLOT( search() ) );
333 334
334 a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), 335 a = new QAction( tr( "Find Next" ), Opie::Core::OResource::loadPixmap( "next", Opie::Core::OResource::SmallIcon ),
335 QString::null, 0, this, 0 ); 336 QString::null, 0, this, 0 );
336 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 337 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
337 a->addTo( searchBar ); 338 a->addTo( searchBar );
338 a->addTo( edit ); 339 a->addTo( edit );
339 340
340 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), 341 a = new QAction( tr( "Close Find" ), Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ),
341 QString::null, 0, this, 0 ); 342 QString::null, 0, this, 0 );
342 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 343 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
343 a->addTo( searchBar ); 344 a->addTo( searchBar );
344 345
345 edit->insertSeparator(); 346 edit->insertSeparator();
346 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), 347 a = new QAction( tr( "Delete" ), Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ),
347 QString::null, 0, this, 0 ); 348 QString::null, 0, this, 0 );
348 connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); 349 connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) );
349 a->addTo( edit ); 350 a->addTo( edit );
350 351
351 searchBar->hide(); 352 searchBar->hide();
352 353
353 editor = new QpeEditor( this ); 354 editor = new QpeEditor( this );
354 setCentralWidget( editor ); 355 setCentralWidget( editor );
355 editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 356 editor->setFrameStyle( QFrame::Panel | QFrame::Sunken );
356 connect( editor, SIGNAL( textChanged() ), 357 connect( editor, SIGNAL( textChanged() ),
357 this, SLOT( editorChanged() ) ); 358 this, SLOT( editorChanged() ) );
358 359