diff --git a/INSTALL.md b/INSTALL.md index 14a1964e8..ef9c74e87 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 diff --git a/simple_make.sh b/simple_make.sh index c845dc26f..555aae1f8 100755 --- a/simple_make.sh +++ b/simple_make.sh @@ -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 diff --git a/src/misc/qrwidget.cpp b/src/misc/qrwidget.cpp index 045426858..52069124c 100644 --- a/src/misc/qrwidget.cpp +++ b/src/misc/qrwidget.cpp @@ -4,7 +4,12 @@ #include #include #include -#include + +#ifdef Q_OS_WIN32 + #include +#else + #include +#endif QRWidget::QRWidget(QWidget *parent) : QWidget(parent), data("0") //Note: The encoding fails with empty string so I just default to something else. diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index cd6a9e82f..5b9a415a3 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -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(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 diff --git a/src/widget/widget.h b/src/widget/widget.h index ac717e299..001b55f2c 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -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);