author | zecke <zecke> | 2002-06-26 18:01:14 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-26 18:01:14 (UTC) |
commit | 125dc1fe52d7a3c8be1b955c79d729cc935c8b6d (patch) (unidiff) | |
tree | 018bb1bc68f03a3cc220ff0e2e22fbc62b0e9718 | |
parent | 1ddf9aa5ffc8dbb4ba290fa6a439b2d7681a0038 (diff) | |
download | opie-125dc1fe52d7a3c8be1b955c79d729cc935c8b6d.zip opie-125dc1fe52d7a3c8be1b955c79d729cc935c8b6d.tar.gz opie-125dc1fe52d7a3c8be1b955c79d729cc935c8b6d.tar.bz2 |
make use of improved mimetype handling
-rw-r--r-- | core/apps/textedit/textedit.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index c1f74bb..ccc43fa 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -465,97 +465,102 @@ void TextEdit::setFontSize(int sz, bool round_down_not_up) | |||
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 | ||
476 | void TextEdit::setBold(bool y) | 476 | void 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 | ||
483 | void TextEdit::setItalic(bool y) | 483 | void 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 | ||
490 | void TextEdit::setWordWrap(bool y) | 490 | void 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 | ||
497 | void TextEdit::fileNew() | 497 | void 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 | ||
505 | void TextEdit::fileOpen() | 505 | void 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( 2,"/");//,"", "*", this ); | 513 | QMap<QString, QStringList> map; |
514 | map.insert(tr("All"), QStringList() ); | ||
515 | QStringList text; | ||
516 | text << "text/*"; | ||
517 | map.insert(tr("Text"), text ); | ||
518 | QString str = OFileDialog::getOpenFileName( 2,"/", QString::null, map);//,"", "*", this ); | ||
514 | if(!str.isEmpty() ) | 519 | if(!str.isEmpty() ) |
515 | openFile( str ); | 520 | openFile( str ); |
516 | // } else { | 521 | // } else { |
517 | // QString str; | 522 | // QString str; |
518 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // | 523 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // |
519 | // browseForFiles->setFileView( viewSelection ); | 524 | // browseForFiles->setFileView( viewSelection ); |
520 | // browseForFiles->showMaximized(); | 525 | // browseForFiles->showMaximized(); |
521 | // // if( result != -1 ) | 526 | // // if( result != -1 ) |
522 | 527 | ||
523 | // if( browseForFiles->exec() != -1 ) { | 528 | // if( browseForFiles->exec() != -1 ) { |
524 | // QString selFile = browseForFiles->selectedFileName; | 529 | // QString selFile = browseForFiles->selectedFileName; |
525 | // QStringList fileList = browseForFiles->fileList; | 530 | // QStringList fileList = browseForFiles->fileList; |
526 | // qDebug(selFile); | 531 | // qDebug(selFile); |
527 | // QStringList::ConstIterator f; | 532 | // QStringList::ConstIterator f; |
528 | // QString fileTemp; | 533 | // QString fileTemp; |
529 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { | 534 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { |
530 | // fileTemp = *f; | 535 | // fileTemp = *f; |
531 | // fileTemp.right( fileTemp.length()-5); | 536 | // fileTemp.right( fileTemp.length()-5); |
532 | // QString fileName = fileTemp; | 537 | // QString fileName = fileTemp; |
533 | // if( fileName != "Unnamed" || fileName != "Empty Text" ) { | 538 | // if( fileName != "Unnamed" || fileName != "Empty Text" ) { |
534 | // currentFileName = fileName; | 539 | // currentFileName = fileName; |
535 | // qDebug("please open "+currentFileName); | 540 | // qDebug("please open "+currentFileName); |
536 | // openFile(currentFileName ); | 541 | // openFile(currentFileName ); |
537 | // } | 542 | // } |
538 | // } | 543 | // } |
539 | // viewSelection = browseForFiles->SelectionCombo->currentItem(); | 544 | // viewSelection = browseForFiles->SelectionCombo->currentItem(); |
540 | // } | 545 | // } |
541 | // delete browseForFiles; | 546 | // delete browseForFiles; |
542 | // editor->setEdited( FALSE); | 547 | // editor->setEdited( FALSE); |
543 | // edited1=FALSE; | 548 | // edited1=FALSE; |
544 | // edited=FALSE; | 549 | // edited=FALSE; |
545 | // if(caption().left(1)=="*") | 550 | // if(caption().left(1)=="*") |
546 | // setCaption(caption().right(caption().length()-1)); | 551 | // setCaption(caption().right(caption().length()-1)); |
547 | // doSearchBar(); | 552 | // doSearchBar(); |
548 | // } | 553 | // } |
549 | 554 | ||
550 | } | 555 | } |
551 | 556 | ||
552 | void TextEdit::doSearchBar() | 557 | void TextEdit::doSearchBar() |
553 | { | 558 | { |
554 | Config cfg("TextEdit"); | 559 | Config cfg("TextEdit"); |
555 | cfg.setGroup("View"); | 560 | cfg.setGroup("View"); |
556 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | 561 | if(cfg.readEntry("SearchBar","Closed") != "Opened") |
557 | searchBar->hide(); | 562 | searchBar->hide(); |
558 | } | 563 | } |
559 | 564 | ||
560 | #if 0 | 565 | #if 0 |
561 | void TextEdit::slotFind() | 566 | void TextEdit::slotFind() |