From fa3772aa7ddea5725cc7e7db42d017567e4cc14c Mon Sep 17 00:00:00 2001 From: zcarsten Date: Tue, 22 Jul 2003 19:23:13 +0000 Subject: Initial revision --- (limited to 'noncore/apps/zsafe/scqtfileedit.h') diff --git a/noncore/apps/zsafe/scqtfileedit.h b/noncore/apps/zsafe/scqtfileedit.h new file mode 100644 index 0000000..7b22bb7 --- a/dev/null +++ b/noncore/apps/zsafe/scqtfileedit.h @@ -0,0 +1,106 @@ +/*************************************************************************** + scqtfileedit.h - description + ------------------- + begin : Mon Sep 3 2001 + copyright : (C) 2001 by Werner Schulte + email : sc@schulte-ac.de + ***************************************************************************/ + +/* $Id$ */ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SCQTFILEEDIT_H +#define SCQTFILEEDIT_H + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define MAXDIRCOMBOCOUNT 8 +#define MAXTYPECOMBOCOUNT 8 + +/** + *@author Werner Schulte + */ + +class ScQtFileEditDlg : public ScQtFileDlg, QDir +{ + Q_OBJECT +public: + ScQtFileEditDlg( QWidget *parent=0, const char *name=0, + const QString &path="/", const QString &filter="*" ); + ~ScQtFileEditDlg(); + QString getResult( ); + QString getFileName( ); + void readIt( ); + void setAutoExtension( bool ex=false ); + void allowMkDir( bool mkdir=false ); + void setNFilter( bool ff=false ); + void setFSorting( bool ff=false ); + void setMode( int mode=QDir::All ); + +private slots: + void slotOK( ); + void slotCancel( ); + void slotDoubleClicked( QListViewItem *item=0 ); + void slotSelectionChanged( QListViewItem *item=0 ); + void slotDirComboBoxChanged( int item ); + void slotTypeComboBoxChanged( int item ); + void slotFileTextChanged( const QString &txt="" ); + void slotShowDir(); + void slotMkDir(); + +protected: + QTimer showTimer; + bool mkdirflag, fsorting, fnfilter; + int fmode; + const QFileInfoList *qfil; + bool rFlag, exflag; // recursionFlag,extensionflag + QString bpath, bfilter, filename; + QString dirstr,linkstr, filestr; + QPixmap *fileIcon, *dirIcon, *linkIcon, *cdToParentIcon; + const QFileInfoList *readDir( const QString &path="/", const QString &filter="*" ); + int checkComboEntryExists( QComboBox *com=0, const QString &str="" ); + void insDirCombo( const QString &str="" ); + void insTypeCombo( const QString &str="" ); + void initDirCombo( const QString &str="" ); + void initTypeCombo( const QString &str="" ); + void autoExtension( ); + +}; + +class ScQtFileEdit : public QObject +{ + Q_OBJECT +public: + ScQtFileEdit( QWidget *parent=0, const char *name=0 ); + ~ScQtFileEdit(); + static void resize( int width, int height ); + static QString getOpenFileName( QWidget *parent=0, const char *name=0, + const QString &path="/", const QString &filter="*" ); + static QString getSaveAsFileName( QWidget *parent=0, const char *name=0, + const QString &path="/", const QString &filter="*" ); + static QString getDirName( QWidget *parent=0, const char *name=0, + const QString &path="/" ); + static QString mkDir( QWidget *parent=0, const char *name=0, + const QString &path="/", const QString &filter="*" ); + +protected: + +}; + +#endif -- cgit v0.9.0.2