kdirselectdialog.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KDIRSELECTDIALOG_H
00021 #define KDIRSELECTDIALOG_H
00022
00023 #include <kdialogbase.h>
00024 #include <kurl.h>
00025
00026 class QVBoxLayout;
00027 class KConfig;
00028 class KFileTreeBranch;
00029 class KFileTreeView;
00030 class KFileTreeViewItem;
00031
00037 class KDirSelectDialog : public KDialogBase
00038 {
00039 Q_OBJECT
00040
00041 public:
00050 KDirSelectDialog(const QString& startDir = QString::null,
00051 bool localOnly = false,
00052 QWidget *parent = 0L,
00053 const char *name = 0, bool modal = false);
00054
00057 ~KDirSelectDialog();
00058
00063 KURL url() const;
00064
00065 KFileTreeView * view() const { return m_treeView; }
00066
00067 bool localOnly() const { return m_localOnly; }
00068
00077 static KURL selectDirectory( const QString& startDir = QString::null,
00078 bool localOnly = false, QWidget *parent = 0L,
00079 const QString& caption = QString::null);
00080
00084 QString startDir() const { return m_startDir; }
00085
00086 public slots:
00087 void setCurrentURL( const KURL& url );
00088
00089 protected:
00090 virtual void accept();
00091
00092
00093 QVBoxLayout *m_mainLayout;
00094 QString m_startDir;
00095
00096 private slots:
00097 void slotCurrentChanged();
00098 void slotURLActivated( const QString& );
00099 void slotNextDirToList( KFileTreeViewItem *dirItem );
00100 void slotComboTextChanged( const QString& text );
00101
00102 private:
00103 void readConfig( KConfig *config, const QString& group );
00104 void saveConfig( KConfig *config, const QString& group );
00105 void openNextDir( KFileTreeViewItem *parent );
00106 KFileTreeBranch * createBranch( const KURL& url );
00107
00108 KFileTreeView *m_treeView;
00109 bool m_localOnly;
00110
00111 protected:
00112 virtual void virtual_hook( int id, void* data );
00113 private:
00114 class KDirSelectDialogPrivate;
00115 KDirSelectDialogPrivate *d;
00116 };
00117
00118 #endif
This file is part of the documentation for kdelibs Version 3.1.5.