diff libgui/src/main-window.cc @ 16452:744ff2fe11ce

add create script context menu to history window * history-dockwidget.h (history_doc_widget::command_create_script): New signal. * history-dockwidget.cc, history-dockwidget.h (history_dock_widget::ctxMenu): New menu item, Create script. (history_dock_widget::handle_contextmenu_create_script): New function. * file-editor-interface.h (file-editor-interface::request_new_file): New argument, commands. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::new_file): New argument, commands. * m-editor/file-editor.h, m-editor/file-editor.cc (file_editor::new_file, file_editor::request_new_file): New argument, commands. * main-window.h, main-window.cc (main_window::new_file): New argument, commands. main_window::construct): Connect history_window::command_create_script signal to main_window::new_file.
author John Donoghue <john.donoghue@ieee.org>
date Sat, 06 Apr 2013 23:58:58 -0400
parents d4c3736e1e28
children 2e3c652c89d1
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Sat Apr 06 23:43:23 2013 -0400
+++ b/libgui/src/main-window.cc	Sat Apr 06 23:58:58 2013 -0400
@@ -103,10 +103,10 @@
 }
 
 void
-main_window::new_file ()
+main_window::new_file (const QString& commands)
 {
 #ifdef HAVE_QSCINTILLA
-  _file_editor->request_new_file ();
+  _file_editor->request_new_file (commands);
 #endif
 }
 
@@ -1022,6 +1022,8 @@
            this,                        SLOT   (set_current_working_directory(QString)));
   connect (this,                        SIGNAL (relay_command_signal (const QString&)),
            command_window,              SLOT   (relay_command (const QString&)));
+  connect (history_window,              SIGNAL (command_create_script (const QString&)),
+           this,                        SLOT   (new_file (const QString&)));
   connect (save_workspace_action,       SIGNAL (triggered ()),
            this,                        SLOT   (handle_save_workspace_request ()));
   connect (load_workspace_action,       SIGNAL (triggered ()),