Mercurial > octave
comparison libgui/src/main-window.cc @ 24645:f61502510d08
restore ability to select variables for editing from workspace widget
* octave-qt-link.h, octave-qt-link.cc: Declare octave::symbol_scope as
a Qt metatype.
(octave_qt_link::set_workspace_signal): Pass scope instead of
individual lists of scope things. Change all uses.
(octave_qt_link::do_set_workspace): Pass scope instead of list of
workspace_element objects.
* octave-link.h, octave-link.cc (octave_link::set_workspace,
octave_link::do_set_workspace): Pass scope instead of list of
workspace_element objects. Change all uses.
* workspace-model.h, workspace-model.cc (workspace_model::m_scope):
New data member.
(workspace_model::set_workspace): Pass and store scope instead of
individual lists of scope things. Change all uses.
(workspace_model::clear_data): Also invalidate m_scope.
(workspace_model::update_table): Unpack scope info here without using
an intermediate list of workspace elements.
(workspace_model::scope): New function.
* workspace-view.h, workspace-view.cc
(workspace_view::edit_variable_signal): Also pass value object.
Change all uses.
(workspace_view::setModel): Also extract value from scope.
* workspace-element.h: Delete.
* libinterp/corefcn/module.mk: Update.
* symscope.h, symscope.cc (symbol_scope::workspace_info,
symbol_scope::symbol_scope_rep::workspace_info): Delete.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 27 Jan 2018 09:06:50 -0500 |
parents | 7d177be54c37 |
children | 88bb3f086d9a |
comparison
equal
deleted
inserted
replaced
24644:e04a56630c8a | 24645:f61502510d08 |
---|---|
1975 this, SLOT (copy_image_to_clipboard (const QString&, bool))); | 1975 this, SLOT (copy_image_to_clipboard (const QString&, bool))); |
1976 | 1976 |
1977 if (m_start_gui) | 1977 if (m_start_gui) |
1978 { | 1978 { |
1979 connect (m_octave_qt_link, | 1979 connect (m_octave_qt_link, |
1980 SIGNAL (set_workspace_signal | 1980 SIGNAL (set_workspace_signal (bool, bool, |
1981 (bool, bool, const QString&, const QStringList&, | 1981 const octave::symbol_scope&)), |
1982 const QStringList&, const QStringList&, | |
1983 const QStringList&, const QIntList&)), | |
1984 m_workspace_model, | 1982 m_workspace_model, |
1985 SLOT (set_workspace | 1983 SLOT (set_workspace (bool, bool, const octave::symbol_scope&))); |
1986 (bool, bool, const QString&, const QStringList&, | |
1987 const QStringList&, const QStringList&, | |
1988 const QStringList&, const QIntList&))); | |
1989 | 1984 |
1990 connect (m_octave_qt_link, SIGNAL (clear_workspace_signal (void)), | 1985 connect (m_octave_qt_link, SIGNAL (clear_workspace_signal (void)), |
1991 m_workspace_model, SLOT (clear_workspace (void))); | 1986 m_workspace_model, SLOT (clear_workspace (void))); |
1992 | 1987 |
1993 connect (m_octave_qt_link, SIGNAL (change_directory_signal (QString)), | 1988 connect (m_octave_qt_link, SIGNAL (change_directory_signal (QString)), |
2548 | 2543 |
2549 octave::symbol_scope scope | 2544 octave::symbol_scope scope |
2550 = octave::__get_current_scope__ ("main_window::load_workspace_callback"); | 2545 = octave::__get_current_scope__ ("main_window::load_workspace_callback"); |
2551 | 2546 |
2552 if (scope) | 2547 if (scope) |
2553 octave_link::set_workspace (true, scope.workspace_info ()); | 2548 octave_link::set_workspace (true, scope); |
2554 } | 2549 } |
2555 | 2550 |
2556 void | 2551 void |
2557 main_window::rename_variable_callback (const main_window::name_pair& names) | 2552 main_window::rename_variable_callback (const main_window::name_pair& names) |
2558 { | 2553 { |
2563 | 2558 |
2564 if (scope) | 2559 if (scope) |
2565 { | 2560 { |
2566 scope.rename (names.first, names.second); | 2561 scope.rename (names.first, names.second); |
2567 | 2562 |
2568 octave_link::set_workspace (true, scope.workspace_info ()); | 2563 octave_link::set_workspace (true, scope); |
2569 } | 2564 } |
2570 | 2565 |
2571 // FIXME: if this action fails, do we need a way to display that info | 2566 // FIXME: if this action fails, do we need a way to display that info |
2572 // in the GUI? | 2567 // in the GUI? |
2573 } | 2568 } |
2632 | 2627 |
2633 octave::symbol_scope scope | 2628 octave::symbol_scope scope |
2634 = octave::__get_current_scope__ ("main_window::force_refresh_workspace"); | 2629 = octave::__get_current_scope__ ("main_window::force_refresh_workspace"); |
2635 | 2630 |
2636 if (scope) | 2631 if (scope) |
2637 octave_link::set_workspace (true, scope.workspace_info (), false); | 2632 octave_link::set_workspace (true, scope, false); |
2638 } | 2633 } |
2639 | 2634 |
2640 bool | 2635 bool |
2641 main_window::focus_console_after_command (void) | 2636 main_window::focus_console_after_command (void) |
2642 { | 2637 { |