This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add "_ignore_on_save" method to ManagedWin


Hi,

We currently have a procedure (ManagedWin::dont_remember_size) which can
be set when the windows of a given class should not have their sizes
saved into the preferences file. What we are missing is whether we should
save the windows of a given class to the active list so that they are
automatically re-opened at startup.

This patch adds a protected method "_ignore_on_save" which simply returns
whether the window should be saved into the active list. This simplifies
ManagedWin::shutdown greatly.

Keith

ChangeLog
2002-04-24  Keith Seitz  <keiths@redhat.com>

        * library/managedwin.ith (_ignore_on_save): New protected method.
        * library/managedwin.itb (shutdown): If _ignore_on_save, don't
        save this window to the active window list in the preferences
        file.
        * library/debugwin.ith (DebugWin::_ignore_on_save): Don't save
        this window to preferences active list.
        (DebugWinDOpts::_ignore_on_save): Likewise.
        * library/pluginwin.itcl (_ignore_on_save): Likewise.
        * library/download.ith (_ignore_on_save): Likewise.

Patch
Index: library/managedwin.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/managedwin.ith,v
retrieving revision 1.5
diff -p -r1.5 managedwin.ith
*** library/managedwin.ith	18 May 2001 22:57:30 -0000	1.5
--- library/managedwin.ith	24 Apr 2002 17:06:38 -0000
*************** class ManagedWin {
*** 52,57 ****
--- 52,61 ----
      method _freeze_me {}
      method _thaw_me {}

+     # Should this window be reopened when we startup?
+     method _ignore_on_save {} { return 0 }
+
+     # Should this window's size be remembered?
      proc dont_remember_size {} { return 0 }
    }

Index: library/managedwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/managedwin.itb,v
retrieving revision 1.24
diff -p -r1.24 managedwin.itb
*** library/managedwin.itb	14 Feb 2002 02:39:14 -0000	1.24
--- library/managedwin.itb	24 Apr 2002 17:06:38 -0000
*************** body ManagedWin::restart {} {
*** 115,122 ****
  body ManagedWin::shutdown {} {
    set activeWins {}
    foreach win [itcl_info objects -isa ManagedWin] {
!     if {![$win isa ModalDialog] && ![$win isa DebugWin] &&
! 	![$win isa DebugWinDOpts] && ![$win isa PluginWindow]} {
        set g [wm geometry [winfo toplevel [namespace tail $win]]]
        pref setd gdb/geometry/[namespace tail $win] $g
        lappend activeWins [$win pickle]
--- 115,121 ----
  body ManagedWin::shutdown {} {
    set activeWins {}
    foreach win [itcl_info objects -isa ManagedWin] {
!     if {![$win isa ModalDialog] && ![$win _ignore_on_save]} {
        set g [wm geometry [winfo toplevel [namespace tail $win]]]
        pref setd gdb/geometry/[namespace tail $win] $g
        lappend activeWins [$win pickle]
Index: library/debugwin.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/debugwin.ith,v
retrieving revision 1.2
diff -p -r1.2 debugwin.ith
*** library/debugwin.ith	5 Nov 2001 19:14:00 -0000	1.2
--- library/debugwin.ith	24 Apr 2002 17:06:38 -0000
*************** class DebugWin {
*** 44,49 ****
--- 44,53 ----
      method _save_contents {}
    }

+   protected {
+     method _ignore_on_save {} { return 1 }
+   }
+
    public {
      method constructor {args}
      method destructor {}
*************** class DebugWinDOpts {
*** 73,78 ****
--- 77,86 ----
    public {
      method constructor {args} {}
      method destructor {}
+   }
+
+   protected {
+     method _ignore_on_save { return 1 }
    }

    private {
Index: library/download.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/download.ith,v
retrieving revision 1.3
diff -p -r1.3 download.ith
*** library/download.ith	5 Apr 2002 02:16:22 -0000	1.3
--- library/download.ith	24 Apr 2002 17:06:38 -0000
*************** class Download {
*** 22,27 ****
--- 22,28 ----
      common num_sections
      common num_steps 100

+     method _ignore_on_save {} { return 1 }
      proc dont_remember_size {} { return 1}
    }
    public {
Index: library/pluginwin.itcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/pluginwin.itcl,v
retrieving revision 1.4
diff -p -r1.4 pluginwin.itcl
*** library/pluginwin.itcl	31 May 2001 20:32:58 -0000	1.4
--- library/pluginwin.itcl	24 Apr 2002 17:06:38 -0000
*************** class PluginWindow {
*** 71,76 ****
--- 71,79 ----
      return $child
    }

+   # Don't automatically reload plugins.
+   protected method _ignore_on_save {} { return 1 }
+
    ####################################################################
    #
    # State control methods used by both the menu and the toolbar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]