summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp40
1 files changed, 31 insertions, 9 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 );
@@ -506,3 +509,3 @@ void TextEdit::fileOpen()
bool b=FALSE;
- if(cfg.readEntry("useOldFileDialog") == "TRUE")
+ if(cfg.readEntry("useOldFileDialog") == "TRUE")
b=TRUE;
@@ -532,3 +535,3 @@ void TextEdit::fileOpen()
qDebug("please open "+currentFileName);
- openFile(str );
+ openFile(currentFileName );
}
@@ -536,3 +539,3 @@ void TextEdit::fileOpen()
viewSelection = browseForFiles->SelectionCombo->currentItem();
- }
+ }
delete browseForFiles;
@@ -665,4 +668,6 @@ void TextEdit::openFile( const QString &f )
}
- } else
+ } else {
filer = f;
+ fileIs = TRUE;
+ }
@@ -744,7 +749,18 @@ bool TextEdit::save()
mode = buf.st_mode;
-
- doc->setName( name);
- FileManager fm;
- if ( !fm.saveFile( *doc, rt ) ) {
- return false;
+ if(!fileIs) {
+ doc->setName( name);
+ FileManager fm;
+ if ( !fm.saveFile( *doc, rt ) ) {
+ return false;
+ }
+ } 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;
+ }
+
}
@@ -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");
+}