From d3cec7b2198761622f444dc5a18db2cc2c7fecfa Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 13 Dec 2016 11:44:35 -0500 Subject: Add new options for the Lumina tips: If a lumina-motd file (executable or text) is found within one of the etc directories (/usr/local/etc/lumina-motd on FreeBSD) or as a valid binary on PATH, then that file will be "preferred" for generating the tips rather than the built-in system. This allows system administrators and/or OS-distributors to customize the login messages "at will" for their particular use-case. NOTE: By making the lumina-motd file a blank text file the tips will be disabled. --- src-qt5/core/lumina-desktop/BootSplash.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/lumina-desktop/BootSplash.cpp b/src-qt5/core/lumina-desktop/BootSplash.cpp index 8903d963..1a648973 100644 --- a/src-qt5/core/lumina-desktop/BootSplash.cpp +++ b/src-qt5/core/lumina-desktop/BootSplash.cpp @@ -16,8 +16,24 @@ BootSplash::BootSplash() : QWidget(0, Qt::SplashScreen | Qt::X11BypassWindowMana } void BootSplash::generateTipOfTheDay(){ - int index = qrand()%46; //Make sure this number matches the length of the case below (max value +1) + //Try to find a system-defined message of the day for lumina + QStringList dirs; dirs << LOS::AppPrefix()+"/etc/" << LOS::SysPrefix()+"/etc/" << L_ETCDIR+"/"; + QString sysMOTD = "lumina-motd"; + for(int i=0; ilabel_welcome->setText( tip); } -- cgit