summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -16,49 +16,51 @@
** 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 "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>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/qcopenvelope_qws.h>
//#include <qpe/finddialog.h>
+
#include <opie/ofileselector.h>
+#include <opie/ofiledialog.h>
#include <qstringlist.h>
#include <qaction.h>
#include <qcolordialog.h>
#include <qfileinfo.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qobjectlist.h>
#include <qpopupmenu.h>
#include <qspinbox.h>
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qcheckbox.h>
#include <qcombo.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h> //getenv
/* XPM */
static char * filesave_xpm[] = {
"16 16 78 1",
" c None",
". c #343434",
"+ c #A0A0A0",
@@ -478,71 +480,73 @@ void TextEdit::setBold(bool y)
void TextEdit::setItalic(bool y)
{
QFont f = editor->font();
f.setItalic(y);
editor->setFont(f);
}
void TextEdit::setWordWrap(bool y)
{
bool state = editor->edited();
editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap );
editor->setEdited( state );
}
void TextEdit::fileNew()
{
// if( !bFromDocView ) {
// saveAs();
// }
newFile(DocLnk());
}
void TextEdit::fileOpen()
{
- OFileSelector *fileSelector;
- fileSelector = new OFileSelector( this, 1,1,"/","", "text/*");
- fileSelector->showMaximized();
-
+ // OFileSelector *fileSelector;
+ // fileSelector = new OFileSelector( this, 1,1,"/","", "text/*");
+ //fileSelector->showMaximized();
+ QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this );
+ if(!str.isEmpty() )
+ openFile( str );
// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); //
// 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(fileName );
+// openFile(str );
// }
// }
// 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()
{