author | zautrix <zautrix> | 2005-04-27 23:23:17 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-27 23:23:17 (UTC) |
commit | 1540fc9be514330c76c999562fcf3e6bc1e2ffbb (patch) (side-by-side diff) | |
tree | ade066f57be45f0d9783c0efa4e869fee337dd51 /microkde/kfiledialog.cpp | |
parent | 3978688cbe832e2b72c8048b96c9a7c43ce11bc9 (diff) | |
download | kdepimpi-1540fc9be514330c76c999562fcf3e6bc1e2ffbb.zip kdepimpi-1540fc9be514330c76c999562fcf3e6bc1e2ffbb.tar.gz kdepimpi-1540fc9be514330c76c999562fcf3e6bc1e2ffbb.tar.bz2 |
csv fixes
-rw-r--r-- | microkde/kfiledialog.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 3f47425..6be1580 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -1,76 +1,79 @@ #include <kfiledialog.h> #include <qdialog.h> #include <qlayout.h> #include <qdir.h> #include <qfileinfo.h> #include <qapplication.h> #ifndef DESKTOP_VERSION //US orig#include <ofileselector.h> #include <ofileselector_p.h> QString KFileDialog::getSaveFileName( const QString & fn, const QString & cap , QWidget * par ) { QString retfile = ""; QDialog dia ( par, "input-dialog", true ); QVBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); QString file = fn; if ( file.isEmpty() ) file = QDir::homeDirPath()+"/*"; QFileInfo fi ( file ); OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); // o.setNewVisible( true ); // o.setNameVisible( true ); dia.showMaximized(); - dia.setCaption( cap ); + if ( cap.isEmpty() ) + dia.setCaption( file ); + else + dia.setCaption( cap ); int res = dia.exec(); if ( res ) retfile = o.selectedName(); return retfile; } QString KFileDialog::getOpenFileName( const QString & fn, const QString & cap, QWidget * par ) { QString retfile = ""; QDialog dia ( par, "input-dialog", true ); // QLineEdit lab ( &dia ); QVBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); QString file = fn; if ( file.isEmpty() ) file = QDir::homeDirPath()+"/*";; QFileInfo fi ( file ); OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); dia.showMaximized(); dia.setCaption( cap ); int res = dia.exec(); if ( res ) retfile = o.selectedName(); return retfile; } #else #include <qfiledialog.h> QString KFileDialog::getSaveFileName( const QString & fn, const QString & cap , QWidget * par ) { return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); } QString KFileDialog::getOpenFileName( const QString & fn, const QString & cap, QWidget * par ) { return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); } #endif |