Mercurial > hg > octave-lyh
diff libgui/src/main-window.h @ 16447:e3b33a7530bc
improve encapsulation of history window object
* history-dockwidget.h, history-dockwidget.cc
(history_dock_widget::history_dock_widget): Set status tip here.
Connect history_dock_widget::information signal to
main_window::report_status_message.
Connect history_dock_widget::command_double_clicked signal to
main_window::handle_command_double_clicked.
(history_dock_widget::connect_visibility_changed,
history_dock_widget::focus, history_dock_widget::handle_visibility):
New functions.
* main-window.h, main-window.cc (main_window::history_window): Rename
from _history_dock_widget. Don't use a pointer. Change all uses.
(main_window::main_window): Initialize it here.
(main_window::~main_window): Don't delete _history_dock_widget.
(main_window::focus_history_window_signal): New signal.
(main_window::focus_history_window): Rename from
main_window::focus_command_history. Emit focus_history_window_signal
instead of performing actions here.
(main_window::handle_command_history_visible): Delete.
(main_window::connect_visibility_changed): Call
history_window.connect_visibility_changed instead of performing
actions here.
(main_window::construct): Don't create _history_dock_widget. Adapt
signal/slot connections for new history_window object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 06 Apr 2013 16:46:14 -0400 |
parents | 4b3a4bf8569b |
children | 47fe533ec85b |
line wrap: on
line diff
--- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -1,5 +1,6 @@ /* +Copyright (C) 2013 John W. Eaton Copyright (C) 2011-2012 Jacob Dawid This file is part of Octave. @@ -20,8 +21,8 @@ */ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#if !defined (main_window_h) +#define main_window_h 1 // Qt includes #include <QtGui/QMainWindow> @@ -72,6 +73,7 @@ void settings_changed (const QSettings *); void relay_command_signal (const QString&); void focus_command_window_signal (void); + void focus_history_window_signal (void); public slots: void report_status_message (const QString& statusMessage); @@ -102,12 +104,11 @@ void handle_command_double_clicked (const QString& command); void focus_command_window (void); - void focus_command_history (); + void focus_history_window (void); void focus_current_directory (); void focus_workspace (); void focus_editor (); void focus_documentation (); - void handle_command_history_visible (bool); void handle_current_directory_visible (bool); void handle_workspace_visible (bool); void handle_editor_visible (bool); @@ -156,6 +157,8 @@ terminal_dock_widget command_window; + history_dock_widget history_window; + #ifdef HAVE_QSCINTILLA file_editor_interface * _file_editor; #endif @@ -172,7 +175,6 @@ // Dock widgets. workspace_view * _workspace_view; - history_dock_widget * _history_dock_widget; files_dock_widget * _files_dock_widget; documentation_dock_widget*_documentation_dock_widget;