summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-07-20 03:00:42 (UTC)
committer llornkcor <llornkcor>2002-07-20 03:00:42 (UTC)
commitc42e3e2485c545beedd482115927bff7d1bf65a2 (patch) (side-by-side diff)
tree9b82c86631917d5ae66d9307c6b5e44237c1ecc9
parent8256eec0103a50f80905e71891904a4267754559 (diff)
downloadopie-c42e3e2485c545beedd482115927bff7d1bf65a2.zip
opie-c42e3e2485c545beedd482115927bff7d1bf65a2.tar.gz
opie-c42e3e2485c545beedd482115927bff7d1bf65a2.tar.bz2
added 'Advanced Features for prompting for .desktop files and permissions on saving
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp22
-rw-r--r--core/apps/textedit/textedit.h5
2 files changed, 22 insertions, 5 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
@@ -343,9 +343,18 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
font->insertSeparator();
+
nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 );
connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) );
nStart->setToggleAction(TRUE);
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()) );
@@ -624,5 +633,5 @@ void TextEdit::openFile( const QString &f )
QString filer;
// bFromDocView = TRUE;
- if(f.find(".desktop",0,TRUE) != -1) {
+ if(f.find(".desktop",0,TRUE) != -1 && useAdvancedFeatures) {
switch ( QMessageBox::warning(this,tr("Text Editor"),
tr("Text Editor has detected\n you selected a .desktop file.\nOpen .desktop file or linked file?"),
@@ -824,5 +833,5 @@ bool TextEdit::saveAs()
}
-// if( fileSaveDlg->filePermCheck->isChecked() ) {
+ if( useAdvancedFfeatures ) {
filePermissions *filePerm;
filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm);
@@ -831,5 +840,5 @@ bool TextEdit::saveAs()
if( filePerm)
delete filePerm;
-// }
+ }
}
}
@@ -967,2 +976,9 @@ void TextEdit::doAbout() {
"and is licensed under the GPL");
}
+
+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
@@ -58,5 +58,5 @@ public:
QPopupMenu *font;
- QAction *nStart, *nFileDlgOpt;
+ QAction *nStart, *nFileDlgOpt, *nAdvanced;
bool edited, edited1;
void openFile( const QString & );
@@ -66,8 +66,9 @@ public slots:
void receive(const QCString&, const QByteArray&);
protected:
- bool fileIs;
+ bool fileIs, useAdvancedFeatures;
void closeEvent( QCloseEvent *e );
void doSearchBar();
private slots:
+ void doAdvanced(bool);
void doAbout();
void setDocument(const QString&);