summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-19 14:22:02 (UTC)
committer llornkcor <llornkcor>2002-02-19 14:22:02 (UTC)
commit3ed313993ab9fa0f6a8c8ca2b2fe0f5c8cf39dc6 (patch) (unidiff)
treebf6a060daf161b9b945e56bb667b69280298ebdb
parent0115b9b986375e08aa3bec19278e7d864744a401 (diff)
downloadopie-3ed313993ab9fa0f6a8c8ca2b2fe0f5c8cf39dc6.zip
opie-3ed313993ab9fa0f6a8c8ca2b2fe0f5c8cf39dc6.tar.gz
opie-3ed313993ab9fa0f6a8c8ca2b2fe0f5c8cf39dc6.tar.bz2
changed 'delete' image (nonexistant) to 'close' which looks more appropo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 197b28b..c869dc9 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -309,129 +309,129 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
309 defb = cfg.readBoolEntry("Bold",FALSE); 309 defb = cfg.readBoolEntry("Bold",FALSE);
310 defi = cfg.readBoolEntry("Italic",FALSE); 310 defi = cfg.readBoolEntry("Italic",FALSE);
311 wrap = cfg.readBoolEntry("Wrap",TRUE); 311 wrap = cfg.readBoolEntry("Wrap",TRUE);
312 312
313 zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); 313 zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 );
314 connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); 314 connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) );
315 zin->addTo( font ); 315 zin->addTo( font );
316 316
317 zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); 317 zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 );
318 connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); 318 connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) );
319 zout->addTo( font ); 319 zout->addTo( font );
320 320
321 font->insertSeparator(); 321 font->insertSeparator();
322 322
323#if 0 323#if 0
324 QAction *ba = new QAction( tr("Bold"), QString::null, 0, this, 0 ); 324 QAction *ba = new QAction( tr("Bold"), QString::null, 0, this, 0 );
325 connect( ba, SIGNAL( toggled(bool) ), this, SLOT( setBold(bool) ) ); 325 connect( ba, SIGNAL( toggled(bool) ), this, SLOT( setBold(bool) ) );
326 ba->setToggleAction(TRUE); 326 ba->setToggleAction(TRUE);
327 ba->addTo( font ); 327 ba->addTo( font );
328 328
329 QAction *ia = new QAction( tr("Italic"), QString::null, 0, this, 0 ); 329 QAction *ia = new QAction( tr("Italic"), QString::null, 0, this, 0 );
330 connect( ia, SIGNAL( toggled(bool) ), this, SLOT( setItalic(bool) ) ); 330 connect( ia, SIGNAL( toggled(bool) ), this, SLOT( setItalic(bool) ) );
331 ia->setToggleAction(TRUE); 331 ia->setToggleAction(TRUE);
332 ia->addTo( font ); 332 ia->addTo( font );
333 333
334 ba->setOn(defb); 334 ba->setOn(defb);
335 ia->setOn(defi); 335 ia->setOn(defi);
336 336
337 font->insertSeparator(); 337 font->insertSeparator();
338#endif 338#endif
339 339
340 QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 ); 340 QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 );
341 connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) ); 341 connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) );
342 wa->setToggleAction(TRUE); 342 wa->setToggleAction(TRUE);
343 wa->addTo( font ); 343 wa->addTo( font );
344 344
345 font->insertSeparator(); 345 font->insertSeparator();
346 font->insertItem("Font", this, SLOT(changeFont()) ); 346 font->insertItem("Font", this, SLOT(changeFont()) );
347 347
348 mb->insertItem( tr( "File" ), file ); 348 mb->insertItem( tr( "File" ), file );
349 mb->insertItem( tr( "Edit" ), edit ); 349 mb->insertItem( tr( "Edit" ), edit );
350 mb->insertItem( tr( "View" ), font ); 350 mb->insertItem( tr( "View" ), font );
351 351
352 searchBar = new QPEToolBar(this); 352 searchBar = new QPEToolBar(this);
353 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); 353 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
354 354
355 searchBar->setHorizontalStretchable( TRUE ); 355 searchBar->setHorizontalStretchable( TRUE );
356 356
357 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 357 searchEdit = new QLineEdit( searchBar, "searchEdit" );
358 searchBar->setStretchableWidget( searchEdit ); 358 searchBar->setStretchableWidget( searchEdit );
359 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 359 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
360 this, SLOT( search() ) ); 360 this, SLOT( search() ) );
361 361
362 362
363 a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); 363 a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 );
364 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 364 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
365 a->addTo( searchBar ); 365 a->addTo( searchBar );
366 a->addTo( edit ); 366 a->addTo( edit );
367 367
368 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 368 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
369 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 369 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
370 a->addTo( searchBar ); 370 a->addTo( searchBar );
371 371
372 edit->insertSeparator(); 372 edit->insertSeparator();
373 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "delete" ), QString::null, 0, this, 0 ); 373 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
374 connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); 374 connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) );
375 a->addTo( edit ); 375 a->addTo( edit );
376 376
377 searchBar->hide(); 377 searchBar->hide();
378 378
379 editorStack = new QWidgetStack( this ); 379 editorStack = new QWidgetStack( this );
380 setCentralWidget( editorStack ); 380 setCentralWidget( editorStack );
381 381
382 searchVisible = FALSE; 382 searchVisible = FALSE;
383 383
384 fileSelector = new FileSelector( "text/*", editorStack, "fileselector" , TRUE, TRUE); //buggy 384 fileSelector = new FileSelector( "text/*", editorStack, "fileselector" , TRUE, TRUE); //buggy
385 connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); 385 connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) );
386 connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); 386 connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) );
387 connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( openFile( const DocLnk & ) ) ); 387 connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( openFile( const DocLnk & ) ) );
388// fileOpen(); 388// fileOpen();
389 389
390 editor = new QpeEditor( editorStack ); 390 editor = new QpeEditor( editorStack );
391 editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 391 editor->setFrameStyle( QFrame::Panel | QFrame::Sunken );
392 editorStack->addWidget( editor, get_unique_id() ); 392 editorStack->addWidget( editor, get_unique_id() );
393 393
394 resize( 200, 300 ); 394 resize( 200, 300 );
395 395
396// setFontSize(defsize,TRUE); 396// setFontSize(defsize,TRUE);
397 FontDatabase fdb; 397 FontDatabase fdb;
398 QFont defaultFont=editor->font(); 398 QFont defaultFont=editor->font();
399 QFontInfo fontInfo(defaultFont); 399 QFontInfo fontInfo(defaultFont);
400 400
401 cfg.setGroup("Font"); 401 cfg.setGroup("Font");
402 QString family = cfg.readEntry("Family", fontInfo.family()); 402 QString family = cfg.readEntry("Family", fontInfo.family());
403 QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); 403 QString style = cfg.readEntry("Style", fdb.styleString(defaultFont));
404 int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); 404 int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10);
405 QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); 405 QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) );
406 406
407 defaultFont = fdb.font(family,style,i_size,charSet); 407 defaultFont = fdb.font(family,style,i_size,charSet);
408 editor->setFont( defaultFont); 408 editor->setFont( defaultFont);
409 409
410 wa->setOn(wrap); 410 wa->setOn(wrap);
411 updateCaption(); 411 updateCaption();
412 412
413 fileNew(); 413 fileNew();
414} 414}
415 415
416TextEdit::~TextEdit() 416TextEdit::~TextEdit()
417{ 417{
418// saveAs(); 418// saveAs();
419 419
420 Config cfg("TextEdit"); 420 Config cfg("TextEdit");
421 cfg.setGroup("View"); 421 cfg.setGroup("View");
422 QFont f = editor->font(); 422 QFont f = editor->font();
423 cfg.writeEntry("FontSize",f.pointSize()); 423 cfg.writeEntry("FontSize",f.pointSize());
424 cfg.writeEntry("Bold",f.bold()); 424 cfg.writeEntry("Bold",f.bold());
425 cfg.writeEntry("Italic",f.italic()); 425 cfg.writeEntry("Italic",f.italic());
426 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); 426 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth);
427} 427}
428 428
429void TextEdit::zoomIn() 429void TextEdit::zoomIn()
430{ 430{
431 setFontSize(editor->font().pointSize()+1,FALSE); 431 setFontSize(editor->font().pointSize()+1,FALSE);
432} 432}
433 433
434void TextEdit::zoomOut() 434void TextEdit::zoomOut()
435{ 435{
436 setFontSize(editor->font().pointSize()-1,TRUE); 436 setFontSize(editor->font().pointSize()-1,TRUE);
437} 437}