Commit 88ddded1 authored by Andreas Traczyk's avatar Andreas Traczyk

project: update qt project file (support for vcxproj and linux build)

Change-Id: I3c8694544def8653d59abd634ff67dd13ec76183
parent ccd41ebf
......@@ -16,3 +16,4 @@ build/
nuget.exe
*.autosave
changelog.html
obj/
......@@ -20,6 +20,7 @@
#include <QDebug>
#ifdef Q_OS_WIN
#include <atlbase.h>
#include <netlistmgr.h>
......@@ -120,6 +121,20 @@ ConnectivityMonitor::ConnectivityMonitor(QObject* parent)
pUnknown->Release();
}
bool
ConnectivityMonitor::isOnline()
{
if (!pNetworkListManager_) {
return false;
}
VARIANT_BOOL IsConnect = VARIANT_FALSE;
HRESULT hr = pNetworkListManager_->get_IsConnectedToInternet(&IsConnect);
if (SUCCEEDED(hr)) {
return IsConnect == VARIANT_TRUE;
}
return false;
}
void
ConnectivityMonitor::destroy()
{
......@@ -141,17 +156,4 @@ ConnectivityMonitor::~ConnectivityMonitor()
destroy();
CoUninitialize();
}
bool
ConnectivityMonitor::isOnline()
{
if (!pNetworkListManager_) {
return false;
}
VARIANT_BOOL IsConnect = VARIANT_FALSE;
HRESULT hr = pNetworkListManager_->get_IsConnectedToInternet(&IsConnect);
if (SUCCEEDED(hr)) {
return IsConnect == VARIANT_TRUE;
}
return false;
}
\ No newline at end of file
#endif // Q_OS_WIN
\ No newline at end of file
......@@ -20,6 +20,7 @@
#include <QObject>
#ifdef Q_OS_WIN
class ConnectivityMonitor : public QObject
{
Q_OBJECT
......@@ -41,4 +42,5 @@ private:
struct IConnectionPoint* pConnectPoint_;
class NetworkEventHandler* netEventHandler_;
unsigned long cookie_;
};
\ No newline at end of file
};
#endif // Q_OS_WIN
\ No newline at end of file
TEMPLATE = app
TARGET = jami-qt
win32-msvc {
TARGET = Jami
TEMPLATE = vcapp
CONFIG += c++17
QT += winextras widgets xml multimedia multimediawidgets network webenginewidgets svg sql
QT += widgets xml multimedia multimediawidgets network webenginewidgets svg
CONFIG += suppress_vcproj_warnings
isEmpty(LRC) {
LRC=../../install/lrc/
# compiler options
QMAKE_CXXFLAGS += /wd"4068" /wd"4099" /wd"4189" /wd"4267" /wd"4577" /wd"4467" /wd"4715" /wd"4828"
QMAKE_CXXFLAGS += /MP /GS /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope
QMAKE_CXXFLAGS += /Gd /Oi /MD /std:c++17 /FC /EHsc /nologo /sdl
# linker options
QMAKE_LFLAGS+= /ignore:4006,4049,4078,4098 /FORCE:MULTIPLE /INCREMENTAL:NO /Debug /LTCG /NODEFAULTLIB:LIBCMT
# preprocessor defines
DEFINES += UNICODE PROCESS_DPI_AWARE=1 QT_NO_DEBUG NDEBUG
# dependencies
LRC=../lrc
DRING=../daemon
QRENCODE=../client-windows/qrencode-win32/qrencode-win32
# client deps
INCLUDEPATH += $${QRENCODE}
LIBS += $${QRENCODE}/vc8/qrcodelib/x64/Release-Lib/qrcodelib.lib
# lrc
INCLUDEPATH += $${LRC}/src/
LIBS += $${LRC}/msvc/release/ringclient_static.lib
LIBS += $${LRC}/msvc/src/qtwrapper/Release/qtwrapper.lib
# daemon
INCLUDEPATH += ../daemon/contrib/msvc/include/
LIBS += $${DRING}/MSVC/x64/ReleaseLib_win32/bin/dring.lib
LIBS += $${DRING}/contrib/msvc/lib/x64/libgnutls.lib
# windows system libs
LIBS += Shell32.lib Ole32.lib Advapi32.lib Shlwapi.lib User32.lib Gdi32.lib Crypt32.lib Strmiids.lib
# output paths
DESTDIR = x64/Release
OBJECTS_DIR = obj/.obj
MOC_DIR = obj/.moc
RCC_DIR = obj/.rcc
UI_DIR = obj/.ui
}
unix {
TARGET = jami-qt
TEMPLATE = app
QT += quick quickwidgets widgets xml multimedia multimediawidgets network webenginewidgets svg
#check Qt version
QT_VERSION = $$[QT_VERSION]
QT_VERSION = $$split(QT_VERSION, ".")
QT_VER_MAJ = $$member(QT_VERSION, 0)
QT_VER_MIN = $$member(QT_VERSION, 1)
lessThan(QT_VER_MIN, 12) {
QMAKE_CXXFLAGS += -std=c++17
}
greaterThan(QT_VER_MIN, 12) | equals(QT_VER_MIN, 12) {
CONFIG += c++17
}
isEmpty(LRC) { LRC=../../install/lrc/ }
INCLUDEPATH += $${LRC}/include/libringclient
INCLUDEPATH += $${LRC}/include
LIBS += -L$${LRC}/lib -lringclient
LIBS += -lqrencode
}
INCLUDEPATH += $${LRC}/include/libringclient
INCLUDEPATH += $${LRC}/include
LIBS += -L$${LRC}/lib -lringclient
LIBS += -lqrencode
# Input
HEADERS += ./aboutdialog.h \
......@@ -50,12 +112,10 @@ HEADERS += ./aboutdialog.h \
./videoview.h \
./advancedsipsettingwidget.h \
./contactpicker.h \
./downloadmanager.h \
./lrcinstance.h \
./passworddialog.h \
./selectareadialog.h \
./toggleswitch.h \
./videowidget.h \
./animationhelpers.h \
./contactpickeritemdelegate.h \
./globalsystemtray.h \
......@@ -85,7 +145,9 @@ HEADERS += ./aboutdialog.h \
./popupdialog.h \
./recordoverlay.h \
./widgethelpers.h \
./recordwidget.h
./recordwidget.h \
./networkmanager.h \
./connectivitymonitor.h
SOURCES += ./aboutdialog.cpp \
./banneditemwidget.cpp \
./conversationsfilterwidget.cpp \
......@@ -101,8 +163,6 @@ SOURCES += ./aboutdialog.cpp \
./nameregistrationdialog.cpp \
./ringcontactlineedit.cpp \
./splashscreen.cpp \
./videowidget.cpp \
./animationhelpers.cpp \
./accountlistmodel.cpp \
./bezierconnectorwidget.cpp \
./deleteaccountdialog.cpp \
......@@ -120,7 +180,6 @@ SOURCES += ./aboutdialog.cpp \
./updateconfirmdialog.cpp \
./advancedsipsettingwidget.cpp \
./contactpicker.cpp \
./downloadmanager.cpp \
./main.cpp \
./passworddialog.cpp \
./settingswidget.cpp \
......@@ -153,7 +212,9 @@ SOURCES += ./aboutdialog.cpp \
./popupdialog.cpp \
./recordoverlay.cpp \
./widgethelpers.cpp \
./recordwidget.cpp
./recordwidget.cpp \
./networkmanager.cpp \
./connectivitymonitor.cpp
FORMS += ./aboutdialog.ui \
./advancedsipsettingwidget.ui \
./callwidget.ui \
......@@ -183,5 +244,6 @@ FORMS += ./aboutdialog.ui \
./collapsiblepasswordwidget.ui \
./popupdialog.ui \
./recordoverlay.ui \
./recordwidget.ui
./recordwidget.ui \
RESOURCES += ressources.qrc
......@@ -36,6 +36,7 @@
#include <QLibraryInfo>
#include <QTranslator>
#include <thread>
#include <ciso646>
#include <locale.h>
......
......@@ -73,11 +73,11 @@ MainWindow::MainWindow(QWidget* parent)
setContextMenuPolicy(Qt::NoContextMenu);
connect(&GlobalSystemTray::instance(), SIGNAL(messageClicked()), this, SLOT(notificationClicked()));
#ifdef Q_OS_WIN
connectivityMonitor_ = std::make_unique<ConnectivityMonitor>(this);
connect(connectivityMonitor_.get(), &ConnectivityMonitor::connectivityChanged,
[this] { LRCInstance::connectivityChanged(); });
#endif // Q_OS_WIN
auto flags_ = windowFlags();
auto accountList = LRCInstance::accountModel().getAccountList();
......@@ -190,7 +190,9 @@ MainWindow::MainWindow(QWidget* parent)
MainWindow::~MainWindow()
{
#ifdef Q_OS_WIN
connectivityMonitor_.reset();
#endif // Q_OS_WIN
updateTimer_->stop();
delete ui;
}
......@@ -300,7 +302,9 @@ void MainWindow::closeEvent(QCloseEvent* event)
settings.setValue(SettingsKey::windowState, saveState());
this->disconnect(screenChangedConnection_);
QMainWindow::closeEvent(event);
#ifdef Q_OS_WIN
connectivityMonitor_.reset();
#endif // Q_OS_WIN
}
}
......
......@@ -90,9 +90,9 @@ private:
QAction* settingsAction_;
QAction* exitAction_;
#ifdef Q_OS_WIN
std::unique_ptr<ConnectivityMonitor> connectivityMonitor_;
#endif // Q_OS_WIN
QMetaObject::Connection screenChangedConnection_;
QTimer* updateTimer_;
......
......@@ -140,14 +140,14 @@ PhotoboothWidget::on_takePhotoButton_clicked()
}
void
PhotoboothWidget::setAvatarPixmap(const QPixmap& avatarPixmap, bool default)
PhotoboothWidget::setAvatarPixmap(const QPixmap& avatarPixmap, bool defaultValue)
{
ui->avatarLabel->setPixmap(avatarPixmap);
if (!LRCInstance::hasVideoCall()) {
LRCInstance::renderer()->stopPreviewing();
}
resetToAvatarLabel();
if (default) {
if (defaultValue) {
ui->takePhotoButton->setIcon(QIcon(":/images/icons/round-add_a_photo-24px.svg"));
}
}
......
......@@ -40,7 +40,7 @@ public:
void startBooth(bool force = false);
void stopBooth();
void setAvatarPixmap(const QPixmap& avatarPixmap, bool default = false);
void setAvatarPixmap(const QPixmap& avatarPixmap, bool defaultValue = false);
const QPixmap& getAvatarPixmap();
bool hasAvatar();
bool isPhotoBoothOpened() { return takePhotoState_; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment