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:
commit
f281ad87ec
|
@ -1,4 +1,4 @@
|
||||||
@mkdir %~dp0libs
|
@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\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
|
@del %~dp0libs\libtoxcore-latest.zip
|
|
@ -7,6 +7,11 @@ SCRIPT_DIR=`dirname $SCRIPT_NAME`
|
||||||
# create libs dir if necessary
|
# create libs dir if necessary
|
||||||
mkdir -p ${SCRIPT_DIR}/libs
|
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
|
# clone current master of libtoxcore
|
||||||
git clone https://github.com/irungentoo/toxcore.git ${SCRIPT_DIR}/libs/libtoxcore-latest
|
git clone https://github.com/irungentoo/toxcore.git ${SCRIPT_DIR}/libs/libtoxcore-latest
|
||||||
|
|
||||||
|
|
BIN
img/status/dot_busy.png
Normal file
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
BIN
img/status/dot_busy_2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 947 B |
BIN
img/status/dot_busy_notification.png
Normal file
BIN
img/status/dot_busy_notification.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 791 B |
3
res.qrc
3
res.qrc
|
@ -97,5 +97,8 @@
|
||||||
<file>ui/window/restoreButtonPressed.png</file>
|
<file>ui/window/restoreButtonPressed.png</file>
|
||||||
<file>ui/friendList/friendList.css</file>
|
<file>ui/friendList/friendList.css</file>
|
||||||
<file>ui/window/window.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>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -62,7 +62,8 @@ HEADERS += widget/form/addfriendform.h \
|
||||||
widget/selfcamview.h \
|
widget/selfcamview.h \
|
||||||
widget/videosurface.h \
|
widget/videosurface.h \
|
||||||
widget/camera.h \
|
widget/camera.h \
|
||||||
widget/netcamview.h
|
widget/netcamview.h \
|
||||||
|
widget/tool/clickablelabel.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
widget/form/addfriendform.cpp \
|
widget/form/addfriendform.cpp \
|
||||||
|
@ -92,4 +93,5 @@ SOURCES += \
|
||||||
widget/selfcamview.cpp \
|
widget/selfcamview.cpp \
|
||||||
widget/videosurface.cpp \
|
widget/videosurface.cpp \
|
||||||
widget/camera.cpp \
|
widget/camera.cpp \
|
||||||
widget/netcamview.cpp
|
widget/netcamview.cpp \
|
||||||
|
widget/tool/clickablelabel.cpp
|
||||||
|
|
51
widget.ui
51
widget.ui
|
@ -226,16 +226,7 @@
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
|
@ -704,16 +695,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -1693,7 +1675,7 @@
|
||||||
<string>Your status</string>
|
<string>Your status</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="statImg">
|
<widget class="ClickableLabel" name="statImg">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>170</x>
|
<x>170</x>
|
||||||
|
@ -2189,16 +2171,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -2735,16 +2708,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -2858,6 +2822,11 @@
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>widget/tool/editablelabelwidget.h</header>
|
<header>widget/tool/editablelabelwidget.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ClickableLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>widget/tool/clickablelabel.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="res.qrc"/>
|
<include location="res.qrc"/>
|
||||||
|
|
11
widget/tool/clickablelabel.cpp
Normal file
11
widget/tool/clickablelabel.cpp
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#include "clickablelabel.h"
|
||||||
|
|
||||||
|
ClickableLabel::ClickableLabel(QWidget *parent) :
|
||||||
|
QLabel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClickableLabel::mousePressEvent(QMouseEvent* event)
|
||||||
|
{
|
||||||
|
emit clicked();
|
||||||
|
}
|
20
widget/tool/clickablelabel.h
Normal file
20
widget/tool/clickablelabel.h
Normal 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
|
|
@ -200,6 +200,7 @@ Widget::Widget(QWidget *parent) :
|
||||||
connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked()));
|
connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked()));
|
||||||
connect(ui->nameLabel, SIGNAL(textChanged(QString,QString)), this, SLOT(onUsernameChanged(QString,QString)));
|
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->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.name, SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged(QString)));
|
||||||
connect(&settingsForm.statusText, SIGNAL(textChanged(QString)), this, SLOT(onStatusMessageChanged(QString)));
|
connect(&settingsForm.statusText, SIGNAL(textChanged(QString)), this, SLOT(onStatusMessageChanged(QString)));
|
||||||
connect(&friendForm, SIGNAL(friendRequested(QString,QString)), this, SIGNAL(friendRequested(QString,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)
|
if (status == Status::Online)
|
||||||
ui->statImg->setPixmap(QPixmap(":img/status/dot_online_2x.png"));
|
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"));
|
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)
|
else if (status == Status::Offline)
|
||||||
ui->statImg->setPixmap(QPixmap(":img/status/dot_away_2x.png"));
|
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"));
|
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
|
||||||
else if (status == Status::Online && f->hasNewMessages == 1)
|
else if (status == Status::Online && f->hasNewMessages == 1)
|
||||||
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
|
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"));
|
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"));
|
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)
|
else if (status == Status::Offline && f->hasNewMessages == 0)
|
||||||
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_away.png"));
|
f->widget->statusPic.setPixmap(QPixmap(":img/status/dot_away.png"));
|
||||||
else if (status == Status::Offline && f->hasNewMessages == 1)
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ private slots:
|
||||||
void removeFriend(int friendId);
|
void removeFriend(int friendId);
|
||||||
void copyFriendIdToClipboard(int friendId);
|
void copyFriendIdToClipboard(int friendId);
|
||||||
void removeGroup(int groupId);
|
void removeGroup(int groupId);
|
||||||
|
void onStatusImgClicked();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void moveWindow(QMouseEvent *e);
|
void moveWindow(QMouseEvent *e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user