summaryrefslogtreecommitdiff
Unidiff
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 403bd92..f89ed6d 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -449,129 +449,129 @@ void TextEdit::zoomOut()
449 449
450void TextEdit::setFontSize(int sz, bool round_down_not_up) 450void TextEdit::setFontSize(int sz, bool round_down_not_up)
451{ 451{
452 int s=10; 452 int s=10;
453 for (int i=0; i<nfontsizes; i++) { 453 for (int i=0; i<nfontsizes; i++) {
454 if ( fontsize[i] == sz ) { 454 if ( fontsize[i] == sz ) {
455 s = sz; 455 s = sz;
456 break; 456 break;
457 } else if ( round_down_not_up ) { 457 } else if ( round_down_not_up ) {
458 if ( fontsize[i] < sz ) 458 if ( fontsize[i] < sz )
459 s = fontsize[i]; 459 s = fontsize[i];
460 } else { 460 } else {
461 if ( fontsize[i] > sz ) { 461 if ( fontsize[i] > sz ) {
462 s = fontsize[i]; 462 s = fontsize[i];
463 break; 463 break;
464 } 464 }
465 } 465 }
466 } 466 }
467 467
468 QFont f = editor->font(); 468 QFont f = editor->font();
469 f.setPointSize(s); 469 f.setPointSize(s);
470 editor->setFont(f); 470 editor->setFont(f);
471 471
472 zin->setEnabled(s != fontsize[nfontsizes-1]); 472 zin->setEnabled(s != fontsize[nfontsizes-1]);
473 zout->setEnabled(s != fontsize[0]); 473 zout->setEnabled(s != fontsize[0]);
474} 474}
475 475
476void TextEdit::setBold(bool y) 476void TextEdit::setBold(bool y)
477{ 477{
478 QFont f = editor->font(); 478 QFont f = editor->font();
479 f.setBold(y); 479 f.setBold(y);
480 editor->setFont(f); 480 editor->setFont(f);
481} 481}
482 482
483void TextEdit::setItalic(bool y) 483void TextEdit::setItalic(bool y)
484{ 484{
485 QFont f = editor->font(); 485 QFont f = editor->font();
486 f.setItalic(y); 486 f.setItalic(y);
487 editor->setFont(f); 487 editor->setFont(f);
488} 488}
489 489
490void TextEdit::setWordWrap(bool y) 490void TextEdit::setWordWrap(bool y)
491{ 491{
492 bool state = editor->edited(); 492 bool state = editor->edited();
493 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); 493 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap );
494 editor->setEdited( state ); 494 editor->setEdited( state );
495} 495}
496 496
497void TextEdit::fileNew() 497void TextEdit::fileNew()
498{ 498{
499// if( !bFromDocView ) { 499// if( !bFromDocView ) {
500// saveAs(); 500// saveAs();
501// } 501// }
502 newFile(DocLnk()); 502 newFile(DocLnk());
503} 503}
504 504
505void TextEdit::fileOpen() 505void TextEdit::fileOpen()
506{ 506{
507 Config cfg("TextEdit"); 507 Config cfg("TextEdit");
508 cfg.setGroup("View"); 508 cfg.setGroup("View");
509 bool b=FALSE; 509 bool b=FALSE;
510// if(cfg.readEntry("useOldFileDialog") == "TRUE") 510// if(cfg.readEntry("useOldFileDialog") == "TRUE")
511// b=TRUE; 511// b=TRUE;
512// if(!b) { 512// if(!b) {
513 QString str = OFileDialog::getOpenFileName( 1,"/")://,"", "*", this ); 513 QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
514 if(!str.isEmpty() ) 514 if(!str.isEmpty() )
515 openFile( str ); 515 openFile( str );
516// } else { 516// } else {
517// QString str; 517// QString str;
518// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // 518// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); //
519// browseForFiles->setFileView( viewSelection ); 519// browseForFiles->setFileView( viewSelection );
520// browseForFiles->showMaximized(); 520// browseForFiles->showMaximized();
521// // if( result != -1 ) 521// // if( result != -1 )
522 522
523// if( browseForFiles->exec() != -1 ) { 523// if( browseForFiles->exec() != -1 ) {
524// QString selFile = browseForFiles->selectedFileName; 524// QString selFile = browseForFiles->selectedFileName;
525// QStringList fileList = browseForFiles->fileList; 525// QStringList fileList = browseForFiles->fileList;
526// qDebug(selFile); 526// qDebug(selFile);
527// QStringList::ConstIterator f; 527// QStringList::ConstIterator f;
528// QString fileTemp; 528// QString fileTemp;
529// for ( f = fileList.begin(); f != fileList.end(); f++ ) { 529// for ( f = fileList.begin(); f != fileList.end(); f++ ) {
530// fileTemp = *f; 530// fileTemp = *f;
531// fileTemp.right( fileTemp.length()-5); 531// fileTemp.right( fileTemp.length()-5);
532// QString fileName = fileTemp; 532// QString fileName = fileTemp;
533// if( fileName != "Unnamed" || fileName != "Empty Text" ) { 533// if( fileName != "Unnamed" || fileName != "Empty Text" ) {
534// currentFileName = fileName; 534// currentFileName = fileName;
535// qDebug("please open "+currentFileName); 535// qDebug("please open "+currentFileName);
536// openFile(currentFileName ); 536// openFile(currentFileName );
537// } 537// }
538// } 538// }
539// viewSelection = browseForFiles->SelectionCombo->currentItem(); 539// viewSelection = browseForFiles->SelectionCombo->currentItem();
540// } 540// }
541// delete browseForFiles; 541// delete browseForFiles;
542// editor->setEdited( FALSE); 542// editor->setEdited( FALSE);
543// edited1=FALSE; 543// edited1=FALSE;
544// edited=FALSE; 544// edited=FALSE;
545// if(caption().left(1)=="*") 545// if(caption().left(1)=="*")
546// setCaption(caption().right(caption().length()-1)); 546// setCaption(caption().right(caption().length()-1));
547// doSearchBar(); 547// doSearchBar();
548// } 548// }
549 549
550} 550}
551 551
552void TextEdit::doSearchBar() 552void TextEdit::doSearchBar()
553{ 553{
554 Config cfg("TextEdit"); 554 Config cfg("TextEdit");
555 cfg.setGroup("View"); 555 cfg.setGroup("View");
556 if(cfg.readEntry("SearchBar","Closed") != "Opened") 556 if(cfg.readEntry("SearchBar","Closed") != "Opened")
557 searchBar->hide(); 557 searchBar->hide();
558} 558}
559 559
560#if 0 560#if 0
561void TextEdit::slotFind() 561void TextEdit::slotFind()
562{ 562{
563 FindDialog frmFind( tr("Text Editor"), this ); 563 FindDialog frmFind( tr("Text Editor"), this );
564 connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), 564 connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)),
565 editor, SLOT(slotDoFind( const QString&,bool,bool))); 565 editor, SLOT(slotDoFind( const QString&,bool,bool)));
566 566
567 //case sensitive, backwards, [category] 567 //case sensitive, backwards, [category]
568 568
569 connect( editor, SIGNAL(notFound()), 569 connect( editor, SIGNAL(notFound()),
570 &frmFind, SLOT(slotNotFound()) ); 570 &frmFind, SLOT(slotNotFound()) );
571 connect( editor, SIGNAL(searchWrapped()), 571 connect( editor, SIGNAL(searchWrapped()),
572 &frmFind, SLOT(slotWrapAround()) ); 572 &frmFind, SLOT(slotWrapAround()) );
573 573
574 frmFind.exec(); 574 frmFind.exec();
575 575
576 576
577} 577}