Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 75 |
1 files changed, 42 insertions, 33 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 18402d4..84888c1 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -492,57 +492,66 @@ void TextEdit::setWordWrap(bool y) | |||
492 | } | 492 | } |
493 | 493 | ||
494 | void TextEdit::fileNew() | 494 | void TextEdit::fileNew() |
495 | { | 495 | { |
496 | // if( !bFromDocView ) { | 496 | // if( !bFromDocView ) { |
497 | // saveAs(); | 497 | // saveAs(); |
498 | // } | 498 | // } |
499 | newFile(DocLnk()); | 499 | newFile(DocLnk()); |
500 | } | 500 | } |
501 | 501 | ||
502 | void TextEdit::fileOpen() | 502 | void TextEdit::fileOpen() |
503 | { | 503 | { |
504 | QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this ); | 504 | Config cfg("TextEdit"); |
505 | if(!str.isEmpty() ) | 505 | cfg.setGroup("View"); |
506 | openFile( str ); | 506 | bool b=FALSE; |
507 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // | 507 | if(cfg.readEntry("useOldFileDialog") == "TRUE") |
508 | // browseForFiles->setFileView( viewSelection ); | 508 | b=TRUE; |
509 | // browseForFiles->showMaximized(); | 509 | if(!b) { |
510 | // // if( result != -1 ) | 510 | QString str = OFileDialog::getOpenFileName( 1,"/","", "text/plain", this ); |
511 | 511 | if(!str.isEmpty() ) | |
512 | // if( browseForFiles->exec() != -1 ) { | 512 | openFile( str ); |
513 | // QString selFile = browseForFiles->selectedFileName; | 513 | } else { |
514 | // QStringList fileList = browseForFiles->fileList; | 514 | QString str; |
515 | // qDebug(selFile); | 515 | browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // |
516 | // QStringList::ConstIterator f; | 516 | browseForFiles->setFileView( viewSelection ); |
517 | // QString fileTemp; | 517 | browseForFiles->showMaximized(); |
518 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { | 518 | // if( result != -1 ) |
519 | // fileTemp = *f; | 519 | |
520 | // fileTemp.right( fileTemp.length()-5); | 520 | if( browseForFiles->exec() != -1 ) { |
521 | // QString fileName = fileTemp; | 521 | QString selFile = browseForFiles->selectedFileName; |
522 | // if( fileName != "Unnamed" || fileName != "Empty Text" ) { | 522 | QStringList fileList = browseForFiles->fileList; |
523 | // currentFileName = fileName; | 523 | qDebug(selFile); |
524 | // qDebug("please open "+currentFileName); | 524 | QStringList::ConstIterator f; |
525 | // openFile(str ); | 525 | QString fileTemp; |
526 | // } | 526 | for ( f = fileList.begin(); f != fileList.end(); f++ ) { |
527 | // } | 527 | fileTemp = *f; |
528 | // viewSelection = browseForFiles->SelectionCombo->currentItem(); | 528 | fileTemp.right( fileTemp.length()-5); |
529 | // } | 529 | QString fileName = fileTemp; |
530 | // delete browseForFiles; | 530 | if( fileName != "Unnamed" || fileName != "Empty Text" ) { |
531 | // editor->setEdited( FALSE); | 531 | currentFileName = fileName; |
532 | // edited1=FALSE; | 532 | qDebug("please open "+currentFileName); |
533 | // edited=FALSE; | 533 | openFile(str ); |
534 | // if(caption().left(1)=="*") | 534 | } |
535 | // setCaption(caption().right(caption().length()-1)); | 535 | } |
536 | // doSearchBar(); | 536 | viewSelection = browseForFiles->SelectionCombo->currentItem(); |
537 | } | ||
538 | delete browseForFiles; | ||
539 | editor->setEdited( FALSE); | ||
540 | edited1=FALSE; | ||
541 | edited=FALSE; | ||
542 | if(caption().left(1)=="*") | ||
543 | setCaption(caption().right(caption().length()-1)); | ||
544 | doSearchBar(); | ||
545 | } | ||
537 | } | 546 | } |
538 | 547 | ||
539 | void TextEdit::doSearchBar() | 548 | void TextEdit::doSearchBar() |
540 | { | 549 | { |
541 | Config cfg("TextEdit"); | 550 | Config cfg("TextEdit"); |
542 | cfg.setGroup("View"); | 551 | cfg.setGroup("View"); |
543 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | 552 | if(cfg.readEntry("SearchBar","Closed") != "Opened") |
544 | searchBar->hide(); | 553 | searchBar->hide(); |
545 | } | 554 | } |
546 | 555 | ||
547 | #if 0 | 556 | #if 0 |
548 | void TextEdit::slotFind() | 557 | void TextEdit::slotFind() |