Browse Source

refactor(android): All android code is removed

Closes #3168.
pull/3302/head
Diadlo 9 years ago
parent
commit
6ed16db5fd
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
  1. 10
      android.qrc
  2. 56
      android/AndroidManifest.xml
  3. 51
      android/build.gradle
  4. 9
      android/gradle.properties
  5. BIN
      android/gradle/wrapper/gradle-wrapper.jar
  6. 6
      android/gradle/wrapper/gradle-wrapper.properties
  7. 164
      android/gradlew
  8. 90
      android/gradlew.bat
  9. 6
      android/local.properties
  10. 25
      android/res/values/libs.xml
  11. BIN
      img/android/menu.png
  12. BIN
      img/android/search.png
  13. 532
      qtox.pro
  14. BIN
      res/android/Roboto-Bold.ttf
  15. BIN
      res/android/Roboto-BoldItalic.ttf
  16. BIN
      res/android/Roboto-Italic.ttf
  17. BIN
      res/android/Roboto-Light.ttf
  18. BIN
      res/android/Roboto-LightItalic.ttf
  19. BIN
      res/android/Roboto-Regular.ttf
  20. BIN
      res/android/Roboto-Thin.ttf
  21. BIN
      res/android/Roboto-ThinItalic.ttf
  22. BIN
      res/android/RobotoCondensed-Bold.ttf
  23. BIN
      res/android/RobotoCondensed-BoldItalic.ttf
  24. BIN
      res/android/RobotoCondensed-Italic.ttf
  25. BIN
      res/android/RobotoCondensed-Light.ttf
  26. BIN
      res/android/RobotoCondensed-LightItalic.ttf
  27. BIN
      res/android/RobotoCondensed-Regular.ttf
  28. 391
      src/android.ui
  29. 3
      src/ipc.cpp
  30. 6
      src/main.cpp
  31. 47
      src/nexus.cpp
  32. 3
      src/nexus.h
  33. 113
      src/widget/androidgui.cpp
  34. 70
      src/widget/androidgui.h
  35. 25
      src/widget/gui.cpp
  36. 2
      src/widget/gui.h
  37. 8
      src/widget/widget.cpp

10
android.qrc

@ -1,10 +0,0 @@
<RCC>
<qresource prefix="/">
<file>img/android/search.png</file>
<file>img/android/menu.png</file>
<file>res/android/Roboto-Bold.ttf</file>
<file>res/android/Roboto-Light.ttf</file>
<file>res/android/Roboto-Regular.ttf</file>
<file>res/android/Roboto-Thin.ttf</file>
</qresource>
</RCC>

56
android/AndroidManifest.xml

@ -1,56 +0,0 @@
<?xml version="1.0"?>
<manifest package="chat.tox.qtox" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="qtox">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="qTox" android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="qtox"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Messages maps -->
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<!-- Messages maps -->
<!-- Splash screen -->
<!--
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
-->
<!-- Splash screen -->
<!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)"
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running -->
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="20"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
</manifest>

51
android/build.gradle

@ -1,51 +0,0 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.1'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
android {
/*******************************************************
* The following variables:
* - androidBuildToolsVersion,
* - androidCompileSdkVersion
* - qt5AndroidDir - holds the path to qt android files
* needed to build any Qt application
* on Android.
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qt5AndroidDir + '/res', 'res']
resources.srcDirs = ['src']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
lintOptions {
abortOnError false
}
}

9
android/gradle.properties

@ -1,9 +0,0 @@
## This file is automatically generated by QtCreator.
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
androidBuildToolsVersion=21.1.2
androidCompileSdkVersion=20
buildDir=.build
qt5AndroidDir=/opt/qt/5.4/android_armv5/src/android/java

BIN
android/gradle/wrapper/gradle-wrapper.jar vendored

Binary file not shown.

6
android/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,6 +0,0 @@
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip

164
android/gradlew vendored

@ -1,164 +0,0 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
android/gradlew.bat vendored

@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

6
android/local.properties

@ -1,6 +0,0 @@
## This file is automatically generated by QtCreator.
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
sdk.dir=/opt/android/android-sdk-linux

25
android/res/values/libs.xml

@ -1,25 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<array name="qt_sources">
<item>https://download.qt-project.org/ministro/android/qt5/qt-5.4</item>
</array>
<!-- The following is handled automatically by the deployment tool. It should
not be edited manually. -->
<array name="bundled_libs">
<!-- %%INSERT_EXTRA_LIBS%% -->
</array>
<array name="qt_libs">
<!-- %%INSERT_QT_LIBS%% -->
</array>
<array name="bundled_in_lib">
<!-- %%INSERT_BUNDLED_IN_LIB%% -->
</array>
<array name="bundled_in_assets">
<!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
</array>
</resources>

BIN
img/android/menu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

BIN
img/android/search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

532
qtox.pro

@ -23,7 +23,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qtox TARGET = qtox
TEMPLATE = app TEMPLATE = app
FORMS += \ FORMS += \
src/android.ui \
src/loginscreen.ui \ src/loginscreen.ui \
src/mainwindow.ui \ src/mainwindow.ui \
src/chatlog/content/filetransferwidget.ui \ src/chatlog/content/filetransferwidget.ui \
@ -63,41 +62,6 @@ DEFINES += TIMESTAMP=$$TIMESTAMP
DEFINES += LOG_TO_FILE DEFINES += LOG_TO_FILE
DEFINES += QT_MESSAGELOGCONTEXT DEFINES += QT_MESSAGELOGCONTEXT
android {
ANDROID_TOOLCHAIN=/opt/android/toolchain-r9d-17/
INCLUDEPATH += $$ANDROID_TOOLCHAIN/include/
LIBS += -L$$PWD/libs/lib -L$$ANDROID_TOOLCHAIN/lib
DISABLE_PLATFORM_EXT=YES
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
contains(ANDROID_TARGET_ARCH,armeabi) {
exists($$ANDROID_TOOLCHAIN/lib/libopenal.so) {
ANDROID_EXTRA_LIBS = $$ANDROID_TOOLCHAIN/lib/libopenal.so
} else {
exists($$PWD/libs/lib/libopenal.so) {
ANDROID_EXTRA_LIBS = $$PWD/libs/lib/libopenal.so
} else {
error(Can\'t find libopenal.so)
}}
}
RESOURCES += android.qrc
HEADERS += src/widget/androidgui.h
SOURCES += src/widget/androidgui.cpp
DISTFILES += \
android/gradle/wrapper/gradle-wrapper.jar \
android/AndroidManifest.xml \
android/gradlew.bat \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew
}
contains(DISABLE_PLATFORM_EXT, YES) { contains(DISABLE_PLATFORM_EXT, YES) {
} else { } else {
@ -171,68 +135,62 @@ win32 {
INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist) INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist)
QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${GIT_DESCRIBE}\" $${INFO_PLIST_PATH} QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${GIT_DESCRIBE}\" $${INFO_PLIST_PATH}
} else { } else {
android { isEmpty(PREFIX) {
LIBS += -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns PREFIX = /usr
LIBS += -llibjpeg -llibwebp -llibpng -llibtiff -llibjasper -lIlmImf }
LIBS += -lopus -lvpx -lsodium -lopenal
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
target.path = $$BINDIR
desktop.path = $$DATADIR/applications
desktop.files += qTox.desktop
INSTALLS += target desktop
# Install application icons according to the XDG spec
ICON_SIZES = 14 16 22 24 32 36 48 64 72 96 128 192 256 512
for(icon_size, ICON_SIZES) {
icon_$${icon_size}.files = img/icons/$${icon_size}x$${icon_size}/qtox.png
icon_$${icon_size}.path = $$DATADIR/icons/hicolor/$${icon_size}x$${icon_size}/apps
INSTALLS += icon_$${icon_size}
}
icon_scalable.files = img/icons/qtox.svg
icon_scalable.path = $$DATADIR/icons/hicolor/scalable/apps
INSTALLS += icon_scalable
# If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package
contains(STATICPKG, YES) {
LIBS += -L$$PWD/libs/lib/ -lopus -lvpx -lopenal -Wl,-Bstatic -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lavformat -lavdevice -lavcodec -lavutil -lswscale -lz -Wl,-Bdynamic
LIBS += -Wl,-Bstatic -ljpeg -ltiff -lpng -ljasper -lIlmImf -lIlmThread -lIex -ldc1394 -lraw1394 -lHalf -lz -llzma -ljbig
LIBS += -Wl,-Bdynamic -lv4l1 -lv4l2 -lavformat -lavcodec -lavutil -lswscale -lusb-1.0
LIBS += -lqrencode -lsqlcipher
} else { } else {
isEmpty(PREFIX) { LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lvpx -lsodium -lopenal -lavformat -lavdevice -lavcodec -lavutil -lswscale
PREFIX = /usr LIBS += -lqrencode -lsqlcipher
} }
BINDIR = $$PREFIX/bin contains(DEFINES, QTOX_PLATFORM_EXT) {
DATADIR = $$PREFIX/share LIBS += -lX11 -lXss
target.path = $$BINDIR }
desktop.path = $$DATADIR/applications
desktop.files += qTox.desktop
INSTALLS += target desktop
# Install application icons according to the XDG spec
ICON_SIZES = 14 16 22 24 32 36 48 64 72 96 128 192 256 512
for(icon_size, ICON_SIZES) {
icon_$${icon_size}.files = img/icons/$${icon_size}x$${icon_size}/qtox.png
icon_$${icon_size}.path = $$DATADIR/icons/hicolor/$${icon_size}x$${icon_size}/apps
INSTALLS += icon_$${icon_size}
}
icon_scalable.files = img/icons/qtox.svg
icon_scalable.path = $$DATADIR/icons/hicolor/scalable/apps
INSTALLS += icon_scalable
# If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package contains(DEFINES, QTOX_FILTER_AUDIO) {
contains(STATICPKG, YES) { contains(STATICPKG, YES) {
LIBS += -L$$PWD/libs/lib/ -lopus -lvpx -lopenal -Wl,-Bstatic -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lavformat -lavdevice -lavcodec -lavutil -lswscale -lz -Wl,-Bdynamic LIBS += -Wl,-Bstatic -lfilteraudio
LIBS += -Wl,-Bstatic -ljpeg -ltiff -lpng -ljasper -lIlmImf -lIlmThread -lIex -ldc1394 -lraw1394 -lHalf -lz -llzma -ljbig
LIBS += -Wl,-Bdynamic -lv4l1 -lv4l2 -lavformat -lavcodec -lavutil -lswscale -lusb-1.0
LIBS += -lqrencode -lsqlcipher
} else { } else {
LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lvpx -lsodium -lopenal -lavformat -lavdevice -lavcodec -lavutil -lswscale LIBS += -lfilteraudio
LIBS += -lqrencode -lsqlcipher
}
contains(DEFINES, QTOX_PLATFORM_EXT) {
LIBS += -lX11 -lXss
}
contains(DEFINES, QTOX_FILTER_AUDIO) {
contains(STATICPKG, YES) {
LIBS += -Wl,-Bstatic -lfilteraudio
} else {
LIBS += -lfilteraudio
}
} }
}
contains(JENKINS, YES) { contains(JENKINS, YES) {
LIBS = ./libs/lib/libtoxav.a ./libs/lib/libvpx.a ./libs/lib/libopus.a ./libs/lib/libtoxdns.a ./libs/lib/libtoxencryptsave.a ./libs/lib/libtoxcore.a ./libs/lib/libopenal.a ./libs/lib/libsodium.a ./libs/lib/libfilteraudio.a ./libs/lib/libavformat-ffmpeg.so ./libs/lib/libavdevice-ffmpeg.so ./libs/lib/libavcodec-ffmpeg.so ./libs/lib/libavutil-ffmpeg.so ./libs/lib/libswscale-ffmpeg.so -ldl -lX11 -lXss -lqrencode LIBS = ./libs/lib/libtoxav.a ./libs/lib/libvpx.a ./libs/lib/libopus.a ./libs/lib/libtoxdns.a ./libs/lib/libtoxencryptsave.a ./libs/lib/libtoxcore.a ./libs/lib/libopenal.a ./libs/lib/libsodium.a ./libs/lib/libfilteraudio.a ./libs/lib/libavformat-ffmpeg.so ./libs/lib/libavdevice-ffmpeg.so ./libs/lib/libavcodec-ffmpeg.so ./libs/lib/libavutil-ffmpeg.so ./libs/lib/libswscale-ffmpeg.so -ldl -lX11 -lXss -lqrencode
contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) { contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) {
LIBS += -lgobject-2.0 -lappindicator -lgtk-x11-2.0 LIBS += -lgobject-2.0 -lappindicator -lgtk-x11-2.0
}
LIBS += -s
} }
LIBS += -s
} }
} }
} }
unix:!macx:!android { unix:!macx {
# The systray Unity backend implements the system tray icon on Unity (Ubuntu) and GNOME desktops. # The systray Unity backend implements the system tray icon on Unity (Ubuntu) and GNOME desktops.
contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) { contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) {
DEFINES += ENABLE_SYSTRAY_UNITY_BACKEND DEFINES += ENABLE_SYSTRAY_UNITY_BACKEND
@ -272,136 +230,6 @@ unix:!macx:!android {
} }
} }
!android {
RESOURCES += res.qrc \
smileys/smileys.qrc
HEADERS += \
src/friend.h \
src/group.h \
src/grouplist.h \
src/friendlist.h \
src/persistence/smileypack.h \
src/widget/emoticonswidget.h \
src/widget/style.h \
src/widget/tool/croppinglabel.h \
src/widget/maskablepixmapwidget.h \
src/video/videosurface.h \
src/net/toxuri.h \
src/net/toxdns.h \
src/persistence/toxsave.h \
src/persistence/serialize.h \
src/chatlog/chatlog.h \
src/chatlog/chatline.h \
src/chatlog/chatlinecontent.h \
src/chatlog/chatlinecontentproxy.h \
src/chatlog/content/text.h \
src/chatlog/content/spinner.h \
src/chatlog/content/filetransferwidget.h \
src/chatlog/chatmessage.h \
src/chatlog/content/image.h \
src/chatlog/customtextdocument.h \
src/widget/form/settings/aboutform.h \
src/widget/form/settings/advancedform.h \
src/chatlog/content/notificationicon.h \
src/chatlog/content/timestamp.h \
src/chatlog/documentcache.h \
src/chatlog/pixmapcache.h \
src/persistence/offlinemsgengine.h \
src/widget/form/addfriendform.h \
src/widget/form/chatform.h \
src/widget/form/groupchatform.h \
src/widget/form/settingswidget.h \
src/widget/form/settings/genericsettings.h \
src/widget/form/settings/generalform.h \
src/widget/form/settings/privacyform.h \
src/widget/form/settings/avform.h \
src/widget/form/filesform.h \
src/widget/form/profileform.h \
src/widget/tool/chattextedit.h \
src/widget/tool/friendrequestdialog.h \
src/widget/friendwidget.h \
src/widget/groupwidget.h \
src/widget/widget.h \
src/video/netcamview.h \
src/widget/friendlistwidget.h \
src/widget/genericchatroomwidget.h \
src/widget/form/genericchatform.h \
src/widget/tool/adjustingscrollarea.h \
src/widget/form/loadhistorydialog.h \
src/widget/form/setpassworddialog.h \
src/widget/form/tabcompleter.h \
src/net/autoupdate.h \
src/widget/tool/callconfirmwidget.h \
src/widget/systemtrayicon.h \
src/widget/qrwidget.h \
src/widget/systemtrayicon_private.h \
src/widget/loginscreen.h \
src/ipc.h
SOURCES += \
src/widget/form/addfriendform.cpp \
src/widget/form/settingswidget.cpp \
src/widget/form/settings/generalform.cpp \
src/widget/form/settings/privacyform.cpp \
src/widget/form/settings/avform.cpp \
src/widget/form/profileform.cpp \
src/widget/form/filesform.cpp \
src/widget/tool/chattextedit.cpp \
src/widget/tool/friendrequestdialog.cpp \
src/widget/widget.cpp \
src/video/netcamview.cpp \
src/widget/friendlistwidget.cpp \
src/widget/tool/adjustingscrollarea.cpp \
src/widget/form/loadhistorydialog.cpp \
src/widget/form/setpassworddialog.cpp \
src/widget/form/tabcompleter.cpp \
src/widget/flowlayout.cpp \
src/net/autoupdate.cpp \
src/widget/tool/callconfirmwidget.cpp \
src/widget/systemtrayicon.cpp \
src/widget/groupwidget.cpp \
src/widget/friendwidget.cpp \
src/widget/form/chatform.cpp \
src/widget/form/groupchatform.cpp \
src/widget/form/genericchatform.cpp \
src/friend.cpp \
src/friendlist.cpp \
src/group.cpp \
src/grouplist.cpp \
src/persistence/smileypack.cpp \
src/widget/emoticonswidget.cpp \
src/widget/style.cpp \
src/widget/tool/croppinglabel.cpp \
src/widget/maskablepixmapwidget.cpp \
src/video/videosurface.cpp \
src/net/toxuri.cpp \
src/net/toxdns.cpp \
src/persistence/toxsave.cpp \
src/persistence/serialize.cpp \
src/chatlog/chatlog.cpp \
src/chatlog/chatline.cpp \
src/chatlog/chatlinecontent.cpp \
src/chatlog/chatlinecontentproxy.cpp \
src/chatlog/content/text.cpp \
src/chatlog/content/spinner.cpp \
src/chatlog/content/filetransferwidget.cpp \
src/chatlog/chatmessage.cpp \
src/chatlog/content/image.cpp \
src/chatlog/customtextdocument.cpp\
src/widget/form/settings/aboutform.cpp \
src/widget/form/settings/advancedform.cpp \
src/chatlog/content/notificationicon.cpp \
src/chatlog/content/timestamp.cpp \
src/chatlog/documentcache.cpp \
src/chatlog/pixmapcache.cpp \
src/persistence/offlinemsgengine.cpp \
src/widget/qrwidget.cpp \
src/widget/genericchatroomwidget.cpp \
src/widget/loginscreen.cpp \
src/ipc.cpp
}
win32 { win32 {
HEADERS += \ HEADERS += \
src/platform/camera/directshow.h src/platform/camera/directshow.h
@ -430,97 +258,111 @@ macx {
src/platform/camera/avfoundation.mm src/platform/camera/avfoundation.mm
} }
SOURCES += \ RESOURCES += res.qrc \
src/audio/audio.cpp \ smileys/smileys.qrc
src/persistence/historykeeper.cpp \
src/main.cpp \
src/nexus.cpp \
src/core/cdata.cpp \
src/core/cstring.cpp \
src/persistence/settings.cpp \
src/persistence/db/genericddinterface.cpp \
src/persistence/db/plaindb.cpp \
src/persistence/db/encrypteddb.cpp \
src/video/videoframe.cpp \
src/widget/gui.cpp \
src/net/toxme.cpp \
src/core/core.cpp \
src/core/coreav.cpp \
src/core/coreencryption.cpp \
src/core/corefile.cpp \
src/core/corestructs.cpp \
src/persistence/profilelocker.cpp \
src/net/avatarbroadcaster.cpp \
src/widget/tool/screenshotgrabber.cpp \
src/widget/tool/screengrabberchooserrectitem.cpp \
src/widget/tool/screengrabberoverlayitem.cpp \
src/widget/tool/toolboxgraphicsitem.cpp \
src/widget/tool/flyoutoverlaywidget.cpp \
src/widget/form/settings/verticalonlyscroller.cpp \
src/video/cameradevice.cpp \
src/video/camerasource.cpp \
src/video/corevideosource.cpp \
src/core/toxid.cpp \
src/persistence/profile.cpp \
src/widget/translator.cpp \
src/persistence/settingsserializer.cpp \
src/widget/notificationscrollarea.cpp \
src/widget/notificationedgewidget.cpp \
src/widget/circlewidget.cpp \
src/widget/genericchatitemwidget.cpp \
src/widget/friendlistlayout.cpp \
src/widget/genericchatitemlayout.cpp \
src/widget/categorywidget.cpp \
src/widget/contentlayout.cpp \
src/widget/contentdialog.cpp \
src/video/genericnetcamview.cpp \
src/widget/tool/activatedialog.cpp \
src/widget/tool/movablewidget.cpp \
src/widget/tool/micfeedbackwidget.cpp \
src/widget/tool/removefrienddialog.cpp \
src/video/groupnetcamview.cpp \
src/core/toxcall.cpp \
src/widget/about/aboutuser.cpp \
src/persistence/db/rawdatabase.cpp \
src/persistence/history.cpp \
src/widget/form/groupinviteform.cpp \
src/widget/tool/profileimporter.cpp
HEADERS += \ HEADERS += \
src/friend.h \
src/friendlist.h \
src/group.h \
src/grouplist.h \
src/ipc.h \
src/nexus.h \
src/audio/audio.h \ src/audio/audio.h \
src/chatlog/chatlog.h \
src/chatlog/chatline.h \
src/chatlog/chatlinecontent.h \
src/chatlog/chatlinecontentproxy.h \
src/chatlog/content/text.h \
src/chatlog/content/spinner.h \
src/chatlog/content/filetransferwidget.h \
src/chatlog/chatmessage.h \
src/chatlog/content/image.h \
src/chatlog/customtextdocument.h \
src/chatlog/content/notificationicon.h \
src/chatlog/content/timestamp.h \
src/chatlog/documentcache.h \
src/chatlog/pixmapcache.h \
src/core/core.h \ src/core/core.h \
src/core/coreav.h \ src/core/coreav.h \
src/core/coredefines.h \ src/core/coredefines.h \
src/core/corefile.h \ src/core/corefile.h \
src/core/corestructs.h \ src/core/corestructs.h \
src/persistence/historykeeper.h \
src/nexus.h \
src/core/cdata.h \ src/core/cdata.h \
src/core/cstring.h \ src/core/cstring.h \
src/core/toxid.h \
src/core/indexedlist.h \
src/core/toxcall.h \
src/net/toxuri.h \
src/net/toxdns.h \
src/net/autoupdate.h \
src/net/toxme.h \
src/net/avatarbroadcaster.h \
src/persistence/smileypack.h \
src/persistence/toxsave.h \
src/persistence/serialize.h \
src/persistence/offlinemsgengine.h \
src/persistence/profilelocker.h \
src/persistence/profile.h \
src/persistence/settingsserializer.h \
src/persistence/db/rawdatabase.h \
src/persistence/history.h \
src/persistence/historykeeper.h \
src/persistence/settings.h \ src/persistence/settings.h \
src/persistence/db/genericddinterface.h \ src/persistence/db/genericddinterface.h \
src/persistence/db/plaindb.h \ src/persistence/db/plaindb.h \
src/persistence/db/encrypteddb.h \ src/persistence/db/encrypteddb.h \
src/video/videosurface.h \
src/video/netcamview.h \
src/video/videoframe.h \ src/video/videoframe.h \
src/video/videosource.h \ src/video/videosource.h \
src/video/cameradevice.h \
src/video/camerasource.h \
src/video/corevideosource.h \
src/video/videomode.h \
src/video/genericnetcamview.h \
src/video/groupnetcamview.h \
src/widget/emoticonswidget.h \
src/widget/style.h \
src/widget/tool/croppinglabel.h \
src/widget/maskablepixmapwidget.h \
src/widget/form/settings/aboutform.h \
src/widget/form/settings/advancedform.h \
src/widget/form/addfriendform.h \
src/widget/form/chatform.h \
src/widget/form/groupchatform.h \
src/widget/form/settingswidget.h \
src/widget/form/settings/genericsettings.h \
src/widget/form/settings/generalform.h \
src/widget/form/settings/privacyform.h \
src/widget/form/settings/avform.h \
src/widget/form/filesform.h \
src/widget/form/profileform.h \
src/widget/tool/chattextedit.h \
src/widget/tool/friendrequestdialog.h \
src/widget/friendwidget.h \
src/widget/groupwidget.h \
src/widget/widget.h \
src/widget/friendlistwidget.h \
src/widget/genericchatroomwidget.h \
src/widget/form/genericchatform.h \
src/widget/tool/adjustingscrollarea.h \
src/widget/form/loadhistorydialog.h \
src/widget/form/setpassworddialog.h \
src/widget/form/tabcompleter.h \
src/widget/tool/callconfirmwidget.h \
src/widget/systemtrayicon.h \
src/widget/qrwidget.h \
src/widget/systemtrayicon_private.h \
src/widget/loginscreen.h \
src/widget/gui.h \ src/widget/gui.h \
src/net/toxme.h \
src/persistence/profilelocker.h \
src/net/avatarbroadcaster.h \
src/widget/tool/screenshotgrabber.h \ src/widget/tool/screenshotgrabber.h \
src/widget/tool/screengrabberchooserrectitem.h \ src/widget/tool/screengrabberchooserrectitem.h \
src/widget/tool/screengrabberoverlayitem.h \ src/widget/tool/screengrabberoverlayitem.h \
src/widget/tool/toolboxgraphicsitem.h \ src/widget/tool/toolboxgraphicsitem.h \
src/widget/tool/flyoutoverlaywidget.h \ src/widget/tool/flyoutoverlaywidget.h \
src/widget/form/settings/verticalonlyscroller.h \ src/widget/form/settings/verticalonlyscroller.h \
src/video/cameradevice.h \
src/video/camerasource.h \
src/video/corevideosource.h \
src/video/videomode.h \
src/core/toxid.h \
src/persistence/profile.h \
src/widget/translator.h \ src/widget/translator.h \
src/persistence/settingsserializer.h \
src/widget/notificationscrollarea.h \ src/widget/notificationscrollarea.h \
src/widget/notificationedgewidget.h \ src/widget/notificationedgewidget.h \
src/widget/circlewidget.h \ src/widget/circlewidget.h \
@ -534,12 +376,122 @@ HEADERS += \
src/widget/tool/micfeedbackwidget.h \ src/widget/tool/micfeedbackwidget.h \
src/widget/tool/removefrienddialog.h \ src/widget/tool/removefrienddialog.h \
src/widget/tool/movablewidget.h \ src/widget/tool/movablewidget.h \
src/video/genericnetcamview.h \
src/video/groupnetcamview.h \
src/core/indexedlist.h \
src/core/toxcall.h \
src/widget/about/aboutuser.h \ src/widget/about/aboutuser.h \
src/persistence/db/rawdatabase.h \
src/persistence/history.h \
src/widget/form/groupinviteform.h \ src/widget/form/groupinviteform.h \
src/widget/tool/profileimporter.h src/widget/tool/profileimporter.h
SOURCES += \
src/ipc.cpp \
src/friend.cpp \
src/friendlist.cpp \
src/group.cpp \
src/grouplist.cpp \
src/main.cpp \
src/nexus.cpp \
src/audio/audio.cpp \
src/core/cdata.cpp \
src/core/cstring.cpp \
src/core/core.cpp \
src/core/coreav.cpp \
src/core/coreencryption.cpp \
src/core/corefile.cpp \
src/core/corestructs.cpp \
src/core/toxid.cpp \
src/core/toxcall.cpp \
src/chatlog/chatlog.cpp \
src/chatlog/chatline.cpp \
src/chatlog/chatlinecontent.cpp \
src/chatlog/chatlinecontentproxy.cpp \
src/chatlog/content/text.cpp \
src/chatlog/content/spinner.cpp \
src/chatlog/content/filetransferwidget.cpp \
src/chatlog/chatmessage.cpp \
src/chatlog/content/image.cpp \
src/chatlog/customtextdocument.cpp\
src/chatlog/content/notificationicon.cpp \
src/chatlog/content/timestamp.cpp \
src/chatlog/documentcache.cpp \
src/chatlog/pixmapcache.cpp \
src/net/autoupdate.cpp \
src/net/toxuri.cpp \
src/net/toxdns.cpp \
src/net/toxme.cpp \
src/net/avatarbroadcaster.cpp \
src/persistence/historykeeper.cpp \
src/persistence/settings.cpp \
src/persistence/db/genericddinterface.cpp \
src/persistence/db/plaindb.cpp \
src/persistence/db/encrypteddb.cpp \
src/persistence/profile.cpp \
src/persistence/settingsserializer.cpp \
src/persistence/smileypack.cpp \
src/persistence/toxsave.cpp \
src/persistence/serialize.cpp \
src/persistence/offlinemsgengine.cpp \
src/persistence/profilelocker.cpp \
src/persistence/db/rawdatabase.cpp \
src/persistence/history.cpp \
src/video/videoframe.cpp \
src/video/cameradevice.cpp \
src/video/camerasource.cpp \
src/video/corevideosource.cpp \
src/video/genericnetcamview.cpp \
src/video/groupnetcamview.cpp \
src/video/netcamview.cpp \
src/video/videosurface.cpp \
src/widget/form/addfriendform.cpp \
src/widget/form/settingswidget.cpp \
src/widget/form/settings/generalform.cpp \
src/widget/form/settings/privacyform.cpp \
src/widget/form/settings/avform.cpp \
src/widget/form/profileform.cpp \
src/widget/form/filesform.cpp \
src/widget/tool/chattextedit.cpp \
src/widget/tool/friendrequestdialog.cpp \
src/widget/widget.cpp \
src/widget/friendlistwidget.cpp \
src/widget/tool/adjustingscrollarea.cpp \
src/widget/form/loadhistorydialog.cpp \
src/widget/form/setpassworddialog.cpp \
src/widget/form/tabcompleter.cpp \
src/widget/flowlayout.cpp \
src/widget/tool/callconfirmwidget.cpp \
src/widget/systemtrayicon.cpp \
src/widget/groupwidget.cpp \
src/widget/friendwidget.cpp \
src/widget/form/chatform.cpp \
src/widget/form/groupchatform.cpp \
src/widget/form/genericchatform.cpp \
src/widget/emoticonswidget.cpp \
src/widget/style.cpp \
src/widget/tool/croppinglabel.cpp \
src/widget/maskablepixmapwidget.cpp \
src/widget/form/settings/aboutform.cpp \
src/widget/form/settings/advancedform.cpp \
src/widget/qrwidget.cpp \
src/widget/genericchatroomwidget.cpp \
src/widget/loginscreen.cpp \
src/widget/gui.cpp \
src/widget/tool/screenshotgrabber.cpp \
src/widget/tool/screengrabberchooserrectitem.cpp \
src/widget/tool/screengrabberoverlayitem.cpp \
src/widget/tool/toolboxgraphicsitem.cpp \
src/widget/tool/flyoutoverlaywidget.cpp \
src/widget/form/settings/verticalonlyscroller.cpp \
src/widget/translator.cpp \
src/widget/notificationscrollarea.cpp \
src/widget/notificationedgewidget.cpp \
src/widget/circlewidget.cpp \
src/widget/genericchatitemwidget.cpp \
src/widget/friendlistlayout.cpp \
src/widget/genericchatitemlayout.cpp \
src/widget/categorywidget.cpp \
src/widget/contentlayout.cpp \
src/widget/contentdialog.cpp \
src/widget/tool/activatedialog.cpp \
src/widget/tool/movablewidget.cpp \
src/widget/tool/micfeedbackwidget.cpp \
src/widget/tool/removefrienddialog.cpp \
src/widget/about/aboutuser.cpp \
src/widget/form/groupinviteform.cpp \
src/widget/tool/profileimporter.cpp

BIN
res/android/Roboto-Bold.ttf

Binary file not shown.

BIN
res/android/Roboto-BoldItalic.ttf

Binary file not shown.

BIN
res/android/Roboto-Italic.ttf

Binary file not shown.

BIN
res/android/Roboto-Light.ttf

Binary file not shown.

BIN
res/android/Roboto-LightItalic.ttf

Binary file not shown.

BIN
res/android/Roboto-Regular.ttf

Binary file not shown.

BIN
res/android/Roboto-Thin.ttf

Binary file not shown.

BIN
res/android/Roboto-ThinItalic.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-Bold.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-BoldItalic.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-Italic.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-Light.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-LightItalic.ttf

Binary file not shown.

BIN
res/android/RobotoCondensed-Regular.ttf

Binary file not shown.

391
src/android.ui

@ -1,391 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Android</class>
<widget class="QWidget" name="Android">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<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">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="head" native="true">
<property name="minimumSize">
<size>
<width>56</width>
<height>56</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>103</red>
<green>58</green>
<blue>183</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>24</number>
</property>
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<item>
<widget class="QLabel" name="headMenuIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="baseSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../android.qrc">:/img/android/menu.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="headTitle">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>128</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>128</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>128</red>
<green>128</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="text">
<string>qTox</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="headRightIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="baseSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../android.qrc">:/img/android/search.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="gridSize">
<size>
<width>0</width>
<height>36</height>
</size>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
<property name="uniformItemSizes">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Someone</string>
</property>
</item>
<item>
<property name="text">
<string>Someone else</string>
</property>
</item>
<item>
<property name="text">
<string>Groupbot</string>
</property>
</item>
<item>
<property name="text">
<string>That guy who I don't remember adding</string>
</property>
</item>
<item>
<property name="text">
<string>NASA manager</string>
</property>
</item>
<item>
<property name="text">
<string>Lorem</string>
</property>
</item>
<item>
<property name="text">
<string>Ipsum</string>
</property>
</item>
<item>
<property name="text">
<string>Dolor</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../android.qrc"/>
</resources>
<connections/>
</ui>

3
src/ipc.cpp

@ -86,9 +86,6 @@ IPC::~IPC()
IPC& IPC::getInstance() IPC& IPC::getInstance()
{ {
#ifdef Q_OS_ANDROID
Q_ASSERT(0 && "IPC can not be used on android");
#endif
static IPC instance; static IPC instance;
return instance; return instance;
} }

6
src/main.cpp

@ -146,9 +146,7 @@ int main(int argc, char *argv[])
parser.addOption(QCommandLineOption("p", QObject::tr("Starts new instance and loads specified profile."), QObject::tr("profile"))); parser.addOption(QCommandLineOption("p", QObject::tr("Starts new instance and loads specified profile."), QObject::tr("profile")));
parser.process(a); parser.process(a);
#ifndef Q_OS_ANDROID
IPC& ipc = IPC::getInstance(); IPC& ipc = IPC::getInstance();
#endif
if (sodium_init() < 0) // For the auto-updater if (sodium_init() < 0) // For the auto-updater
{ {
@ -212,7 +210,6 @@ int main(int argc, char *argv[])
QString profileName; QString profileName;
bool autoLogin = Settings::getInstance().getAutoLogin(); bool autoLogin = Settings::getInstance().getAutoLogin();
#ifndef Q_OS_ANDROID
// Inter-process communication // Inter-process communication
ipc.registerEventHandler("uri", &toxURIEventHandler); ipc.registerEventHandler("uri", &toxURIEventHandler);
ipc.registerEventHandler("save", &toxSaveEventHandler); ipc.registerEventHandler("save", &toxSaveEventHandler);
@ -262,7 +259,6 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
} }
#endif
// Autologin // Autologin
if (autoLogin) if (autoLogin)
@ -281,13 +277,11 @@ int main(int argc, char *argv[])
Nexus::getInstance().start(); Nexus::getInstance().start();
#ifndef Q_OS_ANDROID
// Event was not handled by already running instance therefore we handle it ourselves // Event was not handled by already running instance therefore we handle it ourselves
if (eventType == "uri") if (eventType == "uri")
handleToxURI(firstParam.toUtf8()); handleToxURI(firstParam.toUtf8());
else if (eventType == "save") else if (eventType == "save")
handleToxSave(firstParam.toUtf8()); handleToxSave(firstParam.toUtf8());
#endif
// Run // Run
int errorcode = a.exec(); int errorcode = a.exec();

47
src/nexus.cpp

@ -22,6 +22,7 @@
#include "src/persistence/profile.h" #include "src/persistence/profile.h"
#include "src/core/core.h" #include "src/core/core.h"
#include "src/core/coreav.h" #include "src/core/coreav.h"
#include "src/widget/widget.h"
#include "persistence/settings.h" #include "persistence/settings.h"
#include "video/camerasource.h" #include "video/camerasource.h"
#include "widget/gui.h" #include "widget/gui.h"
@ -33,13 +34,7 @@
#include <QApplication> #include <QApplication>
#include <cassert> #include <cassert>
#include <vpx/vpx_image.h> #include <vpx/vpx_image.h>
#ifdef Q_OS_ANDROID
#include <src/widget/androidgui.h>
#else
#include <src/widget/widget.h>
#include <QDesktopWidget> #include <QDesktopWidget>
#endif
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#include <QWindow> #include <QWindow>
@ -56,18 +51,13 @@ Nexus::Nexus(QObject *parent) :
QObject(parent), QObject(parent),
profile{nullptr}, profile{nullptr},
widget{nullptr}, widget{nullptr},
androidgui{nullptr},
loginScreen{nullptr} loginScreen{nullptr}
{ {
} }
Nexus::~Nexus() Nexus::~Nexus()
{ {
#ifdef Q_OS_ANDROID
delete androidgui;
#else
delete widget; delete widget;
#endif
delete loginScreen; delete loginScreen;
delete profile; delete profile;
Settings::getInstance().saveGlobal(); Settings::getInstance().saveGlobal();
@ -143,21 +133,14 @@ void Nexus::start()
void Nexus::showLogin() void Nexus::showLogin()
{ {
#ifdef Q_OS_ANDROID
delete androidui;
androidgui = nullptr;
#else
delete widget; delete widget;
widget = nullptr; widget = nullptr;
#endif
delete profile; delete profile;
profile = nullptr; profile = nullptr;
loginScreen->reset(); loginScreen->reset();
#ifndef Q_OS_ANDROID
loginScreen->move(QApplication::desktop()->screen()->rect().center() - loginScreen->rect().center()); loginScreen->move(QApplication::desktop()->screen()->rect().center() - loginScreen->rect().center());
#endif
loginScreen->show(); loginScreen->show();
((QApplication*)qApp)->setQuitOnLastWindowClosed(true); ((QApplication*)qApp)->setQuitOnLastWindowClosed(true);
} }
@ -170,17 +153,10 @@ void Nexus::showMainGUI()
loginScreen->close(); loginScreen->close();
// Create GUI // Create GUI
#ifndef Q_OS_ANDROID
widget = Widget::getInstance(); widget = Widget::getInstance();
#endif
// Start GUI // Start GUI
#ifdef Q_OS_ANDROID
androidgui = new AndroidGUI;
androidgui->show();
#else
widget->init(); widget->init();
#endif
GUI::getInstance(); GUI::getInstance();
// Zetok protection // Zetok protection
@ -191,21 +167,6 @@ void Nexus::showMainGUI()
// Connections // Connections
Core* core = profile->getCore(); Core* core = profile->getCore();
#ifdef Q_OS_ANDROID
connect(core, &Core::connected, androidgui, &AndroidGUI::onConnected);
connect(core, &Core::disconnected, androidgui, &AndroidGUI::onDisconnected);
//connect(core, &Core::failedToStart, androidgui, &AndroidGUI::onFailedToStartCore, Qt::BlockingQueuedConnection);
//connect(core, &Core::badProxy, androidgui, &AndroidGUI::onBadProxyCore, Qt::BlockingQueuedConnection);
connect(core, &Core::statusSet, androidgui, &AndroidGUI::onStatusSet);
connect(core, &Core::usernameSet, androidgui, &AndroidGUI::setUsername);
connect(core, &Core::statusMessageSet, androidgui, &AndroidGUI::setStatusMessage);
connect(core, &Core::selfAvatarChanged, androidgui, &AndroidGUI::onSelfAvatarLoaded);
connect(androidgui, &AndroidGUI::statusSet, core, &Core::setStatus);
//connect(androidgui, &AndroidGUI::friendRequested, core, &Core::requestFriendship);
//connect(androidgui, &AndroidGUI::friendRequestAccepted, core, &Core::acceptFriendRequest);
//connect(androidgui, &AndroidGUI::changeProfile, core, &Core::switchConfiguration);
#else
connect(core, &Core::connected, widget, &Widget::onConnected); connect(core, &Core::connected, widget, &Widget::onConnected);
connect(core, &Core::disconnected, widget, &Widget::onDisconnected); connect(core, &Core::disconnected, widget, &Widget::onDisconnected);
connect(core, &Core::failedToStart, widget, &Widget::onFailedToStartCore, Qt::BlockingQueuedConnection); connect(core, &Core::failedToStart, widget, &Widget::onFailedToStartCore, Qt::BlockingQueuedConnection);
@ -237,7 +198,6 @@ void Nexus::showMainGUI()
connect(widget, &Widget::statusSet, core, &Core::setStatus); connect(widget, &Widget::statusSet, core, &Core::setStatus);
connect(widget, &Widget::friendRequested, core, &Core::requestFriendship); connect(widget, &Widget::friendRequested, core, &Core::requestFriendship);
connect(widget, &Widget::friendRequestAccepted, core, &Core::acceptFriendRequest); connect(widget, &Widget::friendRequestAccepted, core, &Core::acceptFriendRequest);
#endif
profile->startCore(); profile->startCore();
} }
@ -276,11 +236,6 @@ void Nexus::setProfile(Profile* profile)
Settings::getInstance().loadPersonal(profile); Settings::getInstance().loadPersonal(profile);
} }
AndroidGUI* Nexus::getAndroidGUI()
{
return getInstance().androidgui;
}
Widget* Nexus::getDesktopGUI() Widget* Nexus::getDesktopGUI()
{ {
return getInstance().widget; return getInstance().widget;

3
src/nexus.h

@ -24,7 +24,6 @@
#include <QObject> #include <QObject>
class Widget; class Widget;
class AndroidGUI;
class Profile; class Profile;
class LoginScreen; class LoginScreen;
class Core; class Core;
@ -56,7 +55,6 @@ public:
static Core* getCore(); ///< Will return 0 if not started static Core* getCore(); ///< Will return 0 if not started
static Profile* getProfile(); ///< Will return 0 if not started static Profile* getProfile(); ///< Will return 0 if not started
static void setProfile(Profile* profile); ///< Delete the current profile, if any, and replaces it static void setProfile(Profile* profile); ///< Delete the current profile, if any, and replaces it
static AndroidGUI* getAndroidGUI(); ///< Will return 0 if not started
static Widget* getDesktopGUI(); ///< Will return 0 if not started static Widget* getDesktopGUI(); ///< Will return 0 if not started
static QString getSupportedImageFilter(); static QString getSupportedImageFilter();
static bool tryRemoveFile(const QString& filepath); ///< Dangerous way to find out if a path is writable static bool tryRemoveFile(const QString& filepath); ///< Dangerous way to find out if a path is writable
@ -94,7 +92,6 @@ private:
private: private:
Profile* profile; Profile* profile;
Widget* widget; Widget* widget;
AndroidGUI* androidgui;
LoginScreen* loginScreen; LoginScreen* loginScreen;
}; };

113
src/widget/androidgui.cpp

@ -1,113 +0,0 @@
/*
Copyright © 2015 by The qTox Project
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#include "androidgui.h"
#include "ui_android.h"
#include "friendlistwidget.h"
#include "maskablepixmapwidget.h"
#include "src/core/core.h"
#include "src/friend.h"
#include "src/friendlist.h"
#include "src/group.h"
#include "src/grouplist.h"
#include "src/persistence/settings.h"
#include "src/misc/style.h"
#include "src/nexus.h"
#include "src/widget/friendwidget.h"
#include "src/widget/groupwidget.h"
#include <QDebug>
#include <QKeyEvent>
#include <QLabel>
#include <QMenu>
#include <QFontDatabase>
#include <QFont>
AndroidGUI::AndroidGUI(QWidget *parent) :
QWidget(parent),
ui{new Ui::Android}
{
ui->setupUi(this);
QFontDatabase::addApplicationFont(":/res/android/Roboto-Bold.ttf");
QFont font("Roboto1200310", 24);
qDebug() << "Font: "<<font.family();
ui->headTitle->setFont(font);
Q_INIT_RESOURCE(android);
}
AndroidGUI::~AndroidGUI()
{
}
void AndroidGUI::reloadTheme()
{
}
void AndroidGUI::onSelfAvatarLoaded(const QPixmap& pic)
{
}
void AndroidGUI::onConnected()
{
if (beforeDisconnect == Status::Offline)
emit statusSet(Status::Online);
else
emit statusSet(beforeDisconnect);
}
void AndroidGUI::onDisconnected()
{
emit statusSet(Status::Offline);
}
void AndroidGUI::setUsername(const QString& username)
{
QString sanename = username;
sanename.remove(QRegExp("[\\t\\n\\v\\f\\r\\x0000]"));
nameMention = QRegExp("\\b" + QRegExp::escape(username) + "\\b", Qt::CaseInsensitive);
sanitizedNameMention = QRegExp("\\b" + QRegExp::escape(sanename) + "\\b", Qt::CaseInsensitive);
}
void AndroidGUI::setStatusMessage(const QString &statusMessage)
{
}
void AndroidGUI::onStatusSet(Status status)
{
}
void AndroidGUI::keyPressEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Back)
{
qDebug() << "Back key pressed, quitting";
qApp->exit(0);
}
else if (event->key() == Qt::Key_Menu)
{
qDebug() << "Menu key pressed";
}
}

70
src/widget/androidgui.h

@ -1,70 +0,0 @@
/*
Copyright © 2015 by The qTox Project
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ANDROIDGUI_H
#define ANDROIDGUI_H
#include "src/core/corestructs.h"
#include <QWidget>
class MaskablePixmapWidget;
class FriendListWidget;
class QKeyEvent;
namespace Ui {
class Android;
}
class AndroidGUI : public QWidget
{
Q_OBJECT
public:
explicit AndroidGUI(QWidget *parent = 0);
~AndroidGUI();
public slots:
void onConnected();
void onDisconnected();
void onStatusSet(Status status);
void onSelfAvatarLoaded(const QPixmap &pic);
void setUsername(const QString& username);
void setStatusMessage(const QString &statusMessage);
signals:
void friendRequestAccepted(const QString& userId);
void friendRequested(const QString& friendAddress, const QString& message);
void statusSet(Status status);
void statusSelected(Status status);
void usernameChanged(const QString& username);
void statusMessageChanged(const QString& statusMessage);
private:
void reloadTheme();
virtual void keyPressEvent(QKeyEvent* event) final override;
private:
Ui::Android* ui;
MaskablePixmapWidget* profilePicture;
FriendListWidget* contactListWidget;
Status beforeDisconnect = Status::Offline;
QRegExp nameMention, sanitizedNameMention;
};
#endif // ANDROIDGUI_H

25
src/widget/gui.cpp

@ -19,6 +19,7 @@
#include "gui.h" #include "gui.h"
#include "widget.h"
#include "src/nexus.h" #include "src/nexus.h"
#include <assert.h> #include <assert.h>
#include <QCoreApplication> #include <QCoreApplication>
@ -30,21 +31,12 @@
#include <QPushButton> #include <QPushButton>
#include <QThread> #include <QThread>
#ifdef Q_OS_ANDROID
#include "androidgui.h"
#else
#include "widget.h"
#endif
GUI::GUI(QObject *parent) : GUI::GUI(QObject *parent) :
QObject(parent) QObject(parent)
{ {
assert(QThread::currentThread() == qApp->thread()); assert(QThread::currentThread() == qApp->thread());
#ifndef Q_OS_ANDROID
assert(Nexus::getDesktopGUI()); assert(Nexus::getDesktopGUI());
connect(Nexus::getDesktopGUI(), &Widget::resized, this, &GUI::resized); connect(Nexus::getDesktopGUI(), &Widget::resized, this, &GUI::resized);
#endif
} }
GUI& GUI::getInstance() GUI& GUI::getInstance()
@ -239,19 +231,12 @@ QString GUI::passwordDialog(const QString& cancel, const QString& body)
void GUI::_clearContacts() void GUI::_clearContacts()
{ {
#ifdef Q_OS_ANDROID
#else
Nexus::getDesktopGUI()->clearContactsList(); Nexus::getDesktopGUI()->clearContactsList();
#endif
} }
void GUI::_setEnabled(bool state) void GUI::_setEnabled(bool state)
{ {
#ifdef Q_OS_ANDROID
Nexus::getAndroidGUI()->setEnabled(state);
#else
Nexus::getDesktopGUI()->setEnabled(state); Nexus::getDesktopGUI()->setEnabled(state);
#endif
} }
void GUI::_setWindowTitle(const QString& title) void GUI::_setWindowTitle(const QString& title)
@ -264,9 +249,7 @@ void GUI::_setWindowTitle(const QString& title)
void GUI::_reloadTheme() void GUI::_reloadTheme()
{ {
#ifndef Q_OS_ANDROID
Nexus::getDesktopGUI()->reloadTheme(); Nexus::getDesktopGUI()->reloadTheme();
#endif
} }
void GUI::_showInfo(const QString& title, const QString& msg) void GUI::_showInfo(const QString& title, const QString& msg)
@ -286,9 +269,7 @@ void GUI::_showError(const QString& title, const QString& msg)
void GUI::_showUpdateDownloadProgress() void GUI::_showUpdateDownloadProgress()
{ {
#ifndef Q_OS_ANDROID
Nexus::getDesktopGUI()->showUpdateDownloadProgress(); Nexus::getDesktopGUI()->showUpdateDownloadProgress();
#endif
} }
bool GUI::_askQuestion(const QString& title, const QString& msg, bool GUI::_askQuestion(const QString& title, const QString& msg,
@ -391,10 +372,6 @@ QString GUI::_passwordDialog(const QString& cancel, const QString& body)
QWidget* GUI::getMainWidget() QWidget* GUI::getMainWidget()
{ {
QWidget* maingui{nullptr}; QWidget* maingui{nullptr};
#ifdef Q_OS_ANDROID
maingui = Nexus::getAndroidGUI();
#else
maingui = Nexus::getDesktopGUI(); maingui = Nexus::getDesktopGUI();
#endif
return maingui; return maingui;
} }

2
src/widget/gui.h

@ -25,7 +25,7 @@
class QWidget; class QWidget;
/// Abstracts the GUI from the target backend (AndroidGUI, DesktopGUI, ...) /// Abstracts the GUI from the target backend (DesktopGUI, ...)
/// All the functions exposed here are thread-safe /// All the functions exposed here are thread-safe
/// Prefer calling this class to calling a GUI backend directly /// Prefer calling this class to calling a GUI backend directly
class GUI : public QObject class GUI : public QObject

8
src/widget/widget.cpp

@ -83,12 +83,6 @@
#include <QSignalMapper> #include <QSignalMapper>
#endif #endif
#ifdef Q_OS_ANDROID
#define IS_ON_DESKTOP_GUI 0
#else
#define IS_ON_DESKTOP_GUI 1
#endif
bool toxActivateEventHandler(const QByteArray&) bool toxActivateEventHandler(const QByteArray&)
{ {
Widget* widget = Nexus::getDesktopGUI(); Widget* widget = Nexus::getDesktopGUI();
@ -530,8 +524,6 @@ Widget::~Widget()
Widget* Widget::getInstance() Widget* Widget::getInstance()
{ {
assert(IS_ON_DESKTOP_GUI); // Widget must only be used on Desktop platforms
if (!instance) if (!instance)
instance = new Widget(); instance = new Widget();

Loading…
Cancel
Save