[PC-BSD Commits] r20406 - in users/ken/Lumina-DE: . optional-utilities src/subclasses

svn at pcbsd.org svn at pcbsd.org
Wed Dec 5 08:53:45 PST 2012


Author: kenmoore
Date: 2012-12-05 16:53:45 +0000 (Wed, 05 Dec 2012)
New Revision: 20406

Added:
   users/ken/Lumina-DE/REQUIRED.txt
   users/ken/Lumina-DE/optional-utilities/l-terminal/
Modified:
   users/ken/Lumina-DE/src/subclasses/LSplashScreen.cpp
   users/ken/Lumina-DE/src/subclasses/LSplashScreen.h
Log:
Make the LSplashScreen class a bit more flexible while I am thinking about it.



Modified: users/ken/Lumina-DE/src/subclasses/LSplashScreen.cpp
===================================================================
--- users/ken/Lumina-DE/src/subclasses/LSplashScreen.cpp	2012-12-05 16:23:01 UTC (rev 20405)
+++ users/ken/Lumina-DE/src/subclasses/LSplashScreen.cpp	2012-12-05 16:53:45 UTC (rev 20406)
@@ -2,20 +2,42 @@
 
 LSplashScreen::LSplashScreen(QWidget* parent) : QSplashScreen(parent,QPixmap(""),Qt::WindowStaysOnTopHint)
 {
-  //Load the images to use as the loading screen(s)
-  screenList << QPixmap(":resources/loadingscreen1");
-  //screenList << QPixmap(":resources/loadingscreen2");
   //Set the current Screen
-  currentScreen = 0;
-  this->setPixmap(screenList[currentScreen]);	
+  currentScreen = -1;
 }
 
 void LSplashScreen::nextScreen(){
-  currentScreen++;
-  if( currentScreen < screenList.length() ){
-    this->setPixmap(screenList[currentScreen]);
+  if(currentScreen == -1){
+    qDebug() << "[LSplashScreen] Cannot transition to the next screen when it has not been started yet!";
   }else{
-    qDebug() << "Cannot change splash screen: no more available";
-    qDebug() << "  - additional screens needed:" << (currentScreen-screenList.length()+1);
+    currentScreen++;
+    if( currentScreen < screenList.length() ){
+      this->setPixmap(screenList[currentScreen]);
+    }else{
+      qDebug() << "[LSplashScreen] Cannot change splash screen: no more available";
+      qDebug() << "  - additional screens needed:" << (currentScreen-screenList.length()+1);
+    }
   }
-}
\ No newline at end of file
+}
+
+void LSplashScreen::setImages(QStringList files){
+  screenList.clear();
+  for(int i=0; i<files.length(); i++){
+    if( QFile::exists(files[i]) ){ screenList << files[i]; } //only add the file to the list if it exists
+    else{ qDebug() << "[LSplashScreen] Desired splash screen file does not exist:" << files[i]; }
+  }
+	
+}
+
+void LSplashScreen::start(){
+  //only start the splashscreen if there are images to display
+  if(screenList.length() > 0){ 
+    currentScreen = 0;
+    this->setPixmap(screenList[currentScreen]); 
+    this->show();  //start up the QSplashScreen
+  }
+}
+
+void LSplashScreen::closeOnOpen(QWidget *window){
+  this->finish(window); //Use the inherent 
+}

Modified: users/ken/Lumina-DE/src/subclasses/LSplashScreen.h
===================================================================
--- users/ken/Lumina-DE/src/subclasses/LSplashScreen.h	2012-12-05 16:23:01 UTC (rev 20405)
+++ users/ken/Lumina-DE/src/subclasses/LSplashScreen.h	2012-12-05 16:53:45 UTC (rev 20406)
@@ -4,6 +4,10 @@
 #include <QSplashScreen>
 #include <QList>
 #include <QPixmap>
+#include <QFile>
+#include <QStringList>
+#include <QString>
+#include <QWidget>
 #include <QDebug>
 
 
@@ -21,6 +25,9 @@
 
   public slots:
 	void nextScreen();
+	void setImages(QStringList files);
+        void start();
+        void closeOnOpen(QWidget* window);
 
 };
 #endif



More information about the Commits mailing list