summaryrefslogtreecommitdiff
authorzecke <zecke>2002-04-12 13:05:42 (UTC)
committer zecke <zecke>2002-04-12 13:05:42 (UTC)
commitc1c9ac64f7f4871642d645ac1da1a2f36853ccb2 (patch) (unidiff)
tree409bf1e97825de681692a8894671eccf745107eb
parent26efd0a7135834626b4e6f275e57e85a97abd34f (diff)
downloadopie-c1c9ac64f7f4871642d645ac1da1a2f36853ccb2.zip
opie-c1c9ac64f7f4871642d645ac1da1a2f36853ccb2.tar.gz
opie-c1c9ac64f7f4871642d645ac1da1a2f36853ccb2.tar.bz2
Port to OFileDialog for open
ljp would you please fix open a bit. I'm not in the mood to do it myself we need to port save to OFileDialog::getSaveFileName()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index a66b967..cc3ccbc 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -24,33 +24,35 @@
24#include "fileSaver.h" 24#include "fileSaver.h"
25#include "filePermissions.h" 25#include "filePermissions.h"
26 26
27#include "fontDialog.h" 27#include "fontDialog.h"
28 28
29#include <qpe/fontdatabase.h> 29#include <qpe/fontdatabase.h>
30#include <qpe/global.h> 30#include <qpe/global.h>
31#include <qpe/fileselector.h> 31#include <qpe/fileselector.h>
32#include <qpe/applnk.h> 32#include <qpe/applnk.h>
33#include <qpe/resource.h> 33#include <qpe/resource.h>
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
36#include <qpe/qpemenubar.h> 36#include <qpe/qpemenubar.h>
37#include <qpe/qpetoolbar.h> 37#include <qpe/qpetoolbar.h>
38#include <qpe/qcopenvelope_qws.h> 38#include <qpe/qcopenvelope_qws.h>
39//#include <qpe/finddialog.h> 39//#include <qpe/finddialog.h>
40
40#include <opie/ofileselector.h> 41#include <opie/ofileselector.h>
42#include <opie/ofiledialog.h>
41 43
42#include <qstringlist.h> 44#include <qstringlist.h>
43#include <qaction.h> 45#include <qaction.h>
44#include <qcolordialog.h> 46#include <qcolordialog.h>
45#include <qfileinfo.h> 47#include <qfileinfo.h>
46#include <qlineedit.h> 48#include <qlineedit.h>
47#include <qmessagebox.h> 49#include <qmessagebox.h>
48#include <qobjectlist.h> 50#include <qobjectlist.h>
49#include <qpopupmenu.h> 51#include <qpopupmenu.h>
50#include <qspinbox.h> 52#include <qspinbox.h>
51#include <qtoolbutton.h> 53#include <qtoolbutton.h>
52#include <qwidgetstack.h> 54#include <qwidgetstack.h>
53#include <qcheckbox.h> 55#include <qcheckbox.h>
54#include <qcombo.h> 56#include <qcombo.h>
55#include <unistd.h> 57#include <unistd.h>
56#include <sys/stat.h> 58#include <sys/stat.h>
@@ -486,55 +488,57 @@ void TextEdit::setWordWrap(bool y)
486{ 488{
487 bool state = editor->edited(); 489 bool state = editor->edited();
488 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); 490 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap );
489 editor->setEdited( state ); 491 editor->setEdited( state );
490} 492}
491 493
492void TextEdit::fileNew() 494void TextEdit::fileNew()
493{ 495{
494// if( !bFromDocView ) { 496// if( !bFromDocView ) {
495// saveAs(); 497// saveAs();
496// } 498// }
497 newFile(DocLnk()); 499 newFile(DocLnk());
498} 500}
499 501
500void TextEdit::fileOpen() 502void TextEdit::fileOpen()
501{ 503{
502 OFileSelector *fileSelector; 504 // OFileSelector *fileSelector;
503 fileSelector = new OFileSelector( this, 1,1,"/","", "text/*"); 505 // fileSelector = new OFileSelector( this, 1,1,"/","", "text/*");
504 fileSelector->showMaximized(); 506 //fileSelector->showMaximized();
505 507 QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this );
508 if(!str.isEmpty() )
509 openFile( str );
506// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // 510// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); //
507// browseForFiles->setFileView( viewSelection ); 511// browseForFiles->setFileView( viewSelection );
508// browseForFiles->showMaximized(); 512// browseForFiles->showMaximized();
509// // if( result != -1 ) 513// // if( result != -1 )
510 514
511// if( browseForFiles->exec() != -1 ) { 515// if( browseForFiles->exec() != -1 ) {
512// QString selFile = browseForFiles->selectedFileName; 516// QString selFile = browseForFiles->selectedFileName;
513// QStringList fileList = browseForFiles->fileList; 517// QStringList fileList = browseForFiles->fileList;
514// qDebug(selFile); 518// qDebug(selFile);
515// QStringList::ConstIterator f; 519// QStringList::ConstIterator f;
516// QString fileTemp; 520// QString fileTemp;
517// for ( f = fileList.begin(); f != fileList.end(); f++ ) { 521// for ( f = fileList.begin(); f != fileList.end(); f++ ) {
518// fileTemp = *f; 522// fileTemp = *f;
519// fileTemp.right( fileTemp.length()-5); 523// fileTemp.right( fileTemp.length()-5);
520// QString fileName = fileTemp; 524// QString fileName = fileTemp;
521// if( fileName != "Unnamed" || fileName != "Empty Text" ) { 525// if( fileName != "Unnamed" || fileName != "Empty Text" ) {
522// currentFileName = fileName; 526// currentFileName = fileName;
523// qDebug("please open "+currentFileName); 527// qDebug("please open "+currentFileName);
524// openFile(fileName ); 528// openFile(str );
525// } 529// }
526// } 530// }
527// viewSelection = browseForFiles->SelectionCombo->currentItem(); 531// viewSelection = browseForFiles->SelectionCombo->currentItem();
528// } 532// }
529// delete browseForFiles; 533// delete browseForFiles;
530// editor->setEdited( FALSE); 534// editor->setEdited( FALSE);
531// edited1=FALSE; 535// edited1=FALSE;
532// edited=FALSE; 536// edited=FALSE;
533// if(caption().left(1)=="*") 537// if(caption().left(1)=="*")
534// setCaption(caption().right(caption().length()-1)); 538// setCaption(caption().right(caption().length()-1));
535// doSearchBar(); 539// doSearchBar();
536} 540}
537 541
538void TextEdit::doSearchBar() 542void TextEdit::doSearchBar()
539{ 543{
540 Config cfg("TextEdit"); 544 Config cfg("TextEdit");