summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp77
-rw-r--r--core/apps/textedit/textedit.h4
-rw-r--r--core/apps/textedit/textedit.pro4
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
@@ -11,25 +11,25 @@
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>
@@ -498,63 +498,64 @@ 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
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
551void TextEdit::doSearchBar() 552void 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
560void TextEdit::slotFind() 561void TextEdit::slotFind()
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
@@ -15,25 +15,25 @@
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
@@ -102,25 +102,25 @@ private slots:
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
106private: 106private:
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
112private: 112private:
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,18 +1,18 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 3
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h 5HEADERS = textedit.h fontDialog.h fileSaver.h filePermissions.h
6SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp 6SOURCES = main.cpp textedit.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp
7 7
8INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
9DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe -lopie 10LIBS += -lqpe -lopie
11 11
12TARGET = textedit 12TARGET = textedit
13 13
14TRANSLATIONS += ../i18n/de/textedit.ts 14TRANSLATIONS += ../i18n/de/textedit.ts
15TRANSLATIONS += ../i18n/pt_BR/textedit.ts 15TRANSLATIONS += ../i18n/pt_BR/textedit.ts
16TRANSLATIONS += ../i18n/en/textedit.ts 16TRANSLATIONS += ../i18n/en/textedit.ts
17TRANSLATIONS += ../i18n/hu/textedit.ts 17TRANSLATIONS += ../i18n/hu/textedit.ts
18TRANSLATIONS += ../i18n/fr/textedit.ts 18TRANSLATIONS += ../i18n/fr/textedit.ts