Mercurial > hg > octave-lyh
annotate libgui/src/files-dockwidget.h @ 15196:017f0b2e6933
rename gui directory to libgu
* libgui: Rename from gui.
* .hgsub (libgui/qterminal): Rename from gui/qterminal.
* Makefile.am (GUIDIR): Set to libgui instead of gui if
AMCOND_BUILD_GUI is true.
* configure.ac (AC_CONFIG_FILES): Update list for directory renaming.
* Makefile.am (.NOTPARALLEL): Delete.
List octave.html/index.html as the primary HTML target, not
octave.html.
(octave.html): New target for making the octave.html directory.
(octave.pdf): Depend on octave.dvi.
* images.awk: In generated rules for png files, depend on octave.html,
not octave.html/index.html.
* src/Makefile.am (OCTAVE_GUI_CPPFLAGS, OCTAVE_GUI_LIBS): Update for
directory renaming.
(CLEANFILES): Fix typo.
* fntests.m (src_tree): Use libinterp, not src.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 18 Aug 2012 18:10:09 -0400 |
parents | gui/src/files-dockwidget.h@3ff18e21c742 |
children | 359098ad343e |
rev | line source |
---|---|
13504
13e3d60aff2d
Replaced Quint with OctaveGUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13495
diff
changeset
|
1 /* OctaveGUI - A graphical user interface for Octave |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13577
diff
changeset
|
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com) |
13495 | 3 * |
4 * This program is free software: you can redistribute it and/or modify | |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13674
diff
changeset
|
5 * it under the terms of the GNU General Public License as |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13577
diff
changeset
|
6 * published by the Free Software Foundation, either version 3 of the |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13577
diff
changeset
|
7 * License, or (at your option) any later version. |
13495 | 8 * |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13674
diff
changeset
|
12 * GNU General Public License for more details. |
13495 | 13 * |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13674
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13577
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
13495 | 16 */ |
17 | |
18 #ifndef FILESDOCKWIDGET_H | |
19 #define FILESDOCKWIDGET_H | |
20 | |
21 #include <QListView> | |
22 #include <QDate> | |
23 #include <QObject> | |
24 #include <QWidget> | |
25 #include <QListWidget> | |
26 #include <QFileSystemModel> | |
27 #include <QToolBar> | |
28 #include <QToolButton> | |
29 #include <QVBoxLayout> | |
30 #include <QAction> | |
31 #include <QTreeView> | |
32 | |
33 #include <QDockWidget> | |
34 #include <QLineEdit> | |
35 | |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
36 /** |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
37 \class files_dock_widget |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
38 \brief Dock widget to display files in the current directory. |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
39 */ |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
40 class files_dock_widget : public QDockWidget |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
41 { |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
42 Q_OBJECT |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
43 public: |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
44 /** 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
|
45 files_dock_widget (QWidget *parent = 0); |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
46 |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
47 public slots: |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
48 /** 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
|
49 void item_double_clicked (const QModelIndex & index); |
13495 | 50 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
51 /** 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
|
52 void do_up_directory (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
53 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
54 /** Sets the current directory being displayed. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
55 void set_current_directory (QString currentDirectory); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
56 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
57 /** 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
|
58 void handle_directory_entered (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
59 |
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
|
60 void display_directory (QString directory); |
13495 | 61 |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
62 /** Tells the widget to react on changed settings. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
63 void notice_settings (); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
64 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
65 /** Slot to steer changing visibility from outside. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
66 void handle_visibility_changed (bool visible); |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
67 |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
68 signals: |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
69 /** Emitted, whenever the user requested to open a file. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
70 void open_file (QString fileName); |
14863
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
71 |
3ff18e21c742
Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14803
diff
changeset
|
72 /** Emitted, whenever the currently displayed directory changed. */ |
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
|
73 void displayed_directory_changed (QString directory); |
13495 | 74 |
13577
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
75 /** Custom signal that tells if a user has clicke away that dock widget. */ |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
76 void active_changed (bool active); |
13577
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
77 |
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
78 protected: |
e440b3f32f02
Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
79 void closeEvent (QCloseEvent *event); |
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 |