1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

check for no systray, fixes #908

cant believe it took this long to figure out ;_;
This commit is contained in:
Dubslow 2014-12-09 14:18:12 -06:00
parent eacef9834f
commit 5cb1b6fe8e
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA

View File

@ -125,7 +125,8 @@ void Widget::init()
} }
else else
{ {
qWarning() << "No system tray detected!"; qWarning() << "Widget: No system tray detected!";
icon = nullptr;
this->show(); this->show();
} }
@ -295,17 +296,19 @@ void Widget::setTranslation()
void Widget::updateTrayIcon() void Widget::updateTrayIcon()
{ {
if (!icon)
return;
QString status = ui->statusButton->property("status").toString(); QString status = ui->statusButton->property("status").toString();
QString icon; QString pic;
if (status == "online") if (status == "online")
icon = ":img/taskbar/taskbar_online_2x.png"; pic = ":img/taskbar/taskbar_online_2x.png";
else if (status == "away") else if (status == "away")
icon = ":img/taskbar/taskbar_idle_2x.png"; pic = ":img/taskbar/taskbar_idle_2x.png";
else if (status == "busy") else if (status == "busy")
icon = ":img/taskbar/taskbar_busy_2x.png"; pic = ":img/taskbar/taskbar_busy_2x.png";
else else
icon = ":img/taskbar/taskbar_offline_2x.png"; pic = ":img/taskbar/taskbar_offline_2x.png";
this->icon->setIcon(QIcon(icon)); icon->setIcon(QIcon(pic));
} }
Widget::~Widget() Widget::~Widget()