00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_GUI_FILE_BROWSER_HH
00020 #define OST_GUI_FILE_BROWSER_HH
00021
00022 #include <QDirModel>
00023 #include <QListView>
00024 #include <QComboBox>
00025
00026 #include <ost/gfx/gfx_object.hh>
00027 #include <ost/gui/module_config.hh>
00028 #include <ost/gui/widget.hh>
00029
00030 namespace ost { namespace gui {
00031
00032
00033
00034
00036 class FileBrowser : public Widget {
00037 Q_OBJECT
00038 public:
00039 FileBrowser(QWidget* parent=NULL);
00040 FileBrowser(const QString& path, QWidget* parent=NULL);
00041
00042 virtual ActionList GetActions();
00043 virtual bool Save(const QString& prefix);
00044 virtual bool Restore(const QString& prefix);
00045
00046 protected:
00047 virtual void keyPressEvent(QKeyEvent* event);
00048
00049 private slots:
00050 void Init(const QString& path);
00051 void DoubleClicked(const QModelIndex& index);
00052 void ChangeToParentDirectory(int index);
00053 void Split();
00054 void ShowContextMenu(const QPoint& pos);
00055 void LoadCurrentObject();
00056 void LoadWithSystemEditor();
00057 void LoadWithSourceViewer();
00058 private:
00059 void LoadObject(const QModelIndex& index);
00060 void UpdateMenu(const QString& path);
00061 void AddItem(const QDir& directory, const QString& mypath="");
00062 QComboBox* menu_;
00063 QDirModel* model_;
00064 QListView* view_;
00065 ActionList action_list_;
00066 };
00067
00068 }}
00069
00070 #endif