-rw-r--r-- | core/apps/textedit/textedit.cpp | 28 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 2 |
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 @@ -352,2 +352,4 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) nStart->addTo( font ); + font->insertSeparator(); + font->insertItem(tr("About"), this, SLOT( doAbout()) ); @@ -414,2 +416,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) } + viewSelection = cfg.readNumEntry( "FileView", 0 ); @@ -532,3 +535,3 @@ void TextEdit::fileOpen() qDebug("please open "+currentFileName); - openFile(str ); + openFile(currentFileName ); } @@ -665,4 +668,6 @@ void TextEdit::openFile( const QString &f ) } - } else + } else { filer = f; + fileIs = TRUE; + } @@ -744,3 +749,3 @@ bool TextEdit::save() mode = buf.st_mode; - + if(!fileIs) { doc->setName( name); @@ -750,2 +755,13 @@ bool TextEdit::save() } + } else { + qDebug("regular save file"); + QFile f(file); + if( f.open(IO_WriteOnly)) { + f.writeBlock(rt,rt.length()); + } else { + QMessageBox::message("Text Edit","Write Failed"); + return false; + } + + } editor->setEdited( FALSE); @@ -971 +987,7 @@ void TextEdit::receive(const QCString&msg, const QByteArray&) { } +void TextEdit::doAbout() { + QMessageBox::about(0,"Text Edit","Text Edit is copyright\n" + "2000 Trolltech AS, and\n" + "2002 by L.J.Potter \nljp@llornkcor.com\n" + "and is licensed under the GPL"); +} 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 @@ -67,2 +67,3 @@ void receive(const QCString&, const QByteArray&); protected: + bool fileIs; void closeEvent( QCloseEvent *e ); @@ -70,2 +71,3 @@ protected: private slots: + void doAbout(); void setDocument(const QString&); |