view libgui/src/octave-qt-event-listener.cc @ 16377:8430ea8c1594

open editor tab and insert marker for debugging with gui * file-editor-interface.h (file_editor_interface::request_open_file): New public slot. (file_editor_interface::handle_dbstop_request): New virtual function. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::goto_line): New arg, line, with default value. Don't prompt if line is greater than zero. (file_editor_tab::set_debugger_position): New arg, widget id. (file_editor_tab::add_filename_to_list): New arg, widget id. * file-editor.h, file-editor.cc (file_eidtor::editor_tab_map): New data member. (file_editor::fetFileNames) Delete. (file_editor::~file_editor, file_editor::check_conflict_save, file_editor::handle_add_filename_to_list): Use editor_tab_map instead of fetFileNames. (file_editor::request_open_file): New args, line and set_marker. Optionally position cursor at line and with debug marker. If file is already open in tab, switch to it instead of giving error. (file_editor::construct): Connect fetab_set_debugger_position signal to set_debugger_position slot. * main-window.h, main-window.cc (main_window::dbstop_signal): New signal. (main_window::handle_dbstop_request): New function. * octave-event-listener.h (octave_event_listener::dbstop): New virtual function. * octave-qt-event-listener.h, octave-qt-event-listener.cc (octave_qt_event_listener::dbstop): New function. (octave_qt_event_listener::dbstop_signal): New signal. * octave-link.h, octave-link.cc (octave_link::dbstop, octave_link::do_dbstop, octave_link::dbstop_event_hook_fcn, octave_link::do_dbstop_event_hook_fcn): New functions * octave-main-thread.h, octave-main-thread.cc (dbstop_event_hook_fcn): New function. (octave_main_thread::run): Add it to the list of dbstop event hook functions.
author John W. Eaton <jwe@octave.org>
date Wed, 27 Mar 2013 12:59:12 -0400
parents d4b6ad43bc87
children 3cacd597464d
line wrap: on
line source

/*

Copyright (C) 2011-2012 Jacob Dawid

This file is part of Octave.

Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.

Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING.  If not, see
<http://www.gnu.org/licenses/>.

*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <iostream>

#include "octave-qt-event-listener.h"
#include <QApplication>

octave_qt_event_listener::octave_qt_event_listener (QObject *p)
  : QObject (p), octave_event_listener ()
{
}

void
octave_qt_event_listener::current_directory_has_changed (const std::string& directory)
{
  emit current_directory_has_changed_signal
    (QString::fromUtf8 (directory.data (), directory.size ()));
}

void
octave_qt_event_listener::update_workspace (void)
{
  emit update_workspace_signal ();
}

void
octave_qt_event_listener::update_history (void)
{
  emit update_history_signal ();
}

void
octave_qt_event_listener::dbstop (const std::string& file, int line)
{
  emit dbstop_signal (QString::fromStdString (file), line);
}

void
octave_qt_event_listener::about_to_exit ()
{
  qApp->quit ();
}

void
octave_qt_event_listener::entered_debug_mode ()
{ emit entered_debug_mode_signal (); }

void
octave_qt_event_listener::quit_debug_mode ()
{ emit quit_debug_mode_signal (); }