Mercurial > hg > octave-lyh
annotate libgui/src/files-dockwidget.h @ 16390:1834b91292ab
doc: removed unneeded Matlab references in java.texi
author | Philip Nienhuis <prnienhuis@users.sf.net> |
---|---|
date | Fri, 29 Mar 2013 11:11:09 +0100 |
parents | c3057d80cf91 |
children | 28136851099a |
rev | line source |
---|---|
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
1 /* |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
2 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
3 Copyright (C) 2011-2012 Jacob Dawid |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
6 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
10 option) any later version. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
11 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
15 for more details. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
16 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
20 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
21 */ |
13495 | 22 |
23 #ifndef FILESDOCKWIDGET_H | |
24 #define FILESDOCKWIDGET_H | |
25 | |
26 #include <QListView> | |
27 #include <QDate> | |
28 #include <QObject> | |
29 #include <QWidget> | |
30 #include <QListWidget> | |
31 #include <QFileSystemModel> | |
32 #include <QToolBar> | |
33 #include <QToolButton> | |
34 #include <QVBoxLayout> | |
35 #include <QAction> | |
36 #include <QTreeView> | |
37 | |
38 #include <QLineEdit> | |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
15552
diff
changeset
|
39 #include "octave-dock-widget.h" |
13495 | 40 |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
41 /** |
15367
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15300
diff
changeset
|
42 \class files_dock_widget |
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15300
diff
changeset
|
43 \brief Dock widget to display files in the current directory. |
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15300
diff
changeset
|
44 */ |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
15552
diff
changeset
|
45 class files_dock_widget : public octave_dock_widget |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
46 { |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
47 Q_OBJECT |
15367
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15300
diff
changeset
|
48 public: |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
49 /** Constructs a new files_dock_widget. */ |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
50 files_dock_widget (QWidget *parent = 0); |
15461
1e64aff609c3
save/restore column state and sorting (column and order) in files-widget
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
51 ~files_dock_widget (); |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
52 |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
53 public slots: |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
15552
diff
changeset
|
54 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
55 /** Slot for handling a change in directory via double click. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
56 void item_double_clicked (const QModelIndex & index); |
13495 | 57 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
58 /** Slot for handling the up-directory button in the toolbar. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
59 void do_up_directory (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
60 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
61 /** Sets the current directory being displayed. */ |
15300
fd27e10b9b05
pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
62 void set_current_directory (const QString& currentDirectory); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
63 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
64 /** Accepts user input a the line edit for the current directory. */ |
14803
625be3eb27c5
Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
65 void handle_directory_entered (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
66 |
15300
fd27e10b9b05
pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
67 void display_directory (const QString& directory); |
13495 | 68 |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
69 /** Tells the widget to react on changed settings. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
70 void notice_settings (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
71 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
72 signals: |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
73 /** Emitted, whenever the user requested to open a file. */ |
15300
fd27e10b9b05
pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
74 void open_file (const QString& fileName); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
75 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
76 /** Emitted, whenever the currently displayed directory changed. */ |
15300
fd27e10b9b05
pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
77 void displayed_directory_changed (const QString& directory); |
13495 | 78 |
13577
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
79 protected: |
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
80 |
13495 | 81 private: |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
82 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc |
13495 | 83 |
14803
625be3eb27c5
Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
84 QString _last_current_directory; |
625be3eb27c5
Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
85 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
86 /** Toolbar for file and directory manipulation. */ |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
87 QToolBar * _navigation_tool_bar; |
13495 | 88 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
89 /** Variables for the up-directory action. */ |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
90 QIcon _directory_icon; |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
91 QAction * _directory_up_action; |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
92 QToolButton * _up_directory_button; |
13495 | 93 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
94 /** The file system model. */ |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
95 QFileSystemModel *_file_system_model; |
13495 | 96 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
97 /** The file system view. */ |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
98 QTreeView * _file_tree_view; |
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
99 QLineEdit * _current_directory; |
13495 | 100 }; |
101 | |
102 #endif // FILESDOCKWIDGET_H |