Ejemplo n.º 1
0
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 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();
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
	int err;

	QApplication app(argc, argv);
	err = setup_signal_handlers();
	if (err) {
		cerr << "Failed to initilize signal handlers" << endl;
		return 1;
	}
	if (!waitForSystray())
		return 1;
	TrayIcon icon;
	icon.show();
	if (!icon.init())
		return 1;
	return app.exec();
}