GNU Octave  4.2.1
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-2017 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 #if ! defined (octave_history_dock_widget_h)
24 #define octave_history_dock_widget_h 1
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  void save_settings (void);
50 
51 signals:
52 
53  void information (const QString& message);
54 
55  /** Emitted, whenever the user double-clicked a command in the history. */
56  void command_double_clicked (const QString& command);
57 
58  /** Emitted whenever the user selects command and chooses Create
59  script from popupmenu. */
60  void command_create_script (const QString& commands);
61 
62 private slots:
63 
64  void update_filter_history ();
65  void filter_activate (bool enable);
66 
67  void handle_double_click (QModelIndex modelIndex);
68  void handle_contextmenu_copy (bool flag);
69  void handle_contextmenu_evaluate (bool flag);
70  void handle_contextmenu_create_script (bool flag);
71  void handle_contextmenu_filter (void);
72  void ctxMenu (const QPoint &pos);
73 
74  void copyClipboard ();
75  void pasteClipboard ();
76  void selectAll ();
77 
78  virtual void handle_visibility (bool visible);
79 
80 private:
81 
82  void construct ();
83  QListView *_history_list_view;
84  QSortFilterProxyModel _sort_filter_proxy_model;
85 
86  /** Stores the current history_model. */
87  QStringListModel *_history_model;
88 
89  QCheckBox *_filter_checkbox;
90  QComboBox *_filter;
93  enum { MaxFilterHistory = 10 };
94 };
95 
96 #endif
QStringListModel * _history_model
Stores the current history_model.
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command
Definition: oct-hist.cc:587
void set_history(const QStringList &hist)
history_dock_widget(QWidget *parent=0)
void ctxMenu(const QPoint &pos)
void handle_double_click(QModelIndex modelIndex)
virtual void handle_visibility(bool visible)
void message(const char *name, const char *fmt,...)
Definition: error.cc:430
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_filter(void)
void handle_contextmenu_create_script(bool flag)
QSortFilterProxyModel _sort_filter_proxy_model
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any commands
Definition: oct-hist.cc:587
void handle_contextmenu_evaluate(bool flag)