diff --git a/android.qrc b/android.qrc deleted file mode 100644 index a597f160a..000000000 --- a/android.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - img/android/search.png - img/android/menu.png - res/android/Roboto-Bold.ttf - res/android/Roboto-Light.ttf - res/android/Roboto-Regular.ttf - res/android/Roboto-Thin.ttf - - diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml deleted file mode 100644 index 628a296d2..000000000 --- a/android/AndroidManifest.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index d1ff36226..000000000 --- a/android/build.gradle +++ /dev/null @@ -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 - } -} diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 8fdbd03c1..000000000 --- a/android/gradle.properties +++ /dev/null @@ -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 diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a8..000000000 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 1e61d1fd3..000000000 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -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 diff --git a/android/gradlew b/android/gradlew deleted file mode 100755 index 91a7e269e..000000000 --- a/android/gradlew +++ /dev/null @@ -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 "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat deleted file mode 100644 index aec99730b..000000000 --- a/android/gradlew.bat +++ /dev/null @@ -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 diff --git a/android/local.properties b/android/local.properties deleted file mode 100644 index f7b883f4d..000000000 --- a/android/local.properties +++ /dev/null @@ -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 diff --git a/android/res/values/libs.xml b/android/res/values/libs.xml deleted file mode 100644 index 4d68673cb..000000000 --- a/android/res/values/libs.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - https://download.qt-project.org/ministro/android/qt5/qt-5.4 - - - - - - - - - - - - - - - - - - - - diff --git a/img/android/menu.png b/img/android/menu.png deleted file mode 100644 index 75394b35b..000000000 Binary files a/img/android/menu.png and /dev/null differ diff --git a/img/android/search.png b/img/android/search.png deleted file mode 100644 index 099b4c528..000000000 Binary files a/img/android/search.png and /dev/null differ diff --git a/qtox.pro b/qtox.pro index 5f6ec00b6..c10760305 100644 --- a/qtox.pro +++ b/qtox.pro @@ -23,7 +23,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qtox TEMPLATE = app FORMS += \ - src/android.ui \ src/loginscreen.ui \ src/mainwindow.ui \ src/chatlog/content/filetransferwidget.ui \ @@ -63,41 +62,6 @@ DEFINES += TIMESTAMP=$$TIMESTAMP DEFINES += LOG_TO_FILE 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) { } else { @@ -171,68 +135,62 @@ win32 { 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} } else { - android { - LIBS += -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns - LIBS += -llibjpeg -llibwebp -llibpng -llibtiff -llibjasper -lIlmImf - LIBS += -lopus -lvpx -lsodium -lopenal + isEmpty(PREFIX) { + PREFIX = /usr + } + + 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 { - isEmpty(PREFIX) { - PREFIX = /usr - } + LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lvpx -lsodium -lopenal -lavformat -lavdevice -lavcodec -lavutil -lswscale + LIBS += -lqrencode -lsqlcipher + } - BINDIR = $$PREFIX/bin - DATADIR = $$PREFIX/share - target.path = $$BINDIR - desktop.path = $$DATADIR/applications - desktop.files += qTox.desktop - INSTALLS += target desktop + contains(DEFINES, QTOX_PLATFORM_EXT) { + LIBS += -lX11 -lXss + } - # 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) { - 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 + LIBS += -Wl,-Bstatic -lfilteraudio } else { - LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lvpx -lsodium -lopenal -lavformat -lavdevice -lavcodec -lavutil -lswscale - LIBS += -lqrencode -lsqlcipher + LIBS += -lfilteraudio } + } - 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) { - 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) { - LIBS += -lgobject-2.0 -lappindicator -lgtk-x11-2.0 - } - LIBS += -s + 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 + contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) { + LIBS += -lgobject-2.0 -lappindicator -lgtk-x11-2.0 } + LIBS += -s } } } -unix:!macx:!android { +unix:!macx { # The systray Unity backend implements the system tray icon on Unity (Ubuntu) and GNOME desktops. contains(ENABLE_SYSTRAY_UNITY_BACKEND, YES) { 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 { HEADERS += \ src/platform/camera/directshow.h @@ -430,97 +258,111 @@ macx { src/platform/camera/avfoundation.mm } -SOURCES += \ - src/audio/audio.cpp \ - 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 +RESOURCES += res.qrc \ + smileys/smileys.qrc -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/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/coreav.h \ src/core/coredefines.h \ src/core/corefile.h \ src/core/corestructs.h \ - src/persistence/historykeeper.h \ - src/nexus.h \ src/core/cdata.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/db/genericddinterface.h \ src/persistence/db/plaindb.h \ src/persistence/db/encrypteddb.h \ + src/video/videosurface.h \ + src/video/netcamview.h \ src/video/videoframe.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/net/toxme.h \ - src/persistence/profilelocker.h \ - src/net/avatarbroadcaster.h \ src/widget/tool/screenshotgrabber.h \ src/widget/tool/screengrabberchooserrectitem.h \ src/widget/tool/screengrabberoverlayitem.h \ src/widget/tool/toolboxgraphicsitem.h \ src/widget/tool/flyoutoverlaywidget.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/persistence/settingsserializer.h \ src/widget/notificationscrollarea.h \ src/widget/notificationedgewidget.h \ src/widget/circlewidget.h \ @@ -534,12 +376,122 @@ HEADERS += \ src/widget/tool/micfeedbackwidget.h \ src/widget/tool/removefrienddialog.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/persistence/db/rawdatabase.h \ - src/persistence/history.h \ src/widget/form/groupinviteform.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 diff --git a/res/android/Roboto-Bold.ttf b/res/android/Roboto-Bold.ttf deleted file mode 100644 index 0f0869cd0..000000000 Binary files a/res/android/Roboto-Bold.ttf and /dev/null differ diff --git a/res/android/Roboto-BoldItalic.ttf b/res/android/Roboto-BoldItalic.ttf deleted file mode 100644 index ecb1d7295..000000000 Binary files a/res/android/Roboto-BoldItalic.ttf and /dev/null differ diff --git a/res/android/Roboto-Italic.ttf b/res/android/Roboto-Italic.ttf deleted file mode 100644 index 053605165..000000000 Binary files a/res/android/Roboto-Italic.ttf and /dev/null differ diff --git a/res/android/Roboto-Light.ttf b/res/android/Roboto-Light.ttf deleted file mode 100644 index d97616153..000000000 Binary files a/res/android/Roboto-Light.ttf and /dev/null differ diff --git a/res/android/Roboto-LightItalic.ttf b/res/android/Roboto-LightItalic.ttf deleted file mode 100644 index f6c2b01d9..000000000 Binary files a/res/android/Roboto-LightItalic.ttf and /dev/null differ diff --git a/res/android/Roboto-Regular.ttf b/res/android/Roboto-Regular.ttf deleted file mode 100644 index 9cbafd652..000000000 Binary files a/res/android/Roboto-Regular.ttf and /dev/null differ diff --git a/res/android/Roboto-Thin.ttf b/res/android/Roboto-Thin.ttf deleted file mode 100644 index 29be04cc4..000000000 Binary files a/res/android/Roboto-Thin.ttf and /dev/null differ diff --git a/res/android/Roboto-ThinItalic.ttf b/res/android/Roboto-ThinItalic.ttf deleted file mode 100644 index 55c412568..000000000 Binary files a/res/android/Roboto-ThinItalic.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-Bold.ttf b/res/android/RobotoCondensed-Bold.ttf deleted file mode 100644 index 02d3d15cd..000000000 Binary files a/res/android/RobotoCondensed-Bold.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-BoldItalic.ttf b/res/android/RobotoCondensed-BoldItalic.ttf deleted file mode 100644 index f64d0099f..000000000 Binary files a/res/android/RobotoCondensed-BoldItalic.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-Italic.ttf b/res/android/RobotoCondensed-Italic.ttf deleted file mode 100644 index 4d81136d2..000000000 Binary files a/res/android/RobotoCondensed-Italic.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-Light.ttf b/res/android/RobotoCondensed-Light.ttf deleted file mode 100644 index 681b76021..000000000 Binary files a/res/android/RobotoCondensed-Light.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-LightItalic.ttf b/res/android/RobotoCondensed-LightItalic.ttf deleted file mode 100644 index dafa3a0b5..000000000 Binary files a/res/android/RobotoCondensed-LightItalic.ttf and /dev/null differ diff --git a/res/android/RobotoCondensed-Regular.ttf b/res/android/RobotoCondensed-Regular.ttf deleted file mode 100644 index 9707f66a0..000000000 Binary files a/res/android/RobotoCondensed-Regular.ttf and /dev/null differ diff --git a/src/android.ui b/src/android.ui deleted file mode 100644 index 4351c1b66..000000000 --- a/src/android.ui +++ /dev/null @@ -1,391 +0,0 @@ - - - Android - - - - 0 - 0 - 320 - 480 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - - 56 - 56 - - - - - - - - - 103 - 58 - 183 - - - - - - - 103 - 58 - 183 - - - - - - - - - 103 - 58 - 183 - - - - - - - 103 - 58 - 183 - - - - - - - - - 103 - 58 - 183 - - - - - - - 103 - 58 - 183 - - - - - - - - true - - - - 24 - - - 12 - - - 12 - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - :/img/android/menu.png - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 128 - 128 - 128 - - - - - - - 128 - 128 - 128 - - - - - - - 128 - 128 - 128 - - - - - - - - - 24 - - - - qTox - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - :/img/android/search.png - - - true - - - - - - - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::NoSelection - - - - 0 - 36 - - - - QListView::ListMode - - - false - - - - Someone - - - - - Someone else - - - - - Groupbot - - - - - That guy who I don't remember adding - - - - - NASA manager - - - - - Lorem - - - - - Ipsum - - - - - Dolor - - - - - - - - - - - - - diff --git a/src/ipc.cpp b/src/ipc.cpp index 31aae4fc9..ee06ddc06 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -86,9 +86,6 @@ IPC::~IPC() IPC& IPC::getInstance() { -#ifdef Q_OS_ANDROID - Q_ASSERT(0 && "IPC can not be used on android"); -#endif static IPC instance; return instance; } diff --git a/src/main.cpp b/src/main.cpp index b48623f98..2bf86c822 100644 --- a/src/main.cpp +++ b/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.process(a); -#ifndef Q_OS_ANDROID IPC& ipc = IPC::getInstance(); -#endif if (sodium_init() < 0) // For the auto-updater { @@ -212,7 +210,6 @@ int main(int argc, char *argv[]) QString profileName; bool autoLogin = Settings::getInstance().getAutoLogin(); -#ifndef Q_OS_ANDROID // Inter-process communication ipc.registerEventHandler("uri", &toxURIEventHandler); ipc.registerEventHandler("save", &toxSaveEventHandler); @@ -262,7 +259,6 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } } -#endif // Autologin if (autoLogin) @@ -281,13 +277,11 @@ int main(int argc, char *argv[]) Nexus::getInstance().start(); -#ifndef Q_OS_ANDROID // Event was not handled by already running instance therefore we handle it ourselves if (eventType == "uri") handleToxURI(firstParam.toUtf8()); else if (eventType == "save") handleToxSave(firstParam.toUtf8()); -#endif // Run int errorcode = a.exec(); diff --git a/src/nexus.cpp b/src/nexus.cpp index bcbb2f30f..4641ea6b6 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -22,6 +22,7 @@ #include "src/persistence/profile.h" #include "src/core/core.h" #include "src/core/coreav.h" +#include "src/widget/widget.h" #include "persistence/settings.h" #include "video/camerasource.h" #include "widget/gui.h" @@ -33,13 +34,7 @@ #include #include #include - -#ifdef Q_OS_ANDROID -#include -#else -#include #include -#endif #ifdef Q_OS_MAC #include @@ -56,18 +51,13 @@ Nexus::Nexus(QObject *parent) : QObject(parent), profile{nullptr}, widget{nullptr}, - androidgui{nullptr}, loginScreen{nullptr} { } Nexus::~Nexus() { -#ifdef Q_OS_ANDROID - delete androidgui; -#else delete widget; -#endif delete loginScreen; delete profile; Settings::getInstance().saveGlobal(); @@ -143,21 +133,14 @@ void Nexus::start() void Nexus::showLogin() { -#ifdef Q_OS_ANDROID - delete androidui; - androidgui = nullptr; -#else delete widget; widget = nullptr; -#endif delete profile; profile = nullptr; loginScreen->reset(); -#ifndef Q_OS_ANDROID loginScreen->move(QApplication::desktop()->screen()->rect().center() - loginScreen->rect().center()); -#endif loginScreen->show(); ((QApplication*)qApp)->setQuitOnLastWindowClosed(true); } @@ -170,17 +153,10 @@ void Nexus::showMainGUI() loginScreen->close(); // Create GUI -#ifndef Q_OS_ANDROID widget = Widget::getInstance(); -#endif // Start GUI -#ifdef Q_OS_ANDROID - androidgui = new AndroidGUI; - androidgui->show(); -#else widget->init(); -#endif GUI::getInstance(); // Zetok protection @@ -191,21 +167,6 @@ void Nexus::showMainGUI() // Connections 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::disconnected, widget, &Widget::onDisconnected); 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::friendRequested, core, &Core::requestFriendship); connect(widget, &Widget::friendRequestAccepted, core, &Core::acceptFriendRequest); -#endif profile->startCore(); } @@ -276,11 +236,6 @@ void Nexus::setProfile(Profile* profile) Settings::getInstance().loadPersonal(profile); } -AndroidGUI* Nexus::getAndroidGUI() -{ - return getInstance().androidgui; -} - Widget* Nexus::getDesktopGUI() { return getInstance().widget; diff --git a/src/nexus.h b/src/nexus.h index 95f132223..7ac497071 100644 --- a/src/nexus.h +++ b/src/nexus.h @@ -24,7 +24,6 @@ #include class Widget; -class AndroidGUI; class Profile; class LoginScreen; class Core; @@ -56,7 +55,6 @@ public: static Core* getCore(); ///< 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 AndroidGUI* getAndroidGUI(); ///< Will return 0 if not started static Widget* getDesktopGUI(); ///< Will return 0 if not started static QString getSupportedImageFilter(); static bool tryRemoveFile(const QString& filepath); ///< Dangerous way to find out if a path is writable @@ -94,7 +92,6 @@ private: private: Profile* profile; Widget* widget; - AndroidGUI* androidgui; LoginScreen* loginScreen; }; diff --git a/src/widget/androidgui.cpp b/src/widget/androidgui.cpp deleted file mode 100644 index 507c92dae..000000000 --- a/src/widget/androidgui.cpp +++ /dev/null @@ -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 . -*/ - - -#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 -#include -#include -#include -#include -#include - -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: "<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"; - } -} diff --git a/src/widget/androidgui.h b/src/widget/androidgui.h deleted file mode 100644 index 2c1c27700..000000000 --- a/src/widget/androidgui.h +++ /dev/null @@ -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 . -*/ - - -#ifndef ANDROIDGUI_H -#define ANDROIDGUI_H - -#include "src/core/corestructs.h" -#include - -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 diff --git a/src/widget/gui.cpp b/src/widget/gui.cpp index 9112e99b3..35eb6921a 100644 --- a/src/widget/gui.cpp +++ b/src/widget/gui.cpp @@ -19,6 +19,7 @@ #include "gui.h" +#include "widget.h" #include "src/nexus.h" #include #include @@ -30,21 +31,12 @@ #include #include -#ifdef Q_OS_ANDROID -#include "androidgui.h" -#else -#include "widget.h" -#endif - GUI::GUI(QObject *parent) : QObject(parent) { assert(QThread::currentThread() == qApp->thread()); - -#ifndef Q_OS_ANDROID assert(Nexus::getDesktopGUI()); connect(Nexus::getDesktopGUI(), &Widget::resized, this, &GUI::resized); -#endif } GUI& GUI::getInstance() @@ -239,19 +231,12 @@ QString GUI::passwordDialog(const QString& cancel, const QString& body) void GUI::_clearContacts() { -#ifdef Q_OS_ANDROID -#else Nexus::getDesktopGUI()->clearContactsList(); -#endif } void GUI::_setEnabled(bool state) { -#ifdef Q_OS_ANDROID - Nexus::getAndroidGUI()->setEnabled(state); -#else Nexus::getDesktopGUI()->setEnabled(state); -#endif } void GUI::_setWindowTitle(const QString& title) @@ -264,9 +249,7 @@ void GUI::_setWindowTitle(const QString& title) void GUI::_reloadTheme() { -#ifndef Q_OS_ANDROID Nexus::getDesktopGUI()->reloadTheme(); -#endif } 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() { -#ifndef Q_OS_ANDROID Nexus::getDesktopGUI()->showUpdateDownloadProgress(); -#endif } 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* maingui{nullptr}; -#ifdef Q_OS_ANDROID - maingui = Nexus::getAndroidGUI(); -#else maingui = Nexus::getDesktopGUI(); -#endif return maingui; } diff --git a/src/widget/gui.h b/src/widget/gui.h index e76977ff7..bdbd96ba9 100644 --- a/src/widget/gui.h +++ b/src/widget/gui.h @@ -25,7 +25,7 @@ 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 /// Prefer calling this class to calling a GUI backend directly class GUI : public QObject diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index b3f07ef0f..4cc4c14aa 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -83,12 +83,6 @@ #include #endif -#ifdef Q_OS_ANDROID -#define IS_ON_DESKTOP_GUI 0 -#else -#define IS_ON_DESKTOP_GUI 1 -#endif - bool toxActivateEventHandler(const QByteArray&) { Widget* widget = Nexus::getDesktopGUI(); @@ -530,8 +524,6 @@ Widget::~Widget() Widget* Widget::getInstance() { - assert(IS_ON_DESKTOP_GUI); // Widget must only be used on Desktop platforms - if (!instance) instance = new Widget();