[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-1/datakiosk/src
From:       Adam Treat <manyoso () yahoo ! com>
Date:       2005-03-30 19:48:06
Message-ID: 20050330194806.17458632 () office ! kde ! org
[Download RAW message or body]

CVS commit by treat: 

* Add a splashscreen for project loading


  M +34 -14    datatablebox.cpp   1.6
  M +5 -3      datatablebox.h   1.4
  M +7 -0      project.cpp   1.18
  M +9 -8      project.h   1.8


--- kdeextragear-1/datakiosk/src/datatablebox.cpp  #1.5:1.6
@@ -17,4 +17,6 @@
 #include <kurldrag.h>
 #include <kmessagebox.h>
+#include <ksplashscreen.h>
+#include <kstandarddirs.h>
 #include <kparts/partmanager.h>
 #include <kpopupmenu.h>
@@ -160,4 +162,13 @@ void DataTableBox::raise( DataReport *da
 void DataTableBox::initialize()
 {
+    QPixmap pm;
+    pm.load( locate( "appdata", "pics/datakiosk-splash.png" ) );
+    KSplashScreen *splash = new KSplashScreen( pm );
+
+    connect( this, SIGNAL( splashMessage( const QString &, int, const QColor & ) ),
+             splash, SLOT( message( const QString &, int, const QColor & ) ) );
+
+    splash->show();
+
     loadConnections();
 
@@ -173,7 +184,7 @@ void DataTableBox::initialize()
         action( "close_project" ) ->setEnabled( true );
         action( "print" ) ->setEnabled( false );
-        return ;
     }
-
+    else
+    {
     action( "edit_project" ) ->setEnabled( false );
     action( "create_datatable" ) ->setEnabled( false );
@@ -183,4 +194,8 @@ void DataTableBox::initialize()
     action( "print" ) ->setEnabled( false );
     emit selectionChanged();
+    }
+
+    splash->finish( this );
+    delete splash;
 }
 
@@ -369,4 +384,9 @@ void DataTableBox::scrollTableDown()
 }
 
+void DataTableBox::setSplashMessage( const QString &txt )
+{
+    emit splashMessage( txt, Qt::AlignRight, QColor( 0, 84, 255 ) );
+}
+
 void DataTableBox::setupDataTable( DataTable *dataTable, const QString &iconName )
 {

--- kdeextragear-1/datakiosk/src/datatablebox.h  #1.3:1.4
@@ -92,4 +92,5 @@ public slots:
 
 protected:
+    virtual void setSplashMessage( const QString &txt );
     virtual void setupDataTable( DataTable *dataTable, const QString &iconName );
     virtual void setupDataTable( DataTable *dataTable, const QString &iconName, Item \
*parentItem ); @@ -105,4 +106,5 @@ signals:
     void searchRemoved();
     void advancedSearchClicked();
+    void splashMessage( const QString &txt, int alignment, const QColor &color );
 
 private:

--- kdeextragear-1/datakiosk/src/project.cpp  #1.17:1.18
@@ -804,4 +804,6 @@ bool Project::loadDataTables()
                 loadDataFieldList( fields, currentDataTable() );
 
+                setSplashMessage( i18n( "Loading table: " ) + dataTableName );
+
                 currentDataTable() ->initialize();
                 addDataTable( currentDataTable() );
@@ -1124,4 +1126,9 @@ void Project::raise( DataReport *dataRep
 }
 
+void Project::setSplashMessage( const QString & )
+{
+    // implemented in subclass
+}
+
 void Project::setupDataTable( DataTable *dataTable, const QString & )
 {

--- kdeextragear-1/datakiosk/src/project.h  #1.7:1.8
@@ -152,4 +152,5 @@ public:
     void deleteRecord();
     
+    virtual void setSplashMessage( const QString &txt );
     virtual void setupDataTable( DataTable *dataTable, const QString &iconName );
     virtual void setupDataTable( DataTable *dataTable, const QString &iconName, \
DataTable* parentTable );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic