summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-01 23:50:15 (UTC)
committer llornkcor <llornkcor>2002-04-01 23:50:15 (UTC)
commitdd9e49cca8cd9a32a52edfc6b6a0683579612a75 (patch) (side-by-side diff)
treeca4bdb7f60150ae147be009a2967721489a81d54
parentcf0ee2d22d3f31ba992df6735968d15b3653820b (diff)
downloadopie-dd9e49cca8cd9a32a52edfc6b6a0683579612a75.zip
opie-dd9e49cca8cd9a32a52edfc6b6a0683579612a75.tar.gz
opie-dd9e49cca8cd9a32a52edfc6b6a0683579612a75.tar.bz2
input dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp43
-rw-r--r--core/apps/textedit/fileBrowser.h2
-rw-r--r--noncore/net/opieftp/inputDialog.cpp4
-rw-r--r--noncore/net/opieftp/inputDialog.h2
-rw-r--r--noncore/net/opieftp/opieftp.cpp4
5 files changed, 35 insertions, 20 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index 8ea8067..652f830 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -10,9 +10,9 @@
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
-#define QTOPIA_INTERNAL_MIMEEXT
+//#define QTOPIA_INTERNAL_MIMEEXT
#include "fileBrowser.h"
//#include "inputDialog.h"
#include <qpe/config.h>
@@ -49,14 +49,21 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
{
if ( !name )
setName( "fileBrowser" );
setCaption(tr( name ) );
- mimeType = mimeFilter;
- MimeType mt( mimeType);
- if( mt.extension().isEmpty())
- filterStr = "*";
- else
- filterStr = "*."+ mt.extension();
+// mimeType = mimeFilter;
+// MimeType mt( mimeType);
+// if( mt.extension().isEmpty())
+ QStringList filterList;
+ filterList=QStringList::split(";",mimeFilter,FALSE);
+ for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) {
+ printf( "%s \n", (*it).latin1() );
+ }
+
+ filterStr = mimeFilter.right(mimeFilter.length()- mimeFilter.find("/",0,TRUE) - 1);// "*";
+ qDebug(filterStr);
+// else
+// filterStr = "*."+ mt.extension();
// qDebug("description "+mt.description());
// qDebug( "id "+mt.id());
// qDebug("extension "+mt.extension());
@@ -67,9 +74,9 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 4 );
layout->setMargin( 4 );
- dirPathCombo = new QComboBox( FALSE, this, "dorPathCombo" );
+ dirPathCombo = new QComboBox( FALSE, this, "dirPathCombo" );
dirPathCombo->setEditable(TRUE);
connect( dirPathCombo, SIGNAL( activated( const QString & ) ),
this, SLOT( dirPathComboActivated( const QString & ) ) );
@@ -129,9 +136,10 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy
// connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) );
// connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) );
- connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) );
+ connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ),
+ this, SLOT( docOpen( const DocLnk & ) ) );
layout->addMultiCellWidget( FileStack, 1, 1, 0, 7 );
SelectionCombo = new QComboBox( FALSE, this, "SelectionCombo" );
SelectionCombo->insertItem( tr( "Documents" ) );
@@ -215,9 +223,9 @@ void fileBrowser::populateList()
if( !fi->isReadable() )
pm = Resource::loadPixmap( "locked" );
else {
MimeType mt(fi->filePath());
- pm=mt.pixmap();
+ pm=mt.pixmap();// sets the pixmap for the mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
}
@@ -416,9 +424,9 @@ void fileBrowser::makDir() {
void fileBrowser::localRename() {
QString curFile = ListView->currentItem()->text(0);
InputDialog *fileDlg;
fileDlg = new InputDialog(this,"Rename",TRUE, 0);
- fileDlg->inputText = curFile;
+ fileDlg->setTextEdit((const QString &) curFile);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QString oldname = currentDir.canonicalPath() + "/" + curFile;
QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist";
@@ -491,16 +499,16 @@ void fileBrowser::showType(const QString &t) {
QString ext;
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
mimeType =(*it);
MimeType mt( mimeType);
- qDebug("mime "+mimeType);
+// qDebug("mime "+mimeType);
// qDebug("description "+mt.description());
// qDebug( "id "+mt.id());
- qDebug("extension "+mt.extension());
- if( mt.extension().isEmpty())
+// qDebug("extension "+mt.extension());
+// if( mt.extension().isEmpty())
filterStr = "*";
- else
- filterStr = "*."+ mt.extension()+" ";
+// else
+// filterStr = "*."+ mt.extension()+" ";
// printf( "%s \n", (*it).latin1() );
}
}
currentDir.setNameFilter(filterStr);
@@ -610,4 +618,7 @@ InputDialog::~InputDialog()
inputText= LineEdit1->text();
}
+void InputDialog::setTextEdit(const QString &string) {
+ LineEdit1->setText(string);
+}
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h
index e76c7df..3db6a27 100644
--- a/core/apps/textedit/fileBrowser.h
+++ b/core/apps/textedit/fileBrowser.h
@@ -112,8 +112,8 @@ public:
InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~InputDialog();
QString inputText;
QLineEdit* LineEdit1;
-
+ void setTextEdit(const QString &);
};
#endif // FILEBROWSER_H
diff --git a/noncore/net/opieftp/inputDialog.cpp b/noncore/net/opieftp/inputDialog.cpp
index 89b345e..373db3b 100644
--- a/noncore/net/opieftp/inputDialog.cpp
+++ b/noncore/net/opieftp/inputDialog.cpp
@@ -37,4 +37,8 @@ InputDialog::~InputDialog()
inputText= LineEdit1->text();
}
+void InputDialog::setTextEdit(const QString &string)
+{
+ LineEdit1->setText(string);
+}
diff --git a/noncore/net/opieftp/inputDialog.h b/noncore/net/opieftp/inputDialog.h
index 2cd8285..dfe0e8a 100644
--- a/noncore/net/opieftp/inputDialog.h
+++ b/noncore/net/opieftp/inputDialog.h
@@ -27,8 +27,8 @@ public:
InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~InputDialog();
QString inputText;
QLineEdit* LineEdit1;
-
+ void setTextEdit(const QString &);
};
#endif // INPUTDIALOG_H
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index e64fd73..b451925 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -942,9 +942,9 @@ void OpieFtp::remoteRename()
{
QString curFile = Remote_View->currentItem()->text(0);
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
- fileDlg->inputText = curFile;
+ fileDlg->setTextEdit((const QString &)curFile);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QString oldName = currentRemoteDir +"/"+ curFile;
QString newName = currentRemoteDir +"/"+ fileDlg->LineEdit1->text();//+".playlist";
@@ -964,9 +964,9 @@ void OpieFtp::localRename()
{
QString curFile = Local_View->currentItem()->text(0);
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
- fileDlg->inputText = curFile;
+ fileDlg->setTextEdit((const QString &)curFile);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QString oldname = currentDir.canonicalPath() + "/" + curFile;
QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist";