[MonoDevelop] Progress patch for splash screen

Christian Hergert Christian Hergert <christian.hergert@gmail.com>
Thu, 10 Mar 2005 15:46:31 -0800


------=_Part_584_8422080.1110498391735
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This is a quick attempt at adding some sort of status to the startup
sequence of monodevelop. you may like or dislike. either way, let me
know.

A more thought out splash system would support things like addin
splash additions with icons and all that fancy features. we obviously
cant do that before this weekends release.
-- 
Christian Hergert
Mosaix Communications, Inc.
Software Engineer
C: 253 906 2115

------=_Part_584_8422080.1110498391735
Content-Type: text/x-patch; name="progress_dialog.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="progress_dialog.patch"

Index: Core/src/MonoDevelop.Base/Gui/Dialogs/SplashScreen.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Core/src/MonoDevelop.Base/Gui/Dialogs/SplashScreen.cs=09(revision 2325)
+++ Core/src/MonoDevelop.Base/Gui/Dialogs/SplashScreen.cs=09(working copy)
@@ -12,6 +12,10 @@
 =09=09static ArrayList requestedFileList =3D new ArrayList();
 =09=09static ArrayList parameterList =3D new ArrayList();
 =09=09
+=09=09static Label message;
+=09=09static ProgressBar progress;
+=09=09static VBox vbox;
+=09=09
 =09=09public static SplashScreenForm SplashScreen {
 =09=09=09get {
 =09=09=09=09return splashScreen;
@@ -24,11 +28,31 @@
 =09=09=09this.WindowPosition =3D WindowPosition.Center;
 =09=09=09this.TypeHint =3D Gdk.WindowTypeHint.Splashscreen;
 =09=09=09Gdk.Pixbuf bitmap =3D new Gdk.Pixbuf(Assembly.GetEntryAssembly(),=
 "SplashScreen.png");
-=09=09=09DefaultWidth =3D bitmap.Width;
-=09=09=09DefaultHeight =3D bitmap.Height;
+=09=09=09//DefaultWidth =3D bitmap.Width;
+=09=09=09//DefaultHeight =3D bitmap.Height;
 =09=09=09Gtk.Image image =3D new Gtk.Image (bitmap);
 =09=09=09image.Show ();
-=09=09=09this.Add (image);
+
+=09=09=09message =3D new Label("Initializing...");
+=09=09=09message.Xalign =3D 0;
+=09=09=09message.Xpad =3D 5;
+=09=09=09message.Ypad =3D 3;
+=09=09=09message.Show();
+=09=09=09
+=09=09=09HBox hbox =3D new HBox();
+=09=09=09hbox.PackStart(new Label("    "), false, false, 0);
+=09=09=09progress =3D new ProgressBar();
+=09=09=09progress.Fraction =3D 0.00;
+=09=09=09hbox.PackStart(progress, true, true, 0);
+=09=09=09hbox.PackStart(new Label("    "), false, false, 0);
+=09=09=09hbox.ShowAll();
+
+=09=09=09vbox =3D new VBox();
+=09=09=09vbox.PackStart(image, true, true, 0);
+=09=09=09vbox.PackStart(hbox, false, true, 0);
+=09=09=09vbox.PackStart(message, false, true, 0);
+=09=09=09
+=09=09=09this.Add (vbox);
 =09=09}
=20
 =09=09public static string[] GetParameterList()
@@ -45,6 +69,16 @@
 =09=09{
 =09=09=09return (string[])list.ToArray(typeof(string));
 =09=09}
+
+=09=09public static void SetProgress(double Percentage)
+=09=09{
+=09=09=09progress.Fraction =3D Percentage;
+=09=09}
+
+=09=09public static void SetMessage(string Message)
+=09=09{
+=09=09=09message.Text =3D Message;
+=09=09}
 =09=09
 =09=09public static void SetCommandLineArgs(string[] args)
 =09=09{
Index: Core/src/MonoDevelop.Startup/MonoDevelopMain.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Core/src/MonoDevelop.Startup/MonoDevelopMain.cs=09(revision 2325)
+++ Core/src/MonoDevelop.Startup/MonoDevelopMain.cs=09(working copy)
@@ -104,7 +104,8 @@
 =09=09=09=09SplashScreenForm.SplashScreen.ShowAll ();
 =09=09=09=09RunMainLoop ();
 =09=09=09}
-
+=09=09=09
+=09=09=09SetSplashInfo(0.05, "Initializing Addins ...");
 =09=09=09bool ignoreDefaultPath =3D false;
 =09=09=09string [] addInDirs =3D MonoDevelop.AddInSettingsHandler.GetAddIn=
Directories(out ignoreDefaultPath);
 =09=09=09AddInTreeSingleton.SetAddInDirectories(addInDirs, ignoreDefaultPa=
th);
@@ -112,12 +113,18 @@
=20
 =09=09=09ArrayList commands =3D null;
 =09=09=09try {
+=09=09=09=09SetSplashInfo(0.1, "Initializing Icon Service ...");
 =09=09=09=09ServiceManager.AddService(new IconService());
+=09=09=09=09SetSplashInfo(0.2, "Initializing Message Service ...");
 =09=09=09=09ServiceManager.AddService(new MessageService());
+=09=09=09=09SetSplashInfo(0.4, "Initializing Resource Service ...");
 =09=09=09=09ServiceManager.AddService(new ResourceService());
+=09=09=09=09SetSplashInfo(0.6, "Initializing Addin Services ...");
 =09=09=09=09ServiceManager.InitializeServicesSubsystem("/Workspace/Service=
s");
=20
+=09=09=09=09SetSplashInfo(0.8, "Initializing Autostart Addins ...");
 =09=09=09=09commands =3D AddInTreeSingleton.AddInTree.GetTreeNode("/Worksp=
ace/Autostart").BuildChildItems(null);
+=09=09=09=09SetSplashInfo(1, "Loading MonoDevelop Workbench ...");
 =09=09=09=09RunMainLoop ();
 =09=09=09=09for (int i =3D 0; i < commands.Count - 1; ++i) {
 =09=09=09=09=09((ICommand)commands[i]).Run();
@@ -126,7 +133,8 @@
=20
 =09=09=09=09// no alternative for Application.ThreadException?
 =09=09=09=09// Application.ThreadException +=3D new ThreadExceptionEventHa=
ndler(ShowErrorBox);
-
+=09=09=09=09
+=09=09=09=09
 =09=09=09} catch (XmlException e) {
 =09=09=09=09Console.WriteLine("Could not load XML :\n" + e.Message);
 =09=09=09=09return 1;
@@ -165,6 +173,13 @@
 =09=09=09return 0;
 =09=09}
=20
+=09=09static void SetSplashInfo(double Percentage, string Message)
+=09=09{
+=09=09=09SplashScreenForm.SetProgress(Percentage);
+=09=09=09SplashScreenForm.SetMessage(Message);
+=09=09=09RunMainLoop();
+=09=09}
+=09=09
 =09=09static string fileToOpen =3D String.Empty;
 =09=09
 =09=09static void RunMainLoop ()

------=_Part_584_8422080.1110498391735--