13495
|
1 /* Quint - A graphical user interface for Octave |
|
2 * Copyright (C) 2011 John P. Swensen, Jacob Dawid |
|
3 * jacob.dawid@googlemail.com |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation, either version 3 of the License, or |
|
8 * (at your option) any later version. |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 */ |
|
18 |
|
19 #ifndef FILESDOCKWIDGET_H |
|
20 #define FILESDOCKWIDGET_H |
|
21 |
|
22 #include <QListView> |
|
23 #include <QDate> |
|
24 #include <QObject> |
|
25 #include <QWidget> |
|
26 #include <QListWidget> |
|
27 #include <QFileSystemModel> |
|
28 #include <QToolBar> |
|
29 #include <QToolButton> |
|
30 #include <QVBoxLayout> |
|
31 #include <QAction> |
|
32 #include <QTreeView> |
|
33 |
|
34 #include <vector> |
|
35 #include <string> |
|
36 |
|
37 #undef PACKAGE_BUGREPORT |
|
38 #undef PACKAGE_NAME |
|
39 #undef PACKAGE_STRING |
|
40 #undef PACKAGE_TARNAME |
|
41 #undef PACKAGE_VERSION |
|
42 #include "octave/config.h" |
|
43 #include "octave/octave.h" |
|
44 #include "octave/str-vec.h" |
|
45 #include "octave/cmd-hist.h" |
|
46 #include <QDockWidget> |
|
47 #include <QLineEdit> |
|
48 |
|
49 class FilesDockWidget : public QDockWidget { |
|
50 Q_OBJECT |
|
51 public : |
|
52 FilesDockWidget(QWidget *parent = 0); |
|
53 public slots: |
|
54 /** Slot for handling a change in directory via double click. */ |
|
55 void itemDoubleClicked(const QModelIndex &index); |
|
56 |
|
57 /** Slot for handling the up-directory button in the toolbar. */ |
|
58 void onUpDirectory(); |
|
59 |
|
60 void setCurrentDirectory(QString currentDirectory); |
|
61 |
|
62 void currentDirectoryEntered(); |
|
63 |
|
64 signals: |
|
65 void openFile(QString fileName); |
|
66 |
|
67 private: |
|
68 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc |
|
69 |
|
70 /** Toolbar for file and directory manipulation. */ |
|
71 QToolBar *m_navigationToolBar; |
|
72 |
|
73 /** Variables for the up-directory action. */ |
|
74 QIcon m_directoryIcon; |
|
75 QAction *m_directoryUpAction; |
|
76 QToolButton *upDirectoryButton; |
|
77 |
|
78 /** The file system model. */ |
|
79 QFileSystemModel *m_fileSystemModel; |
|
80 |
|
81 /** The file system view. */ |
|
82 QTreeView *m_fileTreeView; |
|
83 QLineEdit *m_currentDirectory; |
|
84 }; |
|
85 |
|
86 #endif // FILESDOCKWIDGET_H |