author | llornkcor <llornkcor> | 2002-07-20 03:00:42 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-20 03:00:42 (UTC) |
commit | c42e3e2485c545beedd482115927bff7d1bf65a2 (patch) (side-by-side diff) | |
tree | 9b82c86631917d5ae66d9307c6b5e44237c1ecc9 | |
parent | 8256eec0103a50f80905e71891904a4267754559 (diff) | |
download | opie-c42e3e2485c545beedd482115927bff7d1bf65a2.zip opie-c42e3e2485c545beedd482115927bff7d1bf65a2.tar.gz opie-c42e3e2485c545beedd482115927bff7d1bf65a2.tar.bz2 |
added 'Advanced Features for prompting for .desktop files and permissions on saving
-rw-r--r-- | core/apps/textedit/textedit.cpp | 24 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 5 |
2 files changed, 23 insertions, 6 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index b276cbb..0af18da 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -344,2 +344,3 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) font->insertSeparator(); + nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); @@ -348,4 +349,12 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) nStart->addTo( font ); + + nAdvanced = new QAction( tr("Advanced features"), QString::null, 0, this, 0 ); + connect( nAdvanced, SIGNAL( toggled(bool) ), this, SLOT( doAdvanced(bool) ) ); + nAdvanced->setToggleAction(TRUE); + nAdvanced->addTo( font ); + if(cfg.readBoolEntry("AdvancedFeatures")) + nAdvanced->setOn(TRUE); font->insertSeparator(); - font->insertItem(tr("About"), this, SLOT( doAbout()) ); + + font->insertItem(tr("About"), this, SLOT( doAbout()) ); @@ -625,3 +634,3 @@ void TextEdit::openFile( const QString &f ) // bFromDocView = TRUE; - if(f.find(".desktop",0,TRUE) != -1) { + if(f.find(".desktop",0,TRUE) != -1 && useAdvancedFeatures) { switch ( QMessageBox::warning(this,tr("Text Editor"), @@ -825,3 +834,3 @@ bool TextEdit::saveAs() -// if( fileSaveDlg->filePermCheck->isChecked() ) { + if( useAdvancedFfeatures ) { filePermissions *filePerm; @@ -832,3 +841,3 @@ bool TextEdit::saveAs() delete filePerm; -// } + } } @@ -968 +977,8 @@ void TextEdit::doAbout() { } + +void TextEdit::doAdvanced(bool b) { + useAdvancedFeatures=b; + Config cfg("TextEdit"); + cfg.setGroup("View"); + cfg.writeEntry("AdvancedFeatures",b); +} diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index 764d852..aec6427 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h @@ -59,3 +59,3 @@ public: QPopupMenu *font; - QAction *nStart, *nFileDlgOpt; + QAction *nStart, *nFileDlgOpt, *nAdvanced; bool edited, edited1; @@ -67,3 +67,3 @@ void receive(const QCString&, const QByteArray&); protected: - bool fileIs; + bool fileIs, useAdvancedFeatures; void closeEvent( QCloseEvent *e ); @@ -71,2 +71,3 @@ protected: private slots: + void doAdvanced(bool); void doAbout(); |