aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop')
-rw-r--r--lumina-desktop/BootSplash.cpp55
-rw-r--r--lumina-desktop/BootSplash.h29
-rw-r--r--lumina-desktop/BootSplash.ui89
-rw-r--r--lumina-desktop/LSession.cpp11
-rw-r--r--lumina-desktop/lumina-desktop.pro3
5 files changed, 187 insertions, 0 deletions
diff --git a/lumina-desktop/BootSplash.cpp b/lumina-desktop/BootSplash.cpp
new file mode 100644
index 00000000..93180e5b
--- /dev/null
+++ b/lumina-desktop/BootSplash.cpp
@@ -0,0 +1,55 @@
+#include "BootSplash.h"
+#include "ui_BootSplash.h"
+
+#include <LuminaXDG.h>
+
+BootSplash::BootSplash() : QWidget(0, Qt::SplashScreen | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus), ui(new Ui::BootSplash){
+ ui->setupUi(this);
+ this->setObjectName("LuminaBootSplash"); //for theme styling
+ //Center the window on the primary screen
+ QPoint ctr = QApplication::desktop()->screenGeometry().center();
+ this->move( ctr.x()-(this->width()/2), ctr.y()-(this->height()/2) );
+}
+
+void BootSplash::showScreen(QString loading){ //update icon, text, and progress
+ QString txt, icon;
+ int per = 0;
+ if(loading=="init"){
+ txt = tr("Initializing Session..."); per = 11;
+ icon = "preferences-system-login";
+ }else if(loading=="settings"){
+ txt = tr("Loading Settings..."); per = 22;
+ icon = "user-home";
+ }else if(loading=="user"){
+ txt = tr("Checking User Settings..."); per = 33;
+ icon = "preferences-desktop-user";
+ }else if(loading=="systray"){
+ txt = tr("Registering System Tray..."); per = 44;
+ icon = "preferences-plugin";
+ }else if(loading=="wm"){
+ txt = tr("Starting Window Manager..."); per = 55;
+ icon = "preferences-system-windows-actions";
+ }else if(loading=="desktop"){
+ txt = tr("Initializing Desktop(s)..."); per = 66;
+ icon = "preferences-desktop-wallpaper";
+ }else if(loading=="menus"){
+ txt = tr("Initializing System Menu(s)..."); per = 77;
+ icon = "preferences-system-windows";
+ }else if(loading=="final"){
+ txt = tr("Performing Final Checks..."); per = 90;
+ icon = "pcbsd";
+ }
+ ui->progressBar->setValue(per);
+ ui->label_text->setText(txt);
+ ui->label_icon->setPixmap( LXDG::findIcon(icon, "Lumina-DE").pixmap(64,64) );
+ this->show();
+ this->update();
+ QApplication::processEvents();
+}
+
+void BootSplash::showText(QString txt){ //will only update the text, not the icon/progress
+ ui->label_text->setText(txt);
+ this->show();
+ this->update();
+ QApplication::processEvents();
+} \ No newline at end of file
diff --git a/lumina-desktop/BootSplash.h b/lumina-desktop/BootSplash.h
new file mode 100644
index 00000000..f5bf97a8
--- /dev/null
+++ b/lumina-desktop/BootSplash.h
@@ -0,0 +1,29 @@
+#ifndef _LUMINA_DESKTOP_BOOT_SPLASHSCREEN_H
+#define _LUMINA_DESKTOP_BOOT_SPLASHSCREEN_H
+
+#include <QWidget>
+#include <QLabel>
+#include <QProgressBar>
+#include <QPixmap>
+#include <QPoint>
+#include <QApplication>
+#include <QDesktopWidget>
+
+namespace Ui{
+ class BootSplash;
+};
+
+class BootSplash : public QWidget{
+ Q_OBJECT
+private:
+ Ui::BootSplash *ui;
+
+public:
+ BootSplash();
+ ~BootSplash(){}
+
+ void showScreen(QString loading); //update icon, text, and progress
+ void showText(QString txt); //will only update the text, not the icon/progress
+};
+
+#endif \ No newline at end of file
diff --git a/lumina-desktop/BootSplash.ui b/lumina-desktop/BootSplash.ui
new file mode 100644
index 00000000..867b658c
--- /dev/null
+++ b/lumina-desktop/BootSplash.ui
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BootSplash</class>
+ <widget class="QWidget" name="BootSplash">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>280</width>
+ <height>127</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="4">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_icon">
+ <property name="minimumSize">
+ <size>
+ <width>64</width>
+ <height>64</height>
+ </size>
+ </property>
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" rowspan="2">
+ <widget class="QProgressBar" name="progressBar">
+ <property name="value">
+ <number>0</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="format">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" colspan="4">
+ <widget class="QLabel" name="label_text">
+ <property name="text">
+ <string notr="true">Some loading message</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index e1eac520..b204b0a8 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -9,6 +9,7 @@
#include <QTime>
#include "LXcbEventFilter.h"
+#include "BootSplash.h"
//LibLumina X11 class
#include <LuminaX11.h>
@@ -75,6 +76,8 @@ LSession::~LSession(){
}
void LSession::setupSession(){
+ BootSplash splash;
+ splash.showScreen("init");
qDebug() << "Initializing Session";
if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); }
QTime* timer = 0;
@@ -82,10 +85,12 @@ void LSession::setupSession(){
//Seed random number generator (if needed)
qsrand( QTime::currentTime().msec() );
//Setup the QSettings default paths
+ splash.showScreen("settings");
if(DEBUG){ qDebug() << " - Init QSettings:" << timer->elapsed();}
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
sessionsettings = new QSettings("LuminaDE", "sessionsettings");
//Setup the user's lumina settings directory as necessary
+ splash.showScreen("user");
if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();}
checkUserFiles(); //adds these files to the watcher as well
@@ -93,20 +98,24 @@ void LSession::setupSession(){
DESKTOPS.clear();
//Start the background system tray
+ splash.showScreen("systray");
if(DEBUG){ qDebug() << " - Init System Tray:" << timer->elapsed();}
startSystemTray();
//Launch Fluxbox
+ splash.showScreen("wm");
if(DEBUG){ qDebug() << " - Init WM:" << timer->elapsed();}
WM = new WMProcess();
WM->startWM();
//Initialize the desktops
+ splash.showScreen("desktop");
if(DEBUG){ qDebug() << " - Init Desktops:" << timer->elapsed();}
updateDesktops();
//Initialize the global menus
qDebug() << " - Initialize system menus";
+ splash.showScreen("menus");
if(DEBUG){ qDebug() << " - Init AppMenu:" << timer->elapsed();}
appmenu = new AppMenu();
if(DEBUG){ qDebug() << " - Init SettingsMenu:" << timer->elapsed();}
@@ -115,6 +124,7 @@ void LSession::setupSession(){
sysWindow = new SystemWindow();
//Now setup the system watcher for changes
+ splash.showScreen("final");
qDebug() << " - Initialize file system watcher";
if(DEBUG){ qDebug() << " - Init QFileSystemWatcher:" << timer->elapsed();}
watcher = new QFileSystemWatcher(this);
@@ -131,6 +141,7 @@ void LSession::setupSession(){
connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) );
if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;}
QTimer::singleShot(3000, this, SLOT(launchStartupApps()) ); //startup these processes in 3 seconds
+ splash.close();
}
void LSession::CleanupSession(){
diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro
index 6c3ee0cc..d0f02b65 100644
--- a/lumina-desktop/lumina-desktop.pro
+++ b/lumina-desktop/lumina-desktop.pro
@@ -35,6 +35,7 @@ SOURCES += main.cpp \
AppMenu.cpp \
SettingsMenu.cpp \
SystemWindow.cpp \
+ BootSplash.cpp \
panel-plugins/userbutton/LUserButton.cpp \
panel-plugins/userbutton/UserWidget.cpp \
panel-plugins/userbutton/UserItemWidget.cpp \
@@ -68,6 +69,7 @@ HEADERS += Globals.h \
AppMenu.h \
SettingsMenu.h \
SystemWindow.h \
+ BootSplash.h \
panel-plugins/LPPlugin.h \
panel-plugins/NewPP.h \
panel-plugins/LTBWidget.h \
@@ -100,6 +102,7 @@ HEADERS += Globals.h \
# desktop-plugins/messagecenter/MessageCenter.h
FORMS += SystemWindow.ui \
+ BootSplash.ui \
panel-plugins/userbutton/UserWidget.ui \
panel-plugins/systemdashboard/SysMenuQuick.ui \
desktop-plugins/audioplayer/PlayerWidget.ui
bgstack15