diff options
author | Ken Moore <ken@ixsystems.com> | 2016-12-01 10:33:19 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-12-01 10:33:19 -0500 |
commit | f7b894621578f5b54b3da9a3291586cee503c2d9 (patch) | |
tree | 1c68d19d5be77c22b56f99f6e1d440760bad5dac /src-qt5/core/lumina-desktop/BootSplash.cpp | |
parent | Add the Lumina version to the bottom of the boot splash as well. (diff) | |
download | lumina-f7b894621578f5b54b3da9a3291586cee503c2d9.tar.gz lumina-f7b894621578f5b54b3da9a3291586cee503c2d9.tar.bz2 lumina-f7b894621578f5b54b3da9a3291586cee503c2d9.zip |
Get rid of the "fortune" usage, and replace it with a built-in system of tips for Lumina itself (avoids strange stuff from fortune, and ensures information which is at least semi-useful for the user).
Diffstat (limited to 'src-qt5/core/lumina-desktop/BootSplash.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/BootSplash.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop/BootSplash.cpp b/src-qt5/core/lumina-desktop/BootSplash.cpp index f7981670..f6c4c5fa 100644 --- a/src-qt5/core/lumina-desktop/BootSplash.cpp +++ b/src-qt5/core/lumina-desktop/BootSplash.cpp @@ -11,14 +11,32 @@ BootSplash::BootSplash() : QWidget(0, Qt::SplashScreen | Qt::X11BypassWindowMana //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) ); - if(LUtils::isValidBinary("fortune")){ - QString random = LUtils::getCmdOutput("fortune -s").join("\n").simplified(); - if(random.endsWith("\n")){ random.chop(1); } - ui->label_welcome->setText( "\""+random+"\"" ); - } + generateTipOfTheDay(); ui->label_version->setText( QString(tr("Version %1")).arg(LDesktopUtils::LuminaDesktopVersion()) ); } +void BootSplash::generateTipOfTheDay(){ + int index = qrand()%5; //Make sure this number matches the length of the case below (max value +1) + QString tip = "This desktop is generously sponsored by iXsystems\nwww.ixsystems.com"; //fallback message (just in case) + switch(index){ + case 0: + tip = tr("This desktop is powered by coffee, coffee, and more coffee."); break; + case 1: + tip = tr("Keep up with desktop news!")+"\n\nwww.lumina-desktop.org"; break; + case 2: + tip = tr("There is a full handbook of information about the desktop available online.")+"\n\nwww.lumina-desktop.org/handbook"; break; + case 3: + tip = tr("Want to change the interface? Everything is customizable in the desktop configuration!"); break; + case 4: + tip = tr("Lumina can easily reproduce the interface from most other desktop environments."); break; + case 5: + tip = tr(""); break; + case 6: + tip = tr(""); break; + } + ui->label_welcome->setText( "\""+tip+"\"" ); +} + void BootSplash::showScreen(QString loading){ //update icon, text, and progress QString txt, icon; int per = 0; |