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 TQPopupMenu;
00027 class TQVBoxLayout;
00028 class TDEConfig;
00029 class KFileTreeBranch;
00030 class KFileTreeView;
00031 class KFileTreeViewItem;
00032 class TDEToggleAction;
00033
00039 class TDEIO_EXPORT KDirSelectDialog : public KDialogBase
00040 {
00041 Q_OBJECT
00042
00043 public:
00053 KDirSelectDialog(const TQString& startDir = TQString::null,
00054 bool localOnly = false,
00055 TQWidget *parent = 0L,
00056 const char *name = 0, bool modal = false);
00057
00060 ~KDirSelectDialog();
00061
00066 KURL url() const;
00067
00068 KFileTreeView * view() const { return m_treeView; }
00069
00070 bool localOnly() const { return m_localOnly; }
00071
00082 static KURL selectDirectory( const TQString& startDir = TQString::null,
00083 bool localOnly = false, TQWidget *parent = 0L,
00084 const TQString& caption = TQString::null);
00085
00089 TQString startDir() const { return m_startDir; }
00090
00091 public slots:
00092 void setCurrentURL( const KURL& url );
00093
00094 protected slots:
00095 virtual void slotUser1();
00096
00097 protected:
00098 virtual void accept();
00099
00100
00101 TQVBoxLayout *m_mainLayout;
00102 TQString m_startDir;
00103
00104 private slots:
00105 void slotCurrentChanged();
00106 void slotURLActivated( const TQString& );
00107 void slotNextDirToList( KFileTreeViewItem *dirItem );
00108 void slotComboTextChanged( const TQString& text );
00109 void slotContextMenu( TDEListView *, TQListViewItem *, const TQPoint & );
00110 void slotShowHiddenFoldersToggled();
00111 void slotMkdir();
00112
00113 private:
00114 void readConfig( TDEConfig *config, const TQString& group );
00115 void saveConfig( TDEConfig *config, const TQString& group );
00116 void openNextDir( KFileTreeViewItem *parent );
00117 KFileTreeBranch * createBranch( const KURL& url );
00118
00119 KFileTreeView *m_treeView;
00120 TQPopupMenu *m_contextMenu;
00121 TDEToggleAction *m_showHiddenFolders;
00122 bool m_localOnly;
00123
00124 protected:
00125 virtual void virtual_hook( int id, void* data );
00126 private:
00127 class KDirSelectDialogPrivate;
00128 KDirSelectDialogPrivate *d;
00129 };
00130
00131 #endif