diff src/main-gui.cc @ 17778:b5d58667d32d

new main program wrapper to handle giving up controlling tty * octave-gui.cc (octave_cli_thread): New class, from QtHandles. (dissociate_terminal): Delete. (octave_start_gui): Third arg is now START_GUI instead of FORK. Don't call dissociate_terminal. If start_gui is false, use octave_cli_thread to start Octave within a QApplication context. * sighandlers.cc (gui_driver_sig_handler): Move to src/main.in.cc. (install_gui_driver_signal_handlers): Move to src/main.in.cc and rename to octave_set_signal_handler. * octave.cc (no_fork_option): Delete. (process_command_line): Don't handle NO_FORK_OPTION. (octave_fork_gui): Move to src/main.in.cc and rename to have_controlling_terminal. * options-usage.h (usage_string, octave_print_verbose_usage_and_exit): Delete --no-fork from text. (long_opts): Delete no-fork from list. (NO_FORK_OPTION): Delete. * run-octave.in: Set OCTAVE_BINDIR in environment before exec-ing Octave binary. * src/Makefile.am: Build octave-gui, octave-cli, and octave instead of octave-cli and octave. * main-gui.cc: Rename from main.cc. Call octave_start_gui and pass START_GUI as parameter. * main.in.cc: New file.
author John W. Eaton <jwe@octave.org>
date Sun, 27 Oct 2013 18:47:22 -0400
parents src/main.cc@d63878346099
children 4197fc428c7d
line wrap: on
line diff
copy from src/main.cc
copy to src/main-gui.cc
--- a/src/main.cc
+++ b/src/main-gui.cc
@@ -32,41 +32,13 @@
 int
 main (int argc, char **argv)
 {
-  int retval = 0;
-
   octave_process_command_line (argc, argv);
 
   sysdep_init ();
 
   install_defaults ();
 
-  if (octave_starting_gui ())
-    retval = octave_start_gui (argc, argv, octave_fork_gui ());
-  else
-    {
-      octave_initialize_interpreter (argc, argv, 0);
-
-      retval = octave_execute_interpreter ();
-    }
-
-  return retval;
-}
-
+  bool start_gui = octave_starting_gui ();
 
-/*!
-@mainpage Source code documentation for GNU Octave
-
-GNU Octave is a high-level language, primarily intended for numerical
-computations.  It provides a convenient interactive command line
-interface for solving linear and nonlinear problems numerically, and
-for performing other numerical experiments.  It may also be used as a
-batch-oriented language for data processing.
-
-GNU Octave is free software. You may redistribute it and/or modify it
-under the terms of the <a href="http://www.gnu.org/licenses/">GNU
-General Public License</a> as published by the Free Software Foundation.
-
-This is the developer documentation for Octave's own source code. It is
-intended to help for hacking Octave. It may also be useful for
-understanding the Octave API when writing your own .oct files.
-*/
+  return octave_start_gui (argc, argv, start_gui);
+}