GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
libgui
src
files-dock-widget.h
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 2011-2015 Jacob Dawid
4
5
This file is part of Octave.
6
7
Octave is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 3 of the License, or (at your
10
option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<http://www.gnu.org/licenses/>.
20
21
*/
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
#include <QMouseEvent>
38
39
#include <QComboBox>
40
#include "
octave-dock-widget.h
"
41
42
/**
43
@class files_dock_widget
44
@brief Dock widget to display files in the current directory.
45
*/
46
class
files_dock_widget
:
public
octave_dock_widget
47
{
48
Q_OBJECT
49
50
public
:
51
52
files_dock_widget
(
QWidget
*parent = 0);
53
54
~files_dock_widget
();
55
56
public
slots:
57
58
/** Slot for handling a change in directory via double click. */
59
void
item_double_clicked
(
const
QModelIndex & index);
60
61
/** Slot for handling the up-directory button in the toolbar. */
62
void
change_directory_up
();
63
64
/** Slot for handling the sync octave directory button in the toolbar. */
65
void
do_sync_octave_directory
();
66
67
/** Slot for handling the sync browser directory button in the toolbar. */
68
void
do_sync_browser_directory
();
69
70
/** Sets the current directory being displayed. */
71
void
set_current_directory
(
const
QString& dir);
72
73
/** Accepts user input a the line edit for the current directory. */
74
void
accept_directory_line_edit
();
75
76
/** set the internal variable that holds the actual octave variable **/
77
void
update_octave_directory
(
const
QString& dir);
78
79
/** Tells the widget to react on changed settings. */
80
void
notice_settings
(
const
QSettings *settings);
81
82
private
slots:
83
/** context menu wanted */
84
void
contextmenu_requested
(
const
QPoint& pos);
85
86
void
toggle_headercontextitem_filesize
();
87
void
toggle_headercontextitem_filetype
();
88
void
toggle_headercontextitem_datemodified
();
89
void
toggle_headercontextitem_showhidden
();
90
91
void
headercontextmenu_requested
(
const
QPoint& pos);
92
93
/* context menu actions */
94
void
contextmenu_open
(
bool
);
95
void
contextmenu_open_in_app
(
bool
);
96
void
contextmenu_copy_selection
(
bool
);
97
void
contextmenu_run
(
bool
);
98
void
contextmenu_load
(
bool
);
99
void
contextmenu_rename
(
bool
);
100
void
contextmenu_delete
(
bool
);
101
void
contextmenu_newfile
(
bool
);
102
void
contextmenu_newdir
(
bool
);
103
void
contextmenu_setcurrentdir
(
bool
);
104
void
contextmenu_findfiles
(
bool
);
105
106
/* popdown menu options */
107
void
popdownmenu_newfile
(
bool
);
108
void
popdownmenu_newdir
(
bool
);
109
void
popdownmenu_search_dir
(
bool
);
110
void
popdownmenu_findfiles
(
bool
);
111
void
popdownmenu_home
(
bool
);
112
113
/* from octave_doc_widget */
114
void
copyClipboard
();
115
void
pasteClipboard
();
116
void
selectAll
();
117
118
signals:
119
120
/** Emitted, whenever the user requested to open a file. */
121
void
open_file
(
const
QString& fileName);
122
123
/** Emitted, whenever the currently displayed directory changed. */
124
void
displayed_directory_changed
(
const
QString& dir);
125
126
/** Emitted, whenever the user requested to load a file. */
127
void
load_file_signal
(
const
QString& fileName);
128
129
/** Emitted, whenever the user requested to run a file. */
130
void
run_file_signal
(
const
QFileInfo& info);
131
132
/** Emitted, whenever wants to search for a file . */
133
void
find_files_signal
(
const
QString &startdir);
134
135
private
:
136
void
process_new_file
(
const
QString &parent_name);
137
void
process_new_dir
(
const
QString &parent_name);
138
void
process_set_current_dir
(
const
QString &parent_name);
139
void
process_find_files
(
const
QString &dir_name);
140
141
/** set a new directory or open a file **/
142
void
display_directory
(
const
QString& dir,
bool
set_octave_dir =
true
);
143
144
void
open_item_in_app
(
const
QModelIndex& index);
145
146
/** Variables for the actions **/
147
QToolBar *
_navigation_tool_bar
;
148
QAction *
_sync_octave_directory_action
;
149
QAction *
_sync_browser_directory_action
;
150
151
/** The file system model. */
152
QFileSystemModel *
_file_system_model
;
153
154
/** The file system view. */
155
QTreeView
*
_file_tree_view
;
156
QComboBox *
_current_directory
;
157
158
/** Internal variables **/
159
bool
_sync_octave_dir
;
// flag if syncing with octave
160
QString
_octave_dir
;
// the actual octave dir
161
162
enum
{
MaxMRUDirs
= 10 };
163
};
164
165
#endif // FILESDOCKWIDGET_H
files_dock_widget::load_file_signal
void load_file_signal(const QString &fileName)
Emitted, whenever the user requested to load a file.
Definition:
moc-files-dock-widget.cc:221
files_dock_widget::_current_directory
QComboBox * _current_directory
Definition:
files-dock-widget.h:156
files_dock_widget::process_new_file
void process_new_file(const QString &parent_name)
Definition:
files-dock-widget.cc:863
files_dock_widget::pasteClipboard
void pasteClipboard()
Definition:
files-dock-widget.cc:924
files_dock_widget::process_find_files
void process_find_files(const QString &dir_name)
Definition:
files-dock-widget.cc:901
files_dock_widget::do_sync_browser_directory
void do_sync_browser_directory()
Slot for handling the sync browser directory button in the toolbar.
Definition:
files-dock-widget.cc:328
files_dock_widget::toggle_headercontextitem_filetype
void toggle_headercontextitem_filetype()
Definition:
files-dock-widget.cc:403
files_dock_widget::process_set_current_dir
void process_set_current_dir(const QString &parent_name)
Definition:
files-dock-widget.cc:896
files_dock_widget::popdownmenu_findfiles
void popdownmenu_findfiles(bool)
Definition:
files-dock-widget.cc:845
files_dock_widget::update_octave_directory
void update_octave_directory(const QString &dir)
set the internal variable that holds the actual octave variable
Definition:
files-dock-widget.cc:334
files_dock_widget::contextmenu_load
void contextmenu_load(bool)
Definition:
files-dock-widget.cc:600
files_dock_widget::contextmenu_run
void contextmenu_run(bool)
Definition:
files-dock-widget.cc:616
files_dock_widget::set_current_directory
void set_current_directory(const QString &dir)
Sets the current directory being displayed.
Definition:
files-dock-widget.cc:297
files_dock_widget::toggle_headercontextitem_filesize
void toggle_headercontextitem_filesize()
Definition:
files-dock-widget.cc:393
QWidget
files_dock_widget::headercontextmenu_requested
void headercontextmenu_requested(const QPoint &pos)
Definition:
files-dock-widget.cc:434
files_dock_widget::popdownmenu_search_dir
void popdownmenu_search_dir(bool)
Definition:
files-dock-widget.cc:835
files_dock_widget::contextmenu_rename
void contextmenu_rename(bool)
Definition:
files-dock-widget.cc:631
files_dock_widget::run_file_signal
void run_file_signal(const QFileInfo &info)
Emitted, whenever the user requested to run a file.
Definition:
moc-files-dock-widget.cc:228
files_dock_widget::files_dock_widget
files_dock_widget(QWidget *parent=0)
Definition:
files-dock-widget.cc:64
files_dock_widget::popdownmenu_home
void popdownmenu_home(bool)
Definition:
files-dock-widget.cc:824
files_dock_widget::contextmenu_open
void contextmenu_open(bool)
Definition:
files-dock-widget.cc:550
files_dock_widget::_file_tree_view
QTreeView * _file_tree_view
The file system view.
Definition:
files-dock-widget.h:155
files_dock_widget::notice_settings
void notice_settings(const QSettings *settings)
Tells the widget to react on changed settings.
Definition:
files-dock-widget.cc:775
files_dock_widget::popdownmenu_newdir
void popdownmenu_newdir(bool)
Definition:
files-dock-widget.cc:851
files_dock_widget::contextmenu_open_in_app
void contextmenu_open_in_app(bool)
Definition:
files-dock-widget.cc:570
files_dock_widget::contextmenu_findfiles
void contextmenu_findfiles(bool)
Definition:
files-dock-widget.cc:756
files_dock_widget::contextmenu_delete
void contextmenu_delete(bool)
Definition:
files-dock-widget.cc:661
files_dock_widget::do_sync_octave_directory
void do_sync_octave_directory()
Slot for handling the sync octave directory button in the toolbar.
Definition:
files-dock-widget.cc:319
QTreeView
files_dock_widget::open_file
void open_file(const QString &fileName)
Emitted, whenever the user requested to open a file.
Definition:
moc-files-dock-widget.cc:207
files_dock_widget::~files_dock_widget
~files_dock_widget()
Definition:
files-dock-widget.cc:268
files_dock_widget::change_directory_up
void change_directory_up()
Slot for handling the up-directory button in the toolbar.
Definition:
files-dock-widget.cc:309
files_dock_widget::toggle_headercontextitem_showhidden
void toggle_headercontextitem_showhidden()
Definition:
files-dock-widget.cc:423
files_dock_widget::process_new_dir
void process_new_dir(const QString &parent_name)
Definition:
files-dock-widget.cc:881
files_dock_widget::accept_directory_line_edit
void accept_directory_line_edit()
Accepts user input a the line edit for the current directory.
Definition:
files-dock-widget.cc:303
octave-dock-widget.h
files_dock_widget::displayed_directory_changed
void displayed_directory_changed(const QString &dir)
Emitted, whenever the currently displayed directory changed.
Definition:
moc-files-dock-widget.cc:214
files_dock_widget::popdownmenu_newfile
void popdownmenu_newfile(bool)
Definition:
files-dock-widget.cc:857
files_dock_widget::copyClipboard
void copyClipboard()
Definition:
files-dock-widget.cc:907
files_dock_widget::_sync_octave_directory_action
QAction * _sync_octave_directory_action
Definition:
files-dock-widget.h:148
octave_dock_widget
Definition:
octave-dock-widget.h:33
files_dock_widget::find_files_signal
void find_files_signal(const QString &startdir)
Emitted, whenever wants to search for a file .
Definition:
moc-files-dock-widget.cc:235
files_dock_widget::_file_system_model
QFileSystemModel * _file_system_model
The file system model.
Definition:
files-dock-widget.h:152
files_dock_widget::toggle_headercontextitem_datemodified
void toggle_headercontextitem_datemodified()
Definition:
files-dock-widget.cc:413
files_dock_widget::_octave_dir
QString _octave_dir
Definition:
files-dock-widget.h:160
files_dock_widget
Dock widget to display files in the current directory.
Definition:
files-dock-widget.h:46
files_dock_widget::_sync_octave_dir
bool _sync_octave_dir
Internal variables.
Definition:
files-dock-widget.h:159
files_dock_widget::MaxMRUDirs
Definition:
files-dock-widget.h:162
files_dock_widget::contextmenu_requested
void contextmenu_requested(const QPoint &pos)
context menu wanted
Definition:
files-dock-widget.cc:476
files_dock_widget::contextmenu_setcurrentdir
void contextmenu_setcurrentdir(bool)
Definition:
files-dock-widget.cc:737
files_dock_widget::open_item_in_app
void open_item_in_app(const QModelIndex &index)
Definition:
files-dock-widget.cc:383
files_dock_widget::display_directory
void display_directory(const QString &dir, bool set_octave_dir=true)
set a new directory or open a file
Definition:
files-dock-widget.cc:342
files_dock_widget::_navigation_tool_bar
QToolBar * _navigation_tool_bar
Variables for the actions.
Definition:
files-dock-widget.h:147
files_dock_widget::contextmenu_newfile
void contextmenu_newfile(bool)
Definition:
files-dock-widget.cc:703
files_dock_widget::contextmenu_newdir
void contextmenu_newdir(bool)
Definition:
files-dock-widget.cc:720
files_dock_widget::_sync_browser_directory_action
QAction * _sync_browser_directory_action
Definition:
files-dock-widget.h:149
files_dock_widget::selectAll
void selectAll()
Definition:
files-dock-widget.cc:937
files_dock_widget::contextmenu_copy_selection
void contextmenu_copy_selection(bool)
Definition:
files-dock-widget.cc:580
files_dock_widget::item_double_clicked
void item_double_clicked(const QModelIndex &index)
Slot for handling a change in directory via double click.
Definition:
files-dock-widget.cc:289
Generated on Thu Jun 4 2015 23:30:11 for GNU Octave by
1.8.8