summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kfiledialog.cpp3
-rw-r--r--microkde/kio/kfile/kurlrequester.cpp2
2 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
@@ -5,48 +5,51 @@
#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();
+ 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();
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp
index 6d39308..991c8be 100644
--- a/microkde/kio/kfile/kurlrequester.cpp
+++ b/microkde/kio/kfile/kurlrequester.cpp
@@ -251,49 +251,49 @@ void KURLRequester::setURL( const QString& url )
else
d->setText( url );
}
void KURLRequester::setCaption( const QString& caption )
{
//US fileDialog()->setCaption( caption );
//US QWidget::setCaption( caption );
}
QString KURLRequester::url() const
{
return d->url();
}
void KURLRequester::slotOpenDialog()
{
emit openFileDialog( this );
//US use our special KFIleDialog instead
KURL u( url() );
//QString fn = u.url();
QString fn = d->edit->text();
- fn = KFileDialog::getSaveFileName( fn, "Save backup filename", this );
+ fn = KFileDialog::getSaveFileName( fn, "", this );
if ( fn == "" )
return;
setURL( fn );
emit urlSelected( d->url() );
/*US
KFileDialog *dlg = fileDialog();
if ( !d->url().isEmpty() ) {
KURL u( url() );
// If we won't be able to list it (e.g. http), then don't try :)
if ( KProtocolInfo::supportsListing( u.protocol() ) )
dlg->setSelection( u.url() );
}
if ( dlg->exec() == QDialog::Accepted )
{
setURL( dlg->selectedURL().prettyURL() );
emit urlSelected( d->url() );
}
*/
}