summaryrefslogtreecommitdiff
path: root/core
authorllornkcor <llornkcor>2002-07-20 03:00:42 (UTC)
committer llornkcor <llornkcor>2002-07-20 03:00:42 (UTC)
commitc42e3e2485c545beedd482115927bff7d1bf65a2 (patch) (unidiff)
tree9b82c86631917d5ae66d9307c6b5e44237c1ecc9 /core
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 (limited to 'core') (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 )
343 343
344 font->insertSeparator(); 344 font->insertSeparator();
345
345 nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); 346 nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 );
346 connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) ); 347 connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) );
347 nStart->setToggleAction(TRUE); 348 nStart->setToggleAction(TRUE);
348 nStart->addTo( font ); 349 nStart->addTo( font );
350
351 nAdvanced = new QAction( tr("Advanced features"), QString::null, 0, this, 0 );
352 connect( nAdvanced, SIGNAL( toggled(bool) ), this, SLOT( doAdvanced(bool) ) );
353 nAdvanced->setToggleAction(TRUE);
354 nAdvanced->addTo( font );
355 if(cfg.readBoolEntry("AdvancedFeatures"))
356 nAdvanced->setOn(TRUE);
349 font->insertSeparator(); 357 font->insertSeparator();
358
350 font->insertItem(tr("About"), this, SLOT( doAbout()) ); 359 font->insertItem(tr("About"), this, SLOT( doAbout()) );
351 360
@@ -624,5 +633,5 @@ void TextEdit::openFile( const QString &f )
624 QString filer; 633 QString filer;
625// bFromDocView = TRUE; 634// bFromDocView = TRUE;
626 if(f.find(".desktop",0,TRUE) != -1) { 635 if(f.find(".desktop",0,TRUE) != -1 && useAdvancedFeatures) {
627 switch ( QMessageBox::warning(this,tr("Text Editor"), 636 switch ( QMessageBox::warning(this,tr("Text Editor"),
628 tr("Text Editor has detected\n you selected a .desktop file.\nOpen .desktop file or linked file?"), 637 tr("Text Editor has detected\n you selected a .desktop file.\nOpen .desktop file or linked file?"),
@@ -824,5 +833,5 @@ bool TextEdit::saveAs()
824 } 833 }
825 834
826// if( fileSaveDlg->filePermCheck->isChecked() ) { 835 if( useAdvancedFfeatures ) {
827 filePermissions *filePerm; 836 filePermissions *filePerm;
828 filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm); 837 filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm);
@@ -831,5 +840,5 @@ bool TextEdit::saveAs()
831 if( filePerm) 840 if( filePerm)
832 delete filePerm; 841 delete filePerm;
833// } 842 }
834 } 843 }
835 } 844 }
@@ -967,2 +976,9 @@ void TextEdit::doAbout() {
967 "and is licensed under the GPL"); 976 "and is licensed under the GPL");
968} 977}
978
979void TextEdit::doAdvanced(bool b) {
980 useAdvancedFeatures=b;
981 Config cfg("TextEdit");
982 cfg.setGroup("View");
983 cfg.writeEntry("AdvancedFeatures",b);
984}
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:
58 58
59 QPopupMenu *font; 59 QPopupMenu *font;
60 QAction *nStart, *nFileDlgOpt; 60 QAction *nStart, *nFileDlgOpt, *nAdvanced;
61 bool edited, edited1; 61 bool edited, edited1;
62 void openFile( const QString & ); 62 void openFile( const QString & );
@@ -66,8 +66,9 @@ public slots:
66void receive(const QCString&, const QByteArray&); 66void receive(const QCString&, const QByteArray&);
67protected: 67protected:
68 bool fileIs; 68 bool fileIs, useAdvancedFeatures;
69 void closeEvent( QCloseEvent *e ); 69 void closeEvent( QCloseEvent *e );
70 void doSearchBar(); 70 void doSearchBar();
71private slots: 71private slots:
72 void doAdvanced(bool);
72 void doAbout(); 73 void doAbout();
73 void setDocument(const QString&); 74 void setDocument(const QString&);