summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp28
-rw-r--r--core/apps/textedit/textedit.h2
2 files changed, 27 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 84888c1..19449cb 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -351,4 +351,6 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
351 nStart->setToggleAction(TRUE); 351 nStart->setToggleAction(TRUE);
352 nStart->addTo( font ); 352 nStart->addTo( font );
353 font->insertSeparator();
354 font->insertItem(tr("About"), this, SLOT( doAbout()) );
353 355
354 mb->insertItem( tr( "File" ), file ); 356 mb->insertItem( tr( "File" ), file );
@@ -413,4 +415,5 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
413 fileOpen(); 415 fileOpen();
414 } 416 }
417
415 viewSelection = cfg.readNumEntry( "FileView", 0 ); 418 viewSelection = cfg.readNumEntry( "FileView", 0 );
416} 419}
@@ -531,5 +534,5 @@ void TextEdit::fileOpen()
531 currentFileName = fileName; 534 currentFileName = fileName;
532 qDebug("please open "+currentFileName); 535 qDebug("please open "+currentFileName);
533 openFile(str ); 536 openFile(currentFileName );
534 } 537 }
535 } 538 }
@@ -664,6 +667,8 @@ void TextEdit::openFile( const QString &f )
664 break; 667 break;
665 } 668 }
666 } else 669 } else {
667 filer = f; 670 filer = f;
671 fileIs = TRUE;
672 }
668 673
669 DocLnk nf; 674 DocLnk nf;
@@ -743,5 +748,5 @@ bool TextEdit::save()
743 stat(file.latin1(), &buf); 748 stat(file.latin1(), &buf);
744 mode = buf.st_mode; 749 mode = buf.st_mode;
745 750 if(!fileIs) {
746 doc->setName( name); 751 doc->setName( name);
747 FileManager fm; 752 FileManager fm;
@@ -749,4 +754,15 @@ bool TextEdit::save()
749 return false; 754 return false;
750 } 755 }
756 } else {
757 qDebug("regular save file");
758 QFile f(file);
759 if( f.open(IO_WriteOnly)) {
760 f.writeBlock(rt,rt.length());
761 } else {
762 QMessageBox::message("Text Edit","Write Failed");
763 return false;
764 }
765
766 }
751 editor->setEdited( FALSE); 767 editor->setEdited( FALSE);
752 edited1=FALSE; 768 edited1=FALSE;
@@ -970,2 +986,8 @@ void TextEdit::receive(const QCString&msg, const QByteArray&) {
970 986
971} 987}
988void TextEdit::doAbout() {
989 QMessageBox::about(0,"Text Edit","Text Edit is copyright\n"
990 "2000 Trolltech AS, and\n"
991 "2002 by L.J.Potter \nljp@llornkcor.com\n"
992 "and is licensed under the GPL");
993}
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index edc6fe3..9d27ab0 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -66,7 +66,9 @@ public slots:
66void receive(const QCString&, const QByteArray&); 66void receive(const QCString&, const QByteArray&);
67protected: 67protected:
68 bool fileIs;
68 void closeEvent( QCloseEvent *e ); 69 void closeEvent( QCloseEvent *e );
69 void doSearchBar(); 70 void doSearchBar();
70private slots: 71private slots:
72 void doAbout();
71 void setDocument(const QString&); 73 void setDocument(const QString&);
72 void changeFont(); 74 void changeFont();