GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
history-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 HISTORYDOCKWIDGET_H
24 #define HISTORYDOCKWIDGET_H
25 
26 #include <QLineEdit>
27 #include <QListView>
28 #include <QSortFilterProxyModel>
29 #include <QStringListModel>
30 #include <QComboBox>
31 #include <QCheckBox>
32 
33 #include "octave-dock-widget.h"
34 
36 {
37  Q_OBJECT
38 
39 public:
40 
41  history_dock_widget (QWidget *parent = 0);
43 
44 public slots:
45 
46  void set_history (const QStringList& hist);
47  void append_history (const QString& hist_entry);
48  void clear_history (void);
49 
50 signals:
51 
52  void information (const QString& message);
53 
54  /** Emitted, whenever the user double-clicked a command in the history. */
55  void command_double_clicked (const QString& command);
56 
57  /** Emitted whenever the user selects command and chooses Create
58  script from popupmenu. */
59  void command_create_script (const QString& commands);
60 
61 private slots:
62 
63  void update_filter_history ();
64  void filter_activate (bool enable);
65 
66  void handle_double_click (QModelIndex modelIndex);
67  void handle_contextmenu_copy (bool flag);
68  void handle_contextmenu_evaluate (bool flag);
69  void handle_contextmenu_create_script (bool flag);
70  void ctxMenu (const QPoint &pos);
71 
72  void copyClipboard ();
73  void pasteClipboard ();
74  void selectAll ();
75 
76 private:
77 
78  void construct ();
79  QListView *_history_list_view;
80  QSortFilterProxyModel _sort_filter_proxy_model;
81 
82  /** Stores the current history_model. */
83  QStringListModel *_history_model;
84 
85  QCheckBox *_filter_checkbox;
86  QComboBox *_filter;
87  enum { MaxFilterHistory = 10 };
88 };
89 
90 #endif // HISTORYDOCKWIDGET_H
QStringListModel * _history_model
Stores the current history_model.
void set_history(const QStringList &hist)
history_dock_widget(QWidget *parent=0)
void ctxMenu(const QPoint &pos)
void handle_double_click(QModelIndex modelIndex)
void message(const char *name, const char *fmt,...)
Definition: error.cc:380
QListView * _history_list_view
void information(const QString &message)
void handle_contextmenu_copy(bool flag)
void command_double_clicked(const QString &command)
Emitted, whenever the user double-clicked a command in the history.
void command_create_script(const QString &commands)
Emitted whenever the user selects command and chooses Create script from popupmenu.
void append_history(const QString &hist_entry)
void filter_activate(bool enable)
void handle_contextmenu_create_script(bool flag)
QSortFilterProxyModel _sort_filter_proxy_model
void handle_contextmenu_evaluate(bool flag)