author | llornkcor <llornkcor> | 2002-10-20 22:46:45 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-20 22:46:45 (UTC) |
commit | 9bbc3d997fca39d9ab53541376737b016007685b (patch) (side-by-side diff) | |
tree | b641985f4fae111e71fd620a2864028c6820b934 | |
parent | 7f4136df2e639ffa27c83422e4ccdf169ba71bad (diff) | |
download | opie-9bbc3d997fca39d9ab53541376737b016007685b.zip opie-9bbc3d997fca39d9ab53541376737b016007685b.tar.gz opie-9bbc3d997fca39d9ab53541376737b016007685b.tar.bz2 |
remember user configurations
-rw-r--r-- | core/apps/textedit/textedit.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 209c5de..f38ea53 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -905,82 +905,91 @@ void TextEdit::changeFont() { QBoxLayout *lay = new QVBoxLayout ( d ); OFontSelector *ofs = new OFontSelector ( true, d ); lay-> addWidget ( ofs ); ofs-> setSelectedFont ( editor-> font ( )); d-> showMaximized ( ); if ( d-> exec ( ) == QDialog::Accepted ) editor-> setFont ( ofs-> selectedFont ( )); delete d; } void TextEdit::editDelete() { 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) ) { case 0: if(doc) { doc->removeFiles(); clear(); setCaption( tr("Text Editor") ); } break; case 1: // exit break; }; } void TextEdit::changeStartConfig( bool b ) { Config cfg("TextEdit"); cfg.setGroup("View"); if(b) { qDebug("bool"); cfg.writeEntry("startNew","TRUE"); } else { cfg.writeEntry("startNew","FALSE"); } update(); } void TextEdit::editorChanged() { if(editor->edited() && edited && !edited1) { setCaption( "*"+caption()); edited1=TRUE; } edited=TRUE; } void TextEdit::receive(const QCString&msg, const QByteArray&) { qDebug("QCop "+msg); if ( msg == "setDocument(QString)" ) { qDebug("bugger all"); } } void TextEdit::doAbout() { QMessageBox::about(0,tr("Text Edit"),tr("Text Edit is copyright<BR>" "2000 Trolltech AS, and<BR>" "2002 by <B>L. J. Potter <BR>llornkcor@handhelds.org</B><BR>" "and is licensed under the GPL")); } void TextEdit::doPrompt(bool b) { promptExit=b; + Config cfg("TextEdit"); + cfg.setGroup ( "View" ); + cfg.writeEntry ( "PromptExit", b); } void TextEdit::doDesktop(bool b) { openDesktop=b; + Config cfg("TextEdit"); + cfg.setGroup ( "View" ); + cfg.writeEntry ( "OpenDesktop", b); } void TextEdit::doFilePerms(bool b) { filePerms=b; + Config cfg("TextEdit"); + cfg.setGroup ( "View" ); + cfg.writeEntry ( "FilePermissions", b); } void TextEdit::editPasteTimeDate() { #ifndef QT_NO_CLIPBOARD QClipboard *cb = QApplication::clipboard(); QDateTime dt = QDateTime::currentDateTime(); cb->setText( dt.toString()); editor->paste(); #endif } |