diff libgui/src/documentation-dockwidget.h @ 16453:2e3c652c89d1

improve encapsulation of documentation browser window object * documentation-dockwidget.h, documentation-dockwidget.cc (documentation_dock_widget): Derive from octave_dock_widget, not QDockWidget. (documentation_dock_widget::documentation_dock_widget): Don't connect documentation_dock_widget::visibilityChanged signal to documentation_dock_widget::handle_visibility_changed. Don't connect documentation_dock_widget::topLevelChanged signal to documentation_dock_widget::top_level_changed. Set status tip. (documentation_dock_widget::connect_visibility_changed): New function. (documentation_dock_widget::closeEvent): Delete. (documentation_dock_widget::focus, (documentation_dock_widget::handle_visibility): New functions. (documentation_dock_widget::active_changed): Delete signal. * main-window.h, main-window.cc (main_window::file_browser_window): Rename from documentation_dock_widget. Change all uses. (main_window::main_window): Initialize it. (main_window::focus_documentation, main_window::handle_documentation_visible): Delete. (main_window::connect_visibility_changed): Call doc_browser_window->connect_visibility_changed. (main_window::construct): Don't create _documentation_dock_widget.
author John W. Eaton <jwe@octave.org>
date Sun, 07 Apr 2013 00:43:36 -0400
parents bbbb89cc338f
children
line wrap: on
line diff
--- a/libgui/src/documentation-dockwidget.h	Sat Apr 06 23:58:58 2013 -0400
+++ b/libgui/src/documentation-dockwidget.h	Sun Apr 07 00:43:36 2013 -0400
@@ -23,30 +23,28 @@
 #ifndef DOCUMENTATIONDOCKWIDGET_H
 #define DOCUMENTATIONDOCKWIDGET_H
 
-#include <QObject>
-#include <QDockWidget>
+#include "octave-dock-widget.h"
+
 #include "webinfo.h"
 
-class documentation_dock_widget : public QDockWidget
+class documentation_dock_widget : public octave_dock_widget
 {
   Q_OBJECT
-  public:
+
+public:
+
   documentation_dock_widget (QWidget *parent = 0);
 
+  void connect_visibility_changed (void);
+
 public slots:
-  /** Slot to steer changing visibility from outside. */
-  void handle_visibility_changed (bool visible);
-  /** Slot when floating property changes */
-  void top_level_changed (bool floating);
 
-signals:
-  /** Custom signal that tells if a user has clicked away that dock widget. */
-  void active_changed (bool active);
+  void focus (void);
 
-protected:
-  void closeEvent (QCloseEvent *event);
+  void handle_visibility (bool);
 
 private:
+
   webinfo *_webinfo;
 };