summaryrefslogtreecommitdiffstats
path: root/kommander/editor/filechooser.h
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/filechooser.h')
-rw-r--r--kommander/editor/filechooser.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/kommander/editor/filechooser.h b/kommander/editor/filechooser.h
new file mode 100644
index 00000000..e6bc98e3
--- /dev/null
+++ b/kommander/editor/filechooser.h
@@ -0,0 +1,42 @@
+#ifndef FILECHOOSER_H
+#define FILECHOOSER_H
+
+#include <qwidget.h>
+
+class QLineEdit;
+class QPushButton;
+
+class FileChooser : public QWidget
+{
+ Q_OBJECT
+
+ Q_ENUMS( Mode )
+ Q_PROPERTY( Mode mode READ mode WRITE setMode )
+ Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
+
+public:
+ FileChooser( QWidget *parent = 0, const char *name = 0);
+
+ enum Mode { File, Directory };
+
+ QString fileName() const;
+ Mode mode() const;
+
+public slots:
+ void setFileName( const QString &fn );
+ void setMode( Mode m );
+
+signals:
+ void fileNameChanged( const QString & );
+
+private slots:
+ void chooseFile();
+
+private:
+ QLineEdit *lineEdit;
+ QPushButton *button;
+ Mode md;
+
+};
+
+#endif