author | llornkcor <llornkcor> | 2002-05-28 15:30:43 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-28 15:30:43 (UTC) |
commit | f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5 (patch) (unidiff) | |
tree | 62fbedb348fdcc02264f343c3a6f9a15b0202f7b | |
parent | 267db9835cb67a9fb65cf5cda592012d06caa57d (diff) | |
download | opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.zip opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.tar.gz opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.tar.bz2 |
convert to ofileselector, and fixed bug
-rw-r--r-- | core/apps/textedit/textedit.cpp | 77 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 4 | ||||
-rw-r--r-- | core/apps/textedit/textedit.pro | 4 |
3 files changed, 43 insertions, 42 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index b8d62db..403bd92 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1,87 +1,87 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 | 20 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 |
21 | 21 | ||
22 | #include "textedit.h" | 22 | #include "textedit.h" |
23 | #include "fileBrowser.h" | 23 | //#include "fileBrowser.h" |
24 | #include "fileSaver.h" | 24 | #include "fileSaver.h" |
25 | #include "filePermissions.h" | 25 | #include "filePermissions.h" |
26 | 26 | ||
27 | #include "fontDialog.h" | 27 | #include "fontDialog.h" |
28 | 28 | ||
29 | #include <qpe/fontdatabase.h> | 29 | #include <qpe/fontdatabase.h> |
30 | #include <qpe/global.h> | 30 | #include <qpe/global.h> |
31 | #include <qpe/fileselector.h> | 31 | #include <qpe/fileselector.h> |
32 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
33 | #include <qpe/resource.h> | 33 | #include <qpe/resource.h> |
34 | #include <qpe/config.h> | 34 | #include <qpe/config.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | #include <qpe/qpemenubar.h> | 36 | #include <qpe/qpemenubar.h> |
37 | #include <qpe/qpetoolbar.h> | 37 | #include <qpe/qpetoolbar.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 38 | #include <qpe/qcopenvelope_qws.h> |
39 | //#include <qpe/finddialog.h> | 39 | //#include <qpe/finddialog.h> |
40 | 40 | ||
41 | #include <opie/ofileselector.h> | 41 | #include <opie/ofileselector.h> |
42 | #include <opie/ofiledialog.h> | 42 | #include <opie/ofiledialog.h> |
43 | 43 | ||
44 | #include <qstringlist.h> | 44 | #include <qstringlist.h> |
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcolordialog.h> | 46 | #include <qcolordialog.h> |
47 | #include <qfileinfo.h> | 47 | #include <qfileinfo.h> |
48 | #include <qlineedit.h> | 48 | #include <qlineedit.h> |
49 | #include <qmessagebox.h> | 49 | #include <qmessagebox.h> |
50 | #include <qobjectlist.h> | 50 | #include <qobjectlist.h> |
51 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
52 | #include <qspinbox.h> | 52 | #include <qspinbox.h> |
53 | #include <qtoolbutton.h> | 53 | #include <qtoolbutton.h> |
54 | #include <qwidgetstack.h> | 54 | #include <qwidgetstack.h> |
55 | #include <qcheckbox.h> | 55 | #include <qcheckbox.h> |
56 | #include <qcombo.h> | 56 | #include <qcombo.h> |
57 | #include <unistd.h> | 57 | #include <unistd.h> |
58 | #include <sys/stat.h> | 58 | #include <sys/stat.h> |
59 | 59 | ||
60 | #include <stdlib.h> //getenv | 60 | #include <stdlib.h> //getenv |
61 | /* XPM */ | 61 | /* XPM */ |
62 | static char * filesave_xpm[] = { | 62 | static char * filesave_xpm[] = { |
63 | "16 16 78 1", | 63 | "16 16 78 1", |
64 | " c None", | 64 | " c None", |
65 | ". c #343434", | 65 | ". c #343434", |
66 | "+ c #A0A0A0", | 66 | "+ c #A0A0A0", |
67 | "@ c #565656", | 67 | "@ c #565656", |
68 | "# c #9E9E9E", | 68 | "# c #9E9E9E", |
69 | "$ c #525252", | 69 | "$ c #525252", |
70 | "% c #929292", | 70 | "% c #929292", |
71 | "& c #676767", | 71 | "& c #676767", |
72 | "* c #848484", | 72 | "* c #848484", |
73 | "= c #666666", | 73 | "= c #666666", |
74 | "- c #D8D8D8", | 74 | "- c #D8D8D8", |
75 | "; c #FFFFFF", | 75 | "; c #FFFFFF", |
76 | "> c #DBDBDB", | 76 | "> c #DBDBDB", |
77 | ", c #636363", | 77 | ", c #636363", |
78 | "' c #989898", | 78 | "' c #989898", |
79 | ") c #2D2D2D", | 79 | ") c #2D2D2D", |
80 | "! c #909090", | 80 | "! c #909090", |
81 | "~ c #AEAEAE", | 81 | "~ c #AEAEAE", |
82 | "{ c #EAEAEA", | 82 | "{ c #EAEAEA", |
83 | "] c #575757", | 83 | "] c #575757", |
84 | "^ c #585858", | 84 | "^ c #585858", |
85 | "/ c #8A8A8A", | 85 | "/ c #8A8A8A", |
86 | "( c #828282", | 86 | "( c #828282", |
87 | "_ c #6F6F6F", | 87 | "_ c #6F6F6F", |
@@ -446,167 +446,168 @@ void TextEdit::zoomOut() | |||
446 | setFontSize(editor->font().pointSize()-1,TRUE); | 446 | setFontSize(editor->font().pointSize()-1,TRUE); |
447 | } | 447 | } |
448 | 448 | ||
449 | 449 | ||
450 | void TextEdit::setFontSize(int sz, bool round_down_not_up) | 450 | void 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 | ||
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( 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 | void TextEdit::doSearchBar() | 552 | void TextEdit::doSearchBar() |
552 | { | 553 | { |
553 | Config cfg("TextEdit"); | 554 | Config cfg("TextEdit"); |
554 | cfg.setGroup("View"); | 555 | cfg.setGroup("View"); |
555 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | 556 | if(cfg.readEntry("SearchBar","Closed") != "Opened") |
556 | searchBar->hide(); | 557 | searchBar->hide(); |
557 | } | 558 | } |
558 | 559 | ||
559 | #if 0 | 560 | #if 0 |
560 | void TextEdit::slotFind() | 561 | void TextEdit::slotFind() |
561 | { | 562 | { |
562 | FindDialog frmFind( tr("Text Editor"), this ); | 563 | FindDialog frmFind( tr("Text Editor"), this ); |
563 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 564 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
564 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 565 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
565 | 566 | ||
566 | //case sensitive, backwards, [category] | 567 | //case sensitive, backwards, [category] |
567 | 568 | ||
568 | connect( editor, SIGNAL(notFound()), | 569 | connect( editor, SIGNAL(notFound()), |
569 | &frmFind, SLOT(slotNotFound()) ); | 570 | &frmFind, SLOT(slotNotFound()) ); |
570 | connect( editor, SIGNAL(searchWrapped()), | 571 | connect( editor, SIGNAL(searchWrapped()), |
571 | &frmFind, SLOT(slotWrapAround()) ); | 572 | &frmFind, SLOT(slotWrapAround()) ); |
572 | 573 | ||
573 | frmFind.exec(); | 574 | frmFind.exec(); |
574 | 575 | ||
575 | 576 | ||
576 | } | 577 | } |
577 | #endif | 578 | #endif |
578 | 579 | ||
579 | void TextEdit::fileRevert() | 580 | void TextEdit::fileRevert() |
580 | { | 581 | { |
581 | clear(); | 582 | clear(); |
582 | fileOpen(); | 583 | fileOpen(); |
583 | } | 584 | } |
584 | 585 | ||
585 | void TextEdit::editCut() | 586 | void TextEdit::editCut() |
586 | { | 587 | { |
587 | #ifndef QT_NO_CLIPBOARD | 588 | #ifndef QT_NO_CLIPBOARD |
588 | editor->cut(); | 589 | editor->cut(); |
589 | #endif | 590 | #endif |
590 | } | 591 | } |
591 | 592 | ||
592 | void TextEdit::editCopy() | 593 | void TextEdit::editCopy() |
593 | { | 594 | { |
594 | #ifndef QT_NO_CLIPBOARD | 595 | #ifndef QT_NO_CLIPBOARD |
595 | editor->copy(); | 596 | editor->copy(); |
596 | #endif | 597 | #endif |
597 | } | 598 | } |
598 | 599 | ||
599 | void TextEdit::editPaste() | 600 | void TextEdit::editPaste() |
600 | { | 601 | { |
601 | #ifndef QT_NO_CLIPBOARD | 602 | #ifndef QT_NO_CLIPBOARD |
602 | editor->paste(); | 603 | editor->paste(); |
603 | #endif | 604 | #endif |
604 | } | 605 | } |
605 | 606 | ||
606 | void TextEdit::editFind() | 607 | void TextEdit::editFind() |
607 | { | 608 | { |
608 | searchBar->show(); | 609 | searchBar->show(); |
609 | searchVisible = TRUE; | 610 | searchVisible = TRUE; |
610 | searchEdit->setFocus(); | 611 | searchEdit->setFocus(); |
611 | Config cfg("TextEdit"); | 612 | Config cfg("TextEdit"); |
612 | cfg.setGroup("View"); | 613 | cfg.setGroup("View"); |
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index 9d27ab0..d8208b1 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h | |||
@@ -1,126 +1,126 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // additions made by L.J. Potter Sun 02-17-2002 22:27:46 | 20 | // additions made by L.J. Potter Sun 02-17-2002 22:27:46 |
21 | 21 | ||
22 | #ifndef TEXTEDIT_H | 22 | #ifndef TEXTEDIT_H |
23 | #define TEXTEDIT_H | 23 | #define TEXTEDIT_H |
24 | 24 | ||
25 | #define QTEXTEDIT_OPEN_API | 25 | #define QTEXTEDIT_OPEN_API |
26 | 26 | ||
27 | #include "fileBrowser.h" | 27 | //#include "fileBrowser.h" |
28 | #include "fileSaver.h" | 28 | #include "fileSaver.h" |
29 | 29 | ||
30 | #include <qpe/filemanager.h> | 30 | #include <qpe/filemanager.h> |
31 | #include <qpe/qcopenvelope_qws.h> | 31 | #include <qpe/qcopenvelope_qws.h> |
32 | 32 | ||
33 | #include <opie/ofileselector.h> | 33 | #include <opie/ofileselector.h> |
34 | 34 | ||
35 | #include <qmainwindow.h> | 35 | #include <qmainwindow.h> |
36 | #include <qmultilineedit.h> | 36 | #include <qmultilineedit.h> |
37 | #include <qlist.h> | 37 | #include <qlist.h> |
38 | #include <qmap.h> | 38 | #include <qmap.h> |
39 | 39 | ||
40 | class QAction; | 40 | class QAction; |
41 | class QWidgetStack; | 41 | class QWidgetStack; |
42 | class QToolButton; | 42 | class QToolButton; |
43 | class QPopupMenu; | 43 | class QPopupMenu; |
44 | class QToolBar; | 44 | class QToolBar; |
45 | class QLineEdit; | 45 | class QLineEdit; |
46 | class QAction; | 46 | class QAction; |
47 | class FileSelector; | 47 | class FileSelector; |
48 | class QpeEditor; | 48 | class QpeEditor; |
49 | class QPopupMenu; | 49 | class QPopupMenu; |
50 | 50 | ||
51 | class TextEdit : public QMainWindow | 51 | class TextEdit : public QMainWindow |
52 | { | 52 | { |
53 | Q_OBJECT | 53 | Q_OBJECT |
54 | 54 | ||
55 | public: | 55 | public: |
56 | TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 56 | TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
57 | ~TextEdit(); | 57 | ~TextEdit(); |
58 | 58 | ||
59 | QPopupMenu *font; | 59 | QPopupMenu *font; |
60 | QAction *nStart, *nFileDlgOpt; | 60 | QAction *nStart, *nFileDlgOpt; |
61 | bool edited, edited1; | 61 | bool edited, edited1; |
62 | void openFile( const QString & ); | 62 | void openFile( const QString & ); |
63 | QCopChannel * channel; | 63 | QCopChannel * channel; |
64 | public slots: | 64 | public slots: |
65 | void editorChanged(); | 65 | void editorChanged(); |
66 | void receive(const QCString&, const QByteArray&); | 66 | void receive(const QCString&, const QByteArray&); |
67 | protected: | 67 | protected: |
68 | bool fileIs; | 68 | bool fileIs; |
69 | void closeEvent( QCloseEvent *e ); | 69 | void closeEvent( QCloseEvent *e ); |
70 | void doSearchBar(); | 70 | void doSearchBar(); |
71 | private slots: | 71 | private slots: |
72 | void doAbout(); | 72 | void doAbout(); |
73 | void setDocument(const QString&); | 73 | void setDocument(const QString&); |
74 | void changeFont(); | 74 | void changeFont(); |
75 | void fileNew(); | 75 | void fileNew(); |
76 | void fileRevert(); | 76 | void fileRevert(); |
77 | void fileOpen(); | 77 | void fileOpen(); |
78 | void changeStartConfig(bool); | 78 | void changeStartConfig(bool); |
79 | bool save(); | 79 | bool save(); |
80 | bool saveAs(); | 80 | bool saveAs(); |
81 | void cleanUp(); | 81 | void cleanUp(); |
82 | 82 | ||
83 | 83 | ||
84 | void editCut(); | 84 | void editCut(); |
85 | void editCopy(); | 85 | void editCopy(); |
86 | void editPaste(); | 86 | void editPaste(); |
87 | void editFind(); | 87 | void editFind(); |
88 | void editDelete(); | 88 | void editDelete(); |
89 | 89 | ||
90 | void findNext(); | 90 | void findNext(); |
91 | void findClose(); | 91 | void findClose(); |
92 | 92 | ||
93 | void search(); | 93 | void search(); |
94 | void accept(); | 94 | void accept(); |
95 | 95 | ||
96 | void newFile( const DocLnk & ); | 96 | void newFile( const DocLnk & ); |
97 | void openFile( const DocLnk & ); | 97 | void openFile( const DocLnk & ); |
98 | void showEditTools(); | 98 | void showEditTools(); |
99 | 99 | ||
100 | void zoomIn(); | 100 | void zoomIn(); |
101 | void zoomOut(); | 101 | void zoomOut(); |
102 | void setBold(bool y); | 102 | void setBold(bool y); |
103 | void setItalic(bool y); | 103 | void setItalic(bool y); |
104 | void setWordWrap(bool y); | 104 | void setWordWrap(bool y); |
105 | 105 | ||
106 | private: | 106 | private: |
107 | void colorChanged( const QColor &c ); | 107 | void colorChanged( const QColor &c ); |
108 | void clear(); | 108 | void clear(); |
109 | void updateCaption( const QString &name=QString::null ); | 109 | void updateCaption( const QString &name=QString::null ); |
110 | void setFontSize(int sz, bool round_down_not_up); | 110 | void setFontSize(int sz, bool round_down_not_up); |
111 | 111 | ||
112 | private: | 112 | private: |
113 | fileSaver *fileSaveDlg; | 113 | fileSaver *fileSaveDlg; |
114 | fileBrowser *browseForFiles; | 114 | // fileBrowser *browseForFiles; |
115 | QpeEditor* editor; | 115 | QpeEditor* editor; |
116 | QToolBar *menu, *editBar, *searchBar; | 116 | QToolBar *menu, *editBar, *searchBar; |
117 | QLineEdit *searchEdit; | 117 | QLineEdit *searchEdit; |
118 | DocLnk *doc; | 118 | DocLnk *doc; |
119 | bool searchVisible; | 119 | bool searchVisible; |
120 | bool bFromDocView; | 120 | bool bFromDocView; |
121 | int viewSelection; | 121 | int viewSelection; |
122 | QAction *zin, *zout; | 122 | QAction *zin, *zout; |
123 | QString currentFileName; | 123 | QString currentFileName; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #endif | 126 | #endif |
diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro index 4f20da3..d01a9f4 100644 --- a/core/apps/textedit/textedit.pro +++ b/core/apps/textedit/textedit.pro | |||
@@ -1,25 +1,25 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | 3 | ||
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h | 5 | HEADERS = textedit.h fontDialog.h fileSaver.h filePermissions.h |
6 | SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp | 6 | SOURCES = main.cpp textedit.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp |
7 | 7 | ||
8 | INCLUDEPATH += $(OPIEDIR)/include | 8 | INCLUDEPATH += $(OPIEDIR)/include |
9 | DEPENDPATH += $(OPIEDIR)/include | 9 | DEPENDPATH += $(OPIEDIR)/include |
10 | LIBS += -lqpe -lopie | 10 | LIBS += -lqpe -lopie |
11 | 11 | ||
12 | TARGET = textedit | 12 | TARGET = textedit |
13 | 13 | ||
14 | TRANSLATIONS += ../i18n/de/textedit.ts | 14 | TRANSLATIONS += ../i18n/de/textedit.ts |
15 | TRANSLATIONS += ../i18n/pt_BR/textedit.ts | 15 | TRANSLATIONS += ../i18n/pt_BR/textedit.ts |
16 | TRANSLATIONS += ../i18n/en/textedit.ts | 16 | TRANSLATIONS += ../i18n/en/textedit.ts |
17 | TRANSLATIONS += ../i18n/hu/textedit.ts | 17 | TRANSLATIONS += ../i18n/hu/textedit.ts |
18 | TRANSLATIONS += ../i18n/fr/textedit.ts | 18 | TRANSLATIONS += ../i18n/fr/textedit.ts |
19 | TRANSLATIONS += ../i18n/ja/textedit.ts | 19 | TRANSLATIONS += ../i18n/ja/textedit.ts |
20 | TRANSLATIONS += ../i18n/sl/textedit.ts | 20 | TRANSLATIONS += ../i18n/sl/textedit.ts |
21 | TRANSLATIONS += ../i18n/pl/textedit.ts | 21 | TRANSLATIONS += ../i18n/pl/textedit.ts |
22 | TRANSLATIONS += ../i18n/ko/textedit.ts | 22 | TRANSLATIONS += ../i18n/ko/textedit.ts |
23 | TRANSLATIONS += ../i18n/no/textedit.ts | 23 | TRANSLATIONS += ../i18n/no/textedit.ts |
24 | TRANSLATIONS += ../i18n/zh_CN/textedit.ts | 24 | TRANSLATIONS += ../i18n/zh_CN/textedit.ts |
25 | TRANSLATIONS += ../i18n/zh_TW/textedit.ts | 25 | TRANSLATIONS += ../i18n/zh_TW/textedit.ts |