Here a totally superfluously patch:
a splash screen which shows up while loading LyX. ;)
I've added a parameter which enlarges the time the splash
screen is shown.
Maybe someone has a nice idea for a splash screen picture.
We could also print text on it, something like this
"This is LyX 1.5 alpha! You will die if you rely."
Peter
Index: src/frontends/qt4/QSplash.C
===================================================================
--- src/frontends/qt4/QSplash.C (revision 0)
+++ src/frontends/qt4/QSplash.C (revision 0)
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+/**
+ * \file QSplash.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Peter Kümmel
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include <splash.h>
+#include <support/filetools.h> // LibFileSearch
+#include "qt_helpers.h"
+#include <string>
+
+#include <QSplashScreen.h>
+#include <QTime>
+
+namespace lyx {
+
+QSplashScreen* qsp = 0;
+
+void Splash::init()
+{
+ if (qsp == 0)
+ qsp = new QSplashScreen;
+}
+
+void Splash::show()
+{
+ if (qsp == 0)
+ init();
+ std::string const file = support::libFileSearch("images", "banner",
"ppm");
+ if (file.empty())
+ return;
+
+ QPixmap pm(toqstr(file));
+ qsp->setPixmap(pm);
+ qsp->show();
+}
+
+void Splash::finish(int secs)
+{
+ if (qsp == 0)
+ return;
+ QTime t = QTime::currentTime().addSecs(secs);
+ while (t > QTime::currentTime())
+ {
+ }
+ delete qsp;
+}
+
+
+} // namespace lyx
+
+
Property changes on: src/frontends/qt4/QSplash.C
___________________________________________________________________
Name: svn:eol-style
+ native
Index: src/frontends/qt4/GuiApplication.C
===================================================================
--- src/frontends/qt4/GuiApplication.C (revision 15912)
+++ src/frontends/qt4/GuiApplication.C (working copy)
@@ -13,6 +13,7 @@
#include <config.h>
#include "GuiApplication.h"
+#include "splash.h"
#include "qt_helpers.h"
#include "QLImage.h"
@@ -93,6 +94,10 @@
GuiApplication::GuiApplication(int & argc, char ** argv)
: QApplication(argc, argv), Application(argc, argv)
{
+ // show splashscreen as early as possible:
+ // after the creation of QApplication
+ lyx::Splash::show();
+
#ifdef Q_WS_X11
// doubleClickInterval() is 400 ms on X11 which is just too long.
// On Windows and Mac OS X, the operating system's value is used.
Index: src/splash.h
===================================================================
--- src/splash.h (revision 0)
+++ src/splash.h (revision 0)
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+/**
+ * \file splash.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Peter Kümmel
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef SPLASH_H
+#define SPLASH_H
+
+
+namespace lyx {
+
+struct Splash
+{
+ static void show();
+ static void finish(int secs);
+
+private:
+ static void init();
+};
+
+} // namespace lyx
+
+#endif // SPLASH_H
Property changes on: src/splash.h
___________________________________________________________________
Name: svn:eol-style
+ native
Index: src/lyx_main.C
===================================================================
--- src/lyx_main.C (revision 15912)
+++ src/lyx_main.C (working copy)
@@ -42,6 +42,7 @@
#include "MenuBackend.h"
#include "mover.h"
#include "ToolbarBackend.h"
+#include "splash.h"
#include "frontends/Alert.h"
#include "frontends/Application.h"
@@ -328,6 +329,10 @@
initGuiFont();
// FIXME: this global pointer should probably go.
theApp = pimpl_->application_.get();
+
+ // show the startup banner some more seconds and then delete it
+ lyx::Splash::finish(2);
+
restoreGuiSession(files);
// Start the real execution loop.