summaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2015-06-09 00:54:24 +0200
committerAnne Jan Brouwer <brouwer@annejan.com>2015-06-09 00:54:24 +0200
commit783e6b4a6b19223bc54cd99f0101d4131aab7048 (patch)
tree64631057aeed852b33f94dc09f92c3c68953da81 /mainwindow.cpp
parent64898b575f9e7c3b5d4d072fc369a66d2c2397ee (diff)
trying old trayicon code
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 00454f20..e625d124 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -37,6 +37,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->statusBar->showMessage(tr("Welcome to QtPass %1").arg(VERSION), 2000);
firstRun = true;
startupPhase = true;
+
+ initTrayIcon();
}
/**
@@ -1106,3 +1108,18 @@ void MainWindow::on_profileBox_currentIndexChanged(QString name)
ui->treeView->setRootIndex(proxyModel.mapFromSource(model.setRootPath(passStore)));
}
+
+void MainWindow::initTrayIcon()
+{
+ if(QSystemTrayIcon::isSystemTrayAvailable() == true) {
+ // Setup tray icon
+ this->tray = new trayIcon(this);
+ if(tray == NULL){
+ qDebug() << "Allocating tray icon failed.";
+ exit(1);
+ }
+ qDebug() << "Ehm..";
+ } else {
+ qDebug() << "Whut?";
+ }
+}