-rw-r--r-- | microkde/kfiledialog.cpp | 4 | ||||
-rw-r--r-- | microkde/ktextedit.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 309f8dc..3f47425 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp | |||
@@ -1,76 +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> |
11 | QString KFileDialog::getSaveFileName( const QString & fn, | 11 | QString 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 ); | ||
20 | QString file = fn; | 19 | QString file = fn; |
21 | if ( file.isEmpty() ) | 20 | if ( file.isEmpty() ) |
22 | file = QDir::homeDirPath()+"/*"; | 21 | file = QDir::homeDirPath()+"/*"; |
23 | QFileInfo fi ( file ); | 22 | QFileInfo fi ( file ); |
24 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); | 23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); |
25 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
26 | lay.addWidget( &o); | 25 | lay.addWidget( &o); |
27 | // o.setNewVisible( true ); | 26 | // o.setNewVisible( true ); |
28 | // o.setNameVisible( true ); | 27 | // o.setNameVisible( true ); |
29 | dia.showMaximized(); | 28 | dia.showMaximized(); |
29 | dia.setCaption( cap ); | ||
30 | int res = dia.exec(); | 30 | int res = dia.exec(); |
31 | if ( res ) | 31 | if ( res ) |
32 | retfile = o.selectedName(); | 32 | retfile = o.selectedName(); |
33 | return retfile; | 33 | return retfile; |
34 | } | 34 | } |
35 | 35 | ||
36 | QString KFileDialog::getOpenFileName( const QString & fn, | 36 | QString KFileDialog::getOpenFileName( const QString & fn, |
37 | const QString & cap, QWidget * par ) | 37 | const QString & cap, QWidget * par ) |
38 | { | 38 | { |
39 | QString retfile = ""; | 39 | QString retfile = ""; |
40 | QDialog dia ( par, "input-dialog", true ); | 40 | QDialog dia ( par, "input-dialog", true ); |
41 | // QLineEdit lab ( &dia ); | 41 | // QLineEdit lab ( &dia ); |
42 | QVBoxLayout lay( &dia ); | 42 | QVBoxLayout lay( &dia ); |
43 | lay.setMargin(7); | 43 | lay.setMargin(7); |
44 | lay.setSpacing(7); | 44 | lay.setSpacing(7); |
45 | dia.setCaption( cap ); | ||
46 | QString file = fn; | 45 | QString file = fn; |
47 | if ( file.isEmpty() ) | 46 | if ( file.isEmpty() ) |
48 | file = QDir::homeDirPath()+"/*";; | 47 | file = QDir::homeDirPath()+"/*";; |
49 | QFileInfo fi ( file ); | 48 | QFileInfo fi ( file ); |
50 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); | 49 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); |
51 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 50 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
52 | lay.addWidget( &o); | 51 | lay.addWidget( &o); |
53 | dia.showMaximized(); | 52 | dia.showMaximized(); |
53 | dia.setCaption( cap ); | ||
54 | int res = dia.exec(); | 54 | int res = dia.exec(); |
55 | if ( res ) | 55 | if ( res ) |
56 | retfile = o.selectedName(); | 56 | retfile = o.selectedName(); |
57 | return retfile; | 57 | return retfile; |
58 | } | 58 | } |
59 | 59 | ||
60 | #else | 60 | #else |
61 | 61 | ||
62 | #include <qfiledialog.h> | 62 | #include <qfiledialog.h> |
63 | 63 | ||
64 | QString KFileDialog::getSaveFileName( const QString & fn, | 64 | QString KFileDialog::getSaveFileName( const QString & fn, |
65 | const QString & cap , QWidget * par ) | 65 | const QString & cap , QWidget * par ) |
66 | { | 66 | { |
67 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); | 67 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); |
68 | } | 68 | } |
69 | QString KFileDialog::getOpenFileName( const QString & fn, | 69 | QString KFileDialog::getOpenFileName( const QString & fn, |
70 | const QString & cap, QWidget * par ) | 70 | const QString & cap, QWidget * par ) |
71 | { | 71 | { |
72 | 72 | ||
73 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); | 73 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); |
74 | } | 74 | } |
75 | #endif | 75 | #endif |
76 | 76 | ||
diff --git a/microkde/ktextedit.h b/microkde/ktextedit.h index c912f3b..87c0602 100644 --- a/microkde/ktextedit.h +++ b/microkde/ktextedit.h | |||
@@ -1,22 +1,23 @@ | |||
1 | #ifndef MICROKDE_KTEXTEDIT_H | 1 | #ifndef MICROKDE_KTEXTEDIT_H |
2 | #define MICROKDE_KTEXTEDIT_H | 2 | #define MICROKDE_KTEXTEDIT_H |
3 | 3 | ||
4 | #include <qmultilineedit.h> | 4 | #include <qmultilineedit.h> |
5 | 5 | ||
6 | class KTextEdit : public QMultiLineEdit | 6 | class KTextEdit : public QMultiLineEdit |
7 | { | 7 | { |
8 | public: | 8 | public: |
9 | KTextEdit( QWidget *parent ) ; | 9 | KTextEdit( QWidget *parent ) ; |
10 | void setIgnoreMark( bool b ) { mIgnoreMark = b; } | ||
10 | 11 | ||
11 | private: | 12 | private: |
12 | bool mAllowPopupMenu; | 13 | bool mAllowPopupMenu; |
13 | bool mMouseDown; | 14 | bool mMouseDown; |
14 | bool mIgnoreMark; | 15 | bool mIgnoreMark; |
15 | int mYMousePos; | 16 | int mYMousePos; |
16 | int mXMousePos; | 17 | int mXMousePos; |
17 | void mousePressEvent(QMouseEvent *e); | 18 | void mousePressEvent(QMouseEvent *e); |
18 | void mouseReleaseEvent(QMouseEvent *e); | 19 | void mouseReleaseEvent(QMouseEvent *e); |
19 | void mouseMoveEvent(QMouseEvent *e); | 20 | void mouseMoveEvent(QMouseEvent *e); |
20 | }; | 21 | }; |
21 | 22 | ||
22 | #endif | 23 | #endif |