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

add fancier tray icons with status, remove relevant option

This commit is contained in:
Dubslow 2014-12-05 16:42:15 -06:00
parent 24badc0623
commit 961d5830c3
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
17 changed files with 14 additions and 73 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

View File

@ -37,6 +37,10 @@
<file>img/status/dot_online.png</file>
<file>img/status/dot_online_2x.png</file>
<file>img/status/dot_online_notification.png</file>
<file>img/taskbar/taskbar_online_2x.png</file>
<file>img/taskbar/taskbar_idle_2x.png</file>
<file>img/taskbar/taskbar_busy_2x.png</file>
<file>img/taskbar/taskbar_offline_2x.png</file>
<file>img/transfer.png</file>
<file>smileys/cylgom/angel.png</file>
<file>smileys/cylgom/angry.png</file>

View File

@ -129,7 +129,6 @@ void Settings::load()
makeToxPortable = s.value("makeToxPortable", false).toBool();
autostartInTray = s.value("autostartInTray", false).toBool();
closeToTray = s.value("closeToTray", false).toBool();
trayShowsUserStatus = s.value("trayShowsUserStatus", false).toBool();
forceTCP = s.value("forceTCP", false).toBool();
useProxy = s.value("useProxy", false).toBool();
proxyAddr = s.value("proxyAddr", "").toString();
@ -281,7 +280,6 @@ void Settings::save(QString path, bool writeFriends)
s.setValue("showSystemTray", showSystemTray);
s.setValue("autostartInTray",autostartInTray);
s.setValue("closeToTray", closeToTray);
s.setValue("trayShowsUserStatus", trayShowsUserStatus);
s.setValue("useProxy", useProxy);
s.setValue("forceTCP", forceTCP);
s.setValue("proxyAddr", proxyAddr);
@ -521,16 +519,6 @@ void Settings::setCloseToTray(bool newValue)
closeToTray = newValue;
}
bool Settings::getTrayShowsUserStatus() const
{
return trayShowsUserStatus;
}
void Settings::setTrayShowsUserStatus(bool newValue)
{
trayShowsUserStatus = newValue;
}
bool Settings::getMinimizeToTray() const
{
return minimizeToTray;

View File

@ -58,9 +58,6 @@ public:
bool getCloseToTray() const;
void setCloseToTray(bool newValue);
bool getTrayShowsUserStatus() const;
void setTrayShowsUserStatus(bool newValue);
bool getMinimizeToTray() const;
void setMinimizeToTray(bool newValue);
@ -247,7 +244,6 @@ private:
bool autostartInTray;
bool closeToTray;
bool minimizeToTray;
bool trayShowsUserStatus;
bool useEmoticons;
bool checkUpdates;
bool showInFront;

View File

@ -62,8 +62,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
bodyUI->closeToTray->setEnabled(showSystemTray);
bodyUI->minimizeToTray->setChecked(Settings::getInstance().getMinimizeToTray());
bodyUI->minimizeToTray->setEnabled(showSystemTray);
bodyUI->trayShowsUserStatus->setChecked(Settings::getInstance().getTrayShowsUserStatus());
bodyUI->trayShowsUserStatus->setEnabled(showSystemTray);
bodyUI->statusChanges->setChecked(Settings::getInstance().getStatusChangeNotificationEnabled());
bodyUI->useEmoticons->setChecked(Settings::getInstance().getUseEmoticons());
bodyUI->autoacceptFiles->setChecked(Settings::getInstance().getAutoSaveEnabled());
@ -122,7 +120,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
connect(bodyUI->startInTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetAutostartInTray);
connect(bodyUI->closeToTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetCloseToTray);
connect(bodyUI->minimizeToTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetMinimizeToTray);
connect(bodyUI->trayShowsUserStatus, &QCheckBox::stateChanged, this, &GeneralForm::onSettrayShowsUserStatus);
connect(bodyUI->statusChanges, &QCheckBox::stateChanged, this, &GeneralForm::onSetStatusChange);
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
connect(bodyUI->showInFront, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowInFront);
@ -193,12 +190,6 @@ void GeneralForm::onSetMinimizeToTray()
Settings::getInstance().setMinimizeToTray(bodyUI->minimizeToTray->isChecked());
}
void GeneralForm::onSettrayShowsUserStatus()
{
Settings::getInstance().setTrayShowsUserStatus(bodyUI->trayShowsUserStatus->isChecked());
Widget::getInstance()->updateTrayIcon();
}
void GeneralForm::onStyleSelected(QString style)
{
if(bodyUI->styleBrowser->currentIndex() == 0)

View File

@ -49,7 +49,6 @@ private slots:
void onAutoAwayChanged();
void onUseEmoticonsChange();
void onSetMinimizeToTray();
void onSettrayShowsUserStatus();
void onReconnectClicked();
void onAutoAcceptFileChange();
void onAutoSaveDirChange();

View File

@ -152,22 +152,6 @@
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="trayShowsUserStatus">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Tray icon displays user status</string>
</property>
<property name="toolTip">
<string>This is a temporary work around until proper systray status icons are available.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -607,21 +591,5 @@
</hint>
</hints>
</connection>
<connection>
<sender>showSystemTray</sender>
<signal>toggled(bool)</signal>
<receiver>trayShowsUserStatus</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>148</x>
<y>143</y>
</hint>
<hint type="destinationlabel">
<x>158</x>
<y>205</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -295,22 +295,17 @@ void Widget::setTranslation()
void Widget::updateTrayIcon()
{
if(Settings::getInstance().getTrayShowsUserStatus())
{
QString status = ui->statusButton->property("status").toString();
QString icon;
if(status == "online")
icon = ":img/status/dot_online_2x.png";
else if(status == "away")
icon = ":img/status/dot_idle_2x.png";
else if(status == "busy")
icon = ":img/status/dot_busy_2x.png";
else
icon = ":img/status/dot_away_2x.png";
this->icon->setIcon(QIcon(icon));
}
QString status = ui->statusButton->property("status").toString();
QString icon;
if(status == "online")
icon = ":img/taskbar/taskbar_online_2x.png";
else if(status == "away")
icon = ":img/taskbar/taskbar_idle_2x.png";
else if(status == "busy")
icon = ":img/taskbar/taskbar_busy_2x.png";
else
icon->setIcon(windowIcon());
icon = ":img/taskbar/taskbar_offline_2x.png";
this->icon->setIcon(QIcon(icon));
}
Widget::~Widget()