[PC-BSD Commits] r11965 - pcbsd/current/src-qt4/pc-systemupdatertray

svn at pcbsd.org svn at pcbsd.org
Mon Aug 8 09:35:02 PDT 2011


Author: kris
Date: 2011-08-08 09:35:02 -0700 (Mon, 08 Aug 2011)
New Revision: 11965

Modified:
   pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.cpp
   pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.h
   pcbsd/current/src-qt4/pc-systemupdatertray/main.cpp
   pcbsd/current/src-qt4/pc-systemupdatertray/pc-systemupdatertray.pro
   pcbsd/current/src-qt4/pc-systemupdatertray/pcbsdpbu.desktop
Log:

Convert system-updater tray to QtSingleApp, rename System -> icon



Modified: pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.cpp	2011-08-08 16:01:27 UTC (rev 11964)
+++ pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.cpp	2011-08-08 16:35:02 UTC (rev 11965)
@@ -636,3 +636,8 @@
 	trayIcon->showMessage(tr("Software Updates Available"), tr("Software updates are available. Click here to install them!"), QSystemTrayIcon::Warning);
         connect( trayIcon, SIGNAL(messageClicked()), this, SLOT(slotOpenSoftwareManager()) );
 }
+
+void UpdaterTray::slotSingleInstance()
+{
+  trayIcon->show();
+}

Modified: pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.h
===================================================================
--- pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.h	2011-08-08 16:01:27 UTC (rev 11964)
+++ pcbsd/current/src-qt4/pc-systemupdatertray/UpdaterTray.h	2011-08-08 16:35:02 UTC (rev 11965)
@@ -24,6 +24,9 @@
    void programInit();
    
    virtual ~UpdaterTray() {};
+
+public slots:
+    void slotSingleInstance();
    
 private slots:
    void contextMenuRefresh();

Modified: pcbsd/current/src-qt4/pc-systemupdatertray/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-systemupdatertray/main.cpp	2011-08-08 16:01:27 UTC (rev 11964)
+++ pcbsd/current/src-qt4/pc-systemupdatertray/main.cpp	2011-08-08 16:35:02 UTC (rev 11965)
@@ -8,13 +8,16 @@
 #include <QApplication>
 #include <QMessageBox>
 #include <QtGui>
+#include <qtsingleapplication.h>
 
 #include "UpdaterTray.h"
 #include "../config.h"
 
 int  main(int argc, char ** argv)
 {
-   QApplication a(argc, argv);
+   QtSingleApplication a(argc, argv);
+   if ( a.isRunning() )
+     return !(a.sendMessage("show"));
 
    QTranslator translator;
    QLocale mylocale;
@@ -31,6 +34,8 @@
    QApplication::setQuitOnLastWindowClosed(false);
 
    // Init our program
+   QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &tray, SLOT(slotSingleInstance()) );
+
    tray.programInit();
    return  a.exec();
 }

Modified: pcbsd/current/src-qt4/pc-systemupdatertray/pc-systemupdatertray.pro
===================================================================
--- pcbsd/current/src-qt4/pc-systemupdatertray/pc-systemupdatertray.pro	2011-08-08 16:01:27 UTC (rev 11964)
+++ pcbsd/current/src-qt4/pc-systemupdatertray/pc-systemupdatertray.pro	2011-08-08 16:35:02 UTC (rev 11965)
@@ -3,6 +3,8 @@
 
 CONFIG	+= qt warn_on release
 
+LIBS    += -lQtSolutions_SingleApplication-head
+
 HEADERS	+= UpdaterTray.h
 
 SOURCES	+= main.cpp UpdaterTray.cpp

Modified: pcbsd/current/src-qt4/pc-systemupdatertray/pcbsdpbu.desktop
===================================================================
--- pcbsd/current/src-qt4/pc-systemupdatertray/pcbsdpbu.desktop	2011-08-08 16:01:27 UTC (rev 11964)
+++ pcbsd/current/src-qt4/pc-systemupdatertray/pcbsdpbu.desktop	2011-08-08 16:35:02 UTC (rev 11965)
@@ -3,33 +3,5 @@
 Exec=pc-systemupdatertray
 Icon=preferences-desktop-notification
 Type=Application
-
-
 Categories=System;
-Name=Online Update Notifier
-Name[bn]=à¦
নলাইন আপডেট ম্যানেজার
-Name[ca]=Notificació d'actualitzacions en línia
-Name[da]=Bedsked om online opdatering
-Name[en_GB]=Online Update Notifier
-Name[en_ZA]=Online Update Notifier
-Name[es]=Notificador de actualizaciones
-Name[fr]=Notification des mises-à-jour (en ligne)
-Name[hr]=Online obavješivač ažuriranja
-Name[hu]=Online frissítésértesítő
-Name[id]=Pemberitahu Pembaruan Online
-Name[it]=Notifiche Aggiornamenti
-Name[ja]=オンラインアップデートの通知
-Name[lt]=Internetinė atnaujinimų tvarkytuvė
-Name[lv]=Tieðsaistes Atjauninâjumu menedþeris
-Name[mn]=Системийг Онлайнаар Шинэчлэгч
-Name[nl]=Online Update Notifier
-Name[pl]=Powiadamianie o aktualizacjach online
-Name[pt]=Actualização do sistema
-Name[pt_BR]=Notificar Atualização Online
-Name[ru]=Напоминание онлайн обновлений
-Name[sk]=Online notifikácia aktualizácie
-Name[sl]=Obveščevalnik o posodobitvah
-Name[tr]=Çevrimiçi Güncelleme Bildiricisi
-Name[uk]=Нотифікація онлайн оновлень
-Name[zh_CN]=在線升級
-Name[zh_TW]=線上更新通知
+Name=Update Manager Tray



More information about the Commits mailing list