aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/experimental/lumina-terminal/main.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-04-27 23:48:24 -0400
committerKen Moore <ken@ixsystems.com>2017-04-27 23:48:24 -0400
commit8eba2f4ad58f6f9cc087e544e5f69a3285a99f10 (patch)
treee17acae30ebd4ca46d93b9589947202b8d8be8c1 /src-qt5/experimental/lumina-terminal/main.cpp
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-8eba2f4ad58f6f9cc087e544e5f69a3285a99f10.tar.gz
lumina-8eba2f4ad58f6f9cc087e544e5f69a3285a99f10.tar.bz2
lumina-8eba2f4ad58f6f9cc087e544e5f69a3285a99f10.zip
Move the unfinished utilities in Lumina over to an "experimental" directory.
Diffstat (limited to 'src-qt5/experimental/lumina-terminal/main.cpp')
-rw-r--r--src-qt5/experimental/lumina-terminal/main.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src-qt5/experimental/lumina-terminal/main.cpp b/src-qt5/experimental/lumina-terminal/main.cpp
new file mode 100644
index 00000000..a316ff35
--- /dev/null
+++ b/src-qt5/experimental/lumina-terminal/main.cpp
@@ -0,0 +1,47 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2015, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include <QSystemTrayIcon>
+#include <QDebug>
+
+#include <LuminaSingleApplication.h>
+#include <LuminaThemes.h>
+
+#include <unistd.h>
+
+#include "TrayIcon.h"
+int main(int argc, char *argv[]) {
+ LTHEME::LoadCustomEnvSettings();
+ LSingleApplication a(argc, argv, "lumina-terminal");
+ if( !a.isPrimaryProcess() ){ return 0; } //poked the current process instead
+
+ //First make sure a system tray is available
+ qDebug() << "Checking for system tray";
+ bool ready = false;
+ for(int i=0; i<60 && !ready; i++){
+ ready = QSystemTrayIcon::isSystemTrayAvailable();
+ if(!ready){
+ //Pause for 5 seconds
+ sleep(5); //don't worry about stopping event handling - nothing really running yet
+ }
+ }
+ if(!ready){
+ qDebug() << "Could not find any available system tray after 5 minutes: exiting....";
+ return 1;
+ }
+
+ //Now go ahead and setup the app
+ //LuminaThemeEngine theme(&a);
+ QApplication::setQuitOnLastWindowClosed(false);
+
+ //Now start the tray icon
+ TrayIcon tray;
+ QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &tray, SLOT(slotSingleInstance(QStringList)) );
+ //QObject::connect(&theme, SIGNAL(updateIcons()), &tray, SLOT(updateIcons()) );
+ tray.parseInputs(a.inputlist);
+ tray.show();
+ return a.exec();
+}
bgstack15