summaryrefslogtreecommitdiffabout
path: root/microkde/kfiledialog.cpp
Unidiff
Diffstat (limited to 'microkde/kfiledialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kfiledialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp
index 977499e..309f8dc 100644
--- a/microkde/kfiledialog.cpp
+++ b/microkde/kfiledialog.cpp
@@ -1,74 +1,76 @@
1#include <kfiledialog.h> 1#include <kfiledialog.h>
2#include <qdialog.h> 2#include <qdialog.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qdir.h> 4#include <qdir.h>
5#include <qfileinfo.h> 5#include <qfileinfo.h>
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8#ifndef DESKTOP_VERSION 8#ifndef DESKTOP_VERSION
9//US orig#include <ofileselector.h> 9//US orig#include <ofileselector.h>
10#include <ofileselector_p.h> 10#include <ofileselector_p.h>
11QString KFileDialog::getSaveFileName( const QString & fn, 11QString KFileDialog::getSaveFileName( const QString & fn,
12 const QString & cap , QWidget * par ) 12 const QString & cap , QWidget * par )
13{ 13{
14 QString retfile = ""; 14 QString retfile = "";
15 QDialog dia ( par, "input-dialog", true ); 15 QDialog dia ( par, "input-dialog", true );
16 QVBoxLayout lay( &dia ); 16 QVBoxLayout lay( &dia );
17 lay.setMargin(7); 17 lay.setMargin(7);
18 lay.setSpacing(7); 18 lay.setSpacing(7);
19 dia.setCaption( cap ); 19 dia.setCaption( cap );
20 QString file = fn; 20 QString file = fn;
21 if ( file.isEmpty() ) 21 if ( file.isEmpty() )
22 file = QDir::homeDirPath()+"/*"; 22 file = QDir::homeDirPath()+"/*";
23 QFileInfo fi ( file ); 23 QFileInfo fi ( file );
24 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); 24 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() );
25 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
25 lay.addWidget( &o); 26 lay.addWidget( &o);
26 // o.setNewVisible( true ); 27 // o.setNewVisible( true );
27 // o.setNameVisible( true ); 28 // o.setNameVisible( true );
28 dia.showMaximized(); 29 dia.showMaximized();
29 int res = dia.exec(); 30 int res = dia.exec();
30 if ( res ) 31 if ( res )
31 retfile = o.selectedName(); 32 retfile = o.selectedName();
32 return retfile; 33 return retfile;
33} 34}
34 35
35QString KFileDialog::getOpenFileName( const QString & fn, 36QString KFileDialog::getOpenFileName( const QString & fn,
36 const QString & cap, QWidget * par ) 37 const QString & cap, QWidget * par )
37{ 38{
38 QString retfile = ""; 39 QString retfile = "";
39 QDialog dia ( par, "input-dialog", true ); 40 QDialog dia ( par, "input-dialog", true );
40 // QLineEdit lab ( &dia ); 41 // QLineEdit lab ( &dia );
41 QVBoxLayout lay( &dia ); 42 QVBoxLayout lay( &dia );
42 lay.setMargin(7); 43 lay.setMargin(7);
43 lay.setSpacing(7); 44 lay.setSpacing(7);
44 dia.setCaption( cap ); 45 dia.setCaption( cap );
45 QString file = fn; 46 QString file = fn;
46 if ( file.isEmpty() ) 47 if ( file.isEmpty() )
47 file = QDir::homeDirPath()+"/*";; 48 file = QDir::homeDirPath()+"/*";;
48 QFileInfo fi ( file ); 49 QFileInfo fi ( file );
49 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); 50 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() );
51 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
50 lay.addWidget( &o); 52 lay.addWidget( &o);
51 dia.showMaximized(); 53 dia.showMaximized();
52 int res = dia.exec(); 54 int res = dia.exec();
53 if ( res ) 55 if ( res )
54 retfile = o.selectedName(); 56 retfile = o.selectedName();
55 return retfile; 57 return retfile;
56} 58}
57 59
58#else 60#else
59 61
60#include <qfiledialog.h> 62#include <qfiledialog.h>
61 63
62QString KFileDialog::getSaveFileName( const QString & fn, 64QString KFileDialog::getSaveFileName( const QString & fn,
63 const QString & cap , QWidget * par ) 65 const QString & cap , QWidget * par )
64{ 66{
65 return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); 67 return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap );
66} 68}
67QString KFileDialog::getOpenFileName( const QString & fn, 69QString KFileDialog::getOpenFileName( const QString & fn,
68 const QString & cap, QWidget * par ) 70 const QString & cap, QWidget * par )
69{ 71{
70 72
71 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); 73 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap );
72} 74}
73#endif 75#endif
74 76