summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-11 23:53:23 (UTC)
committer llornkcor <llornkcor>2002-04-11 23:53:23 (UTC)
commita1615d98bdd7430e0533c0325dfdc39bf6627ab2 (patch) (unidiff)
tree14989f0603a32abaa90826b2eff5fb318f99bf70
parent2599e347d9444cfa6282fec9f2bfb9df4743d6d2 (diff)
downloadopie-a1615d98bdd7430e0533c0325dfdc39bf6627ab2.zip
opie-a1615d98bdd7430e0533c0325dfdc39bf6627ab2.tar.gz
opie-a1615d98bdd7430e0533c0325dfdc39bf6627ab2.tar.bz2
here ya go
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp65
-rw-r--r--core/apps/textedit/textedit.pro2
2 files changed, 36 insertions, 31 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 943fecd..a66b967 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -16,48 +16,49 @@
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#include <opie/ofileselector.h>
40 41
41#include <qstringlist.h> 42#include <qstringlist.h>
42#include <qaction.h> 43#include <qaction.h>
43#include <qcolordialog.h> 44#include <qcolordialog.h>
44#include <qfileinfo.h> 45#include <qfileinfo.h>
45#include <qlineedit.h> 46#include <qlineedit.h>
46#include <qmessagebox.h> 47#include <qmessagebox.h>
47#include <qobjectlist.h> 48#include <qobjectlist.h>
48#include <qpopupmenu.h> 49#include <qpopupmenu.h>
49#include <qspinbox.h> 50#include <qspinbox.h>
50#include <qtoolbutton.h> 51#include <qtoolbutton.h>
51#include <qwidgetstack.h> 52#include <qwidgetstack.h>
52#include <qcheckbox.h> 53#include <qcheckbox.h>
53#include <qcombo.h> 54#include <qcombo.h>
54#include <unistd.h> 55#include <unistd.h>
55#include <sys/stat.h> 56#include <sys/stat.h>
56 57
57#include <stdlib.h> //getenv 58#include <stdlib.h> //getenv
58/* XPM */ 59/* XPM */
59static char * filesave_xpm[] = { 60static char * filesave_xpm[] = {
60"16 16 78 1", 61"16 16 78 1",
61" c None", 62" c None",
62". c #343434", 63". c #343434",
63"+ c #A0A0A0", 64"+ c #A0A0A0",
@@ -477,78 +478,82 @@ void TextEdit::setBold(bool y)
477void TextEdit::setItalic(bool y) 478void TextEdit::setItalic(bool y)
478{ 479{
479 QFont f = editor->font(); 480 QFont f = editor->font();
480 f.setItalic(y); 481 f.setItalic(y);
481 editor->setFont(f); 482 editor->setFont(f);
482} 483}
483 484
484void TextEdit::setWordWrap(bool y) 485void TextEdit::setWordWrap(bool y)
485{ 486{
486 bool state = editor->edited(); 487 bool state = editor->edited();
487 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); 488 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap );
488 editor->setEdited( state ); 489 editor->setEdited( state );
489} 490}
490 491
491void TextEdit::fileNew() 492void TextEdit::fileNew()
492{ 493{
493// if( !bFromDocView ) { 494// if( !bFromDocView ) {
494// saveAs(); 495// saveAs();
495// } 496// }
496 newFile(DocLnk()); 497 newFile(DocLnk());
497} 498}
498 499
499void TextEdit::fileOpen() 500void TextEdit::fileOpen()
500{ 501{
501 browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // 502 OFileSelector *fileSelector;
502 browseForFiles->setFileView( viewSelection ); 503 fileSelector = new OFileSelector( this, 1,1,"/","", "text/*");
503 browseForFiles->showMaximized(); 504 fileSelector->showMaximized();
504// if( result != -1 ) 505
505 506// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); //
506 if( browseForFiles->exec() != -1 ) { 507// browseForFiles->setFileView( viewSelection );
507 QString selFile = browseForFiles->selectedFileName; 508// browseForFiles->showMaximized();
508 QStringList fileList = browseForFiles->fileList; 509// // if( result != -1 )
509 qDebug(selFile); 510
510 QStringList::ConstIterator f; 511// if( browseForFiles->exec() != -1 ) {
511 QString fileTemp; 512// QString selFile = browseForFiles->selectedFileName;
512 for ( f = fileList.begin(); f != fileList.end(); f++ ) { 513// QStringList fileList = browseForFiles->fileList;
513 fileTemp = *f; 514// qDebug(selFile);
514 fileTemp.right( fileTemp.length()-5); 515// QStringList::ConstIterator f;
515 QString fileName = fileTemp; 516// QString fileTemp;
516 if( fileName != "Unnamed" || fileName != "Empty Text" ) { 517// for ( f = fileList.begin(); f != fileList.end(); f++ ) {
517 currentFileName = fileName; 518// fileTemp = *f;
518 qDebug("please open "+currentFileName); 519// fileTemp.right( fileTemp.length()-5);
519 openFile(fileName ); 520// QString fileName = fileTemp;
520 } 521// if( fileName != "Unnamed" || fileName != "Empty Text" ) {
521 } 522// currentFileName = fileName;
522 viewSelection = browseForFiles->SelectionCombo->currentItem(); 523// qDebug("please open "+currentFileName);
523 } 524// openFile(fileName );
524 delete browseForFiles; 525// }
525 editor->setEdited( FALSE); 526// }
526 edited1=FALSE; 527// viewSelection = browseForFiles->SelectionCombo->currentItem();
527 edited=FALSE; 528// }
528 if(caption().left(1)=="*") 529// delete browseForFiles;
529 setCaption(caption().right(caption().length()-1)); 530// editor->setEdited( FALSE);
530 doSearchBar(); 531// edited1=FALSE;
532// edited=FALSE;
533// if(caption().left(1)=="*")
534// setCaption(caption().right(caption().length()-1));
535// doSearchBar();
531} 536}
532 537
533void TextEdit::doSearchBar() 538void TextEdit::doSearchBar()
534{ 539{
535 Config cfg("TextEdit"); 540 Config cfg("TextEdit");
536 cfg.setGroup("View"); 541 cfg.setGroup("View");
537 if(cfg.readEntry("SearchBar","Closed") != "Opened") 542 if(cfg.readEntry("SearchBar","Closed") != "Opened")
538 searchBar->hide(); 543 searchBar->hide();
539} 544}
540 545
541#if 0 546#if 0
542void TextEdit::slotFind() 547void TextEdit::slotFind()
543{ 548{
544 FindDialog frmFind( tr("Text Editor"), this ); 549 FindDialog frmFind( tr("Text Editor"), this );
545 connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), 550 connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)),
546 editor, SLOT(slotDoFind( const QString&,bool,bool))); 551 editor, SLOT(slotDoFind( const QString&,bool,bool)));
547 552
548 //case sensitive, backwards, [category] 553 //case sensitive, backwards, [category]
549 554
550 connect( editor, SIGNAL(notFound()), 555 connect( editor, SIGNAL(notFound()),
551 &frmFind, SLOT(slotNotFound()) ); 556 &frmFind, SLOT(slotNotFound()) );
552 connect( editor, SIGNAL(searchWrapped()), 557 connect( editor, SIGNAL(searchWrapped()),
553 &frmFind, SLOT(slotWrapAround()) ); 558 &frmFind, SLOT(slotWrapAround()) );
554 559
diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro
index fce76bd..aae7f89 100644
--- a/core/apps/textedit/textedit.pro
+++ b/core/apps/textedit/textedit.pro
@@ -1,24 +1,24 @@
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 fileBrowser.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 fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp
7 7
8INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
9DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe 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
19TRANSLATIONS += ../i18n/ja/textedit.ts 19TRANSLATIONS += ../i18n/ja/textedit.ts
20TRANSLATIONS += ../i18n/sl/textedit.ts 20TRANSLATIONS += ../i18n/sl/textedit.ts
21TRANSLATIONS += ../i18n/ko/textedit.ts 21TRANSLATIONS += ../i18n/ko/textedit.ts
22TRANSLATIONS += ../i18n/no/textedit.ts 22TRANSLATIONS += ../i18n/no/textedit.ts
23TRANSLATIONS += ../i18n/zh_CN/textedit.ts 23TRANSLATIONS += ../i18n/zh_CN/textedit.ts
24TRANSLATIONS += ../i18n/zh_TW/textedit.ts 24TRANSLATIONS += ../i18n/zh_TW/textedit.ts