summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
Unidiff
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 68ee1b4..d3f5fb4 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -353,13 +353,12 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
353 353
354 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 354 searchEdit = new QLineEdit( searchBar, "searchEdit" );
355 searchBar->setStretchableWidget( searchEdit ); 355 searchBar->setStretchableWidget( searchEdit );
356 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 356 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
357 this, SLOT( search() ) ); 357 this, SLOT( search() ) );
358 358
359
360 a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); 359 a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 );
361 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 360 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
362 a->addTo( searchBar ); 361 a->addTo( searchBar );
363 a->addTo( edit ); 362 a->addTo( edit );
364 363
365 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 364 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
@@ -416,13 +415,13 @@ TextEdit::~TextEdit()
416 cfg.setGroup("View"); 415 cfg.setGroup("View");
417 QFont f = editor->font(); 416 QFont f = editor->font();
418 cfg.writeEntry("FontSize",f.pointSize()); 417 cfg.writeEntry("FontSize",f.pointSize());
419 cfg.writeEntry("Bold",f.bold()); 418 cfg.writeEntry("Bold",f.bold());
420 cfg.writeEntry("Italic",f.italic()); 419 cfg.writeEntry("Italic",f.italic());
421 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); 420 cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth);
422 cfg.writeEntry( "FileView", viewSelection ); 421 cfg.writeEntry( "FileView", viewSelection );
423} 422}
424 423
425void TextEdit::zoomIn() 424void TextEdit::zoomIn()
426{ 425{
427 setFontSize(editor->font().pointSize()+1,FALSE); 426 setFontSize(editor->font().pointSize()+1,FALSE);
428} 427}
@@ -514,12 +513,16 @@ void TextEdit::fileOpen()
514 delete browseForFiles; 513 delete browseForFiles;
515 editor->setEdited( FALSE); 514 editor->setEdited( FALSE);
516 edited1=FALSE; 515 edited1=FALSE;
517 edited=FALSE; 516 edited=FALSE;
518 if(caption().left(1)=="*") 517 if(caption().left(1)=="*")
519 setCaption(caption().right(caption().length()-1)); 518 setCaption(caption().right(caption().length()-1));
519 Config cfg("TextEdit");
520 cfg.setGroup("View");
521 if(cfg.readEntry("SearchBar","Closed") != "Opened")
522 searchBar->hide();
520} 523}
521 524
522#if 0 525#if 0
523void TextEdit::slotFind() 526void TextEdit::slotFind()
524{ 527{
525 FindDialog frmFind( "Text Editor", this ); 528 FindDialog frmFind( "Text Editor", this );
@@ -568,24 +571,32 @@ void TextEdit::editPaste()
568 571
569void TextEdit::editFind() 572void TextEdit::editFind()
570{ 573{
571 searchBar->show(); 574 searchBar->show();
572 searchVisible = TRUE; 575 searchVisible = TRUE;
573 searchEdit->setFocus(); 576 searchEdit->setFocus();
577 Config cfg("TextEdit");
578 cfg.setGroup("View");
579 cfg.writeEntry("SearchBar","Opened");
580
574} 581}
575 582
576void TextEdit::findNext() 583void TextEdit::findNext()
577{ 584{
578 editor->find( searchEdit->text(), FALSE, FALSE ); 585 editor->find( searchEdit->text(), FALSE, FALSE );
579 586
580} 587}
581 588
582void TextEdit::findClose() 589void TextEdit::findClose()
583{ 590{
584 searchVisible = FALSE; 591 searchVisible = FALSE;
585 searchBar->hide(); 592 searchBar->hide();
593 Config cfg("TextEdit");
594 cfg.setGroup("View");
595 cfg.writeEntry("SearchBar","Closed");
596 cfg.write();
586} 597}
587 598
588void TextEdit::search() 599void TextEdit::search()
589{ 600{
590 editor->find( searchEdit->text(), FALSE, FALSE ); 601 editor->find( searchEdit->text(), FALSE, FALSE );
591} 602}