Mercurial > hg > octave-nkf
changeset 16809:84505f200e05
fix checked state of window menu entries at startup (bug #39322)
* file-editor-interface.h: remove connet_visibility_changed
* file-editor.cc/.h: remove connect_visibility_changed and slot
handle_visibility which are aleady implemented in octave-dock-widget
* octave-dock-widget.cc(connect_visibility_changed): moved here from
octave-dock-widget.h, emit signal active_change for initializing the
entries of the window menu
* octave-dock-widget.h: move connect_visibility_changed to *.cc,
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 22 Jun 2013 20:43:29 +0200 |
parents | 772f51539af8 |
children | 62fa28af2842 |
files | libgui/src/m-editor/file-editor-interface.h libgui/src/m-editor/file-editor.cc libgui/src/m-editor/file-editor.h libgui/src/octave-dock-widget.cc libgui/src/octave-dock-widget.h |
diffstat | 5 files changed, 11 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-interface.h +++ b/libgui/src/m-editor/file-editor-interface.h @@ -61,8 +61,6 @@ virtual void set_focus () = 0; - virtual void connect_visibility_changed (void) = 0; - public slots: virtual void request_new_file (const QString& command = QString ()) = 0; virtual void request_new_script (const QString& command = QString ()) = 0;
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -87,20 +87,6 @@ set_focus (); } -void -file_editor::handle_visibility (bool visible) -{ - if (visible && ! isFloating ()) - focus (); -} - -void -file_editor::connect_visibility_changed (void) -{ - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility (bool))); -} - // set focus to editor and its current tab void file_editor::set_focus (void)
--- a/libgui/src/m-editor/file-editor.h +++ b/libgui/src/m-editor/file-editor.h @@ -47,8 +47,6 @@ file_editor (QWidget *p); ~file_editor (void); - void connect_visibility_changed (void); - void loadFile (const QString& fileName); QMenu *get_mru_menu (void) { return _mru_file_menu; } @@ -99,7 +97,6 @@ public slots: void focus (void); - void handle_visibility (bool visible); void request_new_file (const QString& commands); void request_new_script (const QString& commands);
--- a/libgui/src/octave-dock-widget.cc +++ b/libgui/src/octave-dock-widget.cc @@ -103,6 +103,16 @@ settings->endGroup (); } +// connect signal visibility changed to related slot (called from main-window) +void +octave_dock_widget::connect_visibility_changed (void) +{ + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility (bool))); + emit active_changed (isVisible ()); // emit once for init of window menu +} + + // set the title in the dockwidgets title bar void octave_dock_widget::set_title (const QString& title)
--- a/libgui/src/octave-dock-widget.h +++ b/libgui/src/octave-dock-widget.h @@ -38,12 +38,7 @@ octave_dock_widget (QWidget *p = 0); virtual ~octave_dock_widget (); - virtual void connect_visibility_changed (void) - { - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility (bool))); - } - + virtual void connect_visibility_changed (void); void make_window (bool visible); void make_widget (bool visible); void set_title (const QString&);