summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp67
-rw-r--r--core/apps/textedit/textedit.h1
2 files changed, 42 insertions, 26 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index e978fa4..b199c81 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -245,3 +245,4 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
245 edited=false; 245 edited=false;
246 edited1=false; 246 fromSetDocument=false;
247
247 setToolBarsMovable( false ); 248 setToolBarsMovable( false );
@@ -271,3 +272,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
271 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 272 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
272 a->addTo( bar ); 273// a->addTo( bar );
273 a->addTo( file ); 274 a->addTo( file );
@@ -282,2 +283,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
282 file->insertSeparator(); 283 file->insertSeparator();
284 a->addTo( bar );
283 a->addTo( file ); 285 a->addTo( file );
@@ -341,2 +343,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
341 nStart->addTo( advancedMenu ); 343 nStart->addTo( advancedMenu );
344 nStart->setEnabled(false);
342 345
@@ -438,3 +441,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
438 currentFileName=qApp->argv()[1]; 441 currentFileName=qApp->argv()[1];
439// qDebug("<<<<<<<<<<<<<<<<<<<<<<<< "+currentFileName+" %d",qApp->argc()); 442
440 QFileInfo fi(currentFileName); 443 QFileInfo fi(currentFileName);
@@ -447,9 +450,11 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
447 } else { 450 } else {
448// qDebug("Do other thing"); 451 edited1=false;
449 if(startWithNew) { 452
453// if(startWithNew ) {
450 openDotFile(""); 454 openDotFile("");
451// fileNew(); 455// fileNew();
452 } else { 456// }
453 fileOpen(); 457// else {
454 } 458// fileOpen();
459// }
455 } 460 }
@@ -457,2 +462,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
457 viewSelection = cfg.readNumEntry( "FileView", 0 ); 462 viewSelection = cfg.readNumEntry( "FileView", 0 );
463// setCaption(tr("Text Editor"));
458} 464}
@@ -697,3 +703,3 @@ void TextEdit::openFile( const QString &f ) {
697// bFromDocView = true; 703// bFromDocView = true;
698 if(f.find(".desktop",0,true) != -1 && !openDesktop) { 704 if(f.find(".desktop",0,true) != -1 && !openDesktop ) {
699 switch ( QMessageBox::warning(this,tr("Text Editor"), 705 switch ( QMessageBox::warning(this,tr("Text Editor"),
@@ -828,2 +834,4 @@ bool TextEdit::save() {
828bool TextEdit::saveAs() { 834bool TextEdit::saveAs() {
835 if(caption() == tr("Text Editor"))
836 return false;
829 qDebug("saveAsFile " + currentFileName); 837 qDebug("saveAsFile " + currentFileName);
@@ -965,15 +973,15 @@ void TextEdit::setDocument(const QString& fileref) {
965 qDebug("setDocument"); 973 qDebug("setDocument");
966 QFileInfo fi(currentFileName); 974 QFileInfo fi(currentFileName);
967 qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName); 975 qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName);
968 if(fi.baseName().left(1) == "") { 976 if(fi.baseName().left(1) == "") {
969// openDotFile(currentFileName); 977 // openDotFile(currentFileName);
970 } else { 978 } else {
971 qDebug("setDoc open"); 979 qDebug("setDoc open");
972 bFromDocView = true; 980 bFromDocView = true;
973 openFile(fileref); 981 openFile(fileref);
974 editor->setEdited(true); 982 editor->setEdited(true);
975 edited1=false; 983 edited1=false;
976 edited=true; 984 edited=true;
977 985 // fromSetDocument=false;
978// doSearchBar(); 986 // doSearchBar();
979 } 987 }
@@ -999,3 +1007,7 @@ void TextEdit::changeFont() {
999void TextEdit::editDelete() { 1007void TextEdit::editDelete() {
1000 switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want<BR>to <B>delete</B> the current file\nfrom the disk?<BR>This is <B>irreversable!!</B>"),tr("Yes"),tr("No"),0,0,1) ) { 1008 switch ( QMessageBox::warning(this,tr("Text Editor"),
1009 tr("Do you really want<BR>to <B>delete</B> "
1010 "the current file\nfrom the disk?<BR>This is "
1011 "<B>irreversable!!</B>"),
1012 tr("Yes"),tr("No"),0,0,1) ) {
1001 case 0: 1013 case 0:
@@ -1021,4 +1033,5 @@ void TextEdit::changeStartConfig( bool b ) {
1021 1033
1022void TextEdit::editorChanged() { 1034void TextEdit::editorChanged() {
1023 if(editor->edited() && edited && !edited1) { 1035// qDebug("editor changed");
1036 if( /*editor->edited() &&*/ /*edited && */!edited1) {
1024 setCaption( "*"+caption()); 1037 setCaption( "*"+caption());
@@ -1029,3 +1042,3 @@ void TextEdit::editorChanged() {
1029 1042
1030void TextEdit::receive(const QCString&msg, const QByteArray&) { 1043void TextEdit::receive(const QCString&msg, const QByteArray &data) {
1031 qDebug("QCop "+msg); 1044 qDebug("QCop "+msg);
@@ -1033,2 +1046,3 @@ void TextEdit::receive(const QCString&msg, const QByteArray&) {
1033 qDebug("bugger all"); 1046 qDebug("bugger all");
1047
1034 } 1048 }
@@ -1036,2 +1050,3 @@ void TextEdit::receive(const QCString&msg, const QByteArray&) {
1036} 1050}
1051
1037void TextEdit::doAbout() { 1052void TextEdit::doAbout() {
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index bb7d693..9f16ebf 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -118,2 +118,3 @@ private:
118// fileBrowser *browseForFiles; 118// fileBrowser *browseForFiles;
119 bool fromSetDocument;
119 QpeEditor* editor; 120 QpeEditor* editor;