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

Merge branch 'upstream/master'

This commit is contained in:
marcel 2014-07-03 20:01:07 +02:00
commit f281ad87ec
12 changed files with 84 additions and 47 deletions

View File

@ -1,4 +1,4 @@
@mkdir %~dp0libs
%~dp0tools\wget --no-check-certificate http://jenkins.libtoxcore.so/job/libtoxcore-win32-i686/lastSuccessfulBuild/artifact/libtoxcore-win32-i686.zip -O %~dp0libs\libtoxcore-latest.zip
%~dp0tools\unzip %~dp0libs\libtoxcore-latest.zip -d %~dp0libs\
%~dp0tools\unzip -o %~dp0libs\libtoxcore-latest.zip -d %~dp0libs\
@del %~dp0libs\libtoxcore-latest.zip

View File

@ -7,6 +7,11 @@ SCRIPT_DIR=`dirname $SCRIPT_NAME`
# create libs dir if necessary
mkdir -p ${SCRIPT_DIR}/libs
# maybe an earlier run of this script failed
# thus we should remove the libtoxcore-latest dir
# if exists, otherwise cloning the git repo may fail
rm -rf ${SCRIPT_DIR}/libs/libtoxcore-latest
# clone current master of libtoxcore
git clone https://github.com/irungentoo/toxcore.git ${SCRIPT_DIR}/libs/libtoxcore-latest

BIN
img/status/dot_busy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
img/status/dot_busy_2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

View File

@ -97,5 +97,8 @@
<file>ui/window/restoreButtonPressed.png</file>
<file>ui/friendList/friendList.css</file>
<file>ui/window/window.css</file>
<file>img/status/dot_busy.png</file>
<file>img/status/dot_busy_2x.png</file>
<file>img/status/dot_busy_notification.png</file>
</qresource>
</RCC>

View File

@ -62,7 +62,8 @@ HEADERS += widget/form/addfriendform.h \
widget/selfcamview.h \
widget/videosurface.h \
widget/camera.h \
widget/netcamview.h
widget/netcamview.h \
widget/tool/clickablelabel.h
SOURCES += \
widget/form/addfriendform.cpp \
@ -92,4 +93,5 @@ SOURCES += \
widget/selfcamview.cpp \
widget/videosurface.cpp \
widget/camera.cpp \
widget/netcamview.cpp
widget/netcamview.cpp \
widget/tool/clickablelabel.cpp

View File

@ -226,16 +226,7 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
@ -704,16 +695,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@ -1693,7 +1675,7 @@
<string>Your status</string>
</property>
</widget>
<widget class="QLabel" name="statImg">
<widget class="ClickableLabel" name="statImg">
<property name="geometry">
<rect>
<x>170</x>
@ -2189,16 +2171,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@ -2735,16 +2708,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@ -2858,6 +2822,11 @@
<extends>QLabel</extends>
<header>widget/tool/editablelabelwidget.h</header>
</customwidget>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>widget/tool/clickablelabel.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="res.qrc"/>

View File

@ -0,0 +1,11 @@
#include "clickablelabel.h"
ClickableLabel::ClickableLabel(QWidget *parent) :
QLabel(parent)
{
}
void ClickableLabel::mousePressEvent(QMouseEvent* event)
{
emit clicked();
}

View File

@ -0,0 +1,20 @@
#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H
#include <QLabel>
class ClickableLabel : public QLabel
{
Q_OBJECT
public:
explicit ClickableLabel(QWidget *parent = 0);
signals:
void clicked();
protected:
void mousePressEvent ( QMouseEvent * event );
};
#endif // CLICKABLELABEL_H

View File

@ -200,6 +200,7 @@ Widget::Widget(QWidget *parent) :
connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked()));
connect(ui->nameLabel, SIGNAL(textChanged(QString,QString)), this, SLOT(onUsernameChanged(QString,QString)));
connect(ui->statusLabel, SIGNAL(textChanged(QString,QString)), this, SLOT(onStatusMessageChanged(QString,QString)));
connect(ui->statImg, SIGNAL(clicked()), this, SLOT(onStatusImgClicked()));
connect(&settingsForm.name, SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged(QString)));
connect(&settingsForm.statusText, SIGNAL(textChanged(QString)), this, SLOT(onStatusMessageChanged(QString)));
connect(&friendForm, SIGNAL(friendRequested(QString,QString)), this, SIGNAL(friendRequested(QString,QString)));
@ -276,8 +277,10 @@ void Widget::onStatusSet(Status status)
{
if (status == Status::Online)
ui->statImg->setPixmap(QPixmap(":img/status/dot_online_2x.png"));
else if (status == Status::Busy || status == Status::Away)
else if (status == Status::Away)
ui->statImg->setPixmap(QPixmap(":img/status/dot_idle_2x.png"));
else if (status == Status::Busy)
ui->statImg->setPixmap(QPixmap(":img/status/dot_busy_2x.png"));
else if (status == Status::Offline)
ui->statImg->setPixmap(QPixmap(":img/status/dot_away_2x.png"));
}
@ -507,10 +510,14 @@ void Widget::updateFriendStatusLights(int friendId)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
else if (status == Status::Online && f->hasNewMessages == 1)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
else if ((status == Status::Busy || status == Status::Away) && f->hasNewMessages == 0)
else if (status == Status::Away && f->hasNewMessages == 0)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_idle.png"));
else if ((status == Status::Busy || status == Status::Away) && f->hasNewMessages == 1)
else if (status == Status::Away && f->hasNewMessages == 1)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_idle_notification.png"));
else if (status == Status::Busy && f->hasNewMessages == 0)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_busy.png"));
else if (status == Status::Busy && f->hasNewMessages == 1)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_busy_notification.png"));
else if (status == Status::Offline && f->hasNewMessages == 0)
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_away.png"));
else if (status == Status::Offline && f->hasNewMessages == 1)
@ -1099,3 +1106,22 @@ void Widget::minimizeBtnClicked()
}
}
void Widget::onStatusImgClicked()
{
QMenu menu;
menu.addAction("Online");
menu.addAction("Away");
menu.addAction("Busy");
QPoint pos = QCursor::pos();
QAction* selectedItem = menu.exec(pos);
if (selectedItem)
{
if (selectedItem->text() == "Online")
core->setStatus(Status::Online);
else if (selectedItem->text() == "Away")
core->setStatus(Status::Away);
else if (selectedItem->text() == "Busy")
core->setStatus(Status::Busy);
}
}

View File

@ -88,6 +88,7 @@ private slots:
void removeFriend(int friendId);
void copyFriendIdToClipboard(int friendId);
void removeGroup(int groupId);
void onStatusImgClicked();
protected slots:
void moveWindow(QMouseEvent *e);