Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpc/stand/hpcboot Move progress bar management to r...



details:   https://anonhg.NetBSD.org/src/rev/30317912b697
branches:  trunk
changeset: 556577:30317912b697
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Dec 21 03:18:31 2003 +0000

description:
Move progress bar management to rootwindow.cpp so that hpcmenu.cpp
doesn't need to know about the GUI hierarchy, etc.

If boot is aborted, rewind the progress bar.

diffstat:

 sys/arch/hpc/stand/hpcboot/hpcboot.cpp         |   4 +++-
 sys/arch/hpc/stand/hpcboot/hpcmenu.cpp         |  10 ++++++++--
 sys/arch/hpc/stand/hpcboot/hpcmenu.h           |   4 +++-
 sys/arch/hpc/stand/hpcboot/menu/rootwindow.cpp |  14 +++++++++++++-
 sys/arch/hpc/stand/hpcboot/menu/rootwindow.h   |   5 ++++-
 5 files changed, 31 insertions(+), 6 deletions(-)

diffs (109 lines):

diff -r 739129622638 -r 30317912b697 sys/arch/hpc/stand/hpcboot/hpcboot.cpp
--- a/sys/arch/hpc/stand/hpcboot/hpcboot.cpp    Sun Dec 21 03:07:01 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/hpcboot.cpp    Sun Dec 21 03:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcboot.cpp,v 1.9 2003/12/18 12:15:40 uwe Exp $        */
+/*     $NetBSD: hpcboot.cpp,v 1.10 2003/12/21 03:18:31 uwe Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -227,6 +227,8 @@
  failed_exit:
        MessageBox(menu._root->_window, error_message,
            TEXT("BOOT FAILED"), MB_ICONERROR | MB_OK);
+
+       menu.unprogress();      // rewind progress bar
 }
 
 //
diff -r 739129622638 -r 30317912b697 sys/arch/hpc/stand/hpcboot/hpcmenu.cpp
--- a/sys/arch/hpc/stand/hpcboot/hpcmenu.cpp    Sun Dec 21 03:07:01 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/hpcmenu.cpp    Sun Dec 21 03:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*-   $NetBSD: hpcmenu.cpp,v 1.10 2003/12/18 12:18:53 uwe Exp $       */
+/* -*-C++-*-   $NetBSD: hpcmenu.cpp,v 1.11 2003/12/21 03:18:31 uwe Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -337,7 +337,13 @@
 void
 HpcMenuInterface::progress()
 {
-       SendMessage(_root->_progress_bar->_window, PBM_STEPIT, 0, 0);
+       _root->progress();
+}
+
+void
+HpcMenuInterface::unprogress()
+{
+       _root->unprogress();
 }
 
 // Boot kernel.
diff -r 739129622638 -r 30317912b697 sys/arch/hpc/stand/hpcboot/hpcmenu.h
--- a/sys/arch/hpc/stand/hpcboot/hpcmenu.h      Sun Dec 21 03:07:01 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/hpcmenu.h      Sun Dec 21 03:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*-   $NetBSD: hpcmenu.h,v 1.8 2002/03/25 17:23:19 uch Exp $  */
+/* -*-C++-*-   $NetBSD: hpcmenu.h,v 1.9 2003/12/21 03:18:31 uwe Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -178,8 +178,10 @@
        }
        // call architecture dependent boot function.
        void boot(void);
+
        // Progress bar.
        void progress(void);
+       void unprogress(void);
 
        // Console window interface.
        void print(TCHAR *);
diff -r 739129622638 -r 30317912b697 sys/arch/hpc/stand/hpcboot/menu/rootwindow.cpp
--- a/sys/arch/hpc/stand/hpcboot/menu/rootwindow.cpp    Sun Dec 21 03:07:01 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/menu/rootwindow.cpp    Sun Dec 21 03:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*-   $NetBSD: rootwindow.cpp,v 1.5 2003/12/18 12:34:10 uwe Exp $     */
+/* -*-C++-*-   $NetBSD: rootwindow.cpp,v 1.6 2003/12/21 03:18:31 uwe Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -249,6 +249,18 @@
        return FALSE;
 }
 
+void
+RootWindow::progress()
+{
+    SendMessage(_progress_bar->_window, PBM_STEPIT, 0, 0);
+}
+
+void
+RootWindow::unprogress()
+{
+    SendMessage(_progress_bar->_window, PBM_SETPOS, 0, 0);
+}
+
 //
 // BOOT button
 //
diff -r 739129622638 -r 30317912b697 sys/arch/hpc/stand/hpcboot/menu/rootwindow.h
--- a/sys/arch/hpc/stand/hpcboot/menu/rootwindow.h      Sun Dec 21 03:07:01 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/menu/rootwindow.h      Sun Dec 21 03:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*-   $NetBSD: rootwindow.h,v 1.1 2001/02/09 18:35:01 uch Exp $       */
+/* -*-C++-*-   $NetBSD: rootwindow.h,v 1.2 2003/12/21 03:18:31 uwe Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -66,6 +66,9 @@
 
        void disableTimer(void);
        BOOL isDialogMessage(MSG &);
+
+       void progress();
+       void unprogress();
 };
 
 class BootButton : public Window



Home | Main Index | Thread Index | Old Index