Mercurial > hg > octave-lyh
diff libgui/src/main-window.cc @ 15388:24b5348d38e7
merge event_accepted and event_reject into a single function
* history-dockwidget.cc, history-dockwidget.h
(history_dock_widget::handle_event): New function from merging
history_dock_widget::event_accepted and
history_dock_widget::event_reject into single fucntion with argument.
* file-editor-tab.cc, file-editor-tab.h
(file_editor_tab::handle_event): Likewise.
* main-window.cc, main-window.h (main_window::handle_event):
Likewise.
* octave-event-observer.h (octave_event_observer::handle_event):
New pure virtual function.
(octave_event_observer::event_accepted,
octave_event_observer::event_reject): Delete.
* octave_link.cc, octave-link.h (octave_link::handle_event): Likewise.
* workspace-model.cc, workspace-model.h
(workspace_model::handle_event): Likewise.
* octave-link.cc (octave_link::do_process_events): Call
octave_event::handle_event with the return value from
octave_event::perform instead of calling octave_event::accept and
octave_event::reject.
* octave-event.h (octave_event:handle_event): New function.
(octave_event::accept, octave_event::reject): Delete.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Sep 2012 11:14:27 -0400 |
parents | f9ee3befcd6b |
children | 7f423c6111c6 |
line wrap: on
line diff
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -54,18 +54,20 @@ } void -main_window::event_accepted (octave_event *e) +main_window::handle_event (octave_event *e, bool accept) { - if (dynamic_cast<octave_clear_history_event*> (e)) + if (accept) { - // After clearing the history, we need to reset the model. - _history_dock_widget->reset_model (); + if (dynamic_cast<octave_clear_history_event*> (e)) + { + // After clearing the history, we need to reset the model. + _history_dock_widget->reset_model (); + } } -} - -void -main_window::event_reject (octave_event *e) -{ + else + { + // octave_event::perform failed to process event. + } } void