[PC-BSD Commits] r17706 - in pcbsd-projects/PCDE: . images

svn at pcbsd.org svn at pcbsd.org
Tue Jul 10 16:47:47 PDT 2012


Author: kenmoore
Date: 2012-07-10 23:47:47 +0000 (Tue, 10 Jul 2012)
New Revision: 17706

Added:
   pcbsd-projects/PCDE/images/banner.png
   pcbsd-projects/PCDE/images/desktop.png
   pcbsd-projects/PCDE/images/splash.png
   pcbsd-projects/PCDE/images/system.png
   pcbsd-projects/PCDE/pcde-themes.cpp
   pcbsd-projects/PCDE/pcde-themes.h
   pcbsd-projects/PCDE/pcde.conf
   pcbsd-projects/PCDE/sample.pcde-theme
Removed:
   pcbsd-projects/PCDE/images/freebsd.png
   pcbsd-projects/PCDE/images/pcbsd-banner.png
Modified:
   pcbsd-projects/PCDE/PCDE.qrc
   pcbsd-projects/PCDE/main.cpp
Log:
Add sample PCDE configuration and theme files, as well as the beginnings of the Theme class to read and utilize the theme file when creating the UI.



Modified: pcbsd-projects/PCDE/PCDE.qrc
===================================================================
--- pcbsd-projects/PCDE/PCDE.qrc	2012-07-10 19:55:34 UTC (rev 17705)
+++ pcbsd-projects/PCDE/PCDE.qrc	2012-07-10 23:47:47 UTC (rev 17706)
@@ -1,10 +1,10 @@
 <RCC>
-  <qresource prefix="defaults">
-    <file>images/pcbsd-banner.png</file>
+  <qresource prefix="">
+    <file>images/banner.png</file>
     <file>images/backgroundimage.jpg</file>
-    <file>images/freebsd.png</file>
-  </qresource>
-  <qresource prefix="icons">
+    <file>images/system.png</file>
+    <file>images/splash.png</file>
+    <file>images/desktop.png</file>
     <file>images/user.png</file>
     <file>images/password.png</file>
     <file>images/language.png</file>

Modified: pcbsd-projects/PCDE/main.cpp
===================================================================
--- pcbsd-projects/PCDE/main.cpp	2012-07-10 19:55:34 UTC (rev 17705)
+++ pcbsd-projects/PCDE/main.cpp	2012-07-10 23:47:47 UTC (rev 17706)
@@ -5,28 +5,33 @@
 #include <QFile>
 #include <QSplashScreen>
 
-#include "installer.h"
-#include "backend.h"
+#include "pcde-themes.h"
+#include "pcde-gui.h"
+#include "pcde-backend.h"
 
 int main(int argc, char *argv[])
 {
     int returnCode;
     QString changeLang;
 
-    // Start a loop to watch for language changes
-    for ( ;; )
-    {
-      QApplication a(argc, argv);
-
       // Check what directory our app is in
       QString appDir;
-      if ( QFile::exists("/usr/local/bin/PCDE") )
-      {
-        appDir = "/usr/local/share/pcbsd";
+      if ( QFile::exists("/usr/local/bin/PCDE") ){
+        appDir = "/usr/local/share/PCDE";
       } else {
         appDir = QCoreApplication::applicationDirPath();
       }
 
+    //Load the configuration file
+    Config::loadConfiguration(appDir+"/pcde.conf");
+    //Load the Desired Theme
+    Theme::loadTheme(Config::themeFile());
+
+    // Start a loop to watch for language changes
+    for ( ;; )
+    {
+      QApplication a(argc, argv);
+
       QTranslator translator;
       QLocale mylocale;
       QString langCode = mylocale.name();
@@ -44,20 +49,34 @@
       }
 
       // Show our splash screen, so the user doesn't freak that that it takes a few seconds to show up
-      QPixmap pixmap(":/PCBSD/images/pcbsdheader.png");
+      QPixmap pixmap(); //create an empty pixmap
+      if(Theme::useSplashscreen()){
+        pixmap = new QPixmap(Theme::splashscreen()); //load the splashscreen file
+      }
       QSplashScreen splash(pixmap);
       splash.show();
 
 
       PCDEgui w;
 
+      //Set the proper size on the Application
+      if(Theme::isFullScreen()){
+        w.setWindowFlags(w.windowFlags() ^Qt::WindowSoftkeysVisibleHint);
+        w.showFullScreen();
+      }else{
+        //Get the screen and desired geometries
+        QRect dimensions = QApplication::desktop()->screenGeometry();
+        int wid = dimensions.width();     // returns desktop width
+        int hig = dimensions.height();    // returns desktop height
+        int thHig = Theme::windowSize("height"); // desired height
+        int thWid = Theme::windowSize("width");  //desired width
+        //Sanity check the desired geometry versus the actual screen resolution
+        if(thHig > hig){ thHig = hig; }
+	if(thWid > wid){ thWid = wid; }
+        // Center the Application
+        w.setGeometry((wid/2) - (thWid/2), (hig/2) - (thHig/2), thWid, thHig);
+      }
 
-      // Center the installer
-      QRect dimensions = QApplication::desktop()->screenGeometry();
-      int wid = dimensions.width();     // returns desktop width
-      int hig = dimensions.height();    // returns desktop height
-      w.setGeometry((wid/2) - (650/2), (hig/2) - (435/2), 650, 435);
-
       // Start the init
       w.progInit();
 



More information about the Commits mailing list