author | llornkcor <llornkcor> | 2002-05-28 15:30:43 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-28 15:30:43 (UTC) |
commit | f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5 (patch) (side-by-side diff) | |
tree | 62fbedb348fdcc02264f343c3a6f9a15b0202f7b | |
parent | 267db9835cb67a9fb65cf5cda592012d06caa57d (diff) | |
download | opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.zip opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.tar.gz opie-f1f06e4cf8ec641852d1d464d8fa8c95b9d2fcb5.tar.bz2 |
convert to ofileselector, and fixed bug
-rw-r--r-- | core/apps/textedit/textedit.cpp | 77 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 4 | ||||
-rw-r--r-- | core/apps/textedit/textedit.pro | 4 |
3 files changed, 43 insertions, 42 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index b8d62db..403bd92 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -11,25 +11,25 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ // changes added by L. J. Potter Sun 02-17-2002 21:31:31 #include "textedit.h" -#include "fileBrowser.h" +//#include "fileBrowser.h" #include "fileSaver.h" #include "filePermissions.h" #include "fontDialog.h" #include <qpe/fontdatabase.h> #include <qpe/global.h> #include <qpe/fileselector.h> #include <qpe/applnk.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qpe/qpeapplication.h> @@ -498,63 +498,64 @@ void TextEdit::fileNew() { // if( !bFromDocView ) { // saveAs(); // } newFile(DocLnk()); } void TextEdit::fileOpen() { Config cfg("TextEdit"); cfg.setGroup("View"); bool b=FALSE; - if(cfg.readEntry("useOldFileDialog") == "TRUE") - b=TRUE; - if(!b) { - QString str = OFileDialog::getOpenFileName( 1,"/","", "*", this ); +// if(cfg.readEntry("useOldFileDialog") == "TRUE") +// b=TRUE; +// if(!b) { + QString str = OFileDialog::getOpenFileName( 1,"/")://,"", "*", this ); if(!str.isEmpty() ) openFile( str ); - } else { - QString str; - browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // - browseForFiles->setFileView( viewSelection ); - browseForFiles->showMaximized(); -// if( result != -1 ) - - if( browseForFiles->exec() != -1 ) { - QString selFile = browseForFiles->selectedFileName; - QStringList fileList = browseForFiles->fileList; - qDebug(selFile); - QStringList::ConstIterator f; - QString fileTemp; - for ( f = fileList.begin(); f != fileList.end(); f++ ) { - fileTemp = *f; - fileTemp.right( fileTemp.length()-5); - QString fileName = fileTemp; - if( fileName != "Unnamed" || fileName != "Empty Text" ) { - currentFileName = fileName; - qDebug("please open "+currentFileName); - openFile(currentFileName ); - } - } - viewSelection = browseForFiles->SelectionCombo->currentItem(); - } - delete browseForFiles; - editor->setEdited( FALSE); - edited1=FALSE; - edited=FALSE; - if(caption().left(1)=="*") - setCaption(caption().right(caption().length()-1)); - doSearchBar(); - } +// } else { +// QString str; +// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // +// browseForFiles->setFileView( viewSelection ); +// browseForFiles->showMaximized(); +// // if( result != -1 ) + +// if( browseForFiles->exec() != -1 ) { +// QString selFile = browseForFiles->selectedFileName; +// QStringList fileList = browseForFiles->fileList; +// qDebug(selFile); +// QStringList::ConstIterator f; +// QString fileTemp; +// for ( f = fileList.begin(); f != fileList.end(); f++ ) { +// fileTemp = *f; +// fileTemp.right( fileTemp.length()-5); +// QString fileName = fileTemp; +// if( fileName != "Unnamed" || fileName != "Empty Text" ) { +// currentFileName = fileName; +// qDebug("please open "+currentFileName); +// openFile(currentFileName ); +// } +// } +// viewSelection = browseForFiles->SelectionCombo->currentItem(); +// } +// delete browseForFiles; +// editor->setEdited( FALSE); +// edited1=FALSE; +// edited=FALSE; +// if(caption().left(1)=="*") +// setCaption(caption().right(caption().length()-1)); +// doSearchBar(); +// } + } void TextEdit::doSearchBar() { Config cfg("TextEdit"); cfg.setGroup("View"); if(cfg.readEntry("SearchBar","Closed") != "Opened") searchBar->hide(); } #if 0 void TextEdit::slotFind() diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h index 9d27ab0..d8208b1 100644 --- a/core/apps/textedit/textedit.h +++ b/core/apps/textedit/textedit.h @@ -15,25 +15,25 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ // additions made by L.J. Potter Sun 02-17-2002 22:27:46 #ifndef TEXTEDIT_H #define TEXTEDIT_H #define QTEXTEDIT_OPEN_API -#include "fileBrowser.h" +//#include "fileBrowser.h" #include "fileSaver.h" #include <qpe/filemanager.h> #include <qpe/qcopenvelope_qws.h> #include <opie/ofileselector.h> #include <qmainwindow.h> #include <qmultilineedit.h> #include <qlist.h> #include <qmap.h> @@ -102,25 +102,25 @@ private slots: void setBold(bool y); void setItalic(bool y); void setWordWrap(bool y); private: void colorChanged( const QColor &c ); void clear(); void updateCaption( const QString &name=QString::null ); void setFontSize(int sz, bool round_down_not_up); private: fileSaver *fileSaveDlg; - fileBrowser *browseForFiles; +// fileBrowser *browseForFiles; QpeEditor* editor; QToolBar *menu, *editBar, *searchBar; QLineEdit *searchEdit; DocLnk *doc; bool searchVisible; bool bFromDocView; int viewSelection; QAction *zin, *zout; QString currentFileName; }; #endif diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro index 4f20da3..d01a9f4 100644 --- a/core/apps/textedit/textedit.pro +++ b/core/apps/textedit/textedit.pro @@ -1,18 +1,18 @@ TEMPLATE = app CONFIG += qt warn_on release DESTDIR = $(OPIEDIR)/bin -HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h -SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp +HEADERS = textedit.h fontDialog.h fileSaver.h filePermissions.h +SOURCES = main.cpp textedit.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie TARGET = textedit TRANSLATIONS += ../i18n/de/textedit.ts TRANSLATIONS += ../i18n/pt_BR/textedit.ts TRANSLATIONS += ../i18n/en/textedit.ts TRANSLATIONS += ../i18n/hu/textedit.ts TRANSLATIONS += ../i18n/fr/textedit.ts |