Mercurial > hg > octave-nkf
diff libgui/src/files-dockwidget.h @ 16450:3207f1d62e74
improve encapsulation of file browser window object
* files-dockwidget.h, files-dockwidget.cc
(files_dock_widget::files_dock_widget): Use new local variable
container for clarity. Set status tip.
(files_dock_widget::connect_visibility_changed,
files_dock_widget::focus, files_dock_widget::handle_visibility):
New functions.
* main-window.h, main-window.cc (main_window::file_browser_window):
Rename from _files_dock_widget. Change all uses.
(main_window::main_window): Initialize it here.
(main_window::focus_current_directory,
main_window::handle_current_directory_visible): Delete.
(main_window::connect_visibility_changed): Call
file_browser_window->connect_visibility_changed.
(main_window::construct): Don't create _files_dock_widget here.
Connect file_browser_action::triggered to
file_browser_window::focus instead of
main_window::focus_current_directory.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 06 Apr 2013 19:08:14 -0400 |
parents | 919796a440c6 |
children |
line wrap: on
line diff
--- a/libgui/src/files-dockwidget.h +++ b/libgui/src/files-dockwidget.h @@ -46,11 +46,15 @@ class files_dock_widget : public octave_dock_widget { Q_OBJECT - public: - /** Constructs a new files_dock_widget. */ + +public: + files_dock_widget (QWidget *parent = 0); + ~files_dock_widget (); + void connect_visibility_changed (void); + public slots: /** Slot for handling a change in directory via double click. */ @@ -70,6 +74,10 @@ /** Tells the widget to react on changed settings. */ void notice_settings (const QSettings *settings); + void focus (void); + + void handle_visibility (bool visible); + signals: /** Emitted, whenever the user requested to open a file. */ void open_file (const QString& fileName);