annotate libgui/src/history-dock-widget.h @ 24011:9107bae20480

style fixes for some GUI source files * color-picker.cc, color-picker.h, documentation-dock-widget.cc, documentation-dock-widget.h, external-editor-interface.cc, external-editor-interface.h, find-files-dialog.cc, find-files-dialog.h, find-files-model.cc, find-files-model.h, history-dock-widget.cc, history-dock-widget.h, settings-dialog.cc, settings-dialog.h, terminal-dock-widget.cc, thread-manager.cc, thread-manager.h: Use m_ prefix for member variables, order functions consistently in header and source files, and follow more Octave coding conventions.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Sep 2017 09:25:46 -0400
parents 21baad6b35c4
children 1d6c940a1b37
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 2011-2017 Jacob Dawid
15204
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
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
8 under the terms of the GNU General Public License as published by
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
10 (at your option) any later version.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
15 GNU General Public License for more details.
15204
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 */
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
23 #if ! defined (octave_history_dock_widget_h)
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
24 #define octave_history_dock_widget_h 1
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
13545
ffc2e1d1ad5f History can be filtered with an input search box while typing.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
26 #include <QLineEdit>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27 #include <QListView>
13545
ffc2e1d1ad5f History can be filtered with an input search box while typing.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
28 #include <QSortFilterProxyModel>
14720
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
29 #include <QStringListModel>
19563
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
30 #include <QComboBox>
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
31 #include <QCheckBox>
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
32
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
33 #include "octave-dock-widget.h"
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
35 class history_dock_widget : public octave_dock_widget
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
36 {
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
37 Q_OBJECT
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
38
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
39 public:
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
40
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23433
diff changeset
41 history_dock_widget (QWidget *parent = nullptr);
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
42
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
43 ~history_dock_widget (void) = default;
14720
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
44
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13518
diff changeset
45 public slots:
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
46
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16350
diff changeset
47 void set_history (const QStringList& hist);
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16350
diff changeset
48 void append_history (const QString& hist_entry);
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16350
diff changeset
49 void clear_history (void);
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 21203
diff changeset
50 void save_settings (void);
13546
5ef33f99a078 Command get inserted by double clicking in the command history again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13545
diff changeset
51
13517
86adc9c4ec4b History deactivated.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
52 signals:
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
53
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
54 void information (const QString& message);
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14814
diff changeset
55
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14814
diff changeset
56 /** Emitted, whenever the user double-clicked a command in the history. */
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
57 void command_double_clicked (const QString& command);
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14814
diff changeset
58
16452
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16447
diff changeset
59 /** Emitted whenever the user selects command and chooses Create
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16447
diff changeset
60 script from popupmenu. */
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16447
diff changeset
61 void command_create_script (const QString& commands);
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16447
diff changeset
62
13546
5ef33f99a078 Command get inserted by double clicking in the command history again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13545
diff changeset
63 private slots:
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
64
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
65 void update_filter_history (void);
19563
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
66 void filter_activate (bool enable);
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
67
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
68 void ctxMenu (const QPoint& pos);
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
69 void handle_double_click (QModelIndex modelIndex);
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
70 void handle_contextmenu_copy (bool flag);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 void handle_contextmenu_evaluate (bool flag);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
72 void handle_contextmenu_create_script (bool flag);
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
73 void handle_contextmenu_filter (void);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
74
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
75 void copyClipboard (void);
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
76 void pasteClipboard (void);
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
77 void selectAll (void);
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
78
20692
950c8a092db7 check whether filter is active or not when history widget becomes visible
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
79 virtual void handle_visibility (bool visible);
950c8a092db7 check whether filter is active or not when history widget becomes visible
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
80
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
81 private:
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
82
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
83 void construct (void);
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
84
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
85 QListView *m_history_list_view;
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
86 QSortFilterProxyModel m_sort_filter_proxy_model;
14720
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
87
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
88 /** Stores the current history_model. */
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
89 QStringListModel *m_history_model;
19563
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
90
24011
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
91 QCheckBox *m_filter_checkbox;
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
92 QComboBox *m_filter;
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
93 QWidget *m_filter_widget;
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
94 bool m_filter_shown;
9107bae20480 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
95
19563
a402493c0605 provide the same filter for history view as for workspace view
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
96 enum { MaxFilterHistory = 10 };
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
97 };
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
98
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20697
diff changeset
99 #endif