Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 16566:662a712b8fd5
partial menu bar cleanup
* file-editor-interface.h (file_editor_interface::request_new_script,
file_editor_interface::request_new_function): New functions.
* file-editor.h, file-editor.cc (file_editor::request_new_script,
file_editor::request_new_function): New functions.
* main-window.h, main-window.cc (main_window::construct_desktop_menu):
Delete function and all uses.
(main_window::handle_new_figure_request,
main_window::handle_new_variable_request,
main_window::new_figure_callback): New functions.
(main_window::construct_file_menu, main_window::construct_edit_menu):
Delete close_command_window_action, import_data_action,
page_setup_action, print_action, print_selection_action,
new_class_action, new_enumeration_action, new_gui_action,
paste_to_workspace_action, find_action. Move load_workspace_action to
file_menu.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 25 Apr 2013 02:42:45 -0400 |
parents | ebec000cbfc5 |
children | d5ae5aa80d42 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -151,6 +151,31 @@ } void +file_editor::request_new_script (const QString& commands) +{ + request_new_file (commands); +} + +void +file_editor::request_new_function (const QString& commands) +{ + QString text = commands; + + if (text.isEmpty ()) + text = "## Copyright (C)\n" + "\n" + "## -*- texinfo -*-\n" + "## @deftypefn {Function File} {[outputs] =} unamed_function (inputs)\n" + "## @end deftypefn\n" + "\n" + "function [outputs] = unnamed_function (inputs)\n" + "\n" + "endfunction\n"; + + request_new_file (text); +} + +void file_editor::request_open_file (void) { // Open file isn't a file_editor_tab function since the file