diff libinterp/corefcn/variables.h @ 23927:e3a36f84d01d

provide variable-editor widget for the GUI This patch is the work of RĂ¼diger Sonderfeld <ruediger on savannah> Philip Nienhuis Michael Barnes <mjbcode@runbox.com> jwe * libgui/src/variable-editor.cc, libgui/src/variable-editor.h, libgui/src/variable-editor-model.cc, libgui/src/variable-editor-model.h:: New files. * libgui/src/module.mk: Update. * main-window.cc, main-window.h (main_window::main_window): Initialize variable_editor_window. (main_window::~main_window): Delete variable_editor_window. (main_window::connect_uiwidget_links): Connect variable window signals to octave_qt_link slots and callbacks. Add variable editor to menus. (main_window::variable_editor_callback, main_window::force_refresh_workspace, main_window::edit_variable, main_window::clear_variable_editor_cache): New functions. (main_window::configure_shortcuts): Also configure variable editor shortcuts. * resource-manager.cc, resource-manager.h (varedit_color_chars, varedit_color_names, varedit_default_colors): New functions. * settings-dialog.ui: New configuration info for variable editor. * settings-dialog.cc, settings-dialog.h (settings_dialog::read_varedit_colors, settings_dialog::write_varedit_colors): New functions. (settings_dialog::settings_dialog, settings_dialog::write_changed_settings): Also handle settings for variable editor. * workspace-model.h (workspace_model::prompt_variable_editor): New signal. * workspace-view.cc, workspace-view.h (workspace_view::workspace_view): Also connect eidt_variable_signal to edit_variable slot. (workspace_view::contextmenu_requested): Handle opening variabl in variable editor. (workspace_view::handle_contextmenu_edit): New function. (workspace_view::edit_variable_signal): New signal. * octave-link.cc, octave-link.h (Fopenvar): New function. (octave_link::post_event, octave_link::do_post_event): New variants for methods with two, three, or four arguments. (octave_link::set_workspace): New argument, update_variable_editor. (octave_link::openvar): New function. (octave_link::do_openvar): New pure virtual. * octave-qt-link.cc, octave-qt-link.h (octave_qt_link::do_set_workspace): New argument, update_variable_editor. (octave_qt_link::do_set_workspace): Optionally emit refresh_variable_editor signal (octave_qt_link::do_openvar): New function. (octave_qt_link::open_variable, octave_qt_link::refresh_variable_editor): New signals. * gui.txi: Document openvar. * variables.cc, variables.h (symbol_exist): New function. * action-container.h (action_container::method_arg2_elem, action_container::method_arg3_elem, action_container::method_arg4_elem): New classes. (action_container::add_method): New variants for two, three, or four arguments.
author Michael Barnes <mjbcode@runbox.com>
date Fri, 19 May 2017 18:15:48 +0200
parents 6eb5f6199a5a
children 3fc24b792a24
line wrap: on
line diff
--- a/libinterp/corefcn/variables.h	Mon Aug 21 17:22:28 2017 +0200
+++ b/libinterp/corefcn/variables.h	Fri May 19 18:15:48 2017 +0200
@@ -70,6 +70,9 @@
 extern OCTINTERP_API bool
 looks_like_struct (const std::string& text, char prev_char);
 
+extern OCTINTERP_API int
+symbol_exist (const std::string& name, const std::string& type = "any");
+
 extern OCTINTERP_API std::string
 unique_symbol_name (const std::string& basename);