summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp23
-rw-r--r--core/apps/textedit/fileBrowser.h17
-rw-r--r--core/apps/textedit/inputDialog.cpp40
-rw-r--r--core/apps/textedit/inputDialog.h34
-rw-r--r--core/apps/textedit/textedit.pro4
5 files changed, 41 insertions, 77 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index ebb78d1..f3e4e1e 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -1,63 +1,63 @@
/****************************************************************************
** copyright 2001 ljp ljp@llornkcor.com
** Created: Fri Dec 14 08:16:46 2001
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#include "fileBrowser.h"
-#include "inputDialog.h"
+//#include "inputDialog.h"
#include <qpe/config.h>
#include <qpe/resource.h>
#include <qpe/fileselector.h>
#include <qpe/qpeapplication.h>
#include <qpe/menubutton.h>
#include <qpe/mimetype.h>
#include <qdict.h>
#include <qwidgetstack.h>
#include <qlistview.h>
#include <qcombo.h>
#include <qpushbutton.h>
#include <qfile.h>
#include <qmessagebox.h>
#include <qlayout.h>
#include <unistd.h>
#include <qpopupmenu.h>
#include <qlineedit.h>
#include <qstringlist.h>
#include <unistd.h>
#include <stdlib.h>
static int u_id = 1;
static int get_unique_id()
{
return u_id++;
}
fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "fileBrowser" );
setCaption(tr( name ) );
filterStr=filter;
// channel = new QCopChannel( "QPE/fileDialog", this );
// connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
// this, SLOT(receive(const QCString&, const QByteArray&)) );
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 4 );
layout->setMargin( 4 );
dirPathCombo = new QComboBox( FALSE, this, "dorPathCombo" );
dirPathCombo->setEditable(TRUE);
@@ -508,48 +508,69 @@ QStringList fileBrowser::getMimeTypes() {
r << k;
k+="\n";
file.writeBlock( k.latin1(), k.length());
}
}
}
}
r.sort();
file.close();
return r;
}
void fileBrowser::receive( const QCString &msg, const QByteArray &data ) {
// QDataStream stream( data, IO_ReadOnly );
// if (msg == "keyRegister(int key, QString channel, QString message)")
// {
// int k;
// QString c, m;
// stream >> k;
// stream >> c;
// stream >> m;
}
void fileBrowser::dirPathComboActivated( const QString & current) {
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateList();
update();
}
void fileBrowser::dirPathEditPressed() {
QString current = dirPathCombo->lineEdit()->text();
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateList();
update();
}
void fileBrowser::fillCombo(const QString &currentPath) {
dirPathCombo->lineEdit()->setText(currentPath);
if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
dirPathCombo->clear();
dirPathStringList.prepend(currentPath );
dirPathCombo->insertStringList( dirPathStringList,-1);
}
}
+
+
+InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "InputDialog" );
+ resize( 234, 50 );
+ setMaximumSize( QSize( 240, 50 ) );
+ setCaption( tr(name ) );
+
+ LineEdit1 = new QLineEdit( this, "LineEdit1" );
+ LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
+}
+
+InputDialog::~InputDialog()
+{
+ inputText= LineEdit1->text();
+
+}
+
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h
index bac3d2e..42f93b6 100644
--- a/core/apps/textedit/fileBrowser.h
+++ b/core/apps/textedit/fileBrowser.h
@@ -1,101 +1,118 @@
/****************************************************************************
**
** Created: Fri Dec 14 08:16:02 2001
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
copyright Sun 02-17-2002 22:28:23 L. J. Potter ljp@llornkcor.com
****************************************************************************/
#ifndef FILEBROWSER_H
#define FILEBROWSER_H
//#include <qvariant.h>
#include <qdialog.h>
#include <qfile.h>
#include <qdir.h>
#include <qstringlist.h>
#include <qlabel.h>
#include <qstring.h>
#include <qdict.h>
#include <qpe/filemanager.h>
+#include <qvariant.h>
+#include <qdialog.h>
+class QLineEdit;
+
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QListView;
class QListViewItem;
class QPushButton;
class QComboBox;
class QWidgetStack;
class FileSelector;
class QPoint;
class MenuButton;
class QRegExp;
class fileBrowser : public QDialog
{
Q_OBJECT
public:
fileBrowser( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ,const QString filter=0);
~fileBrowser();
QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton, *cdUpButton;
QListView* ListView;
QLabel *dirLabel;
QString selectedFileName, filterStr;
QDir currentDir;
QFile file;
QStringList fileList, dirPathStringList;
QListViewItem * item;
QComboBox *SelectionCombo, *dirPathCombo;
MenuButton *typemb;
QWidgetStack *FileStack;
FileSelector *fileSelector;
QString mimeType;
public slots:
void setFileView( int );
private:
// QDict<void> mimes;
QRegExp tf;
QStringList getMimeTypes();
void fillCombo( const QString&);
private slots:
void populateList();
void homeButtonPushed();
void docButtonPushed();
void ListPressed( int, QListViewItem *, const QPoint&, int);
void showListMenu(QListViewItem*);
void doCd();
void makDir();
void localRename();
void localDelete();
void receive( const QCString &msg, const QByteArray &data );
void dirPathComboActivated( const QString & );
void upDir();
void listClicked( QListViewItem * );
void selectionChanged( const QString & );
void OnOK();
void docOpen( const DocLnk & );
void updateMimeTypeMenu();
void showType(const QString &);
void dirPathEditPressed();
protected slots:
protected:
};
+
+class InputDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~InputDialog();
+ QString inputText;
+ QLineEdit* LineEdit1;
+
+};
+
#endif // FILEBROWSER_H
diff --git a/core/apps/textedit/inputDialog.cpp b/core/apps/textedit/inputDialog.cpp
deleted file mode 100644
index 22205d3..0000000
--- a/core/apps/textedit/inputDialog.cpp
+++ b/dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
- inputDialog.cpp
- -------------------
-** Created: Sat Mar 9 23:33:09 2002
- copyright : (C) 2002 by ljp
- email : ljp@llornkcor.com
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- ***************************************************************************/
-
-#include "inputDialog.h"
-
-#include <qlineedit.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-
-
-InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
- : QDialog( parent, name, modal, fl )
-{
- if ( !name )
- setName( "InputDialog" );
- resize( 234, 50 );
- setMaximumSize( QSize( 240, 50 ) );
- setCaption( tr(name ) );
-
- LineEdit1 = new QLineEdit( this, "LineEdit1" );
- LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
-}
-
-InputDialog::~InputDialog()
-{
- inputText= LineEdit1->text();
-
-}
-
diff --git a/core/apps/textedit/inputDialog.h b/core/apps/textedit/inputDialog.h
deleted file mode 100644
index 2cd8285..0000000
--- a/core/apps/textedit/inputDialog.h
+++ b/dev/null
@@ -1,34 +0,0 @@
-/***************************************************************************
- inputDialog.h
- -------------------
-** Created: Sat Mar 9 23:33:09 2002
- copyright : (C) 2002 by ljp
- email : ljp@llornkcor.com
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- ***************************************************************************/
-#ifndef INPUTDIALOG_H
-#define INPUTDIALOG_H
-
-#include <qvariant.h>
-#include <qdialog.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QLineEdit;
-
-class InputDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~InputDialog();
- QString inputText;
- QLineEdit* LineEdit1;
-
-};
-
-#endif // INPUTDIALOG_H
diff --git a/core/apps/textedit/textedit.pro b/core/apps/textedit/textedit.pro
index 37ddf15..9b743d3 100644
--- a/core/apps/textedit/textedit.pro
+++ b/core/apps/textedit/textedit.pro
@@ -1,15 +1,15 @@
TEMPLATE = app
CONFIG += qt warn_on release
DESTDIR = $(OPIEDIR)/bin
-HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h inputDialog.h
-SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp inputDialog.cpp
+HEADERS = textedit.h fileBrowser.h fontDialog.h fileSaver.h filePermissions.h
+SOURCES = main.cpp textedit.cpp fileBrowser.cpp fontDialog.cpp fileSaver.cpp filePermissions.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
TARGET = textedit
TRANSLATIONS += ../i18n/de/textedit.ts
TRANSLATIONS += ../i18n/pt_BR/textedit.ts