diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-29 16:35:25 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-29 16:35:25 +0200 |
commit | e77e01d40232e129902d0f9fade49bf81ef082ae (patch) | |
tree | f7226c961c4a02ffe0ed12e08e87e2cc362fea26 /facetracknoir | |
parent | 6742c131815df55b69682b0ad04621d1a5814333 (diff) |
Remove tray functionality
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 80 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.h | 14 |
2 files changed, 1 insertions, 93 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index ba21d1de..eeff25ec 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -184,8 +184,6 @@ FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WFlags flags) : pSecondTrackerDialog(NULL),
pProtocolDialog(NULL),
pFilterDialog(NULL),
- trayIcon(NULL),
- trayIconMenu(NULL),
#if defined(__WIN32) || defined(_WIN32)
keybindingWorker(NULL),
#endif
@@ -207,7 +205,6 @@ FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WFlags flags) : _curve_config = 0;
tracker = 0;
- trayIcon = 0;
setupFaceTrackNoIR();
@@ -281,18 +278,10 @@ void FaceTrackNoIR::setupFaceTrackNoIR() { //Create the system-tray and connect the events for that.
createIconGroupBox();
- createActions();
- createTrayIcon();
- if (trayIcon)
- connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
-
- //Load the tracker-settings, from the INI-file
+ //Load the tracker-settings, from the INI-file
loadSettings();
- if (trayIcon)
- trayIcon->show();
-
connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int)));
connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int)));
connect(ui.iconcomboTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int)));
@@ -1123,62 +1112,6 @@ void FaceTrackNoIR::createIconGroupBox() }
//
-// Create the Actions in the System tray and connect them to Application events
-//
-void FaceTrackNoIR::createActions()
-{
- minimizeAction = new QAction(tr("Mi&nimize FaceTrackNoIR"), this);
- connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
-
- //maximizeAction = new QAction(tr("Ma&ximize"), this);
- //connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
-
- restoreAction = new QAction(tr("&Restore FaceTrackNoIR"), this);
- connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
-
- quitAction = new QAction(tr("&Quit FaceTrackNoIR"), this);
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
-}
-
-//
-// Create the SystemTray and set the default Icon
-//
-void FaceTrackNoIR::createTrayIcon()
-{
- if (QSystemTrayIcon::isSystemTrayAvailable()) {
- trayIconMenu = new QMenu(this);
- trayIconMenu->addAction(minimizeAction);
- trayIconMenu->addAction(restoreAction);
- trayIconMenu->addSeparator();
- trayIconMenu->addAction(quitAction);
-
- trayIcon = new QSystemTrayIcon(this);
- trayIcon->setContextMenu(trayIconMenu);
-
- //trayIcon->setIcon(QIcon(QCoreApplication::applicationDirPath() + "/images/FaceTrackNoIR.png"));
- }
-}
-
-//
-// Handle SystemTray events
-//
-void FaceTrackNoIR::iconActivated(QSystemTrayIcon::ActivationReason reason)
-{
- switch (reason) {
- case QSystemTrayIcon::Trigger:
- case QSystemTrayIcon::DoubleClick:
- //ui.iconcomboProtocol->setCurrentIndex((ui.iconcomboProtocol->currentIndex() + 1)
- // % ui.iconcomboProtocol->count());
- break;
- ////case QSystemTrayIcon::MiddleClick:
- //// showMessage();
- //// break;
- default:
- ;
- }
- }
-
-//
// Handle changes of the Protocol selection
//
void FaceTrackNoIR::protocolSelected(int index)
@@ -1186,17 +1119,6 @@ void FaceTrackNoIR::protocolSelected(int index) settingsDirty = true;
ui.btnShowServerControls->setEnabled ( true );
- //
- // Set the Icon for the tray and update the Icon for the Settings button.
- //
- QIcon icon = ui.iconcomboProtocol->itemIcon(index);
- if (trayIcon != 0) {
- trayIcon->setIcon(icon);
- trayIcon->setToolTip(ui.iconcomboProtocol->itemText(index));
- trayIcon->show();
- QApplication::sendPostedEvents(trayIcon, QEventLoop::AllEvents);
- trayIcon->showMessage( "FaceTrackNoIR", ui.iconcomboProtocol->itemText(index));
- }
//setWindowIcon(QIcon(":/images/FaceTrackNoIR.png"));
//breaks with transparency -sh
//ui.btnShowServerControls->setIcon(icon);]
diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/facetracknoir.h index 7a179bd4..b2f1ea27 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/facetracknoir.h @@ -142,21 +142,8 @@ private: QWidget *_keyboard_shortcuts;
QWidget *_curve_config;
- /** QT objects **/
- QDialog aboutDialog;
- QDesktopWidget desktop;
-
- QAction *minimizeAction;
- QAction *restoreAction;
- QAction *quitAction;
-
- QSystemTrayIcon *trayIcon;
- QMenu *trayIconMenu;
-
void createIconGroupBox();
// void createMessageGroupBox();
- void createActions();
- void createTrayIcon();
/** helper **/
bool cameraDetected;
@@ -179,7 +166,6 @@ private: void saveAs();
void exit();
// void setIcon(int index);
- void iconActivated(QSystemTrayIcon::ActivationReason reason);
void profileSelected(int index);
void protocolSelected(int index);
void filterSelected(int index);
|