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

Merge branches 'pr1433', 'pr1435', 'pr1436', 'pr1438' and 'pr1439'

This commit is contained in:
Dubslow 2015-03-19 23:02:02 -05:00
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
5 changed files with 46 additions and 6 deletions

View File

@ -96,7 +96,7 @@ First of all install the dependencies of Tox Core.
Arch Linux:
```bash
sudo pacman -S --needed opus vpx
sudo pacman -S --needed opus libvpx
```
Debian / Ubuntu:
@ -221,6 +221,11 @@ Download the MinGW installer for Windows from [sourceforge.net](http://sourcefor
Make sure to install MSYS (a set of Unix tools for Windows).
The following steps assume that MinGW is installed at "C:\MinGW". If you decided to choose another location, replace corresponding parts.
###qrencode
Download the qrencode from http://fukuchi.org/works/qrencode/ or direct from https://code.google.com/p/qrencode-win32/source/checkout ,
build project "..\qrencode-win32\vc8\qrcodelib\", you must copy files from release in: "qrcodelib.dll" to \qTox\libs\bin\qrcodelib.dll";
"qrencode.h" to \qTox\libs\include\qrencode.h"; "qrcodelib.lib" to "\qTox\libs\lib\qrencode.lib" with rename!!!
###Setting up Path
Add MinGW/MSYS/CMake binaries to the system path to make them globally accessible.
@ -232,7 +237,7 @@ The very first semicolon must only be added if it is missing. CMake may be added
###Cloning the Repository
Clone the repository (https://github.com/tux3/qTox.git) with your preferred Git client. [SmartGit](http://www.syntevo.com/smartgit/) is very nice for this task.
Clone the repository (https://github.com/tux3/qTox.git) with your preferred Git client. [SmartGit](http://www.syntevo.com/smartgit/) is very nice for this task (you may need to add the path to the git.exe system variable Path).
The following steps assume that you cloned the repository at "C:\qTox". If you decided to choose another location, replace corresponding parts.
### Getting dependencies

View File

@ -2,7 +2,7 @@
if which apt-get; then
sudo apt-get install build-essential qt5-qmake qt5-default libopenal-dev libopencv-dev \
libtool autotools-dev automake checkinstall check libopus-dev libvpx-dev qttools5-dev-tools qtchooser libxss-dev libqt5svg5* qrencode
libtool autotools-dev automake checkinstall check libopus-dev libvpx-dev qttools5-dev-tools qtchooser libxss-dev libqt5svg5* libqrencode-dev
elif which pacman; then
sudo pacman -S --needed base-devel qt5 opencv openal opus libvpx libxss qt5-svg qrencode
elif which yum; then

View File

@ -4,7 +4,12 @@
#include <QBuffer>
#include <QImage>
#include <qrencode.h>
#include <sys/errno.h>
#ifdef Q_OS_WIN32
#include <errno.h>
#else
#include <sys/errno.h>
#endif
QRWidget::QRWidget(QWidget *parent) : QWidget(parent), data("0")
//Note: The encoding fails with empty string so I just default to something else.

View File

@ -84,6 +84,7 @@ Widget::Widget(QWidget *parent)
eventFlag(false),
eventIcon(false)
{
installEventFilter(this);
translator = new QTranslator;
setTranslation();
}
@ -222,6 +223,23 @@ void Widget::setTranslation()
QCoreApplication::installTranslator(translator);
}
bool Widget::eventFilter(QObject *obj, QEvent *event)
{
if(event->type() == QEvent::WindowStateChange && obj != NULL)
{
QWindowStateChangeEvent * ce = static_cast<QWindowStateChangeEvent*>(event);
if (windowState() & Qt::WindowMinimized)
{
if (ce->oldState() & Qt::WindowMaximized)
wasMaximized = true;
else
wasMaximized = false;
}
}
event->accept();
return false;
}
void Widget::updateIcons()
{
if (!icon)
@ -433,16 +451,23 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
{
show();
activateWindow();
showNormal();
if (wasMaximized)
showMaximized();
else
showNormal();
}
else if (isMinimized())
{
forceShow();
activateWindow();
showNormal();
if (wasMaximized)
showMaximized();
else
showNormal();
}
else
{
wasMaximized = isMaximized();
if (Settings::getInstance().getMinimizeToTray())
hide();
else
@ -452,6 +477,7 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
break;
}
case QSystemTrayIcon::MiddleClick:
wasMaximized = isMaximized();
if (Settings::getInstance().getMinimizeToTray())
hide();
else

View File

@ -51,6 +51,9 @@ class Widget : public QMainWindow
{
Q_OBJECT
protected:
bool eventFilter(QObject *obj, QEvent *event);
public:
explicit Widget(QWidget *parent = 0);
void init();
@ -181,6 +184,7 @@ private:
QRegExp nameMention, sanitizedNameMention;
bool eventFlag;
bool eventIcon;
bool wasMaximized = false;
};
bool toxActivateEventHandler(const QByteArray& data);