[Uml-devel] kdesdk/umbrello/umbrello

Jonathan Riddell jri at jriddell.org
Wed Feb 12 14:46:08 UTC 2003


CVS commit by jriddell: 

statup logo no longer delays startup for 2 seconds with sleep(2)


  M +14 -2     kstartuplogo.cpp   1.3
  M +7 -3      kstartuplogo.h   1.2
  M +5 -4      main.cpp   1.2
  M +0 -7      tips   1.2


--- kdesdk/umbrello/umbrello/kstartuplogo.cpp  #1.2:1.3
@@ -11,4 +11,5 @@
 #include <kapp.h>
 #include <kstddirs.h>
+#include <qtimer.h>
 
 KStartupLogo::KStartupLogo(QWidget * parent, const char *name)
@@ -24,7 +25,13 @@ KStartupLogo::KStartupLogo(QWidget * par
                     QApplication::desktop()->height()/2-pm.height()/2,
                     pm.width(),pm.height());
+
+        timer = new QTimer(this);
+        connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) );
+        timer->start(2000, true);
 }
 
-KStartupLogo::~KStartupLogo() {}
+KStartupLogo::~KStartupLogo() {
+        delete timer;
+}
 
 void KStartupLogo::mousePressEvent( QMouseEvent*) {
@@ -34,5 +41,10 @@ void KStartupLogo::mousePressEvent( QMou
 }
 
+void KStartupLogo::timerDone() {
+        this->close();
+}
 
-
+void KStartupLogo::setHideEnabled(bool bEnabled) {
+        m_bReadyToHide = bEnabled;
+}
 #include "kstartuplogo.moc"

--- kdesdk/umbrello/umbrello/kstartuplogo.h  #1.1:1.2
@@ -31,10 +31,14 @@ public:
         KStartupLogo(QWidget *parent=0, const char *name=0);
         ~KStartupLogo();
-        void setHideEnabled(bool bEnabled) {
-                m_bReadyToHide = bEnabled;
-        };
+        void setHideEnabled(bool bEnabled);
+
 protected:
         virtual void mousePressEvent( QMouseEvent*);
         bool m_bReadyToHide;
+        QTimer* timer;
+
+public slots:
+        void timerDone();
+
 };
 

--- kdesdk/umbrello/umbrello/main.cpp  #1.1:1.2
@@ -51,12 +51,10 @@ int main(int argc, char *argv[]) {
                 cfg -> setGroup( "General Options" );
                 bool showLogo = cfg -> readBoolEntry( "logo", true );
-                if( showLogo ) {
+                if (showLogo) {
                         start_logo = new KStartupLogo();
-                        start_logo -> setHideEnabled( true );
+                        start_logo->setHideEnabled(true);
                         start_logo->show();
                         start_logo->raise();
                         QApplication::flushX();
-                        sleep(2);
-                        delete start_logo;
                 }
                 uml->show();
@@ -79,4 +77,7 @@ int main(int argc, char *argv[]) {
                                 uml->newDocument();
                         }
+                }
+                if (showLogo) {
+                        start_logo->raise();
                 }
         }

--- kdesdk/umbrello/umbrello/tips  #1.1:1.2
@@ -22,11 +22,4 @@
 <tip category="Umbrello">
 <html>
-<p>Turning off the splash screen in Settings->Configure Umbrello->Startup Logo 
-saves 2 seconds off the startup time.</p>
-</html>
-</tip>
-
-<tip category="Umbrello">
-<html>
 <p>The vertical lines in sequence diagrams can be resized.  Just click at the bottom of
 one and drag up or down.</p>






More information about the umbrello-devel mailing list