[PATCH] Setup Re: "Installation finished"

Igor Peshansky pechtcha@cs.nyu.edu
Fri Mar 30 20:43:00 GMT 2007


Ping?  I'd like to apply this.  Corinna, is that what you were
envisioning?  Would you like me to make a pre-compiled version available
on the web to let people test without having to build?
	Igor

On Wed, 28 Mar 2007, Igor Peshansky wrote:

> On Thu, 22 Mar 2007, Brian Dessent wrote:
>
> > Corinna Vinschen wrote:
> >
> > > Question to the setup.exe maintainers:
> > >
> > > Do we really need the "Installation finished." message box at the end?
> > > I find it increasingly annoying that I have to confirm the end of the
> > > installation on a centered button when all the rest of the "OK" buttons
> > > were at the bottom right of the prevous dialogs.
> > >
> > > Wouldn't it suffice to rename the "OK" button in the last dialog to
> > > "Finish"?
> >
> > You're right, I hate that too and it's been on the todo list to remove
> > this for a long time.
>
> And here is a patch.  It does a bit more than remove the final mbox -- it
> also moves the status information into the "Create Icons" dialog.  It
> should handle the resizing of that dialog correctly, but please test it
> anyway.  ChangeLog is below.  Comments welcome.
> 	Igor
> ==============================================================================
> ChangeLog:
> 2007-03-28  Igor Peshansky  <pechtcha@cs.nyu.edu>
>
> 	* LogFile.cc (LogFile::exit): Write exit_msg directly to log, without
> 	the message box.
> 	* resource.h (IDC_DESKTOP_SEPARATOR,IDC_STATUS_HEADER,IDC_STATUS): New
> 	control ids.
> 	* res.rc (IDD_DESKTOP): Change the caption.  Add status information.
> 	* desktop.h (DesktopSetupPage::DesktopSetupPage): Define constructor
> 	in the implementation.
> 	* desktop.cc (DesktopControlsInfo): Position specifiers for status
> 	information items.
> 	(DesktopSetupPage::DesktopSetupPage): Register position specifiers.
> 	(set_status): New static method.
> 	(load_dialog): Set status information, if available.
> 	(DesktopSetupPage::OnInit): Set status header font.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin
-------------- next part --------------
Index: LogFile.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/LogFile.cc,v
retrieving revision 2.15
diff -u -p -r2.15 LogFile.cc
--- LogFile.cc	15 Apr 2006 21:21:25 -0000	2.15
+++ LogFile.cc	28 Mar 2007 14:50:38 -0000
@@ -24,6 +24,7 @@ static const char *cvsid =
 #include "io_stream.h"
 #include "win32.h"
 #include "msg.h"
+#include "dialog.h"
 #include "resource.h"
 #include <iostream>
 #include <sstream>
@@ -126,7 +127,14 @@ LogFile::exit (int const exit_code)
   been_here = 1;
   
   if (exit_msg)
-    note (NULL, exit_msg, backslash(getFileName(LOG_BABBLE)).c_str());
+    {
+      char buf[1000], fmt[1000];
+      if (LoadString (hinstance, exit_msg, fmt, sizeof (fmt)) > 0)
+        {
+          snprintf (buf, 1000, fmt, backslash(getFileName(LOG_BABBLE)).c_str());
+          log (LOG_PLAIN) << "note: " << buf << endLog;
+        }
+    }
   
   log (LOG_TIMESTAMP) << "Ending cygwin install" << endLog;
 
Index: desktop.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/desktop.cc,v
retrieving revision 2.46
diff -u -p -r2.46 desktop.cc
--- desktop.cc	28 Feb 2007 00:55:04 -0000	2.46
+++ desktop.cc	28 Mar 2007 14:50:38 -0000
@@ -45,6 +45,7 @@ static const char *cvsid =
 #include "io_stream.h"
 #include "getopt++/BoolOption.h"
 #include "PackageSpecification.h"
+#include "LogFile.h"
 
 static BoolOption NoShortcutsOption (false, 'n', "no-shortcuts", "Disable creation of desktop and start menu shortcuts");
 static BoolOption NoStartMenuOption (false, 'N', "no-startmenu", "Disable creation of start menu shortcut");
@@ -61,6 +62,18 @@ static BoolOption NoDesktopOption (false
 static std::string batname;
 static std::string iconname;
 
+static ControlAdjuster::ControlInfo DesktopControlsInfo[] = {
+  {IDC_DESKTOP_SEPARATOR, 	CP_STRETCH, CP_BOTTOM},
+  {IDC_STATUS, 			CP_LEFT, CP_BOTTOM},
+  {IDC_STATUS_HEADER, 		CP_LEFT, CP_BOTTOM},
+  {0, CP_LEFT, CP_TOP}
+};
+
+DesktopSetupPage::DesktopSetupPage ()
+{
+  sizeProcessor.AddControlInfo (DesktopControlsInfo);
+}
+
 static void
 make_link (const std::string& linkpath,
            const std::string& title,
@@ -223,12 +236,26 @@ check_if_enable_next (HWND h)
   EnableWindow (GetDlgItem (h, IDOK), 1);
 }
 
+extern LogFile * theLog;
+
+static void
+set_status (HWND h)
+{
+  char buf[1000], fmt[1000];
+  if (LoadString (hinstance, exit_msg, fmt, sizeof (fmt)) > 0)
+    {
+      snprintf (buf, 1000, fmt, backslash(theLog->getFileName(LOG_BABBLE)).c_str());
+      ::SetWindowText (GetDlgItem (h, IDC_STATUS), buf);
+    }
+}
+
 static void
 load_dialog (HWND h)
 {
   rbset (h, da, root_desktop);
   rbset (h, ma, root_menu);
   check_if_enable_next (h);
+  set_status (h);
 }
 
 static int
@@ -362,6 +389,7 @@ DesktopSetupPage::OnInit ()
 
   load_dialog (GetHWND ());
 
+  SetDlgItemFont(IDC_STATUS_HEADER, "MS Shell Dlg", 8, FW_BOLD);
 }
 
 long
Index: desktop.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/desktop.h,v
retrieving revision 2.6
diff -u -p -r2.6 desktop.h
--- desktop.h	23 Jun 2003 20:48:59 -0000	2.6
+++ desktop.h	28 Mar 2007 14:50:38 -0000
@@ -27,9 +27,7 @@
 class DesktopSetupPage:public PropertyPage
 {
 public:
-  DesktopSetupPage ()
-  {
-  };
+  DesktopSetupPage ();
   virtual ~ DesktopSetupPage ()
   {
   };
Index: res.rc
===================================================================
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.71
diff -u -p -r2.71 res.rc
--- res.rc	28 Feb 2007 00:55:04 -0000	2.71
+++ res.rc	28 Mar 2007 14:56:07 -0000
@@ -272,7 +272,7 @@ END
 IDD_DESKTOP DIALOG DISCARDABLE  0, 0, 317, 179
 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | 
     WS_CAPTION | WS_SYSMENU
-CAPTION "Cygwin Setup - Create Icons"
+CAPTION "Cygwin Setup - Installation Status and Create Icons"
 FONT 8, "MS Shell Dlg"
 BEGIN
     CONTROL         "Create icon on &Desktop",IDC_ROOT_DESKTOP,"Button",
@@ -286,6 +286,11 @@ BEGIN
                     IDC_STATIC,21,9,239,16,NOT WS_GROUP
     LTEXT           "Create Icons",IDC_STATIC_HEADER_TITLE,7,0,258,8,NOT 
                     WS_GROUP
+    CONTROL         "",IDC_DESKTOP_SEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,
+                    0,155,317,1
+    LTEXT           "Installation Status",IDC_STATUS_HEADER,7,160,258,8,NOT WS_GROUP
+    LTEXT           "Cygwin installation completed successfully.",IDC_STATUS,
+                    21,169,239,16,NOT WS_GROUP
 END
 
 IDD_FTP_AUTH DIALOG DISCARDABLE  0, 0, 215, 95
Index: resource.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/resource.h,v
retrieving revision 2.33
diff -u -p -r2.33 resource.h
--- resource.h	10 Mar 2006 17:18:20 -0000	2.33
+++ resource.h	28 Mar 2007 14:50:38 -0000
@@ -155,3 +155,6 @@
 #define IDC_PREREQ_CHECK                  578
 #define IDC_DROP_MIRRORS                  579
 #define IDC_DROP_NOWARN                   580
+#define IDC_DESKTOP_SEPARATOR             581
+#define IDC_STATUS_HEADER                 582
+#define IDC_STATUS                        583


More information about the Cygwin-apps mailing list