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

Merge branch 'pr923'

This commit is contained in:
Dubslow 2014-12-12 18:40:24 -06:00
commit a8b1f60256
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
27 changed files with 49 additions and 11 deletions

View File

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 420 B

View File

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 716 B

View File

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 410 B

View File

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 719 B

View File

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 478 B

View File

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 704 B

View File

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 395 B

View File

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 711 B

View File

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

12
res.qrc
View File

@ -37,10 +37,14 @@
<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/taskbar/dark/taskbar_online_2x.png</file>
<file>img/taskbar/dark/taskbar_idle_2x.png</file>
<file>img/taskbar/dark/taskbar_busy_2x.png</file>
<file>img/taskbar/dark/taskbar_offline_2x.png</file>
<file>img/taskbar/light/taskbar_online_2x.png</file>
<file>img/taskbar/light/taskbar_idle_2x.png</file>
<file>img/taskbar/light/taskbar_busy_2x.png</file>
<file>img/taskbar/light/taskbar_offline_2x.png</file>
<file>img/transfer.png</file>
<file>smileys/cylgom/angel.png</file>
<file>smileys/cylgom/angry.png</file>

View File

@ -167,6 +167,7 @@ void Settings::load()
timestampFormat = s.value("timestampFormat", "hh:mm").toString();
minimizeOnClose = s.value("minimizeOnClose", false).toBool();
minimizeToTray = s.value("minimizeToTray", false).toBool();
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
useNativeStyle = s.value("nativeStyle", false).toBool();
useEmoticons = s.value("useEmoticons", true).toBool();
statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
@ -315,6 +316,7 @@ void Settings::save(QString path, bool writeFriends)
s.setValue("timestampFormat", timestampFormat);
s.setValue("minimizeOnClose", minimizeOnClose);
s.setValue("minimizeToTray", minimizeToTray);
s.setValue("lightTrayIcon", lightTrayIcon);
s.setValue("nativeStyle", useNativeStyle);
s.setValue("useEmoticons", useEmoticons);
s.setValue("themeColor", themeColor);
@ -530,6 +532,16 @@ void Settings::setMinimizeToTray(bool newValue)
minimizeToTray = newValue;
}
bool Settings::getLightTrayIcon() const
{
return lightTrayIcon;
}
void Settings::setLightTrayIcon(bool newValue)
{
lightTrayIcon = newValue;
}
bool Settings::getStatusChangeNotificationEnabled() const
{
return statusChangeNotificationEnabled;

View File

@ -61,6 +61,9 @@ public:
bool getMinimizeToTray() const;
void setMinimizeToTray(bool newValue);
bool getLightTrayIcon() const;
void setLightTrayIcon(bool newValue);
QString getStyle() const;
void setStyle(const QString& newValue);
@ -244,6 +247,7 @@ private:
bool autostartInTray;
bool closeToTray;
bool minimizeToTray;
bool lightTrayIcon;
bool useEmoticons;
bool checkUpdates;
bool showInFront;

View File

@ -62,6 +62,8 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
bodyUI->closeToTray->setEnabled(showSystemTray);
bodyUI->minimizeToTray->setChecked(Settings::getInstance().getMinimizeToTray());
bodyUI->minimizeToTray->setEnabled(showSystemTray);
bodyUI->lightTrayIcon->setChecked(Settings::getInstance().getLightTrayIcon());
bodyUI->lightTrayIcon->setEnabled(showSystemTray);
bodyUI->statusChanges->setChecked(Settings::getInstance().getStatusChangeNotificationEnabled());
bodyUI->useEmoticons->setChecked(Settings::getInstance().getUseEmoticons());
bodyUI->autoacceptFiles->setChecked(Settings::getInstance().getAutoSaveEnabled());
@ -120,6 +122,7 @@ 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->lightTrayIcon, &QCheckBox::stateChanged, this, &GeneralForm::onSetLightTrayIcon);
connect(bodyUI->statusChanges, &QCheckBox::stateChanged, this, &GeneralForm::onSetStatusChange);
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
connect(bodyUI->showInFront, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowInFront);
@ -185,6 +188,12 @@ void GeneralForm::onSetCloseToTray()
Settings::getInstance().setCloseToTray(bodyUI->closeToTray->isChecked());
}
void GeneralForm::onSetLightTrayIcon()
{
Settings::getInstance().setLightTrayIcon(bodyUI->lightTrayIcon->isChecked());
Widget::getInstance()->updateTrayIcon();
}
void GeneralForm::onSetMinimizeToTray()
{
Settings::getInstance().setMinimizeToTray(bodyUI->minimizeToTray->isChecked());

View File

@ -37,6 +37,7 @@ private slots:
void onSetShowSystemTray();
void onSetAutostartInTray();
void onSetCloseToTray();
void onSetLightTrayIcon();
void onSmileyBrowserIndexChanged(int index);
void onUDPUpdated();
void onProxyAddrEdited();

View File

@ -39,8 +39,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>509</width>
<height>849</height>
<width>513</width>
<height>819</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,1">
@ -109,7 +109,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="trayBehavior">
<item>
<widget class="QCheckBox" name="startInTray">
@ -152,6 +152,13 @@
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="lightTrayIcon">
<property name="text">
<string>Light icon</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -300,14 +300,15 @@ void Widget::updateTrayIcon()
return;
QString status = ui->statusButton->property("status").toString();
QString pic;
QString color = Settings::getInstance().getLightTrayIcon() ? "light" : "dark";
if (status == "online")
pic = ":img/taskbar/taskbar_online_2x.png";
pic = ":img/taskbar/" + color + "/taskbar_online_2x.png";
else if (status == "away")
pic = ":img/taskbar/taskbar_idle_2x.png";
pic = ":img/taskbar/" + color + "/taskbar_idle_2x.png";
else if (status == "busy")
pic = ":img/taskbar/taskbar_busy_2x.png";
pic = ":img/taskbar/" + color + "/taskbar_busy_2x.png";
else
pic = ":img/taskbar/taskbar_offline_2x.png";
pic = ":img/taskbar/" + color + "/taskbar_offline_2x.png";
icon->setIcon(QIcon(pic));
}