Mercurial > octave
changeset 23945:cf16f6521180
double clicking a variable in workspace view opens variable editor (bug #51843)
* workspace-view.cc (workspace_view): connect signal for double clicking
in the table view with the already existing slot for opening the editor;
(contextmenu_requested): put open variable editor at first position of the
context menu
author | Torsten <mttl@mailbox.org> |
---|---|
date | Fri, 25 Aug 2017 22:29:34 +0200 |
parents | 0bc54dbc2bfc |
children | c7b801f36be4 |
files | libgui/src/workspace-view.cc |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/workspace-view.cc Fri Aug 25 20:55:08 2017 +0200 +++ b/libgui/src/workspace-view.cc Fri Aug 25 22:29:34 2017 +0200 @@ -150,6 +150,9 @@ connect (view, SIGNAL (customContextMenuRequested (const QPoint&)), this, SLOT (contextmenu_requested (const QPoint&))); + connect (view, SIGNAL (doubleClicked (QModelIndex)), + this, SLOT (handle_contextmenu_edit (void))); + connect (this, SIGNAL (command_requested (const QString&)), p, SLOT (execute_command_in_terminal (const QString&))); @@ -309,6 +312,9 @@ { QString var_name = get_var_name (index); + menu.addAction (tr ("Open in Variable Editor"), this, + SLOT (handle_contextmenu_edit ())); + menu.addAction (tr ("Copy name"), this, SLOT (handle_contextmenu_copy ())); @@ -327,9 +333,6 @@ rename->setToolTip (tr ("Only top-level symbols may be renamed")); } - menu.addAction (tr ("Open in Variable Editor"), this, - SLOT (handle_contextmenu_edit ())); - menu.addSeparator (); menu.addAction ("disp (" + var_name + ')', this,