diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 71842bc..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-CMakeLists.txt.user*
-friendiqa.pro.user*
-IJPSvd.json
diff --git a/BackgroundSync.patch b/BackgroundSync.patch
deleted file mode 100644
index 263f528..0000000
--- a/BackgroundSync.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/common/alarmlinux.cpp
-+++ src/common/alarmlinux.cpp
-@@ -67,7 +67,7 @@
- stream << "Description=Run friendiqa background sync" << Qt::endl << Qt::endl;
- stream << "[Service]" << Qt::endl;
- stream << "Type=oneshot" << Qt::endl;
-- stream << "ExecStart=/usr/bin/friendiqa -service" << Qt::endl;
-+ stream << "ExecStart=flatpak run de.manic.friendiqa -service" << Qt::endl;
- }
-
- QString nameTimer ="friendiqa-sync.timer";
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 81cab7a..953d3e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,219 +1,82 @@
-## v0.6.9
-
-* Separate window for new messages with more formatting options
-* Replaced all Fontawesome icons with system icons
-* Switch between OAuth2 and Basic Auth
-* Background sync with systemd-timer and removal of system tray
-
-## v0.6.8
-
-* OAuth2 as signup method
-* New translation: Dutch
-
-## v0.6.7
-
-* Upload multiple images for post and add image descriptions
-* Block user
-* Report user
-* Create Calendar entry from post text
-
-## v0.6.6
-
-* Create event
-* Delete event
-* New sorting of conversations
-
-## v0.6.5
-
-* Fix reply in Friendica 3/2022 version due to API bug
-* Image downloads work again
-* Some additional emojis
-
-## v0.6.4
-
-* Search for new contacts (hashtags, names)
-* Filter contacts
-* many new emojis
-* Replaced Favorite button with Reply button due to buggy Favourite API
-* Rebuild contacts handling due to buggy Contacts API
-* Removed permissions for new messages due to buggy Contacts API
-* Sync all accounts in background (not only active)
-
-## v0.6.3
-
-* Dark theme
-* Account Page: list of largest servers for server field
-* Settings page: Tabs for different settings
-* Conversation opens on short click on news item
-* Linux: Option to Autostart on System start
-
-## v0.6.2
-
-* Follow and Unfollow contacts (Friendica 2021.07 required)
-* Linux: App stays in systemtray after close, syncs in background
-* bugfix for bulk image upload and download of public images
-* bugfix for conversations in timeline
-
-## v0.6.1
-
-* Add requestLegacyExternalStorage in AndroidManifest for attachment permissions
-* Refresh timeline on start for Linux
-* DropArea bugfix for Flatpak
-
-## v0.6
-
-* New language: Hungarian thank to urbalazs (https://www.urbalazs.hu)
-* Multiple photos in post open in separate slideshow
-* Layout redesign
-* Adaptive sidebar
-* Sync Friendship Requests, approve/deny/ignore requests
-* Events: show upcoming events below calendar
-* Linux: Drag&Drop for new messages and photo upload
-* Linux: Remember app size
-
-## v0.5.3
-
-* Implementation of new events API (incl. sync and notification) for Friendica version >= 20.03
-* Indentation to see replied to newsitem for conversation view
-* News view type config moved from account page to config page
-* Simplification of account page on first start
-* Bugfixes
-
-## v0.5.2
-
-* Redesign of news item
-* Background sync for Android >8.0
-* Bugfixes
-
-## v0.5.1
-
-* Videos open in full screen
-* Youtube videos open in app
-* Option to minimize #nsfw post
-* Rotate image in messageSend component
-
-## v0.5
-
-* Redesign due to QML Components 1 being deprecated in Qt 5.12: Slideview for News, left Drawer for Settings, message creation in listview header
-* Android Notifications for News, DMs, Replies
-* Global app config separated from account config
-
-## v0.4
-
-* Background sync for friends timeline (interval on config page must be > 0) for Android > 5
-* Replies timeline
-* Bugfix: App asks for storage permission on first start
-
-## v0.3.4
-
-* Direct message creation from profile page works again
-* Profile image upload works again
-* Viewing private album pictures of contacts works again
-* On first start servername from https://dir.friendica.social/servers/surprise selected
-* Register button opens webview of registration page on server
-
-## v0.3.3
-
-* Update for OpenSSL and At
-* Experimental support for Peertube (links are expanded to video widget)
-* Some Unicode emojis
-* Redesign of contact details (click on contact opens in new stack and shows last news)
-
-## v0.3.2
-
-* For news containing url ending with mp3, mp4, avi, webm, ogg: media can be played in app
-* Pictures can be renamed or moved to another album
-* Bugfix: random crashes for conversations
-* Bugfix: attach image to message works again
-* Bugfix: check for nickname on Server has been removed due to API change
-
-## v0.3.1
-
-* By popular demand: Conversations open in a new stack, like in Twidere
-* Conversations open after (long) press on news, like in Twidere
-* Image attachments are shown below text and can be enlarged, like in Twidere (solves issue #8)
-* New messages are html, line breaks work (solves issue #7)
-
-## v0.3
-
-* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
-* Refactoring of news part
-* Search button for news
-* Click on hashtag in newsitem starts search for news with that word
-* Public timeline
-* Timeline for selected group
-* Small redesign of SendMessage page
-
-## v0.2.2
-
-* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
-* Link to list of public server on Config Tab
-* Small redesign of SendMessage page
-* Intents for texts/urls (Send text or url from everywhere to create message)
-
-## v0.2.1
-
-* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
-* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
-* Long posts are automatically truncated
-* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
-
-## v0.2
-
-# News
-
-* Profile image download completely reworked, resulting in speed improvement
-
-# Contacts
-
-* New profile tab, data of public and private profiles shown
-* Change profile picture
-* For friends image button shows private images thanks to new remoteAuth API (Friendica 3.6 server required) --> private holiday pictures have finally arrived!
-* For friends calendar button shows private events thanks to new remoteAuth API (Friendica 3.6 server required)
-* News button for forum accounts shows news published via that forum
-
-# Images
-
-* Complete rework of image download, fixes bug with private images
-* Download all or only new images
-
-# Config
-
-* Check if nickname exist on server
-* Check if password is correct
-* Account deletion now also removes news, image data and events from local db
-
-# Translations
-
-* Italian thanks to Davide de Prisco
-
-## v0.1.2##
-
-* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
-
-## v0.1.1##
-
-* FIX: Spanish translation
-* FIX: Empty Newsview after deletion of first newsitem
-
## v0.1##
-# News
-* Native Android image selector for new message
-* Click on contacts shows contact details on news page
-* Fix problem with news list after deletion of item
+# News #
-# Contacts
+* Native Android image selector for new message
+* Click on contacts shows contact details on news page
+* Fix problem with news list after deletion of item
-* Clean contacts with no news
+# Contacts #
+* Clean contacts with no news
-# Images
+# Images #
+* Upload pictures with description to album (permissions cannot be set due to API problems)
+* Delete pictures or albums from client and server (long press on picture in overview)
+* Fix problem when enlarging photo
-* Upload pictures with description to album (permissions cannot be set due to API problems)
-* Delete pictures or albums from client and server (long press on picture in overview)
-* Fix problem when enlarging photo
+# Translations #
+* German, Spanish
-# Translations
-* German, Spanish
+
+## v0.1.1##
+* FIX: Spanish translation
+* FIX: Empty Newsview after deletion of first newsitem
+
+
+
+## v0.1.2#
+* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
+
+
+## v0.2 ##
+# News #
+* Profile image download completely reworked, resulting in speed improvement
+
+# Contacts #
+* New profile tab, data of public and private profiles shown
+* Change profile picture
+* For friends image button shows private images thanks to new remoteAuth API (Friendica 3.6 server required) --> private holiday pictures have finally arrived!
+* For friends calendar button shows private events thanks to new remoteAuth API (Friendica 3.6 server required)
+* News button for forum accounts shows news published via that forum
+
+# Images #
+* Complete rework of image download, fixes bug with private images
+* Download all or only new images
+
+# Config #
+* Check if nickname exist on server
+* Check if password is correct
+* Account deletion now also removes news, image data and events from local db
+
+# Translations #
+* Italian thanks to Davide de Prisco
+
+## v0.2.1 ##
+* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
+* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
+* Long posts are automatically truncated
+* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
+
+## v0.2.2 ##
+* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
+* Link to list of public server on Config Tab
+* Small redesign of SendMessage page
+* Intents for texts/urls (Send text or url from everywhere to create message)
+
+
+## v0.3 ##
+* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
+* Refactoring of news part
+* Search button for news
+* Click on hashtag in newsitem starts search for news with that word
+* Public timeline
+* Timeline for selected group
+* Small redesign of SendMessage page
+
+## v0.3.1 ##
+* By popular demand: Conversations open in a new stack, like in Twidere
+* Conversations open after (long) press on news, like in Twidere
+* Image attachments are shown below text and can be enlarged, like in Twidere (solves issue #8)
+* New messages are html, line breaks work (solves issue #7)
diff --git a/FlatpakAutostart.patch b/FlatpakAutostart.patch
deleted file mode 100644
index 0905eb1..0000000
--- a/FlatpakAutostart.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- source-linux/common/filesystem.cpp
-+++ source-linux/common/filesystem.cpp
-@@ -165,7 +165,7 @@
- QTextStream stream(&file);
- stream << "[Desktop Entry]" << Qt::endl;
- stream << "Name=Friendiqa" << Qt::endl;
-- stream << "Exec=friendiqa -background %u" << Qt::endl;
-+ stream << "Exec=flatpak run de.manic.friendiqa -background %u" << Qt::endl;
- stream << "Terminal=false" << Qt::endl;
- stream << "Icon=Friendiqa.svg" << Qt::endl;
- stream << "Type=Application" << Qt::endl;
-
diff --git a/Friendiqa_v0.3.1.apk b/Friendiqa_v0.3.1.apk
new file mode 100644
index 0000000..0091db5
Binary files /dev/null and b/Friendiqa_v0.3.1.apk differ
diff --git a/PrivacyPolicy.md b/PrivacyPolicy.md
deleted file mode 100644
index 716bb9e..0000000
--- a/PrivacyPolicy.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## Privacy Policy##
-
-
-You have probably selected Friendica as your preferred social network because you have doubts about privacy on the well-known global networks. I as the developer of Friendiqa try to take privacy very seriously.
-
-Storing some pieces of user data on the device is necessary for some app features, other apps on your device may not access this data (keeping app’s own database storage protected from other apps is guaranteed by Android). The app has been programmed so that stored information contain any personal data (only login data and id number of last seen post will be transferred to servers). Photos from the albums and contact images are stored in a public directory on the device. Other apps may access these files and the Friendiqa needs access to this directory.
-To send images from the Android gallery the app needs access to picture databases on the device.
-This app doesn’t collect any usage statistics. In addition, no information is sent from your smartphone to me as a developer or to a website associated with me.
diff --git a/README.md b/README.md
index e80c04c..14ade80 100644
--- a/README.md
+++ b/README.md
@@ -1,134 +1,122 @@
-## Friendiqa
-
-QML based client for the Friendica Social Network. Tabs for news (incl. Direct Messages), friends, photos and events. OS: currently Linux and Android (4.3 Jelly Bean, 5.1 for background sync). Source code is a QtCreator project.
-
-## Screenshots
-
-    
-
-## Features
-
-# News
-
-Currently supported:
-
-* Shows Posts from friends, replies, Direct Messages and notifications (in swipe view), selected group, replies, favorited messages, public timeline
-* Background sync with configurable interval of 15 min to 2h for active user for friends timeline, replies and DMs (Android 5.1 required)
-* Android notifications or Dbus notification (Linux) for new items in friends timeline, replies and DMs
-* Search for news
-* Click on hashtag in newsitem starts search for news with that word
-* Only first photo attachment in post is shown, click for more images and fullscreen image
-* Click on video shows video fullscreen
-* For news containing urls ending with mp3, mp4, avi, webm, ogg or to a Peertube instance: media can be played in the app
-* Open links in external browser
-* Click on contact photo for contact details and last news
-* Click on like text for additional contact info
-* Click on post text opens conversation
-* Deletion, Reposting, Answering of Posts
-* Expand truncated news items
-* Liking, disliking
-* Attending for event posts
-* Update fetches new posts (up to last 50) since last in local DB
-* More shows older posts from local DB
-* Create new Message with images or direct messages, smileys in new window
-* Send image(s) from Android gallery
-* Send text or urls from other apps to Friendiqa
-* Native Android image dialog
-
-ToDo:
-
-* Videos and other binary data as attachment (sending, not supported in API)
-* Attachments for Direct messages (currently not supported in API)
-
-# Friends
-
-Currently supported:
-
-* Tabs for own profiles, friends, other contacts and groups
-* Show profile(s) of user and change profile picture
-* List of all known contacts with locally downloaded pictures
-* Follow/unfollow or block/unblock contacts
-* Search for new contacts according to topic
-* Show follow requests; approve, deny, ignore requests
-* Additional information, last messages and other functionality shown in news tab
-* Show public and private pictures of contact (screenscraping of contact's website, works only with certain theme)
-* Show public and private events of contact
-* Show members of groups
-* Open website of contact
-* Clean other contacts with no news
-
-ToDo:
-
-* More information for contact from description page, possibly private information for friends (needs API change)
-* Groups: create, change, delete (needs API change)
-
-# Images
-
-Currently supported:
-
-* Download public own images to local directory (API is currently broken)
-* Upload public picture to album with descriptions, send from gallery (API is currently broken)
-* Delete own pictures and albums on client and server
-* Change name or album of existing picture
-* Show albums in grid, show images in album in grid and fullscreen
-* Show public albums and images of contacts
-* Pinch to zoom, swipe to scroll
-
-ToDo:
-
-* Upload private images
-
-# Events
-
-Currently supported:
-
-* Show own events
-* Show public events of Friendica contacts
-* List view of events of selected date
-* Click on event to show details
-* Create event
-* Delete event
-
-ToDo
-
-* Show more details and attendance of events (needs API)
-
-# Config/Accounts
-
-Currently supported:
-
-* Multiple accounts
-* Dark Mode
-* View mode for news (conversation tree or timeline)
-* Maximum news (deleted after use of Quit button)
-* Set default news tabs
-* Sync home timeline, replies, DM, Events, friend requests; Notify yes/no
-* Hide #nsfw
-* OAuth2 as authorization method
-
-# Other
-
-* on Linux: syncs in background via systemd-timer
-
-ToDo
-
-* Video tab
-* Translation
-* Blingbling
-
-# Translations
-
-* German, Spanish, Italian, Hungarian, Dutch
-* To contribute translations:
-
-# Install
-
-* F-Droid binary repository: or for those who get the "error getting index file" from F-Droid client due to outdated crypto libraries the url without encryption: To include repo in Fdroid: Open config --> package sources --> plus symbol --> paste url
-* [Google Playstore](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa)
-* Arch User Repository:
-* Flatpak:
-* Flatpak for Mobile Linux:
-
-## License
-
-Pubished under the [GPL v3](http://gplv3.fsf.org) with the exception of the Openssl library, which is published under OpenSSL License.
+## Friendiqa ##
+
+QML based client for the Friendica Social Network.
+ Tabs for news (incl. Direct Messages), friends, photos and events.
+ OS: currently Linux and Android (4.3 Jelly Bean).
+ Source code is a QtCreator project.
+
+## Screenshots ##
+
+
+
+
+
+
+
+
+## Features ##
+
+# News #
+Currently supported:
+* Shows Posts from friends, selected group, favorited messages, public timeline, Direct Messages and notifications
+* Search button for news
+* Click on hashtag in newsitem starts search for news with that word
+* Click on image shows image fullscreen
+* Open links in external browser
+* Click on contact photo for contact details
+* Click on like text for additional contact info
+* Deletion, Reposting, Answering of Posts
+* Expand truncated news items
+* Liking, disliking, favoriting
+* Attending for event posts
+* Update fetches new posts (up to last 50) since last in local DB
+* More shows older posts from local DB
+* Create new Message with images or direct messages, Contact/Group access rights(can be stored), smileys
+* Send image from Android gallery
+* Send text or urls from other apps to Friendiqa
+* Native Android image dialog
+
+ToDo:
+
+* Videos and other binary data as attachment (sending and receiving)
+* More than one attachment (currently not supported in API)
+* Rich text editing in Send Dialog (currently not possible in QML)
+* Attachments for Direct messages (currently not supported in API)
+
+
+# Friends #
+Currently supported:
+
+* Tabs for own profiles, friends, other contacts and groups
+* Show profile(s) of user and change profile picture
+* Grid of all known contacts with locally downloaded pictures
+* Large friend item for additional information and functionality
+* Show news of contact from local database
+* Send direct message, if contact is following
+* Show public and private (Friendica 3.6 required) pictures of contact (screenscraping of contact's website, works only with certain theme)
+* Show public and private (Friendica 3.6 required) events of contact
+* Show members of groups
+* Open website of contact or connect page (for other contacts)
+* Clean other contacts with no news
+
+ToDo:
+* More information for contact from description page, possibly private information for friends
+ (needs API change)
+* Groups: create, change, delete
+ (needs API change)
+
+
+# Images #
+Currently supported:
+* Download public and private own images to local directory
+* Upload picture to album with descriptions(public), send from gallery
+* Delete own pictures and albums on client and server
+* Show albums in grid, show images in album in grid and fullscreen
+* Show public and private (Friendica 3.6 server required) albums and images of contacts
+* Pinch to zoom, swipe to scroll
+
+ToDo:
+* Change name or album of existing picture
+* Upload private images
+
+
+# Events #
+* Download own public events
+* Show public and private events of Friendica contacts (Friendica 3.6 server required)
+* List view of events of selected date
+* Click on event to show details
+
+ToDo
+* Show own private events (needs API)
+* Create events (needs API)
+
+
+# Config #
+Currently supported:
+* Multiple accounts
+* Maximum news (deleted after use of Quit button)
+* View mode for news (tree or timeline)
+
+ToDo
+* OAuth?
+
+
+# Other #
+ToDo
+* Video tab
+* Translation
+* Blingbling
+
+
+# Translations #
+* German, Spanish, Italian
+
+
+# Install #
+* F-Droid binary repository: [https://www.ma-nic.de/fdroid/repo](https://www.ma-nic.de/fdroid/repo) or for those who get the "error getting index file" from F-Droid client due to outdated crypto libraries the url without encryption: [http://www.ma-nic.de/fdroid/repo](http://www.ma-nic.de/fdroid/repo)
+* [Google Playstore](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa)
+
+
+## License ##
+Pubished under the [GPL v3](http://gplv3.fsf.org) with the exception of the Openssl library, which is published under OpenSSL License.
+
diff --git a/Screenshots/ConfigTab.jpg b/Screenshots/ConfigTab.jpg
index ca61dc3..ed2b9da 100644
Binary files a/Screenshots/ConfigTab.jpg and b/Screenshots/ConfigTab.jpg differ
diff --git a/Screenshots/EventsTab.jpg b/Screenshots/EventsTab.jpg
index 703860f..3439b05 100644
Binary files a/Screenshots/EventsTab.jpg and b/Screenshots/EventsTab.jpg differ
diff --git a/Screenshots/FriendsTab.jpg b/Screenshots/FriendsTab.jpg
index 83bbe17..6258f55 100644
Binary files a/Screenshots/FriendsTab.jpg and b/Screenshots/FriendsTab.jpg differ
diff --git a/Screenshots/LeftDrawer.jpg b/Screenshots/LeftDrawer.jpg
deleted file mode 100644
index 7facd16..0000000
Binary files a/Screenshots/LeftDrawer.jpg and /dev/null differ
diff --git a/Screenshots/NewMessage.jpg b/Screenshots/NewMessage.jpg
deleted file mode 100644
index bcff846..0000000
Binary files a/Screenshots/NewMessage.jpg and /dev/null differ
diff --git a/Screenshots/NewsTab.jpg b/Screenshots/NewsTab.jpg
index dc0817d..047f7f4 100644
Binary files a/Screenshots/NewsTab.jpg and b/Screenshots/NewsTab.jpg differ
diff --git a/Screenshots/PhotoTab.jpg b/Screenshots/PhotoTab.jpg
index 8b98b53..6655493 100644
Binary files a/Screenshots/PhotoTab.jpg and b/Screenshots/PhotoTab.jpg differ
diff --git a/source-android/CMakeLists.txt b/source-android/CMakeLists.txt
deleted file mode 100644
index c47a156..0000000
--- a/source-android/CMakeLists.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-# TEMPLATE = app
-# TARGET = friendiqa
-# CONFIG += release
-# QT += qml quick gui widgets sql webview dbus webengine
-
-
-cmake_minimum_required(VERSION 3.1.0)
-
-project(friendiqa VERSION 0.6 LANGUAGES CXX)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(CMAKE_VERSION VERSION_LESS "3.7.0")
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
-endif()
-
-find_package(Qt5 COMPONENTS Widgets Quick Sql DBus WebView REQUIRED)
-
-#Webview Webengine
-
-set(MOC_SOURCES common/uploadableimage.h
- common/xhr.h
- common/filesystem.h
- common/remoteauthasyncimageprovider.h
- common/updatenews.h
- common/alarm.h)
-
-set(SOURCES common/friendiqa.cpp
- common/uploadableimage.cpp
- common/xhr.cpp
- common/filesystem.cpp
- common/remoteauthasyncimageprovider.cpp
- common/updatenews.cpp
- common/alarmandroid.cpp)
-
-include_directories(common)
-
-add_executable(friendiqa ${SOURCES} ${MOC_SOURCES} application.qrc)
-
-target_link_libraries(friendiqa Qt::Core)
-target_link_libraries(friendiqa Qt::Widgets)
-target_link_libraries(friendiqa Qt::Quick)
-target_link_libraries(friendiqa Qt::Sql)
-target_link_libraries(friendiqa Qt::WebView)
-target_link_libraries(friendiqa Qt::DBus)
-# target_link_libraries(friendiqa Qt::Webengine)
-
-# qt5_use_modules(friendiqa Core Widgets Quick Sql DBus)
-
-install(TARGETS friendiqa DESTINATION bin)
-
-#RESOURCES = application.qrc
-
-# OTHER_FILES += qml/friendiqa.qml \
-# translations/*.ts \
-# qml/*.qml
-# qml/newsqml/*.qml
-# qml/contactqml/*.qml
-# qml/photoqml/*.qml
-# qml/configqml/*.qml
-# js/*.js
-
-#TRANSLATIONS += translations/friendiqa-de.ts \
-# translations/friendiqa-es.ts \
-# translations/friendiqa-it.ts
-# HEADERS += \
-# common/uploadableimage.h \
-# common/xhr.h \
-# common/filesystem.h \
-# common/remoteauthasyncimageprovider.h \
-# common/updatenews.h \
-# common/alarm.h
-
-#DISTFILES += \
-# qml/calendarqml/*.qml \
-# translations/*.ts \
-# translations/*.qm \
-# qml/*.qml \
-# qml/newsqml/*.qml \
-# qml/contactqml/*.qml \
-# qml/photoqml/*.qml \
-# qml/configqml/*.qml \
-# js/*.js \
-
-
-# target.path=/usr/bin
-# desktop.path = /usr/share/applications
-# desktop.files = images/de.ma-nic.Friendiqa.desktop
-# icon.path = /usr/share/icons/hicolor/scalable/apps
-# icon.files = images/Friendiqa.svg
-# INSTALLS+=target desktop icon
diff --git a/source-android/android/AndroidManifest.xml b/source-android/android/AndroidManifest.xml
index 277b677..975885b 100644
--- a/source-android/android/AndroidManifest.xml
+++ b/source-android/android/AndroidManifest.xml
@@ -1,20 +1,7 @@
-
-
-
-
-
-
-
+
+
+
@@ -30,10 +17,6 @@
-
-
-
-
@@ -41,33 +24,22 @@
-
+
+
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/source-android/android/arm/libcrypto_1_1.so b/source-android/android/arm/libcrypto_1_1.so
deleted file mode 100644
index 07ec588..0000000
Binary files a/source-android/android/arm/libcrypto_1_1.so and /dev/null differ
diff --git a/source-android/android/arm/libssl_1_1.so b/source-android/android/arm/libssl_1_1.so
deleted file mode 100644
index 5aac52f..0000000
Binary files a/source-android/android/arm/libssl_1_1.so and /dev/null differ
diff --git a/source-android/android/arm64/libcrypto_1_1.so b/source-android/android/arm64/libcrypto_1_1.so
deleted file mode 100644
index 43653f8..0000000
Binary files a/source-android/android/arm64/libcrypto_1_1.so and /dev/null differ
diff --git a/source-android/android/arm64/libssl_1_1.so b/source-android/android/arm64/libssl_1_1.so
deleted file mode 100644
index 5590c78..0000000
Binary files a/source-android/android/arm64/libssl_1_1.so and /dev/null differ
diff --git a/source-android/android/build.gradle b/source-android/android/build.gradle
index 01264a5..4b3e83a 100644
--- a/source-android/android/build.gradle
+++ b/source-android/android/build.gradle
@@ -1,31 +1,23 @@
buildscript {
repositories {
- google()
jcenter()
- mavenCentral()
}
dependencies {
- classpath "com.android.tools.build:gradle:4.1.0"
+ classpath 'com.android.tools.build:gradle:1.1.0'
}
}
-repositories {
- google()
- jcenter()
- maven {
- url "https://maven.google.com"
- }
+allprojects {
+ repositories {
+ jcenter()
+ }
}
apply plugin: 'com.android.application'
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
-}
-
-dependencies {
- compile 'androidx.appcompat:appcompat:1.4.2'
+ compile fileTree(dir: 'libs', include: ['*.jar'])
}
android {
@@ -44,21 +36,15 @@ android {
compileSdkVersion androidCompileSdkVersion.toInteger()
- buildToolsVersion '31.0.0'
- compileSdkVersion 33
+ buildToolsVersion androidBuildToolsVersion
- defaultConfig {
- minSdkVersion 26
- targetSdkVersion 31
- resConfigs "en"
- }
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 = ['resources']
+ resources.srcDirs = ['src']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
@@ -68,11 +54,6 @@ android {
lintOptions {
abortOnError false
}
-
- // Do not compress Qt binary resources file
- aaptOptions {
- noCompress 'rcc'
- }
}
apply from: "androidnative.gradle"
- setAndroidNativePath("/../androidnative.pri");
+ setAndroidNativePath("/../androidnative.pri");
\ No newline at end of file
diff --git a/source-android/android/gradle.properties b/source-android/android/gradle.properties
deleted file mode 100644
index 82755ae..0000000
--- a/source-android/android/gradle.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-buildDir=.build
-android.useAndroidX=true
-android.enableJetifier=true
-android.enforceUniquePackageName=false
diff --git a/source-android/android/gradle/wrapper/gradle-wrapper.jar b/source-android/android/gradle/wrapper/gradle-wrapper.jar
index f6b961f..8c0fb64 100644
Binary files a/source-android/android/gradle/wrapper/gradle-wrapper.jar and b/source-android/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/source-android/android/gradle/wrapper/gradle-wrapper.properties b/source-android/android/gradle/wrapper/gradle-wrapper.properties
index 186b715..0c71e76 100644
--- a/source-android/android/gradle/wrapper/gradle-wrapper.properties
+++ b/source-android/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
diff --git a/source-android/android/gradlew b/source-android/android/gradlew
index cccdd3d..91a7e26 100644
--- a/source-android/android/gradlew
+++ b/source-android/android/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
##############################################################################
##
@@ -6,6 +6,47 @@
##
##############################################################################
+# 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"
@@ -20,49 +61,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
+cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-# 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
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
+cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -89,7 +90,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+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
@@ -113,7 +114,6 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,19 +154,11 @@ if $cygwin ; then
esac
fi
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
}
-APP_ARGS=$(save "$@")
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/source-android/android/gradlew.bat b/source-android/android/gradlew.bat
index f955316..aec9973 100644
--- a/source-android/android/gradlew.bat
+++ b/source-android/android/gradlew.bat
@@ -1,84 +1,90 @@
-@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
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@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=
-
-@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 Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_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=%*
-
-: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
+@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/source-android/android/libcrypto.so b/source-android/android/libcrypto.so
new file mode 100644
index 0000000..5c87b67
Binary files /dev/null and b/source-android/android/libcrypto.so differ
diff --git a/source-android/android/libssl.so b/source-android/android/libssl.so
new file mode 100644
index 0000000..8cbe056
Binary files /dev/null and b/source-android/android/libssl.so differ
diff --git a/source-android/android/res/drawable-hdpi/friendiqanotification.png b/source-android/android/res/drawable-hdpi/friendiqanotification.png
deleted file mode 100644
index cb78f92..0000000
Binary files a/source-android/android/res/drawable-hdpi/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/drawable-hdpi/icon.png b/source-android/android/res/drawable-hdpi/icon.png
deleted file mode 100644
index 7618b3a..0000000
Binary files a/source-android/android/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/source-android/android/res/drawable-ldpi/icon.png b/source-android/android/res/drawable-ldpi/icon.png
deleted file mode 100644
index 8e269d7..0000000
Binary files a/source-android/android/res/drawable-ldpi/icon.png and /dev/null differ
diff --git a/source-android/android/res/drawable-mdpi/friendiqanotification.png b/source-android/android/res/drawable-mdpi/friendiqanotification.png
deleted file mode 100644
index 3f1c816..0000000
Binary files a/source-android/android/res/drawable-mdpi/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/drawable-mdpi/icon.png b/source-android/android/res/drawable-mdpi/icon.png
deleted file mode 100644
index 6643513..0000000
Binary files a/source-android/android/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/source-android/android/res/drawable-xhdpi/friendiqanotification.png b/source-android/android/res/drawable-xhdpi/friendiqanotification.png
deleted file mode 100644
index 5fe8bbd..0000000
Binary files a/source-android/android/res/drawable-xhdpi/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/drawable-xxhdpi/friendiqanotification.png b/source-android/android/res/drawable-xxhdpi/friendiqanotification.png
deleted file mode 100644
index 8cec597..0000000
Binary files a/source-android/android/res/drawable-xxhdpi/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/drawable-xxxhdpi/friendiqanotification.png b/source-android/android/res/drawable-xxxhdpi/friendiqanotification.png
deleted file mode 100644
index ea3879d..0000000
Binary files a/source-android/android/res/drawable-xxxhdpi/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/drawable/friendiqanotification.png b/source-android/android/res/drawable/friendiqanotification.png
deleted file mode 100644
index ea3879d..0000000
Binary files a/source-android/android/res/drawable/friendiqanotification.png and /dev/null differ
diff --git a/source-android/android/res/values/libs.xml b/source-android/android/res/values/libs.xml
index 6b1a4a2..77f422c 100644
--- a/source-android/android/res/values/libs.xml
+++ b/source-android/android/res/values/libs.xml
@@ -1,7 +1,7 @@
- https://download.qt.io/ministro/android/qt5/qt-5.14
+ https://download.qt.io/ministro/android/qt5/qt-5.8
-
-
-
+
+
+
-
-
+
+
+
+
+
diff --git a/source-android/android/src/FriendiqaNotifierService.java b/source-android/android/src/ExampleService.java
similarity index 97%
rename from source-android/android/src/FriendiqaNotifierService.java
rename to source-android/android/src/ExampleService.java
index ee17178..217e99c 100644
--- a/source-android/android/src/FriendiqaNotifierService.java
+++ b/source-android/android/src/ExampleService.java
@@ -1,4 +1,4 @@
-package androidnative.friendiqa;
+package androidnative.example;
import androidnative.SystemDispatcher;
import android.app.Notification;
import android.app.NotificationManager;
@@ -10,7 +10,7 @@ import android.content.Context;
import java.util.Map;
import org.qtproject.qt5.android.QtNative;
-public class FriendiqaNotifierService {
+public class ExampleService {
static {
diff --git a/source-android/android/src/FriendiqaActivity.java b/source-android/android/src/FriendiqaActivity.java
index dc9b643..ce892f3 100644
--- a/source-android/android/src/FriendiqaActivity.java
+++ b/source-android/android/src/FriendiqaActivity.java
@@ -2,6 +2,10 @@ package androidnative.friendiqa;
import androidnative.AndroidNativeActivity;
+
+
+
+
public class FriendiqaActivity extends AndroidNativeActivity {
public FriendiqaActivity() {
super();
@@ -9,4 +13,8 @@ public class FriendiqaActivity extends AndroidNativeActivity {
QT_ANDROID_THEMES = new String[] {""};
QT_ANDROID_DEFAULT_THEME = "";
}
+
+
+
+
}
diff --git a/source-android/android/src/FriendiqaService.java b/source-android/android/src/FriendiqaService.java
deleted file mode 100644
index 4dc2dda..0000000
--- a/source-android/android/src/FriendiqaService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package androidnative.friendiqa;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-import android.app.job.JobService;
-import android.app.job.JobParameters;
-import androidnative.AndroidNativeService;
-import org.qtproject.qt5.android.bindings.QtService;
-import org.qtproject.qt5.android.QtNative;
-//import androidnative.friendiqa.FriendiqaQtService;
-
-public class FriendiqaService extends JobService{
- private static String TAG = "FriendiqaService";
- //Log.e(TAG,"Service");
-
-
- @Override
- public boolean onStartJob(JobParameters params) {
- Log.d(TAG,"Friendiqa JobService");
- Context context = this.getApplicationContext();
- AndroidNativeService fs = new AndroidNativeService();
- fs.startQtService(context);
- jobFinished(params,false);
- //Intent serviceIntent = new Intent(this, AndroidNativeService.class);
- //startService(serviceIntent);
- return false;
- }
-
- @Override
- public boolean onStopJob(JobParameters params) {
- // whether or not you would like JobScheduler to automatically retry your failed job.
- return false;
- }
-}
-
diff --git a/source-android/android/src/FriendiqaStopService.java b/source-android/android/src/FriendiqaStopService.java
deleted file mode 100644
index 2851bcd..0000000
--- a/source-android/android/src/FriendiqaStopService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package androidnative.friendiqa;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-import android.app.job.JobService;
-import android.app.job.JobParameters;
-import androidnative.AndroidNativeService;
-import org.qtproject.qt5.android.bindings.QtService;
-import org.qtproject.qt5.android.QtNative;
-//import androidnative.friendiqa.FriendiqaQtService;
-
-public class FriendiqaStopService extends JobService{
- private static String TAG = "AndroidNative";
- //Log.e(TAG,"Service");
-
-
- @Override
- public boolean onStartJob(JobParameters params) {
- Log.d(TAG,"Friendiqa JobServiceStop");
- Context context = this.getApplicationContext();
- AndroidNativeService fs = new AndroidNativeService();
- fs.stopQtService(context);
- jobFinished(params,false);
- //Intent serviceIntent = new Intent(this, AndroidNativeService.class);
- //startService(serviceIntent);
- return false;
- }
-
- @Override
- public boolean onStopJob(JobParameters params) {
- // whether or not you would like JobScheduler to automatically retry your failed job.
- return true;
- }
- @Override
- public boolean onUnbind(Intent intent) {
- stopSelf();
- return super.onUnbind(intent);
- }
-
-}
diff --git a/source-android/androidnative.pri/.gitignore b/source-android/androidnative.pri/.gitignore
new file mode 100644
index 0000000..23657c7
--- /dev/null
+++ b/source-android/androidnative.pri/.gitignore
@@ -0,0 +1,45 @@
+# C++ objects and libs
+
+*.slo
+*.lo
+*.o
+*.a
+*.la
+*.lai
+*.so
+*.dll
+*.dylib
+
+# Qt-es
+
+/.qmake.cache
+/.qmake.stash
+*.pro.user
+*.pro.user.*
+*.moc
+moc_*.cpp
+qrc_*.cpp
+ui_*.h
+Makefile*
+*-build-*
+build-*
+html
+
+# QtCreator
+
+*.autosave
+.idea
+
+tests/quickandroidactivitytests/tests/bin/*
+tests/quickandroidactivitytests/tests/gen/*
+
+#Android
+local.properties
+gradle.properties
+.build
+.gradle
+*.iml
+vendor
+tests/instrument/build
+build
+*.swp
diff --git a/source-android/androidnative.pri/.gitmodules b/source-android/androidnative.pri/.gitmodules
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/source-android/androidnative.pri/.gitmodules
@@ -0,0 +1 @@
+
diff --git a/source-android/androidnative.pri/.travis.yml b/source-android/androidnative.pri/.travis.yml
new file mode 100644
index 0000000..deffa3c
--- /dev/null
+++ b/source-android/androidnative.pri/.travis.yml
@@ -0,0 +1,61 @@
+language : android
+addons:
+ apt:
+ packages:
+ - p7zip
+ - coreutils
+ - realpath
+android:
+ components:
+ - build-tools-23.0.2
+ - android-19
+ - extra-google-google_play_services
+env:
+ - DISPLAY=:99.0
+compiler:
+ - gcc
+before_install:
+ - wget -c https://services.gradle.org/distributions/gradle-2.9-bin.zip
+ - unzip -qq gradle-2.9-bin.zip
+ - export GRADLE_HOME=$PWD/gradle-2.9
+ - export PATH=$GRADLE_HOME/bin:$PATH
+ - gradle --version
+ - git clone https://github.com/benlau/qtci/
+ - source qtci/path.env
+ - ./ci/qt-android
+
+script:
+ - export ROOT_DIR=`pwd`
+ - KEYSTORE=dev.keystore
+ - KEYPASS=123456
+ - BUILD_DIR=$ROOT_DIR/tests/instrument/build
+ - ANDROID_TARGET_SDK_VERSION=23
+ - mkdir -p $BUILD_DIR
+ - ls
+ - keytool -genkey -v -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 -dname "cn=localhost, ou=oss, o=Continuent, c=HK" -storepass $KEYPASS -keypass $KEYPASS -keystore $KEYSTORE
+ - source qt.env
+ - ls $ANDROID_SDK_ROOT/build-tools
+ - cd $BUILD_DIR
+ - build-android-gradle-project ${ROOT_DIR}/tests/instrument/activity/activity.pro
+ - sed -i "s/com.android.application/com.android.library/g" android-build/build.gradle
+ - cat android-build/gradle.properties
+ - cp ./android-build/build/outputs/apk/android-build-debug.apk output.apk
+ - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
+ - emulator -avd test -no-audio -no-window &
+ - android-wait-for-emulator
+ - adb shell input keyevent 82 &
+ - export ANDROID_HOME=$ANDROID_SDK_ROOT
+ - adb install -r output.apk
+ - cd $ROOT_DIR/tests/instrument/runner
+ - ls
+ - ./gradlew -q assembleDebug
+ - find . -name "*.apk"
+ - adb install -r ./build/outputs/apk/runner-debug.apk
+ - adb shell am instrument -w quickandroid.example.tests/android.test.InstrumentationTestRunner 2>&1 | tee instrument.log
+ - adb logcat -d > log.txt
+ - sed -i "/dalvikvm/d" log.txt
+ - tail -n 500 log.txt
+ - OK=`cat instrument.log | grep -G "^OK" | wc -l`
+ - echo $OK
+ - if [ $OK -eq 0 ]; then echo "Test failure found"; exit 1; fi
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/Components.qml b/source-android/androidnative.pri/examples/androidnativeexample/Components.qml
new file mode 100644
index 0000000..cdd7880
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/Components.qml
@@ -0,0 +1,62 @@
+import QtQuick 2.2
+import QtQuick.Window 2.1
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import "./theme"
+
+Page {
+ objectName: "ComponentPage";
+
+ property var pages: [
+ {
+ name: "Image Picker",
+ demo: "imagePicker/ImagePickerDemo.qml",
+ description: "Pick photo via Java language binding"
+ },{
+ name: "Toast",
+ demo: "toast/ToastDemo.qml",
+ description: "Toast Demonstration"
+ },{
+ name: "Notification",
+ demo: "notification/NotificationDemo.qml",
+ description: "Demonstrate how to use SystemDispatcher to send notification"
+ },{
+ name: "Information",
+ demo: "info/InfoDemo.qml",
+ description: "Android System Information"
+ },{
+ name: "Status Bar",
+ demo: "statusbar/StatusBarDemo.qml",
+ description: "Config Status Bar"
+ }
+
+ ];
+
+ actionBar: ActionBar {
+ id : actionBar
+ iconSource: A.drawable("ic_menu",Constants.black87)
+ title: "AndroidNative Component List"
+ showIcon: false
+ actionButtonEnabled: false
+ }
+
+ VisualDataModel {
+ id: visualDataModel
+ delegate: ListItem {
+ title: modelData.name
+ subtitle: modelData.description
+ onClicked: {
+ present(Qt.resolvedUrl(modelData.demo));
+ }
+ }
+
+ model: pages;
+ }
+
+ ListView {
+ anchors.fill: parent
+
+ model : visualDataModel
+ }
+
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/README.md b/source-android/androidnative.pri/examples/androidnativeexample/README.md
new file mode 100644
index 0000000..e3a9f38
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/README.md
@@ -0,0 +1,25 @@
+AndroidNative Example Program
+=====================
+
+Prerequisites
+-------------
+
+ * Qt Android SDK >= 5.6
+ * Android SDK
+
+Check this article for how to setup Qt and Android SDK:
+
+[Getting Started with Qt for Android](http://qt-project.org/doc/qt-5/androidgs.html)
+
+Build Instruction
+-----------------
+
+ 1. Run `qpm install` to get required packages
+ 1. Open androidnativeexample.pro by Qt Creator
+ 1. Press the "Projects" tab. Make sure the "Android for xxx" kit has been selected
+ 1. Plug a Android device to your computer
+ 1. Press "Build" -> "Run"
+ 1. The program will be deployed to your device. It is so easy!
+
+
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/AndroidManifest.xml b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/AndroidManifest.xml
new file mode 100644
index 0000000..5ecf270
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/AndroidManifest.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/androidnative.gradle b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/androidnative.gradle
new file mode 100644
index 0000000..8fe9786
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/androidnative.gradle
@@ -0,0 +1,34 @@
+
+// Obtain androidPackageSourceDir
+// androidPackageSourceDir is the absolute path of the folder containing build.gradle and AndroidManifests.xml
+// This code also works with androiddeployqt.
+
+import groovy.json.JsonSlurper
+
+String getAndroidPackageSourceDir() {
+ String res = System.getProperty("user.dir");
+
+ FileTree tree = fileTree(dir: res + "/..").include("android*deployment-settings.json");
+
+ if (tree.getFiles().size() > 0) {
+ def inputFile = tree.getFiles().toArray()[0];
+ def InputJSON = new JsonSlurper().parseText(inputFile.text);
+ res = InputJSON["android-package-source-directory"]
+ } else {
+ println("android*deployment-settings.json not found. Set androidPackageSourceDir to user.dir");
+ }
+
+ return res;
+}
+
+String setAndroidNativePath(String path) {
+ String androidPackageSourceDir = getAndroidPackageSourceDir();
+ String androidNativePath = androidPackageSourceDir + path + "/java/src";
+ LinkedHashSet hash = android.sourceSets.main.java.srcDirs;
+ hash.add(androidNativePath);
+ android.sourceSets.main.java.srcDirs = hash;
+}
+
+ext {
+ setAndroidNativePath = this.&setAndroidNativePath;
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/build.gradle b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/build.gradle
new file mode 100644
index 0000000..4ce7902
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/build.gradle
@@ -0,0 +1,60 @@
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.3.0'
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+apply plugin: 'com.android.application'
+
+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
+ }
+}
+
+apply from: "androidnative.gradle"
+setAndroidNativePath("/../../..");
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties
new file mode 100644
index 0000000..798b77d
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties
@@ -0,0 +1,9 @@
+## 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=25.0.3
+androidCompileSdkVersion=25
+buildDir=.build
+qt5AndroidDir=/home/pankraz/Qt/5.9.1/android_armv7/src/android/java
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties~ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties~
new file mode 100644
index 0000000..798b77d
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle.properties~
@@ -0,0 +1,9 @@
+## 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=25.0.3
+androidCompileSdkVersion=25
+buildDir=.build
+qt5AndroidDir=/home/pankraz/Qt/5.9.1/android_armv7/src/android/java
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.jar b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.properties b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..9f2bca4
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Feb 16 01:04:18 HKT 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew
@@ -0,0 +1,160 @@
+#!/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
+
+# 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\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+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"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # 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/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew.bat b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew.bat
@@ -0,0 +1,90 @@
+@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/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties
new file mode 100644
index 0000000..4277a61
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties
@@ -0,0 +1,6 @@
+## 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=/home/pankraz/android-sdk_alt
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties~ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties~
new file mode 100644
index 0000000..4277a61
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/local.properties~
@@ -0,0 +1,6 @@
+## 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=/home/pankraz/android-sdk_alt
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/icon.png b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/icon.png
new file mode 100644
index 0000000..156243d
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/icon.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/splash.xml b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/splash.xml
new file mode 100644
index 0000000..c1bd6fc
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/drawable/splash.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/apptheme.xml b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/apptheme.xml
new file mode 100644
index 0000000..455b965
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/apptheme.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/libs.xml b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/libs.xml
new file mode 100644
index 0000000..4d68673
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/res/values/libs.xml
@@ -0,0 +1,25 @@
+
+
+
+ https://download.qt-project.org/ministro/android/qt5/qt-5.4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleActivity.java b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleActivity.java
new file mode 100644
index 0000000..ffa8952
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleActivity.java
@@ -0,0 +1,16 @@
+package androidnative.example;
+
+import androidnative.AndroidNativeActivity;
+
+/**
+ * Created by benlau on 8/3/2017.
+ */
+
+public class ExampleActivity extends AndroidNativeActivity {
+ public ExampleActivity() {
+ super();
+
+ QT_ANDROID_THEMES = new String[] {""};
+ QT_ANDROID_DEFAULT_THEME = "";
+ }
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleService.java b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleService.java
new file mode 100644
index 0000000..082ff10
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/android-sources/src/ExampleService.java
@@ -0,0 +1,96 @@
+package androidnative.example;
+import androidnative.SystemDispatcher;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.util.Log;
+import android.os.Handler;
+import android.app.Activity;
+import android.view.View;
+import android.content.Context;
+import java.util.Map;
+import org.qtproject.qt5.android.QtNative;
+
+public class ExampleService {
+
+ static {
+
+ SystemDispatcher.addListener(new SystemDispatcher.Listener() {
+
+ NotificationManager m_notificationManager;
+ Notification.Builder m_builder;
+
+ private void notificationManagerNotify(Map data) {
+
+ final Activity activity = QtNative.activity();
+ final Map messageData = data;
+
+ Runnable runnable = new Runnable () {
+ public void run() {
+ try {
+ String title = (String) messageData.get("title");
+
+ String message = (String) messageData.get("message");
+
+ if (m_notificationManager == null) {
+ m_notificationManager = (NotificationManager) activity.getSystemService(Context.NOTIFICATION_SERVICE);
+ m_builder = new Notification.Builder(activity);
+
+ // Small Icon is a must to make notification works.
+ // And that is why you need to inherit QtActivity
+ m_builder.setSmallIcon(R.drawable.icon);
+ }
+
+ m_builder.setContentTitle(title);
+ m_builder.setContentText(message);
+ m_notificationManager.notify(1, m_builder.build());
+
+ // Test function. Remove it later.
+ SystemDispatcher.dispatch("Notifier.notifyFinished");
+ } catch (Exception e) {
+ Log.d("",e.getMessage());
+ }
+
+ };
+ };
+ activity.runOnUiThread(runnable);
+ }
+
+ private void hapticFeedbackPerform(Map data) {
+
+ final Activity activity = QtNative.activity();
+ final Map messageData = data;
+ Runnable runnable = new Runnable () {
+ public void run() {
+ int feedbackConstant = (Integer) messageData.get("feedbackConstant");
+ int flags = (Integer) messageData.get("flags");
+
+ Log.d("",String.format("hapticFeedbackPerform(%d,%d)",feedbackConstant,flags));
+
+ View rootView = activity.getWindow().getDecorView().getRootView();
+ rootView.performHapticFeedback(feedbackConstant, flags);
+
+ // Test function. Remove it later.
+ SystemDispatcher.dispatch("hapticFeedbackPerformFinished");
+ };
+ };
+ activity.runOnUiThread(runnable);
+ }
+
+ public void onDispatched(String name , Map data) {
+
+ if (name.equals("Notifier.notify")) {
+ notificationManagerNotify(data);
+ return;
+ } else if (name.equals("hapticFeedbackPerform")) {
+ hapticFeedbackPerform(data);
+ return;
+ }
+
+ return;
+ }
+ });
+
+ }
+
+}
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro b/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro
new file mode 100644
index 0000000..cec26e5
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro
@@ -0,0 +1,38 @@
+TEMPLATE = app
+
+QT += qml quick
+
+SOURCES += main.cpp \
+ debugwrapper.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH += ../..
+
+android {
+ ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
+}
+
+# include(vendor/vendor.pri)
+# Default rules for deployment.
+include(deployment.pri)
+include(../../androidnative.pri)
+include(../../../../../../quickandroid/quickandroid.pri)
+
+DISTFILES += \
+ android-sources/AndroidManifest.xml \
+ android-sources/src/quickandroid/example/ExampleService.java \
+ README.md \
+ android-sources/gradle/wrapper/gradle-wrapper.jar \
+ android-sources/gradlew \
+ android-sources/res/values/libs.xml \
+ android-sources/build.gradle \
+ android-sources/gradle/wrapper/gradle-wrapper.properties \
+ android-sources/gradlew.bat \
+ android-sources/settings.gradle \
+ android-sources/src/androidnative/example/ExampleService.java
+
+HEADERS += \
+ ../../README.md \
+ debugwrapper.h
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro.user b/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro.user
new file mode 100644
index 0000000..1693b53
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro.user
@@ -0,0 +1,392 @@
+
+
+
+
+
+ EnvironmentId
+ {8825bc46-5cad-4a59-be78-bf9eeaa7217a}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ 1
+ true
+ true
+ true
+ false
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Android
+ Android
+ {8e3757e7-5698-4d0f-9f13-55359b1a832e}
+ 0
+ 0
+ 0
+
+ /home/pankraz/build/debug
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+
+ true
+ Anwendungsdaten kopieren
+
+ Qt4ProjectManager.AndroidPackageInstallationStep
+
+
+ android-25
+
+ true
+ Android-APK erstellen
+
+ QmakeProjectManager.AndroidBuildApkStep
+ 2
+ true
+ false
+
+ 4
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ Bereinigen
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Debug
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+ true
+
+
+ /home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/build-androidnativeexample-Android-Release
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ false
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+
+ true
+ Anwendungsdaten kopieren
+
+ Qt4ProjectManager.AndroidPackageInstallationStep
+
+
+ android-25
+
+ true
+ Android-APK erstellen
+
+ QmakeProjectManager.AndroidBuildApkStep
+ 2
+ true
+ false
+
+ 4
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ Bereinigen
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Release
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+
+ /home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/build-androidnativeexample-Android-Profile
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ true
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ false
+
+
+
+
+ true
+ Anwendungsdaten kopieren
+
+ Qt4ProjectManager.AndroidPackageInstallationStep
+
+
+ android-25
+
+ true
+ Android-APK erstellen
+
+ QmakeProjectManager.AndroidBuildApkStep
+ 2
+ true
+ false
+
+ 4
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ -w
+ -r
+
+ true
+ clean
+
+
+ 1
+ Bereinigen
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Profile
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+ 3
+
+
+
+ true
+ Deployment auf Android-Gerät
+
+ Qt4ProjectManager.AndroidDeployQtStep
+ false
+
+ 1
+ Deployment
+
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+ Deployment auf Android-Gerät
+ Deployment auf Android-Gerät
+ Qt4ProjectManager.AndroidDeployConfiguration2
+
+ 1
+
+ CB5A22HSB9
+
+
+ false
+ false
+ 1000
+
+ true
+
+ false
+ false
+ false
+ false
+ true
+ 0.01
+ 10
+ true
+ 1
+ 25
+
+ 1
+ true
+ false
+ true
+ valgrind
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+
+
+
+
+ androidnativeexample
+
+ Qt4ProjectManager.AndroidRunConfiguration:/home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro
+ androidnativeexample.pro
+ 3768
+ false
+ true
+ false
+ false
+ true
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 18
+
+
+ Version
+ 18
+
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.cpp b/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.cpp
new file mode 100644
index 0000000..8aaf024
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.cpp
@@ -0,0 +1,17 @@
+#include "debugwrapper.h"
+#include "AndroidNative/debug.h"
+
+DebugWrapper::DebugWrapper(QObject *parent) : QObject(parent)
+{
+
+}
+
+long DebugWrapper::getNativeHeapSize() const
+{
+ return AndroidNative::Debug::getNativeHeapSize();
+}
+
+long DebugWrapper::getNativeHeapAllocatedSize() const
+{
+ return AndroidNative::Debug::getNativeHeapAllocatedSize();
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.h b/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.h
new file mode 100644
index 0000000..80c3424
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/debugwrapper.h
@@ -0,0 +1,20 @@
+#ifndef DEBUGWRAPPER_H
+#define DEBUGWRAPPER_H
+
+#include
+
+class DebugWrapper : public QObject
+{
+ Q_OBJECT
+public:
+ explicit DebugWrapper(QObject *parent = 0);
+
+signals:
+
+public slots:
+ long getNativeHeapSize() const;
+
+ long getNativeHeapAllocatedSize() const;
+};
+
+#endif // DEBUGWRAPPER_H
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/deployment.pri b/source-android/androidnative.pri/examples/androidnativeexample/deployment.pri
new file mode 100644
index 0000000..5441b63
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/deployment.pri
@@ -0,0 +1,27 @@
+android-no-sdk {
+ target.path = /data/user/qt
+ export(target.path)
+ INSTALLS += target
+} else:android {
+ x86 {
+ target.path = /libs/x86
+ } else: armeabi-v7a {
+ target.path = /libs/armeabi-v7a
+ } else {
+ target.path = /libs/armeabi
+ }
+ export(target.path)
+ INSTALLS += target
+} else:unix {
+ isEmpty(target.path) {
+ qnx {
+ target.path = /tmp/$${TARGET}/bin
+ } else {
+ target.path = /opt/$${TARGET}/bin
+ }
+ export(target.path)
+ }
+ INSTALLS += target
+}
+
+export(INSTALLS)
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/dialog/DialogDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/dialog/DialogDemo.qml
new file mode 100644
index 0000000..8ee22be
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/dialog/DialogDemo.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import "../theme"
+
+Page {
+ actionBar: ActionBar {
+ id: actionBar
+ upEnabled: true
+ title: qsTr("Dialog Demo")
+ showTitle: true
+
+ onActionButtonClicked: back();
+ z: 10
+
+ }
+
+ Button {
+ id: label
+ text : "Press to launch dialog"
+ anchors.centerIn: parent
+ onClicked: {
+ dialog.open();
+ }
+ }
+
+ Dialog {
+ id: dialog
+ anchors.centerIn: parent
+ title: "Dialog"
+ Text {
+ text: "Demo"
+ }
+ z: 20
+
+ acceptButtonText: "OK"
+ }
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/imagePicker/ImagePickerDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/imagePicker/ImagePickerDemo.qml
new file mode 100644
index 0000000..e38c7a3
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/imagePicker/ImagePickerDemo.qml
@@ -0,0 +1,77 @@
+import QtQuick 2.0
+import QuickAndroid 0.1
+import AndroidNative 1.0 as AN
+import "../theme"
+
+Page {
+ id: demo
+ actionBar: ActionBar {
+ title: "Image Picker Demo"
+ onActionButtonClicked: back();
+ }
+
+ AN.ImagePicker {
+ id: imagePicker;
+ multiple : true
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: Constants.black100
+
+ Image {
+ id: image
+ anchors.fill: parent
+ source: imagePicker.imageUrl
+ fillMode: Image.PreserveAspectFit
+ visible: imagePicker.imageUrls.length <= 1
+ }
+
+ Grid {
+ columns: 3
+ spacing: 0
+ visible: !image.visible
+
+ Repeater {
+ model: imagePicker.imageUrls
+ delegate: Image {
+ width: demo.width / 3
+ height: width / 4 * 3
+ source: modelData
+ asynchronous: true
+ fillMode: Image.PreserveAspectCrop
+ }
+ }
+ }
+
+ Column {
+ anchors.right: parent.right
+ anchors.rightMargin: 16 * A.dp
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 32 * A.dp
+
+ spacing: 16 * A.dp
+
+ FloatingActionButton {
+ iconSource: A.drawable("ic_camera",Constants.black87);
+ size: Constants.small
+ backgroundColor: Constants.white100
+ onClicked: {
+ imagePicker.takePhoto();
+ }
+ }
+
+ FloatingActionButton {
+ iconSource: A.drawable("ic_image",Constants.black87);
+ size: Constants.small
+ backgroundColor: Constants.white100
+ onClicked: {
+ imagePicker.pickImage();
+ }
+ }
+
+ }
+
+ }
+}
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/info/InfoDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/info/InfoDemo.qml
new file mode 100644
index 0000000..d86a319
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/info/InfoDemo.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.0
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import "../theme"
+
+Page {
+ id: page
+ actionBar: ActionBar {
+ id: actionBar
+ upEnabled: true
+ title: qsTr("Information")
+ showTitle: true
+
+ onActionButtonClicked: back();
+ z: 10
+ }
+
+ VisualItemModel {
+ id: itemModel
+
+ ListItem {
+ title: "Environment.DIRECTORY_DCIM"
+ subtitle: Environment.DIRECTORY_DCIM
+ interactive: false
+ width: page.width
+ }
+
+ ListItem {
+ title: "Debug.getNativeHeapSize"
+ subtitle: (Debug.getNativeHeapSize() / 1024 / 1024).toFixed(2) + "MB";
+ interactive: false
+ width: page.width
+ }
+
+ ListItem {
+ title: "Debug.getNativeHeapAllocatedSize"
+ subtitle: (Debug.getNativeHeapAllocatedSize() / 1024 / 1024).toFixed(2) + "MB";
+ interactive: false
+ width: page.width
+ }
+
+ ListItem {
+ title: "QThread.idealThreadCount"
+ subtitle: Misc.idealThreadCount;
+ interactive: false
+ width: page.width
+ }
+ }
+
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+ }
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/main.cpp b/source-android/androidnative.pri/examples/androidnativeexample/main.cpp
new file mode 100644
index 0000000..062572b
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/main.cpp
@@ -0,0 +1,72 @@
+#include
+#include
+#include
+#include
+#include
+#include
+//#include "qadrawableprovider.h"
+#include "AndroidNative/systemdispatcher.h"
+#include "AndroidNative/environment.h"
+#include "AndroidNative/debug.h"
+#include "AndroidNative/mediascannerconnection.h"
+#include "debugwrapper.h"
+
+using namespace AndroidNative;
+
+#ifdef Q_OS_ANDROID
+#include
+#include
+
+JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
+ Q_UNUSED(vm);
+ qDebug("NativeInterface::JNI_OnLoad()");
+
+ // It must call this function within JNI_OnLoad to enable System Dispatcher
+ SystemDispatcher::registerNatives();
+ return JNI_VERSION_1_6;
+}
+#endif
+
+int main(int argc, char *argv[])
+{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
+ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
+
+ QGuiApplication app(argc, argv);
+ app.setApplicationName("Android Native Example");
+ app.setOrganizationDomain("com.github.benlau.androidnative");
+
+ QSettings settings;
+
+ settings.setValue("firstTimeLoading", false);
+ settings.sync();
+
+ QVariantMap env;
+ env["DIRECTORY_DCIM"] = Environment::getExternalStoragePublicDirectory(Environment::DIRECTORY_DCIM);
+
+ QVariantMap misc;
+ misc["idealThreadCount"] = QThread::idealThreadCount();
+
+ MediaScannerConnection::scanFile("");
+
+ SystemDispatcher::instance()->loadClass("androidnative.example.ExampleService");
+
+ QQmlApplicationEngine engine;
+
+ /* QuickAndroid Initialization */
+ engine.addImportPath("qrc:///"); // Add QuickAndroid into the import path
+ engine.rootContext()->setContextProperty("Environment", env);
+ engine.rootContext()->setContextProperty("Misc", misc);
+ engine.rootContext()->setContextProperty("Debug", new DebugWrapper(&engine));
+
+ /* End of QuickAndroid Initialization */
+
+ // Extra features:
+ //QADrawableProvider* provider = new QADrawableProvider();
+ //provider->setBasePath("qrc://res");
+ //engine.addImageProvider("drawable",provider);
+ engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
+
+ return app.exec();
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/main.qml b/source-android/androidnative.pri/examples/androidnativeexample/main.qml
new file mode 100644
index 0000000..9a08956
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/main.qml
@@ -0,0 +1,76 @@
+import QtQuick 2.2
+import QtQuick.Window 2.2
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import "./theme"
+
+Window {
+ id: window;
+ width: 480
+ height: 640
+
+ color: "#FFFFFF"
+
+ visible: false;
+
+ /* Fast Splash Screen Setup Instruction
+
+ 1. Create a custom theme (apptheme.qml) and set windowBackground to @drawable/splash.xml (Your splash screen drawable)
+
+ 2. Within AndroidManifest.xml, set android.app.splash_screen_drawable to @drawable/splash.xml
+
+
+
+
+
+ That will show a splash screen while Qt is loading. However, screen flicker will happen when your Window
+ item is shown. To prevent screen flicker completely, you could setup your main.qml accoroding to step 3.
+
+ 3. In your main.qml (the one with Window component)
+
+ 3.1. Set Window.color to a color which is similar to splash screen / Theme.windowBackground
+
+ 3.2. Set visible of Window to false until your content is loaded. (Keep Android splash screen while loading)
+
+ 3.3. Use an asynchronous Loader for your content. Set opacity to 0.
+
+ 3.4. Once everything is ready, set Window.visible to true and perform a fade-in animation on Loader
+
+ */
+
+ Loader {
+ id: loader
+ parent: null
+ width: window.width
+ height: window.height
+ asynchronous: true
+ opacity: 0
+ focus: true;
+
+ sourceComponent: PageStack {
+ id: stack
+ objectName: "PageStack";
+ initialPage: Components {
+
+ onPresented: {
+ window.visible = true;
+ A.setTimeout(function() {
+ loader.parent = window.contentItem;
+ loader.opacity = 1;
+ }, 34);
+ }
+ }
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 200
+ easing.type: Easing.OutQuad;
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ ThemeManager.currentTheme = AppTheme
+ }
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/notification/NotificationDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/notification/NotificationDemo.qml
new file mode 100644
index 0000000..174a5a0
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/notification/NotificationDemo.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.2
+import QtQuick.Window 2.1
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import AndroidNative 1.0 as AN
+import "../theme"
+
+Page {
+
+ actionBar: ActionBar {
+ id : actionBar
+ title: "Notification"
+ z: 10
+ upEnabled: true
+ onActionButtonClicked: back();
+ }
+
+ Button {
+ id: label
+ text : "Press to send notification"
+ anchors.centerIn: parent
+ onClicked: {
+ AN.SystemDispatcher.dispatch("Notifier.notify",{
+ title: "Quick Android Example",
+ message: "Hello!"
+ });
+ }
+ }
+
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/qml.qrc b/source-android/androidnative.pri/examples/androidnativeexample/qml.qrc
new file mode 100644
index 0000000..225e836
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/qml.qrc
@@ -0,0 +1,31 @@
+
+
+ main.qml
+ res/drawable-hdpi/icon.png
+ Components.qml
+ res/drawable-xxhdpi/ic_menu.png
+ dialog/DialogDemo.qml
+ notification/NotificationDemo.qml
+ theme/AppTheme.qml
+ theme/qmldir
+ res/drawable-hdpi/ic_android_black_48dp.png
+ res/drawable-xxhdpi/ic_android_black_48dp.png
+ res/drawable-mdpi/ic_android_black_48dp.png
+ res/drawable-xhdpi/ic_android_black_48dp.png
+ res/drawable-xxxhdpi/ic_android_black_48dp.png
+ res/drawable-hdpi/ic_done_black_24dp.png
+ res/drawable-mdpi/ic_done_black_24dp.png
+ res/drawable-xhdpi/ic_done_black_24dp.png
+ res/drawable-xxhdpi/ic_done_black_24dp.png
+ res/drawable-xxxhdpi/ic_done_black_24dp.png
+ theme/ActionBarBackground.qml
+ res/drawable-xxhdpi/ic_keyboard_backspace.png
+ res/drawable-xxhdpi/ic_arrow_back.png
+ res/drawable-xxhdpi/ic_image.png
+ res/drawable-xxhdpi/ic_camera.png
+ imagePicker/ImagePickerDemo.qml
+ info/InfoDemo.qml
+ toast/ToastDemo.qml
+ statusbar/StatusBarDemo.qml
+
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/qpm.json b/source-android/androidnative.pri/examples/androidnativeexample/qpm.json
new file mode 100644
index 0000000..9ff04fd
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/qpm.json
@@ -0,0 +1,10 @@
+{
+ "name": "",
+ "description": "",
+ "dependencies": [
+ "com.github.benlau.quickandroid@0.1.7"
+ ],
+ "license": "NONE",
+ "pri_filename": "",
+ "webpage": ""
+}
\ No newline at end of file
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_android_black_48dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_android_black_48dp.png
new file mode 100644
index 0000000..6006b12
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_android_black_48dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_done_black_24dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_done_black_24dp.png
new file mode 100644
index 0000000..d4c0607
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/ic_done_black_24dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/icon.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..156243d
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-hdpi/icon.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_android_black_48dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_android_black_48dp.png
new file mode 100644
index 0000000..41558f2
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_android_black_48dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_done_black_24dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_done_black_24dp.png
new file mode 100644
index 0000000..5e5e7cf
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-mdpi/ic_done_black_24dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_android_black_48dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_android_black_48dp.png
new file mode 100644
index 0000000..4f935bf
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_android_black_48dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_done_black_24dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_done_black_24dp.png
new file mode 100644
index 0000000..64a4944
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xhdpi/ic_done_black_24dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_android_black_48dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_android_black_48dp.png
new file mode 100644
index 0000000..149b4ec
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_android_black_48dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_arrow_back.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_arrow_back.png
new file mode 100644
index 0000000..1e88d35
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_arrow_back.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_camera.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_camera.png
new file mode 100644
index 0000000..91f103d
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_camera.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_done_black_24dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_done_black_24dp.png
new file mode 100644
index 0000000..c9c0174
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_done_black_24dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_image.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_image.png
new file mode 100644
index 0000000..b32faff
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_image.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_keyboard_backspace.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_keyboard_backspace.png
new file mode 100644
index 0000000..a49c20c
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_keyboard_backspace.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_menu.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_menu.png
new file mode 100644
index 0000000..ab83be5
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxhdpi/ic_menu.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_android_black_48dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_android_black_48dp.png
new file mode 100644
index 0000000..ded531f
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_android_black_48dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_done_black_24dp.png b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_done_black_24dp.png
new file mode 100644
index 0000000..2f6d638
Binary files /dev/null and b/source-android/androidnative.pri/examples/androidnativeexample/res/drawable-xxxhdpi/ic_done_black_24dp.png differ
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/statusbar/StatusBarDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/statusbar/StatusBarDemo.qml
new file mode 100644
index 0000000..0d82d01
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/statusbar/StatusBarDemo.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.2
+import QtQuick.Window 2.1
+import QtQuick.Controls 2.1 as QQC2
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import AndroidNative 1.0 as AN
+import "../theme"
+
+Page {
+
+ actionBar: ActionBar {
+ id : actionBar
+ title: "Status Bar"
+ z: 10
+ upEnabled: true
+ onActionButtonClicked: back();
+ }
+
+ Column {
+ anchors.centerIn: parent
+
+ QQC2.Switch {
+ text: "Translucent Status Bar"
+ checked: false
+
+ onCheckedChanged: {
+ AN.SystemDispatcher.dispatch("androidnative.Util.setTranslucentStatusBar", {value: checked});
+ }
+ }
+
+ QQC2.Switch {
+ text: "Status Bar Visible"
+ checked: true
+
+ onCheckedChanged: {
+ AN.SystemDispatcher.dispatch("androidnative.Util.setFullScreen", {value: checked});
+ }
+ }
+
+ }
+
+ Component.onCompleted: {
+ AN.SystemDispatcher.loadClass("androidnative.Util");
+ }
+
+
+}
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/theme/ActionBarBackground.qml b/source-android/androidnative.pri/examples/androidnativeexample/theme/ActionBarBackground.qml
new file mode 100644
index 0000000..1adb0f1
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/theme/ActionBarBackground.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QuickAndroid 0.1
+
+Item {
+
+ MaterialShadow {
+ asynchronous: true
+ anchors.fill: parent
+ depth: 1
+ }
+
+ Rectangle {
+ color: "#cddc39" // Lime 500
+ anchors.fill: parent
+ }
+}
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/theme/AppTheme.qml b/source-android/androidnative.pri/examples/androidnativeexample/theme/AppTheme.qml
new file mode 100644
index 0000000..9ee92c2
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/theme/AppTheme.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+pragma Singleton
+
+Theme {
+ mediumText.textSize: 18 * A.dp
+ smallText.textSize : 14 * A.dp
+
+ colorPrimary: "#cddc39" // Lime 500
+ textColorPrimary: Constants.black87
+ windowBackground: "#eeeeee";
+
+ // The default icon of ActionBar is a "back" image
+ actionBar.iconSource: A.drawable("ic_arrow_back",Constants.black87)
+
+ // Background with shadow
+ actionBar.background: ActionBarBackground {
+ }
+
+ // actionBar.title.textSize is not allowed in QML. You should declare your own TextMaterial and assign directly.
+ // or modify text , smallText , mediumText and largetText
+ actionBar.title : customTextMaterial1;
+ actionBar.iconSourceSize: Qt.size(24 * A.dp , 24 * A.dp)
+
+ // Custom Style object.
+ TextMaterial {
+ id : customTextMaterial1
+ textSize: 18 * A.dp
+ textColor : Constants.black87
+ }
+}
+
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/theme/qmldir b/source-android/androidnative.pri/examples/androidnativeexample/theme/qmldir
new file mode 100644
index 0000000..5a1f2f4
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/theme/qmldir
@@ -0,0 +1,2 @@
+module theme
+singleton AppTheme 0.1 AppTheme.qml
diff --git a/source-android/androidnative.pri/examples/androidnativeexample/toast/ToastDemo.qml b/source-android/androidnative.pri/examples/androidnativeexample/toast/ToastDemo.qml
new file mode 100644
index 0000000..f5e23bd
--- /dev/null
+++ b/source-android/androidnative.pri/examples/androidnativeexample/toast/ToastDemo.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.2
+import QtQuick.Window 2.1
+import QuickAndroid 0.1
+import QuickAndroid.Styles 0.1
+import AndroidNative 1.0 as AN
+import "../theme"
+
+Page {
+
+ actionBar: ActionBar {
+ id : actionBar
+ title: "Toast"
+ z: 10
+ upEnabled: true
+ onActionButtonClicked: back();
+ }
+
+ AN.Toast {
+ id: toast
+ text: "Toast"
+ longDuration: true
+ }
+
+ Button {
+ id: label
+ text : "Press to show toast"
+ anchors.centerIn: parent
+ onClicked: {
+ toast.show();
+ }
+ }
+
+}
diff --git a/source-android/androidnative.pri/java/src/androidnative/AndroidNativeActivity.java b/source-android/androidnative.pri/java/src/androidnative/AndroidNativeActivity.java
index 01833c2..e03622f 100644
--- a/source-android/androidnative.pri/java/src/androidnative/AndroidNativeActivity.java
+++ b/source-android/androidnative.pri/java/src/androidnative/AndroidNativeActivity.java
@@ -4,13 +4,6 @@ import android.util.Log;
import android.app.Activity;
import android.os.*;
import java.util.Map;
-import java.util.HashMap;
-import android.content.pm.PackageManager;
-import android.content.Context;
-import android.Manifest.permission;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-import androidnative.AndroidNativeService;
/** An alternative Activity class for Qt applicaiton.
@@ -18,9 +11,6 @@ import androidnative.AndroidNativeService;
*/
public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.QtActivity {
- public static final int MY_PERMISSIONS_REQUEST_READ_STORAGE = 0x245285a8;
- public static final int MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS = 0x245285a9;
- private static final String TAG = "AndroidNativeActivity";
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -31,28 +21,9 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
protected void onResume() {
super.onResume();
-
-
-
- AndroidNativeService fs = new AndroidNativeService();
- fs.startQtService(this);
- //if (ContextCompat.checkSelfPermission(this,android.Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) {
-
- // Permission is not granted
-
- // ActivityCompat.requestPermissions(this,new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE},MY_PERMISSIONS_REQUEST_WRITE_STORAGE);
-
- // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
- // app-defined int constant. The callback method gets the
- // result of the request.
- //} else {
-
- System.loadLibrary("friendiqa_arm64-v8a");
- //System.loadLibrary("friendiqa_armeabi-v7a");
if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) {
SystemDispatcher.onActivityResume();
} else {
-
Intent data = getIntent();
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
String type = data.getType();
@@ -75,42 +46,9 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
} else {
SystemDispatcher.onActivityResume();
}}
- //}
}
-
-
-
- @Override public void onRequestPermissionsResult(int requestCode,String permissions[], int[] grantResults) {
- Log.d(TAG,"onRequestPermissionsResult");
- switch (requestCode) {
- case MY_PERMISSIONS_REQUEST_READ_STORAGE: {
- // If request is cancelled, the result arrays are empty.
- if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
- Map message = new HashMap();
- message.put("multiple",false);
- SystemDispatcher.dispatch("androidnative.ImagePicker.pickImage",message);
- } else {
- }
- }
- case MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS: {
- // If request is cancelled, the result arrays are empty.
- if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
- Map message = new HashMap();
- message.put("multiple",false);
- SystemDispatcher.dispatch("androidnative.Util.setPostNotification",message);
- } else {
- }
- }
- return;
- }
- }
-
-
-
- protected void onNewIntent(Intent data) {
- System.loadLibrary("friendiqa_arm64-v8a");
- //System.loadLibrary("friendiqa_armeabi-v7a");
+ protected void onNewIntent(Intent data) {
super.onNewIntent(data);
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
String type = data.getType();
diff --git a/source-android/androidnative.pri/java/src/androidnative/AndroidNativeService.java b/source-android/androidnative.pri/java/src/androidnative/AndroidNativeService.java
deleted file mode 100644
index eeca21e..0000000
--- a/source-android/androidnative.pri/java/src/androidnative/AndroidNativeService.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package androidnative;
-import android.os.Build;
-import android.content.Context;
-import android.content.Intent;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.util.Log;
-import android.app.Notification.Builder;
-import android.app.Notification;
-import android.app.job.JobScheduler;
-import org.qtproject.qt5.android.bindings.QtService;
-import org.qtproject.qt5.android.QtNative;
-import org.qtproject.friendiqa.R;
-import androidnative.friendiqa.FriendiqaActivity;
-
-public class AndroidNativeService extends QtService
- {
- private static String TAG = "AndroidNative";
-
- public void startQtService(Context ctx) {
- Log.d(TAG, "QtActivity active "+String.valueOf(QtNative.activity()!=null));
- if (QtNative.activity()==null){
- Log.d(TAG,"Friendiqasync Stop existing QtService");
- ctx.stopService(new Intent(ctx, AndroidNativeService.class));
-
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- Log.d(TAG,"Friendiqasync startForegroundService");
- ctx.startForegroundService(new Intent(ctx, AndroidNativeService.class));
- } else {
- ctx.startService(new Intent(ctx, AndroidNativeService.class));
- }
- }
-
- public static void stopQtService(Context ctx) {
- Log.d(TAG,"Friendiqasync QtServiceStop");
- ctx.stopService(new Intent(ctx, AndroidNativeService.class));
- }
-
- @Override
- public void onCreate()
- {
- Context context;
- context = this.getApplicationContext();
- Log.d(TAG,"Friendiqa onCreate");
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-
- Intent intent = new Intent(context,FriendiqaActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
- String CHANNEL_ID = "channel_02";
- NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
- "Sync Channel",
- NotificationManager.IMPORTANCE_DEFAULT);
- channel.setSound(null,null);
- ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
- Log.d(TAG,"Friendiqa onCreate Notification");
- Notification notification = new Notification.Builder(context,CHANNEL_ID)
- .setSmallIcon(R.drawable.friendiqanotification)
- .setContentTitle("Friendiqa")
- .setContentText("Background Sync")
- .setContentIntent(pendingIntent).build();
- startForeground(1, notification);}
- JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
- jobScheduler.cancel(1);
- super.onCreate();
- }
- }
diff --git a/source-android/androidnative.pri/java/src/androidnative/ImagePicker.java b/source-android/androidnative.pri/java/src/androidnative/ImagePicker.java
index 9b9b0e5..5d515f8 100644
--- a/source-android/androidnative.pri/java/src/androidnative/ImagePicker.java
+++ b/source-android/androidnative.pri/java/src/androidnative/ImagePicker.java
@@ -1,7 +1,6 @@
package androidnative;
import org.qtproject.qt5.android.QtNative;
import android.content.Intent;
-import android.content.Context;
import android.util.Log;
import android.app.Activity;
import java.util.Map;
@@ -18,20 +17,12 @@ import android.content.ClipData;
import java.util.List;
import java.util.ArrayList;
-import android.content.pm.PackageManager;
-import android.content.Context;
-import android.Manifest.permission;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-
-
-
public class ImagePicker {
// Random
public static final int PICK_IMAGE_ACTION = 0x245285a3;
public static final int TAKE_PHOTO_ACTION = 0x29fe8748;
- public static final int MY_PERMISSIONS_REQUEST_READ_STORAGE = 0x245285a8;
+
public static final String PICK_IMAGE_MESSAGE = "androidnative.ImagePicker.pickImage";
public static final String TAKE_PHOTO_MESSAGE = "androidnative.ImagePicker.takePhoto";
public static final String CHOSEN_MESSAGE = "androidnative.ImagePicker.chosen";
@@ -56,15 +47,8 @@ public class ImagePicker {
}
static void pickImage(Map message) {
- Context context;
- context = QtNative.activity().getApplicationContext();
- Activity activity = org.qtproject.qt5.android.QtNative.activity();
- if (ContextCompat.checkSelfPermission(context,android.Manifest.permission.READ_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) {
- // Permission is not granted
- ActivityCompat.requestPermissions(activity,new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE},MY_PERMISSIONS_REQUEST_READ_STORAGE);
- } else {
Boolean multiple = false;
- //Activity activity = org.qtproject.qt5.android.QtNative.activity();
+ Activity activity = org.qtproject.qt5.android.QtNative.activity();
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
@@ -78,8 +62,7 @@ public class ImagePicker {
// >= API 18
activity.startActivityForResult(intent, PICK_IMAGE_ACTION);
-
- }}
+ }
static void takePhoto(Map message) {
if (message.containsKey("broadcast")) {
@@ -112,6 +95,7 @@ public class ImagePicker {
return;
int requestCode = (Integer) message.get("requestCode");
Intent data = (Intent) message.get("data");
+
if (requestCode == PICK_IMAGE_ACTION) {
importImage(data);
} else if (requestCode == TAKE_PHOTO_ACTION) {
@@ -126,8 +110,8 @@ public class ImagePicker {
static private void importImage(Intent data) {
Uri uri = data.getData();
- //Log.d(TAG,"importImage: uri:" + uri);
- //Log.d(TAG,"importImage: type: " + data.getType());
+ Log.d(TAG,"importImage: uri:" + uri);
+ Log.d(TAG,"importImage: type: " + data.getType());
if (data.getClipData() != null) {
importImageFromClipData(data);
diff --git a/source-android/androidnative.pri/java/src/androidnative/SystemDispatcher.java b/source-android/androidnative.pri/java/src/androidnative/SystemDispatcher.java
index 616fce5..c21d802 100644
--- a/source-android/androidnative.pri/java/src/androidnative/SystemDispatcher.java
+++ b/source-android/androidnative.pri/java/src/androidnative/SystemDispatcher.java
@@ -135,12 +135,12 @@ public class SystemDispatcher {
message.put("requestCode",requestCode);
message.put("resultCode",resultCode);
message.put("data",data);
+ Log.d(TAG,"onActivityResult" + isInitialized);
if(isInitialized) {
dispatch(ACTIVITY_RESULT_MESSAGE,message);
waitingIntent=null;
isIntentPending=false;
} else { //onIntent start
- Log.e(TAG,"notInitialized: onIntentStart "+data);
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
waitingIntent = message;
diff --git a/source-android/androidnative.pri/java/src/androidnative/Util.java b/source-android/androidnative.pri/java/src/androidnative/Util.java
index 3d77096..d016af5 100644
--- a/source-android/androidnative.pri/java/src/androidnative/Util.java
+++ b/source-android/androidnative.pri/java/src/androidnative/Util.java
@@ -6,29 +6,10 @@ import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
-import android.content.Context;
-import android.content.ComponentName;
-import android.app.job.JobScheduler;
-import android.app.job.JobInfo;
-import android.app.PendingIntent;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import androidx.core.app.NotificationCompat;
-import androidx.core.app.NotificationManagerCompat;
-import org.qtproject.qt5.android.QtNative;
-import androidnative.friendiqa.FriendiqaService;
-import androidnative.friendiqa.FriendiqaStopService;
-import androidnative.friendiqa.FriendiqaActivity;
-import androidnative.AndroidNativeActivity;
-import androidnative.AndroidNativeService;
-import android.content.Intent;
-import java.util.Map;
-import org.qtproject.friendiqa.R;
-import android.content.pm.PackageManager;
-import android.Manifest;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
+import org.qtproject.qt5.android.QtNative;
+
+import java.util.Map;
public class Util {
@@ -36,10 +17,7 @@ public class Util {
public static final String SET_TRANSLUCENT_STATUS_BAR = "androidnative.Util.setTranslucentStatusBar";
public static final String SET_FULL_SCREEN = "androidnative.Util.setFullScreen";
- public static final String SET_SCHEDULE = "androidnative.Util.setSchedule";
- public static final String SET_NOTIFICATION = "androidnative.Util.setNotification";
- public static final String SET_POST_NOTIFICATION = "androidnative.Util.setPostNotification";
- public static final int MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS = 0x245285a9;
+
static {
SystemDispatcher.addListener(new SystemDispatcher.Listener() {
@@ -48,12 +26,6 @@ public class Util {
setTranslucentStatusBar(message);
} else if (type.equals(SET_FULL_SCREEN)) {
setFullScreen(message);
- } else if (type.equals(SET_SCHEDULE)) {
- setSchedule(message);
- } else if (type.equals(SET_NOTIFICATION)) {
- setNotification(message);
- } else if (type.equals(SET_POST_NOTIFICATION)) {
- setPostNotification(message);
}
}
});
@@ -90,10 +62,6 @@ public class Util {
return;
}
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- return;
- }
-
final Boolean value = (Boolean) message.get("value");
final Activity activity = QtNative.activity();
@@ -116,140 +84,4 @@ public class Util {
activity.runOnUiThread(runnable);
}
-
- static void setNotification(Map message) {
- Log.d(TAG,"setNotification");
- Context context;
- //Context appcontext;
- context = QtNative.service().getApplicationContext();
- //appcontext = QtNative.activity().getApplicationContext();
- Intent intent = new Intent(context,FriendiqaActivity.class);
- //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
-
- final String textTitle = (String) message.get("title");
- final String textContent = (String) message.get("message");
- final int notificationId = (int) message.get("id");
-
- NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- final String CHANNEL_ID = "channel_01";
- NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
- "Channel for Friendiqa News",
- NotificationManagerCompat.IMPORTANCE_LOW);
- notificationManager.createNotificationChannel(channel);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(context,CHANNEL_ID)
- .setSmallIcon(R.drawable.friendiqanotification)
- .setContentIntent(pendingIntent)
- .setContentTitle(textTitle)
- .setContentText(textContent)
- .setStyle(new NotificationCompat.BigTextStyle()
- .bigText(textContent))
- .setAutoCancel(true);
- notificationManager.notify(notificationId, builder.build());
-
- } else {
- NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
- .setSmallIcon(R.drawable.friendiqanotification)
- .setContentIntent(pendingIntent)
- .setContentTitle(textTitle)
- .setContentText(textContent)
- .setStyle(new NotificationCompat.BigTextStyle()
- .bigText(textContent))
-
- .setPriority(NotificationCompat.PRIORITY_DEFAULT)
- .setAutoCancel(true);
- notificationManager.notify(notificationId, builder.build());
- }
- }
-
- static void setSchedule(Map message) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- return;
- }
-
- final Integer value = (Integer) message.get("value");
- //final int JOB_ID = 1;
- final int ONE_MIN = 60 * 1000;
- Context context;
- if (QtNative.activity() == null){
- context = QtNative.service().getApplicationContext();
-
- } else {
- context = QtNative.activity().getApplicationContext();
- }
-
-
-
- //AndroidNativeService fs = new AndroidNativeService();
- //fs.startQtService(context);
-
-
- if (value==0){
- JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
- jobScheduler.cancelAll();
- Log.d(TAG,"Friendiqasync deleting Androidnative jobscheduler");
- } else {
- Log.d(TAG,"Friendiqasync schedule Androidnative jobscheduler");
- ComponentName component = new ComponentName(context, FriendiqaService.class);
- JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
-
-
- //Log.d(TAG,"Jobinfolist size " + String.valueOf(jobScheduler.getAllPendingJobs().size()));
- if (jobScheduler.getAllPendingJobs().size()==0){
- JobInfo.Builder builder = new JobInfo.Builder(2, component)
- .setPeriodic(value * ONE_MIN)
- .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
- .setPersisted(true)
- .setPrefetch(true);
- Log.d(TAG,"1 Friendiqa schedule Androidnative sync schedule"+ (value * ONE_MIN));
- jobScheduler.schedule(builder.build());
- } else {
- for ( JobInfo jobInfo : jobScheduler.getAllPendingJobs() ) {
- //Log.d(TAG,"Jobinfo current interval " + String.valueOf(jobInfo.getIntervalMillis ()));
- if (jobInfo.getIntervalMillis ()!=(value * ONE_MIN)){
- JobInfo.Builder builder = new JobInfo.Builder(2, component)
- .setPeriodic(value * ONE_MIN)
- .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
- .setPersisted(true)
- .setPrefetch(true);
- Log.d(TAG,"2 Friendiqa schedule Androidnative sync schedule"+ (value * ONE_MIN));
- jobScheduler.schedule(builder.build());
- }
- }
- }
- //Log.d(TAG,"Active service " + String.valueOf(QtNative.service()!=null));
- //if (QtNative.service() != null){
- // Log.d(TAG,"Schedule Stopping Friendiqa Androidnative service");
- // ComponentName componentStopper = new ComponentName(context, FriendiqaStopService.class);
- // JobInfo.Builder stopbuilder = new JobInfo.Builder(1, componentStopper)
- // .setMinimumLatency(50)
- // .setOverrideDeadline(100);
-
- // JobScheduler jobStopScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
- // jobStopScheduler.schedule(stopbuilder.build());
- //}
- }
- NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
- notificationManager.cancelAll();
- //context.stopService(new Intent(context, AndroidNativeService.class));
- }
-
- static void setPostNotification(Map message) {
- Log.d(TAG,"setPostNotification");
- Context context;
- if (QtNative.activity() == null){
- context = QtNative.service().getApplicationContext();
- } else {
- context = QtNative.activity().getApplicationContext();
- }
- Activity activity = org.qtproject.qt5.android.QtNative.activity();
- Log.d(TAG,String.valueOf(ContextCompat.checkSelfPermission(context,Manifest.permission.POST_NOTIFICATIONS)));
- if (ContextCompat.checkSelfPermission(context,Manifest.permission.POST_NOTIFICATIONS)!= PackageManager.PERMISSION_GRANTED) {
- // Permission is not granted
- Log.d(TAG,String.valueOf(PackageManager.PERMISSION_GRANTED));
- ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.POST_NOTIFICATIONS},MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS);
- }
- }
}
diff --git a/source-android/application.qrc b/source-android/application.qrc
new file mode 100644
index 0000000..256445b
--- /dev/null
+++ b/source-android/application.qrc
@@ -0,0 +1,225 @@
+
+
+ qml/friendiqa.qml
+ qml/newsqml/NewsTab.qml
+ qml/newsqml/Newsitem.qml
+ qml/newsqml/MessageSend.qml
+ qml/newsqml/Conversation.qml
+ qml/newsqml/FriendicaActivities.qml
+ qml/contactqml/FriendsTab.qml
+ qml/contactqml/GroupComponent.qml
+ qml/contactqml/ContactComponent.qml
+ qml/contactqml/ContactDetailsComponent.qml
+ qml/contactqml/Contactlist.qml
+ qml/genericqml/BlueButton.qml
+ qml/photoqml/PhotoComponent.qml
+ qml/photoqml/PhotogroupComponent.qml
+ qml/photoqml/PhotoTab.qml
+ qml/configqml/InfoBox.qml
+ qml/configqml/ConfigTab.qml
+ js/layout.js
+ js/photoworker.js
+ js/service.js
+ js/news.js
+ js/newsworker.js
+ js/helper.js
+ images/defaultcontact.jpg
+ images/fontawesome-webfont.ttf
+ images/folder-blue.png
+ qml/configqml/OSSettingsAndroid.qml
+ qml/configqml/OSSettingsLinux.qml
+ qml/newsqml/SmileyDialog.qml
+ js/smiley.js
+ images/smileys/animals/bee.gif
+ images/smileys/animals/bigspider.gif
+ images/smileys/animals/bunny.gif
+ images/smileys/animals/bunnyflowers.gif
+ images/smileys/animals/cat.gif
+ images/smileys/animals/chick.gif
+ images/smileys/animals/cow.gif
+ images/smileys/animals/crab.gif
+ images/smileys/animals/dog.gif
+ images/smileys/animals/dolphin.gif
+ images/smileys/animals/dragonfly.gif
+ images/smileys/animals/elephant.gif
+ images/smileys/animals/fish.gif
+ images/smileys/animals/frog.gif
+ images/smileys/animals/giraffe.gif
+ images/smileys/animals/hamster.gif
+ images/smileys/animals/horse.gif
+ images/smileys/animals/ladybird.gif
+ images/smileys/animals/monkey.gif
+ images/smileys/animals/parrot.gif
+ images/smileys/animals/pig.gif
+ images/smileys/animals/sheep.gif
+ images/smileys/animals/snail.gif
+ images/smileys/animals/tux.gif
+ images/smileys/babies/baby.gif
+ images/smileys/babies/babycot.gif
+ images/smileys/babies/pregnant.gif
+ images/smileys/babies/stork.gif
+ images/smileys/confused/confused.gif
+ images/smileys/confused/dazed.gif
+ images/smileys/confused/shrug.gif
+ images/smileys/confused/stupid.gif
+ images/smileys/cool/affro.gif
+ images/smileys/cool/cool.gif
+ images/smileys/devilangel/angel.gif
+ images/smileys/devilangel/blondedevil.gif
+ images/smileys/devilangel/catdevil.gif
+ images/smileys/devilangel/cherub.gif
+ images/smileys/devilangel/daseesaw.gif
+ images/smileys/devilangel/devil.gif
+ images/smileys/devilangel/graveside.gif
+ images/smileys/devilangel/saint.gif
+ images/smileys/devilangel/turnevil.gif
+ images/smileys/disgust/fartblush.gif
+ images/smileys/disgust/fartinbed.gif
+ images/smileys/disgust/toilet.gif
+ images/smileys/disgust/vomit.gif
+ images/smileys/drink/tea.gif
+ images/smileys/drool/drool.gif
+ images/smileys/fantasy/alienmonster.gif
+ images/smileys/fantasy/barbarian.gif
+ images/smileys/fantasy/dinosaur.gif
+ images/smileys/fantasy/dragon.gif
+ images/smileys/fantasy/dragonwhelp.gif
+ images/smileys/fantasy/ghost.gif
+ images/smileys/fantasy/mummy.gif
+ images/smileys/fight/2guns.gif
+ images/smileys/fight/acid.gif
+ images/smileys/fight/alienfight.gif
+ images/smileys/fight/alpha.png
+ images/smileys/fight/army.gif
+ images/smileys/fight/arrowhead.gif
+ images/smileys/fight/bfg.gif
+ images/smileys/fight/bowman.gif
+ images/smileys/fight/chainsaw.gif
+ images/smileys/fight/crossbow.gif
+ images/smileys/fight/crusader.gif
+ images/smileys/fight/dead.gif
+ images/smileys/fight/gangs.gif
+ images/smileys/fight/hammersplat.gif
+ images/smileys/fight/lasergun.gif
+ images/smileys/fight/machinegun.gif
+ images/smileys/fight/marine.gif
+ images/smileys/fight/sabre.gif
+ images/smileys/fight/samurai.gif
+ images/smileys/fight/tank.gif
+ images/smileys/fight/viking.gif
+ images/smileys/food/apple.gif
+ images/smileys/food/banana.gif
+ images/smileys/food/birthdaycake.gif
+ images/smileys/food/broccoli.gif
+ images/smileys/food/cake.gif
+ images/smileys/food/carrot.gif
+ images/smileys/food/cooking.gif
+ images/smileys/food/fryegg.gif
+ images/smileys/food/popcorn.gif
+ images/smileys/food/tomato.gif
+ images/smileys/happy/cloud9.gif
+ images/smileys/happy/tearsofjoy.gif
+ images/smileys/laugh/hahaha.gif
+ images/smileys/laugh/loltv.gif
+ images/smileys/laugh/rofl.gif
+ images/smileys/love/iloveyou.gif
+ images/smileys/love/inlove.gif
+ images/smileys/love/love.gif
+ images/smileys/love/lovebear.gif
+ images/smileys/love/lovebed.gif
+ images/smileys/love/loveheart.gif
+ images/smileys/music/dj.gif
+ images/smileys/music/drums.gif
+ images/smileys/music/elvis.gif
+ images/smileys/music/guitar.gif
+ images/smileys/music/trumpet.gif
+ images/smileys/music/violin.gif
+ images/smileys/oldcore/beard.png
+ images/smileys/oldcore/headbang.gif
+ images/smileys/oldcore/laughing.gif
+ images/smileys/oldcore/shaka.gif
+ images/smileys/oldcore/surprised.gif
+ images/smileys/oldcore/whitebeard.png
+ images/smileys/respect/bow.gif
+ images/smileys/respect/bravo.gif
+ images/smileys/respect/hailking.gif
+ images/smileys/respect/number1.gif
+ images/smileys/sad/crying.png
+ images/smileys/sad/prisoner.gif
+ images/smileys/sad/sigh.gif
+ images/smileys/smoking/smoking.gif
+ images/smileys/sport/archery.gif
+ images/smileys/sport/basketball.gif
+ images/smileys/sport/bowling.gif
+ images/smileys/sport/cycling.gif
+ images/smileys/sport/darts.gif
+ images/smileys/sport/fencing.gif
+ images/smileys/sport/football.gif
+ images/smileys/sport/golf.gif
+ images/smileys/sport/horseriding.gif
+ images/smileys/sport/juggling.gif
+ images/smileys/sport/skipping.gif
+ images/smileys/sport/snooker.gif
+ images/smileys/sport/surfing.gif
+ images/smileys/sport/tennis.gif
+ images/smileys/tired/countsheep.gif
+ images/smileys/tired/hammock.gif
+ images/smileys/tired/pillow.gif
+ images/smileys/tired/yawn.gif
+ images/smileys/core/beer_mug.gif
+ images/smileys/core/coffee.gif
+ images/smileys/core/dislike.gif
+ images/smileys/core/friendica-16.png
+ images/smileys/core/like.gif
+ images/smileys/core/rm-16.png
+ images/smileys/core/smiley-bangheaddesk.gif
+ images/smileys/core/smiley-brokenheart.gif
+ images/smileys/core/smiley-cool.gif
+ images/smileys/core/smiley-cry.gif
+ images/smileys/core/smiley-embarassed.gif
+ images/smileys/core/smiley-facepalm.gif
+ images/smileys/core/smiley-foot-in-mouth.gif
+ images/smileys/core/smiley-heart.gif
+ images/smileys/core/smiley-kiss.gif
+ images/smileys/core/smiley-laughing.gif
+ images/smileys/core/smiley-Oo.gif
+ images/smileys/core/smiley-smile.gif
+ images/smileys/core/smiley-surprised.gif
+ images/smileys/core/smiley-thumbsup.gif
+ images/smileys/core/smiley-tongue-out.gif
+ images/smileys/core/smiley-undecided.gif
+ images/smileys/core/smiley-wink.gif
+ images/smileys/core/smiley-frown.gif
+ images/smileys/adult/bong.gif
+ images/smileys/adult/drunk.gif
+ images/smileys/adult/finger.gif
+ images/smileys/adult/sperm.gif
+ images/smileys/adult/tits.gif
+ common/filesystem.cpp
+ common/filesystem.h
+ common/friendiqa.cpp
+ common/uploadableimage.cpp
+ common/uploadableimage.h
+ common/xhr.cpp
+ common/xhr.h
+ qml/calendarqml/CalendarTab.qml
+ qml/calendarqml/CalendarDay.qml
+ qml/calendarqml/EventList.qml
+ translations/friendiqa-de.qm
+ translations/friendiqa-de.ts
+ translations/friendiqa-es.qm
+ translations/friendiqa-es.ts
+ qml/photoqml/ImageUploadDialog.qml
+ qml/genericqml/PermissionDialog.qml
+ images/addImage.png
+ qml/genericqml/ImagePicker.qml
+ qml/genericqml/ImagePickerLinux.qml
+ js/image.js
+ qml/contactqml/ProfileComponent.qml
+ translations/friendiqa-it.ts
+ qml/genericqml/Search.qml
+ qml/newsqml/Hashtag.qml
+ qml/genericqml/IntentReceiver.qml
+ qml/newsqml/NewsImage.qml
+
+
diff --git a/src/common/filesystem.cpp b/source-android/common/filesystem.cpp
similarity index 62%
rename from src/common/filesystem.cpp
rename to source-android/common/filesystem.cpp
index 2ce9919..c1668e4 100644
--- a/src/common/filesystem.cpp
+++ b/source-android/common/filesystem.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,7 +30,6 @@
// along with this program. If not, see .
#include "filesystem.h"
-#include
FILESYSTEM *FILESYSTEM::instance()
{
@@ -53,22 +52,11 @@ QString FILESYSTEM::Directory() const
return m_Directory;
}
-void FILESYSTEM::setVisibility(bool Visibility)
-{
- if (Visibility!=m_Visibility) {
- m_Visibility = Visibility;
- emit visibilityChanged();
- }
-}
-
-bool FILESYSTEM::Visibility()
-{
- return m_Visibility;
-}
-
QString FILESYSTEM::homePath() const
{
- QString homeDir=QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);;
+ QDir dir(m_Directory);
+ QString homeDir=dir.homePath();
+ //qDebug(homeDir);
return homeDir;
}
@@ -95,25 +83,13 @@ void FILESYSTEM::makeDir(QString name)
if (dir.mkdir(name)){
emit success(name);
}
- else {
- emit error(name,1);
- }
-}
-
-void FILESYSTEM::makePath(QString name)
-{
- QDir dir(m_Directory);
- if (dir.mkpath(name)){
- emit success(name);
- }
- else {
- qDebug() << "makepath error" <
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -34,8 +34,6 @@
#include
#include
-#include
-#include
//#include
//#include
@@ -43,12 +41,8 @@ class FILESYSTEM : public QObject//, public QAndroidActivityResultReceiver
{
Q_OBJECT
Q_PROPERTY(QString Directory READ Directory WRITE setDirectory NOTIFY directoryChanged)
- Q_PROPERTY(bool Visibility READ Visibility WRITE setVisibility NOTIFY visibilityChanged)
//Q_PROPERTY(bool direxist READ direxist)
Q_PROPERTY(QString homePath READ homePath)
- Q_PROPERTY(bool isAutostart READ isAutostart NOTIFY isAutostartChanged)
- Q_PROPERTY(QString osType READ osType CONSTANT)
- Q_PROPERTY(QString hostname READ hostname CONSTANT)
//Q_PROPERTY(QString cameraPath READ cameraPath)
@@ -56,23 +50,16 @@ public:
static FILESYSTEM *instance();
explicit FILESYSTEM(QObject *parent = 0);
void setDirectory(QString Directory);
- void setVisibility(bool Visibility);
QString Directory() const;
QFileInfoList fileList();
//bool direxist(QString Directory);
QString homePath() const;
- bool Visibility();
- bool isAutostart();
- QString osType() const;
- QString hostname() const;
//QString cameraPath() const;
// virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data);
signals:
//void imageselected(QString);
void directoryChanged();
- void visibilityChanged();
- void isAutostartChanged();
//void fileListContent(QList data);
void success(QString data);
void error(QString data, int code);
@@ -80,17 +67,14 @@ signals:
public slots:
bool fileexist(QString name);
void makeDir(QString name);
- void makePath(QString name);
void rmDir();
void rmFile(QString name);
- void setAutostart(bool autostart);
//void searchImage();
//void fileList();
private:
QString m_Directory;
QString homeDir;
- bool m_Visibility;
//QList m_Filelist;
};
diff --git a/source-android/common/friendiqa.cpp b/source-android/common/friendiqa.cpp
index 7dc02b5..8a0280c 100644
--- a/source-android/common/friendiqa.cpp
+++ b/source-android/common/friendiqa.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -31,18 +31,18 @@
#include
#include
-#include
#include
#include "xhr.h"
-#include "updatenews.h"
#include "filesystem.h"
-#include "oauth.h"
#include "remoteauthasyncimageprovider.h"
#include "AndroidNative/systemdispatcher.h"
+#include "AndroidNative/environment.h"
+//#include "AndroidNative/debug.h"
+#include "AndroidNative/mediascannerconnection.h"
#ifdef Q_OS_ANDROID
-#include
+#include
#include
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
Q_UNUSED(vm);
@@ -50,44 +50,27 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
AndroidNative::SystemDispatcher::registerNatives();
return JNI_VERSION_1_6;
- }
+ }
#endif
-Q_DECL_EXPORT int main(int argc, char *argv[]) {
- if ((argc>1) && (qstrcmp(argv[1],"-service")==0)){
- QAndroidService app(argc, argv);
- UPDATENEWS* updatenews= UPDATENEWS::instance();
- updatenews->setDatabase();
- updatenews->login();
- updatenews->setSyncAll(true);
- updatenews->startsync();
- app.connect (updatenews,SIGNAL(quitapp()),&app,SLOT(quit()));
- return app.exec();
- }
- else{
+int main(int argc, char *argv[]) {
QApplication app(argc, argv);
- QQmlApplicationEngine view;
+ QQuickView view;
QTranslator qtTranslator;
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
app.installTranslator(&qtTranslator);
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
- view.addImageProvider("remoteauthimage",imageProvider);
+ view.engine()->addImageProvider("remoteauthimage",imageProvider);
view.rootContext()->setContextProperty("remoteauth", imageProvider);
XHR* xhr = XHR::instance();
view.rootContext()->setContextProperty("xhr", xhr);
FILESYSTEM* filesystem = FILESYSTEM::instance();
view.rootContext()->setContextProperty("filesystem", filesystem);
- ALARM* alarm = ALARM::instance();
- view.rootContext()->setContextProperty("alarm", alarm);
- UPDATENEWS* updatenews = UPDATENEWS::instance();
- view.rootContext()->setContextProperty("updatenews", updatenews);
- OAuthWrapper* oauth2 = OAuthWrapper::instance();
- view.rootContext()->setContextProperty("oauth2", oauth2);
- view.load(QUrl("qrc:/qml/friendiqa.qml"));
+ view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
+ view.show();
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
-
return app.exec();
- }
+
}
diff --git a/src/common/remoteauthasyncimageprovider.cpp b/source-android/common/remoteauthasyncimageprovider.cpp
similarity index 98%
rename from src/common/remoteauthasyncimageprovider.cpp
rename to source-android/common/remoteauthasyncimageprovider.cpp
index 8d21faa..66a8b03 100644
--- a/src/common/remoteauthasyncimageprovider.cpp
+++ b/source-android/common/remoteauthasyncimageprovider.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
diff --git a/src/common/remoteauthasyncimageprovider.h b/source-android/common/remoteauthasyncimageprovider.h
similarity index 98%
rename from src/common/remoteauthasyncimageprovider.h
rename to source-android/common/remoteauthasyncimageprovider.h
index 2d990a6..f028ada 100644
--- a/src/common/remoteauthasyncimageprovider.h
+++ b/source-android/common/remoteauthasyncimageprovider.h
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
diff --git a/src/common/uploadableimage.cpp b/source-android/common/uploadableimage.cpp
similarity index 81%
rename from src/common/uploadableimage.cpp
rename to source-android/common/uploadableimage.cpp
index cea2d77..7ef3524 100644
--- a/src/common/uploadableimage.cpp
+++ b/source-android/common/uploadableimage.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -36,19 +36,6 @@
#include
#include
#include
-#include
-
-void UploadableImage::setAngle(const int &b) {
- if (b != m_angle) {
- m_angle = b;
-
- //qDebug() << "UploadableImage::setAngle : " << m_angle;
- if (m_angle==0) {
- emit angleChanged();
- return;
- }
- }
-}
void UploadableImage::setSource(const QString &a) {
if (a != m_source) {
@@ -57,7 +44,7 @@ void UploadableImage::setSource(const QString &a) {
m_mimetype = "";
m_filename = "";
- //qDebug() << "UploadableImage::setSource : " << m_source;
+ qDebug() << "UploadableImage::setSource : " << m_source;
if (m_source=="") {
emit sourceChanged();
@@ -68,12 +55,6 @@ void UploadableImage::setSource(const QString &a) {
}
QImage fullimage = QImage(QUrl(m_source).toLocalFile());
-
- if (m_angle!=0){
- QTransform transform;
- transform.rotate(qreal(m_angle));
- fullimage=fullimage.transformed(transform);
- }
if (fullimage.width() > 800 || fullimage.height() > 800) {
if (fullimage.width() > fullimage.height()) {
m_image = fullimage.scaledToWidth(800);
@@ -83,7 +64,7 @@ void UploadableImage::setSource(const QString &a) {
} else {
m_image = fullimage;
}
- //qDebug() << "UploadableImage::setSource : " << m_image.width() << "x" << m_image.height();
+ qDebug() << "UploadableImage::setSource : " << m_image.width() << "x" << m_image.height();
emit sourceChanged();
QFileInfo fi(m_source);
@@ -95,7 +76,7 @@ void UploadableImage::setSource(const QString &a) {
if (filetype!="PNG" && filetype!="JPG") {
filetype = "JPG";
}
- //qDebug() << "UploadableImage::setSource : " << "Saving as " << filetype;
+ qDebug() << "UploadableImage::setSource : " << "Saving as " << filetype;
m_mimetype = "image/"+filetype.toLower();
emit mimetypeChanged();
@@ -120,9 +101,6 @@ QString UploadableImage::source() const {
return m_source;
}
-int UploadableImage::angle() const{
- return m_angle;
-}
//QString UploadableImage::base64() const {
// return m_base64;
//}
diff --git a/src/common/uploadableimage.h b/source-android/common/uploadableimage.h
similarity index 91%
rename from src/common/uploadableimage.h
rename to source-android/common/uploadableimage.h
index d232d98..665bf82 100644
--- a/src/common/uploadableimage.h
+++ b/source-android/common/uploadableimage.h
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -40,7 +40,6 @@ class UploadableImage : public QObject
{
Q_OBJECT
Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(int angle READ angle WRITE setAngle NOTIFY angleChanged)
//Q_PROPERTY(QString base64 READ base64 NOTIFY base64Changed)
Q_PROPERTY(QString filename READ filename NOTIFY filenameChanged)
Q_PROPERTY(QString mimetype READ mimetype NOTIFY mimetypeChanged)
@@ -48,9 +47,8 @@ class UploadableImage : public QObject
public:
void setSource(const QString &a);
- void setAngle(const int &b);
QString source() const;
- int angle() const;
+
//QString base64() const;
QString filename() const;
QString mimetype() const;
@@ -58,7 +56,6 @@ public:
QByteArray bytes();
signals:
void sourceChanged();
- void angleChanged();
//void base64Changed();
void filenameChanged();
void mimetypeChanged();
@@ -66,7 +63,6 @@ signals:
private:
QString m_source;
QImage m_image;
- int m_angle;
//QString m_base64;
QString m_filename;
QString m_mimetype;
diff --git a/src/common/xhr.cpp b/source-android/common/xhr.cpp
similarity index 55%
rename from src/common/xhr.cpp
rename to source-android/common/xhr.cpp
index dba9c5d..2a9107f 100644
--- a/src/common/xhr.cpp
+++ b/source-android/common/xhr.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -32,11 +32,10 @@
#include "xhr.h"
#include
-//#include
+#include
#include
#include
#include
-#include
#include
#include
#include "uploadableimage.h"
@@ -49,95 +48,70 @@ XHR *XHR::instance()
XHR::XHR(QObject *parent) : QObject(parent)
{
- //request.setSslConfiguration(QSslConfiguration::defaultConfiguration());
+ request.setSslConfiguration(QSslConfiguration::defaultConfiguration());
}
void XHR::setUrl(QString url)
{
- if (url!=m_url) {
- m_url = url;
- emit urlChanged();
- }
+ if (url!=m_url) {
+ m_url = url;
+ emit urlChanged();
+ }
}
void XHR::setApi(QString api)
{
- if (api!=m_api) {
- m_api = api;
- emit apiChanged();
- }
+ if (api!=m_api) {
+ m_api = api;
+ emit apiChanged();
+ }
}
void XHR::setLogin(QString login)
{
- if (login!=m_login) {
- m_login = login;
- m_token="";
- emit loginChanged();
- }
-}
-
-void XHR::setAccount(QVariantMap account)
-{
- clearParams();
- if (account["password"].toString() !=""){
- setLogin(account["username"].toString()+":"+QByteArray::fromBase64(account["password"].toByteArray()));
- }
- else if (account["token"].toString() !="" && !account["token"].isNull()){
- setToken(account["token"].toString());
- }
- setUrl(account["server"].toString());
- setImagedir(account["imagestore"].toString());
- m_account = account;
- emit accountChanged();
-}
-
-void XHR::setToken(QString token)
-{
- if (token!=m_token) {
- m_token = token;
- m_login="";
- emit tokenChanged();
- }
+ if (login!=m_login) {
+ m_login = login;
+ emit loginChanged();
+ }
}
void XHR::setFilename(QString filename)
{
- if (filename!=m_filename) {
- m_filename = filename;
- emit filenameChanged();
- }
+ if (filename!=m_filename) {
+ m_filename = filename;
+ emit filenameChanged();
+ }
}
void XHR::setContactlist(QList contactlist)
{
- if (contactlist!=m_contactlist) {
- m_contactlist = contactlist;
- emit contactlistChanged();
- }
+ if (contactlist!=m_contactlist) {
+ m_contactlist = contactlist;
+ emit contactlistChanged();
+ }
}
void XHR::setFilelist(QList filelist)
{
- if (filelist!=m_filelist) {
- m_filelist = filelist;
- emit filelistChanged();
- }
+ if (filelist!=m_filelist) {
+ m_filelist = filelist;
+ emit filelistChanged();
+ }
}
void XHR::setImagedir(QString imagedir)
{
- if (imagedir!=m_imagedir) {
- m_imagedir = imagedir;
- emit imagedirChanged();
- }
+ if (imagedir!=m_imagedir) {
+ m_imagedir = imagedir;
+ emit imagedirChanged();
+ }
}
void XHR::setDownloadtype(QString downloadtype)
{
- if (downloadtype!=m_downloadtype) {
- m_downloadtype = downloadtype;
- emit downloadtypeChanged();
- }
+ if (downloadtype!=m_downloadtype) {
+ m_downloadtype = downloadtype;
+ emit downloadtypeChanged();
+ }
}
QString XHR::url() const
@@ -155,16 +129,6 @@ QString XHR::login() const
return m_login;
}
-QString XHR::token() const
-{
- return m_token;
-}
-
-QVariantMap XHR::account() const
-{
- return m_account;
-}
-
QString XHR::filename() const
{
return m_filename;
@@ -209,53 +173,43 @@ void XHR::clearParams()
void XHR::download()
{
QUrl requrl(m_url);
- QNetworkRequest request;
if(m_downloadtype=="picturelist"){
- if(m_login!=""){
- QByteArray loginData = m_login.toLocal8Bit().toBase64();
- QString headerData = "Basic " + loginData;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- } else{
- QString headerData = "Bearer " + m_token;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- }
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader("Authorization", headerData.toLocal8Bit());
}
request.setUrl(requrl);
+ //qDebug() << requrl;
reply = manager.get(request);
reply->ignoreSslErrors();
connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead);
//connect(reply,SIGNAL(downloadProgress(qint64,qint64)), this,SLOT(updateDownloadProgress(qint64,qint64)));
connect(reply, &QNetworkReply::finished,this, &XHR::onRequestFinished);
connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
- connect(reply, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
}
void XHR::get()
{
QUrlQuery query;
- //qDebug() << "get";
+
QHashIterator i(params);
while(i.hasNext()) {
i.next();
- //qDebug() << i.key() << "value" << i.value();
query.addQueryItem(i.key(), i.value());
}
+
QUrl requrl(m_url+m_api);
+ //qDebug() << requrl;
requrl.setQuery(query);
- QNetworkRequest request;
- if(m_login!=""){
- QByteArray loginData = m_login.toLocal8Bit().toBase64();
- QString headerData = "Basic " + loginData;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- } else if (m_token!=""){
- QString headerData = "Bearer " + m_token;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- }
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader("Authorization", headerData.toLocal8Bit());
request.setUrl(requrl);
reply = manager.get(request);
+
connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
- //connect(reply,SIGNAL(downloadProgress(qint64,qint64)), this,SLOT(updateDownloadProgress(qint64,qint64)));
- connect(reply, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
connect(reply, &QNetworkReply::readyRead, this, &XHR::onReadyRead);
connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
}
@@ -264,127 +218,92 @@ void XHR::getlist()
{
if(dlindex < m_filelist.size()) {
QString cleanfilename;
- if (m_downloadtype=="contactlist" || m_downloadtype=="friendrequests" ){
- cleanfilename = m_contactlist.at(dlindex)+"-"+ m_filelist.at(dlindex).section('/',-1).section('?',0,0);
+ if (m_downloadtype=="contactlist"){cleanfilename = m_contactlist.at(dlindex)+"-"+ m_filelist.at(dlindex).section('/',-1).section('?',0,0);
XHR::setFilename(imagedir()+"contacts/"+cleanfilename);
XHR::setUrl(m_filelist.at(dlindex));}
else {
XHR::setUrl(m_filelist.at(dlindex));}
- //qDebug() << "start download" << m_url;
XHR::download();
- } else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();}
+ } else {dlindex=0;}
}
void XHR::post()
{
+ qDebug() << "start post to " << m_url;
QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
QHashIterator iparams(params);
while(iparams.hasNext()) {
iparams.next();
+ qDebug() << "\t add param " << iparams.key() << " : " << iparams.value();
QHttpPart textPart;
textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"" + iparams.key() + "\""));
+
+
textPart.setBody(iparams.value().toUtf8());
multiPart->append(textPart);
}
UploadableImage uimg;
- if (files.contains("media")){
- uimg.setAngle(files.value("angle").toInt());
- uimg.setSource(files.value("media"));
+ QHashIterator ifiles(files);
+ while(ifiles.hasNext()) {
+ ifiles.next();
+
+ uimg.setSource(ifiles.value());
+ qDebug() << "\t image: " << uimg.mimetype() << ", " << ifiles.key();
+
QHttpPart imagePart;
imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(uimg.mimetype()));
- imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"media\"; filename=\""+uimg.filename()+"\""));
+ imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"" + ifiles.key() + "\"; filename=\""+uimg.filename()+"\""));
imagePart.setBody(uimg.bytes());
multiPart->append(imagePart);
}
- QNetworkRequest request;
- if(m_login!=""){
- QByteArray loginData = m_login.toLocal8Bit().toBase64();
- QString headerData = "Basic " + loginData;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- } else if (m_token!=""){
- QString headerData = "Bearer " + m_token;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- }
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit());
+
request.setUrl(m_url+m_api);
reply = manager.post(request, multiPart);
qDebug() << "\t request sent";
connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
- connect(reply, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
connect(reply, &QNetworkReply::readyRead, this, &XHR::onReadyRead);
connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
-}
-
-void XHR::postJSON()
-{
- if (params.contains("JSON")){
- QByteArray mJSON=params.value("JSON").toUtf8();
- QNetworkRequest request;
- if(m_login!=""){
- QByteArray loginData = m_login.toLocal8Bit().toBase64();
- QString headerData = "Basic " + loginData;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- } else if (m_token!=""){
- QString headerData = "Bearer " + m_token;
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- }
- request.setHeader(QNetworkRequest::ContentTypeHeader,"application/json; charset=UTF-8");
- request.setUrl(m_url+m_api);
- reply = manager.post(request, mJSON);
- qDebug() << "\t request sent";
- connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
- connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
- connect(reply, &QNetworkReply::readyRead, this, &XHR::onReadyRead);
- connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
- qDebug() << "\t reply signals connected";
- }
+ qDebug() << "\t reply signals connected";
}
void XHR::onReplyError(QNetworkReply::NetworkError code)
{
qDebug() << code;
- if(downloadtype()!="contactlist"){emit this->error( bufferToString(), m_url,m_api, (int) code);}
+ emit this->error( bufferToString(), m_url,m_api, (int) code);
buffer.clear();
reply->deleteLater();
- if((downloadtype()=="contactlist")||(downloadtype()=="picturelist")){dlindex=dlindex+1;XHR::getlist();}
}
void XHR::onReplySuccess()
{
qDebug() << "!";
- //QHashIterator i(params);
- // while(i.hasNext()) {
- // i.next();
- // //qDebug() << i.key()<< " " << i.value();
- // }
- //emit this->success(buffer, m_api);
- emit success(buffer, m_api);
- //emit this->error(m_downloadtype,m_url,m_api,1);
+ emit this->success( bufferToString(), m_api);
buffer.clear();
- // reply->deleteLater();
+// reply->deleteLater();
}
void XHR::onRequestFinished()
{
// Save the file here
- //qDebug() << "buffer " << buffer;
- if (buffer.isNull()){qDebug() << "File empty"<error(m_downloadtype,m_url,m_api,1);
- }
+ if (buffer.isNull()){qDebug() << "File empty"<error(m_downloadtype,m_url,m_api,1);}
else if (m_downloadtype=="picturelist") {
QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer);
QJsonObject jsonObject = jsonResponse.object();
- int arraystart=buffer.indexOf("{\"data\":\"")+8;
+ int arraystart=buffer.indexOf('{"data":"')+8;
int arraylength=buffer.indexOf('"',9)-arraystart;
QByteArray b64=buffer.mid(arraystart,arraylength);
QString helpfilename=jsonObject["filename"].toString();
QString helpfile=helpfilename.left(helpfilename.lastIndexOf("."));
QString filesuffix="";
- if (jsonObject["type"].toString()=="image/jpeg" || jsonObject["type"].toString()=="image/jpg"){filesuffix=".jpg";}
+ if (jsonObject["type"].toString()=="image/jpeg"){filesuffix=".jpg";}
else if (jsonObject["type"].toString()=="image/png"){filesuffix=".png";}
else {filesuffix="";}
if (helpfilename==""){// check if file has any filename
@@ -402,6 +321,7 @@ void XHR::onRequestFinished()
jsonObject["data"]="";
jsonObject["filename"]=helpfile+filesuffix;
emit this->downloadedjson(m_downloadtype,m_url,m_filename,dlindex,jsonObject);
+ if(downloadtype()=="picturelist"){dlindex=dlindex+1;XHR::getlist();}
}
else {
QFile file(m_filename);
@@ -410,10 +330,9 @@ void XHR::onRequestFinished()
buffer.clear();
file.close();
emit this->downloaded(m_downloadtype,m_url,m_filename,dlindex);
- //reply->deleteLater();
- }
- if(downloadtype()=="contactlist" || downloadtype()=="friendrequests" || downloadtype()=="picturelist"){
- dlindex=dlindex+1;XHR::getlist();
+ if(downloadtype()=="contactlist"){dlindex=dlindex+1;XHR::getlist();}
+
+ //reply->deleteLater();
}
}
@@ -426,7 +345,7 @@ void XHR::onReadyRead()
//void XHR::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes)
//{
// qDebug() << "Bytes: " << bytesRead<<" / "< &errors)
@@ -440,6 +359,5 @@ void XHR::onSSLError(const QList &errors)
QString XHR::bufferToString()
{
- //return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
- return QString(buffer);
+ return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
}
diff --git a/src/common/xhr.h b/source-android/common/xhr.h
similarity index 84%
rename from src/common/xhr.h
rename to source-android/common/xhr.h
index fd2d024..f111d59 100644
--- a/src/common/xhr.h
+++ b/source-android/common/xhr.h
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -37,21 +37,17 @@
#include
#include
#include
-//#include
class XHR : public QObject
{
Q_OBJECT
Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
Q_PROPERTY(QString login READ login WRITE setLogin NOTIFY loginChanged)
- Q_PROPERTY(QString token READ token WRITE setToken NOTIFY tokenChanged)
- Q_PROPERTY(QVariantMap account READ account WRITE setAccount NOTIFY accountChanged)
Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
Q_PROPERTY(QString imagedir READ imagedir WRITE setImagedir NOTIFY imagedirChanged)
Q_PROPERTY(QList contactlist READ contactlist WRITE setContactlist NOTIFY contactlistChanged)
Q_PROPERTY(QList filelist READ filelist WRITE setFilelist NOTIFY filelistChanged)
Q_PROPERTY(QString downloadtype READ downloadtype WRITE setDownloadtype NOTIFY downloadtypeChanged)
- //Q_PROPERTY(QString networktype READ networktype() NOTIFY networktypeChanged)
public:
@@ -62,38 +58,30 @@ public:
QString url() const;
QString api() const;
QString login() const;
- QString token() const;
- QVariantMap account() const;
QString filename() const;
QList contactlist() const;
QList filelist() const;
QString imagedir() const;
QString downloadtype() const;
-// QString networktype();
signals:
void urlChanged();
void apiChanged();
void loginChanged();
- void tokenChanged();
- void accountChanged();
void filenameChanged();
void contactlistChanged();
void filelistChanged();
void imagedirChanged();
void downloadtypeChanged();
- void networktypeChanged();
void downloaded(QString type, QString url, QString filename, int i);
void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject);
- void success(QByteArray data, QString api);
+ void success(QString data, QString api);
void error(QString data, QString url,QString api, int code);
public slots:
void setUrl(QString url);
void setApi(QString api);
void setLogin(QString login);
- void setToken(QString token);
- void setAccount(QVariantMap account);
void setDownloadtype(QString downloadtype);
void setFilename(QString filename);
void setContactlist(QList filename);
@@ -103,13 +91,10 @@ public slots:
void setImageFileParam(QString name, QString url);
void clearParams();
void post();
- void postJSON();
void get();
void getlist();
void download();
-// void networktype();
-
private slots:
void onReplyError(QNetworkReply::NetworkError code);
void onReplySuccess();
@@ -123,11 +108,8 @@ private:
QString m_url;
QString m_api;
QString m_login;
- QString m_token;
- QVariantMap m_account;
QString m_filename;
QString m_downloadtype;
-// QString m_networktype;
QHash params;
QHash files;
QList m_filelist;
@@ -136,9 +118,9 @@ private:
int dlindex;
QNetworkAccessManager manager;
- //QNetworkRequest request;
+ QNetworkRequest request;
QNetworkReply *reply;
- //QNetworkConfiguration nc;
+
QString bufferToString();
};
diff --git a/source-android/friendiqa.pro b/source-android/friendiqa.pro
index 20ff216..edafe5c 100644
--- a/source-android/friendiqa.pro
+++ b/source-android/friendiqa.pro
@@ -13,32 +13,19 @@
TEMPLATE = app
TARGET = friendiqa
CONFIG += release
-QT += core core-private qml quick gui widgets sql androidextras network networkauth
+QT += qml quick gui widgets androidextras
include(androidnative.pri/androidnative.pri)
SOURCES += common/friendiqa.cpp \
- common/uploadableimage.cpp \
+ common/uploadableimage.cpp \
common/xhr.cpp \
- common/filesystemandroid.cpp \
- common/remoteauthasyncimageprovider.cpp \
- common/updatenews.cpp \
- common/alarmandroid.cpp \
- common/oauth.cpp
- lupdate_only{
- SOURCES = qml/friendiqa.qml \
- qml/*.qml
- qml/calendarqml/*.qml
- qml/configqml/*.qml
- qml/genericqml/*.qml
- qml/contactqml/*.qml
- qml/newsqml/*.qml
- qml/photoqml/*.qml
- js/*.js
- }
+ common/filesystem.cpp \
+ common/remoteauthasyncimageprovider.cpp
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
+
RESOURCES = application.qrc
OTHER_FILES += qml/friendiqa.qml \
@@ -51,22 +38,15 @@ OTHER_FILES += qml/friendiqa.qml \
js/*.js
TRANSLATIONS += translations/friendiqa-de.ts \
- translations/friendiqa-es.ts \
- translations/friendiqa-it.ts \
- translations/friendiqa-hu.ts \
- translations/friendiqa-nl.ts
+ translations/friendiqa-es.ts
HEADERS += \
common/uploadableimage.h \
common/xhr.h \
common/filesystem.h \
- common/remoteauthasyncimageprovider.h \
- common/updatenews.h \
- common/alarm.h \
- common/oauth.h
-
+ common/remoteauthasyncimageprovider.h
+
DISTFILES += \
- android/gradle.properties \
qml/calendarqml/*.qml \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
@@ -75,7 +55,6 @@ DISTFILES += \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat \
- qml/configqml/ConfigAppearancePage.qml \
translations/*.ts \
translations/*.qm \
qml/*.qml \
@@ -86,8 +65,10 @@ DISTFILES += \
js/*.js \
android/androidnative.gradle \
android/src/FriendiqaActivity.java \
- android/src/FriendiqaService.java
+ android/src/ExampleService.java
-#ANDROID_ABIS = arm64-v8a
-
-android: include(/home/pankraz/android-sdk/android_openssl/openssl.pri)
+contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
+ ANDROID_EXTRA_LIBS = \
+ $$PWD/android/libcrypto.so \
+ $$PWD/android/libssl.so
+}
diff --git a/source-android/images/addImage.png b/source-android/images/addImage.png
new file mode 100644
index 0000000..988f9f1
Binary files /dev/null and b/source-android/images/addImage.png differ
diff --git a/src/assets/defaultcontact.jpg b/source-android/images/defaultcontact.jpg
similarity index 100%
rename from src/assets/defaultcontact.jpg
rename to source-android/images/defaultcontact.jpg
diff --git a/src/assets/folder-blue.png b/source-android/images/folder-blue.png
similarity index 100%
rename from src/assets/folder-blue.png
rename to source-android/images/folder-blue.png
diff --git a/source-android/images/fontawesome-webfont.ttf b/source-android/images/fontawesome-webfont.ttf
new file mode 100644
index 0000000..35acda2
Binary files /dev/null and b/source-android/images/fontawesome-webfont.ttf differ
diff --git a/source-android/images/smileys/adult/bong.gif b/source-android/images/smileys/adult/bong.gif
new file mode 100644
index 0000000..4b67122
Binary files /dev/null and b/source-android/images/smileys/adult/bong.gif differ
diff --git a/source-android/images/smileys/adult/drunk.gif b/source-android/images/smileys/adult/drunk.gif
new file mode 100644
index 0000000..4a1c064
Binary files /dev/null and b/source-android/images/smileys/adult/drunk.gif differ
diff --git a/source-android/images/smileys/adult/finger.gif b/source-android/images/smileys/adult/finger.gif
new file mode 100644
index 0000000..d45dcb8
Binary files /dev/null and b/source-android/images/smileys/adult/finger.gif differ
diff --git a/source-android/images/smileys/adult/sperm.gif b/source-android/images/smileys/adult/sperm.gif
new file mode 100644
index 0000000..6ba9219
Binary files /dev/null and b/source-android/images/smileys/adult/sperm.gif differ
diff --git a/source-android/images/smileys/adult/tits.gif b/source-android/images/smileys/adult/tits.gif
new file mode 100644
index 0000000..4c1658c
Binary files /dev/null and b/source-android/images/smileys/adult/tits.gif differ
diff --git a/source-android/images/smileys/animals/bee.gif b/source-android/images/smileys/animals/bee.gif
new file mode 100644
index 0000000..206c2e3
Binary files /dev/null and b/source-android/images/smileys/animals/bee.gif differ
diff --git a/source-android/images/smileys/animals/bigspider.gif b/source-android/images/smileys/animals/bigspider.gif
new file mode 100644
index 0000000..bc43deb
Binary files /dev/null and b/source-android/images/smileys/animals/bigspider.gif differ
diff --git a/source-android/images/smileys/animals/bunny.gif b/source-android/images/smileys/animals/bunny.gif
new file mode 100644
index 0000000..402b2b3
Binary files /dev/null and b/source-android/images/smileys/animals/bunny.gif differ
diff --git a/source-android/images/smileys/animals/bunnyflowers.gif b/source-android/images/smileys/animals/bunnyflowers.gif
new file mode 100644
index 0000000..6d665e2
Binary files /dev/null and b/source-android/images/smileys/animals/bunnyflowers.gif differ
diff --git a/source-android/images/smileys/animals/cat.gif b/source-android/images/smileys/animals/cat.gif
new file mode 100644
index 0000000..a612c47
Binary files /dev/null and b/source-android/images/smileys/animals/cat.gif differ
diff --git a/source-android/images/smileys/animals/chick.gif b/source-android/images/smileys/animals/chick.gif
new file mode 100644
index 0000000..6bcddcd
Binary files /dev/null and b/source-android/images/smileys/animals/chick.gif differ
diff --git a/source-android/images/smileys/animals/cow.gif b/source-android/images/smileys/animals/cow.gif
new file mode 100644
index 0000000..3f94cfa
Binary files /dev/null and b/source-android/images/smileys/animals/cow.gif differ
diff --git a/source-android/images/smileys/animals/crab.gif b/source-android/images/smileys/animals/crab.gif
new file mode 100644
index 0000000..db5b8ce
Binary files /dev/null and b/source-android/images/smileys/animals/crab.gif differ
diff --git a/source-android/images/smileys/animals/dog.gif b/source-android/images/smileys/animals/dog.gif
new file mode 100644
index 0000000..7b28477
Binary files /dev/null and b/source-android/images/smileys/animals/dog.gif differ
diff --git a/source-android/images/smileys/animals/dolphin.gif b/source-android/images/smileys/animals/dolphin.gif
new file mode 100644
index 0000000..672ebd7
Binary files /dev/null and b/source-android/images/smileys/animals/dolphin.gif differ
diff --git a/source-android/images/smileys/animals/dragonfly.gif b/source-android/images/smileys/animals/dragonfly.gif
new file mode 100644
index 0000000..566e95c
Binary files /dev/null and b/source-android/images/smileys/animals/dragonfly.gif differ
diff --git a/source-android/images/smileys/animals/elephant.gif b/source-android/images/smileys/animals/elephant.gif
new file mode 100644
index 0000000..4311e97
Binary files /dev/null and b/source-android/images/smileys/animals/elephant.gif differ
diff --git a/source-android/images/smileys/animals/fish.gif b/source-android/images/smileys/animals/fish.gif
new file mode 100644
index 0000000..3a7a584
Binary files /dev/null and b/source-android/images/smileys/animals/fish.gif differ
diff --git a/source-android/images/smileys/animals/frog.gif b/source-android/images/smileys/animals/frog.gif
new file mode 100644
index 0000000..85e4b56
Binary files /dev/null and b/source-android/images/smileys/animals/frog.gif differ
diff --git a/source-android/images/smileys/animals/giraffe.gif b/source-android/images/smileys/animals/giraffe.gif
new file mode 100644
index 0000000..4c95ea4
Binary files /dev/null and b/source-android/images/smileys/animals/giraffe.gif differ
diff --git a/source-android/images/smileys/animals/hamster.gif b/source-android/images/smileys/animals/hamster.gif
new file mode 100644
index 0000000..96c7323
Binary files /dev/null and b/source-android/images/smileys/animals/hamster.gif differ
diff --git a/source-android/images/smileys/animals/horse.gif b/source-android/images/smileys/animals/horse.gif
new file mode 100644
index 0000000..9103abf
Binary files /dev/null and b/source-android/images/smileys/animals/horse.gif differ
diff --git a/source-android/images/smileys/animals/ladybird.gif b/source-android/images/smileys/animals/ladybird.gif
new file mode 100644
index 0000000..69444a9
Binary files /dev/null and b/source-android/images/smileys/animals/ladybird.gif differ
diff --git a/source-android/images/smileys/animals/monkey.gif b/source-android/images/smileys/animals/monkey.gif
new file mode 100644
index 0000000..b9b338d
Binary files /dev/null and b/source-android/images/smileys/animals/monkey.gif differ
diff --git a/source-android/images/smileys/animals/parrot.gif b/source-android/images/smileys/animals/parrot.gif
new file mode 100644
index 0000000..ae6faf6
Binary files /dev/null and b/source-android/images/smileys/animals/parrot.gif differ
diff --git a/source-android/images/smileys/animals/pig.gif b/source-android/images/smileys/animals/pig.gif
new file mode 100644
index 0000000..bdc68e8
Binary files /dev/null and b/source-android/images/smileys/animals/pig.gif differ
diff --git a/source-android/images/smileys/animals/sheep.gif b/source-android/images/smileys/animals/sheep.gif
new file mode 100644
index 0000000..8fafc11
Binary files /dev/null and b/source-android/images/smileys/animals/sheep.gif differ
diff --git a/source-android/images/smileys/animals/snail.gif b/source-android/images/smileys/animals/snail.gif
new file mode 100644
index 0000000..3bdb44c
Binary files /dev/null and b/source-android/images/smileys/animals/snail.gif differ
diff --git a/source-android/images/smileys/animals/tux.gif b/source-android/images/smileys/animals/tux.gif
new file mode 100644
index 0000000..08e006e
Binary files /dev/null and b/source-android/images/smileys/animals/tux.gif differ
diff --git a/source-android/images/smileys/babies/baby.gif b/source-android/images/smileys/babies/baby.gif
new file mode 100644
index 0000000..d105afb
Binary files /dev/null and b/source-android/images/smileys/babies/baby.gif differ
diff --git a/source-android/images/smileys/babies/babycot.gif b/source-android/images/smileys/babies/babycot.gif
new file mode 100644
index 0000000..750f6df
Binary files /dev/null and b/source-android/images/smileys/babies/babycot.gif differ
diff --git a/source-android/images/smileys/babies/pregnant.gif b/source-android/images/smileys/babies/pregnant.gif
new file mode 100644
index 0000000..d97f476
Binary files /dev/null and b/source-android/images/smileys/babies/pregnant.gif differ
diff --git a/source-android/images/smileys/babies/stork.gif b/source-android/images/smileys/babies/stork.gif
new file mode 100644
index 0000000..de2371d
Binary files /dev/null and b/source-android/images/smileys/babies/stork.gif differ
diff --git a/source-android/images/smileys/confused/confused.gif b/source-android/images/smileys/confused/confused.gif
new file mode 100644
index 0000000..8f1b79a
Binary files /dev/null and b/source-android/images/smileys/confused/confused.gif differ
diff --git a/source-android/images/smileys/confused/dazed.gif b/source-android/images/smileys/confused/dazed.gif
new file mode 100644
index 0000000..f5e7ec2
Binary files /dev/null and b/source-android/images/smileys/confused/dazed.gif differ
diff --git a/source-android/images/smileys/confused/shrug.gif b/source-android/images/smileys/confused/shrug.gif
new file mode 100644
index 0000000..31ce007
Binary files /dev/null and b/source-android/images/smileys/confused/shrug.gif differ
diff --git a/source-android/images/smileys/confused/stupid.gif b/source-android/images/smileys/confused/stupid.gif
new file mode 100644
index 0000000..c17170a
Binary files /dev/null and b/source-android/images/smileys/confused/stupid.gif differ
diff --git a/source-android/images/smileys/cool/affro.gif b/source-android/images/smileys/cool/affro.gif
new file mode 100644
index 0000000..f06166b
Binary files /dev/null and b/source-android/images/smileys/cool/affro.gif differ
diff --git a/source-android/images/smileys/cool/cool.gif b/source-android/images/smileys/cool/cool.gif
new file mode 100644
index 0000000..05ba9f1
Binary files /dev/null and b/source-android/images/smileys/cool/cool.gif differ
diff --git a/source-android/images/smileys/core/beer_mug.gif b/source-android/images/smileys/core/beer_mug.gif
new file mode 100644
index 0000000..9a3e051
Binary files /dev/null and b/source-android/images/smileys/core/beer_mug.gif differ
diff --git a/source-android/images/smileys/core/coffee.gif b/source-android/images/smileys/core/coffee.gif
new file mode 100644
index 0000000..7e20371
Binary files /dev/null and b/source-android/images/smileys/core/coffee.gif differ
diff --git a/source-android/images/smileys/core/dislike.gif b/source-android/images/smileys/core/dislike.gif
new file mode 100644
index 0000000..7777942
Binary files /dev/null and b/source-android/images/smileys/core/dislike.gif differ
diff --git a/source-android/images/smileys/core/friendica-16.png b/source-android/images/smileys/core/friendica-16.png
new file mode 100644
index 0000000..745b7ac
Binary files /dev/null and b/source-android/images/smileys/core/friendica-16.png differ
diff --git a/source-android/images/smileys/core/like.gif b/source-android/images/smileys/core/like.gif
new file mode 100644
index 0000000..f71d032
Binary files /dev/null and b/source-android/images/smileys/core/like.gif differ
diff --git a/source-android/images/smileys/core/rm-16.png b/source-android/images/smileys/core/rm-16.png
new file mode 100644
index 0000000..9361ef2
Binary files /dev/null and b/source-android/images/smileys/core/rm-16.png differ
diff --git a/source-android/images/smileys/core/smiley-Oo.gif b/source-android/images/smileys/core/smiley-Oo.gif
new file mode 100644
index 0000000..a15d974
Binary files /dev/null and b/source-android/images/smileys/core/smiley-Oo.gif differ
diff --git a/source-android/images/smileys/core/smiley-bangheaddesk.gif b/source-android/images/smileys/core/smiley-bangheaddesk.gif
new file mode 100644
index 0000000..91ccb8b
Binary files /dev/null and b/source-android/images/smileys/core/smiley-bangheaddesk.gif differ
diff --git a/source-android/images/smileys/core/smiley-brokenheart.gif b/source-android/images/smileys/core/smiley-brokenheart.gif
new file mode 100644
index 0000000..971b57f
Binary files /dev/null and b/source-android/images/smileys/core/smiley-brokenheart.gif differ
diff --git a/source-android/images/smileys/core/smiley-cool.gif b/source-android/images/smileys/core/smiley-cool.gif
new file mode 100644
index 0000000..cee1c1a
Binary files /dev/null and b/source-android/images/smileys/core/smiley-cool.gif differ
diff --git a/source-android/images/smileys/core/smiley-cry.gif b/source-android/images/smileys/core/smiley-cry.gif
new file mode 100644
index 0000000..06e6ca2
Binary files /dev/null and b/source-android/images/smileys/core/smiley-cry.gif differ
diff --git a/source-android/images/smileys/core/smiley-embarassed.gif b/source-android/images/smileys/core/smiley-embarassed.gif
new file mode 100644
index 0000000..adc12e7
Binary files /dev/null and b/source-android/images/smileys/core/smiley-embarassed.gif differ
diff --git a/source-android/images/smileys/core/smiley-facepalm.gif b/source-android/images/smileys/core/smiley-facepalm.gif
new file mode 100644
index 0000000..7243703
Binary files /dev/null and b/source-android/images/smileys/core/smiley-facepalm.gif differ
diff --git a/source-android/images/smileys/core/smiley-foot-in-mouth.gif b/source-android/images/smileys/core/smiley-foot-in-mouth.gif
new file mode 100644
index 0000000..b444e57
Binary files /dev/null and b/source-android/images/smileys/core/smiley-foot-in-mouth.gif differ
diff --git a/source-android/images/smileys/core/smiley-frown.gif b/source-android/images/smileys/core/smiley-frown.gif
new file mode 100644
index 0000000..9ff1985
Binary files /dev/null and b/source-android/images/smileys/core/smiley-frown.gif differ
diff --git a/source-android/images/smileys/core/smiley-heart.gif b/source-android/images/smileys/core/smiley-heart.gif
new file mode 100644
index 0000000..6a11e70
Binary files /dev/null and b/source-android/images/smileys/core/smiley-heart.gif differ
diff --git a/source-android/images/smileys/core/smiley-kiss.gif b/source-android/images/smileys/core/smiley-kiss.gif
new file mode 100644
index 0000000..cc35661
Binary files /dev/null and b/source-android/images/smileys/core/smiley-kiss.gif differ
diff --git a/source-android/images/smileys/core/smiley-laughing.gif b/source-android/images/smileys/core/smiley-laughing.gif
new file mode 100644
index 0000000..1bf29de
Binary files /dev/null and b/source-android/images/smileys/core/smiley-laughing.gif differ
diff --git a/source-android/images/smileys/core/smiley-smile.gif b/source-android/images/smileys/core/smiley-smile.gif
new file mode 100644
index 0000000..b9bff40
Binary files /dev/null and b/source-android/images/smileys/core/smiley-smile.gif differ
diff --git a/source-android/images/smileys/core/smiley-surprised.gif b/source-android/images/smileys/core/smiley-surprised.gif
new file mode 100644
index 0000000..b074653
Binary files /dev/null and b/source-android/images/smileys/core/smiley-surprised.gif differ
diff --git a/source-android/images/smileys/core/smiley-thumbsup.gif b/source-android/images/smileys/core/smiley-thumbsup.gif
new file mode 100644
index 0000000..1bc6b12
Binary files /dev/null and b/source-android/images/smileys/core/smiley-thumbsup.gif differ
diff --git a/source-android/images/smileys/core/smiley-tongue-out.gif b/source-android/images/smileys/core/smiley-tongue-out.gif
new file mode 100644
index 0000000..48867dc
Binary files /dev/null and b/source-android/images/smileys/core/smiley-tongue-out.gif differ
diff --git a/source-android/images/smileys/core/smiley-undecided.gif b/source-android/images/smileys/core/smiley-undecided.gif
new file mode 100644
index 0000000..2802979
Binary files /dev/null and b/source-android/images/smileys/core/smiley-undecided.gif differ
diff --git a/source-android/images/smileys/core/smiley-wink.gif b/source-android/images/smileys/core/smiley-wink.gif
new file mode 100644
index 0000000..e1cefb0
Binary files /dev/null and b/source-android/images/smileys/core/smiley-wink.gif differ
diff --git a/source-android/images/smileys/devilangel/angel.gif b/source-android/images/smileys/devilangel/angel.gif
new file mode 100644
index 0000000..8e58541
Binary files /dev/null and b/source-android/images/smileys/devilangel/angel.gif differ
diff --git a/source-android/images/smileys/devilangel/blondedevil.gif b/source-android/images/smileys/devilangel/blondedevil.gif
new file mode 100644
index 0000000..09e7e68
Binary files /dev/null and b/source-android/images/smileys/devilangel/blondedevil.gif differ
diff --git a/source-android/images/smileys/devilangel/catdevil.gif b/source-android/images/smileys/devilangel/catdevil.gif
new file mode 100644
index 0000000..269d719
Binary files /dev/null and b/source-android/images/smileys/devilangel/catdevil.gif differ
diff --git a/source-android/images/smileys/devilangel/cherub.gif b/source-android/images/smileys/devilangel/cherub.gif
new file mode 100644
index 0000000..40872e0
Binary files /dev/null and b/source-android/images/smileys/devilangel/cherub.gif differ
diff --git a/source-android/images/smileys/devilangel/daseesaw.gif b/source-android/images/smileys/devilangel/daseesaw.gif
new file mode 100644
index 0000000..1c04b2e
Binary files /dev/null and b/source-android/images/smileys/devilangel/daseesaw.gif differ
diff --git a/source-android/images/smileys/devilangel/devil.gif b/source-android/images/smileys/devilangel/devil.gif
new file mode 100644
index 0000000..2b56797
Binary files /dev/null and b/source-android/images/smileys/devilangel/devil.gif differ
diff --git a/source-android/images/smileys/devilangel/graveside.gif b/source-android/images/smileys/devilangel/graveside.gif
new file mode 100644
index 0000000..0e90935
Binary files /dev/null and b/source-android/images/smileys/devilangel/graveside.gif differ
diff --git a/source-android/images/smileys/devilangel/saint.gif b/source-android/images/smileys/devilangel/saint.gif
new file mode 100644
index 0000000..52c22c4
Binary files /dev/null and b/source-android/images/smileys/devilangel/saint.gif differ
diff --git a/source-android/images/smileys/devilangel/turnevil.gif b/source-android/images/smileys/devilangel/turnevil.gif
new file mode 100644
index 0000000..1490c0f
Binary files /dev/null and b/source-android/images/smileys/devilangel/turnevil.gif differ
diff --git a/source-android/images/smileys/disgust/fartblush.gif b/source-android/images/smileys/disgust/fartblush.gif
new file mode 100644
index 0000000..4160a1f
Binary files /dev/null and b/source-android/images/smileys/disgust/fartblush.gif differ
diff --git a/source-android/images/smileys/disgust/fartinbed.gif b/source-android/images/smileys/disgust/fartinbed.gif
new file mode 100644
index 0000000..5553649
Binary files /dev/null and b/source-android/images/smileys/disgust/fartinbed.gif differ
diff --git a/source-android/images/smileys/disgust/toilet.gif b/source-android/images/smileys/disgust/toilet.gif
new file mode 100644
index 0000000..092d7ca
Binary files /dev/null and b/source-android/images/smileys/disgust/toilet.gif differ
diff --git a/source-android/images/smileys/disgust/vomit.gif b/source-android/images/smileys/disgust/vomit.gif
new file mode 100644
index 0000000..6e7e727
Binary files /dev/null and b/source-android/images/smileys/disgust/vomit.gif differ
diff --git a/source-android/images/smileys/drink/tea.gif b/source-android/images/smileys/drink/tea.gif
new file mode 100644
index 0000000..474b989
Binary files /dev/null and b/source-android/images/smileys/drink/tea.gif differ
diff --git a/source-android/images/smileys/drool/drool.gif b/source-android/images/smileys/drool/drool.gif
new file mode 100644
index 0000000..4093df6
Binary files /dev/null and b/source-android/images/smileys/drool/drool.gif differ
diff --git a/source-android/images/smileys/fantasy/alienmonster.gif b/source-android/images/smileys/fantasy/alienmonster.gif
new file mode 100644
index 0000000..e0ca7f6
Binary files /dev/null and b/source-android/images/smileys/fantasy/alienmonster.gif differ
diff --git a/source-android/images/smileys/fantasy/barbarian.gif b/source-android/images/smileys/fantasy/barbarian.gif
new file mode 100644
index 0000000..de8a068
Binary files /dev/null and b/source-android/images/smileys/fantasy/barbarian.gif differ
diff --git a/source-android/images/smileys/fantasy/dinosaur.gif b/source-android/images/smileys/fantasy/dinosaur.gif
new file mode 100644
index 0000000..e8c625c
Binary files /dev/null and b/source-android/images/smileys/fantasy/dinosaur.gif differ
diff --git a/source-android/images/smileys/fantasy/dragon.gif b/source-android/images/smileys/fantasy/dragon.gif
new file mode 100644
index 0000000..fd28fbf
Binary files /dev/null and b/source-android/images/smileys/fantasy/dragon.gif differ
diff --git a/source-android/images/smileys/fantasy/dragonwhelp.gif b/source-android/images/smileys/fantasy/dragonwhelp.gif
new file mode 100644
index 0000000..dbc4555
Binary files /dev/null and b/source-android/images/smileys/fantasy/dragonwhelp.gif differ
diff --git a/source-android/images/smileys/fantasy/ghost.gif b/source-android/images/smileys/fantasy/ghost.gif
new file mode 100644
index 0000000..4c5d85d
Binary files /dev/null and b/source-android/images/smileys/fantasy/ghost.gif differ
diff --git a/source-android/images/smileys/fantasy/mummy.gif b/source-android/images/smileys/fantasy/mummy.gif
new file mode 100644
index 0000000..50e1dfb
Binary files /dev/null and b/source-android/images/smileys/fantasy/mummy.gif differ
diff --git a/source-android/images/smileys/fight/2guns.gif b/source-android/images/smileys/fight/2guns.gif
new file mode 100644
index 0000000..9e1b663
Binary files /dev/null and b/source-android/images/smileys/fight/2guns.gif differ
diff --git a/source-android/images/smileys/fight/acid.gif b/source-android/images/smileys/fight/acid.gif
new file mode 100644
index 0000000..fa55f67
Binary files /dev/null and b/source-android/images/smileys/fight/acid.gif differ
diff --git a/source-android/images/smileys/fight/alienfight.gif b/source-android/images/smileys/fight/alienfight.gif
new file mode 100644
index 0000000..9d5e879
Binary files /dev/null and b/source-android/images/smileys/fight/alienfight.gif differ
diff --git a/source-android/images/smileys/fight/alpha.png b/source-android/images/smileys/fight/alpha.png
new file mode 100644
index 0000000..09e3f23
Binary files /dev/null and b/source-android/images/smileys/fight/alpha.png differ
diff --git a/source-android/images/smileys/fight/army.gif b/source-android/images/smileys/fight/army.gif
new file mode 100644
index 0000000..7506700
Binary files /dev/null and b/source-android/images/smileys/fight/army.gif differ
diff --git a/source-android/images/smileys/fight/arrowhead.gif b/source-android/images/smileys/fight/arrowhead.gif
new file mode 100644
index 0000000..f4572c4
Binary files /dev/null and b/source-android/images/smileys/fight/arrowhead.gif differ
diff --git a/source-android/images/smileys/fight/bfg.gif b/source-android/images/smileys/fight/bfg.gif
new file mode 100644
index 0000000..c2ba9d0
Binary files /dev/null and b/source-android/images/smileys/fight/bfg.gif differ
diff --git a/source-android/images/smileys/fight/bowman.gif b/source-android/images/smileys/fight/bowman.gif
new file mode 100644
index 0000000..2f1f8f0
Binary files /dev/null and b/source-android/images/smileys/fight/bowman.gif differ
diff --git a/source-android/images/smileys/fight/chainsaw.gif b/source-android/images/smileys/fight/chainsaw.gif
new file mode 100644
index 0000000..71f757c
Binary files /dev/null and b/source-android/images/smileys/fight/chainsaw.gif differ
diff --git a/source-android/images/smileys/fight/crossbow.gif b/source-android/images/smileys/fight/crossbow.gif
new file mode 100644
index 0000000..20874f3
Binary files /dev/null and b/source-android/images/smileys/fight/crossbow.gif differ
diff --git a/source-android/images/smileys/fight/crusader.gif b/source-android/images/smileys/fight/crusader.gif
new file mode 100644
index 0000000..95848ae
Binary files /dev/null and b/source-android/images/smileys/fight/crusader.gif differ
diff --git a/source-android/images/smileys/fight/dead.gif b/source-android/images/smileys/fight/dead.gif
new file mode 100644
index 0000000..31adaba
Binary files /dev/null and b/source-android/images/smileys/fight/dead.gif differ
diff --git a/source-android/images/smileys/fight/gangs.gif b/source-android/images/smileys/fight/gangs.gif
new file mode 100644
index 0000000..2c655b1
Binary files /dev/null and b/source-android/images/smileys/fight/gangs.gif differ
diff --git a/source-android/images/smileys/fight/hammersplat.gif b/source-android/images/smileys/fight/hammersplat.gif
new file mode 100644
index 0000000..95bd540
Binary files /dev/null and b/source-android/images/smileys/fight/hammersplat.gif differ
diff --git a/source-android/images/smileys/fight/lasergun.gif b/source-android/images/smileys/fight/lasergun.gif
new file mode 100644
index 0000000..f3f82cb
Binary files /dev/null and b/source-android/images/smileys/fight/lasergun.gif differ
diff --git a/source-android/images/smileys/fight/machinegun.gif b/source-android/images/smileys/fight/machinegun.gif
new file mode 100644
index 0000000..1cff5cc
Binary files /dev/null and b/source-android/images/smileys/fight/machinegun.gif differ
diff --git a/source-android/images/smileys/fight/marine.gif b/source-android/images/smileys/fight/marine.gif
new file mode 100644
index 0000000..88fd2e0
Binary files /dev/null and b/source-android/images/smileys/fight/marine.gif differ
diff --git a/source-android/images/smileys/fight/sabre.gif b/source-android/images/smileys/fight/sabre.gif
new file mode 100644
index 0000000..e623968
Binary files /dev/null and b/source-android/images/smileys/fight/sabre.gif differ
diff --git a/source-android/images/smileys/fight/samurai.gif b/source-android/images/smileys/fight/samurai.gif
new file mode 100644
index 0000000..8b24385
Binary files /dev/null and b/source-android/images/smileys/fight/samurai.gif differ
diff --git a/source-android/images/smileys/fight/tank.gif b/source-android/images/smileys/fight/tank.gif
new file mode 100644
index 0000000..f1d969d
Binary files /dev/null and b/source-android/images/smileys/fight/tank.gif differ
diff --git a/source-android/images/smileys/fight/viking.gif b/source-android/images/smileys/fight/viking.gif
new file mode 100644
index 0000000..4908edd
Binary files /dev/null and b/source-android/images/smileys/fight/viking.gif differ
diff --git a/source-android/images/smileys/food/apple.gif b/source-android/images/smileys/food/apple.gif
new file mode 100644
index 0000000..969d4ca
Binary files /dev/null and b/source-android/images/smileys/food/apple.gif differ
diff --git a/source-android/images/smileys/food/banana.gif b/source-android/images/smileys/food/banana.gif
new file mode 100644
index 0000000..d990d19
Binary files /dev/null and b/source-android/images/smileys/food/banana.gif differ
diff --git a/source-android/images/smileys/food/birthdaycake.gif b/source-android/images/smileys/food/birthdaycake.gif
new file mode 100644
index 0000000..30ebceb
Binary files /dev/null and b/source-android/images/smileys/food/birthdaycake.gif differ
diff --git a/source-android/images/smileys/food/broccoli.gif b/source-android/images/smileys/food/broccoli.gif
new file mode 100644
index 0000000..f379889
Binary files /dev/null and b/source-android/images/smileys/food/broccoli.gif differ
diff --git a/source-android/images/smileys/food/cake.gif b/source-android/images/smileys/food/cake.gif
new file mode 100644
index 0000000..22d0ebd
Binary files /dev/null and b/source-android/images/smileys/food/cake.gif differ
diff --git a/source-android/images/smileys/food/carrot.gif b/source-android/images/smileys/food/carrot.gif
new file mode 100644
index 0000000..387b94c
Binary files /dev/null and b/source-android/images/smileys/food/carrot.gif differ
diff --git a/source-android/images/smileys/food/cooking.gif b/source-android/images/smileys/food/cooking.gif
new file mode 100644
index 0000000..e62fea0
Binary files /dev/null and b/source-android/images/smileys/food/cooking.gif differ
diff --git a/source-android/images/smileys/food/fryegg.gif b/source-android/images/smileys/food/fryegg.gif
new file mode 100644
index 0000000..bd1b4ff
Binary files /dev/null and b/source-android/images/smileys/food/fryegg.gif differ
diff --git a/source-android/images/smileys/food/popcorn.gif b/source-android/images/smileys/food/popcorn.gif
new file mode 100644
index 0000000..b0ea697
Binary files /dev/null and b/source-android/images/smileys/food/popcorn.gif differ
diff --git a/source-android/images/smileys/food/tomato.gif b/source-android/images/smileys/food/tomato.gif
new file mode 100644
index 0000000..0e3dadd
Binary files /dev/null and b/source-android/images/smileys/food/tomato.gif differ
diff --git a/source-android/images/smileys/happy/cloud9.gif b/source-android/images/smileys/happy/cloud9.gif
new file mode 100644
index 0000000..801c1a3
Binary files /dev/null and b/source-android/images/smileys/happy/cloud9.gif differ
diff --git a/source-android/images/smileys/happy/tearsofjoy.gif b/source-android/images/smileys/happy/tearsofjoy.gif
new file mode 100644
index 0000000..5de3117
Binary files /dev/null and b/source-android/images/smileys/happy/tearsofjoy.gif differ
diff --git a/source-android/images/smileys/laugh/hahaha.gif b/source-android/images/smileys/laugh/hahaha.gif
new file mode 100644
index 0000000..37aa92a
Binary files /dev/null and b/source-android/images/smileys/laugh/hahaha.gif differ
diff --git a/source-android/images/smileys/laugh/loltv.gif b/source-android/images/smileys/laugh/loltv.gif
new file mode 100644
index 0000000..3de6f77
Binary files /dev/null and b/source-android/images/smileys/laugh/loltv.gif differ
diff --git a/source-android/images/smileys/laugh/rofl.gif b/source-android/images/smileys/laugh/rofl.gif
new file mode 100644
index 0000000..a3bb03d
Binary files /dev/null and b/source-android/images/smileys/laugh/rofl.gif differ
diff --git a/source-android/images/smileys/love/iloveyou.gif b/source-android/images/smileys/love/iloveyou.gif
new file mode 100644
index 0000000..7007515
Binary files /dev/null and b/source-android/images/smileys/love/iloveyou.gif differ
diff --git a/source-android/images/smileys/love/inlove.gif b/source-android/images/smileys/love/inlove.gif
new file mode 100644
index 0000000..30357af
Binary files /dev/null and b/source-android/images/smileys/love/inlove.gif differ
diff --git a/source-android/images/smileys/love/love.gif b/source-android/images/smileys/love/love.gif
new file mode 100644
index 0000000..d8f0d5b
Binary files /dev/null and b/source-android/images/smileys/love/love.gif differ
diff --git a/source-android/images/smileys/love/lovebear.gif b/source-android/images/smileys/love/lovebear.gif
new file mode 100644
index 0000000..d13fd18
Binary files /dev/null and b/source-android/images/smileys/love/lovebear.gif differ
diff --git a/source-android/images/smileys/love/lovebed.gif b/source-android/images/smileys/love/lovebed.gif
new file mode 100644
index 0000000..c5783e0
Binary files /dev/null and b/source-android/images/smileys/love/lovebed.gif differ
diff --git a/source-android/images/smileys/love/loveheart.gif b/source-android/images/smileys/love/loveheart.gif
new file mode 100644
index 0000000..541220a
Binary files /dev/null and b/source-android/images/smileys/love/loveheart.gif differ
diff --git a/source-android/images/smileys/music/dj.gif b/source-android/images/smileys/music/dj.gif
new file mode 100644
index 0000000..66bc075
Binary files /dev/null and b/source-android/images/smileys/music/dj.gif differ
diff --git a/source-android/images/smileys/music/drums.gif b/source-android/images/smileys/music/drums.gif
new file mode 100644
index 0000000..27215f4
Binary files /dev/null and b/source-android/images/smileys/music/drums.gif differ
diff --git a/source-android/images/smileys/music/elvis.gif b/source-android/images/smileys/music/elvis.gif
new file mode 100644
index 0000000..ebcdccc
Binary files /dev/null and b/source-android/images/smileys/music/elvis.gif differ
diff --git a/source-android/images/smileys/music/guitar.gif b/source-android/images/smileys/music/guitar.gif
new file mode 100644
index 0000000..11eccdd
Binary files /dev/null and b/source-android/images/smileys/music/guitar.gif differ
diff --git a/source-android/images/smileys/music/trumpet.gif b/source-android/images/smileys/music/trumpet.gif
new file mode 100644
index 0000000..4595ccc
Binary files /dev/null and b/source-android/images/smileys/music/trumpet.gif differ
diff --git a/source-android/images/smileys/music/violin.gif b/source-android/images/smileys/music/violin.gif
new file mode 100644
index 0000000..53592d6
Binary files /dev/null and b/source-android/images/smileys/music/violin.gif differ
diff --git a/source-android/images/smileys/oldcore/beard.png b/source-android/images/smileys/oldcore/beard.png
new file mode 100644
index 0000000..5d4b284
Binary files /dev/null and b/source-android/images/smileys/oldcore/beard.png differ
diff --git a/source-android/images/smileys/oldcore/headbang.gif b/source-android/images/smileys/oldcore/headbang.gif
new file mode 100644
index 0000000..91ccb8b
Binary files /dev/null and b/source-android/images/smileys/oldcore/headbang.gif differ
diff --git a/source-android/images/smileys/oldcore/laughing.gif b/source-android/images/smileys/oldcore/laughing.gif
new file mode 100644
index 0000000..1bf29de
Binary files /dev/null and b/source-android/images/smileys/oldcore/laughing.gif differ
diff --git a/source-android/images/smileys/oldcore/shaka.gif b/source-android/images/smileys/oldcore/shaka.gif
new file mode 100644
index 0000000..e5d7b70
Binary files /dev/null and b/source-android/images/smileys/oldcore/shaka.gif differ
diff --git a/source-android/images/smileys/oldcore/surprised.gif b/source-android/images/smileys/oldcore/surprised.gif
new file mode 100644
index 0000000..b074653
Binary files /dev/null and b/source-android/images/smileys/oldcore/surprised.gif differ
diff --git a/source-android/images/smileys/oldcore/whitebeard.png b/source-android/images/smileys/oldcore/whitebeard.png
new file mode 100644
index 0000000..2a1fccb
Binary files /dev/null and b/source-android/images/smileys/oldcore/whitebeard.png differ
diff --git a/source-android/images/smileys/respect/bow.gif b/source-android/images/smileys/respect/bow.gif
new file mode 100644
index 0000000..ecc6484
Binary files /dev/null and b/source-android/images/smileys/respect/bow.gif differ
diff --git a/source-android/images/smileys/respect/bravo.gif b/source-android/images/smileys/respect/bravo.gif
new file mode 100644
index 0000000..34f72ab
Binary files /dev/null and b/source-android/images/smileys/respect/bravo.gif differ
diff --git a/source-android/images/smileys/respect/hailking.gif b/source-android/images/smileys/respect/hailking.gif
new file mode 100644
index 0000000..07551e5
Binary files /dev/null and b/source-android/images/smileys/respect/hailking.gif differ
diff --git a/source-android/images/smileys/respect/number1.gif b/source-android/images/smileys/respect/number1.gif
new file mode 100644
index 0000000..ab5c410
Binary files /dev/null and b/source-android/images/smileys/respect/number1.gif differ
diff --git a/source-android/images/smileys/sad/crying.png b/source-android/images/smileys/sad/crying.png
new file mode 100644
index 0000000..62b9646
Binary files /dev/null and b/source-android/images/smileys/sad/crying.png differ
diff --git a/source-android/images/smileys/sad/prisoner.gif b/source-android/images/smileys/sad/prisoner.gif
new file mode 100644
index 0000000..f2c3181
Binary files /dev/null and b/source-android/images/smileys/sad/prisoner.gif differ
diff --git a/source-android/images/smileys/sad/sigh.gif b/source-android/images/smileys/sad/sigh.gif
new file mode 100644
index 0000000..6860226
Binary files /dev/null and b/source-android/images/smileys/sad/sigh.gif differ
diff --git a/source-android/images/smileys/smoking/smoking.gif b/source-android/images/smileys/smoking/smoking.gif
new file mode 100644
index 0000000..77720b1
Binary files /dev/null and b/source-android/images/smileys/smoking/smoking.gif differ
diff --git a/source-android/images/smileys/sport/archery.gif b/source-android/images/smileys/sport/archery.gif
new file mode 100644
index 0000000..8b4b9f6
Binary files /dev/null and b/source-android/images/smileys/sport/archery.gif differ
diff --git a/source-android/images/smileys/sport/basketball.gif b/source-android/images/smileys/sport/basketball.gif
new file mode 100644
index 0000000..e9ad4b5
Binary files /dev/null and b/source-android/images/smileys/sport/basketball.gif differ
diff --git a/source-android/images/smileys/sport/bowling.gif b/source-android/images/smileys/sport/bowling.gif
new file mode 100644
index 0000000..0f8300c
Binary files /dev/null and b/source-android/images/smileys/sport/bowling.gif differ
diff --git a/source-android/images/smileys/sport/cycling.gif b/source-android/images/smileys/sport/cycling.gif
new file mode 100644
index 0000000..332081e
Binary files /dev/null and b/source-android/images/smileys/sport/cycling.gif differ
diff --git a/source-android/images/smileys/sport/darts.gif b/source-android/images/smileys/sport/darts.gif
new file mode 100644
index 0000000..09fb6ea
Binary files /dev/null and b/source-android/images/smileys/sport/darts.gif differ
diff --git a/source-android/images/smileys/sport/fencing.gif b/source-android/images/smileys/sport/fencing.gif
new file mode 100644
index 0000000..a4ec5cd
Binary files /dev/null and b/source-android/images/smileys/sport/fencing.gif differ
diff --git a/source-android/images/smileys/sport/football.gif b/source-android/images/smileys/sport/football.gif
new file mode 100644
index 0000000..c9fa6c5
Binary files /dev/null and b/source-android/images/smileys/sport/football.gif differ
diff --git a/source-android/images/smileys/sport/golf.gif b/source-android/images/smileys/sport/golf.gif
new file mode 100644
index 0000000..179fc52
Binary files /dev/null and b/source-android/images/smileys/sport/golf.gif differ
diff --git a/source-android/images/smileys/sport/horseriding.gif b/source-android/images/smileys/sport/horseriding.gif
new file mode 100644
index 0000000..13ca450
Binary files /dev/null and b/source-android/images/smileys/sport/horseriding.gif differ
diff --git a/source-android/images/smileys/sport/juggling.gif b/source-android/images/smileys/sport/juggling.gif
new file mode 100644
index 0000000..1a2eb60
Binary files /dev/null and b/source-android/images/smileys/sport/juggling.gif differ
diff --git a/source-android/images/smileys/sport/skipping.gif b/source-android/images/smileys/sport/skipping.gif
new file mode 100644
index 0000000..f63270b
Binary files /dev/null and b/source-android/images/smileys/sport/skipping.gif differ
diff --git a/source-android/images/smileys/sport/snooker.gif b/source-android/images/smileys/sport/snooker.gif
new file mode 100644
index 0000000..fa2e6a8
Binary files /dev/null and b/source-android/images/smileys/sport/snooker.gif differ
diff --git a/source-android/images/smileys/sport/surfing.gif b/source-android/images/smileys/sport/surfing.gif
new file mode 100644
index 0000000..b75d74b
Binary files /dev/null and b/source-android/images/smileys/sport/surfing.gif differ
diff --git a/source-android/images/smileys/sport/tennis.gif b/source-android/images/smileys/sport/tennis.gif
new file mode 100644
index 0000000..36e47bf
Binary files /dev/null and b/source-android/images/smileys/sport/tennis.gif differ
diff --git a/source-android/images/smileys/tired/countsheep.gif b/source-android/images/smileys/tired/countsheep.gif
new file mode 100644
index 0000000..815b090
Binary files /dev/null and b/source-android/images/smileys/tired/countsheep.gif differ
diff --git a/source-android/images/smileys/tired/hammock.gif b/source-android/images/smileys/tired/hammock.gif
new file mode 100644
index 0000000..8639dd3
Binary files /dev/null and b/source-android/images/smileys/tired/hammock.gif differ
diff --git a/source-android/images/smileys/tired/pillow.gif b/source-android/images/smileys/tired/pillow.gif
new file mode 100644
index 0000000..367f65e
Binary files /dev/null and b/source-android/images/smileys/tired/pillow.gif differ
diff --git a/source-android/images/smileys/tired/yawn.gif b/source-android/images/smileys/tired/yawn.gif
new file mode 100644
index 0000000..d451480
Binary files /dev/null and b/source-android/images/smileys/tired/yawn.gif differ
diff --git a/src/js/friendworker.js b/source-android/js/friendworker.js
similarity index 91%
rename from src/js/friendworker.js
rename to source-android/js/friendworker.js
index 146b1cf..ab6fdf4 100644
--- a/src/js/friendworker.js
+++ b/source-android/js/friendworker.js
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@ WorkerScript.onMessage = function(msg) {
if (msg.albums[j]) {
var albumobject=msg.albums[j];
var data=({"albumobject": albumobject,"foreignPicture": msg.foreignPicture})}
+// print("Albums:"+j+msg.albums.length+JSON.stringify(data));
msg.model.append(data);}
if (j==msg.albums.length){
msg.model.sync()
diff --git a/src/js/helper.js b/source-android/js/helper.js
similarity index 70%
rename from src/js/helper.js
rename to source-android/js/helper.js
index 7a70eef..956139b 100644
--- a/src/js/helper.js
+++ b/source-android/js/helper.js
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -39,8 +39,8 @@ function friendicaRequest(login,api,rootwindow,callback) {
try{
if (xhrequest.status==200){
callback(xhrequest.responseText)
- }else{print("xhrequest.status "+xhrequest.status)
- callback(xhrequest.responseText)
+ }else{
+ showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow);
}
}
catch (e){
@@ -48,39 +48,27 @@ function friendicaRequest(login,api,rootwindow,callback) {
}
}
}
- if (login.password==""){
- xhrequest.open("GET", login.server+api,true);
- xhrequest.setRequestHeader("Authorization","Bearer "+login.token);
- }
- else{
- xhrequest.open("GET", login.server+api,true,login.username,Qt.atob(login.password));
- }
+ xhrequest.open("GET", login.server+api,true,login.username,Qt.atob(login.password));
xhrequest.send();
}
function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
var xhrequest= new XMLHttpRequest();
xhrequest.onreadystatechange = function() {
+ //print(api+JSON.stringify(login)+Qt.atob(login.password));
if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
} else if(xhrequest.readyState === XMLHttpRequest.DONE) {
- try{ if (xhrequest.responseText!=""){//print (xhrequest.responseText)
+ try{ if (xhrequest.responseText!=""){
callback(xhrequest.responseText)
}else{
+ showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
callback(xhrequest.responseText)
}
}
- catch (e){
- print("API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText);
- }
+ catch (e){showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
}
}
- if (login.password==""){
- xhrequest.open(method, login.server+api,true);
- xhrequest.setRequestHeader("Authorization","Bearer "+login.token);
- }
- else{
- xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));
- }
+ xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));
xhrequest.send(data);
}
@@ -94,6 +82,18 @@ function getCount(database,login,table,field,countvalue){
return count
}
+function friendicaWebRequest(url,rootwindow,callback) {
+ var xhrequest = new XMLHttpRequest();
+ xhrequest.onreadystatechange = function() {
+ if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {}
+ else if(xhrequest.readyState === XMLHttpRequest.DONE) {
+ try{callback(xhrequest.responseText)}
+ catch (e){showMessage("Error","API:\n" +url+" "+e+"\n Return: "+xhrequest.responseText, rootwindow)}
+ }
+ }
+ xhrequest.open("GET", url,true);
+ xhrequest.send();
+}
function friendicaRemoteAuthRequest(login,url,c_url,rootwindow,callback) {
var xhrequest = new XMLHttpRequest();
@@ -111,11 +111,10 @@ function friendicaRemoteAuthRequest(login,url,c_url,rootwindow,callback) {
function readData(database,table,username,callback,filter,filtervalue, sort) { // reads and applies data from DB
if (filter){
- if (username){var where = " AND "+ filter +" = '" + filtervalue+"'";} else{
- var where = " WHERE "+ filter +" = '" + filtervalue+"'";}
+ var where = " AND "+ filter +" = '" + filtervalue+"'";
} else { var where="";}
if (username){
- var user = ' where username= "'+ username +'"';
+ var user = ' where username= "'+ username +'"';
} else { var user='';}
if (sort){
@@ -124,7 +123,8 @@ function readData(database,table,username,callback,filter,filtervalue, sort) { /
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
if(!db) { return; }
db.transaction( function(tx) {
- var rsArray=[];
+ //print('select * from '+table+user+where+sortparam);
+ var rsArray=[];
var rs = tx.executeSql('select * from '+table+user+where+sortparam);
for(var i = 0; i < rs.rows.length; i++) {
rsArray.push(rs.rows.item(i))
@@ -142,6 +142,7 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
db.transaction( function(tx) {
//print('... read from database ' + field)
var rsArray=[];
+ //print('select DISTINCT '+field+' from '+table+' WHERE username="'+username+'"'+where+' ORDER BY '+field+' ASC');
var rs = tx.executeSql('select DISTINCT '+field+' from '+table+' WHERE username="'+username+'"'+where+' ORDER BY '+field+' ASC');
for(var i = 0; i < rs.rows.length; i++) {
rsArray.push(rs.rows.item(i)[field])
@@ -150,37 +151,10 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
});
}
-
-function deleteData(database,table, username, callback,filter,filtervalue) { // reads and applies data from DB
-if (filter){
-var where = " AND "+ filter +" = '" + filtervalue+"'";
-} else { var where="";}
- var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
- if(!db) { return; }
- db.transaction( function(tx) {
- var rsArray=[];
- var rs = tx.executeSql('DELETE from '+table+' WHERE username="'+username+'"'+where);
- callback();
- });
-}
-
-function updateData(database,table, username, key, value, callback,filter,filtervalue) { // reads and applies data from DB
- if (filter){
- var where = " AND "+ filter +" = '" + filtervalue+"'";
- } else { var where="";}
- var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
- if(!db) { return; }
- db.transaction( function(tx) {
- var rsArray=[];
- var rs = tx.executeSql('UPDATE '+table+' SET '+key+' = '+value+' WHERE username="'+username+'"'+where);
- callback();
- });
-}
-
-function showMessage(header,message,rootwindow){//print(message);
+function showMessage(header,message,rootwindow){
var cleanmessage=message.replace(/"/g,"-");
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
- var messageString='import QtQuick 6.3; import QtQuick.Controls 6.3; Dialog{ visible: true; title:"'+header+'";standardButtons: Dialog.Ok;anchors.centerIn: parent;Label{text:" '+cleanmessage+'"}}';
+ var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';
var messageObject=Qt.createQmlObject(messageString,rootwindow,"messageOutput");
}
diff --git a/source-android/js/image.js b/source-android/js/image.js
new file mode 100644
index 0000000..5c48ac3
--- /dev/null
+++ b/source-android/js/image.js
@@ -0,0 +1,272 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+
+function requestList(login,database,onlynew,rootwindow,callback) {
+ //get list of own images and call download function
+ Helperjs.friendicaRequest(login,"/api/friendica/photos/list", rootwindow,function (helperobject){
+ //print("return"+helperobject);
+ var obj=JSON.parse(helperobject);
+ if (onlynew){Helperjs.readField("id",database,"imageData",login.username,function(AllStoredImages){
+ if (AllStoredImages.length>0){
+ for(var i=0;i< AllStoredImages.length;i++){
+ var position=Helperjs.inArray(obj,"id",AllStoredImages[i]);
+ if (position>-1){obj.splice(position,1)}
+ }
+ }
+ callback(obj)
+ })}
+ else{callback(obj)}
+})}
+
+function dataRequest(login,photoID,database,xhr,rootwindow) {
+ // check if image exist and call download function
+ Helperjs.friendicaRequest(login,"/api/friendica/photo?photo_id="+photoID, rootwindow, function (image){
+ try{ if(image==""){currentimageno=currentimageno+1}else{
+ var obj = JSON.parse(image);
+ var helpfilename=obj.filename.substring(0,obj.filename.lastIndexOf("."));
+ var filesuffix="";
+ if (obj.type=="image/jpeg"){filesuffix=".jpg"}
+ else if (obj.type=="image/png"){filesuffix=".png"}
+ else {filesuffix=""}
+ if (helpfilename==""){// check if file has any filename
+ obj.filename=obj["id"]+filesuffix;
+ }
+ else{obj.filename=helpfilename+filesuffix}
+ var link="";
+ if(obj["link"][0]){link=obj["link"][0]} else{link=obj["link"]["4"]}
+ xhr.setUrl(Qt.resolvedUrl(link));
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setFilename(login.imagestore+'albums/'+obj.album+"/"+obj["filename"]);
+ xhr.setDownloadtype("picture");
+ xhr.download();
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('SELECT * from imageData where id = "'+obj["id"]+'"');
+ if(result.rows.length === 1) {// use update
+ result = tx.executeSql('UPDATE imageData SET username ="' +login.username+ '",id="'+obj.id+'", created="'+obj.created+'", edited="'+obj.edited+'", profile="'+obj.profile+'", link="'+obj["link"]["4"]+'", filename="'+obj.filename+'",title="'+obj.title+'", desc="'+obj.desc+'", type="'+obj.type+'", width="'+obj.width+'", height="'+obj.height+'", album="'+obj.album+'", location="file://'+login.imagestore+'albums/'+obj.album+'/" where id="'+obj["id"]+'"');
+ } else {// use insert print('... does not exists, create it')
+ result = tx.executeSql('INSERT INTO imageData VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,obj.id,obj.created,obj.edited, obj.title, obj.desc, obj.album, obj.filename, obj.type, obj.height, obj.width,obj. profile,obj["link"]["4"],'file://'+login.imagestore+'albums/'+obj.album+"/"]);
+ }
+ })}}
+ catch (e){print("Data retrieval failure! "+ e+obj);}
+})}
+
+function storeImagedata(login,database,imagedata,rootwindow) {
+ // check if image exist and call download function
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('SELECT * from imageData where id = "'+imagedata["id"]+'"');
+ if(result.rows.length === 1) {// use update
+ result = tx.executeSql('UPDATE imageData SET username ="' +login.username+ '",id="'+imagedata.id+'", created="'+imagedata.created+'", edited="'+imagedata.edited+'", profile="'+imagedata.profile+'", link="'+imagedata.link[0]+'", filename="'+imagedata.filename+'",title="'+imagedata.title+'", desc="'+imagedata.desc+'", type="'+imagedata.type+'", width="'+imagedata.width+'", height="'+imagedata.height+'", album="'+imagedata.album+'", location="file://'+login.imagestore+'albums/'+imagedata.album+'/" where id="'+imagedata["id"]+'"');
+ } else {// use insert print('... does not exists, create it')
+ result = tx.executeSql('INSERT INTO imageData VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,imagedata.id,imagedata.created,imagedata.edited, imagedata.title, imagedata.desc, imagedata.album, imagedata.filename, imagedata.type, imagedata.height, imagedata.width,imagedata. profile,imagedata.link[0],'file://'+login.imagestore+'albums/'+imagedata.album+"/"]);
+ }
+})}
+
+function deleteImage(database,login,type,location,filesystem,rootwindow,callback) { // delete image locally and on server
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ var rsfilename=location.substring(location.lastIndexOf("/")+1,location.length);
+ var rslocation=location.substring(0,location.lastIndexOf("/")+1);
+ //print(type+" Name "+ rsfilename+" Location: "+rslocation)
+ db.transaction( function(tx) {
+ if (type=='image'){
+ var rs= tx.executeSql('SELECT * FROM imageData WHERE filename="'+rsfilename+'" AND location="'+rslocation+'"')
+ var imageId=rs.rows.item(0).id;
+ Helperjs.friendicaPostRequest(login,"/api/friendica/photo/delete?photo_id="+imageId,"","DELETE",rootwindow, function (obj){
+ //var deletereturn = JSON.parse(obj); print(obj);
+ //if (deletereturn.result=="deleted"){
+ db.transaction( function(tx) {
+ var deleters=tx.executeSql('DELETE FROM imageData WHERE location="'+rslocation+'" AND filename="'+rsfilename+'"'); });
+ filesystem.Directory=rslocation.substring(7,rslocation.length-1);
+ filesystem.rmFile(rsfilename)
+ //}
+ })
+ }
+ else{
+ Helperjs.friendicaPostRequest(login,"/api/friendica/photoalbum/delete?album="+rsfilename,"","DELETE",rootwindow, function (obj){
+ //var deletereturn = JSON.parse(obj);
+ //if (deletereturn.result=="deleted"){
+ db.transaction( function(tx) {
+ var rs= tx.executeSql('SELECT DISTINCT location FROM imageData WHERE album="'+rsfilename+'" AND username="'+login.username+'"');
+ var locationstring=rs.rows.item(0).location;
+ filesystem.Directory=locationstring.substring(7,locationstring.length-1);
+ filesystem.rmDir();
+ var deleters=tx.executeSql('DELETE FROM imageData WHERE album="'+location+'"');
+ })
+ //}
+ })
+ }
+ callback(location)
+ })
+}
+
+function deleteContacts(database,user,callback) { // does nothing useful at the moment
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ //print(' delete Image Data() for ' + field +"="+selection)
+ db.transaction( function(tx) {
+ result1= tx.executeSql('SELECT * FROM contacts a LEFT OUTER JOIN news b ON a.url==b.uid');
+ result2= tx.executeSql('SELECT * FROM contacts a LEFT OUTER JOIN news b ON a.url==b.uid');
+ callback(result)})
+}
+
+//function requestFriendsAlbumPictures(login,friend,rootwindow,callback){
+//// screenscraping of albums page of contact without user and password
+// Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
+// //print(photohtml);
+// var photoarray=[];
+// var arr = photohtml.split("sidebar-photos-albums-li");
+// for (var i=2;i')-1);
+// var album={'link':albumlink,'name':albumname}
+// photoarray.push(album);
+// }
+// callback(photoarray)
+// })
+//}
+
+function newRequestFriendsAlbumPictures(login,friend,rootwindow,callback){
+// screenscraping of albums page of contact with remoteAuth
+ Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
+ //print("Photohtml: "+photohtml);
+ try {var obj=JSON.parse(photohtml);
+ if (obj.hasOwnProperty('status')){
+ Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
+ getAlbumFromHtml(photohtml,false,rootwindow,callback)})
+ }}
+ catch (e){
+ getAlbumFromHtml(photohtml,true,rootwindow,callback)
+ }
+ })
+}
+
+function getAlbumFromHtml(photohtml,remoteAuthBool,rootwindow,callback){
+ var photoarray=[];
+ var arr = photohtml.split("sidebar-photos-albums-li");
+ for (var i=2;i')-1);
+ var album={'link':albumlink,'name':albumname}//print(albumlink+" "+albumname);
+ photoarray.push(album);
+ }
+ callback(photoarray,remoteAuthBool)
+}
+
+
+function newRequestFriendsPictures(login,link,friend,remoteAuthBool,remoteauth,rootwindow,callback){
+// screenscraping of pictures page for given album
+ if (remoteAuthBool){
+ remoteauth.setUrl(login.server);
+ remoteauth.setLogin(login.username+":"+Qt.atob(login.password));
+ remoteauth.setContacturl(friend.url);
+ Helperjs.friendicaRemoteAuthRequest(login,link,friend.url,rootwindow,function(photohtml){
+ getPictureFromHtml(photohtml,remoteAuthBool,function(photoarray){
+ callback(photoarray)
+ })
+ })}
+ else{
+ Helperjs.friendicaWebRequest(link,rootwindow,function(photohtml){
+ getPictureFromHtml(photohtml,remoteAuthBool,function(photoarray){
+ callback(photoarray)
+ })
+ })
+ }
+}
+
+function getPictureFromHtml(photohtml,remoteAuthBool,callback){
+ var photoarray=[];
+ var basehtml=photohtml.substring(photohtml.indexOf('',photohtml.indexOf('-1){ //theme 1
+ var arr = photohtml.split("photo-album-image-wrapper-end");}
+
+// other themes
+ if (photohtml.indexOf("photo-album-wrapper")>-1){ //theme 2
+ var photoarea=photohtml.substring(photohtml.indexOf("photo-album-wrapper"),photohtml.indexOf("photo-album-end"))
+ var arr = photoarea.split("");}
+ //print("Url: "+login.server+ "Contacturl: "+friend.url)
+// remoteauth.setUrl(login.server);
+// remoteauth.setLogin(login.username+":"+Qt.atob(login.password));
+// remoteauth.setContacturl(friend.url);
+ for (var i=0;i',photohtml.indexOf('-1){ //theme 1
+ var arr = photohtml.split("photo-album-image-wrapper-end");}
+
+// other themes
+ if (photohtml.indexOf("photo-album-wrapper")>-1){ //theme 2
+ var photoarea=photohtml.substring(photohtml.indexOf("photo-album-wrapper"),photohtml.indexOf("photo-album-end"))
+ var arr = photoarea.split("");}
+
+ for (var i=0;i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+function showFriends(db) {
+ Service.readActiveConfig(db,function(login){
+ Service.requestFriends(login.url,login.user,login.password,displayFriends);
+ });
+}
+function displayFriends(obj){
+ for (var i=0; i= c.x)
+ f.contentX = c.x;
+ else if (f.contentX+f.width <= c.x+c.width)
+ f.contentX = c.x+c.width-f.width;
+ if (f.contentY >= c.y)
+ f.contentY = c.y;
+ else if (f.contentY+f.height <= c.y+c.height)
+ f.contentY = c.y+c.height-f.height;
+}
+
+function createObject(objectQml,qmlParameters,parentitem,callback) {
+ var component = Qt.createComponent(objectQml);
+ if (component.status === Component.Ready || component.status === Component.Error)
+ finishCreation(component,qmlParameters,parentitem,callback);
+ else
+ component.statusChanged.connect(finishCreation(qmlParameters));
+}
+
+function finishCreation(component,qmlParameters,parentitem,callback) {
+ if (component.status === Component.Ready) {
+ var createdObject = component.createObject(parentitem, qmlParameters);
+ if (createdObject === null)
+ print("Error creating image"); }
+ else if (component.status === Component.Error)
+ print("Error loading component:"+component.errorString());
+ else {print("created")}
+ //callback(createdObject);
+}
+
diff --git a/source-android/js/news.js b/source-android/js/news.js
new file mode 100644
index 0000000..f1c1ef7
--- /dev/null
+++ b/source-android/js/news.js
@@ -0,0 +1,562 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+
+function requestFriends(login,database,rootwindow,callback){
+// return array of friends
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends
+ Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
+ var friends=JSON.parse(obj);
+ for (var i=0;i0'); // check for friends
+ var contactlist=[];
+ for (var i=0;i'+lastDate);
+ var result2 = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge > '+lastDate);
+ for (var j=0;j0){
+ for (var j=0;j0){
+ for (var k=0;j0){var helpernews=newsrs.rows.item(0);
+ var newscount=newsrs.rows.length;
+ helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
+ helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
+ helpernews.text=Qt.atob(helpernews.text);
+ helpernews.id=helpernews.status_id;
+ if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
+ callback(helpernews,newscount);}
+// var conversationobject={news:helpernews,newscount:newscount};
+// return conversationobject;
+})}
+
+
+
+
+function getAllContacts(database,user){
+ var allcontacts=[];
+ Helperjs.readData(database,"contacts",user,function(obj){
+ allcontacts=obj;
+ for (var n in allcontacts){
+ allcontacts[n].name=Qt.atob(allcontacts[n].name);
+ allcontacts[n].description=Qt.atob(allcontacts[n].description)
+ }
+ });
+ return allcontacts;
+}
+
+function inArray(list, prop, val) {
+ if (list.length > 0 ) {
+ for (var i in list) {if (list[i][prop] == val) {
+ return true;
+ }
+ }
+ } return false;
+}
+
+function objFromArray(list, prop, val) {
+ if (list.length > 0 ) {
+ for (var i in list) {if (list[i][prop] == val) {
+ return list[i];
+ }
+ }
+ } return false;
+}
+
+function cleanDate(date){
+ var cleanedDate= date.slice(0,3)+", "+date.slice(8,11)+date.slice(4,7)+date.slice(25,30)+date.slice(10,25);
+ return cleanedDate
+}
diff --git a/source-android/js/newsworker.js b/source-android/js/newsworker.js
new file mode 100644
index 0000000..fe60147
--- /dev/null
+++ b/source-android/js/newsworker.js
@@ -0,0 +1,129 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+WorkerScript.onMessage = function(msg) {
+if(msg.deleteId!==undefined)
+ {msg.model.remove(msg.deleteId);
+ msg.model.sync()
+}
+else{
+ if(msg.appendnews!==true){msg.model.clear()};
+ msg.model.sync()
+ for (var j=0;j0){
+ if (newsitemobject.friendica_activities.like.length==1){likeText= newsitemobject.friendica_activities.like[0].name+" "+ qsTr("likes this.")}
+ else {likeText= newsitemobject.friendica_activities.like.length+" "+ qsTr("like this.")}
+ }
+ if (newsitemobject.friendica_activities.dislike.length>0){
+ if (newsitemobject.friendica_activities.dislike.length==1){dislikeText= newsitemobject.friendica_activities.dislike[0].name+" "+ qsTr("doesn't like this.")}
+ else {dislikeText= newsitemobject.friendica_activities.dislike.length+" "+ qsTr("don't like this.")}
+ }
+ if (newsitemobject.friendica_activities.attendyes.length>0){
+ if (newsitemobject.friendica_activities.attendyes.length==1){attendyesText=newsitemobject.friendica_activities.attendyes[0].name+" "+ qsTr("will attend.")}
+ else {attendyesText= newsitemobject.friendica_activities.attendyes.length+" "+ qsTr("persons will attend.")}
+ }
+ if (newsitemobject.friendica_activities.attendno.length>0){
+ if (newsitemobject.friendica_activities.attendno.length==1){attendnoText= newsitemobject.friendica_activities.attendno[0].name+" "+ qsTr("will not attend.")}
+ else {attendnoText= newsitemobject.friendica_activities.attendno.length+" "+ qsTr("persons will not attend.")}
+ }
+ if (newsitemobject.friendica_activities.attendmaybe.length>0){
+ if (newsitemobject.friendica_activities.attendmaybe.length==1){attendmaybeText= newsitemobject.friendica_activities.attendmaybe[0].name+" "+ qsTr("may attend.")}
+ else {attendmaybeText= newsitemobject.friendica_activities.attendmaybe.length+" "+ qsTr("persons may attend.")}
+ }
+ //var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self);
+ if (newsitemobject.hasOwnProperty("friendica_activities_self")){
+ if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")}
+ if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")}
+ if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")}
+ if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
+ if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
+ }}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
+ var friendica_activities={likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText,self:self}
+ var attachmentList=[];
+ try{if(newsitemobject.attachments){
+ var attachArray=newsitemobject.attachments;
+ for (var image in attachArray){
+ var attachhelper={mimetype:attachArray[image].mimetype}
+ var attachhelperstring=Qt.btoa(attachArray[image].url)
+ var helperstringposition=newsitemobject.text.indexOf(attachhelperstring);
+ if (helperstringposition>-1){attachhelper.url=newsitemobject.text.substring(newsitemobject.text.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
+ if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
+ else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
+ else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
+ }
+ else {attachhelper.url=attachArray[image].url}
+ attachmentList.push(attachhelper)
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url,"")
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
+ }
+ }}catch(e){print("attachment "+e)}
+ newsitemobject.attachmentList=attachmentList;
+
+ var seconds=(msg.currentTime-newsitemobject.created_at)/1000;
+ var timestring="";
+ if (seconds<60) {timestring=seconds+" "+qsTr("seconds") +" "+qsTr("ago");}
+ else if (seconds<90){timestring=Math.round(seconds/60)+" "+qsTr("minute") +" "+qsTr("ago");}
+ else if (seconds<3600){timestring=Math.round(seconds/60)+" "+qsTr("minutes") +" "+qsTr("ago");}
+ else if (seconds<5400){timestring=Math.round(seconds/3600)+" "+qsTr("hour") +" "+qsTr("ago");}
+ else if (seconds<86400){timestring=Math.round(seconds/3600)+" "+qsTr("hours") +" "+qsTr("ago");}
+ else if (seconds<129600){timestring=Math.round(seconds/86400)+" "+qsTr("day") +" "+qsTr("ago");}
+ else if (seconds<3888000){timestring=Math.round(seconds/86400)+" "+qsTr("days") +" "+qsTr("ago");}
+ else if (seconds<5832000){timestring=Math.round(seconds/3888000)+" "+qsTr("month") +" "+qsTr("ago");}
+ else if (seconds<69984000){timestring=Math.round(seconds/3888000)+" "+qsTr("months") +" "+qsTr("ago");}
+ else {timestring=Math.round(seconds/46656000)+" "+qsTr("years") +" "+qsTr("ago");}
+
+ var data=({"newsitemobject": newsitemobject,"dateDiff":timestring,"friendica_activities":friendica_activities,"forumname":forumname})}
+ //print("News:"+j+msg.news.length+JSON.stringify(data));
+ msg.model.append(data)
+ }
+
+ if (j==msg.news.length){
+ //print("j: "+j+" msg.model.count: "+msg.model.count);
+ msg.model.sync()
+}
+}
+}
diff --git a/src/js/photoworker.js b/source-android/js/photoworker.js
similarity index 85%
rename from src/js/photoworker.js
rename to source-android/js/photoworker.js
index 4dfdc21..76f2129 100644
--- a/src/js/photoworker.js
+++ b/source-android/js/photoworker.js
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -32,14 +32,14 @@
WorkerScript.onMessage = function(msg) {
if (msg.firstalbum==0){msg.model.clear();}
var contact={}; try{contact=msg.friend}catch(e){print(e)}
- var limit=0; if (msg.albums.length-msg.firstalbum<20){limit=msg.albums.length} else{limit=msg.firstalbum+20}
+ var limit=0; if (msg.albums.length-msg.firstalbum<20){limit=msg.albums.length} else{limit=msg.firstalbum+20}
for (var j=msg.firstalbum;j
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+//.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+.import "qrc:/js/news.js" as Newsjs
+
+// CONFIG FUNCTIONS
+
+function initDatabase(database) { // initialize the database object
+ var db =Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ print('initDatabase()'+database[0]+database[1]+database[2]+database[3])
+ db.transaction( function(tx) {
+ //var version=tx.executeSql('PRAGMA user_version');print(JSON.stringify(version.rows.item(0)))
+ tx.executeSql('CREATE TABLE IF NOT EXISTS imageData(username TEXT,id INT, created TEXT,edited TEXT, title TEXT, desc TEXT, album TEXT,filename TEXT, type TEXT, height INT, width INT, profile INT, link TEXT,location TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS config(server TEXT, username TEXT, password TEXT, imagestore TEXT, maxnews INT, timerInterval INT, newsViewType TEXT,isActive INT, permissions TEXT,maxContactAge INT,APIVersion TEXT,layout TEXT, addons TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS news(username TEXT, messagetype INT, text TEXT, created_at INT, in_reply_to_status_id INT, source TEXT, status_id INT, in_reply_to_user_id INT, geo TEXT,favorited TEXT, uid INT, statusnet_html TEXT, statusnet_conversation_id TEXT,friendica_activities TEXT, friendica_activities_self TEXT, attachments TEXT, friendica_owner TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS contacts(username TEXT, id INT, name TEXT, screen_name TEXT, location TEXT,imageAge INT, profile_image_url TEXT, description TEXT, profile_image BLOB, url TEXT, protected TEXT, followers_count INT, friends_count INT, created_at INT, favourites_count TEXT, utc_offset TEXT, time_zone TEXT, statuses_count INT, following TEXT, verified TEXT, statusnet_blocking TEXT, notifications TEXT, statusnet_profile_url TEXT, cid INT, network TEXT, isFriend INT, timestamp INT)');
+// tx.executeSql('CREATE INDEX IF NOT EXISTS contact_id ON contacts(id)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(username TEXT, id INT, profiledata TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS groups(username TEXT, groupname TEXT, gid INT, members TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS events(username TEXT, id INT, start INT, end INT, allday INT, title TEXT, j INT, d TEXT, isFirst INT, uid INT, cid INT, uri TEXT, created INT, edited INT, desc TEXT, location TEXT, type TEXT, nofinish TEXT, adjust INT, ignore INT, permissions TEXT, guid INT, itemid INT, plink TEXT, authorName TEXT, authorAvatar TEXT, authorLink TEXT, html TEXT)');
+})}
+
+function cleanPermissions(oldperms){
+ var newperms=oldperms.replace("<","");newperms=newperms.replace(">","");newperms="["+newperms+"]";
+ var newpermArray=JSON.parse(newperms);
+return (newpermArray)
+}
+
+function getEvents(database,login,rootwindow,callback){
+var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ Helperjs.friendicaWebRequest(login.server+"/cal/"+login.username+"/json",rootwindow,function(obj){
+ //Helperjs.friendicaRemoteAuthRequest(login,login.server+"/cal/"+login.username+"/json",login.server+"/profile/"+login.username,rootwindow,function(obj){
+ var events = JSON.parse(obj);
+ db.transaction( function(tx) {
+ for (var i=0;i0){
+ for(var i = 0; i < rs.rows.length; i++) {
+ rsArray.push(rs.rows.item(i))
+ }
+ var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,maxnews:rsArray[0].maxnews,isActive:rsArray[0].isActive,timerInterval:rsArray[0].timerInterval, newsViewType:rsArray[0].newsViewType,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
+ } else {var rsObject=""}
+ callback(rsObject)}}
+ )
+}
+
+function readActiveConfig(database){
+ var obj;
+ readConfig(database,function(config){obj=config},"isActive", 0);
+ return obj;
+}
+
+function deleteConfig(database,userobj,callback) { // delete user data from DB
+ if (userobj){var where = " WHERE username='"+ userobj.username+"' and server='"+userobj.server+"'";} else { return "no user selected!";}
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ if(!db) { return; }
+ db.transaction( function(tx) {
+ var rs1 = tx.executeSql('delete from config'+where);
+ var rs2 = tx.executeSql("delete from news WHERE username='"+ userobj.username+"'");
+ var rs3 = tx.executeSql("delete from contacts WHERE username='"+ userobj.username+"'");
+ var rs4 = tx.executeSql("delete from imageData WHERE username='"+ userobj.username+"'");
+ var rs5 = tx.executeSql("delete from groups WHERE username='"+ userobj.username+"'");
+ var rs5 = tx.executeSql("delete from events WHERE username='"+ userobj.username+"'");
+ callback();
+ })
+}
+
+function cleanNews(database,callback){
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var maxnewsrs = tx.executeSql("SELECT DISTINCT maxnews FROM config");
+ var maxnews=maxnewsrs.rows.item(0).maxnews;
+ var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
+ var newscount = newscountrs.rows.item(0)["COUNT(*)"];//print("newscount "+newscount)
+ if (newscount>maxnews){
+ var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news ORDER BY created_at ASC LIMIT ' +(newscount-maxnews));
+ var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnews-1).created_at;
+ var deleters = tx.executeSql('DELETE from news WHERE created_at<='+lastvalidtime)}
+ callback()
+ })
+ }
+
+function cleanContacts(login,database,callback){
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var oldestnewsrs= tx.executeSql('SELECT created_at FROM news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY created_at ASC LIMIT 1');
+ if (oldestnewsrs.rows.length>0){ var oldestnewsTime=oldestnewsrs.rows.item(0).created_at- 604800000;} else{var oldestnewsTime=0} //contacts can be 7 days old
+ //print(login.username+" älteste news: "+ oldestnewsTime);
+ var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
+ //print ("Contact result length: "+ result.rows.length)
+ for (var i=0;i-1){contacttimer.start()}
+ }
+
+}
+
+
+function cleanUser(user){
+ user.created_at=Date.parse(Newsjs.cleanDate(user.created_at));
+ var imagehelper1=user.profile_image_url.split("?");
+ var imagehelper2=imagehelper1[0].substring(imagehelper1[0].lastIndexOf("/")+1,imagehelper1[0].length);
+ var imagehelper3=login.imagestore+"contacts/"+user.screen_name+"-"+imagehelper2
+ if(filesystem.fileexist(imagehelper3)){user.profile_image=imagehelper3}else {user.profile_image=""}
+ return user
+}
+
+function updateView(viewtype){
+ newsBusy.running=true;
+ //downloadNotice.text="xhr start "+Date.now()
+ switch(viewtype){
+ case "Conversations":
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ break;
+ case "Timeline":
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ break;
+ case "Search":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/search");
+ break;
+ case "Notifications":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/friendica/notifications");
+ xhr.clearParams();
+ break;
+ case "Direct Messages":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/direct_messages/all");
+ xhr.clearParams();
+ break;
+ case "Public Timeline":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/public_timeline");
+ xhr.clearParams();
+ break;
+ case "Favorites":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/favorites");
+ xhr.clearParams();
+ break;
+ default:
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ newstab.newstabstatus="Conversations";
+ }
+ xhr.get();
+
+ if (viewtype==="Conversations"){Newsjs.allchatsfromdb(db,login.username,function(temp){
+ newsStack.allchats=temp
+ })}
+}
+
+function showGroups(){
+ Helperjs.readData(db,"groups",login.username,function(groups){
+ var groupitems="";
+ for (var i=0;i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+
+var core=[
+{name:'<3',url:
+'qrc:///images/smileys/core/smiley-heart.gif'},
+
+{name:'</3',url:
+'qrc:///images/smileys/core/smiley-brokenheart.gif'},
+
+{name:':-)',url:
+'qrc:///images/smileys/core/smiley-smile.gif'},
+
+{name:';-)',url:
+'qrc:///images/smileys/core/smiley-wink.gif'},
+
+{name:':-(',url:
+'qrc:///images/smileys/core/smiley-frown.gif'},
+
+{name:':-P',url:
+'qrc:///images/smileys/core/smiley-tongue-out.gif'},
+
+{name:':-X',url:
+'qrc:///images/smileys/core/smiley-kiss.gif'},
+
+{name:':-D',url:
+'qrc:///images/smileys/core/smiley-laughing.gif'},
+
+{name:':-O',url:
+'qrc:///images/smileys/core/smiley-surprised.gif'},
+
+{name:'\\o/',url:
+'qrc:///images/smileys/core/smiley-thumbsup.gif'},
+
+{name:'o.O',url:
+'qrc:///images/smileys/core/smiley-Oo.gif'},
+
+{name:":'(",url:
+'qrc:///images/smileys/core/smiley-cry.gif'},
+
+{name:":-!",url:
+'qrc:///images/smileys/core/smiley-foot-in-mouth.gif'},
+
+{name:":-/",url:
+'qrc:///images/smileys/core/smiley-undecided.gif'},
+
+{name:":-[",url:
+'qrc:///images/smileys/core/smiley-embarassed.gif'},
+
+{name:"8-)",url:
+'qrc:///images/smileys/core/smiley-cool.gif'},
+
+{name:':beer',url:
+'qrc:///images/smileys/core/beer_mug.gif'},
+
+{name:':coffee',url:
+'qrc:///images/smileys/core/coffee.gif'},
+
+{name:':facepalm',url:
+'qrc:///images/smileys/core/smiley-facepalm.gif'},
+
+{name:':like',url:
+'qrc:///images/smileys/core/like.gif'},
+
+{name:':dislike',url:
+'qrc:///images/smileys/core/dislike.gif'},
+
+{name:'~friendica',url:
+'qrc:///images/smileys/core/friendica-16.png'},
+
+{name:'red#',url:
+'qrc:///images/smileys/core/rm-16.png'}
+]
+
+
+var addon=[
+{name:':bunnyflowers',url:
+'qrc:///images/smileys/animals/bunnyflowers.gif'},
+
+ {name:':chick',url:
+'qrc:///images/smileys/animals/chick.gif'},
+
+ {name:':bumblebee',url:
+'qrc:///images/smileys/animals/bee.gif'},
+
+ {name:':ladybird',url:
+'qrc:///images/smileys/animals/ladybird.gif'},
+
+ {name:':bigspider',url:
+'qrc:///images/smileys/animals/bigspider.gif' },
+
+ {name:':cat',url:
+'qrc:///images/smileys/animals/cat.gif'},
+
+ {name:':bunny',url:
+'qrc:///images/smileys/animals/bunny.gif' },
+
+ {name:':cow',url:
+'qrc:///images/smileys/animals/cow.gif' },
+
+ {name:':crab',url:
+'qrc:///images/smileys/animals/crab.gif' },
+
+ {name:':dolphin',url:
+'qrc:///images/smileys/animals/dolphin.gif' },
+
+ {name:':dragonfly',url:
+'qrc:///images/smileys/animals/dragonfly.gif' },
+
+ {name:':frog',url:
+'qrc:///images/smileys/animals/frog.gif'},
+
+ {name:':hamster',url:
+'qrc:///images/smileys/animals/hamster.gif' },
+
+ {name:':monkey',url:
+'qrc:///images/smileys/animals/monkey.gif' },
+
+ {name:':horse',url:
+'qrc:///images/smileys/animals/horse.gif' },
+
+ {name:':parrot',url:
+'qrc:///images/smileys/animals/parrot.gif' },
+
+ {name:':tux',url:
+'qrc:///images/smileys/animals/tux.gif' },
+
+ {name:':snail',url:
+'qrc:///images/smileys/animals/snail.gif' },
+
+ {name:':sheep',url:
+'qrc:///images/smileys/animals/sheep.gif' },
+
+ {name:':dog',url:
+'qrc:///images/smileys/animals/dog.gif'},
+
+ {name:':elephant',url:
+'qrc:///images/smileys/animals/elephant.gif' },
+
+ {name:':fish',url:
+'qrc:///images/smileys/animals/fish.gif' },
+
+ {name:':giraffe',url:
+'qrc:///images/smileys/animals/giraffe.gif' },
+
+ {name:':pig',url:
+'qrc:///images/smileys/animals/pig.gif'},
+
+//Baby
+
+ {name:':baby',url:
+'qrc:///images/smileys/babies/baby.gif' },
+
+ {name:':babycot',url:
+'qrc:///images/smileys/babies/babycot.gif' },
+
+
+ {name:':pregnant',url:
+'qrc:///images/smileys/babies/pregnant.gif' },
+
+ {name:':stork',url:
+'qrc:///images/smileys/babies/stork.gif' },
+
+
+//Confused
+ {name:':confused',url:
+'qrc:///images/smileys/confused/confused.gif' },
+
+ {name:':shrug',url:
+'qrc:///images/smileys/confused/shrug.gif' },
+
+ {name:':stupid',url:
+'qrc:///images/smileys/confused/stupid.gif' },
+
+ {name:':dazed',url:
+'qrc:///images/smileys/confused/dazed.gif' },
+//Cool 'qrc:///images/smileys
+
+ {name:':affro',url:
+'qrc:///images/smileys/cool/affro.gif'},
+
+//Devil/Angel
+
+ {name:':angel',url:
+'qrc:///images/smileys/devilangel/angel.gif'},
+
+ {name:':cherub',url:
+'qrc:///images/smileys/devilangel/cherub.gif'},
+
+ {name:':devilangel',url:
+'qrc:///images/smileys/devilangel/blondedevil.gif' },
+ {name:':catdevil',url:
+'qrc:///images/smileys/devilangel/catdevil.gif'},
+
+ {name:':devillish',url:
+'qrc:///images/smileys/devilangel/devil.gif'},
+
+ {name:':daseesaw',url:
+'qrc:///images/smileys/devilangel/daseesaw.gif'},
+
+ {name:':turnevil',url:
+'qrc:///images/smileys/devilangel/turnevil.gif' },
+
+ {name:':saint',url:
+'qrc:///images/smileys/devilangel/saint.gif'},
+
+ {name:':graveside',url:
+'qrc:///images/smileys/devilangel/graveside.gif'},
+
+//Unpleasent
+
+ {name:':toilet',url:
+'qrc:///images/smileys/disgust/toilet.gif'},
+
+ {name:':fartinbed',url:
+'qrc:///images/smileys/disgust/fartinbed.gif' },
+
+ {name:':fartblush',url:
+'qrc:///images/smileys/disgust/fartblush.gif' },
+
+//Drinks
+
+ {name:':tea',url:
+'qrc:///images/smileys/drink/tea.gif' },
+
+ {name:':drool',url:
+'qrc:///images/smileys/drool/drool.gif'},
+
+//Sad
+
+ {name:':crying',url:
+'qrc:///images/smileys/sad/crying.png'},
+
+ {name:':prisoner',url:
+'qrc:///images/smileys/sad/prisoner.gif' },
+
+ {name:':sigh',url:
+'qrc:///images/smileys/sad/sigh.gif'},
+
+//Smoking - only one smiley in here, maybe it needs moving elsewhere?
+
+ {name:':smoking',url:
+'qrc:///images/smileys/smoking/smoking.gif'},
+
+//Sport
+
+ {name:':basketball',url:
+'qrc:///images/smileys/sport/basketball.gif'},
+
+ {name:':bowling',url:
+'qrc:///images/smileys/sport/bowling.gif'},
+
+ {name:':cycling',url:
+'qrc:///images/smileys/sport/cycling.gif'},
+
+ {name:':darts',url:
+'qrc:///images/smileys/sport/darts.gif'},
+
+ {name:':fencing',url:
+'qrc:///images/smileys/sport/fencing.gif' },
+
+ {name:':juggling',url:
+'qrc:///images/smileys/sport/juggling.gif'},
+
+ {name:':skipping',url:
+'qrc:///images/smileys/sport/skipping.gif'},
+
+ {name:':archery',url:
+'qrc:///images/smileys/sport/archery.gif'},
+
+ {name:':surfing',url:
+'qrc:///images/smileys/sport/surfing.gif' },
+
+ {name:':snooker',url:
+'qrc:///images/smileys/sport/snooker.gif' },
+
+ {name:':horseriding',url:
+'qrc:///images/smileys/sport/horseriding.gif'},
+
+//Love
+
+ {name:':iloveyou',url:
+'qrc:///images/smileys/love/iloveyou.gif'},
+
+ {name:':inlove',url:
+'qrc:///images/smileys/love/inlove.gif'},
+
+ {name:':~love',url:
+'qrc:///images/smileys/love/love.gif' },
+
+ {name:':lovebear',url:
+'qrc:///images/smileys/love/lovebear.gif'},
+
+ {name:':lovebed',url:
+'qrc:///images/smileys/love/lovebed.gif' },
+
+ {name:':loveheart',url:
+'qrc:///images/smileys/love/loveheart.gif' },
+
+//Tired/Sleep
+
+ {name:':countsheep',url:
+'qrc:///images/smileys/tired/countsheep.gif' },
+
+ {name:':hammock',url:
+'qrc:///images/smileys/tired/hammock.gif'},
+
+ {name:':pillow',url:
+'qrc:///images/smileys/tired/pillow.gif' },
+
+ {name:':yawn',url:
+'qrc:///images/smileys/tired/yawn.gif'},
+
+//Fight/Flame/Violent
+
+ {name:':2guns',url:
+'qrc:///images/smileys/fight/2guns.gif' },
+
+ {name:':alienfight',url:
+'qrc:///images/smileys/fight/alienfight.gif' },
+
+ {name:':army',url:
+'qrc:///images/smileys/fight/army.gif'},
+
+ {name:':arrowhead',url:
+'qrc:///images/smileys/fight/arrowhead.gif'},
+
+ {name:':bfg',url:
+'qrc:///images/smileys/fight/bfg.gif' },
+
+ {name:':bowman',url:
+'qrc:///images/smileys/fight/bowman.gif' },
+
+ {name:':chainsaw',url:
+'qrc:///images/smileys/fight/chainsaw.gif'},
+
+ {name:':crossbow',url:
+'qrc:///images/smileys/fight/crossbow.gif'},
+
+ {name:':crusader',url:
+'qrc:///images/smileys/fight/crusader.gif' },
+
+ {name:':dead',url:
+'qrc:///images/smileys/fight/dead.gif' },
+
+ {name:':hammersplat',url:
+'qrc:///images/smileys/fight/hammersplat.gif' },
+
+ {name:':lasergun',url:
+'qrc:///images/smileys/fight/lasergun.gif' },
+
+ {name:':machinegun',url:
+'qrc:///images/smileys/fight/machinegun.gif' },
+
+ {name:':acid',url:
+'qrc:///images/smileys/fight/acid.gif' },
+
+//Fantasy - monsters and dragons fantasy. The other type of fantasy belongs in adult
+
+ {name:':alienmonster',url:
+'qrc:///images/smileys/fantasy/alienmonster.gif' },
+
+ {name:':barbarian',url:
+'qrc:///images/smileys/fantasy/barbarian.gif' },
+
+ {name:':dinosaur',url:
+'qrc:///images/smileys/fantasy/dinosaur.gif'},
+
+ {name:':dragon',url:
+'qrc:///images/smileys/fantasy/dragon.gif'},
+
+ {name:':draco',url:
+'qrc:///images/smileys/fantasy/dragonwhelp.gif'},
+
+ {name:':ghost',url:
+'qrc:///images/smileys/fantasy/ghost.gif'},
+
+ {name:':mummy',url:
+'qrc:///images/smileys/fantasy/mummy.gif'},
+
+//Food
+
+ {name:':apple',url:
+'qrc:///images/smileys/food/apple.gif' },
+
+ {name:':broccoli',url:
+'qrc:///images/smileys/food/broccoli.gif' },
+
+ {name:':cake',url:
+'qrc:///images/smileys/food/cake.gif'},
+
+ {name:':carrot',url:
+'qrc:///images/smileys/food/carrot.gif' },
+
+ {name:':popcorn',url:
+'qrc:///images/smileys/food/popcorn.gif'},
+
+ {name:':tomato',url:
+'qrc:///images/smileys/food/tomato.gif'},
+
+ {name:':banana',url:
+'qrc:///images/smileys/food/banana.gif'},
+
+ {name:':cooking',url:
+'qrc:///images/smileys/food/cooking.gif'},
+
+ {name:':fryegg',url:
+'qrc:///images/smileys/food/fryegg.gif'},
+
+ {name:':birthdaycake',url:
+'qrc:///images/smileys/food/birthdaycake.gif'},
+
+//Happy
+
+ {name:':cloud9',url:
+'qrc:///images/smileys/happy/cloud9.gif'},
+
+ {name:':tearsofjoy',url:
+'qrc:///images/smileys/happy/tearsofjoy.gif' },
+
+//Repsect
+
+ {name:':bow',url:
+'qrc:///images/smileys/respect/bow.gif'},
+
+ {name:':bravo',url:
+'qrc:///images/smileys/respect/bravo.gif'},
+
+ {name:':hailking',url:
+'qrc:///images/smileys/respect/hailking.gif'},
+
+ {name:':number1',url:
+'qrc:///images/smileys/respect/number1.gif' },
+
+//Laugh
+
+ {name:':hahaha',url:
+'qrc:///images/smileys/laugh/hahaha.gif'},
+
+ {name:':loltv',url:
+'qrc:///images/smileys/laugh/loltv.gif' },
+
+ {name:':rofl',url:
+'qrc:///images/smileys/laugh/rofl.gif'},
+
+//Music
+
+ {name:':drums',url:
+'qrc:///images/smileys/music/drums.gif'},
+
+
+ {name:':guitar',url:
+'qrc:///images/smileys/music/guitar.gif'},
+
+ {name:':trumpet',url:
+'qrc:///images/smileys/music/trumpet.gif' },
+
+//smileys that used to be in core
+
+ {name:':headbang',url:
+'qrc:///images/smileys/oldcore/headbang.gif'},
+
+ {name:':beard',url:
+'qrc:///images/smileys/oldcore/beard.png'},
+
+ {name:':whitebeard',url:
+'qrc:///images/smileys/oldcore/whitebeard.png'},
+
+ {name:':shaka',url:
+'qrc:///images/smileys/oldcore/shaka.gif'},
+
+ {name:':\\.../',url:
+'qrc:///images/smileys/oldcore/shaka.gif'},
+
+ {name:':\\ooo/',url:
+'qrc:///images/smileys/oldcore/shaka.gif' },
+
+ {name:':headdesk',url:
+'qrc:///images/smileys/oldcore/headbang.gif' },
+
+//These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
+
+ {name:':-d',url:
+'qrc:///images/smileys/oldcore/laughing.gif'},
+
+ {name:':-o',url:
+'qrc:///images/smileys/oldcore/surprised.gif' },
+
+// Regex killers - stick these at the bottom so they appear at the end of the English and
+// at the start of $OtherLanguage.
+
+ {name:':cool',url:
+'qrc:///images/smileys/cool/cool.gif' },
+
+ {name:':vomit',url:
+'qrc:///images/smileys/disgust/vomit.gif' },
+
+ {name:':golf',url:
+'qrc:///images/smileys/sport/golf.gif' },
+
+ {name:':football',url:
+'qrc:///images/smileys/sport/football.gif'},
+
+ {name:':tennis',url:
+'qrc:///images/smileys/sport/tennis.gif' },
+
+ {name:':alpha',url:
+'qrc:///images/smileys/fight/alpha.png' },
+
+ {name:':marine',url:
+'qrc:///images/smileys/fight/marine.gif' },
+
+ {name:':sabre',url:
+'qrc:///images/smileys/fight/sabre.gif' },
+
+ {name:':tank',url:
+'qrc:///images/smileys/fight/tank.gif' },
+
+ {name:':viking',url:
+'qrc:///images/smileys/fight/viking.gif' },
+
+ {name:':gangs',url:
+'qrc:///images/smileys/fight/gangs.gif' },
+
+ {name:':dj',url:
+'qrc:///images/smileys/music/dj.gif'},
+
+ {name:':elvis',url:
+'qrc:///images/smileys/music/elvis.gif'},
+
+ {name:':violin',url:
+'qrc:///images/smileys/music/violin.gif'},
+]
+
+
+var adult=[
+{
+name:'(o)(o) ',url:
+'qrc:///images/smileys/adult/tits.gif'},
+
+{name:'(.)(.) ',url:
+'qrc:///images/smileys/adult/tits.gif'},
+
+{name:':bong',url:
+'qrc:///images/smileys/adult/bong.gif'},
+
+{name:':sperm',url:
+'qrc:///images/smileys/adult/sperm.gif'},
+
+{name:':drunk',url:
+'qrc:///images/smileys/adult/drunk.gif'},
+
+{name:':finger',url:
+'qrc:///images/smileys/adult/finger.gif'}
+]
diff --git a/src/qml/calendarqml/CalendarDay.qml b/source-android/qml/calendarqml/CalendarDay.qml
similarity index 68%
rename from src/qml/calendarqml/CalendarDay.qml
rename to source-android/qml/calendarqml/CalendarDay.qml
index bbb8de7..21064df 100644
--- a/src/qml/calendarqml/CalendarDay.qml
+++ b/source-android/qml/calendarqml/CalendarDay.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,45 +29,50 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
+import QtQuick 2.0
+import QtQuick.Controls 1.4
Item {
id: calendarDay
- width: root.fontFactor*osSettings.bigFontSize*2
- height: root.fontFactor*osSettings.bigFontSize*2
- property int dateInt: Math.floor(model.date.valueOf()/86400000)
+ width:7*mm
+ height: 7*mm
+ property int dateInt:Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
Rectangle {
id: placeHolder
- color: model.today?'lightblue':'transparent';
- border.color: 'lightblue'
- border.width: 2
- antialiasing: true
+ color: 'lightblue'; antialiasing: true
anchors.fill:parent
- radius: 0.5*mm
}
Text {
id:daytext
anchors.right: parent.right
anchors.margins: 0.5*mm
- color:(model.month==monthgrid.month)?osSettings.primaryTextColor:osSettings.secondaryTextColor
+ color:(model.month==monthgrid.month)?"black":"grey"
wrapMode: Text.WrapAnywhere
text: model.day
font.bold: model.today
- font.pointSize: 1.2*osSettings.systemFontSize
+ font.pixelSize: 4*mm
}
Rectangle {
id:eventRect
- color:"grey"
+ color:"black"
anchors.margins: 0.5*mm
anchors.bottom: calendarDay.bottom
width: parent.width-mm
- height: 0.5*osSettings.systemFontSize//mm
+ height: mm
visible: eventdays.indexOf(dateInt)>-1
}
MouseArea {
anchors.fill: calendarDay
onClicked: {
- rootstackView.push("qrc:/qml/calendarqml/EventList.qml",{"dayint": dateInt,"events":events});
+ var eventDate=[];
+ var idx = eventdays.indexOf(dateInt);
+ while (idx != -1) {
+ eventDate.push(idx);
+ idx = eventdays.indexOf(dateInt,idx + 1)
+ }
+ var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
+ if (component.status== Component.Ready){
+ var eventlist = component.createObject(calendartab,{"daylist": eventDate})}
}
}
}
diff --git a/source-android/qml/calendarqml/CalendarTab.qml b/source-android/qml/calendarqml/CalendarTab.qml
new file mode 100644
index 0000000..3f96a62
--- /dev/null
+++ b/source-android/qml/calendarqml/CalendarTab.qml
@@ -0,0 +1,167 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 2.3
+import QtQml 2.2
+import Qt.labs.calendar 1.0
+import QtQuick.Controls 1.2 as Oldcontrol
+import QtQuick.Layouts 1.3
+import "qrc:/js/service.js" as Service
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/calendarqml"
+import "qrc:/qml/genericqml"
+
+Rectangle {
+ id:calendarrectangle
+ y:1
+ width:root.width-mm
+ height:root.height-5*mm
+ color: '#fff'
+ property date currentTime: new Date()
+ property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
+ property var events:[]
+ property var eventdays:[]
+ //onEventdaysChanged: print(JSON.stringify(eventdays))
+
+ function showEvents(friend){
+ if(friend=="backButton"){Service.eventsfromdb(db,login.username,function(eventArray,dayArray){
+ events=eventArray;
+ eventdays=dayArray})
+ }
+ else if (friend!=""){
+ calendartab.calendartabstatus=friend.url.substring(friend.url.lastIndexOf("/")+1,friend.url.length)
+ Service.newRequestFriendsEvents(login,friend,calendartab,function(eventArray,dayArray){
+ events=eventArray;
+ eventdays=dayArray})
+ }
+ else {calendartab.calendartabstatus="Events";
+ Service.eventsfromdb(db,login.username,function(eventArray,dayArray){
+ events=eventArray;
+ eventdays=dayArray;
+ calBusy.running=false
+ })
+ }
+ }
+
+ BusyIndicator{
+ id: calBusy
+ anchors.horizontalCenter: calendarView.horizontalCenter
+ anchors.top:calendarView.top
+ anchors.topMargin: 2*mm
+ width:10*mm
+ height: 10*mm
+ running: false
+ }
+
+
+ BlueButton{
+ id: updateEvents
+ anchors.top: parent.top
+ anchors.topMargin: 0.5*mm
+ anchors.right:calendartabstatusButton.left
+ anchors.rightMargin:mm
+ text:"\uf021"
+ onClicked: {
+
+ Service.getEvents(db,login, calendartab,function(){
+ showEvents("")
+ })}}
+
+ BlueButton{
+ id: calendartabstatusButton
+ anchors.top: parent.top
+ anchors.topMargin: 0.5*mm
+ anchors.right: parent.right
+ anchors.rightMargin:2*mm
+ text: calendartab.calendartabstatus=="Events"?qsTr("Events"):calendartabstatus
+ Oldcontrol.Menu {
+ id:calendartabmenu
+ Oldcontrol.MenuItem {
+ text: qsTr("Own Calendar")
+ onTriggered: {
+ calendartab.calendartabstatus="Events";
+ // calendartabstatusButton.text=qsTr("own Calendar");
+ showEvents("")}
+ }
+ }
+ onClicked: {calendartabmenu.popup()}
+ }
+
+
+ ListView{
+ id: calendarView
+ x: mm;y:8*mm
+ width: parent.width-2*mm; height: parent.height-9*mm
+ clip: true
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ model: CalendarModel {id:calendarModel
+ from: new Date()
+ to: new Date(new Date().valueOf()+93312000000)
+ }
+ delegate:
+ ColumnLayout{
+ width:calendarView.width
+ Text{
+ font.bold: true
+ Layout.fillWidth: true
+ horizontalAlignment:Text.AlignHCenter
+ text: model.year
+ }
+ Text{
+ text: Qt.locale().standaloneMonthName(model.month)
+ Layout.fillWidth: true
+ horizontalAlignment:Text.AlignHCenter
+ }
+ DayOfWeekRow{
+ locale: monthgrid.locale
+ Layout.fillWidth: true
+ }
+
+ MonthGrid {
+ id: monthgrid
+ Layout.fillWidth: true
+ month: model.month
+ year: model.year
+ locale: Qt.locale()
+ delegate: CalendarDay{}
+ }
+ }
+ ScrollIndicator.horizontal: ScrollIndicator { }
+ }
+
+ Component.onCompleted: {
+ root.eventSignal.connect(showEvents);
+ if (calendartab.calendartabstatus=="Events"){showEvents("")}
+ }
+ }
diff --git a/source-android/qml/calendarqml/EventList.qml b/source-android/qml/calendarqml/EventList.qml
new file mode 100644
index 0000000..8632657
--- /dev/null
+++ b/source-android/qml/calendarqml/EventList.qml
@@ -0,0 +1,115 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import "qrc:/js/service.js" as Service
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle{
+ id:eventList
+ z:2
+ border.color: "grey"
+ width: parent.width-4*mm
+ height:parent.height-12*mm
+ x:mm
+ y:mm
+ property var daylist:[]
+
+ BlueButton{
+ id:closeButton
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ text: "\uf057"
+ onClicked:{eventList.destroy()}
+ }
+ ListView {
+ id: eventlistView
+ x: mm
+ y:closeButton.height+2*mm
+ width: eventList.width-2*mm
+ height: eventList.height-closeButton.height-4*mm
+ clip: true
+ model: eventModel
+ delegate: eventItem
+ }
+
+ ListModel{
+ id: eventModel
+ }
+
+ Component.onCompleted:{
+ for (var i=0; i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.7
+import QtQuick.Dialogs 1.2
+import QtQuick.Controls 1.2
+
+import "qrc:/js/service.js" as Service
+import "qrc:/js/layout.js" as Layoutjs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/configqml"
+import "qrc:/qml/genericqml"
+
+StackView{
+ id: configStack
+ anchors.fill:parent
+ initialItem: Flickable{
+ width:root.width-5*mm
+ height:root.height-12*mm
+ contentHeight: configBackground.height
+ boundsBehavior: Flickable.StopAtBounds
+
+ Rectangle{
+ id:configBackground
+ color: "white"
+ width:parent.width
+ height:Math.max(90*mm,root.height-12*mm)
+ property var users:[]
+ property bool registeredUser: true
+ property var userdata: ({})
+
+ function setServericon(server){
+ try {Helperjs.friendicaWebRequest(server+"/api/statusnet/config",configBackground, function (obj){
+ var serverdata = JSON.parse(obj);
+ servericon.visible=true;
+ servericon.source=serverdata.site.logo})} catch(e){print(e)}
+ }
+
+ BlueButton{
+ id:userButton
+ text:qsTr("User")
+ y:mm
+ width: root.width/2
+ onClicked:{
+ var useritems="";
+ for (var i=0;i
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,41 +29,40 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
+import QtQuick 2.0
+import QtQuick.Controls 1.2
import "qrc:/qml/genericqml"
-Page{
+Rectangle{
+ color:"white"
+ width:infoBoxText.contentWidth
+ height:infoBoxText.contentHeight
Text{id:infoBoxText
anchors.top:closeButton.bottom
anchors.topMargin: mm
textFormat: Text.RichText
- width: root.width-mm
- font.pointSize: osSettings.systemFontSize
- color: osSettings.primaryTextColor
+ width: parent.width
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
- text: "Friendiqa v0.6.9 Licensed under GPL 3 with the exception of OpenSSL "+
- "Website https://friendiqa.ma-nic.de "+
+ text: "Friendiqa v0.3.1 Licensed under GPL 3 with the exception of OpenSSL "+
+ "Profile https://freunde.ma-nic.de/profile/friendiqa "+
"Sourcecode: https://git.friendi.ca/LubuWest/Friendiqa "+
- "Privacy Policy: http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md "+
- "Code by Marco "+
- "Qt Framework www.qt.io "+
- "Icons by Fork Awesome "+
- "AndroidNative by Ben Lau "+
- "This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"
- onLinkActivated:{
+ "Most of C++ code by Fabio "+
+ "QML and Javascript code by Marco "+
+ "Qt Framework www.qt.io "+
+ "Icons by FontAwesome "+
+ "Folder Icon by KDE Breeze Icons "+
+ "AndroidNative by Ben Lau "+
+ "This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ onLinkActivated:{
Qt.openUrlExternally(link)}
- }
- MButton{
- id:closeButton
- anchors.top: parent.top
- anchors.topMargin: root.fontFactor*osSettings.bigFontSize
- anchors.right: parent.right
- anchors.rightMargin: 1*mm
- text: qsTr("Close")
- display: AbstractButton.IconOnly
- icon.name: "dialog-close"
- icon.source: "qrc:/assets/icons/times-circle.svg"
- onClicked:{rootstackView.pop()}
- }
+ }
+ BlueButton{
+ id:closeButton
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ text: "\uf057"
+ onClicked:{configStack.pop()}
+ }
}
diff --git a/src/qml/genericqml/MButton.qml b/source-android/qml/configqml/OSSettingsAndroid.qml
similarity index 69%
rename from src/qml/genericqml/MButton.qml
rename to source-android/qml/configqml/OSSettingsAndroid.qml
index b2c8cea..0974706 100644
--- a/src/qml/genericqml/MButton.qml
+++ b/source-android/qml/configqml/OSSettingsAndroid.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -28,21 +28,16 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
-Button{
- id: mButton
- //property alias color: bg.color
- width: Math.max(implicitContentWidth+2*mm,3*root.fontFactor*osSettings.bigFontSize)
- //radius: mm
- height: 2*root.fontFactor*osSettings.bigFontSize
- //color: Material.foreground
- //font.family: fontAwesome.name
- font.pointSize: osSettings.bigFontSize
- //highlighted:true
- icon.width: root.fontFactor*osSettings.bigFontSize
- icon.height: root.fontFactor*osSettings.bigFontSize
- // background: Rectangle{id:bg;color: osSettings.dialogColor;
- // radius: 0.5*mm}
+import QtQuick.Window 2.0
+import QtQuick 2.0
+QtObject{
+ property int appWidth: Screen.desktopAvailableWidth
+ property int appHeight: Screen.desktopAvailableHeight
+ property int backKey: Qt.Key_Back
+ //property string attachImageDir:filesystem.cameraPath+"/"
+ property string imagePickQml: "ImagePicker"
+ property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
+ imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+
+ 'attachImage(imageUrl)}}'
}
diff --git a/src/qml/genericqml/LeftDrawerAndroid.qml b/source-android/qml/configqml/OSSettingsLinux.qml
similarity index 79%
rename from src/qml/genericqml/LeftDrawerAndroid.qml
rename to source-android/qml/configqml/OSSettingsLinux.qml
index 8387fc1..adde0c6 100644
--- a/src/qml/genericqml/LeftDrawerAndroid.qml
+++ b/source-android/qml/configqml/OSSettingsLinux.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,14 +29,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
-import "qrc:/qml/configqml"
-
-Drawer{
- id: leftDrawer
- width: root.fontFactor*osSettings.systemFontSize*13
- height: root.height
- background: Rectangle{color: osSettings.backgroundColor}
- LeftDrawerScrollview{}
+import QtQuick 2.0
+QtObject{
+ property real appWidth: 500
+ property real appHeight: 500
+ property int backKey: Qt.Key_Escape
+ //property string attachImageDir:filesystem.homePath+"/Pictures/"
+ property string imagePickQml: "ImagePickerLinux"
}
diff --git a/source-android/qml/contactqml/ContactComponent.qml b/source-android/qml/contactqml/ContactComponent.qml
new file mode 100644
index 0000000..0231094
--- /dev/null
+++ b/source-android/qml/contactqml/ContactComponent.qml
@@ -0,0 +1,88 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.3
+import "qrc:/qml/genericqml"
+
+Item {
+id: contactComponent
+property var createdAtDate: new Date(contact.created_at)
+property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( ""+qsTr("Connect")+" ")
+
+Rectangle {
+ id: wrapper
+ width: 16*mm
+ height: 15*mm
+ border.color: "grey"
+ color:"white"
+ Image {
+ id: photoImage
+ x:1
+ y:1
+ width: 10*mm
+ height:10*mm
+ source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
+ onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
+ }
+
+ Label {
+ id: namelabel
+ x: 1
+ width: wrapper.width-4
+ height: 3*mm
+ text: contact.screen_name
+ elide:Text.ElideRight
+ anchors.topMargin: 0
+ anchors.left: photoImage.left
+ color: "#303030"
+ font.pixelSize: 3*mm
+ anchors.top: photoImage.bottom
+ }
+ BlueButton{
+ id:infobutton
+ width: 5*mm
+ height: 5*mm
+ color:"transparent"
+ text:"?"
+ anchors.left: photoImage.right
+ anchors.leftMargin: 0.5*mm
+ anchors.topMargin: mm
+ anchors.top: parent.top
+ onClicked:{
+ var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
+ if (component.status== Component.Ready){
+ var contactDetails = component.createObject(friendstab,{"contact": contact})}
+ }
+ }
+ }
+
+}
diff --git a/source-android/qml/contactqml/ContactDetailsComponent.qml b/source-android/qml/contactqml/ContactDetailsComponent.qml
new file mode 100644
index 0000000..45d3767
--- /dev/null
+++ b/source-android/qml/contactqml/ContactDetailsComponent.qml
@@ -0,0 +1,167 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.3
+import "qrc:/qml/genericqml"
+
+Item {
+id: contactLargeComponent
+x:mm
+y:mm
+property var contact:({})
+property var createdAtDate: new Date(contact.created_at)
+property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( ""+qsTr("Connect")+" ")
+
+Rectangle {
+ id: wrapper
+
+ width:root.width-2*mm //friendsTabView.width;
+ height:root.height-20*mm// friendsTabView.height-15*mm
+ border.color: "grey"
+ color:"white"
+ Image {
+ id: photoImage
+ x:mm
+ y:mm
+ width: 15*mm
+ height:15*mm
+ source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
+ onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
+ }
+
+ Label {
+ id: namelabel
+ x: mm
+ width: root.width-6*mm //friendsTabView.width-4*mm
+ height: 3*mm
+ text:contact.name+" (@"+contact.screen_name+")"
+ elide:Text.ElideRight
+ anchors.topMargin: 0
+ anchors.left: photoImage.left
+ color: "#303030"
+ font.pixelSize: 4*mm
+ anchors.top: photoImage.bottom
+ }
+Rectangle{
+ id: detailsrectangle
+ anchors.top: namelabel.bottom
+ anchors.topMargin: 2*mm
+
+ ScrollView{
+ horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
+ frameVisible: true
+ id:namelabelflickable
+ width: root.width-10*mm
+ height:root.height-50*mm
+ x: mm
+ clip:true
+ Text{
+ id:namelabeltext
+ width: namelabelflickable.width
+ height: implicitHeight
+ font.pixelSize: 3*mm
+ textFormat:Text.RichText
+ wrapMode: Text.Wrap
+ text:""+qsTr("Description")+": "+contact.description+" "+qsTr("Location")+": "+contact.location+" "+qsTr("Posts")+": "+contact.statuses_count+
+ " "+qsTr("URL")+":"+contact.url+" "+
+ connectUrl+ ""+qsTr("Created at")+": "+createdAtDate.toLocaleString(Qt.locale())
+ onLinkActivated: {
+ Qt.openUrlExternally(link)}
+ }
+ }
+
+ Row{
+ anchors.top: namelabelflickable.bottom
+ anchors.topMargin: 2*mm
+ x: mm
+ spacing:4
+
+ BlueButton{
+ id:photobutton
+ text: "\uf03e" // "Photos"
+ visible:(contact.network=="dfrn")
+ onClicked:{
+ fotostab.phototabstatus="Contact";
+ root.currentIndex=2;
+ fotostab.active=true;
+ root.fotoSignal(root.login,contact) ;
+ contactLargeComponent.destroy();
+ }
+ }
+
+ BlueButton{
+ id:messagebutton
+ text: "\uf0e6" //"Messages"
+ onClicked:{
+ root.currentIndex=0;
+ //newstab.active=true;
+ root.messageSignal(contact) ;
+ contactLargeComponent.destroy();
+ }
+ }
+
+ BlueButton{
+ id:dmbutton
+ visible: (contact.following=="true")
+ text: "\uf040" //"DM"
+ onClicked:{
+ root.currentIndex=0;
+ //newstab.active=true;
+ root.directmessageSignal(contact.screen_name);
+ contactLargeComponent.destroy();
+ }
+ }
+
+
+ BlueButton{
+ id:eventbutton
+ visible:(contact.network=="dfrn")
+ text:"\uf073"
+ onClicked:{
+ root.currentIndex=3;
+ calendartab.active=true;
+ calendartab.calendartabstatus="Friend"
+ root.eventSignal(contact);
+ contactLargeComponent.destroy();
+ }
+ }
+
+ BlueButton{
+ id: closeButton
+ text: "\uf057" //"close"
+ onClicked:{contactLargeComponent.destroy();
+ }
+ }
+ }
+ }
+}
+}
diff --git a/src/qml/contactqml/Contactlist.qml b/source-android/qml/contactqml/Contactlist.qml
similarity index 52%
rename from src/qml/contactqml/Contactlist.qml
rename to source-android/qml/contactqml/Contactlist.qml
index 8c0b2cb..8e8250e 100644
--- a/src/qml/contactqml/Contactlist.qml
+++ b/source-android/qml/contactqml/Contactlist.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,8 +30,7 @@
// along with this program. If not, see .
// List of people
-import QtQuick 6.3
-import QtQuick.Controls 6.3
+import QtQuick 2.0
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@@ -47,41 +46,41 @@ Rectangle {
height:groupListView.height
ListView {
- id: contactView
- x:mm
- y:6*mm
- width: contactlistRectangle.width-2*mm
- height: contactlistRectangle.height-10*mm
- clip: true
- spacing: 0
- model: contactModel
- delegate: listContact
- }
+ id: contactView
+ x:mm
+ y:6*mm
+ width: contactlistRectangle.width-2*mm
+ height: contactlistRectangle.height-10*mm
+ clip: true
+ spacing: 0
+ model: contactModel
+ delegate: listContact
+ }
- ListModel{id: contactModel}
+ ListModel{id: contactModel}
- Component { id:listContact
- Rectangle{
- border.color: "#EEEEEE"
- border.width: 1
- radius:0.5*mm
- width:contactView.width
- height:6*mm
- Image {
- id: contactImage
- x:1
- y:1
- width: 5*mm
- height:5*mm
- source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
- onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/assets/defaultcontact.jpg"}
- }
- Text{
- font.pointSize: osSettings.bigFontSize
- anchors.left: contactImage.right
- anchors.margins: 1*mm
- text:Qt.atob(contact.name)
- }
+ Component { id:listContact
+ Rectangle{
+ border.color: "#EEEEEE"
+ border.width: 1
+ radius:0.5*mm
+ width:contactView.width
+ height:6*mm
+ Image {
+ id: contactImage
+ x:1
+ y:1
+ width: 5*mm
+ height:5*mm
+ source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
+ onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
+ }
+ Text{
+ font.pixelSize: 3*mm
+ anchors.left: contactImage.right
+ anchors.margins: 1*mm
+ text:Qt.atob(contact.name)
+ }
Text {
id:selected
anchors.right:parent.right
@@ -91,40 +90,38 @@ Rectangle {
width: 5*mm
anchors.top: parent.top
color: "green"
- font.pointSize: osSettings.bigFontSize
+ font.pixelSize: 3*mm
}
- MouseArea{
+ MouseArea{
anchors.fill: parent
onClicked:{
if(selected.visible==true){
- contacts.splice(Helperjs.inArray(contacts,"id",contact.id),1);
- selected.visible=false
- }
- else{
- contacts.push(contact);
- selected.visible=true;
- }
- }
+ contacts.splice(Helperjs.inArray(contacts,"id",contact.id),1);
+ selected.visible=false
+ }
+ else{
+ contacts.push(contact);
+ selected.visible=true;
+ }
+ }
+ }
}
- }
- }
+ }
- MButton {
- id: closeButton
- anchors.top: parent.top
- anchors.topMargin: 1*mm
- anchors.right: parent.right
- anchors.rightMargin: 1*mm
- text: qsTr("Close")
- display: AbstractButton.IconOnly
- icon.name: "dialog-close"
- icon.source: "qrc:/assets/icons/times-circle.svg"
- onClicked: {
- groupModelAppend(contacts,function(){
- contactlistRectangle.destroy()
- });
- }
+ BlueButton {
+ id: closeButton
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ color:"white"
+ text: "\uf057"
+ onClicked: {
+ groupModelAppend(contacts,function(){
+ contactlistRectangle.destroy()
+ });
+ }
}
Component.onCompleted: {
diff --git a/source-android/qml/contactqml/FriendsTab.qml b/source-android/qml/contactqml/FriendsTab.qml
new file mode 100644
index 0000000..db32907
--- /dev/null
+++ b/source-android/qml/contactqml/FriendsTab.qml
@@ -0,0 +1,361 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.4
+import QtQuick.LocalStorage 2.0
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/js/news.js" as Newsjs
+import "qrc:/js/service.js" as Service
+import "qrc:/qml/contactqml"
+import "qrc:/qml/genericqml"
+
+Rectangle {
+ y:1
+ color: "white"
+
+ function showContactdetails(contact){
+ var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
+ if(contact.isFriend){
+ friendsTabView.currentIndex=1;
+ var contactDetails = component.createObject(friendstab,{"contact": contact})
+ }
+ else{friendsTabView.currentIndex=2;
+ var contactDetails = component.createObject(friendstab,{"contact": contact})
+ }
+ }
+
+ function showProfile(callback){
+ var profile=({});
+ Helperjs.readData(db,"profiles",login.username,function(profileobject){
+ var profilearray=[];
+ for (var i in profileobject){
+ profilearray.push(JSON.parse(Qt.atob(profileobject[i].profiledata)));
+ }
+ profile.profiles=profilearray;
+ });
+ Helperjs.readData(db,"contacts",login.username,function(owner){
+ profile.friendica_owner=owner[0];
+ },"isFriend",2);
+ callback(profile)
+ }
+
+ TabView{
+ id:friendsTabView
+ tabPosition: Qt.TopEdge
+ x:mm
+ y:mm
+ width: root.width-2*mm
+ height: root.height-10*mm
+ currentIndex: 1
+ signal contactsSignal(var contact)
+ signal groupsSignal(var username)
+ onCurrentIndexChanged:{
+ if (currentIndex==1){
+ contactsSignal("")
+ }
+ else if (currentIndex==2){
+ contactsSignal("")
+ }
+ else if (currentIndex==3){groupsSignal(root.login.username)}
+ }
+ style: TabViewStyle {
+ frameOverlap: 1
+ tab: Rectangle {
+ color: "white"
+ implicitWidth: root.width/4-2*mm
+ implicitHeight: 4*mm
+ Text { id: text
+ anchors.centerIn: parent
+ text: styleData.title
+ color: "dark grey"
+ font.pixelSize:2.5*mm
+ font.bold: styleData.selected
+ }
+ }
+ frame: Rectangle { color: "light grey" }
+ tabsAlignment:Qt.AlignHCenter
+ }
+
+ Tab{
+ id:profileGridTab
+ title: qsTr("Me")
+ Component.onCompleted:{
+ showProfile(function(profile){
+ var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
+ var profilecomp = component.createObject(profileGridTab,{"profile": profile});
+ });
+ }
+ }
+
+ Tab{
+ title: qsTr("Friends")
+ Rectangle{
+ id: friendsGridTab
+ property int currentContact:0
+ function showFriends(contact){
+ try {friendsModel.clear()} catch(e){print(e)};
+ Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
+ for (var i=0;i1){
+ friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
+ }
+ friendsModel.append({"contact":friendsobject[i]});
+ }
+ },"isFriend",1,"screen_name ASC");
+ }
+ Connections{
+ target:xhr
+ onDownloaded:{
+ if(type=="contactlist"){
+ //print(url+" "+filename+" "+i)
+ currentContact=i+1;
+ if(currentContact==root.newContacts.length){showFriends(root.login.username)}
+ }
+ }
+ }
+ BlueButton {
+ id: updateFriendsButton
+ text: "\uf021"
+ anchors.top: parent.top
+ anchors.topMargin: mm
+ anchors.right: parent.right
+ onClicked: {
+ try {friendsModel.clear()} catch(e){print(e)};
+ root.contactLoadType="friends";
+ Newsjs.requestFriends(root.login,db,root,function(nc){
+ root.newContacts=nc
+ })
+ }
+ }
+
+ ProgressBar{
+ id: newContactsProgress
+ width: 15*mm
+ height: updateFriendsButton.height
+ anchors.top: parent.top
+ anchors.right:updateFriendsButton.left
+ anchors.rightMargin:mm
+ visible: (currentContact!=(root.newContacts.length))?true:false
+ value: currentContact/root.newContacts.length
+ }
+
+ GridView {
+ id: friendsView
+ x:mm
+ y:updateFriendsButton.height+2*mm
+ width:friendsGridTab.width-2*mm
+ height:friendsGridTab.height-updateFriendsButton.height-2*mm
+ clip: true
+ cellHeight: 16*mm
+ cellWidth: 17*mm
+ //add: Transition {
+ // NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
+ // }
+ model: friendsModel
+ delegate: ContactComponent { }
+ }
+
+ ListModel{id:friendsModel}
+
+ Component.onCompleted: {
+ root.friendsSignal.connect(showFriends);
+ friendsTabView.contactsSignal.connect(showFriends);
+ showFriends(root.login.username);
+ root.newContacts=[]
+ }
+ }
+ }
+
+ Tab{
+ title: qsTr("Contacts")
+
+ Rectangle{
+ id: contactsGridTab
+ function showContacts(contact){
+ try {contactsModel.clear()} catch(e){print(e)};
+ Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
+ for (var j=0;j
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/js/news.js" as Newsjs
+import "qrc:/qml/genericqml"
+
+Item {
+ id: groupComponent
+ property var groupmembers:[]
+ //property bool newGroup: false
+ function groupModelAppend(groupcontacts,callback){
+ for (var n in groupcontacts){
+ groupModel.append({"groupmember":groupcontacts[n]});}
+ callback()
+ }
+
+ Rectangle {
+ id: wrapper
+ width: 16*mm
+ height: 15*mm
+ border.color: "grey"
+ color:"white"
+
+ Image {
+ id: photoImage
+ x:1
+ y:1
+ width: 10*mm
+ height:10*mm
+ source:"qrc:/images/defaultcontact.jpg"
+ }
+ Rectangle{
+ id:namelabelRect
+ x: 1
+ width: wrapper.width-2
+ height: 3.5*mm
+ anchors.top: photoImage.bottom
+ border.color: "light grey"
+ TextInput {
+ id: namelabel
+ anchors.fill: parent
+ readOnly: true
+ text: group.new?"":group.groupname
+ color: "#303030"
+ font.pixelSize: 3*mm
+
+ }
+ }
+ BlueButton{
+ id:infobutton
+ width: 5*mm
+ height: 5*mm
+ color:"transparent"
+ text:"?"
+ anchors.left: photoImage.right
+ anchors.leftMargin: 3
+ anchors.topMargin: 3
+ anchors.top: parent.top
+ onClicked:{
+ //if(group.new){
+ Helperjs.readField("members",root.db,"groups",root.login.username,function(groups){
+ try {groupModel.clear()}catch (e){print(e)}
+ groupmembers=JSON.parse(groups);
+ for (var user in groupmembers){
+ Helperjs.readData(root.db,"contacts",root.login.username,function(userdata){
+ if (userdata[0]){groupModel.append({"groupmember":userdata[0]})}
+ },"id",groupmembers[user])
+ } //catch(e){}
+ },"groupname",group.groupname);
+ //}
+ groupComponent.state="large"
+ }
+ }
+
+ Rectangle{
+ id: detailsrectangle
+ anchors.top: namelabelRect.bottom
+ anchors.topMargin: 2*mm
+ opacity: 0
+
+ Component {
+ id:groupMember
+ Rectangle{
+ width:parent.width
+ height:6*mm
+ Rectangle{id:memberrectangle
+ border.color: "#EEEEEE"
+ border.width: 1
+ width:parent.width-12*mm
+ height:6*mm
+ Image {
+ id: memberImage
+ x:1
+ y:1
+ width: 5*mm
+ height:5*mm
+ source:(groupmember.isFriend==1)? "file://"+groupmember.profile_image :groupmember.profile_image_url
+ onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
+ }
+ Text{
+ font.pixelSize: 3*mm
+ anchors.left: memberImage.right
+ anchors.margins: 1*mm
+ width:parent.width-1
+ text:Qt.atob(groupmember.name)
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked:{
+ root.currentIndex=1;
+ friendstab.active=true;
+ root.contactdetailsSignal(groupmember)
+ }
+ }
+ // BlueButton{
+ // anchors.left: memberrectangle.right
+ // anchors.margins: 1*mm
+ // text: "\uf056"
+ // onClicked:{
+ // groupModel.remove(index)
+ // }
+ // }
+ }
+ }
+ }
+
+ ListView{
+ id: groupListView
+ x:1
+ //anchors.top: parent.top
+ width: root.width-10*mm
+ height:groupsView.height -31*mm
+ clip: true
+ spacing: 2
+ model: groupModel
+ delegate: groupMember
+ }
+
+ ListModel{id: groupModel}
+
+ Row{
+ anchors.top: groupListView.bottom
+ anchors.topMargin: mm
+ spacing: mm
+ BlueButton{
+ id: closeButton
+ text: "\uf057"
+ onClicked:{groupComponent.state="";
+ if (group.new){groupsModel.remove(index)}
+ }
+ }
+
+// BlueButton{
+// id: addMembers
+// text:"\uf234"
+// onClicked: {
+// Newsjs.listFriends(root.login,root.db,function(userdata){
+// var newlistcontacts=[];
+// for (var n in userdata){
+// if (groupmembers.indexOf(userdata[n].id)==-1){
+// newlistcontacts.push(userdata[n])
+// }
+// }
+// var component = Qt.createComponent("qrc:/qml/contactqml/Contactlist.qml");
+// var contactlistobject = component.createObject(groupListView,{"possibleUsers":newlistcontacts});
+
+// })
+// }
+// }
+
+// BlueButton{
+// id: updateButton
+// text: "\uf0ee"
+// onClicked:{
+// var groupobject={};
+// var groupmembers=[];
+// for (var i=0;i
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,23 +29,23 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
+import QtQuick 2.0
+import QtQuick.Controls 1.3
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service
Rectangle {
-// width:parent.width-2*mm
-// height:parent.height-14*mm
- anchors.fill:parent
- color: osSettings.backgroundColor
+ width:root.width-2*mm
+ height:root.height-14*mm
+ color:"white"
property var profile:({})
property var attachImageURLs:[]
property var createdAtDate: new Date(profile.friendica_owner.created_at)
function updateProfileImage(){
- xhr.setAccount(login);
- xhr.setApi("/api/account/update_profile_image.json");
+ xhr.url= login.server + "/api/account/update_profile_image.json";
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.clearParams();
xhr.setImageFileParam("image", photoImage.source );
xhr.post();
}
@@ -53,8 +53,8 @@ Rectangle {
function buildProfiletext(pobject,callback){
var profileobject={};
var profiletext="";
- for (var key in pobject){
- if(pobject[key]!=""&&pobject[key]!=null&&key!="users"&&key!="profile_id"){
+ for (var key in pobject){//print(key+obj[key])
+ if(pobject[key]!=""&&key!="users"&&key!="profile_id"){
var keytext="";
switch(key){
case "profile_name":keytext=qsTr("profile name");break;
@@ -94,39 +94,23 @@ Rectangle {
case "education":keytext=qsTr("education");break;
case "social_networks":keytext=qsTr("social networks");break;
case "homepage":keytext=qsTr("homepage");break;
- case "custom_fields":keytext=qsTr("other");break;
default:keytext=key;
}
- if (key=="custom_fields"){
- var customObject=pobject[key];
- for (var customkey in customObject){
- profiletext=profiletext+(""+customObject[customkey].label+": "+(customObject[customkey].value)+" ");}
- }else if(key=="homepage" || key=="profile_photo" || key=="profile_thumb"){
- profiletext=profiletext+(""+keytext+": "+(pobject[key])+" ");
- }
- else{
- profiletext=profiletext+(""+keytext+": "+(pobject[key])+" ");
- }
+ profiletext=profiletext+(""+keytext+": "+(pobject[key])+" ");
}
}
callback(profiletext)
}
- MButton {
+ BlueButton {
id: update
anchors.top: parent.top
anchors.topMargin: mm
anchors.right: parent.right
- anchors.rightMargin: menuButton.width
- text: qsTr("refresh")
- display: AbstractButton.IconOnly
- icon.name: "view-refresh-symbolic"
- icon.source: "qrc:/assets/icons/refresh.svg"
- font.pointSize: osSettings.bigFontSize
+ text: "\uf021"
onClicked: {
Service.requestProfile(root.login,root.db,root,function(nc){
root.newContacts=nc;
- root.onNewContactsChanged(nc);
photoImage.source="";
showProfile(function(newprofile){
profile=newprofile;
@@ -148,60 +132,48 @@ Rectangle {
Image {
id: photoImage
- anchors.top: parent.top
- anchors.topMargin: mm
- anchors.left: parent.left
+ x:mm
+ y:mm
width: 15*mm
height:15*mm
source: "file://"+profile.friendica_owner.profile_image
- onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/assets/defaultcontact.jpg"}
+ onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
MouseArea{
anchors.fill: parent
onClicked:{
- imagePicking=true;
- var imagePicker = Qt.createQmlObject('import QtQuick 6.3; import "qrc:/qml/genericqml";'+
+ var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
- '}}',profileTab,"imagePicker");
+ '}}',profileGridTab,"imagePicker");
imagePicker.pickImage()
}
}
}
-// Rectangle{
-// id:phototextRectangle
-// color:"black"
-// z:3
-// opacity: 0.5
-// width:6*mm
-// height: phototext.contentHeight
-// anchors.top: photoImage.top
-// anchors.right: photoImage.right
-// }
-// Text {
-// id:phototext
-// z:4
-// font.family: fontAwesome.name
-// text: "\uf040"
-// width:5*mm
-// anchors.top: photoImage.top
-// anchors.right:photoImage.right
-// color: "white"
-// font.pointSize: 1.2*osSettings.bigFontSize
-// }
- Image{
+ Rectangle{
+ id:phototextRectangle
+ color:"black"
+ z:3
+ opacity: 0.5
+ width:6*mm
+ height: phototext.contentHeight
+ anchors.top: photoImage.top
+ anchors.right: photoImage.right
+ }
+ Text {
+ id:phototext
z:4
- source: "qrc:/assets/icons/pencil.svg"
- width: root.fontFactor*osSettings.systemFontSize
- height: root.fontFactor*osSettings.systemFontSize
+ text: "\uf040"
+ width:5*mm
anchors.top: photoImage.top
anchors.right:photoImage.right
-
+ color: "white"
+ font.pixelSize: 4*mm
}
- MButton{
+
+ BlueButton{
id:updatebutton
- width: 8*root.fontFactor*osSettings.bigFontSize
+ height: 5*mm
visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source
text:qsTr("Update")
- font.pointSize: osSettings.bigFontSize
anchors.left: photoImage.right
anchors.leftMargin: 0.5*mm
anchors.topMargin: mm
@@ -211,15 +183,15 @@ Rectangle {
Label {
id: namelabel
x: mm
- width: parent.width-6*mm
+ width: root.width-6*mm
height: 3*mm
text:(Qt.atob(profile.friendica_owner.name))+" (@"+profile.friendica_owner.screen_name+")"
elide:Text.ElideRight
anchors.topMargin: 0
anchors.left: photoImage.left
wrapMode: Text.Wrap
- color: osSettings.secondaryTextColor
- font.pointSize: osSettings.bigFontSize
+ color: "#303030"
+ font.pixelSize: 4*mm
anchors.top: photoImage.bottom
}
@@ -229,13 +201,12 @@ Rectangle {
Rectangle{
id:profileRect
width:profileView.width
- color: osSettings.backgroundColor
height: 5*mm+profiletextfield.height
Text{
y:mm
- font.pointSize: osSettings.systemFontSize
+ font.pixelSize: 3*mm
text:""+qsTr("profile id")+": "+profileid+" "
- color:osSettings.primaryTextColor
+ color:"black"
}
Text{
id:profiletextfield
@@ -243,10 +214,9 @@ Rectangle {
y:4.5*mm
width:parent.width-2.5*mm
wrapMode: Text.Wrap
- font.pointSize: osSettings.systemFontSize
+ font.pixelSize: 3*mm
text:profiletext
- color: osSettings.primaryTextColor
- onLinkActivated: Qt.openUrlExternally(link)
+ color:"black"
}
}
}
@@ -254,13 +224,12 @@ Rectangle {
id:textcomponent
Text{
id:namelabeltext
- color: osSettings.primaryTextColor
width: namelabelflickable.width
height: implicitHeight
- font.pointSize: osSettings.bigFontSize
+ font.pixelSize: 3*mm
textFormat:Text.RichText
wrapMode: Text.Wrap
- text:""+qsTr("Description")+": "+(Qt.atob(profile.friendica_owner.description))+" "+qsTr("Location")+": "+profile.friendica_owner.location+" "+qsTr("Posts")+": "+profile.friendica_owner.statuses_count+
+ text:""+qsTr("Description")+": "+(profile.friendica_owner.description)+" "+qsTr("Location")+": "+profile.friendica_owner.location+" "+qsTr("Posts")+": "+profile.friendica_owner.statuses_count+
" "+qsTr("URL")+":"+profile.friendica_owner.url+" "+
""+qsTr("Created at")+": "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: {
@@ -268,25 +237,32 @@ Rectangle {
}
}
+ Rectangle{
+ id: detailsrectangle
+ anchors.top: namelabel.bottom
+ anchors.topMargin: 2*mm
+
ScrollView{
- ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
+ horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
+ frameVisible: true
id:namelabelflickable
- anchors.top: namelabel.bottom
- anchors.topMargin: 2*mm
- width: parent.width-mm
- height:parent.height-22*mm//friendsTabView.height-45*mm
+ width: root.width-10*mm
+ height:root.height-36*mm//friendsTabView.height-45*mm
x: mm
clip:true
ListView {
id: profileView
header:textcomponent
+ width:root.width-10*mm
+ height: root.height
+ clip: true
spacing: 0
model: profileModel
delegate: profileItem
}
}
-
+ }
Component.onCompleted: {
profile.profiles.sort(function(obj1, obj2) {
diff --git a/source-android/qml/friendiqa.qml b/source-android/qml/friendiqa.qml
index e9c5227..20cbf79 100644
--- a/source-android/qml/friendiqa.qml
+++ b/source-android/qml/friendiqa.qml
@@ -1,5 +1,5 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
+// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
@@ -29,59 +29,51 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 2.5
+import QtQuick 2.0
import QtQuick.LocalStorage 2.0
import QtQuick.Window 2.0
-import QtQuick.Controls 2.4
-import QtQuick.Controls.Material 2.12
-import QtQuick.Layouts 1.11
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.4
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service
import "qrc:/qml/genericqml"
-ApplicationWindow{
+TabView{
id:root
- title: "Friendiqa"
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
- visible: true
+ //IntentReceiver{}
+ tabPosition: Qt.BottomEdge
+ width: osSettings.appWidth
+ height:osSettings.appHeight
+ focus:true
+
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
property var login: Service.readActiveConfig(db)
- property var globaloptions: Service.readGO(db)
- property real fontFactor: root.font.pixelSize/root.font.pointSize
property var contactlist: []
- property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
- property bool wideScreen : width>height
- signal fotoSignal(var username, var friend)
+ property real mm: Screen.pixelDensity
+ signal messageSignal(var friend)
+ signal fotoSignal(var login, var friend)
signal directmessageSignal(var friend)
signal newsSignal(var news)
- signal newstypeSignal(var type)
signal friendsSignal(var username)
signal contactdetailsSignal(var contact)
- signal contactRefreshSignal()
- signal searchSignal (var searchterm)
signal eventSignal(var contact)
- signal eventcreateSignal(var event)
signal uploadSignal(var urls)
signal sendtextSignal(var intenttext)
- signal changeimage(var method, var type, var id)
- signal updateSyncinterval(int interval)
- signal replySignal(var newsobject)
+
property var news:[]
property var newContacts:[]
- property var contactposts:[]
- //property string contactLoadType: ""
- property bool imagePicking: false
+ property string contactLoadType: ""
- Material.theme: Material.System
-
- function onLoginChanged(login){
- if(login=="" || login==null){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
+ onLoginChanged:{
+ if(login==""){root.currentIndex=4}
else{
+ newstab.newstabstatus=login.newsViewType;
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts})}
}
- function onNewContactsChanged(newContacts){
+ onNewContactsChanged:{
if(newContacts.length>0){// download contact images and update db
var contacturls=[];
var contactnames=[];
@@ -96,37 +88,23 @@ ApplicationWindow{
xhr.setContactlist(contactnames);
xhr.setImagedir(login.imagestore);
xhr.getlist();
+// Service.processNews(function(){
+// root.contactLoadType="";
+// root.news=[];
+// })
}
-
+// else if (contactLoadType!=""){
+// Service.processNews(function(){
+// root.contactLoadType="";
+// root.news=[];
+// })}
}
- Connections {
- target: root
- function onWidthChanged(appWidth) {
- if(osSettings.osType=="Linux" && Math.abs(appWidth-(globaloptions.appWidth||0))>50){
- Service.updateglobaloptions(db,"appWidth",appWidth)
- }
- }
- }
- Connections {
- target: root
- function onHeightChanged(appHeight) {
- if(osSettings.osType=="Linux" && Math.abs(appHeight-(globaloptions.appHeight||0))>50){
- Service.updateglobaloptions(db,"appHeight",appHeight)
- }
- }
- }
-
-
- function showContact(contact){
- rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
- }
-
-
Connections{
target:xhr
- function onDownloaded(type,url,filename,i){
+ onDownloaded:{
if(type=="contactlist"){
+ //print("contact image saved"+Date.now()+" "+filename+" "+url);
var database=LocalStorage.openDatabaseSync(root.db[0],root.db[1],root.db[2],root.db[3]);
var result;
database.transaction( function(tx) {
@@ -136,142 +114,87 @@ ApplicationWindow{
}
}
-
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
- onClosing: {
- if (rootstack.currentIndex==0){
+ Keys.onReleased: {
+ if (event.key === osSettings.backKey) {
+ if (currentIndex==0){
newstab.active=true;
- if ((newstab.newstabstatus!="") && (newstab.newstabstatus!=globaloptions.newsViewType)&&(globaloptions.newsViewType!=null)){
- newstab.newstabstatus=globaloptions.newsViewType;
- if(globaloptions.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
+ if (newstab.newstabstatus!=login.newsViewType){
+ newstab.newstabstatus=login.newsViewType;
+ if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){
newsSignal(dbnews)
})}
else{
- Newsjs.chatsfromdb(db,login.username,0,function(dbnews){
+ Newsjs.chatsfromdb(db,login.username,function(dbnews){
newsSignal(dbnews)
})}
- close.accepted=false;
- }
-
- else if (newstab.conversation.length>0){
- newstab.conversation=[];
- close.accepted=false
- }
- else if (rootstackView.depth>1){
- rootstackView.pop();
- roottoolbar.visible=true;
- close.accepted=false
- }
- else{
- Service.cleanNews(root.db,function(){
- Service.cleanHashtags(root.db,function(){
- Service.cleanContacts(root.login,root.db,function(){
- Qt.quit()
- })
- })})
- close.accepted=true
}
+ else if (newstab.conversation.length>0){newstab.conversation=[]}
+ else{Service.cleanNews(root.db,function(){
+ Service.cleanContacts(root.login,root.db,function(){
+ Qt.quit()})
+ })}
}
- else if (rootstack.currentIndex==2){fotoSignal(login.username,"backButton");bar.currentIndex=0;close.accepted=false}
- else {rootstack.currentIndex=0;bar.currentIndex=0;close.accepted=false}
+ else if (currentIndex==2){fotoSignal("backButton")}
+ else {currentIndex=0}
+ event.accepted = true
+ }}
+
+
+ style: TabViewStyle {
+ frameOverlap: 1
+ tab: Rectangle {
+ color: styleData.selected?"sky blue":"light blue"
+ //border.color: "light grey"
+ implicitWidth: root.width/5
+ implicitHeight: 5*mm
+ Text { id: text
+ anchors.centerIn: parent
+ text: styleData.title
+ color: "black"
+ font.family: fontAwesome.name
+ font.pixelSize: 3*mm
+ }
+ }
+ frame: Rectangle { color: "light grey" }
+ tabsAlignment:Qt.AlignHCenter
+ }
+
+ Tab{
+ title: "\uf03a"
+ id: newstab
+ property string newstabstatus
+ property var conversation:[]
+ source:(root.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
+ }
+ Tab{
+ title: "\uf0c0"
+ id: friendstab
+ source: (root.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
+ }
+ Tab{
+ title: "\uf03e"
+ id: fotostab
+ property string phototabstatus:"Images"
+ source: (root.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
+ }
+ Tab{
+ title: "\uf073"
+ id: calendartab
+ property string calendartabstatus:"Events"
+ source: (root.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
}
-
-
- footer:ToolBar{id:roottoolbar
- background: Rectangle{
- anchors.fill: parent
- color: Material.backgroundDimColor
- }
-
- TabBar {
- id: bar
- width:parent.width
- onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
- TabButton {
- text: "\uf03a"
- font.pointSize: osSettings.bigFontSize
- background:Rectangle{
- anchors.fill: parent
- color: Material.backgroundDimColor
- }
- }
- TabButton {
- text: "\uf0c0"
- font.pointSize: osSettings.bigFontSize
- background:Rectangle{
- anchors.fill: parent
- color: Material.backgroundDimColor
- }
- }
- TabButton {
- text: "\uf03e"
- font.pointSize: osSettings.bigFontSize
- background:Rectangle{
- anchors.fill: parent
- color: Material.backgroundDimColor
- }
- }
- TabButton {
- text: "\uf073"
- font.pointSize: osSettings.bigFontSize
- background:Rectangle{
- anchors.fill: parent
- color: Material.backgroundDimColor
- }
- }
- }
+ Tab{
+ title:"\uf085"
+ id: configtab
+ source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":""
}
-
- StackView{id:rootstackView
- width:root.width
- height: root.height
- initialItem: StackLayout{
- id:rootstack
- width:rootstackView.width
- height: rootstackView.height
- currentIndex:bar.currentIndex
-
- Loader{
- id: newstab
- property string newstabstatus
- property var conversation:[]
- source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
- //onDoubleClicked:{newstypeSignal("refresh")}
- }
- Loader{
- id: friendstab
- source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
- }
- Loader{
- id: fotostab
- property string phototabstatus:"Images"
- source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
- }
- Loader{
- id: calendartab
- property string calendartabstatus:"Events"
- source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
- }
- }
- }
-
Component.onCompleted: {
- onLoginChanged(login);
- globaloptions=Service.readGO(db);
- if(globaloptions.view_darkmode==1){Material.theme=Material.Dark}
- else if (globaloptions.view_darkmode==2){Material.theme=Material.Light}
- else {Material.theme=Material.System}
- //forceActiveFocus();
- if(osSettings.osType=="Android"){
- var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
- var IntentReceiverQml = component.createObject(root);
- }
- else if (osSettings.osType=="Linux"){
- var component = Qt.createComponent("qrc:/qml/genericqml/LinuxSync.qml");
- var LinuxSyncQml = component.createObject(root);
+ if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
+ var IntentReceiverQml = component.createObject(root)
}
}
}
diff --git a/src/qml/genericqml/BlueButton.qml b/source-android/qml/genericqml/BlueButton.qml
similarity index 81%
rename from src/qml/genericqml/BlueButton.qml
rename to source-android/qml/genericqml/BlueButton.qml
index adbe394..3db1ecc 100644
--- a/src/qml/genericqml/BlueButton.qml
+++ b/source-android/qml/genericqml/BlueButton.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,32 +29,30 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
+import QtQuick 2.0
Rectangle{
id: blueButton
- width: Math.max(mainText.width+2*mm,5*mm)
+ width: Math.max(mainText.width+2*mm,8*mm)
height: 5*mm
- //border.color: "light blue"
- color:"transparent"//"#EFEAEA" "sky blue"
+ color:"light blue"//"#EFEAEA" "sky blue"
property alias fontColor: mainText.color
- border.width:1
+// border.color:"grey"
+// border.width:1
radius: mm
property alias text: mainText.text
property alias font: mainText.font
- property alias fontSize: mainText.font.pointSize
signal clicked
state:""
Text{
id:mainText
- color: osSettings.primaryTextColor
+ color: "black"
anchors.centerIn: parent
width: contentWidth
height: contentHeight
- //font.family:fontAwesome.name
- font.pointSize: osSettings.bigFontSize
+ font.family:fontAwesome.name
+ font.pixelSize: 3*mm
text: ""
- elide: Text.ElideNone
}
MouseArea{
id:buttonArea
@@ -66,7 +64,7 @@ Rectangle{
states: [
State { name: "Pressed"
- PropertyChanges { target: blueButton; color: osSettings.buttonColor} }
+ PropertyChanges { target: blueButton; color: "sky blue"} }
]
transitions: [
Transition { to:"*"
diff --git a/src/qml/genericqml/ImagePicker.qml b/source-android/qml/genericqml/ImagePicker.qml
similarity index 88%
rename from src/qml/genericqml/ImagePicker.qml
rename to source-android/qml/genericqml/ImagePicker.qml
index 2ac69a2..6f1a925 100644
--- a/src/qml/genericqml/ImagePicker.qml
+++ b/source-android/qml/genericqml/ImagePicker.qml
@@ -1,4 +1,4 @@
-import QtQuick 6.3
+import QtQuick 2.0
import AndroidNative 1.0
Item {
@@ -37,9 +37,8 @@ Item {
Connections {
target: SystemDispatcher
- //onDispatched: {
- function onDispatched(type, message){
- if ((type === m_CHOSEN_MESSAGE) && (root.imagePicking==true)) {
+ onDispatched: {
+ if (type === m_CHOSEN_MESSAGE) {
var h=[];
for (var n in message.imageUrls){
h.push("file://"+ decodeURIComponent(message.imageUrls[n]).substring(5))
@@ -47,13 +46,13 @@ Item {
imageUrls=h;
imageUrl=h[0];
ready();
- root.imagePicking=false
}
}
}
Component.onCompleted: {
SystemDispatcher.loadClass("androidnative.ImagePicker");
+ if (root.currentIndex==0){SystemDispatcher.setInitialized();}
}
}
diff --git a/source-android/qml/genericqml/ImagePickerLinux.qml b/source-android/qml/genericqml/ImagePickerLinux.qml
new file mode 100644
index 0000000..c5e3051
--- /dev/null
+++ b/source-android/qml/genericqml/ImagePickerLinux.qml
@@ -0,0 +1,186 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import Qt.labs.folderlistmodel 2.1
+import "qrc:/js/service.js" as Service
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle{
+ id:imageDialog
+ z:2
+ border.color: "grey"
+ width: parent.width-4*mm
+ height:parent.height-12*mm
+ x:2*mm
+ y:10*mm
+ property string directory: ""
+ property bool multiple: false
+ property string imageUrl: ""
+ property var imageUrls: []
+ signal ready();
+ function pickImage() {}
+
+ Text{
+ id:directoryText
+ x:0.5*mm
+ y:0.5*mm
+ width: imageDialog.width-15*mm
+ height:contentHeight
+ wrapMode: Text.Wrap
+ text: directory
+ }
+ BlueButton{
+ id:closeButton
+ anchors.top: parent.top
+ anchors.topMargin: 0.5*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ text: "\uf057"
+ onClicked:{ready();imageDialog.destroy()}
+ }
+
+ ListView {
+ id: imageView
+ x:0.5*mm
+ y: Math.max(directoryText.height, closeButton.height)+mm
+ width: imageDialog.width-2*mm
+ height: imageDialog.height-imageView.y-4*mm
+ clip: true
+ model: imageModel
+ delegate: imageItem
+ }
+
+ FolderListModel{
+ id: imageModel
+ nameFilters: ["*.png", "*.jpg",".jpeg","*.JPG","*.gif"]
+ sortField: FolderListModel.Time
+ sortReversed:false
+ showDotAndDotDot: true
+ showDirs: true
+ showDirsFirst: true
+ folder:directory
+ }
+
+ BusyIndicator{
+ id: imageBusy
+ anchors.horizontalCenter: imageView.horizontalCenter
+ anchors.top:imageView.top
+ anchors.topMargin: 2*mm
+ width:10*mm
+ height: 10*mm
+ running:false
+ }
+
+ Component{
+ id:imageItem
+ Item{
+ width:imageView.width
+ height:folderImage.height+2*mm
+ Rectangle{
+ id:imagetextRectangle
+ color:"black"
+ x:mm
+ z:3
+ opacity: fileIsDir?0:0.5
+ width:imagetext.contentWidth
+ height: imagetext.contentHeight
+ anchors.bottom: folderImage.bottom
+ }
+ Text {
+ id:imagetext
+ x:fileIsDir?11*mm:mm
+ z:4
+ text: fileName
+ width: fileIsDir?parent.width - 12*mm :imageView.width-mm
+ anchors.bottom: folderImage.bottom
+ color: fileIsDir?"black":"white"
+ font.pixelSize: 3*mm
+ wrapMode:Text.Wrap
+ }
+ Text {
+ id:selected
+ anchors.right:parent.right
+ visible: attachImageURLs.indexOf(fileURL)>-1
+ z:4
+ text: "\u2713"
+ width: 10*mm
+ anchors.top: folderImage.top
+ color: "green"
+ font.pixelSize: 10*mm
+ }
+
+ Image{id:folderImage
+ width: fileIsDir?10*mm: imageView.width-mm
+ fillMode:Image.PreserveAspectFit
+ source:fileIsDir?"qrc:/images/folder-blue.png":fileURL
+ }
+
+ MouseArea{
+ anchors.fill: parent
+ onClicked:{
+ if (fileName==".."){
+ imageModel.folder=imageModel.parentFolder;
+ directory=imageModel.parentFolder
+ }
+ else if (fileIsDir){
+ imageModel.folder=fileURL;
+ directory=fileURL
+ }
+ else{
+ if (multiple!=true){
+ //attachImageURLs.push(fileURL);
+ //attachImage(fileURL);
+ imageUrls.push(fileURL);
+ imageUrl=fileURL;
+ ready();
+ imageDialog.destroy()
+ }
+ else {
+ if(selected.visible==true){
+ imageUrls.splice(imageUrls.indexOf(fileURL,1))
+ selected.visible=false
+ }
+ else{
+ imageUrls.push(fileURL);
+ selected.visible=true;
+
+ }
+ imageUrl=fileURL
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/source-android/qml/genericqml/IntentReceiver.qml b/source-android/qml/genericqml/IntentReceiver.qml
new file mode 100644
index 0000000..c39c742
--- /dev/null
+++ b/source-android/qml/genericqml/IntentReceiver.qml
@@ -0,0 +1,43 @@
+import QtQuick 2.0
+import AndroidNative 1.0
+
+Item {
+
+ /// The URL of the image chosen. If multiple images are picked, it will be equal to the first image.
+ property string imageUrl: ""
+
+ /// A list of images chosen
+ property var imageUrls: []
+
+ property string m_TEXT_MESSAGE: "androidnative.TextIntent.chosen";
+ property string m_IMAGE_MESSAGE: "androidnative.ImagePicker.chosen";
+
+
+ Connections {
+ target: SystemDispatcher
+ onDispatched: {
+ if (type === m_IMAGE_MESSAGE) {
+ var h=[];
+ for (var n in message.imageUrls){
+ h.push("file://"+ decodeURIComponent(message.imageUrls[n]).substring(5))
+ }
+ imageUrls=h;
+ if(imageUrls.length==1){
+ root.currentIndex=0;newstab.active=true;
+ root.uploadSignal(imageUrls)
+ } else{
+ root.currentIndex=2;fotostab.active=true;
+ root.uploadSignal(imageUrls)
+ }
+ } else if (type==m_TEXT_MESSAGE){
+ root.currentIndex=0;newstab.active=true;
+ root.sendtextSignal(message)
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ SystemDispatcher.setInitialized();
+ }
+}
+
diff --git a/source-android/qml/genericqml/PermissionDialog.qml b/source-android/qml/genericqml/PermissionDialog.qml
new file mode 100644
index 0000000..61a05cc
--- /dev/null
+++ b/source-android/qml/genericqml/PermissionDialog.qml
@@ -0,0 +1,220 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import "qrc:/js/service.js" as Service
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle{
+ id:permissionDialog
+// x: mm
+ width: parent.width-5*mm
+ height:root.height/3
+ function updatePerms(){
+ for (var i=0;i-1){contactstatus="positive"}
+ else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
+ contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
+ }},"isFriend",1);
+
+ Helperjs.readData(db,"groups",login.username,function(owngroups){
+ for (var number in owngroups){
+ var groupstatus= "neutral";
+ if (group_allow.indexOf(owngroups[number].gid)>-1){groupstatus="positive"}
+ else if (group_deny.indexOf(owngroups[number].gid)>-1){groupstatus="negative"}
+ groupModel.append({"group":owngroups[number],"groupstatus":groupstatus})
+ }});
+ }
+}
diff --git a/src/qml/contactqml/ProfileTab.qml b/source-android/qml/genericqml/Search.qml
similarity index 52%
rename from src/qml/contactqml/ProfileTab.qml
rename to source-android/qml/genericqml/Search.qml
index b16d7b5..d76b2e2 100644
--- a/src/qml/contactqml/ProfileTab.qml
+++ b/source-android/qml/genericqml/Search.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,34 +29,55 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
-import "qrc:/js/helper.js" as Helperjs
-import "qrc:/js/news.js" as Newsjs
-import "qrc:/js/service.js" as Service
-import "qrc:/qml/contactqml"
+import QtQuick 2.7
+import QtQuick.Controls 1.2
import "qrc:/qml/genericqml"
+import "qrc:/js/news.js" as Newsjs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/js/service.js" as Service
-Item{
- id:profileTab
- function showProfile(callback){
- var profile=({});
- Helperjs.readData(db,"profiles",login.username,function(profileobject){
- var profilearray=[];
- for (var i in profileobject){
- profilearray.push(JSON.parse(Qt.atob(profileobject[i].profiledata)));
- }
- profile.profiles=profilearray;
- });
- Helperjs.readData(db,"contacts",login.username,function(owner){
- profile.friendica_owner=owner[0];
- },"isFriend",2);
- callback(profile)
+
+Item {
+ id:searchComponent
+ onVisibleChanged: if (visible) searchText.forceActiveFocus()
+// border.color: "#EEEEEE"
+// border.width: 1
+// color:"lightgrey"
+// width:conversationView.width
+// height:Math.max(replyText.contentHeight+2*mm,6*mm)
+ Rectangle{
+ color: "white"
+ radius:0.5*mm
+ anchors.left: parent.left
+ anchors.leftMargin:mm
+ anchors.top:parent.top
+ anchors.topMargin: 0.5*mm
+ width:parent.width-2*mm
+ height:Math.max( searchText.contentHeight,5*mm)
+
+ TextInput {
+ id: searchText
+ font.pixelSize: 3*mm
+ wrapMode: Text.Wrap
+ anchors.fill: parent
+ selectByMouse: true
+ cursorVisible: false
+ onEditingFinished: search(displayText)
+ //onHeightChanged: newsView.contentY+=4.5*mm
+ }
+
+// BlueButton {
+// id: sendButton
+// text: "\uf002"
+// anchors.left: parent.right
+// anchors.leftMargin:mm
+// anchors.top:parent.top
+// //anchors.topMargin: 0.5*mm
+// color:"white"
+// onClicked: {
+// var body=searchText.getText(0,searchText.length);
+// search(body)
+// }
+// }
}
- Component.onCompleted:{
- showProfile(function(profile){
- var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
- var profilecomp = component.createObject(profileTab,{"profile": profile});
- });
- }
}
diff --git a/source-android/qml/newsqml/Conversation.qml b/source-android/qml/newsqml/Conversation.qml
new file mode 100644
index 0000000..45921a3
--- /dev/null
+++ b/source-android/qml/newsqml/Conversation.qml
@@ -0,0 +1,185 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+// ConversationView with button
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle {
+ id:conversationList
+// width:root.width-5*mm
+// height:root.height-12*mm
+ //property var news
+// y:1
+// z:2
+ color: "white"
+// border.color: "grey"
+// width:root.width-5*mm
+// height: conversationView.height+10*mm
+
+ ListView {
+ id: conversationView
+ x:3*mm
+ y:8*mm
+ width: conversationList.width-4*mm
+ //height: contentHeight
+ height:conversationList.height-10*mm
+ clip: true
+ spacing: 0
+ footer: footerReply
+ model: conversationModel
+ delegate: Newsitem{}
+ }
+ BusyIndicator{
+ id: conversationBusy
+ anchors.horizontalCenter: conversationView.horizontalCenter
+ anchors.top:conversationList.top
+ anchors.topMargin: 2*mm
+ width:10*mm
+ height: 10*mm
+ running: true
+ }
+
+ Connections{
+ target:newstab
+ onConversationChanged:{
+ //if(newsitem.itemindex==newsStack.conversationIndex){
+ if(newstab.conversation.length==0){
+ newsStack.pop()
+ //newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
+ //conversationList.destroy(); conversationsymbol.color="grey"
+ } else { conversationBusy.running=false;
+ conversationModel.clear();
+ var currentTime= new Date();
+ var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation};
+ conversationWorker.sendMessage(msg)
+ //conversationsymbol.color="grey"
+ }
+ //}
+ }
+ }
+
+ Component { id:footerReply
+ Rectangle{
+ border.color: "#EEEEEE"
+ border.width: 1
+ color:"lightgrey"
+ width:conversationView.width
+ height:Math.max(replyText.contentHeight+2*mm,6*mm)
+ Rectangle{
+ color: "white"
+ radius:0.5*mm
+ anchors.left: parent.left
+ anchors.leftMargin:mm
+ anchors.top:parent.top
+ anchors.topMargin: 0.5*mm
+ width:parent.width-12*mm
+ height:Math.max( replyText.contentHeight,5*mm)
+
+ TextInput {
+ id: replyText
+ font.pixelSize: 3*mm
+ wrapMode: Text.Wrap
+ anchors.fill: parent
+ selectByMouse: true
+ onHeightChanged: newsView.contentY+=4.5*mm
+ }
+ }
+
+ BlueButton {
+ id: sendButton
+ text: "\uf1d9"
+ anchors.right: parent.right
+ anchors.rightMargin:mm
+ anchors.top:parent.top
+ anchors.topMargin: 0.5*mm
+ color:"white"
+ onClicked: { try{
+ var body=replyText.getText(0,replyText.length);
+ newsBusy.running=true;
+ replyText.text=""
+ xhr.clearParams();
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ if (conversationModel.get(0).newsitemobject.messagetype==0){
+
+ //xhr.url= login.server + "/api/statuses/update.json";
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/update");
+ xhr.setParam("source", "Friendiqa");
+ xhr.setParam("status", body);
+ xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.id)}
+ else {//xhr.url= login.server + "/api/direct_messages/new.json";
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/direct_messages/new");
+ xhr.setParam("text", body);
+ xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name);
+ xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.id)
+ }
+ xhr.post();
+ } catch(e){Helperjs.showMessage("Error",e.toString(),root)}
+ }
+ }
+ }
+ }
+
+
+
+ ListModel{id: conversationModel}
+
+ WorkerScript {
+ id: conversationWorker
+ source: "qrc:/js/newsworker.js"
+ }
+
+ BlueButton {
+ id: closeButton
+ width:10*mm
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ text: "\uf057"
+ onClicked: {
+ //newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
+ newsStack.pop()
+ //conversationList.destroy();
+ //conversationsymbol.color="grey"
+ }
+ }
+
+// Component.onCompleted: {
+// if (news){var currentTime= new Date();
+// var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news};
+// conversationWorker.sendMessage(msg)}
+// }
+}
diff --git a/src/qml/newsqml/FriendicaActivities.qml b/source-android/qml/newsqml/FriendicaActivities.qml
similarity index 59%
rename from src/qml/newsqml/FriendicaActivities.qml
rename to source-android/qml/newsqml/FriendicaActivities.qml
index 9555d8c..e235518 100644
--- a/src/qml/newsqml/FriendicaActivities.qml
+++ b/source-android/qml/newsqml/FriendicaActivities.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,15 +30,15 @@
// along with this program. If not, see .
// List of people from Friendica Activities
-import QtQuick 6.3
+import QtQuick 2.0
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle {
id:activitiesRectangle
property var activitymembers
- color: osSettings.dialogColor
- //border.color: osSettings.frameColor
+ color: "white"
+ border.color: "light grey"
radius:0.5*mm
width:root.width/2
height:Math.min(root.height/2,(10*mm+6*activitymembers.length*mm))
@@ -53,56 +53,51 @@ Rectangle {
spacing: 0
model: activitiesModel
delegate: activitiesContact
- }
+ }
- ListModel{id: activitiesModel}
+ ListModel{id: activitiesModel}
- Component {
- id:activitiesContact
- Rectangle{
- //border.color: Material.frameColor
- color: osSettings.backgroundColor
- border.width: 1
- radius:0.5*mm
- width:parent.width
- height:6*mm
- Image {
- id: contactImage
- x:1
- y:1
- width: 5*mm
- height:5*mm
- source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
- onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/assets/defaultcontact.jpg"}
- }
- Text{
- color: osSettings.primaryTextColor
- font.pointSize: osSettings.bigFontSize
- anchors.left: contactImage.right
- anchors.margins: 1*mm
- text:contact.name
- }
+ Component { id:activitiesContact
+ Rectangle{
+ border.color: "#EEEEEE"
+ border.width: 1
+ radius:0.5*mm
+ width:parent.width
+ height:6*mm
+ Image {
+ id: contactImage
+ x:1
+ y:1
+ width: 5*mm
+ height:5*mm
+ source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
+ onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
+ }
+ Text{
+ font.pixelSize: 3*mm
+ anchors.left: contactImage.right
+ anchors.margins: 1*mm
+ text:contact.name
+ }
MouseArea{
anchors.fill: parent
onClicked:{showContact(contact)}
}
- }
- }
+ }}
- MButton {
- id: closeButton
- anchors.top: parent.top
- anchors.topMargin: 1*mm
- anchors.right: parent.right
- anchors.rightMargin: 1*mm
- text: qsTr("Close")
- display: AbstractButton.IconOnly
- icon.name: "dialog-close"
- icon.source: "qrc:/assets/icons/times-circle.svg"
- onClicked: {
- activitiesRectangle.destroy()
- }
+ BlueButton {
+ id: closeButton
+ //width:10*mm
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ color:"white"
+ text: "\uf057"// qsTr("Close")
+ onClicked: {
+ activitiesRectangle.destroy()
+ }
}
Component.onCompleted: {
diff --git a/src/qml/newsqml/Hashtag.qml b/source-android/qml/newsqml/Hashtag.qml
similarity index 81%
rename from src/qml/newsqml/Hashtag.qml
rename to source-android/qml/newsqml/Hashtag.qml
index 28aa64c..27584c0 100644
--- a/src/qml/newsqml/Hashtag.qml
+++ b/source-android/qml/newsqml/Hashtag.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,24 +29,23 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
+import QtQuick 2.0
Rectangle {
- id:hashtagRectangle
- color: osSettings.dialogColor
+ id:hasgtagRectangle
+ color: "light grey"
property alias text: hashtagText.text
radius:0.3*mm
width:hashtagText.contentWidth+mm
- height:root.fontFactor*osSettings.bigFontSize
+ height:2.5* mm
Text{
id:hashtagText
- font.pointSize: osSettings.systemFontSize
- color: osSettings.secondaryTextColor
+ font.pixelSize: 1.5*mm
anchors.centerIn: parent
anchors.margins: 0.5*mm
}
MouseArea{
anchors.fill: parent
- onClicked:{root.searchSignal(hashtagText.text.replace("#",""))}
+ onClicked:{search(hashtagText.text.replace("#",""))}
}
}
diff --git a/source-android/qml/newsqml/MessageSend.qml b/source-android/qml/newsqml/MessageSend.qml
new file mode 100644
index 0000000..12812ae
--- /dev/null
+++ b/source-android/qml/newsqml/MessageSend.qml
@@ -0,0 +1,250 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+// message.qml
+// message with buttons
+import QtQuick 2.0
+import QtQuick.Controls 1.4
+//import QtQuick.Dialogs 1.2
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/js/smiley.js" as Smileyjs
+import "qrc:/qml/genericqml"
+
+
+Rectangle{
+ color:"white"
+// width:root.width-5*mm
+// height:root.height-12*mm
+ //anchors.fill: parent
+ property string parentId: ""
+ property string reply_to_user:""
+ property alias bodyMessage: bodyField.text
+ property var attachImageURLs: [];
+ property int directmessage: 0;
+ property var contacts: []
+ property var groups: []
+ property var contact_allow:login.permissions[0]
+ property var contact_deny:login.permissions[1]
+ property var group_allow:login.permissions[2]
+ property var group_deny:login.permissions[3]
+
+ function attachImage(url){ print("attachImage "+url)
+ var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
+ url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+
+ url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
+ }
+
+ function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
+ //xhr.url= login.server + "/api/statuses/update.json";
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/update");
+ xhr.clearParams();
+ xhr.setParam("source", "Friendiqa");
+ xhr.setParam("htmlstatus", status);
+ if (parentId!="") {xhr.setParam("in_reply_to_status_id", parentId)};
+ if (title!=="") {xhr.setParam("title", title)};
+ if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))};
+ if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))};
+ if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))};
+ if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))};
+ if (attachImageURL.length>0) {for (var image in attachImageURL){xhr.setImageFileParam("media", attachImageURL[image] )}};
+ xhr.post();
+ }
+
+ function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
+ //xhr.url= login.server + "/api/direct_messages/new.json";
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/direct_messages/new");
+ xhr.clearParams();
+ xhr.setParam("text", text);
+ xhr.setParam("screen_name", screen_name);
+ if (parentId!="") {xhr.setParam("replyto", replyto)};
+ //if (title!=="") {xhr.setParam("title", title)};
+ xhr.post();
+ }
+
+ Flickable{
+ anchors.fill: parent
+ contentHeight: messageColumn.height
+ boundsBehavior: Flickable.StopAtBounds
+ id:messageSend
+ Column {
+ id:messageColumn
+ spacing: 0.5*mm
+ width: parent.width
+ TextField {
+ id: titleField
+ width: parent.width
+ placeholderText: qsTr("Title (optional)")
+ visible: parentId === ""
+ }
+
+ Rectangle{
+ color: "white"
+ radius: 0.5*mm
+ x:mm
+ width: parent.width-2*mm
+ height:Math.max(bodyField.contentHeight+2*mm,10*mm)
+ TextArea {
+ id: bodyField
+ anchors.fill: parent
+ font.pixelSize: 3*mm
+ wrapMode: Text.Wrap
+ selectByMouse: true
+ textFormat: TextEdit.RichText //TextEdit.PlainText
+ onLinkActivated:{Qt.openUrlExternally(link)}
+ }
+ }
+
+
+ Row{
+ spacing: 2
+ width: parent.width
+ CheckBox{
+ id:dmCheckbox
+ text:"DM"
+ enabled: false
+ checked: (directmessage==1)?true:false
+ onClicked:{
+ if(dmCheckbox.checkedState==Qt.Checked){directmessage=1}
+ else if(dmCheckbox.checkedState==Qt.Unchecked){directmessage=0}
+ }
+ }
+
+ BlueButton{
+ text:"\uf0c1"
+ onClicked: {
+ if(bodyField.selectedText==""){Helperjs.showMessage("Error","No text selected",messageSend)}
+ else{urlTextEdit.text="";
+ urlRectangle.visible=true}}
+ }
+ }
+ Rectangle{
+ id:urlRectangle
+ height: 7*mm //parent.height
+ width:parent.width-2*mm
+ visible:false
+ TextField{
+ id:urlTextEdit
+ width:parent.width-7*mm
+ height:parent.height
+ }
+ BlueButton{
+ anchors.left:urlTextEdit.right
+ anchors.leftMargin:mm
+ text:"\u2713"
+ onClicked: {if(urlTextEdit.text!=""){
+ var start = bodyField.selectionStart;
+ var text=bodyField.selectedText
+ if(text.lastIndexOf(".jpg")>-1 || text.lastIndexOf(".jpeg")>-1 || text.lastIndexOf(".png")>-1){text=""}
+ text = "[url="+urlTextEdit.text+"]" + text + "[/url]";
+ bodyField.remove(start,bodyField.selectionEnd);
+ bodyField.insert(start,text);}
+ urlRectangle.visible=false}
+ }
+ }
+ Row{
+ spacing:2
+ BlueButton{id:permButton
+ visible: (directmessage==1)?false:true
+ text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
+ onClicked: { permissionDialog.visible=true;}
+ }
+ BlueButton {
+ id: attachButton
+ text: "\uf03e"
+ visible:(directmessage==0)
+ onClicked: {
+ if (attachImageURLs.length>0){//Server currently accepts only one attachment
+ Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
+ }
+ else{
+ var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
+ osSettings.imagePickQml+'{multiple : false;onReady: {attachImageURLs.push(imageUrl);'+
+ 'attachImage(imageUrl)}}',messageSend,"imagePicker");
+ imagePicker.pickImage()
+ }
+ }
+ }
+ BlueButton{
+ id:contactButton
+ text:"\uf234"
+ visible:(directmessage==0)
+ onClicked:{
+ var contactitems="";
+ for (var i=0;i1){
+ contacts[i].screen_name=contacts[i].screen_name+"+"+contacts[i].cid
+ }
+ contactitems=contactitems+"MenuItem{text:'"+contacts[i].screen_name+"'; onTriggered: bodyField.insert("+bodyField.cursorPosition+",' @"+contacts[i].screen_name+" ')}"
+ }}
+ var menuString="import QtQuick.Controls 1.4; Menu {"+contactitems+"}";
+ var contactlistObject=Qt.createQmlObject(menuString,messageColumn,"contactmenuOutput")
+ contactlistObject.popup() }
+ }
+
+ BlueButton{
+ id:smileyButton
+ text: "\uf118"
+ onClicked: {smileyDialog.visible=true}
+ }
+
+ BlueButton {
+ id: cancelButton
+ text: "\uf057"
+ onClicked: {
+ newstab.newstabstatus=login.newsViewType;
+ newsStack.pop(null)
+ }
+ }
+ BlueButton {
+ id: sendButton
+ text: "\uf1d9"
+ onClicked: {
+ var title=titleField.text.replace("\"","\'");
+ var body=bodyField.getFormattedText(0,bodyField.length);
+ var dmbody=bodyField.getText(0,bodyField.length);
+ if (directmessage==0){
+ statusUpdate(title,body,parentId,attachImageURLs)}
+ else {dmUpdate(title,dmbody,parentId,reply_to_user) }
+ newstab.newstabstatus=login.newsViewType; newsStack.pop(null)
+ }
+ }
+ }
+ PermissionDialog{id:permissionDialog;x:mm;visible: false}
+ SmileyDialog{id:smileyDialog;x:mm;visible: false}
+ }
+ Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])}
+}
+}
diff --git a/src/common/oauth.h b/source-android/qml/newsqml/NewsImage.qml
similarity index 61%
rename from src/common/oauth.h
rename to source-android/qml/newsqml/NewsImage.qml
index 92b8508..74401a0 100644
--- a/src/common/oauth.h
+++ b/source-android/qml/newsqml/NewsImage.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,43 +29,22 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-#ifndef OAUTH_H
-#define OAUTH_H
-
-#include
-#include
-
-#include
-
-
-class OAuthWrapper : public QObject//, public QAndroidActivityResultReceiver
-{
- Q_OBJECT
-
-
-public:
- OAuthWrapper(QObject *parent = nullptr);;
- OAuthWrapper(const QString &clientIdentifier, QObject *parent = nullptr);
- static OAuthWrapper *instance();
-// bool isPermanent() const;
-// void setPermanent(bool value);
-
-signals:
- void success(QString token);
- void error(QString error);
-
-public slots:
- void grant();
- void setServer(QString server);
- void setClientId(QString clientid);
- void setClientSecret(QString clientsecret);
-
-private:
- QOAuth2AuthorizationCodeFlow oauth2;
-// bool permanent = false;
- QString m_clientid;
- QString m_clientsecret;
- QString m_server;
-};
-
-#endif //OAuthWrapper
+import QtQuick 2.0
+AnimatedImage {id:gif;
+ width:newscolumn.width;
+ property string mimetype:""
+ fillMode: Image.PreserveAspectFit;
+ onStatusChanged: playing = (status == AnimatedImage.Ready);
+ MouseArea {anchors.fill:parent;
+ onClicked:{
+ if (mimetype!="image/gif"){
+ var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+
+ 'Rectangle{id:recfullscreen;color:"white";width:root.width;height:root.height;'+
+ 'MouseArea {anchors.fill:parent;onClicked:{recfullscreen.destroy()}}'+
+ 'AnimatedImage {id:giffullscreen;source: "'+gif.source+
+ '";anchors.centerIn:parent; width:root.width;fillMode: Image.PreserveAspectFit; onStatusChanged: playing = (status == AnimatedImage.Ready);'+
+ '}}',root,"Attachmentlarge")
+ }
+ }
+ }
+}
diff --git a/source-android/qml/newsqml/NewsTab.qml b/source-android/qml/newsqml/NewsTab.qml
new file mode 100644
index 0000000..095bb0e
--- /dev/null
+++ b/source-android/qml/newsqml/NewsTab.qml
@@ -0,0 +1,444 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 2.3
+//import QtQuick.Controls.Styles 2.3
+import QtQuick.Dialogs 1.3
+import "qrc:/qml/genericqml"
+import "qrc:/js/news.js" as Newsjs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/js/service.js" as Service
+
+
+Item {
+ Connections{
+ target:newstab
+ onNewstabstatusChanged:{
+ newstabstatusButton.text= qsTr(newstab.newstabstatus)
+ }
+ }
+
+ Connections{
+ target:xhr
+ onError:{
+ Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
+ }
+ onSuccess:{
+ // downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
+ Service.processNews(api,data);
+ }
+ }
+
+ Timer {id:replytimer; interval: 1000; running: false; repeat: false
+ onTriggered: {
+ if(newstab.newstabstatus=="Conversation"){
+ showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)}
+ else{
+ Service.updateView(newstab.newstabstatus)
+ root.contactLoadType="news";
+ }
+ }
+ }
+
+ Timer {id:contacttimer; interval: 50; running: false; repeat: false
+ onTriggered: {
+ // downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
+ root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
+ Newsjs.storeNews(login,db,root.news,root)
+ }
+ }
+
+
+
+ function showNews(newsToShow){
+ try{if (newsStack.depth>1){newsStack.pop()}}catch(e){}
+ newsBusy.running=false;
+ var currentTime= new Date();
+ // downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
+ //print("appendnews "+newsStack.appendNews +JSON.stringify(newsToShow))
+ var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'appendnews':newsStack.appendNews};
+ newsWorker.sendMessage(msg);
+ newsStack.appendNews=false
+ }
+
+
+
+ function showConversation(conversationIndex,newsitemobject){
+ //newsBusy.running=true;
+ root.contactLoadType="conversation";
+ newsStack.conversationIndex= conversationIndex;
+ //print(newsitemobject.id);
+ if(newsitemobject.messagetype==0){
+ xhr.clearParams();
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/conversation/show");
+ xhr.setParam("id",newsitemobject.id)
+ xhr.get();
+ }
+ else{
+ xhr.clearParams();
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/direct_messages/conversation");
+ xhr.setParam("uri",newsitemobject.statusnet_conversation_id)
+ xhr.get();
+ }
+ }
+
+ function showContact(contact){
+ var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
+ if (component.status== Component.Ready){
+ var contactDetails = component.createObject(newstab,{"contact": contact})
+ }
+ }
+
+ function search(term){//print("Search "+term)
+ if (term!=""){
+ newstab.newstabstatus="Search";
+ newsBusy.running=true;
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/search");
+ xhr.clearParams();
+ xhr.setParam("q",term)
+ xhr.get();}
+ newsSearch.visible=false;
+ newsView.anchors.topMargin=7*mm
+ }
+
+
+ function onFriendsMessages(friend){
+ newstab.newstabstatus="Contact"
+ Newsjs.newsfromdb(db,root.login.username, function(dbnews){
+ if (dbnews.length==0){
+ Newsjs.newsfromdb(db,login.username,function(forumnews){
+ showNews(forumnews)
+ },friend.url)
+ }
+ else showNews(dbnews)
+ },friend.id)
+ }
+
+ function onDirectMessage(friend){
+ newstab.newstabstatus="SendMessage"
+ newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"reply_to_user": friend,"directmessage":1,"login":root.login});
+ }
+
+ function sendUrls(urls){
+ if((urls.length==1)&&(newsStack.depth<2)){
+ newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"attachImageURLs":urls})
+ }
+ }
+
+ function sendtext(text){
+ if(text&&(newsStack.depth<2)){
+ if (text.subject=="undefined"){text.subject=""}
+ if(text.plaintext.lastIndexOf(".jpg")>-1 || text.plaintext.lastIndexOf(".jpeg")>-1 || text.plaintext.lastIndexOf(".png")>-1 || text.plaintext.lastIndexOf(".jpeg")>-1){
+ text.plaintext=""}
+ newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"bodyMessage":text.subject+"\n"+text.plaintext})
+ }
+ }
+
+ StackView{
+ id: newsStack
+ anchors.fill:parent
+ property int conversationIndex: 0
+ property bool appendNews: false
+ property var allchats: ({})
+ initialItem:Rectangle {
+ id:newslistRectangle
+ y:1
+ color: "white"
+
+ BlueButton{
+ id:newstabstatusButton
+ anchors.top: parent.top
+ anchors.topMargin: 0.5*mm
+ text: qsTr(newstab.newstabstatus)
+ onClicked: {newstabmenu.popup(2*mm,6*mm)}
+
+ Menu{id:newstabmenu
+ width: 40*mm
+
+ delegate:MenuItem{
+ contentItem: Text{
+ font.pixelSize: 3.5*mm
+ text:parent.text
+ }
+ background: Rectangle {
+ implicitWidth: 40*mm; implicitHeight: 5*mm
+ color: "#ffffff"
+ border.color: "grey"
+ }
+ }
+ Action {
+ text: qsTr("Timeline")
+ onTriggered: {
+ newstab.newstabstatus="Timeline";
+ newsModel.clear();
+ try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
+ showNews(dbnews)
+ })}catch(e){Helperjs.showMessage("Error",e,root)}}
+ }
+ Action {
+ text: qsTr("Conversations")
+ onTriggered:{
+ newsModel.clear();
+ newstab.newstabstatus="Conversations";
+ Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
+ }
+ }
+ Action {
+ text: qsTr("Favorites")
+ onTriggered:{
+ newstab.newstabstatus="Favorites";
+ Service.updateView("Favorites")
+ }
+ }
+ Action {
+ text: qsTr("Public timeline")
+ onTriggered:{
+ newstab.newstabstatus="Public Timeline";
+ Service.updateView("Public Timeline")
+ }
+ }
+
+ Action {
+ text: qsTr("Direct Messages")
+ onTriggered:{
+ newstab.newstabstatus="Direct Messages";
+ Service.updateView("Direct Messages")
+ }
+ }
+ Action {
+ text: qsTr("Notifications")
+ onTriggered:{
+ newstab.newstabstatus="Notifications";
+ Service.updateView("Notifications")
+ }
+ }
+ Action {
+ text: qsTr("Group news")
+ onTriggered:Service.showGroups();
+ }
+ Action {
+ text: qsTr("Quit")
+ onTriggered:{
+ Service.cleanNews(root.db,function(){
+ Service.cleanContacts(root.login,root.db,function(){
+ Qt.quit()})
+ })
+ }
+ }
+ }
+ }
+
+ Row{
+ spacing: mm
+ anchors.top: parent.top
+ anchors.topMargin: 0.5*mm
+ anchors.right: parent.right
+
+ BlueButton {
+ id: searchButton
+ text: "\uf002"
+ onClicked: {
+ if (newsSearch.visible==false){
+ newsView.anchors.topMargin=18*mm;
+ newsSearch.visible=true}
+ else{
+ newsSearch.visible=false;
+ newsView.anchors.topMargin=7*mm;
+ }
+ }
+ }
+
+ BlueButton {
+ id: newMessageButton
+ text: "\uf040"
+ onClicked: {
+ var groups=[];
+ Helperjs.readData(root.db,"groups",root.login.username,function(groupobject){
+ groups=groupobject
+ });
+ newstab.newstabstatus="SendMessage";
+ Helperjs.readData(root.db,"contacts",root.login.username,function(friends){
+ newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"contacts": friends,"login":root.login})
+ },"isFriend",1);
+ }
+ }
+// BlueButton {
+// id: quitButton
+// text: "\uf08b"
+// onClicked: {Service.cleanNews(root.db,function(){
+// Service.cleanContacts(root.login,root.db,function(){
+// Qt.quit() })
+// })}
+// }
+ BlueButton {
+ id: update
+ text: "\uf021"
+ onClicked: {
+ root.contactLoadType="news";
+ Service.updateView(newstab.newstabstatus)
+ }
+ }
+
+ }
+ Component { id:footerComponent
+ Rectangle{
+ border.color: "#EEEEEE"
+ border.width: 1
+ width:newsView.width
+ height:6*mm
+ Text{
+ font.pixelSize: 1.5*mm
+ anchors.centerIn: parent
+ text:qsTr("More")
+ }
+ MouseArea{anchors.fill:parent
+ onClicked:{
+ var currentTime= new Date();
+ var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
+ if(newstab.newstabstatus=="Timeline"){
+ Newsjs.newsfromdb(root.db,root.login.username, function(news){
+ var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
+ newsWorker.sendMessage(msg);
+ },false,lastnews_id)}
+ if(newstab.newstabstatus=="Conversations"){
+ Newsjs.chatsfromdb(root.db,root.login.username, function(news){
+ var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
+ newsWorker.sendMessage(msg);
+ },lastnews_id)}
+ else if(newstab.newstabstatus=="Contact"){
+ Newsjs.newsfromdb(root.db,root.login.username, function(news){
+ var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
+ newsWorker.sendMessage(msg);
+ },newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)}
+ else if (newstab.newstabstatus=="Notifications"){}
+ else{
+ newsStack.appendNews=true;
+ xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);
+ xhr.get()
+ }}
+ }
+ }
+ }
+ Rectangle{
+ id: newsSearch
+ color: "#FFFAFA"
+ y:8*mm
+ width:root.width
+ height: 8*mm
+ visible:false
+ Search{
+ anchors.fill: parent
+ anchors.margins: mm
+ }
+ }
+ ListView {
+ id: newsView
+ anchors.fill: parent
+ anchors.topMargin: 7*root.mm
+ anchors.leftMargin: 3*root.mm; anchors.rightMargin: root.mm
+ anchors.bottomMargin: 1*root.mm
+ clip: true
+ spacing: 0
+ footer: footerComponent
+ model: newsModel
+ delegate: Newsitem{}
+ //onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing");
+ onDragEnded:{if(contentY<-5*mm){//print("refreshing");
+ root.contactLoadType="news";
+ var onlynew=true;
+ Service.updateView(newstab.newstabstatus)
+ }}
+ }
+
+ ListModel{id: newsModel}
+
+ WorkerScript {
+ id: newsWorker
+ source: "qrc:/js/newsworker.js"
+ }
+
+ BusyIndicator{
+ id: newsBusy
+ anchors.horizontalCenter: newsView.horizontalCenter
+ anchors.top:newsView.top
+ anchors.topMargin: 2*mm
+ width:10*mm
+ height: 10*mm
+ }
+ Rectangle{
+ id:downloadNotice
+ property alias text: noticeText.text
+ color:"white"
+ border.color:"grey"
+ z:1
+ anchors.horizontalCenter: newsView.horizontalCenter
+ anchors.bottom:newsView.bottom
+ anchors.bottomMargin: 2*mm
+ width: noticeText.width+2*mm
+ height: noticeText.height+2*mm
+ visible: (downloadNotice.text!="")
+
+ Text{
+ id:noticeText
+ color: "grey"
+ anchors.centerIn: parent
+ width: contentWidth
+ height: contentHeight
+ font.pixelSize: 2*mm
+ text:""
+ }
+ }
+
+ Component.onCompleted: {
+ root.messageSignal.connect(onFriendsMessages);
+ root.directmessageSignal.connect(onDirectMessage);
+ root.newsSignal.connect(showNews);
+ root.uploadSignal.connect(sendUrls);
+ root.sendtextSignal.connect(sendtext);
+ try{newsModel.clear()} catch(e){}
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ if(root.news.length>0){showNews(root.news)}
+ else{ newstab.newstabstatus=login.newsViewType;
+ if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
+ else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
+ }
+ }
+ }
+ }
+}
diff --git a/source-android/qml/newsqml/Newsitem.qml b/source-android/qml/newsqml/Newsitem.qml
new file mode 100644
index 0000000..b626057
--- /dev/null
+++ b/source-android/qml/newsqml/Newsitem.qml
@@ -0,0 +1,460 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import "qrc:/js/news.js" as Newsjs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Item {
+ id: newsitem
+ width: parent.width
+ height:toprow.height+friendicaActivities.height+controlrow.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
+ property int itemindex: index
+
+ property string attending: ""
+ onAttendingChanged: {attendLabel.visible=true;
+ attendLabel.text= qsTr("attending: ")+ qsTr(attending)}
+
+ signal replyto(string parent_id)
+
+ function showActivityContacts(contacts){
+ var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml");
+ var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
+ }
+
+ function findTags(fulltext){
+ return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
+ }
+
+ Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
+
+ Rectangle{
+ width:newsitem.width
+ height:newsitem.height-1
+ color: (newsitemobject.messagetype==1)?"#ffe6e6" : "white"
+
+ Row{id:toprow
+ Column {
+ id: authorcolumn
+ width: 8*mm
+
+ Image {
+ id:profileImage
+ source: ((newsitemobject.user.profile_image!="") && (typeof(newsitemobject.user.profile_image)=="string"))? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url
+ x:1
+ width: 7*mm
+ height: 7*mm
+ MouseArea{
+ anchors.fill: parent
+ onClicked:{
+ showContact(newsitemobject.user)}
+ }
+ onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
+ }
+ Label {
+ id:user_name
+ color: "grey"
+ width:parent.width
+ font.pixelSize: 1.5*mm
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ text: newsitemobject.user.name+forumname
+ }
+ }
+ Column {
+ id:newscolumn
+ width: newsitem.width-8*mm
+
+ Flow{
+ id:topFlow
+ spacing: mm
+ width:parent.width
+ Label {
+ id:messageTypeLabel
+ color: "grey"
+ text: if (newsitemobject.messagetype==0){qsTr("Source: ")+newsitemobject.source
+ } else if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else {" Notification"}
+ font.pixelSize: 1.5*mm
+ }
+ Label {
+ id:createdAtLabel
+ color: "grey"
+ font.pixelSize: 1.5*mm
+ horizontalAlignment: Label.AlignRight
+ text: dateDiff
+ }
+ Label {
+ id:replytoLabel
+ color: "grey"
+ font.pixelSize: 1.5*mm
+ horizontalAlignment: Label.AlignRight
+ text: try {qsTr("In reply to ")+newsitemobject.reply_user.screen_name
+ }catch(e){" "}
+ }
+
+ Label {
+ id:newscountLabel
+ visible:((newstabstatus=="Conversations")&&(newsitemobject.newscount>1))?true:false
+ color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ font.bold: true
+ horizontalAlignment: Label.AlignRight
+ text: try {(newsitemobject.newscount-1)+qsTr(" comments") }catch(e){" "}
+ MouseArea{
+ anchors.fill:parent
+ onClicked: {
+ conversationsymbol.color="black";
+ newsView.contentY+=newsitem.height;
+ var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
+ var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
+ showConversation(index,newsitemobject);
+ }
+ }
+ }
+ }
+
+
+ Column{ id: messageColumn
+ //anchors.top:topFlow.bottom
+ width:parent.width
+ spacing:mm
+ clip:true
+ height: Math.min(implicitHeight,3/4*root.height)
+ MouseArea{
+ width: newsitem.width-8*mm-2
+ height: itemMessage.height
+ onPressAndHold: {
+ newsStack.push("qrc:/qml/newsqml/Conversation.qml");
+ showConversation(index,newsitemobject)
+ }
+ Text {
+ color: "#404040"
+ linkColor: "light green"
+ id: itemMessage
+ textFormat: Text.RichText
+ text: newsitemobject.attachmentList.length>0?newsitemobject.text : newsitemobject.statusnet_html
+ width: newsitem.width-8*mm-2
+ height: implicitHeight
+ wrapMode: Text.Wrap
+ clip:true
+ //MouseArea{anchors.fill:parent;onClicked: print("Test")}
+ onLinkActivated:{
+ Qt.openUrlExternally(link)}
+ Component.onCompleted:{
+ if (newsitemobject.messagetype==0){
+ var hashtags=[];
+ hashtags=findTags(newsitemobject.text);
+ var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
+ for (var tags in hashtags){
+ var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
+ }}
+
+ if (newsitemobject.attachmentList.length>0){
+ var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
+ for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
+ var imageQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
+ }
+ }
+ }
+ }}
+ }
+ BlueButton{
+ width: newsitem.width-8*mm-2
+ height:5*mm
+ //anchors.bottom: messageColumn.bottom//itemMessage.bottom
+ visible: messageColumn.implicitHeight>3/4*root.height//itemMessage.implicitHeight>3/4*root.height
+ text:"\uf078"
+ fontColor:"grey"
+ border.color: "transparent"
+ color:"white"
+// gradient: Gradient {
+// GradientStop { position: 0.0; color: "transparent" }
+// GradientStop { position: 0.5; color: "white" }
+// }
+ radius:0
+ onClicked: {
+ if (text=="\uf078"){
+ messageColumn.height=messageColumn.implicitHeight+10*mm;text="\uf077"
+ } else {
+ messageColumn.height=Math.min(messageColumn.implicitHeight,3/4*root.height);
+ text="\uf078";
+ newsView.positionViewAtIndex(index,ListView.Beginning);
+ }
+ }
+ }
+ }
+ }
+ Flow{
+ id:friendicaActivities
+ anchors.top:toprow.bottom
+ width:parent.width
+ spacing:mm
+
+ Label{color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ text: friendica_activities.likeText
+ MouseArea{
+ anchors.fill: parent
+ onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
+ }
+ }
+ Label{color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ text: friendica_activities.dislikeText
+ MouseArea{
+ anchors.fill: parent
+ onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
+ }
+ }
+ Label{color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ text: friendica_activities.attendyesText
+ MouseArea{
+ anchors.fill: parent
+ onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
+ }}
+ Label{color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ text: friendica_activities.attendnoText
+ MouseArea{
+ anchors.fill: parent
+ onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
+ }
+ }
+ Label{color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ text: friendica_activities.attendmaybeText
+ MouseArea{
+ anchors.fill: parent
+ onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
+ }
+ }
+ Label{
+ id:attendLabel
+ color: "grey"
+ height:3.5*mm
+ font.pixelSize: 1.5*mm
+ horizontalAlignment: Label.AlignRight
+ text: (friendica_activities.self.attending)?(qsTr("Attending: ")+ qsTr(friendica_activities.self.attending)):""
+ }
+ }
+ Row{id:controlrow
+ anchors.top:friendicaActivities.bottom
+
+ CheckBox{
+ id:likeCheckbox
+ width:10*mm
+ visible: (newsitemobject.messagetype==0)? true:false
+ checked:(friendica_activities.self.liked==1)?true:false
+ style: CheckBoxStyle {
+ indicator: Rectangle{
+ implicitWidth: 10*mm
+ implicitHeight:3*mm
+ Text{
+ anchors.centerIn: parent
+ font.pixelSize: 2.5*mm
+ font.family:fontAwesome.name
+ color:control.checked?"black": "grey"
+ text:"\uf118"
+ }
+ }
+ }
+ onClicked: {
+ if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
+ else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.friendica_activities.self.liked=1}}
+ }
+ CheckBox{
+ id: dislikeCheckbox
+ width:10*mm
+ visible: (newsitemobject.messagetype==0)? true:false
+ checked: (friendica_activities.self.disliked==1)?true:false
+ style: CheckBoxStyle {
+ indicator: Rectangle{
+ implicitWidth: 10*mm
+ implicitHeight:3*mm
+ Text{
+ anchors.centerIn: parent
+ font.pixelSize: 2.5*mm
+ font.family:fontAwesome.name
+ color:control.checked?"black": "grey"
+ text: "\uf119"
+ }
+ }
+ }
+ onClicked: {
+ if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
+ else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.friendica_activities.self.disliked=1}}
+ }
+
+ CheckBox {
+ id:favoritedCheckbox
+ visible:(newsitemobject.messagetype==0)
+ width: 10*mm
+ style: CheckBoxStyle {
+ indicator:Rectangle{
+ x:4*mm
+ width: 3*mm
+ implicitHeight:4*mm
+ Text{
+ color: control.checked?"black":"grey"
+ font.pixelSize: 2.5*mm
+ text:"\uf005"
+ }
+ }
+ }
+ checked:(newsitemobject.favorited>0)
+ onClicked:{
+ if(favoritedCheckbox.checkedState==Qt.Checked){
+ Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
+ else if(favoritedCheckbox.checkedState==Qt.Unchecked){
+ Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
+ }
+ }
+ Rectangle{
+ width: 10*mm
+ height: 4*mm
+ visible:(newsitemobject.messagetype!==2)
+ color:"transparent"
+ Text{
+ id:newsmenusymbol
+ color: "grey"
+ anchors.centerIn: parent
+ font.pixelSize: 2.5*mm
+ font.family:fontAwesome.name
+ text: "\uf142"
+ }
+ MouseArea{
+ anchors.fill:parent
+ onClicked: {newsmenu.popup()}}
+ }
+ Rectangle{
+ width: 10*mm
+ height: 4*mm
+ visible:(newsitemobject.messagetype!==2)&&(newstab.newstabstatus!="Conversation")
+ color:"transparent"
+ Text{
+ id:conversationsymbol
+ color: "grey"
+ anchors.centerIn: parent
+ font.pixelSize: 2.5*mm
+ font.family: fontAwesome.name
+ text: "\uf086"
+ }
+ MouseArea{
+ anchors.fill:parent
+ onClicked:{
+ //conversationsymbol.color="black";
+// var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
+// var conversationItem = component.createObject(friendicaActivities);
+ newsStack.push("qrc:/qml/newsqml/Conversation.qml")
+ showConversation(index,newsitemobject)
+ }
+ }
+ }
+
+ }
+
+ Menu {
+ id:newsmenu
+ MenuItem {
+ text: qsTr("Reply")
+ onTriggered: {
+ var directmessage=0;
+ if (newsitemobject.messagetype==1){ directmessage=1}
+ newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage});
+ }
+ }
+ MenuItem {
+ text: qsTr("DM")
+ onTriggered: {
+ root.directmessageSignal(newsitemobject.user.screen_name);
+ }
+ }
+ MenuItem {
+ text: qsTr("Repost")
+ onTriggered: {
+ Newsjs.retweetNews(root.login,db,newsitemobject.id,root,function(reply){
+ Helperjs.showMessage("Repost",qsTr("Success!"),root)
+ })
+ }
+ }
+ MenuItem {
+ text: qsTr("Conversation")
+ onTriggered: {
+ conversationsymbol.color="black";
+ var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
+ var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
+ showConversation(index,newsitemobject)
+ }
+ }
+
+ Menu{
+ title: qsTr("Attending")
+ MenuItem{
+ text:qsTr("yes")
+ onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.id,root,function(){
+ model.friendica_activities.self.attending="yes";attending="yes"})
+ }
+ }
+ MenuItem{text:qsTr("maybe")
+ onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.id,root,function(){
+ model.friendica_activities.self.attending="maybe";attending="maybe"})
+ }
+ }
+ MenuItem{text:qsTr("no")
+ onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.id,root,function(){
+ model.friendica_activities.self.attending="no";attending="no"})}
+ }
+ }
+
+ MenuItem {
+ text: qsTr("Delete")
+ onTriggered: {
+ Newsjs.deleteNews(root.login,root.db,newsitemobject.id,newsitemobject.messagetype,root,function(reply){
+ var msg = {'deleteId': index, 'model': newsModel};
+ newsWorker.sendMessage(msg);
+ })
+ }
+ }
+ //MenuItem{
+ // text:qsTr("Show on website")
+ // onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
+ //}
+ }
+}}
diff --git a/src/qml/newsqml/PermissionDialog.qml b/source-android/qml/newsqml/PermissionDialog.qml
similarity index 95%
rename from src/qml/newsqml/PermissionDialog.qml
rename to source-android/qml/newsqml/PermissionDialog.qml
index d9eaa67..433ea6d 100644
--- a/src/qml/newsqml/PermissionDialog.qml
+++ b/source-android/qml/newsqml/PermissionDialog.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,7 +30,6 @@
// along with this program. If not, see .
import QtQuick 2.0
-import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@@ -38,7 +37,7 @@ import "qrc:/qml/genericqml"
Rectangle{
id:permissionDialog
x: mm
- width: messageColumn.width-3*mm
+ width: messageColumn.width-5*mm
height:root.height/3
function updatePerms(){
for (var i=0;i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.7
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.4
+import "qrc:/js/smiley.js" as Smileyjs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle{
+ id:smileyDialog
+ x: mm
+ width: messageColumn.width-5*mm
+ height:root.height/3
+
+ BlueButton{
+ id:closeButton
+ anchors.top: parent.top
+ anchors.topMargin: 1*mm
+ anchors.right: parent.right
+ anchors.rightMargin: 1*mm
+ text: "\uf057"
+ onClicked:{smileyDialog.visible=false}
+ }
+
+ TabView{
+ id:smileyTabView
+ tabPosition: Qt.BottomEdge
+ anchors.top: closeButton.bottom
+ anchors.topMargin: 1*mm
+ width: smileyDialog.width-2*mm
+ height: smileyDialog.height-7*mm
+ currentIndex: 0
+ style: TabViewStyle {
+ frameOverlap: 1
+ tab: Rectangle {
+ color: "white"
+ implicitWidth: smileyTabView.width/3-2*mm
+ implicitHeight: 4*mm
+ Text { id: text
+ anchors.centerIn: parent
+ text: styleData.title
+ color: "dark grey"
+ font.pixelSize:2.5*mm
+ font.bold: styleData.selected
+ }
+ }
+ frame: Rectangle { color: "light grey" }
+ tabsAlignment:Qt.AlignHCenter
+ }
+
+ Tab{
+ title: qsTr("Standard")
+ Rectangle{
+ id: coreGridTab
+ GridView {
+ id: coreSmileyView
+ anchors.fill: parent
+ cellWidth: 5*mm
+ cellHeight: 5*mm
+ clip: true
+ model: coreSmileyModel
+ delegate: smileyItem
+ }
+
+ ListModel{
+ id: coreSmileyModel
+ }
+
+ Component.onCompleted:{
+ var smileyarray=Smileyjs.core
+ for (var icon in smileyarray){
+ coreSmileyModel.append({"emoji":smileyarray[icon]})
+ }
+ }
+ }
+ }
+ Tab{
+ title: qsTr("Addon")
+ Rectangle{
+ id: addonGridTab
+ GridView {
+ id: addonView
+ anchors.fill: parent
+ cellWidth: 5*mm
+ cellHeight: 5*mm
+ clip: true
+ model: addonModel
+ delegate: smileyItem
+ }
+
+ ListModel{
+ id: addonModel
+ }
+ Component.onCompleted:{
+ for (var icon in Smileyjs.addon){
+ addonModel.append({"emoji":Smileyjs.addon[icon]})
+ }
+ }
+ }
+ }
+ Tab{
+ title: qsTr("Adult")
+ Rectangle{
+ id: adultGridTab
+ GridView {
+ id: adultView
+ anchors.fill: parent
+ cellWidth: 5*mm
+ cellHeight: 5*mm
+ clip: true
+ model: adultModel
+ delegate: smileyItem
+ }
+
+ ListModel{
+ id: adultModel
+ }
+ Component.onCompleted:{
+ for (var icon in Smileyjs.adult){
+ adultModel.append({"emoji":Smileyjs.adult[icon]})
+ }
+ }
+ }
+ }
+ }
+ Component{
+ id:smileyItem
+ AnimatedImage{id:smileyImage
+ width:4.5*mm
+ height: 4.5*mm
+ fillMode:Image.PreserveAspectFit
+ source:emoji.url
+
+ MouseArea{
+ anchors.fill: parent
+ onClicked:{
+ //bodyField.append(emoji.name+" ")
+ bodyField.insert(bodyField.cursorPosition,emoji.name+" ");
+ smileyDialog.destroy()
+ }
+ }
+ }
+ }
+ }
diff --git a/source-android/qml/photoqml/ImageUploadDialog.qml b/source-android/qml/photoqml/ImageUploadDialog.qml
new file mode 100644
index 0000000..ca379f0
--- /dev/null
+++ b/source-android/qml/photoqml/ImageUploadDialog.qml
@@ -0,0 +1,270 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.7
+import QtQuick.Controls 1.4
+import "qrc:/js/service.js" as Service
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/genericqml"
+
+Rectangle{
+ id:imageDialog
+ property var attachImageURLs: []
+ property var contacts: []
+ property var groups: []
+ property var contact_allow:login.permissions[0]
+ property var contact_deny:login.permissions[1]
+ property var group_allow:login.permissions[2]
+ property var group_deny:login.permissions[3]
+ property int imageNo: 0
+
+ function uploadSelectedImage(inumber){
+ xhr.url= login.server + "/api/friendica/photo/create.json";
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.clearParams();
+ xhr.setParam("desc",imageUploadModel.get(inumber).description);
+ xhr.setParam("album", album.currentText);
+ //if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))};
+ //if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))};
+ //if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))};
+ //if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))};
+ xhr.setImageFileParam("media", imageUploadModel.get(inumber).imageUrl );
+ xhr.post();
+ }
+
+ function attachImage(url){
+ imageUploadModel.append({"imageUrl":url,"description":""})
+ }
+
+ //border.color: "grey"
+ y:1
+ width:root.width-mm
+ height:root.height-5*mm
+ property string directory: ""
+
+ Connections{
+ target:xhr
+ onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
+ onSuccess:{
+ imageNo=imageNo+1;
+ if(imageNo0){
+ uploadSelectedImage(0)
+ }}
+ }
+ }
+ ProgressBar{
+ id: newimageProgress
+ width: 15*mm
+ height: buttonRow.height
+ anchors.top: parent.top
+ anchors.right:buttonRow.left
+ anchors.rightMargin:mm
+ visible: false
+ value: imageNo/imageUploadModel.count
+ }
+
+ Component.onCompleted:{
+ albumModel.append({"text":""});
+ try{Helperjs.readField("album",db,"imageData",login.username,function(storedAlbums){
+ for (var n in storedAlbums){
+ albumModel.append({"text":storedAlbums[n]})}
+ })}
+ catch (e){print(e)}
+ if(attachImageURLs.length>0){
+ for (var n in attachImageURLs){attachImage(attachImageURLs[n])}
+ }
+ }
+// BusyIndicator{
+// id: imageBusy
+// anchors.horizontalCenter: imageUploadView.horizontalCenter
+// anchors.top:imageUploadView.top
+// anchors.topMargin: 2*mm
+// width:10*mm
+// height: 10*mm
+// running:false
+// }
+}
diff --git a/src/qml/photoqml/PhotoComponent.qml b/source-android/qml/photoqml/PhotoComponent.qml
similarity index 88%
rename from src/qml/photoqml/PhotoComponent.qml
rename to source-android/qml/photoqml/PhotoComponent.qml
index 347f9c3..2e4f29b 100644
--- a/src/qml/photoqml/PhotoComponent.qml
+++ b/source-android/qml/photoqml/PhotoComponent.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,9 +29,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
-import "qrc:/qml/photoqml"
+import QtQuick 2.7
+import QtQuick.Controls 1.2
Package {
Item { id: stackItem; Package.name: 'stack'; z: stackItem.PathView.z;width:16.5*mm;height:16.5*mm}
@@ -43,7 +42,6 @@ Package {
width: 16.5*mm; height: 16.5*mm
z: stackItem.PathView.z
property string hqphotolink: photoLink
- property string imageId:""
Rectangle {
id: placeHolder
@@ -78,18 +76,13 @@ Package {
width:15*mm
anchors.bottom: photoWrapper.bottom
color: "white"
- font.pointSize: osSettings.systemFontSize
+ font.pixelSize: 2*mm
wrapMode:Text.Wrap
}
MouseArea {
width: realImage.paintedWidth; height: realImage.paintedHeight; anchors.centerIn: realImage
onPressAndHold:{
- var menuString="import QtQuick 6.3;import QtQuick.Controls 6.3; "+
- "Menu {MenuItem {text:qsTr('Delete on client and server'); onTriggered: {"+
- "changeimage('delete','image','"+imageLocation+"');photoModel.remove(index)}}"+
- "MenuItem {text:qsTr('Move to album'); onTriggered: {"+
- "changeimage('update','image','"+imageId+"');}}"+
- "}";
+ var menuString="import QtQuick.Controls 1.4; Menu {MenuItem{text:qsTr('Delete on client and server'); onTriggered: {deletepics('image','"+imageLocation+"');photoModel.remove(index)}}}";
var imagemenuObject=Qt.createQmlObject(menuString,photoWrapper,"imagemenuOutput")
imagemenuObject.popup()
}
@@ -113,6 +106,7 @@ Package {
enabled: false
}
+ // onStateChanged: print("State"+photoWrapper.state+index)
states: [
State {
name: 'stacked'; when: albumWrapper.state == ''
diff --git a/source-android/qml/photoqml/PhotoTab.qml b/source-android/qml/photoqml/PhotoTab.qml
new file mode 100644
index 0000000..de6e1da
--- /dev/null
+++ b/source-android/qml/photoqml/PhotoTab.qml
@@ -0,0 +1,278 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import QtQml.Models 2.1
+import "qrc:/js/image.js" as Imagejs
+import "qrc:/js/helper.js" as Helperjs
+import "qrc:/qml/photoqml"
+import "qrc:/qml/genericqml"
+
+
+StackView{
+ id: photoStack
+ anchors.fill:parent
+ initialItem:Rectangle {
+ id:fotorectangle
+ y:1
+ width:root.width-mm
+ height:root.height-5*mm
+ color: '#fff'
+ property var newimages:[]
+ property int currentimageno: 0
+ property bool remoteContact: false
+
+ onNewimagesChanged:{
+ if(fotorectangle.newimages.length>0){
+ //print("newimages "+JSON.stringify(newimages));
+ var ownimagelist=[];
+ Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
+ for (var i=0;i
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,8 +29,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
+import QtQuick 2.0
+import QtQuick.Controls 1.3
import QtQml.Models 2.1
//import "qrc:/js/service.js" as Service
import "qrc:/js/image.js" as Imagejs
@@ -93,7 +93,7 @@ Package {
wrapMode:Text.Wrap
color: "white"
font.family: "Monospace"
- font.pointSize: osSettings.systemFontSize
+ font.pixelSize: 2*mm
anchors.bottom: albumWrapper.bottom
}
@@ -112,30 +112,20 @@ Package {
}
})}
else{
- Helperjs.friendicaRequest(login,"/api/friendica/photoalbum?album="+albumname,parent,function(obj){
- if(obj){ let albumphotos=JSON.parse(obj);
- for (var k=0;k
+
+
+
+ CalendarTab
+
+
+ Events
+ Termine
+
+
+
+ Own Calendar
+ Eigener Kalender
+
+
+
+ ConfigTab
+
+
+
+
+ User
+ Name
+
+
+
+ Server
+ Server
+
+
+
+ Nickname
+ Kurzname
+
+
+
+ Password
+ Passwort
+
+
+
+ Image dir.
+ Bildverz.
+
+
+
+ Max. News
+ Max. Nachr.
+
+
+
+ News as
+ Anzeige
+
+
+
+ Interval (0=None)
+ Intervall (0=keins)
+
+
+
+
+
+ Error
+ Fehler
+
+
+
+ Nickname not registered at given server!
+ Name auf der Seite nicht registriert!
+
+
+
+ Confirm
+ Bestätigen
+
+
+
+ No server given!
+ Kein Server angegeben!
+
+
+
+ No nickname given!
+ Kein Kurzname angegeben!
+
+
+
+ Nickname not registered at given server!
+ Name auf der Seite nicht registriert!
+
+
+ No username given!
+ Kein Nutzername angegeben!
+
+
+
+ No password given!
+ Kein Passwort angegeben!
+
+
+
+ No image directory given!
+ Kein Verzeichnis für Bilder angegeben!
+
+
+
+ No maximum news number given!
+ Maximale News-Anzahl nicht angegeben!
+
+
+
+ Wrong password!
+ Falsches Passwort!
+
+
+
+ Success
+ Bestätigt
+
+
+
+ Name
+ Name
+
+
+
+ Timeline
+ Chronologisch
+
+
+
+ Conversations
+ Unterhaltungen
+
+
+
+ ContactComponent
+
+
+ Connect
+ Kontaktanfrage
+
+
+
+ ContactDetailsComponent
+
+
+ Connect
+ Kontaktanfrage
+
+
+
+ Description
+ Beschreibung
+
+
+
+ Location
+ Ort
+
+
+
+ Posts
+ Beiträge
+
+
+
+ URL
+ Profilseite
+
+
+
+ Created at
+ Erstellt
+
+
+
+ FriendsTab
+
+
+ Me
+ Ich
+
+
+
+ Friends
+ Freunde
+
+
+
+ Contacts
+ Kontakte
+
+
+
+ Groups
+ Gruppen
+
+
+
+ GroupComponent
+
+ Error
+ Fehler
+
+
+ No name given
+ Kein Name angegeben
+
+
+
+ ImageUploadDialog
+
+
+ Upload to album
+ In Album hochladen
+
+
+
+ Album
+ Album
+
+
+
+ Image
+ Bild
+
+
+
+ Description
+ Beschreibung
+
+
+
+ Upload
+ Hochladen
+
+
+
+ Error
+ Fehler
+
+
+
+ No album name given
+ Kein Albumname angegeben
+
+
+
+ MessageSend
+
+
+ Title (optional)
+ Überschrift (optional)
+
+
+
+ Error
+ Fehler
+
+
+
+ Only one attachment supported at the moment.
+ Remove other attachment first!
+ Nur ein Anhang derzeit unterstützt.
+ Lösche zuerst den anderen Anhang!
+
+
+
+ NewsTab
+
+ Download profile image for
+ Lade Profilbild für
+
+
+
+ More
+ Mehr
+
+
+
+ Timeline
+ Chronologisch
+
+
+
+ Error
+ Fehler
+
+
+
+ Favorites
+ Markierte News
+
+
+
+ Conversations
+ Unterhaltungen
+
+
+
+ Public timeline
+ Gemeinschaft
+
+
+
+ Direct Messages
+ Direktnachrichten
+
+
+
+ Notifications
+ Meldungen
+
+
+
+ Group news
+ News Gruppe
+
+
+
+ Quit
+ Schliessen
+
+
+
+ Newsitem
+
+
+ attending:
+ Teilnahme
+
+
+
+ Source:
+ Quelle:
+
+
+
+ Direct Message
+ Direktnachricht
+
+
+
+ In reply to
+ Antwort an
+
+
+
+ comments
+ Kommentare
+
+
+
+ Attending:
+ Teilnahme:
+
+
+
+ Reply
+ Antworten
+
+
+
+ DM
+ Direktnachricht
+
+
+
+ Repost
+ Teilen
+
+
+
+ Success!
+ Erledigt!
+
+
+
+ Conversation
+ Unterhaltung
+
+
+
+ Attending
+ Teilnahme
+
+
+
+ yes
+ ja
+
+
+
+ maybe
+ vielleicht
+
+
+
+ no
+ nein
+
+
+
+ Delete
+ Löschen
+
+
+
+ PermissionDialog
+
+
+ Friends
+ Freunde
+
+
+
+ Groups
+ Gruppen
+
+
+
+ PhotoTab
+
+
+ 's images
+ s Bilder
+
+
+
+ All Images
+ Alle Bilder
+
+
+
+ Only new
+ Nur neue
+
+
+
+
+ Own Images
+ Eigene Bilder
+
+
+
+ More
+ Mehr
+
+
+
+ ProfileComponent
+
+
+ profile name
+ Profilname
+
+
+
+ is default
+ Hauptprofil
+
+
+
+ hide friends
+ Verberge Freunde
+
+
+
+ profile photo
+ Profilbild
+
+
+
+ profile thumb
+ Mini-Profilbild
+
+
+
+ publish
+ öffentlich
+
+
+
+ publish in network
+ Öffentlich im Netzwerk
+
+
+
+ description
+ Beschreibung
+
+
+
+ date of birth
+ Geburtstag
+
+
+
+ address
+ Adresse
+
+
+
+ city
+ Stadt
+
+
+
+ region
+ Region
+
+
+
+ postal code
+ Postleitzahl
+
+
+
+ country
+ Land
+
+
+
+ hometown
+ Heimatstadt
+
+
+
+ gender
+ Geschlecht
+
+
+
+ marital status
+ Beziehungsstatus
+
+
+
+ married with
+ verheiratet mit
+
+
+
+ married since
+ verheiratet seit
+
+
+
+ sexual
+ Sex
+
+
+
+ politics
+ Politik
+
+
+
+ religion
+ Religion
+
+
+
+ public keywords
+ öffentliche Schlagwörter
+
+
+
+ private keywords
+ private Schlagwörter
+
+
+
+ likes
+ Vorlieben
+
+
+
+ dislikes
+ Abneigungen
+
+
+
+ about
+ über
+
+
+
+ music
+ Musik
+
+
+
+ book
+ Bücher
+
+
+
+ tv
+ TV
+
+
+
+ film
+ Filme
+
+
+
+ interest
+ Interessen
+
+
+
+ romance
+ Liebschaften
+
+
+
+ work
+ Arbeit
+
+
+
+ education
+ Bildung
+
+
+
+ social networks
+ Soziale Netzwerke
+
+
+
+ homepage
+ Homepage
+
+
+
+ Update
+ Aktualisieren
+
+
+
+ profile id
+ Profil-Nummer
+
+
+
+ Description
+ Beschreibung
+
+
+
+ Location
+ Ort
+
+
+
+ Posts
+ Beiträge
+
+
+
+ URL
+ Profilseite
+
+
+
+ Created at
+ Erstellt
+
+
+
+ SmileyDialog
+
+
+ Standard
+ Standard
+
+
+
+ Addon
+ Addon
+
+
+
+ Adult
+ XXX
+
+
+
+ newsworker
+
+
+ likes this.
+ mag das.
+
+
+
+ like this.
+ mögen das.
+
+
+
+ doesn't like this.
+ mag das nicht.
+
+
+
+ don't like this.
+ mögen das nicht.
+
+
+
+ will attend.
+ nehmen teil.
+
+
+
+ persons will attend.
+ Personen nehmen teil.
+
+
+
+ will not attend.
+ nimmt nicht teil.
+
+
+
+ persons will not attend.
+ Personen nehmen nicht teil.
+
+
+
+ may attend.
+ nimmt vielleicht teil.
+
+
+
+ persons may attend.
+ Personen nehmen vielleicht teil.
+
+
+
+ yes
+ ja
+
+
+
+ no
+ nein
+
+
+
+ maybe
+ vielleicht
+
+
+
+ seconds
+ Sekunden
+
+
+
+
+
+
+
+
+
+
+
+
+ ago
+ her
+
+
+
+ minute
+ Minute
+
+
+
+ minutes
+ Minuten
+
+
+
+ hour
+ Stunde
+
+
+
+ hours
+ Stunden
+
+
+
+ day
+ Tag
+
+
+
+ days
+ Tage
+
+
+
+ month
+ Monat
+
+
+
+ months
+ Monate
+
+
+
+ years
+
+
+
+
+ service
+
+
+
+
+ Error
+ Fehler
+
+
+
diff --git a/source-android/translations/friendiqa-es.qm b/source-android/translations/friendiqa-es.qm
new file mode 100644
index 0000000..4bd80da
Binary files /dev/null and b/source-android/translations/friendiqa-es.qm differ
diff --git a/source-android/translations/friendiqa-es.ts b/source-android/translations/friendiqa-es.ts
new file mode 100644
index 0000000..1b22144
--- /dev/null
+++ b/source-android/translations/friendiqa-es.ts
@@ -0,0 +1,825 @@
+
+
+
+
+ CalendarTab
+
+
+ Events
+ Eventos
+
+
+
+ Own Calendar
+ Calendario propio
+
+
+
+ ConfigTab
+
+
+
+
+ User
+ Usuario
+
+
+
+ Server
+ Servidor
+
+
+
+ Nickname
+
+
+
+
+ Password
+ Contraseña
+
+
+
+ Image dir.
+ Dir. de imágenes
+
+
+
+ Max. News
+ Nº Max. de noticias.
+
+
+
+ News as
+ Noticias como
+
+
+
+ Interval (0=None)
+ Intervalo (0=ningún)
+
+
+
+
+
+ Error
+ Error
+
+
+
+ Nickname not registered at given server!
+
+
+
+
+ Confirm
+ Confirmar
+
+
+
+ No server given!
+ ¡Servidor no encontrado!
+
+
+
+ No nickname given!
+
+
+
+
+ Nickname not registered at given server!
+
+
+
+ No username given!
+ ¡Usuario incorrecto!
+
+
+
+ No password given!
+ ¡Contraseña incorrecta!
+
+
+
+ No image directory given!
+ ¡No se ha encontrado el directorio de imágenes!
+
+
+
+ No maximum news number given!
+ ¡Nº máximo de noticias incorrecto!
+
+
+
+ Wrong password!
+
+
+
+
+ Success
+
+
+
+
+ Name
+
+
+
+
+ Timeline
+ Cronología
+
+
+
+ Conversations
+ Conversaciones
+
+
+
+ ContactComponent
+
+
+ Connect
+ Conectar
+
+
+
+ ContactDetailsComponent
+
+
+ Connect
+ Conectar
+
+
+
+ Description
+ Descripción
+
+
+
+ Location
+ Localización
+
+
+
+ Posts
+ Mensajes
+
+
+
+ URL
+ URL
+
+
+
+ Created at
+ Creado en
+
+
+
+ FriendsTab
+
+
+ Me
+
+
+
+
+ Friends
+ Amigos
+
+
+
+ Contacts
+ Contactos
+
+
+
+ Groups
+ Grupos
+
+
+
+ ImageUploadDialog
+
+
+ Upload to album
+
+
+
+
+ Album
+ álbum
+
+
+
+ Image
+ imagen
+
+
+
+ Description
+ Descripción
+
+
+
+ Upload
+ Subir
+
+
+
+ Error
+ Error
+
+
+
+ No album name given
+ ¡Nombre del álbum no encontrado!
+
+
+
+ MessageSend
+
+
+ Title (optional)
+ Título (opcional)
+
+
+
+ Error
+ Error
+
+
+
+ Only one attachment supported at the moment.
+ Remove other attachment first!
+ Solo se admite adjuntar un solo archivo en este momento.
+ ¡Elimine y deje un archivo adjunto!
+
+
+
+ NewsTab
+
+ Download profile image for
+ Descargar la imagen del perfil para
+
+
+
+ More
+ Mas
+
+
+
+ Timeline
+ Cronología
+
+
+
+ Error
+ Error
+
+
+
+ Favorites
+ Favoritos
+
+
+
+ Conversations
+ Conversaciones
+
+
+
+ Public timeline
+
+
+
+
+ Direct Messages
+
+
+
+
+ Notifications
+ Notificaciones
+
+
+
+ Group news
+
+
+
+
+ Quit
+
+
+
+
+ Newsitem
+
+
+ attending:
+ Asistiendo:
+
+
+
+ Source:
+ Fuente:
+
+
+
+ Direct Message
+ Mensaje directo
+
+
+
+ In reply to
+ En respuesta a
+
+
+
+ comments
+ comentarios
+
+
+
+ Attending:
+ Asistiendo:
+
+
+
+ Reply
+ Respuesta
+
+
+
+ DM
+ Mensaje directo
+
+
+
+ Repost
+ Volver a publicar
+
+
+
+ Success!
+ éxito!
+
+
+
+ Conversation
+ Conversación
+
+
+
+ Attending
+ Asistiendo
+
+
+
+ yes
+ si
+
+
+
+ maybe
+ quizás
+
+
+
+ no
+ no
+
+
+
+ Delete
+ Borrar
+
+
+
+ PermissionDialog
+
+
+ Friends
+ Amigos
+
+
+
+ Groups
+ Grupos
+
+
+
+ PhotoTab
+
+
+ 's images
+ s Imágenes
+
+
+
+ All Images
+
+
+
+
+ Only new
+
+
+
+
+
+ Own Images
+ Mis imágenes
+
+
+
+ More
+ Mas
+
+
+
+ ProfileComponent
+
+
+ profile name
+
+
+
+
+ is default
+
+
+
+
+ hide friends
+
+
+
+
+ profile photo
+
+
+
+
+ profile thumb
+
+
+
+
+ publish
+
+
+
+
+ publish in network
+
+
+
+
+ description
+
+
+
+
+ date of birth
+
+
+
+
+ address
+
+
+
+
+ city
+
+
+
+
+ region
+
+
+
+
+ postal code
+
+
+
+
+ country
+
+
+
+
+ hometown
+
+
+
+
+ gender
+
+
+
+
+ marital status
+
+
+
+
+ married with
+
+
+
+
+ married since
+
+
+
+
+ sexual
+
+
+
+
+ politics
+
+
+
+
+ religion
+
+
+
+
+ public keywords
+
+
+
+
+ private keywords
+
+
+
+
+ likes
+
+
+
+
+ dislikes
+
+
+
+
+ about
+
+
+
+
+ music
+
+
+
+
+ book
+
+
+
+
+ tv
+
+
+
+
+ film
+
+
+
+
+ interest
+
+
+
+
+ romance
+
+
+
+
+ work
+
+
+
+
+ education
+
+
+
+
+ social networks
+
+
+
+
+ homepage
+
+
+
+
+ Update
+
+
+
+
+ profile id
+
+
+
+
+ Description
+ Descripción
+
+
+
+ Location
+ Localización
+
+
+
+ Posts
+ Mensajes
+
+
+
+ URL
+ URL
+
+
+
+ Created at
+ Creado en
+
+
+
+ SmileyDialog
+
+
+ Standard
+ Standard
+
+
+
+ Addon
+ Addon
+
+
+
+ Adult
+ XXX
+
+
+
+ newsworker
+
+
+ likes this.
+ le gusta esto.
+
+
+
+ like this.
+ me gusta esto.
+
+
+
+ doesn't like this.
+ no de ése.
+
+
+
+ don't like this.
+ no me gusta.
+
+
+
+ will attend.
+ asistirá.
+
+
+
+ persons will attend.
+ Personas que asistirán.
+
+
+
+ will not attend.
+ no asistirá.
+
+
+
+ persons will not attend.
+ Personas que no asistirán..
+
+
+
+ may attend.
+ Puede asistir.
+
+
+
+ persons may attend.
+ Personas que pueden asistir.
+
+
+
+ yes
+ si
+
+
+
+ no
+ no
+
+
+
+ maybe
+ quizás
+
+
+
+ seconds
+ Segundos
+
+
+
+
+
+
+
+
+
+
+
+
+ ago
+ hace
+
+
+
+ minute
+ Minuto
+
+
+
+ minutes
+ Minutos
+
+
+
+ hour
+ Hora
+
+
+
+ hours
+ Horas
+
+
+
+ day
+ Dia
+
+
+
+ days
+ Dias
+
+
+
+ month
+ Mes
+
+
+
+ months
+ Meses
+
+
+
+ years
+ Años
+
+
+
+ service
+
+
+
+
+ Error
+ Error
+
+
+
diff --git a/source-android/translations/friendiqa-it.qm b/source-android/translations/friendiqa-it.qm
new file mode 100644
index 0000000..4dfcf94
Binary files /dev/null and b/source-android/translations/friendiqa-it.qm differ
diff --git a/source-android/translations/friendiqa-it.ts b/source-android/translations/friendiqa-it.ts
new file mode 100644
index 0000000..658670b
--- /dev/null
+++ b/source-android/translations/friendiqa-it.ts
@@ -0,0 +1,825 @@
+
+
+
+
+ CalendarTab
+
+
+ Events
+ Eventi
+
+
+
+ Own Calendar
+ Calendario
+
+
+
+ ConfigTab
+
+
+
+
+ User
+ Utente
+
+
+
+ Server
+ Server
+
+
+
+ Nickname
+
+
+
+
+ Password
+ Password
+
+
+
+ Image dir.
+ Directory immagini
+
+
+
+ Max. News
+ Nº Max. di notizie
+
+
+
+ News as
+ News come
+
+
+
+ Interval (0=None)
+ Intervallo (0=nessuno)
+
+
+
+
+
+ Error
+ Errore
+
+
+
+ Nickname not registered at given server!
+
+
+
+
+ Confirm
+ Conferma
+
+
+
+ No server given!
+ Nessun server inserito!
+
+
+
+ No nickname given!
+
+
+
+
+ Nickname not registered at given server!
+
+
+
+ No username given!
+ Nessun utente inserito!
+
+
+
+ No password given!
+ Nessuna password inserita!
+
+
+
+ No image directory given!
+ Nessuna directory immagini inserita!
+
+
+
+ No maximum news number given!
+ Nessun numero massimo di news inserito!
+
+
+
+ Wrong password!
+
+
+
+
+ Success
+
+
+
+
+ Name
+
+
+
+
+ Timeline
+ Cronologia
+
+
+
+ Conversations
+ Conversazioni
+
+
+
+ ContactComponent
+
+
+ Connect
+ Connetti
+
+
+
+ ContactDetailsComponent
+
+
+ Connect
+ Connetti
+
+
+
+ Description
+ Descrizione
+
+
+
+ Location
+ Località
+
+
+
+ Posts
+ Messaggi
+
+
+
+ URL
+ URL
+
+
+
+ Created at
+ Creato il
+
+
+
+ FriendsTab
+
+
+ Me
+
+
+
+
+ Friends
+ Amici
+
+
+
+ Contacts
+ Contatti
+
+
+
+ Groups
+ Gruppi
+
+
+
+ ImageUploadDialog
+
+
+ Upload to album
+
+
+
+
+ Album
+ Album
+
+
+
+ Image
+ Immagine
+
+
+
+ Description
+ Descrizione
+
+
+
+ Upload
+ Carica
+
+
+
+ Error
+ Errore
+
+
+
+ No album name given
+ Nessun nome album inserito!
+
+
+
+ MessageSend
+
+
+ Title (optional)
+ Titolo (opzionale)
+
+
+
+ Error
+ Errore
+
+
+
+ Only one attachment supported at the moment.
+ Remove other attachment first!
+ Solo un allegato è attualmente supportato.
+ Rimuovere prima gli altri allegati!
+
+
+
+ NewsTab
+
+ Download profile image for
+ Download immagine profilo per
+
+
+
+ More
+ Ancora
+
+
+
+ Timeline
+ Cronologia
+
+
+
+ Error
+ Errore
+
+
+
+ Favorites
+ Favoriti
+
+
+
+ Conversations
+ Conversazioni
+
+
+
+ Public timeline
+
+
+
+
+ Direct Messages
+
+
+
+
+ Notifications
+ Notifiche
+
+
+
+ Group news
+
+
+
+
+ Quit
+
+
+
+
+ Newsitem
+
+
+ attending:
+ attendere:
+
+
+
+ Source:
+ Codice:
+
+
+
+ Direct Message
+ Messaggio diretto
+
+
+
+ In reply to
+ In risposta a
+
+
+
+ comments
+ commenti
+
+
+
+ Attending:
+ Attendi:
+
+
+
+ Reply
+ Risposta
+
+
+
+ DM
+ Messaggio diretto
+
+
+
+ Repost
+ Condividi
+
+
+
+ Success!
+ Ha funzionato!
+
+
+
+ Conversation
+ Conversazione
+
+
+
+ Attending
+ Attendi
+
+
+
+ yes
+ si
+
+
+
+ maybe
+ potrebbe
+
+
+
+ no
+ no
+
+
+
+ Delete
+ Cancella
+
+
+
+ PermissionDialog
+
+
+ Friends
+ Amici
+
+
+
+ Groups
+ Gruppi
+
+
+
+ PhotoTab
+
+
+ 's images
+ Immagini
+
+
+
+ All Images
+
+
+
+
+ Only new
+
+
+
+
+
+ Own Images
+ Mie immagini
+
+
+
+ More
+ Ancora
+
+
+
+ ProfileComponent
+
+
+ profile name
+
+
+
+
+ is default
+
+
+
+
+ hide friends
+
+
+
+
+ profile photo
+
+
+
+
+ profile thumb
+
+
+
+
+ publish
+
+
+
+
+ publish in network
+
+
+
+
+ description
+
+
+
+
+ date of birth
+
+
+
+
+ address
+
+
+
+
+ city
+
+
+
+
+ region
+
+
+
+
+ postal code
+
+
+
+
+ country
+
+
+
+
+ hometown
+
+
+
+
+ gender
+
+
+
+
+ marital status
+
+
+
+
+ married with
+
+
+
+
+ married since
+
+
+
+
+ sexual
+
+
+
+
+ politics
+
+
+
+
+ religion
+
+
+
+
+ public keywords
+
+
+
+
+ private keywords
+
+
+
+
+ likes
+
+
+
+
+ dislikes
+
+
+
+
+ about
+
+
+
+
+ music
+
+
+
+
+ book
+
+
+
+
+ tv
+
+
+
+
+ film
+
+
+
+
+ interest
+
+
+
+
+ romance
+
+
+
+
+ work
+
+
+
+
+ education
+
+
+
+
+ social networks
+
+
+
+
+ homepage
+
+
+
+
+ Update
+
+
+
+
+ profile id
+
+
+
+
+ Description
+ Descrizione
+
+
+
+ Location
+ Località
+
+
+
+ Posts
+ Messaggi
+
+
+
+ URL
+ URL
+
+
+
+ Created at
+ Creato il
+
+
+
+ SmileyDialog
+
+
+ Standard
+ Standard
+
+
+
+ Addon
+ Addon
+
+
+
+ Adult
+ XXX
+
+
+
+ newsworker
+
+
+ likes this.
+ mi piace.
+
+
+
+ like this.
+ mi piace.
+
+
+
+ doesn't like this.
+ non mi piace.
+
+
+
+ don't like this.
+ non mi piace.
+
+
+
+ will attend.
+ attendere.
+
+
+
+ persons will attend.
+ Persone che attendono.
+
+
+
+ will not attend.
+ non aspettare.
+
+
+
+ persons will not attend.
+ Persone che non aspettano.
+
+
+
+ may attend.
+ puoi attendere.
+
+
+
+ persons may attend.
+ Persone che possono attendere.
+
+
+
+ yes
+ si
+
+
+
+ no
+ no
+
+
+
+ maybe
+ potrebbe
+
+
+
+ seconds
+ secondi
+
+
+
+
+
+
+
+
+
+
+
+
+ ago
+ fa
+
+
+
+ minute
+ minuti
+
+
+
+ minutes
+ minuti
+
+
+
+ hour
+ ora
+
+
+
+ hours
+ ore
+
+
+
+ day
+ giorno
+
+
+
+ days
+ giorni
+
+
+
+ month
+ mese
+
+
+
+ months
+ mesi
+
+
+
+ years
+ anni
+
+
+
+ service
+
+
+
+
+ Error
+ Errore
+
+
+
diff --git a/source-linux/application.qrc b/source-linux/application.qrc
new file mode 100644
index 0000000..256445b
--- /dev/null
+++ b/source-linux/application.qrc
@@ -0,0 +1,225 @@
+
+
+ qml/friendiqa.qml
+ qml/newsqml/NewsTab.qml
+ qml/newsqml/Newsitem.qml
+ qml/newsqml/MessageSend.qml
+ qml/newsqml/Conversation.qml
+ qml/newsqml/FriendicaActivities.qml
+ qml/contactqml/FriendsTab.qml
+ qml/contactqml/GroupComponent.qml
+ qml/contactqml/ContactComponent.qml
+ qml/contactqml/ContactDetailsComponent.qml
+ qml/contactqml/Contactlist.qml
+ qml/genericqml/BlueButton.qml
+ qml/photoqml/PhotoComponent.qml
+ qml/photoqml/PhotogroupComponent.qml
+ qml/photoqml/PhotoTab.qml
+ qml/configqml/InfoBox.qml
+ qml/configqml/ConfigTab.qml
+ js/layout.js
+ js/photoworker.js
+ js/service.js
+ js/news.js
+ js/newsworker.js
+ js/helper.js
+ images/defaultcontact.jpg
+ images/fontawesome-webfont.ttf
+ images/folder-blue.png
+ qml/configqml/OSSettingsAndroid.qml
+ qml/configqml/OSSettingsLinux.qml
+ qml/newsqml/SmileyDialog.qml
+ js/smiley.js
+ images/smileys/animals/bee.gif
+ images/smileys/animals/bigspider.gif
+ images/smileys/animals/bunny.gif
+ images/smileys/animals/bunnyflowers.gif
+ images/smileys/animals/cat.gif
+ images/smileys/animals/chick.gif
+ images/smileys/animals/cow.gif
+ images/smileys/animals/crab.gif
+ images/smileys/animals/dog.gif
+ images/smileys/animals/dolphin.gif
+ images/smileys/animals/dragonfly.gif
+ images/smileys/animals/elephant.gif
+ images/smileys/animals/fish.gif
+ images/smileys/animals/frog.gif
+ images/smileys/animals/giraffe.gif
+ images/smileys/animals/hamster.gif
+ images/smileys/animals/horse.gif
+ images/smileys/animals/ladybird.gif
+ images/smileys/animals/monkey.gif
+ images/smileys/animals/parrot.gif
+ images/smileys/animals/pig.gif
+ images/smileys/animals/sheep.gif
+ images/smileys/animals/snail.gif
+ images/smileys/animals/tux.gif
+ images/smileys/babies/baby.gif
+ images/smileys/babies/babycot.gif
+ images/smileys/babies/pregnant.gif
+ images/smileys/babies/stork.gif
+ images/smileys/confused/confused.gif
+ images/smileys/confused/dazed.gif
+ images/smileys/confused/shrug.gif
+ images/smileys/confused/stupid.gif
+ images/smileys/cool/affro.gif
+ images/smileys/cool/cool.gif
+ images/smileys/devilangel/angel.gif
+ images/smileys/devilangel/blondedevil.gif
+ images/smileys/devilangel/catdevil.gif
+ images/smileys/devilangel/cherub.gif
+ images/smileys/devilangel/daseesaw.gif
+ images/smileys/devilangel/devil.gif
+ images/smileys/devilangel/graveside.gif
+ images/smileys/devilangel/saint.gif
+ images/smileys/devilangel/turnevil.gif
+ images/smileys/disgust/fartblush.gif
+ images/smileys/disgust/fartinbed.gif
+ images/smileys/disgust/toilet.gif
+ images/smileys/disgust/vomit.gif
+ images/smileys/drink/tea.gif
+ images/smileys/drool/drool.gif
+ images/smileys/fantasy/alienmonster.gif
+ images/smileys/fantasy/barbarian.gif
+ images/smileys/fantasy/dinosaur.gif
+ images/smileys/fantasy/dragon.gif
+ images/smileys/fantasy/dragonwhelp.gif
+ images/smileys/fantasy/ghost.gif
+ images/smileys/fantasy/mummy.gif
+ images/smileys/fight/2guns.gif
+ images/smileys/fight/acid.gif
+ images/smileys/fight/alienfight.gif
+ images/smileys/fight/alpha.png
+ images/smileys/fight/army.gif
+ images/smileys/fight/arrowhead.gif
+ images/smileys/fight/bfg.gif
+ images/smileys/fight/bowman.gif
+ images/smileys/fight/chainsaw.gif
+ images/smileys/fight/crossbow.gif
+ images/smileys/fight/crusader.gif
+ images/smileys/fight/dead.gif
+ images/smileys/fight/gangs.gif
+ images/smileys/fight/hammersplat.gif
+ images/smileys/fight/lasergun.gif
+ images/smileys/fight/machinegun.gif
+ images/smileys/fight/marine.gif
+ images/smileys/fight/sabre.gif
+ images/smileys/fight/samurai.gif
+ images/smileys/fight/tank.gif
+ images/smileys/fight/viking.gif
+ images/smileys/food/apple.gif
+ images/smileys/food/banana.gif
+ images/smileys/food/birthdaycake.gif
+ images/smileys/food/broccoli.gif
+ images/smileys/food/cake.gif
+ images/smileys/food/carrot.gif
+ images/smileys/food/cooking.gif
+ images/smileys/food/fryegg.gif
+ images/smileys/food/popcorn.gif
+ images/smileys/food/tomato.gif
+ images/smileys/happy/cloud9.gif
+ images/smileys/happy/tearsofjoy.gif
+ images/smileys/laugh/hahaha.gif
+ images/smileys/laugh/loltv.gif
+ images/smileys/laugh/rofl.gif
+ images/smileys/love/iloveyou.gif
+ images/smileys/love/inlove.gif
+ images/smileys/love/love.gif
+ images/smileys/love/lovebear.gif
+ images/smileys/love/lovebed.gif
+ images/smileys/love/loveheart.gif
+ images/smileys/music/dj.gif
+ images/smileys/music/drums.gif
+ images/smileys/music/elvis.gif
+ images/smileys/music/guitar.gif
+ images/smileys/music/trumpet.gif
+ images/smileys/music/violin.gif
+ images/smileys/oldcore/beard.png
+ images/smileys/oldcore/headbang.gif
+ images/smileys/oldcore/laughing.gif
+ images/smileys/oldcore/shaka.gif
+ images/smileys/oldcore/surprised.gif
+ images/smileys/oldcore/whitebeard.png
+ images/smileys/respect/bow.gif
+ images/smileys/respect/bravo.gif
+ images/smileys/respect/hailking.gif
+ images/smileys/respect/number1.gif
+ images/smileys/sad/crying.png
+ images/smileys/sad/prisoner.gif
+ images/smileys/sad/sigh.gif
+ images/smileys/smoking/smoking.gif
+ images/smileys/sport/archery.gif
+ images/smileys/sport/basketball.gif
+ images/smileys/sport/bowling.gif
+ images/smileys/sport/cycling.gif
+ images/smileys/sport/darts.gif
+ images/smileys/sport/fencing.gif
+ images/smileys/sport/football.gif
+ images/smileys/sport/golf.gif
+ images/smileys/sport/horseriding.gif
+ images/smileys/sport/juggling.gif
+ images/smileys/sport/skipping.gif
+ images/smileys/sport/snooker.gif
+ images/smileys/sport/surfing.gif
+ images/smileys/sport/tennis.gif
+ images/smileys/tired/countsheep.gif
+ images/smileys/tired/hammock.gif
+ images/smileys/tired/pillow.gif
+ images/smileys/tired/yawn.gif
+ images/smileys/core/beer_mug.gif
+ images/smileys/core/coffee.gif
+ images/smileys/core/dislike.gif
+ images/smileys/core/friendica-16.png
+ images/smileys/core/like.gif
+ images/smileys/core/rm-16.png
+ images/smileys/core/smiley-bangheaddesk.gif
+ images/smileys/core/smiley-brokenheart.gif
+ images/smileys/core/smiley-cool.gif
+ images/smileys/core/smiley-cry.gif
+ images/smileys/core/smiley-embarassed.gif
+ images/smileys/core/smiley-facepalm.gif
+ images/smileys/core/smiley-foot-in-mouth.gif
+ images/smileys/core/smiley-heart.gif
+ images/smileys/core/smiley-kiss.gif
+ images/smileys/core/smiley-laughing.gif
+ images/smileys/core/smiley-Oo.gif
+ images/smileys/core/smiley-smile.gif
+ images/smileys/core/smiley-surprised.gif
+ images/smileys/core/smiley-thumbsup.gif
+ images/smileys/core/smiley-tongue-out.gif
+ images/smileys/core/smiley-undecided.gif
+ images/smileys/core/smiley-wink.gif
+ images/smileys/core/smiley-frown.gif
+ images/smileys/adult/bong.gif
+ images/smileys/adult/drunk.gif
+ images/smileys/adult/finger.gif
+ images/smileys/adult/sperm.gif
+ images/smileys/adult/tits.gif
+ common/filesystem.cpp
+ common/filesystem.h
+ common/friendiqa.cpp
+ common/uploadableimage.cpp
+ common/uploadableimage.h
+ common/xhr.cpp
+ common/xhr.h
+ qml/calendarqml/CalendarTab.qml
+ qml/calendarqml/CalendarDay.qml
+ qml/calendarqml/EventList.qml
+ translations/friendiqa-de.qm
+ translations/friendiqa-de.ts
+ translations/friendiqa-es.qm
+ translations/friendiqa-es.ts
+ qml/photoqml/ImageUploadDialog.qml
+ qml/genericqml/PermissionDialog.qml
+ images/addImage.png
+ qml/genericqml/ImagePicker.qml
+ qml/genericqml/ImagePickerLinux.qml
+ js/image.js
+ qml/contactqml/ProfileComponent.qml
+ translations/friendiqa-it.ts
+ qml/genericqml/Search.qml
+ qml/newsqml/Hashtag.qml
+ qml/genericqml/IntentReceiver.qml
+ qml/newsqml/NewsImage.qml
+
+
diff --git a/src/common/filesystemandroid.cpp b/source-linux/common/filesystem.cpp
similarity index 58%
rename from src/common/filesystemandroid.cpp
rename to source-linux/common/filesystem.cpp
index 07f6540..c1668e4 100644
--- a/src/common/filesystemandroid.cpp
+++ b/source-linux/common/filesystem.cpp
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -30,8 +30,6 @@
// along with this program. If not, see .
#include "filesystem.h"
-#include
-
FILESYSTEM *FILESYSTEM::instance()
{
@@ -53,27 +51,28 @@ QString FILESYSTEM::Directory() const
{
return m_Directory;
}
-void FILESYSTEM::setVisibility(bool Visibility)
-{
- if (Visibility!=m_Visibility) {
- m_Visibility = Visibility;
- emit visibilityChanged();
- }
-}
-
-bool FILESYSTEM::Visibility()
-{
- return m_Visibility;
-}
QString FILESYSTEM::homePath() const
{
- QAndroidJniObject activity =QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative","activity", "()Landroid/app/Activity;");
- QAndroidJniObject dir = activity.callObjectMethod("getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;", NULL);
- QString homeDir=dir.toString();
+ QDir dir(m_Directory);
+ QString homeDir=dir.homePath();
+ //qDebug(homeDir);
return homeDir;
}
+//QString FILESYSTEM::cameraPath() const
+//{
+//QAndroidJniObject object = QAndroidJniObject::getStaticObjectField("android.os.Environment", "DIRECTORY_DCIM");
+//QAndroidJniObject dcim =QAndroidJniObject::callStaticObjectMethod("android.os.Environment","getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", object.object());
+// return dcim.toString();
+//}
+
+
+//bool FILESYSTEM::direxist(QString Directory) const
+//{QDir dir(Directory);
+// return dir.exists();
+//}
+
bool FILESYSTEM::fileexist(QString name)
{ return QFile::exists(name);
}
@@ -84,26 +83,15 @@ void FILESYSTEM::makeDir(QString name)
if (dir.mkdir(name)){
emit success(name);
}
- else {
- emit error(name,1);
- }
-}
-
-void FILESYSTEM::makePath(QString name)
-{
- QDir dir(m_Directory);
- if (dir.mkpath(name)){
- emit success(name);
- }
- else {
- emit error(name,1);}
+ else {emit error(name,1);}
}
void FILESYSTEM::rmDir()
{
QDir dir(m_Directory);
- if (dir.removeRecursively()){
- emit success(m_Directory);
+ //qDebug()<
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#ifndef FILESYSTEM_H
+#define FILESYSTEM_H
+
+#include
+#include
+//#include
+//#include
+
+class FILESYSTEM : public QObject//, public QAndroidActivityResultReceiver
+{
+ Q_OBJECT
+ Q_PROPERTY(QString Directory READ Directory WRITE setDirectory NOTIFY directoryChanged)
+ //Q_PROPERTY(bool direxist READ direxist)
+ Q_PROPERTY(QString homePath READ homePath)
+ //Q_PROPERTY(QString cameraPath READ cameraPath)
+
+
+public:
+ static FILESYSTEM *instance();
+ explicit FILESYSTEM(QObject *parent = 0);
+ void setDirectory(QString Directory);
+ QString Directory() const;
+ QFileInfoList fileList();
+ //bool direxist(QString Directory);
+ QString homePath() const;
+ //QString cameraPath() const;
+ // virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data);
+
+signals:
+ //void imageselected(QString);
+ void directoryChanged();
+ //void fileListContent(QList data);
+ void success(QString data);
+ void error(QString data, int code);
+
+public slots:
+ bool fileexist(QString name);
+ void makeDir(QString name);
+ void rmDir();
+ void rmFile(QString name);
+ //void searchImage();
+ //void fileList();
+
+private:
+ QString m_Directory;
+ QString homeDir;
+ //QList m_Filelist;
+};
+
+#endif // FILSYSTEM_H
diff --git a/source-linux/common/friendiqa.cpp b/source-linux/common/friendiqa.cpp
new file mode 100644
index 0000000..0e4a348
--- /dev/null
+++ b/source-linux/common/friendiqa.cpp
@@ -0,0 +1,76 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#include
+#include
+#include
+#include "xhr.h"
+#include "filesystem.h"
+#include "remoteauthasyncimageprovider.h"
+//#include "AndroidNative/systemdispatcher.h"
+//#include "AndroidNative/environment.h"
+//#include "AndroidNative/debug.h"
+//#include "AndroidNative/mediascannerconnection.h"
+
+
+#ifdef Q_OS_ANDROID
+#include
+#include
+JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
+ Q_UNUSED(vm);
+ qDebug("NativeInterface::JNI_OnLoad()"); // It must call this function within JNI_OnLoad to enable System Dispatcher
+
+ AndroidNative::SystemDispatcher::registerNatives();
+ return JNI_VERSION_1_6;
+ }
+#endif
+
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+ QQuickView view;
+ QTranslator qtTranslator;
+ qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
+ app.installTranslator(&qtTranslator);
+ RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
+ view.engine()->addImageProvider("remoteauthimage",imageProvider);
+ view.rootContext()->setContextProperty("remoteauth", imageProvider);
+ XHR* xhr = XHR::instance();
+ view.rootContext()->setContextProperty("xhr", xhr);
+ FILESYSTEM* filesystem = FILESYSTEM::instance();
+ view.rootContext()->setContextProperty("filesystem", filesystem);
+ view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
+ view.show();
+ view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
+ return app.exec();
+
+}
+
diff --git a/source-linux/common/remoteauthasyncimageprovider.cpp b/source-linux/common/remoteauthasyncimageprovider.cpp
new file mode 100644
index 0000000..66a8b03
--- /dev/null
+++ b/source-linux/common/remoteauthasyncimageprovider.cpp
@@ -0,0 +1,123 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#include "remoteauthasyncimageprovider.h"
+#include
+#include
+
+ AsyncImageResponse::AsyncImageResponse(QNetworkRequest req, QSize reqSize)
+ {
+ m_reply = m_imageLoader.get(req);
+ m_requestedSize = reqSize;
+ connect(m_reply, &QNetworkReply::finished, this, &AsyncImageResponse::onResponseFinished);
+}
+
+
+ void AsyncImageResponse::onResponseFinished()
+ {
+ QByteArray myImageData = m_reply->readAll();
+ m_resultImage = QImage::fromData(myImageData);
+ if (m_requestedSize.isValid())
+ {
+ m_resultImage = m_resultImage.scaled(m_requestedSize);
+ }
+ emit finished();
+ }
+
+
+ QQuickTextureFactory *AsyncImageResponse::textureFactory() const
+ {
+ return QQuickTextureFactory::textureFactoryForImage(m_resultImage);
+ }
+
+
+ RemoteAuthAsyncImageProvider::RemoteAuthAsyncImageProvider()
+ {
+ }
+
+
+ QQuickImageResponse* RemoteAuthAsyncImageProvider::requestImageResponse(const QString &id, const QSize &requestedSize)
+ {
+ QUrl iUrl=url()+"/api/friendica/remoteauth?c_url="+contacturl()+"&url="+id;
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+
+ QNetworkRequest request(iUrl);
+ request.setRawHeader("Authorization", headerData.toLocal8Bit());
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute,true);
+ request.setUrl(iUrl);
+ return new AsyncImageResponse(request, requestedSize);
+ }
+
+
+ void RemoteAuthAsyncImageProvider::setContacturl(QString contacturl)
+ {
+ if (contacturl!=m_contacturl) {
+ m_contacturl = contacturl;
+ emit contacturlChanged();
+ }
+ }
+
+
+ void RemoteAuthAsyncImageProvider::setUrl(QString url)
+ {
+ if (url!=m_url) {
+ m_url = url;
+ emit urlChanged();
+ }
+ }
+
+
+ void RemoteAuthAsyncImageProvider::setLogin(QString login)
+ {
+ if (login!=m_login) {
+ m_login = login;
+ emit loginChanged();
+ }
+ }
+
+
+ QString RemoteAuthAsyncImageProvider::contacturl() const
+ {
+ return m_contacturl;
+ }
+
+
+ QString RemoteAuthAsyncImageProvider::url() const
+ {
+ return m_url;
+ }
+
+
+ QString RemoteAuthAsyncImageProvider::login() const
+ {
+ return m_login;
+ }
diff --git a/source-linux/common/remoteauthasyncimageprovider.h b/source-linux/common/remoteauthasyncimageprovider.h
new file mode 100644
index 0000000..f028ada
--- /dev/null
+++ b/source-linux/common/remoteauthasyncimageprovider.h
@@ -0,0 +1,95 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#ifndef REMOTEAUTHIMAGEPROVIDER_H
+#define REMOTEAUTHIMAGEPROVIDER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+class AsyncImageResponse : public QQuickImageResponse
+{
+ Q_OBJECT
+public:
+ explicit AsyncImageResponse(QNetworkRequest req, QSize requestedSize);
+ QQuickTextureFactory *textureFactory() const;
+
+public slots:
+ void onResponseFinished();
+
+protected:
+ QNetworkAccessManager m_imageLoader;
+ QNetworkReply* m_reply;
+ QSize m_requestedSize;
+ QImage m_resultImage;
+ int m_index;
+ QString m_id;
+ QImage m_image;
+};
+
+class RemoteAuthAsyncImageProvider : public QObject, public QQuickAsyncImageProvider
+{
+ Q_OBJECT
+ Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(QString contacturl READ contacturl WRITE setContacturl NOTIFY contacturlChanged)
+ Q_PROPERTY(QString login READ login WRITE setLogin NOTIFY loginChanged)
+
+public:
+ explicit RemoteAuthAsyncImageProvider();
+ QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) override;
+ QString url() const;
+ QString contacturl() const;
+ QString login() const;
+
+signals:
+ void contacturlChanged();
+ void urlChanged();
+ void loginChanged();
+
+public slots:
+ void setContacturl(QString contacturl);
+ void setUrl(QString url);
+ void setLogin(QString login);
+
+private:
+ QByteArray buffer;
+ QString m_url;
+ QString m_contacturl;
+ QString m_login;
+ QString bufferToString();
+};
+
+#endif // REMOTEAUTHIMAGEPROVIDER_H
diff --git a/source-linux/common/uploadableimage.cpp b/source-linux/common/uploadableimage.cpp
new file mode 100644
index 0000000..7ef3524
--- /dev/null
+++ b/source-linux/common/uploadableimage.cpp
@@ -0,0 +1,121 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#include "uploadableimage.h"
+
+
+#include
+#include
+#include
+#include
+
+void UploadableImage::setSource(const QString &a) {
+ if (a != m_source) {
+ m_source = a;
+ //m_base64 = "";
+ m_mimetype = "";
+ m_filename = "";
+
+ qDebug() << "UploadableImage::setSource : " << m_source;
+
+ if (m_source=="") {
+ emit sourceChanged();
+ //emit base64Changed();
+ emit mimetypeChanged();
+ emit filenameChanged();
+ return;
+ }
+
+ QImage fullimage = QImage(QUrl(m_source).toLocalFile());
+ if (fullimage.width() > 800 || fullimage.height() > 800) {
+ if (fullimage.width() > fullimage.height()) {
+ m_image = fullimage.scaledToWidth(800);
+ } else {
+ m_image = fullimage.scaledToHeight(800);
+ }
+ } else {
+ m_image = fullimage;
+ }
+ qDebug() << "UploadableImage::setSource : " << m_image.width() << "x" << m_image.height();
+ emit sourceChanged();
+
+ QFileInfo fi(m_source);
+
+ m_filename = fi.fileName();
+ emit filenameChanged();
+
+ QString filetype = fi.suffix().toUpper();
+ if (filetype!="PNG" && filetype!="JPG") {
+ filetype = "JPG";
+ }
+ qDebug() << "UploadableImage::setSource : " << "Saving as " << filetype;
+
+ m_mimetype = "image/"+filetype.toLower();
+ emit mimetypeChanged();
+
+ /*
+ QByteArray byteArray;
+ QBuffer buffer(&byteArray);
+ m_image.save(&buffer, filetype.toLatin1().constData());
+ QString b64 = QString::fromLatin1(byteArray.toBase64().data());
+
+ for(int k=0; k
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#ifndef UPLOADABLEIMAGE_H
+#define UPLOADABLEIMAGE_H
+
+#include
+#include
+#include
+
+class UploadableImage : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
+ //Q_PROPERTY(QString base64 READ base64 NOTIFY base64Changed)
+ Q_PROPERTY(QString filename READ filename NOTIFY filenameChanged)
+ Q_PROPERTY(QString mimetype READ mimetype NOTIFY mimetypeChanged)
+ Q_PROPERTY(QByteArray bytes READ bytes)
+
+public:
+ void setSource(const QString &a);
+ QString source() const;
+
+ //QString base64() const;
+ QString filename() const;
+ QString mimetype() const;
+
+ QByteArray bytes();
+signals:
+ void sourceChanged();
+ //void base64Changed();
+ void filenameChanged();
+ void mimetypeChanged();
+
+private:
+ QString m_source;
+ QImage m_image;
+ //QString m_base64;
+ QString m_filename;
+ QString m_mimetype;
+};
+
+#endif // UPLOADABLEIMAGE_H
diff --git a/source-linux/common/xhr.cpp b/source-linux/common/xhr.cpp
new file mode 100644
index 0000000..2a9107f
--- /dev/null
+++ b/source-linux/common/xhr.cpp
@@ -0,0 +1,363 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#include "xhr.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "uploadableimage.h"
+
+XHR *XHR::instance()
+{
+ static XHR xhr;
+ return &xhr;
+}
+
+XHR::XHR(QObject *parent) : QObject(parent)
+{
+ request.setSslConfiguration(QSslConfiguration::defaultConfiguration());
+}
+
+void XHR::setUrl(QString url)
+{
+ if (url!=m_url) {
+ m_url = url;
+ emit urlChanged();
+ }
+}
+
+void XHR::setApi(QString api)
+{
+ if (api!=m_api) {
+ m_api = api;
+ emit apiChanged();
+ }
+}
+
+void XHR::setLogin(QString login)
+{
+ if (login!=m_login) {
+ m_login = login;
+ emit loginChanged();
+ }
+}
+
+void XHR::setFilename(QString filename)
+{
+ if (filename!=m_filename) {
+ m_filename = filename;
+ emit filenameChanged();
+ }
+}
+
+void XHR::setContactlist(QList contactlist)
+{
+ if (contactlist!=m_contactlist) {
+ m_contactlist = contactlist;
+ emit contactlistChanged();
+ }
+}
+
+void XHR::setFilelist(QList filelist)
+{
+ if (filelist!=m_filelist) {
+ m_filelist = filelist;
+ emit filelistChanged();
+ }
+}
+
+void XHR::setImagedir(QString imagedir)
+{
+ if (imagedir!=m_imagedir) {
+ m_imagedir = imagedir;
+ emit imagedirChanged();
+ }
+}
+void XHR::setDownloadtype(QString downloadtype)
+{
+ if (downloadtype!=m_downloadtype) {
+ m_downloadtype = downloadtype;
+ emit downloadtypeChanged();
+ }
+}
+
+QString XHR::url() const
+{
+ return m_url;
+}
+
+QString XHR::api() const
+{
+ return m_api;
+}
+
+QString XHR::login() const
+{
+ return m_login;
+}
+
+QString XHR::filename() const
+{
+ return m_filename;
+}
+
+QList XHR::contactlist() const
+{
+ return m_contactlist;
+}
+
+QList XHR::filelist() const
+{
+ return m_filelist;
+}
+
+QString XHR::imagedir() const
+{
+ return m_imagedir;
+}
+
+QString XHR::downloadtype() const
+{
+ return m_downloadtype;
+}
+
+void XHR::setParam(QString name, QString value)
+{
+ params.insert(name, value);
+}
+
+void XHR::setImageFileParam(QString name, QString url)
+{
+ files.insert(name, url);
+}
+
+void XHR::clearParams()
+{
+ files.clear();
+ params.clear();
+}
+
+void XHR::download()
+{
+ QUrl requrl(m_url);
+ if(m_downloadtype=="picturelist"){
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader("Authorization", headerData.toLocal8Bit());
+ }
+ request.setUrl(requrl);
+ //qDebug() << requrl;
+ reply = manager.get(request);
+ reply->ignoreSslErrors();
+ connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead);
+ //connect(reply,SIGNAL(downloadProgress(qint64,qint64)), this,SLOT(updateDownloadProgress(qint64,qint64)));
+ connect(reply, &QNetworkReply::finished,this, &XHR::onRequestFinished);
+ connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+}
+
+void XHR::get()
+{
+ QUrlQuery query;
+
+ QHashIterator i(params);
+ while(i.hasNext()) {
+ i.next();
+ query.addQueryItem(i.key(), i.value());
+ }
+
+ QUrl requrl(m_url+m_api);
+ //qDebug() << requrl;
+ requrl.setQuery(query);
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader("Authorization", headerData.toLocal8Bit());
+ request.setUrl(requrl);
+ reply = manager.get(request);
+
+ connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+ connect(reply, &QNetworkReply::readyRead, this, &XHR::onReadyRead);
+ connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
+}
+
+void XHR::getlist()
+{
+ if(dlindex < m_filelist.size()) {
+ QString cleanfilename;
+ if (m_downloadtype=="contactlist"){cleanfilename = m_contactlist.at(dlindex)+"-"+ m_filelist.at(dlindex).section('/',-1).section('?',0,0);
+ XHR::setFilename(imagedir()+"contacts/"+cleanfilename);
+ XHR::setUrl(m_filelist.at(dlindex));}
+ else {
+ XHR::setUrl(m_filelist.at(dlindex));}
+ XHR::download();
+ } else {dlindex=0;}
+}
+
+
+void XHR::post()
+{
+ qDebug() << "start post to " << m_url;
+ QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
+
+ QHashIterator iparams(params);
+ while(iparams.hasNext()) {
+ iparams.next();
+ qDebug() << "\t add param " << iparams.key() << " : " << iparams.value();
+ QHttpPart textPart;
+ textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"" + iparams.key() + "\""));
+
+
+ textPart.setBody(iparams.value().toUtf8());
+ multiPart->append(textPart);
+ }
+
+ UploadableImage uimg;
+ QHashIterator ifiles(files);
+ while(ifiles.hasNext()) {
+ ifiles.next();
+
+ uimg.setSource(ifiles.value());
+ qDebug() << "\t image: " << uimg.mimetype() << ", " << ifiles.key();
+
+ QHttpPart imagePart;
+ imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(uimg.mimetype()));
+ imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"" + ifiles.key() + "\"; filename=\""+uimg.filename()+"\""));
+ imagePart.setBody(uimg.bytes());
+ multiPart->append(imagePart);
+ }
+
+ QByteArray loginData = m_login.toLocal8Bit().toBase64();
+ QString headerData = "Basic " + loginData;
+ request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit());
+
+ request.setUrl(m_url+m_api);
+ reply = manager.post(request, multiPart);
+ qDebug() << "\t request sent";
+ connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
+ connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
+ connect(reply, &QNetworkReply::readyRead, this, &XHR::onReadyRead);
+ connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
+ qDebug() << "\t reply signals connected";
+}
+
+void XHR::onReplyError(QNetworkReply::NetworkError code)
+{
+ qDebug() << code;
+ emit this->error( bufferToString(), m_url,m_api, (int) code);
+ buffer.clear();
+ reply->deleteLater();
+}
+
+void XHR::onReplySuccess()
+{
+ qDebug() << "!";
+ emit this->success( bufferToString(), m_api);
+ buffer.clear();
+// reply->deleteLater();
+}
+
+void XHR::onRequestFinished()
+{
+ // Save the file here
+ if (buffer.isNull()){qDebug() << "File empty"<error(m_downloadtype,m_url,m_api,1);}
+ else if (m_downloadtype=="picturelist") {
+ QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer);
+ QJsonObject jsonObject = jsonResponse.object();
+ int arraystart=buffer.indexOf('{"data":"')+8;
+ int arraylength=buffer.indexOf('"',9)-arraystart;
+ QByteArray b64=buffer.mid(arraystart,arraylength);
+ QString helpfilename=jsonObject["filename"].toString();
+ QString helpfile=helpfilename.left(helpfilename.lastIndexOf("."));
+ QString filesuffix="";
+ if (jsonObject["type"].toString()=="image/jpeg"){filesuffix=".jpg";}
+ else if (jsonObject["type"].toString()=="image/png"){filesuffix=".png";}
+ else {filesuffix="";}
+ if (helpfilename==""){// check if file has any filename
+ helpfile=jsonObject["id"].toString();
+ setFilename(imagedir()+"albums/"+jsonObject["album"].toString()+"/"+jsonObject["id"].toString()+filesuffix);
+ }
+ else{setFilename(imagedir()+"albums/"+jsonObject["album"].toString()+"/"+helpfile+filesuffix);}
+ //qDebug()<<"Filename "<downloadedjson(m_downloadtype,m_url,m_filename,dlindex,jsonObject);
+ if(downloadtype()=="picturelist"){dlindex=dlindex+1;XHR::getlist();}
+ }
+ else {
+ QFile file(m_filename);
+ file.open(QIODevice::WriteOnly);
+ file.write(buffer);
+ buffer.clear();
+ file.close();
+ emit this->downloaded(m_downloadtype,m_url,m_filename,dlindex);
+ if(downloadtype()=="contactlist"){dlindex=dlindex+1;XHR::getlist();}
+
+ //reply->deleteLater();
+ }
+}
+
+void XHR::onReadyRead()
+{
+ qDebug() << ".";
+ buffer += reply->readAll();
+}
+
+//void XHR::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes)
+//{
+// qDebug() << "Bytes: " << bytesRead<<" / "< &errors)
+{
+ qDebug() << "XHR::onSSLError :" ;
+ QListIterator ierrs(errors);
+ while(ierrs.hasNext()) {
+ qDebug() << "\t" << ierrs.next().errorString();
+ }
+}
+
+QString XHR::bufferToString()
+{
+ return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
+}
diff --git a/source-linux/common/xhr.h b/source-linux/common/xhr.h
new file mode 100644
index 0000000..f111d59
--- /dev/null
+++ b/source-linux/common/xhr.h
@@ -0,0 +1,127 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+#ifndef XHR_H
+#define XHR_H
+
+#include
+#include
+#include
+#include
+#include
+
+class XHR : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(QString login READ login WRITE setLogin NOTIFY loginChanged)
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+ Q_PROPERTY(QString imagedir READ imagedir WRITE setImagedir NOTIFY imagedirChanged)
+ Q_PROPERTY(QList contactlist READ contactlist WRITE setContactlist NOTIFY contactlistChanged)
+ Q_PROPERTY(QList filelist READ filelist WRITE setFilelist NOTIFY filelistChanged)
+ Q_PROPERTY(QString downloadtype READ downloadtype WRITE setDownloadtype NOTIFY downloadtypeChanged)
+
+
+public:
+ static XHR *instance();
+
+ explicit XHR(QObject *parent = 0);
+
+ QString url() const;
+ QString api() const;
+ QString login() const;
+ QString filename() const;
+ QList contactlist() const;
+ QList filelist() const;
+ QString imagedir() const;
+ QString downloadtype() const;
+
+signals:
+ void urlChanged();
+ void apiChanged();
+ void loginChanged();
+ void filenameChanged();
+ void contactlistChanged();
+ void filelistChanged();
+ void imagedirChanged();
+ void downloadtypeChanged();
+ void downloaded(QString type, QString url, QString filename, int i);
+ void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject);
+ void success(QString data, QString api);
+ void error(QString data, QString url,QString api, int code);
+
+public slots:
+ void setUrl(QString url);
+ void setApi(QString api);
+ void setLogin(QString login);
+ void setDownloadtype(QString downloadtype);
+ void setFilename(QString filename);
+ void setContactlist(QList filename);
+ void setFilelist(QList filename);
+ void setImagedir(QString filename);
+ void setParam(QString name, QString value);
+ void setImageFileParam(QString name, QString url);
+ void clearParams();
+ void post();
+ void get();
+ void getlist();
+ void download();
+
+private slots:
+ void onReplyError(QNetworkReply::NetworkError code);
+ void onReplySuccess();
+ void onRequestFinished();
+ void onReadyRead();
+ void onSSLError(const QList &errors);
+ //void updateDownloadProgress(qint64 bytesRead, qint64 totalBytes);
+
+private:
+ QByteArray buffer;
+ QString m_url;
+ QString m_api;
+ QString m_login;
+ QString m_filename;
+ QString m_downloadtype;
+ QHash params;
+ QHash files;
+ QList m_filelist;
+ QList m_contactlist;
+ QString m_imagedir;
+ int dlindex;
+
+ QNetworkAccessManager manager;
+ QNetworkRequest request;
+ QNetworkReply *reply;
+
+ QString bufferToString();
+};
+
+#endif // XHR_H
diff --git a/source-linux/friendiqa.pro b/source-linux/friendiqa.pro
new file mode 100644
index 0000000..411246d
--- /dev/null
+++ b/source-linux/friendiqa.pro
@@ -0,0 +1,55 @@
+# NOTICE:
+#
+# Application name defined in TARGET has a corresponding QML filename.
+# If name defined in TARGET is changed, the following needs to be done
+# to match new name:
+# - corresponding QML filename must be changed
+# - desktop icon filename must be changed
+# - desktop filename must be changed
+# - icon definition filename in desktop file must be changed
+# - translation filenames have to be changed
+
+# The name of your application
+TEMPLATE = app
+TARGET = friendiqa
+CONFIG += release
+QT += qml quick gui widgets
+
+SOURCES += common/friendiqa.cpp \
+ common/uploadableimage.cpp \
+ common/xhr.cpp \
+ common/filesystem.cpp \
+ common/remoteauthasyncimageprovider.cpp
+
+RESOURCES = application.qrc
+
+OTHER_FILES += qml/friendiqa.qml \
+ translations/*.ts \
+ qml/*.qml
+ qml/newsqml/*.qml
+ qml/contactqml/*.qml
+ qml/photoqml/*.qml
+ qml/configqml/*.qml
+ js/*.js
+
+TRANSLATIONS += translations/friendiqa-de.ts \
+ translations/friendiqa-es.ts \
+ translations/friendiqa-it.ts
+HEADERS += \
+ common/uploadableimage.h \
+ common/xhr.h \
+ common/filesystem.h \
+ common/remoteauthasyncimageprovider.h
+
+DISTFILES += \
+ qml/calendarqml/*.qml \
+ translations/*.ts \
+ translations/*.qm \
+ qml/*.qml \
+ qml/newsqml/*.qml \
+ qml/contactqml/*.qml \
+ qml/photoqml/*.qml \
+ qml/configqml/*.qml \
+ js/*.js \
+ qml/newsqml/Hashtag.qml \
+ qml/newsqml/NewsImage.qml
diff --git a/source-linux/images/addImage.png b/source-linux/images/addImage.png
new file mode 100644
index 0000000..988f9f1
Binary files /dev/null and b/source-linux/images/addImage.png differ
diff --git a/source-linux/images/defaultcontact.jpg b/source-linux/images/defaultcontact.jpg
new file mode 100644
index 0000000..bb7bce2
Binary files /dev/null and b/source-linux/images/defaultcontact.jpg differ
diff --git a/source-linux/images/folder-blue.png b/source-linux/images/folder-blue.png
new file mode 100644
index 0000000..b530009
Binary files /dev/null and b/source-linux/images/folder-blue.png differ
diff --git a/source-linux/images/fontawesome-webfont.ttf b/source-linux/images/fontawesome-webfont.ttf
new file mode 100644
index 0000000..35acda2
Binary files /dev/null and b/source-linux/images/fontawesome-webfont.ttf differ
diff --git a/source-linux/images/smileys/adult/bong.gif b/source-linux/images/smileys/adult/bong.gif
new file mode 100644
index 0000000..4b67122
Binary files /dev/null and b/source-linux/images/smileys/adult/bong.gif differ
diff --git a/source-linux/images/smileys/adult/drunk.gif b/source-linux/images/smileys/adult/drunk.gif
new file mode 100644
index 0000000..4a1c064
Binary files /dev/null and b/source-linux/images/smileys/adult/drunk.gif differ
diff --git a/source-linux/images/smileys/adult/finger.gif b/source-linux/images/smileys/adult/finger.gif
new file mode 100644
index 0000000..d45dcb8
Binary files /dev/null and b/source-linux/images/smileys/adult/finger.gif differ
diff --git a/source-linux/images/smileys/adult/sperm.gif b/source-linux/images/smileys/adult/sperm.gif
new file mode 100644
index 0000000..6ba9219
Binary files /dev/null and b/source-linux/images/smileys/adult/sperm.gif differ
diff --git a/source-linux/images/smileys/adult/tits.gif b/source-linux/images/smileys/adult/tits.gif
new file mode 100644
index 0000000..4c1658c
Binary files /dev/null and b/source-linux/images/smileys/adult/tits.gif differ
diff --git a/source-linux/images/smileys/animals/bee.gif b/source-linux/images/smileys/animals/bee.gif
new file mode 100644
index 0000000..206c2e3
Binary files /dev/null and b/source-linux/images/smileys/animals/bee.gif differ
diff --git a/source-linux/images/smileys/animals/bigspider.gif b/source-linux/images/smileys/animals/bigspider.gif
new file mode 100644
index 0000000..bc43deb
Binary files /dev/null and b/source-linux/images/smileys/animals/bigspider.gif differ
diff --git a/source-linux/images/smileys/animals/bunny.gif b/source-linux/images/smileys/animals/bunny.gif
new file mode 100644
index 0000000..402b2b3
Binary files /dev/null and b/source-linux/images/smileys/animals/bunny.gif differ
diff --git a/source-linux/images/smileys/animals/bunnyflowers.gif b/source-linux/images/smileys/animals/bunnyflowers.gif
new file mode 100644
index 0000000..6d665e2
Binary files /dev/null and b/source-linux/images/smileys/animals/bunnyflowers.gif differ
diff --git a/source-linux/images/smileys/animals/cat.gif b/source-linux/images/smileys/animals/cat.gif
new file mode 100644
index 0000000..a612c47
Binary files /dev/null and b/source-linux/images/smileys/animals/cat.gif differ
diff --git a/source-linux/images/smileys/animals/chick.gif b/source-linux/images/smileys/animals/chick.gif
new file mode 100644
index 0000000..6bcddcd
Binary files /dev/null and b/source-linux/images/smileys/animals/chick.gif differ
diff --git a/source-linux/images/smileys/animals/cow.gif b/source-linux/images/smileys/animals/cow.gif
new file mode 100644
index 0000000..3f94cfa
Binary files /dev/null and b/source-linux/images/smileys/animals/cow.gif differ
diff --git a/source-linux/images/smileys/animals/crab.gif b/source-linux/images/smileys/animals/crab.gif
new file mode 100644
index 0000000..db5b8ce
Binary files /dev/null and b/source-linux/images/smileys/animals/crab.gif differ
diff --git a/source-linux/images/smileys/animals/dog.gif b/source-linux/images/smileys/animals/dog.gif
new file mode 100644
index 0000000..7b28477
Binary files /dev/null and b/source-linux/images/smileys/animals/dog.gif differ
diff --git a/source-linux/images/smileys/animals/dolphin.gif b/source-linux/images/smileys/animals/dolphin.gif
new file mode 100644
index 0000000..672ebd7
Binary files /dev/null and b/source-linux/images/smileys/animals/dolphin.gif differ
diff --git a/source-linux/images/smileys/animals/dragonfly.gif b/source-linux/images/smileys/animals/dragonfly.gif
new file mode 100644
index 0000000..566e95c
Binary files /dev/null and b/source-linux/images/smileys/animals/dragonfly.gif differ
diff --git a/source-linux/images/smileys/animals/elephant.gif b/source-linux/images/smileys/animals/elephant.gif
new file mode 100644
index 0000000..4311e97
Binary files /dev/null and b/source-linux/images/smileys/animals/elephant.gif differ
diff --git a/source-linux/images/smileys/animals/fish.gif b/source-linux/images/smileys/animals/fish.gif
new file mode 100644
index 0000000..3a7a584
Binary files /dev/null and b/source-linux/images/smileys/animals/fish.gif differ
diff --git a/source-linux/images/smileys/animals/frog.gif b/source-linux/images/smileys/animals/frog.gif
new file mode 100644
index 0000000..85e4b56
Binary files /dev/null and b/source-linux/images/smileys/animals/frog.gif differ
diff --git a/source-linux/images/smileys/animals/giraffe.gif b/source-linux/images/smileys/animals/giraffe.gif
new file mode 100644
index 0000000..4c95ea4
Binary files /dev/null and b/source-linux/images/smileys/animals/giraffe.gif differ
diff --git a/source-linux/images/smileys/animals/hamster.gif b/source-linux/images/smileys/animals/hamster.gif
new file mode 100644
index 0000000..96c7323
Binary files /dev/null and b/source-linux/images/smileys/animals/hamster.gif differ
diff --git a/source-linux/images/smileys/animals/horse.gif b/source-linux/images/smileys/animals/horse.gif
new file mode 100644
index 0000000..9103abf
Binary files /dev/null and b/source-linux/images/smileys/animals/horse.gif differ
diff --git a/source-linux/images/smileys/animals/ladybird.gif b/source-linux/images/smileys/animals/ladybird.gif
new file mode 100644
index 0000000..69444a9
Binary files /dev/null and b/source-linux/images/smileys/animals/ladybird.gif differ
diff --git a/source-linux/images/smileys/animals/monkey.gif b/source-linux/images/smileys/animals/monkey.gif
new file mode 100644
index 0000000..b9b338d
Binary files /dev/null and b/source-linux/images/smileys/animals/monkey.gif differ
diff --git a/source-linux/images/smileys/animals/parrot.gif b/source-linux/images/smileys/animals/parrot.gif
new file mode 100644
index 0000000..ae6faf6
Binary files /dev/null and b/source-linux/images/smileys/animals/parrot.gif differ
diff --git a/source-linux/images/smileys/animals/pig.gif b/source-linux/images/smileys/animals/pig.gif
new file mode 100644
index 0000000..bdc68e8
Binary files /dev/null and b/source-linux/images/smileys/animals/pig.gif differ
diff --git a/source-linux/images/smileys/animals/sheep.gif b/source-linux/images/smileys/animals/sheep.gif
new file mode 100644
index 0000000..8fafc11
Binary files /dev/null and b/source-linux/images/smileys/animals/sheep.gif differ
diff --git a/source-linux/images/smileys/animals/snail.gif b/source-linux/images/smileys/animals/snail.gif
new file mode 100644
index 0000000..3bdb44c
Binary files /dev/null and b/source-linux/images/smileys/animals/snail.gif differ
diff --git a/source-linux/images/smileys/animals/tux.gif b/source-linux/images/smileys/animals/tux.gif
new file mode 100644
index 0000000..08e006e
Binary files /dev/null and b/source-linux/images/smileys/animals/tux.gif differ
diff --git a/source-linux/images/smileys/babies/baby.gif b/source-linux/images/smileys/babies/baby.gif
new file mode 100644
index 0000000..d105afb
Binary files /dev/null and b/source-linux/images/smileys/babies/baby.gif differ
diff --git a/source-linux/images/smileys/babies/babycot.gif b/source-linux/images/smileys/babies/babycot.gif
new file mode 100644
index 0000000..750f6df
Binary files /dev/null and b/source-linux/images/smileys/babies/babycot.gif differ
diff --git a/source-linux/images/smileys/babies/pregnant.gif b/source-linux/images/smileys/babies/pregnant.gif
new file mode 100644
index 0000000..d97f476
Binary files /dev/null and b/source-linux/images/smileys/babies/pregnant.gif differ
diff --git a/source-linux/images/smileys/babies/stork.gif b/source-linux/images/smileys/babies/stork.gif
new file mode 100644
index 0000000..de2371d
Binary files /dev/null and b/source-linux/images/smileys/babies/stork.gif differ
diff --git a/source-linux/images/smileys/confused/confused.gif b/source-linux/images/smileys/confused/confused.gif
new file mode 100644
index 0000000..8f1b79a
Binary files /dev/null and b/source-linux/images/smileys/confused/confused.gif differ
diff --git a/source-linux/images/smileys/confused/dazed.gif b/source-linux/images/smileys/confused/dazed.gif
new file mode 100644
index 0000000..f5e7ec2
Binary files /dev/null and b/source-linux/images/smileys/confused/dazed.gif differ
diff --git a/source-linux/images/smileys/confused/shrug.gif b/source-linux/images/smileys/confused/shrug.gif
new file mode 100644
index 0000000..31ce007
Binary files /dev/null and b/source-linux/images/smileys/confused/shrug.gif differ
diff --git a/source-linux/images/smileys/confused/stupid.gif b/source-linux/images/smileys/confused/stupid.gif
new file mode 100644
index 0000000..c17170a
Binary files /dev/null and b/source-linux/images/smileys/confused/stupid.gif differ
diff --git a/source-linux/images/smileys/cool/affro.gif b/source-linux/images/smileys/cool/affro.gif
new file mode 100644
index 0000000..f06166b
Binary files /dev/null and b/source-linux/images/smileys/cool/affro.gif differ
diff --git a/source-linux/images/smileys/cool/cool.gif b/source-linux/images/smileys/cool/cool.gif
new file mode 100644
index 0000000..05ba9f1
Binary files /dev/null and b/source-linux/images/smileys/cool/cool.gif differ
diff --git a/source-linux/images/smileys/core/beer_mug.gif b/source-linux/images/smileys/core/beer_mug.gif
new file mode 100644
index 0000000..9a3e051
Binary files /dev/null and b/source-linux/images/smileys/core/beer_mug.gif differ
diff --git a/source-linux/images/smileys/core/coffee.gif b/source-linux/images/smileys/core/coffee.gif
new file mode 100644
index 0000000..7e20371
Binary files /dev/null and b/source-linux/images/smileys/core/coffee.gif differ
diff --git a/source-linux/images/smileys/core/dislike.gif b/source-linux/images/smileys/core/dislike.gif
new file mode 100644
index 0000000..7777942
Binary files /dev/null and b/source-linux/images/smileys/core/dislike.gif differ
diff --git a/source-linux/images/smileys/core/friendica-16.png b/source-linux/images/smileys/core/friendica-16.png
new file mode 100644
index 0000000..745b7ac
Binary files /dev/null and b/source-linux/images/smileys/core/friendica-16.png differ
diff --git a/source-linux/images/smileys/core/like.gif b/source-linux/images/smileys/core/like.gif
new file mode 100644
index 0000000..f71d032
Binary files /dev/null and b/source-linux/images/smileys/core/like.gif differ
diff --git a/source-linux/images/smileys/core/rm-16.png b/source-linux/images/smileys/core/rm-16.png
new file mode 100644
index 0000000..9361ef2
Binary files /dev/null and b/source-linux/images/smileys/core/rm-16.png differ
diff --git a/source-linux/images/smileys/core/smiley-Oo.gif b/source-linux/images/smileys/core/smiley-Oo.gif
new file mode 100644
index 0000000..a15d974
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-Oo.gif differ
diff --git a/source-linux/images/smileys/core/smiley-bangheaddesk.gif b/source-linux/images/smileys/core/smiley-bangheaddesk.gif
new file mode 100644
index 0000000..91ccb8b
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-bangheaddesk.gif differ
diff --git a/source-linux/images/smileys/core/smiley-brokenheart.gif b/source-linux/images/smileys/core/smiley-brokenheart.gif
new file mode 100644
index 0000000..971b57f
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-brokenheart.gif differ
diff --git a/source-linux/images/smileys/core/smiley-cool.gif b/source-linux/images/smileys/core/smiley-cool.gif
new file mode 100644
index 0000000..cee1c1a
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-cool.gif differ
diff --git a/source-linux/images/smileys/core/smiley-cry.gif b/source-linux/images/smileys/core/smiley-cry.gif
new file mode 100644
index 0000000..06e6ca2
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-cry.gif differ
diff --git a/source-linux/images/smileys/core/smiley-embarassed.gif b/source-linux/images/smileys/core/smiley-embarassed.gif
new file mode 100644
index 0000000..adc12e7
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-embarassed.gif differ
diff --git a/source-linux/images/smileys/core/smiley-facepalm.gif b/source-linux/images/smileys/core/smiley-facepalm.gif
new file mode 100644
index 0000000..7243703
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-facepalm.gif differ
diff --git a/source-linux/images/smileys/core/smiley-foot-in-mouth.gif b/source-linux/images/smileys/core/smiley-foot-in-mouth.gif
new file mode 100644
index 0000000..b444e57
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-foot-in-mouth.gif differ
diff --git a/source-linux/images/smileys/core/smiley-frown.gif b/source-linux/images/smileys/core/smiley-frown.gif
new file mode 100644
index 0000000..9ff1985
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-frown.gif differ
diff --git a/source-linux/images/smileys/core/smiley-heart.gif b/source-linux/images/smileys/core/smiley-heart.gif
new file mode 100644
index 0000000..6a11e70
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-heart.gif differ
diff --git a/source-linux/images/smileys/core/smiley-kiss.gif b/source-linux/images/smileys/core/smiley-kiss.gif
new file mode 100644
index 0000000..cc35661
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-kiss.gif differ
diff --git a/source-linux/images/smileys/core/smiley-laughing.gif b/source-linux/images/smileys/core/smiley-laughing.gif
new file mode 100644
index 0000000..1bf29de
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-laughing.gif differ
diff --git a/source-linux/images/smileys/core/smiley-smile.gif b/source-linux/images/smileys/core/smiley-smile.gif
new file mode 100644
index 0000000..b9bff40
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-smile.gif differ
diff --git a/source-linux/images/smileys/core/smiley-surprised.gif b/source-linux/images/smileys/core/smiley-surprised.gif
new file mode 100644
index 0000000..b074653
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-surprised.gif differ
diff --git a/source-linux/images/smileys/core/smiley-thumbsup.gif b/source-linux/images/smileys/core/smiley-thumbsup.gif
new file mode 100644
index 0000000..1bc6b12
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-thumbsup.gif differ
diff --git a/source-linux/images/smileys/core/smiley-tongue-out.gif b/source-linux/images/smileys/core/smiley-tongue-out.gif
new file mode 100644
index 0000000..48867dc
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-tongue-out.gif differ
diff --git a/source-linux/images/smileys/core/smiley-undecided.gif b/source-linux/images/smileys/core/smiley-undecided.gif
new file mode 100644
index 0000000..2802979
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-undecided.gif differ
diff --git a/source-linux/images/smileys/core/smiley-wink.gif b/source-linux/images/smileys/core/smiley-wink.gif
new file mode 100644
index 0000000..e1cefb0
Binary files /dev/null and b/source-linux/images/smileys/core/smiley-wink.gif differ
diff --git a/source-linux/images/smileys/devilangel/angel.gif b/source-linux/images/smileys/devilangel/angel.gif
new file mode 100644
index 0000000..8e58541
Binary files /dev/null and b/source-linux/images/smileys/devilangel/angel.gif differ
diff --git a/source-linux/images/smileys/devilangel/blondedevil.gif b/source-linux/images/smileys/devilangel/blondedevil.gif
new file mode 100644
index 0000000..09e7e68
Binary files /dev/null and b/source-linux/images/smileys/devilangel/blondedevil.gif differ
diff --git a/source-linux/images/smileys/devilangel/catdevil.gif b/source-linux/images/smileys/devilangel/catdevil.gif
new file mode 100644
index 0000000..269d719
Binary files /dev/null and b/source-linux/images/smileys/devilangel/catdevil.gif differ
diff --git a/source-linux/images/smileys/devilangel/cherub.gif b/source-linux/images/smileys/devilangel/cherub.gif
new file mode 100644
index 0000000..40872e0
Binary files /dev/null and b/source-linux/images/smileys/devilangel/cherub.gif differ
diff --git a/source-linux/images/smileys/devilangel/daseesaw.gif b/source-linux/images/smileys/devilangel/daseesaw.gif
new file mode 100644
index 0000000..1c04b2e
Binary files /dev/null and b/source-linux/images/smileys/devilangel/daseesaw.gif differ
diff --git a/source-linux/images/smileys/devilangel/devil.gif b/source-linux/images/smileys/devilangel/devil.gif
new file mode 100644
index 0000000..2b56797
Binary files /dev/null and b/source-linux/images/smileys/devilangel/devil.gif differ
diff --git a/source-linux/images/smileys/devilangel/graveside.gif b/source-linux/images/smileys/devilangel/graveside.gif
new file mode 100644
index 0000000..0e90935
Binary files /dev/null and b/source-linux/images/smileys/devilangel/graveside.gif differ
diff --git a/source-linux/images/smileys/devilangel/saint.gif b/source-linux/images/smileys/devilangel/saint.gif
new file mode 100644
index 0000000..52c22c4
Binary files /dev/null and b/source-linux/images/smileys/devilangel/saint.gif differ
diff --git a/source-linux/images/smileys/devilangel/turnevil.gif b/source-linux/images/smileys/devilangel/turnevil.gif
new file mode 100644
index 0000000..1490c0f
Binary files /dev/null and b/source-linux/images/smileys/devilangel/turnevil.gif differ
diff --git a/source-linux/images/smileys/disgust/fartblush.gif b/source-linux/images/smileys/disgust/fartblush.gif
new file mode 100644
index 0000000..4160a1f
Binary files /dev/null and b/source-linux/images/smileys/disgust/fartblush.gif differ
diff --git a/source-linux/images/smileys/disgust/fartinbed.gif b/source-linux/images/smileys/disgust/fartinbed.gif
new file mode 100644
index 0000000..5553649
Binary files /dev/null and b/source-linux/images/smileys/disgust/fartinbed.gif differ
diff --git a/source-linux/images/smileys/disgust/toilet.gif b/source-linux/images/smileys/disgust/toilet.gif
new file mode 100644
index 0000000..092d7ca
Binary files /dev/null and b/source-linux/images/smileys/disgust/toilet.gif differ
diff --git a/source-linux/images/smileys/disgust/vomit.gif b/source-linux/images/smileys/disgust/vomit.gif
new file mode 100644
index 0000000..6e7e727
Binary files /dev/null and b/source-linux/images/smileys/disgust/vomit.gif differ
diff --git a/source-linux/images/smileys/drink/tea.gif b/source-linux/images/smileys/drink/tea.gif
new file mode 100644
index 0000000..474b989
Binary files /dev/null and b/source-linux/images/smileys/drink/tea.gif differ
diff --git a/source-linux/images/smileys/drool/drool.gif b/source-linux/images/smileys/drool/drool.gif
new file mode 100644
index 0000000..4093df6
Binary files /dev/null and b/source-linux/images/smileys/drool/drool.gif differ
diff --git a/source-linux/images/smileys/fantasy/alienmonster.gif b/source-linux/images/smileys/fantasy/alienmonster.gif
new file mode 100644
index 0000000..e0ca7f6
Binary files /dev/null and b/source-linux/images/smileys/fantasy/alienmonster.gif differ
diff --git a/source-linux/images/smileys/fantasy/barbarian.gif b/source-linux/images/smileys/fantasy/barbarian.gif
new file mode 100644
index 0000000..de8a068
Binary files /dev/null and b/source-linux/images/smileys/fantasy/barbarian.gif differ
diff --git a/source-linux/images/smileys/fantasy/dinosaur.gif b/source-linux/images/smileys/fantasy/dinosaur.gif
new file mode 100644
index 0000000..e8c625c
Binary files /dev/null and b/source-linux/images/smileys/fantasy/dinosaur.gif differ
diff --git a/source-linux/images/smileys/fantasy/dragon.gif b/source-linux/images/smileys/fantasy/dragon.gif
new file mode 100644
index 0000000..fd28fbf
Binary files /dev/null and b/source-linux/images/smileys/fantasy/dragon.gif differ
diff --git a/source-linux/images/smileys/fantasy/dragonwhelp.gif b/source-linux/images/smileys/fantasy/dragonwhelp.gif
new file mode 100644
index 0000000..dbc4555
Binary files /dev/null and b/source-linux/images/smileys/fantasy/dragonwhelp.gif differ
diff --git a/source-linux/images/smileys/fantasy/ghost.gif b/source-linux/images/smileys/fantasy/ghost.gif
new file mode 100644
index 0000000..4c5d85d
Binary files /dev/null and b/source-linux/images/smileys/fantasy/ghost.gif differ
diff --git a/source-linux/images/smileys/fantasy/mummy.gif b/source-linux/images/smileys/fantasy/mummy.gif
new file mode 100644
index 0000000..50e1dfb
Binary files /dev/null and b/source-linux/images/smileys/fantasy/mummy.gif differ
diff --git a/source-linux/images/smileys/fight/2guns.gif b/source-linux/images/smileys/fight/2guns.gif
new file mode 100644
index 0000000..9e1b663
Binary files /dev/null and b/source-linux/images/smileys/fight/2guns.gif differ
diff --git a/source-linux/images/smileys/fight/acid.gif b/source-linux/images/smileys/fight/acid.gif
new file mode 100644
index 0000000..fa55f67
Binary files /dev/null and b/source-linux/images/smileys/fight/acid.gif differ
diff --git a/source-linux/images/smileys/fight/alienfight.gif b/source-linux/images/smileys/fight/alienfight.gif
new file mode 100644
index 0000000..9d5e879
Binary files /dev/null and b/source-linux/images/smileys/fight/alienfight.gif differ
diff --git a/source-linux/images/smileys/fight/alpha.png b/source-linux/images/smileys/fight/alpha.png
new file mode 100644
index 0000000..09e3f23
Binary files /dev/null and b/source-linux/images/smileys/fight/alpha.png differ
diff --git a/source-linux/images/smileys/fight/army.gif b/source-linux/images/smileys/fight/army.gif
new file mode 100644
index 0000000..7506700
Binary files /dev/null and b/source-linux/images/smileys/fight/army.gif differ
diff --git a/source-linux/images/smileys/fight/arrowhead.gif b/source-linux/images/smileys/fight/arrowhead.gif
new file mode 100644
index 0000000..f4572c4
Binary files /dev/null and b/source-linux/images/smileys/fight/arrowhead.gif differ
diff --git a/source-linux/images/smileys/fight/bfg.gif b/source-linux/images/smileys/fight/bfg.gif
new file mode 100644
index 0000000..c2ba9d0
Binary files /dev/null and b/source-linux/images/smileys/fight/bfg.gif differ
diff --git a/source-linux/images/smileys/fight/bowman.gif b/source-linux/images/smileys/fight/bowman.gif
new file mode 100644
index 0000000..2f1f8f0
Binary files /dev/null and b/source-linux/images/smileys/fight/bowman.gif differ
diff --git a/source-linux/images/smileys/fight/chainsaw.gif b/source-linux/images/smileys/fight/chainsaw.gif
new file mode 100644
index 0000000..71f757c
Binary files /dev/null and b/source-linux/images/smileys/fight/chainsaw.gif differ
diff --git a/source-linux/images/smileys/fight/crossbow.gif b/source-linux/images/smileys/fight/crossbow.gif
new file mode 100644
index 0000000..20874f3
Binary files /dev/null and b/source-linux/images/smileys/fight/crossbow.gif differ
diff --git a/source-linux/images/smileys/fight/crusader.gif b/source-linux/images/smileys/fight/crusader.gif
new file mode 100644
index 0000000..95848ae
Binary files /dev/null and b/source-linux/images/smileys/fight/crusader.gif differ
diff --git a/source-linux/images/smileys/fight/dead.gif b/source-linux/images/smileys/fight/dead.gif
new file mode 100644
index 0000000..31adaba
Binary files /dev/null and b/source-linux/images/smileys/fight/dead.gif differ
diff --git a/source-linux/images/smileys/fight/gangs.gif b/source-linux/images/smileys/fight/gangs.gif
new file mode 100644
index 0000000..2c655b1
Binary files /dev/null and b/source-linux/images/smileys/fight/gangs.gif differ
diff --git a/source-linux/images/smileys/fight/hammersplat.gif b/source-linux/images/smileys/fight/hammersplat.gif
new file mode 100644
index 0000000..95bd540
Binary files /dev/null and b/source-linux/images/smileys/fight/hammersplat.gif differ
diff --git a/source-linux/images/smileys/fight/lasergun.gif b/source-linux/images/smileys/fight/lasergun.gif
new file mode 100644
index 0000000..f3f82cb
Binary files /dev/null and b/source-linux/images/smileys/fight/lasergun.gif differ
diff --git a/source-linux/images/smileys/fight/machinegun.gif b/source-linux/images/smileys/fight/machinegun.gif
new file mode 100644
index 0000000..1cff5cc
Binary files /dev/null and b/source-linux/images/smileys/fight/machinegun.gif differ
diff --git a/source-linux/images/smileys/fight/marine.gif b/source-linux/images/smileys/fight/marine.gif
new file mode 100644
index 0000000..88fd2e0
Binary files /dev/null and b/source-linux/images/smileys/fight/marine.gif differ
diff --git a/source-linux/images/smileys/fight/sabre.gif b/source-linux/images/smileys/fight/sabre.gif
new file mode 100644
index 0000000..e623968
Binary files /dev/null and b/source-linux/images/smileys/fight/sabre.gif differ
diff --git a/source-linux/images/smileys/fight/samurai.gif b/source-linux/images/smileys/fight/samurai.gif
new file mode 100644
index 0000000..8b24385
Binary files /dev/null and b/source-linux/images/smileys/fight/samurai.gif differ
diff --git a/source-linux/images/smileys/fight/tank.gif b/source-linux/images/smileys/fight/tank.gif
new file mode 100644
index 0000000..f1d969d
Binary files /dev/null and b/source-linux/images/smileys/fight/tank.gif differ
diff --git a/source-linux/images/smileys/fight/viking.gif b/source-linux/images/smileys/fight/viking.gif
new file mode 100644
index 0000000..4908edd
Binary files /dev/null and b/source-linux/images/smileys/fight/viking.gif differ
diff --git a/source-linux/images/smileys/food/apple.gif b/source-linux/images/smileys/food/apple.gif
new file mode 100644
index 0000000..969d4ca
Binary files /dev/null and b/source-linux/images/smileys/food/apple.gif differ
diff --git a/source-linux/images/smileys/food/banana.gif b/source-linux/images/smileys/food/banana.gif
new file mode 100644
index 0000000..d990d19
Binary files /dev/null and b/source-linux/images/smileys/food/banana.gif differ
diff --git a/source-linux/images/smileys/food/birthdaycake.gif b/source-linux/images/smileys/food/birthdaycake.gif
new file mode 100644
index 0000000..30ebceb
Binary files /dev/null and b/source-linux/images/smileys/food/birthdaycake.gif differ
diff --git a/source-linux/images/smileys/food/broccoli.gif b/source-linux/images/smileys/food/broccoli.gif
new file mode 100644
index 0000000..f379889
Binary files /dev/null and b/source-linux/images/smileys/food/broccoli.gif differ
diff --git a/source-linux/images/smileys/food/cake.gif b/source-linux/images/smileys/food/cake.gif
new file mode 100644
index 0000000..22d0ebd
Binary files /dev/null and b/source-linux/images/smileys/food/cake.gif differ
diff --git a/source-linux/images/smileys/food/carrot.gif b/source-linux/images/smileys/food/carrot.gif
new file mode 100644
index 0000000..387b94c
Binary files /dev/null and b/source-linux/images/smileys/food/carrot.gif differ
diff --git a/source-linux/images/smileys/food/cooking.gif b/source-linux/images/smileys/food/cooking.gif
new file mode 100644
index 0000000..e62fea0
Binary files /dev/null and b/source-linux/images/smileys/food/cooking.gif differ
diff --git a/source-linux/images/smileys/food/fryegg.gif b/source-linux/images/smileys/food/fryegg.gif
new file mode 100644
index 0000000..bd1b4ff
Binary files /dev/null and b/source-linux/images/smileys/food/fryegg.gif differ
diff --git a/source-linux/images/smileys/food/popcorn.gif b/source-linux/images/smileys/food/popcorn.gif
new file mode 100644
index 0000000..b0ea697
Binary files /dev/null and b/source-linux/images/smileys/food/popcorn.gif differ
diff --git a/source-linux/images/smileys/food/tomato.gif b/source-linux/images/smileys/food/tomato.gif
new file mode 100644
index 0000000..0e3dadd
Binary files /dev/null and b/source-linux/images/smileys/food/tomato.gif differ
diff --git a/source-linux/images/smileys/happy/cloud9.gif b/source-linux/images/smileys/happy/cloud9.gif
new file mode 100644
index 0000000..801c1a3
Binary files /dev/null and b/source-linux/images/smileys/happy/cloud9.gif differ
diff --git a/source-linux/images/smileys/happy/tearsofjoy.gif b/source-linux/images/smileys/happy/tearsofjoy.gif
new file mode 100644
index 0000000..5de3117
Binary files /dev/null and b/source-linux/images/smileys/happy/tearsofjoy.gif differ
diff --git a/source-linux/images/smileys/laugh/hahaha.gif b/source-linux/images/smileys/laugh/hahaha.gif
new file mode 100644
index 0000000..37aa92a
Binary files /dev/null and b/source-linux/images/smileys/laugh/hahaha.gif differ
diff --git a/source-linux/images/smileys/laugh/loltv.gif b/source-linux/images/smileys/laugh/loltv.gif
new file mode 100644
index 0000000..3de6f77
Binary files /dev/null and b/source-linux/images/smileys/laugh/loltv.gif differ
diff --git a/source-linux/images/smileys/laugh/rofl.gif b/source-linux/images/smileys/laugh/rofl.gif
new file mode 100644
index 0000000..a3bb03d
Binary files /dev/null and b/source-linux/images/smileys/laugh/rofl.gif differ
diff --git a/source-linux/images/smileys/love/iloveyou.gif b/source-linux/images/smileys/love/iloveyou.gif
new file mode 100644
index 0000000..7007515
Binary files /dev/null and b/source-linux/images/smileys/love/iloveyou.gif differ
diff --git a/source-linux/images/smileys/love/inlove.gif b/source-linux/images/smileys/love/inlove.gif
new file mode 100644
index 0000000..30357af
Binary files /dev/null and b/source-linux/images/smileys/love/inlove.gif differ
diff --git a/source-linux/images/smileys/love/love.gif b/source-linux/images/smileys/love/love.gif
new file mode 100644
index 0000000..d8f0d5b
Binary files /dev/null and b/source-linux/images/smileys/love/love.gif differ
diff --git a/source-linux/images/smileys/love/lovebear.gif b/source-linux/images/smileys/love/lovebear.gif
new file mode 100644
index 0000000..d13fd18
Binary files /dev/null and b/source-linux/images/smileys/love/lovebear.gif differ
diff --git a/source-linux/images/smileys/love/lovebed.gif b/source-linux/images/smileys/love/lovebed.gif
new file mode 100644
index 0000000..c5783e0
Binary files /dev/null and b/source-linux/images/smileys/love/lovebed.gif differ
diff --git a/source-linux/images/smileys/love/loveheart.gif b/source-linux/images/smileys/love/loveheart.gif
new file mode 100644
index 0000000..541220a
Binary files /dev/null and b/source-linux/images/smileys/love/loveheart.gif differ
diff --git a/source-linux/images/smileys/music/dj.gif b/source-linux/images/smileys/music/dj.gif
new file mode 100644
index 0000000..66bc075
Binary files /dev/null and b/source-linux/images/smileys/music/dj.gif differ
diff --git a/source-linux/images/smileys/music/drums.gif b/source-linux/images/smileys/music/drums.gif
new file mode 100644
index 0000000..27215f4
Binary files /dev/null and b/source-linux/images/smileys/music/drums.gif differ
diff --git a/source-linux/images/smileys/music/elvis.gif b/source-linux/images/smileys/music/elvis.gif
new file mode 100644
index 0000000..ebcdccc
Binary files /dev/null and b/source-linux/images/smileys/music/elvis.gif differ
diff --git a/source-linux/images/smileys/music/guitar.gif b/source-linux/images/smileys/music/guitar.gif
new file mode 100644
index 0000000..11eccdd
Binary files /dev/null and b/source-linux/images/smileys/music/guitar.gif differ
diff --git a/source-linux/images/smileys/music/trumpet.gif b/source-linux/images/smileys/music/trumpet.gif
new file mode 100644
index 0000000..4595ccc
Binary files /dev/null and b/source-linux/images/smileys/music/trumpet.gif differ
diff --git a/source-linux/images/smileys/music/violin.gif b/source-linux/images/smileys/music/violin.gif
new file mode 100644
index 0000000..53592d6
Binary files /dev/null and b/source-linux/images/smileys/music/violin.gif differ
diff --git a/source-linux/images/smileys/oldcore/beard.png b/source-linux/images/smileys/oldcore/beard.png
new file mode 100644
index 0000000..5d4b284
Binary files /dev/null and b/source-linux/images/smileys/oldcore/beard.png differ
diff --git a/source-linux/images/smileys/oldcore/headbang.gif b/source-linux/images/smileys/oldcore/headbang.gif
new file mode 100644
index 0000000..91ccb8b
Binary files /dev/null and b/source-linux/images/smileys/oldcore/headbang.gif differ
diff --git a/source-linux/images/smileys/oldcore/laughing.gif b/source-linux/images/smileys/oldcore/laughing.gif
new file mode 100644
index 0000000..1bf29de
Binary files /dev/null and b/source-linux/images/smileys/oldcore/laughing.gif differ
diff --git a/source-linux/images/smileys/oldcore/shaka.gif b/source-linux/images/smileys/oldcore/shaka.gif
new file mode 100644
index 0000000..e5d7b70
Binary files /dev/null and b/source-linux/images/smileys/oldcore/shaka.gif differ
diff --git a/source-linux/images/smileys/oldcore/surprised.gif b/source-linux/images/smileys/oldcore/surprised.gif
new file mode 100644
index 0000000..b074653
Binary files /dev/null and b/source-linux/images/smileys/oldcore/surprised.gif differ
diff --git a/source-linux/images/smileys/oldcore/whitebeard.png b/source-linux/images/smileys/oldcore/whitebeard.png
new file mode 100644
index 0000000..2a1fccb
Binary files /dev/null and b/source-linux/images/smileys/oldcore/whitebeard.png differ
diff --git a/source-linux/images/smileys/respect/bow.gif b/source-linux/images/smileys/respect/bow.gif
new file mode 100644
index 0000000..ecc6484
Binary files /dev/null and b/source-linux/images/smileys/respect/bow.gif differ
diff --git a/source-linux/images/smileys/respect/bravo.gif b/source-linux/images/smileys/respect/bravo.gif
new file mode 100644
index 0000000..34f72ab
Binary files /dev/null and b/source-linux/images/smileys/respect/bravo.gif differ
diff --git a/source-linux/images/smileys/respect/hailking.gif b/source-linux/images/smileys/respect/hailking.gif
new file mode 100644
index 0000000..07551e5
Binary files /dev/null and b/source-linux/images/smileys/respect/hailking.gif differ
diff --git a/source-linux/images/smileys/respect/number1.gif b/source-linux/images/smileys/respect/number1.gif
new file mode 100644
index 0000000..ab5c410
Binary files /dev/null and b/source-linux/images/smileys/respect/number1.gif differ
diff --git a/source-linux/images/smileys/sad/crying.png b/source-linux/images/smileys/sad/crying.png
new file mode 100644
index 0000000..62b9646
Binary files /dev/null and b/source-linux/images/smileys/sad/crying.png differ
diff --git a/source-linux/images/smileys/sad/prisoner.gif b/source-linux/images/smileys/sad/prisoner.gif
new file mode 100644
index 0000000..f2c3181
Binary files /dev/null and b/source-linux/images/smileys/sad/prisoner.gif differ
diff --git a/source-linux/images/smileys/sad/sigh.gif b/source-linux/images/smileys/sad/sigh.gif
new file mode 100644
index 0000000..6860226
Binary files /dev/null and b/source-linux/images/smileys/sad/sigh.gif differ
diff --git a/source-linux/images/smileys/smoking/smoking.gif b/source-linux/images/smileys/smoking/smoking.gif
new file mode 100644
index 0000000..77720b1
Binary files /dev/null and b/source-linux/images/smileys/smoking/smoking.gif differ
diff --git a/source-linux/images/smileys/sport/archery.gif b/source-linux/images/smileys/sport/archery.gif
new file mode 100644
index 0000000..8b4b9f6
Binary files /dev/null and b/source-linux/images/smileys/sport/archery.gif differ
diff --git a/source-linux/images/smileys/sport/basketball.gif b/source-linux/images/smileys/sport/basketball.gif
new file mode 100644
index 0000000..e9ad4b5
Binary files /dev/null and b/source-linux/images/smileys/sport/basketball.gif differ
diff --git a/source-linux/images/smileys/sport/bowling.gif b/source-linux/images/smileys/sport/bowling.gif
new file mode 100644
index 0000000..0f8300c
Binary files /dev/null and b/source-linux/images/smileys/sport/bowling.gif differ
diff --git a/source-linux/images/smileys/sport/cycling.gif b/source-linux/images/smileys/sport/cycling.gif
new file mode 100644
index 0000000..332081e
Binary files /dev/null and b/source-linux/images/smileys/sport/cycling.gif differ
diff --git a/source-linux/images/smileys/sport/darts.gif b/source-linux/images/smileys/sport/darts.gif
new file mode 100644
index 0000000..09fb6ea
Binary files /dev/null and b/source-linux/images/smileys/sport/darts.gif differ
diff --git a/source-linux/images/smileys/sport/fencing.gif b/source-linux/images/smileys/sport/fencing.gif
new file mode 100644
index 0000000..a4ec5cd
Binary files /dev/null and b/source-linux/images/smileys/sport/fencing.gif differ
diff --git a/source-linux/images/smileys/sport/football.gif b/source-linux/images/smileys/sport/football.gif
new file mode 100644
index 0000000..c9fa6c5
Binary files /dev/null and b/source-linux/images/smileys/sport/football.gif differ
diff --git a/source-linux/images/smileys/sport/golf.gif b/source-linux/images/smileys/sport/golf.gif
new file mode 100644
index 0000000..179fc52
Binary files /dev/null and b/source-linux/images/smileys/sport/golf.gif differ
diff --git a/source-linux/images/smileys/sport/horseriding.gif b/source-linux/images/smileys/sport/horseriding.gif
new file mode 100644
index 0000000..13ca450
Binary files /dev/null and b/source-linux/images/smileys/sport/horseriding.gif differ
diff --git a/source-linux/images/smileys/sport/juggling.gif b/source-linux/images/smileys/sport/juggling.gif
new file mode 100644
index 0000000..1a2eb60
Binary files /dev/null and b/source-linux/images/smileys/sport/juggling.gif differ
diff --git a/source-linux/images/smileys/sport/skipping.gif b/source-linux/images/smileys/sport/skipping.gif
new file mode 100644
index 0000000..f63270b
Binary files /dev/null and b/source-linux/images/smileys/sport/skipping.gif differ
diff --git a/source-linux/images/smileys/sport/snooker.gif b/source-linux/images/smileys/sport/snooker.gif
new file mode 100644
index 0000000..fa2e6a8
Binary files /dev/null and b/source-linux/images/smileys/sport/snooker.gif differ
diff --git a/source-linux/images/smileys/sport/surfing.gif b/source-linux/images/smileys/sport/surfing.gif
new file mode 100644
index 0000000..b75d74b
Binary files /dev/null and b/source-linux/images/smileys/sport/surfing.gif differ
diff --git a/source-linux/images/smileys/sport/tennis.gif b/source-linux/images/smileys/sport/tennis.gif
new file mode 100644
index 0000000..36e47bf
Binary files /dev/null and b/source-linux/images/smileys/sport/tennis.gif differ
diff --git a/source-linux/images/smileys/tired/countsheep.gif b/source-linux/images/smileys/tired/countsheep.gif
new file mode 100644
index 0000000..815b090
Binary files /dev/null and b/source-linux/images/smileys/tired/countsheep.gif differ
diff --git a/source-linux/images/smileys/tired/hammock.gif b/source-linux/images/smileys/tired/hammock.gif
new file mode 100644
index 0000000..8639dd3
Binary files /dev/null and b/source-linux/images/smileys/tired/hammock.gif differ
diff --git a/source-linux/images/smileys/tired/pillow.gif b/source-linux/images/smileys/tired/pillow.gif
new file mode 100644
index 0000000..367f65e
Binary files /dev/null and b/source-linux/images/smileys/tired/pillow.gif differ
diff --git a/source-linux/images/smileys/tired/yawn.gif b/source-linux/images/smileys/tired/yawn.gif
new file mode 100644
index 0000000..d451480
Binary files /dev/null and b/source-linux/images/smileys/tired/yawn.gif differ
diff --git a/src/common/alarm.h b/source-linux/js/friendworker.js
similarity index 70%
rename from src/common/alarm.h
rename to source-linux/js/friendworker.js
index 9edea0b..ab6fdf4 100644
--- a/src/common/alarm.h
+++ b/source-linux/js/friendworker.js
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
-// https://git.friendi.ca/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -28,32 +28,15 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-
-#ifndef ALARM_H
-#define ALARM_H
-
-#include
-
-class ALARM : public QObject
-{
- Q_OBJECT
- //Q_PROPERTY(int alarmtime READ alarmtime WRITE setAlarm NOTIFY alarmChanged)
-public:
- static ALARM *instance();
- explicit ALARM(QObject *parent = 0);
-
- //int alarmtime() const;
-
-signals:
-
- void alarmChanged(QString url);
-
-public slots:
- void setAlarm(int time);
- void notify(QString title, QString text, int id);
-
-private:
- int m_time;
-};
-
-#endif // UPDATENEWS_H
+WorkerScript.onMessage = function(msg) {
+ msg.model.clear();
+ for (var j=0;j
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+
+function friendicaRequest(login,api,rootwindow,callback) {
+ var xhrequest= new XMLHttpRequest();
+ xhrequest.onreadystatechange = function() {
+ if(xhrequest.readyState === XMLHttpRequest.DONE) {
+ try{
+ if (xhrequest.status==200){
+ callback(xhrequest.responseText)
+ }else{
+ showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow);
+ }
+ }
+ catch (e){
+ showMessage("Error", "API:\n" +login.server+api+"\n"+e+"\n Return: "+xhrequest.responseText,rootwindow)
+ }
+ }
+ }
+ xhrequest.open("GET", login.server+api,true,login.username,Qt.atob(login.password));
+ xhrequest.send();
+}
+
+function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
+ var xhrequest= new XMLHttpRequest();
+ xhrequest.onreadystatechange = function() {
+ //print(api+JSON.stringify(login)+Qt.atob(login.password));
+ if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
+ } else if(xhrequest.readyState === XMLHttpRequest.DONE) {
+ try{ if (xhrequest.responseText!=""){
+ callback(xhrequest.responseText)
+ }else{
+ showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
+ callback(xhrequest.responseText)
+ }
+ }
+ catch (e){showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
+ }
+ }
+ xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));
+ xhrequest.send(data);
+}
+
+function getCount(database,login,table,field,countvalue){
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ var count=0;
+ db.transaction( function(tx) {
+ var countrs = tx.executeSql('SELECT COUNT(*) from '+table+' WHERE username= "'+ login.username +'" AND '+field+' = "'+countvalue+'"');
+ count = parseInt(countrs.rows.item(0)["COUNT(*)"])
+ })
+ return count
+}
+
+function friendicaWebRequest(url,rootwindow,callback) {
+ var xhrequest = new XMLHttpRequest();
+ xhrequest.onreadystatechange = function() {
+ if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {}
+ else if(xhrequest.readyState === XMLHttpRequest.DONE) {
+ try{callback(xhrequest.responseText)}
+ catch (e){showMessage("Error","API:\n" +url+" "+e+"\n Return: "+xhrequest.responseText, rootwindow)}
+ }
+ }
+ xhrequest.open("GET", url,true);
+ xhrequest.send();
+}
+
+function friendicaRemoteAuthRequest(login,url,c_url,rootwindow,callback) {
+ var xhrequest = new XMLHttpRequest();
+ xhrequest.onreadystatechange = function() {
+ if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {}
+ else if(xhrequest.readyState === XMLHttpRequest.DONE) {
+ try{callback(xhrequest.responseText)}
+ catch (e){showMessage("Error","Url:\n" +url+" "+e+"\n Return: "+xhrequest.responseText, rootwindow)}
+ }
+ }
+ xhrequest.open("GET", login.server+"/api/friendica/remoteauth?c_url="+c_url+"&url="+url,true,login.username,Qt.atob(login.password));
+ xhrequest.send();
+}
+
+
+function readData(database,table,username,callback,filter,filtervalue, sort) { // reads and applies data from DB
+ if (filter){
+ var where = " AND "+ filter +" = '" + filtervalue+"'";
+ } else { var where="";}
+ if (username){
+ var user = ' where username= "'+ username +'"';
+ } else { var user='';}
+
+ if (sort){
+ var sortparam = " ORDER BY "+ sort;
+ } else { var sortparam="";}
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ if(!db) { return; }
+ db.transaction( function(tx) {
+ //print('select * from '+table+user+where+sortparam);
+ var rsArray=[];
+ var rs = tx.executeSql('select * from '+table+user+where+sortparam);
+ for(var i = 0; i < rs.rows.length; i++) {
+ rsArray.push(rs.rows.item(i))
+ }
+ callback(rsArray);
+ });
+}
+
+function readField(field,database,table, username, callback,filter,filtervalue) { // reads and applies data from DB
+if (filter){
+var where = " AND "+ filter +" = '" + filtervalue+"'";
+} else { var where="";}
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ if(!db) { return; }
+ db.transaction( function(tx) {
+ //print('... read from database ' + field)
+ var rsArray=[];
+ //print('select DISTINCT '+field+' from '+table+' WHERE username="'+username+'"'+where+' ORDER BY '+field+' ASC');
+ var rs = tx.executeSql('select DISTINCT '+field+' from '+table+' WHERE username="'+username+'"'+where+' ORDER BY '+field+' ASC');
+ for(var i = 0; i < rs.rows.length; i++) {
+ rsArray.push(rs.rows.item(i)[field])
+ }
+ callback(rsArray);
+ });
+}
+
+function showMessage(header,message,rootwindow){
+ var cleanmessage=message.replace(/"/g,"-");
+ if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
+ var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';
+ var messageObject=Qt.createQmlObject(messageString,rootwindow,"messageOutput");
+}
+
+function inArray(list, prop, val) {
+ if (list.length > 0 ) {
+ for (var i in list) { if (list[i][prop] == val) {
+ return i;
+ }
+ }
+ } return -1;
+}
+function cleanArray(array) {
+var arraystring=JSON.stringify(array);
+ arraystring=arraystring.replace(/[\[\]]/g , '');
+return arraystring;
+}
+
+function cleanDate(date){
+var cleanedDate= date.slice(0,3)+", "+date.slice(8,11)+date.slice(4,7)+date.slice(25,30)+date.slice(10,25);
+return cleanedDate
+}
diff --git a/source-linux/js/image.js b/source-linux/js/image.js
new file mode 100644
index 0000000..5c48ac3
--- /dev/null
+++ b/source-linux/js/image.js
@@ -0,0 +1,272 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+
+function requestList(login,database,onlynew,rootwindow,callback) {
+ //get list of own images and call download function
+ Helperjs.friendicaRequest(login,"/api/friendica/photos/list", rootwindow,function (helperobject){
+ //print("return"+helperobject);
+ var obj=JSON.parse(helperobject);
+ if (onlynew){Helperjs.readField("id",database,"imageData",login.username,function(AllStoredImages){
+ if (AllStoredImages.length>0){
+ for(var i=0;i< AllStoredImages.length;i++){
+ var position=Helperjs.inArray(obj,"id",AllStoredImages[i]);
+ if (position>-1){obj.splice(position,1)}
+ }
+ }
+ callback(obj)
+ })}
+ else{callback(obj)}
+})}
+
+function dataRequest(login,photoID,database,xhr,rootwindow) {
+ // check if image exist and call download function
+ Helperjs.friendicaRequest(login,"/api/friendica/photo?photo_id="+photoID, rootwindow, function (image){
+ try{ if(image==""){currentimageno=currentimageno+1}else{
+ var obj = JSON.parse(image);
+ var helpfilename=obj.filename.substring(0,obj.filename.lastIndexOf("."));
+ var filesuffix="";
+ if (obj.type=="image/jpeg"){filesuffix=".jpg"}
+ else if (obj.type=="image/png"){filesuffix=".png"}
+ else {filesuffix=""}
+ if (helpfilename==""){// check if file has any filename
+ obj.filename=obj["id"]+filesuffix;
+ }
+ else{obj.filename=helpfilename+filesuffix}
+ var link="";
+ if(obj["link"][0]){link=obj["link"][0]} else{link=obj["link"]["4"]}
+ xhr.setUrl(Qt.resolvedUrl(link));
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setFilename(login.imagestore+'albums/'+obj.album+"/"+obj["filename"]);
+ xhr.setDownloadtype("picture");
+ xhr.download();
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('SELECT * from imageData where id = "'+obj["id"]+'"');
+ if(result.rows.length === 1) {// use update
+ result = tx.executeSql('UPDATE imageData SET username ="' +login.username+ '",id="'+obj.id+'", created="'+obj.created+'", edited="'+obj.edited+'", profile="'+obj.profile+'", link="'+obj["link"]["4"]+'", filename="'+obj.filename+'",title="'+obj.title+'", desc="'+obj.desc+'", type="'+obj.type+'", width="'+obj.width+'", height="'+obj.height+'", album="'+obj.album+'", location="file://'+login.imagestore+'albums/'+obj.album+'/" where id="'+obj["id"]+'"');
+ } else {// use insert print('... does not exists, create it')
+ result = tx.executeSql('INSERT INTO imageData VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,obj.id,obj.created,obj.edited, obj.title, obj.desc, obj.album, obj.filename, obj.type, obj.height, obj.width,obj. profile,obj["link"]["4"],'file://'+login.imagestore+'albums/'+obj.album+"/"]);
+ }
+ })}}
+ catch (e){print("Data retrieval failure! "+ e+obj);}
+})}
+
+function storeImagedata(login,database,imagedata,rootwindow) {
+ // check if image exist and call download function
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('SELECT * from imageData where id = "'+imagedata["id"]+'"');
+ if(result.rows.length === 1) {// use update
+ result = tx.executeSql('UPDATE imageData SET username ="' +login.username+ '",id="'+imagedata.id+'", created="'+imagedata.created+'", edited="'+imagedata.edited+'", profile="'+imagedata.profile+'", link="'+imagedata.link[0]+'", filename="'+imagedata.filename+'",title="'+imagedata.title+'", desc="'+imagedata.desc+'", type="'+imagedata.type+'", width="'+imagedata.width+'", height="'+imagedata.height+'", album="'+imagedata.album+'", location="file://'+login.imagestore+'albums/'+imagedata.album+'/" where id="'+imagedata["id"]+'"');
+ } else {// use insert print('... does not exists, create it')
+ result = tx.executeSql('INSERT INTO imageData VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,imagedata.id,imagedata.created,imagedata.edited, imagedata.title, imagedata.desc, imagedata.album, imagedata.filename, imagedata.type, imagedata.height, imagedata.width,imagedata. profile,imagedata.link[0],'file://'+login.imagestore+'albums/'+imagedata.album+"/"]);
+ }
+})}
+
+function deleteImage(database,login,type,location,filesystem,rootwindow,callback) { // delete image locally and on server
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ var rsfilename=location.substring(location.lastIndexOf("/")+1,location.length);
+ var rslocation=location.substring(0,location.lastIndexOf("/")+1);
+ //print(type+" Name "+ rsfilename+" Location: "+rslocation)
+ db.transaction( function(tx) {
+ if (type=='image'){
+ var rs= tx.executeSql('SELECT * FROM imageData WHERE filename="'+rsfilename+'" AND location="'+rslocation+'"')
+ var imageId=rs.rows.item(0).id;
+ Helperjs.friendicaPostRequest(login,"/api/friendica/photo/delete?photo_id="+imageId,"","DELETE",rootwindow, function (obj){
+ //var deletereturn = JSON.parse(obj); print(obj);
+ //if (deletereturn.result=="deleted"){
+ db.transaction( function(tx) {
+ var deleters=tx.executeSql('DELETE FROM imageData WHERE location="'+rslocation+'" AND filename="'+rsfilename+'"'); });
+ filesystem.Directory=rslocation.substring(7,rslocation.length-1);
+ filesystem.rmFile(rsfilename)
+ //}
+ })
+ }
+ else{
+ Helperjs.friendicaPostRequest(login,"/api/friendica/photoalbum/delete?album="+rsfilename,"","DELETE",rootwindow, function (obj){
+ //var deletereturn = JSON.parse(obj);
+ //if (deletereturn.result=="deleted"){
+ db.transaction( function(tx) {
+ var rs= tx.executeSql('SELECT DISTINCT location FROM imageData WHERE album="'+rsfilename+'" AND username="'+login.username+'"');
+ var locationstring=rs.rows.item(0).location;
+ filesystem.Directory=locationstring.substring(7,locationstring.length-1);
+ filesystem.rmDir();
+ var deleters=tx.executeSql('DELETE FROM imageData WHERE album="'+location+'"');
+ })
+ //}
+ })
+ }
+ callback(location)
+ })
+}
+
+function deleteContacts(database,user,callback) { // does nothing useful at the moment
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ //print(' delete Image Data() for ' + field +"="+selection)
+ db.transaction( function(tx) {
+ result1= tx.executeSql('SELECT * FROM contacts a LEFT OUTER JOIN news b ON a.url==b.uid');
+ result2= tx.executeSql('SELECT * FROM contacts a LEFT OUTER JOIN news b ON a.url==b.uid');
+ callback(result)})
+}
+
+//function requestFriendsAlbumPictures(login,friend,rootwindow,callback){
+//// screenscraping of albums page of contact without user and password
+// Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
+// //print(photohtml);
+// var photoarray=[];
+// var arr = photohtml.split("sidebar-photos-albums-li");
+// for (var i=2;i')-1);
+// var album={'link':albumlink,'name':albumname}
+// photoarray.push(album);
+// }
+// callback(photoarray)
+// })
+//}
+
+function newRequestFriendsAlbumPictures(login,friend,rootwindow,callback){
+// screenscraping of albums page of contact with remoteAuth
+ Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
+ //print("Photohtml: "+photohtml);
+ try {var obj=JSON.parse(photohtml);
+ if (obj.hasOwnProperty('status')){
+ Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
+ getAlbumFromHtml(photohtml,false,rootwindow,callback)})
+ }}
+ catch (e){
+ getAlbumFromHtml(photohtml,true,rootwindow,callback)
+ }
+ })
+}
+
+function getAlbumFromHtml(photohtml,remoteAuthBool,rootwindow,callback){
+ var photoarray=[];
+ var arr = photohtml.split("sidebar-photos-albums-li");
+ for (var i=2;i')-1);
+ var album={'link':albumlink,'name':albumname}//print(albumlink+" "+albumname);
+ photoarray.push(album);
+ }
+ callback(photoarray,remoteAuthBool)
+}
+
+
+function newRequestFriendsPictures(login,link,friend,remoteAuthBool,remoteauth,rootwindow,callback){
+// screenscraping of pictures page for given album
+ if (remoteAuthBool){
+ remoteauth.setUrl(login.server);
+ remoteauth.setLogin(login.username+":"+Qt.atob(login.password));
+ remoteauth.setContacturl(friend.url);
+ Helperjs.friendicaRemoteAuthRequest(login,link,friend.url,rootwindow,function(photohtml){
+ getPictureFromHtml(photohtml,remoteAuthBool,function(photoarray){
+ callback(photoarray)
+ })
+ })}
+ else{
+ Helperjs.friendicaWebRequest(link,rootwindow,function(photohtml){
+ getPictureFromHtml(photohtml,remoteAuthBool,function(photoarray){
+ callback(photoarray)
+ })
+ })
+ }
+}
+
+function getPictureFromHtml(photohtml,remoteAuthBool,callback){
+ var photoarray=[];
+ var basehtml=photohtml.substring(photohtml.indexOf('',photohtml.indexOf('-1){ //theme 1
+ var arr = photohtml.split("photo-album-image-wrapper-end");}
+
+// other themes
+ if (photohtml.indexOf("photo-album-wrapper")>-1){ //theme 2
+ var photoarea=photohtml.substring(photohtml.indexOf("photo-album-wrapper"),photohtml.indexOf("photo-album-end"))
+ var arr = photoarea.split("");}
+ //print("Url: "+login.server+ "Contacturl: "+friend.url)
+// remoteauth.setUrl(login.server);
+// remoteauth.setLogin(login.username+":"+Qt.atob(login.password));
+// remoteauth.setContacturl(friend.url);
+ for (var i=0;i',photohtml.indexOf('-1){ //theme 1
+ var arr = photohtml.split("photo-album-image-wrapper-end");}
+
+// other themes
+ if (photohtml.indexOf("photo-album-wrapper")>-1){ //theme 2
+ var photoarea=photohtml.substring(photohtml.indexOf("photo-album-wrapper"),photohtml.indexOf("photo-album-end"))
+ var arr = photoarea.split("");}
+
+ for (var i=0;i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+function showFriends(db) {
+ Service.readActiveConfig(db,function(login){
+ Service.requestFriends(login.url,login.user,login.password,displayFriends);
+ });
+}
+function displayFriends(obj){
+ for (var i=0; i= c.x)
+ f.contentX = c.x;
+ else if (f.contentX+f.width <= c.x+c.width)
+ f.contentX = c.x+c.width-f.width;
+ if (f.contentY >= c.y)
+ f.contentY = c.y;
+ else if (f.contentY+f.height <= c.y+c.height)
+ f.contentY = c.y+c.height-f.height;
+}
+
+function createObject(objectQml,qmlParameters,parentitem,callback) {
+ var component = Qt.createComponent(objectQml);
+ if (component.status === Component.Ready || component.status === Component.Error)
+ finishCreation(component,qmlParameters,parentitem,callback);
+ else
+ component.statusChanged.connect(finishCreation(qmlParameters));
+}
+
+function finishCreation(component,qmlParameters,parentitem,callback) {
+ if (component.status === Component.Ready) {
+ var createdObject = component.createObject(parentitem, qmlParameters);
+ if (createdObject === null)
+ print("Error creating image"); }
+ else if (component.status === Component.Error)
+ print("Error loading component:"+component.errorString());
+ else {print("created")}
+ //callback(createdObject);
+}
+
diff --git a/source-linux/js/news.js b/source-linux/js/news.js
new file mode 100644
index 0000000..f1c1ef7
--- /dev/null
+++ b/source-linux/js/news.js
@@ -0,0 +1,562 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+
+function requestFriends(login,database,rootwindow,callback){
+// return array of friends
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends
+ Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
+ var friends=JSON.parse(obj);
+ for (var i=0;i0'); // check for friends
+ var contactlist=[];
+ for (var i=0;i'+lastDate);
+ var result2 = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge > '+lastDate);
+ for (var j=0;j0){
+ for (var j=0;j0){
+ for (var k=0;j0){var helpernews=newsrs.rows.item(0);
+ var newscount=newsrs.rows.length;
+ helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
+ helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
+ helpernews.text=Qt.atob(helpernews.text);
+ helpernews.id=helpernews.status_id;
+ if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
+ callback(helpernews,newscount);}
+// var conversationobject={news:helpernews,newscount:newscount};
+// return conversationobject;
+})}
+
+
+
+
+function getAllContacts(database,user){
+ var allcontacts=[];
+ Helperjs.readData(database,"contacts",user,function(obj){
+ allcontacts=obj;
+ for (var n in allcontacts){
+ allcontacts[n].name=Qt.atob(allcontacts[n].name);
+ allcontacts[n].description=Qt.atob(allcontacts[n].description)
+ }
+ });
+ return allcontacts;
+}
+
+function inArray(list, prop, val) {
+ if (list.length > 0 ) {
+ for (var i in list) {if (list[i][prop] == val) {
+ return true;
+ }
+ }
+ } return false;
+}
+
+function objFromArray(list, prop, val) {
+ if (list.length > 0 ) {
+ for (var i in list) {if (list[i][prop] == val) {
+ return list[i];
+ }
+ }
+ } return false;
+}
+
+function cleanDate(date){
+ var cleanedDate= date.slice(0,3)+", "+date.slice(8,11)+date.slice(4,7)+date.slice(25,30)+date.slice(10,25);
+ return cleanedDate
+}
diff --git a/source-linux/js/newsworker.js b/source-linux/js/newsworker.js
new file mode 100644
index 0000000..fe60147
--- /dev/null
+++ b/source-linux/js/newsworker.js
@@ -0,0 +1,129 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+WorkerScript.onMessage = function(msg) {
+if(msg.deleteId!==undefined)
+ {msg.model.remove(msg.deleteId);
+ msg.model.sync()
+}
+else{
+ if(msg.appendnews!==true){msg.model.clear()};
+ msg.model.sync()
+ for (var j=0;j0){
+ if (newsitemobject.friendica_activities.like.length==1){likeText= newsitemobject.friendica_activities.like[0].name+" "+ qsTr("likes this.")}
+ else {likeText= newsitemobject.friendica_activities.like.length+" "+ qsTr("like this.")}
+ }
+ if (newsitemobject.friendica_activities.dislike.length>0){
+ if (newsitemobject.friendica_activities.dislike.length==1){dislikeText= newsitemobject.friendica_activities.dislike[0].name+" "+ qsTr("doesn't like this.")}
+ else {dislikeText= newsitemobject.friendica_activities.dislike.length+" "+ qsTr("don't like this.")}
+ }
+ if (newsitemobject.friendica_activities.attendyes.length>0){
+ if (newsitemobject.friendica_activities.attendyes.length==1){attendyesText=newsitemobject.friendica_activities.attendyes[0].name+" "+ qsTr("will attend.")}
+ else {attendyesText= newsitemobject.friendica_activities.attendyes.length+" "+ qsTr("persons will attend.")}
+ }
+ if (newsitemobject.friendica_activities.attendno.length>0){
+ if (newsitemobject.friendica_activities.attendno.length==1){attendnoText= newsitemobject.friendica_activities.attendno[0].name+" "+ qsTr("will not attend.")}
+ else {attendnoText= newsitemobject.friendica_activities.attendno.length+" "+ qsTr("persons will not attend.")}
+ }
+ if (newsitemobject.friendica_activities.attendmaybe.length>0){
+ if (newsitemobject.friendica_activities.attendmaybe.length==1){attendmaybeText= newsitemobject.friendica_activities.attendmaybe[0].name+" "+ qsTr("may attend.")}
+ else {attendmaybeText= newsitemobject.friendica_activities.attendmaybe.length+" "+ qsTr("persons may attend.")}
+ }
+ //var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self);
+ if (newsitemobject.hasOwnProperty("friendica_activities_self")){
+ if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")}
+ if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")}
+ if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")}
+ if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
+ if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
+ }}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
+ var friendica_activities={likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText,self:self}
+ var attachmentList=[];
+ try{if(newsitemobject.attachments){
+ var attachArray=newsitemobject.attachments;
+ for (var image in attachArray){
+ var attachhelper={mimetype:attachArray[image].mimetype}
+ var attachhelperstring=Qt.btoa(attachArray[image].url)
+ var helperstringposition=newsitemobject.text.indexOf(attachhelperstring);
+ if (helperstringposition>-1){attachhelper.url=newsitemobject.text.substring(newsitemobject.text.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
+ if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
+ else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
+ else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
+ }
+ else {attachhelper.url=attachArray[image].url}
+ attachmentList.push(attachhelper)
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url,"")
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
+ newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
+ }
+ }}catch(e){print("attachment "+e)}
+ newsitemobject.attachmentList=attachmentList;
+
+ var seconds=(msg.currentTime-newsitemobject.created_at)/1000;
+ var timestring="";
+ if (seconds<60) {timestring=seconds+" "+qsTr("seconds") +" "+qsTr("ago");}
+ else if (seconds<90){timestring=Math.round(seconds/60)+" "+qsTr("minute") +" "+qsTr("ago");}
+ else if (seconds<3600){timestring=Math.round(seconds/60)+" "+qsTr("minutes") +" "+qsTr("ago");}
+ else if (seconds<5400){timestring=Math.round(seconds/3600)+" "+qsTr("hour") +" "+qsTr("ago");}
+ else if (seconds<86400){timestring=Math.round(seconds/3600)+" "+qsTr("hours") +" "+qsTr("ago");}
+ else if (seconds<129600){timestring=Math.round(seconds/86400)+" "+qsTr("day") +" "+qsTr("ago");}
+ else if (seconds<3888000){timestring=Math.round(seconds/86400)+" "+qsTr("days") +" "+qsTr("ago");}
+ else if (seconds<5832000){timestring=Math.round(seconds/3888000)+" "+qsTr("month") +" "+qsTr("ago");}
+ else if (seconds<69984000){timestring=Math.round(seconds/3888000)+" "+qsTr("months") +" "+qsTr("ago");}
+ else {timestring=Math.round(seconds/46656000)+" "+qsTr("years") +" "+qsTr("ago");}
+
+ var data=({"newsitemobject": newsitemobject,"dateDiff":timestring,"friendica_activities":friendica_activities,"forumname":forumname})}
+ //print("News:"+j+msg.news.length+JSON.stringify(data));
+ msg.model.append(data)
+ }
+
+ if (j==msg.news.length){
+ //print("j: "+j+" msg.model.count: "+msg.model.count);
+ msg.model.sync()
+}
+}
+}
diff --git a/source-linux/js/photoworker.js b/source-linux/js/photoworker.js
new file mode 100644
index 0000000..76f2129
--- /dev/null
+++ b/source-linux/js/photoworker.js
@@ -0,0 +1,47 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+WorkerScript.onMessage = function(msg) {
+ if (msg.firstalbum==0){msg.model.clear();}
+ var contact={}; try{contact=msg.friend}catch(e){print(e)}
+ var limit=0; if (msg.albums.length-msg.firstalbum<20){limit=msg.albums.length} else{limit=msg.firstalbum+20}
+ for (var j=msg.firstalbum;j
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+//.pragma library
+.import QtQuick.LocalStorage 2.0 as Sql
+.import "qrc:/js/helper.js" as Helperjs
+.import "qrc:/js/news.js" as Newsjs
+
+// CONFIG FUNCTIONS
+
+function initDatabase(database) { // initialize the database object
+ var db =Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ print('initDatabase()'+database[0]+database[1]+database[2]+database[3])
+ db.transaction( function(tx) {
+ //var version=tx.executeSql('PRAGMA user_version');print(JSON.stringify(version.rows.item(0)))
+ tx.executeSql('CREATE TABLE IF NOT EXISTS imageData(username TEXT,id INT, created TEXT,edited TEXT, title TEXT, desc TEXT, album TEXT,filename TEXT, type TEXT, height INT, width INT, profile INT, link TEXT,location TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS config(server TEXT, username TEXT, password TEXT, imagestore TEXT, maxnews INT, timerInterval INT, newsViewType TEXT,isActive INT, permissions TEXT,maxContactAge INT,APIVersion TEXT,layout TEXT, addons TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS news(username TEXT, messagetype INT, text TEXT, created_at INT, in_reply_to_status_id INT, source TEXT, status_id INT, in_reply_to_user_id INT, geo TEXT,favorited TEXT, uid INT, statusnet_html TEXT, statusnet_conversation_id TEXT,friendica_activities TEXT, friendica_activities_self TEXT, attachments TEXT, friendica_owner TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS contacts(username TEXT, id INT, name TEXT, screen_name TEXT, location TEXT,imageAge INT, profile_image_url TEXT, description TEXT, profile_image BLOB, url TEXT, protected TEXT, followers_count INT, friends_count INT, created_at INT, favourites_count TEXT, utc_offset TEXT, time_zone TEXT, statuses_count INT, following TEXT, verified TEXT, statusnet_blocking TEXT, notifications TEXT, statusnet_profile_url TEXT, cid INT, network TEXT, isFriend INT, timestamp INT)');
+// tx.executeSql('CREATE INDEX IF NOT EXISTS contact_id ON contacts(id)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(username TEXT, id INT, profiledata TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS groups(username TEXT, groupname TEXT, gid INT, members TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS events(username TEXT, id INT, start INT, end INT, allday INT, title TEXT, j INT, d TEXT, isFirst INT, uid INT, cid INT, uri TEXT, created INT, edited INT, desc TEXT, location TEXT, type TEXT, nofinish TEXT, adjust INT, ignore INT, permissions TEXT, guid INT, itemid INT, plink TEXT, authorName TEXT, authorAvatar TEXT, authorLink TEXT, html TEXT)');
+})}
+
+function cleanPermissions(oldperms){
+ var newperms=oldperms.replace("<","");newperms=newperms.replace(">","");newperms="["+newperms+"]";
+ var newpermArray=JSON.parse(newperms);
+return (newpermArray)
+}
+
+function getEvents(database,login,rootwindow,callback){
+var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ Helperjs.friendicaWebRequest(login.server+"/cal/"+login.username+"/json",rootwindow,function(obj){
+ //Helperjs.friendicaRemoteAuthRequest(login,login.server+"/cal/"+login.username+"/json",login.server+"/profile/"+login.username,rootwindow,function(obj){
+ var events = JSON.parse(obj);
+ db.transaction( function(tx) {
+ for (var i=0;i0){
+ for(var i = 0; i < rs.rows.length; i++) {
+ rsArray.push(rs.rows.item(i))
+ }
+ var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,maxnews:rsArray[0].maxnews,isActive:rsArray[0].isActive,timerInterval:rsArray[0].timerInterval, newsViewType:rsArray[0].newsViewType,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
+ } else {var rsObject=""}
+ callback(rsObject)}}
+ )
+}
+
+function readActiveConfig(database){
+ var obj;
+ readConfig(database,function(config){obj=config},"isActive", 0);
+ return obj;
+}
+
+function deleteConfig(database,userobj,callback) { // delete user data from DB
+ if (userobj){var where = " WHERE username='"+ userobj.username+"' and server='"+userobj.server+"'";} else { return "no user selected!";}
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ if(!db) { return; }
+ db.transaction( function(tx) {
+ var rs1 = tx.executeSql('delete from config'+where);
+ var rs2 = tx.executeSql("delete from news WHERE username='"+ userobj.username+"'");
+ var rs3 = tx.executeSql("delete from contacts WHERE username='"+ userobj.username+"'");
+ var rs4 = tx.executeSql("delete from imageData WHERE username='"+ userobj.username+"'");
+ var rs5 = tx.executeSql("delete from groups WHERE username='"+ userobj.username+"'");
+ var rs5 = tx.executeSql("delete from events WHERE username='"+ userobj.username+"'");
+ callback();
+ })
+}
+
+function cleanNews(database,callback){
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var maxnewsrs = tx.executeSql("SELECT DISTINCT maxnews FROM config");
+ var maxnews=maxnewsrs.rows.item(0).maxnews;
+ var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
+ var newscount = newscountrs.rows.item(0)["COUNT(*)"];//print("newscount "+newscount)
+ if (newscount>maxnews){
+ var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news ORDER BY created_at ASC LIMIT ' +(newscount-maxnews));
+ var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnews-1).created_at;
+ var deleters = tx.executeSql('DELETE from news WHERE created_at<='+lastvalidtime)}
+ callback()
+ })
+ }
+
+function cleanContacts(login,database,callback){
+ var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
+ db.transaction( function(tx) {
+ var oldestnewsrs= tx.executeSql('SELECT created_at FROM news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY created_at ASC LIMIT 1');
+ if (oldestnewsrs.rows.length>0){ var oldestnewsTime=oldestnewsrs.rows.item(0).created_at- 604800000;} else{var oldestnewsTime=0} //contacts can be 7 days old
+ //print(login.username+" älteste news: "+ oldestnewsTime);
+ var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
+ //print ("Contact result length: "+ result.rows.length)
+ for (var i=0;i-1){contacttimer.start()}
+ }
+
+}
+
+
+function cleanUser(user){
+ user.created_at=Date.parse(Newsjs.cleanDate(user.created_at));
+ var imagehelper1=user.profile_image_url.split("?");
+ var imagehelper2=imagehelper1[0].substring(imagehelper1[0].lastIndexOf("/")+1,imagehelper1[0].length);
+ var imagehelper3=login.imagestore+"contacts/"+user.screen_name+"-"+imagehelper2
+ if(filesystem.fileexist(imagehelper3)){user.profile_image=imagehelper3}else {user.profile_image=""}
+ return user
+}
+
+function updateView(viewtype){
+ newsBusy.running=true;
+ //downloadNotice.text="xhr start "+Date.now()
+ switch(viewtype){
+ case "Conversations":
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ break;
+ case "Timeline":
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ break;
+ case "Search":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/search");
+ break;
+ case "Notifications":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/friendica/notifications");
+ xhr.clearParams();
+ break;
+ case "Direct Messages":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/direct_messages/all");
+ xhr.clearParams();
+ break;
+ case "Public Timeline":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/public_timeline");
+ xhr.clearParams();
+ break;
+ case "Favorites":
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/favorites");
+ xhr.clearParams();
+ break;
+ default:
+ var lastnews=Newsjs.getLastNews(login,db);
+ xhr.setLogin(login.username+":"+Qt.atob(login.password));
+ xhr.setUrl(login.server);
+ xhr.setApi("/api/statuses/friends_timeline");
+ xhr.clearParams();
+ xhr.setParam("since_id",lastnews);
+ xhr.setParam("count",50)
+ newstab.newstabstatus="Conversations";
+ }
+ xhr.get();
+
+ if (viewtype==="Conversations"){Newsjs.allchatsfromdb(db,login.username,function(temp){
+ newsStack.allchats=temp
+ })}
+}
+
+function showGroups(){
+ Helperjs.readData(db,"groups",login.username,function(groups){
+ var groupitems="";
+ for (var i=0;i
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see .
+
+
+var core=[
+{name:'<3',url:
+'qrc:///images/smileys/core/smiley-heart.gif'},
+
+{name:'</3',url:
+'qrc:///images/smileys/core/smiley-brokenheart.gif'},
+
+{name:':-)',url:
+'qrc:///images/smileys/core/smiley-smile.gif'},
+
+{name:';-)',url:
+'qrc:///images/smileys/core/smiley-wink.gif'},
+
+{name:':-(',url:
+'qrc:///images/smileys/core/smiley-frown.gif'},
+
+{name:':-P',url:
+'qrc:///images/smileys/core/smiley-tongue-out.gif'},
+
+{name:':-X',url:
+'qrc:///images/smileys/core/smiley-kiss.gif'},
+
+{name:':-D',url:
+'qrc:///images/smileys/core/smiley-laughing.gif'},
+
+{name:':-O',url:
+'qrc:///images/smileys/core/smiley-surprised.gif'},
+
+{name:'\\o/',url:
+'qrc:///images/smileys/core/smiley-thumbsup.gif'},
+
+{name:'o.O',url:
+'qrc:///images/smileys/core/smiley-Oo.gif'},
+
+{name:":'(",url:
+'qrc:///images/smileys/core/smiley-cry.gif'},
+
+{name:":-!",url:
+'qrc:///images/smileys/core/smiley-foot-in-mouth.gif'},
+
+{name:":-/",url:
+'qrc:///images/smileys/core/smiley-undecided.gif'},
+
+{name:":-[",url:
+'qrc:///images/smileys/core/smiley-embarassed.gif'},
+
+{name:"8-)",url:
+'qrc:///images/smileys/core/smiley-cool.gif'},
+
+{name:':beer',url:
+'qrc:///images/smileys/core/beer_mug.gif'},
+
+{name:':coffee',url:
+'qrc:///images/smileys/core/coffee.gif'},
+
+{name:':facepalm',url:
+'qrc:///images/smileys/core/smiley-facepalm.gif'},
+
+{name:':like',url:
+'qrc:///images/smileys/core/like.gif'},
+
+{name:':dislike',url:
+'qrc:///images/smileys/core/dislike.gif'},
+
+{name:'~friendica',url:
+'qrc:///images/smileys/core/friendica-16.png'},
+
+{name:'red#',url:
+'qrc:///images/smileys/core/rm-16.png'}
+]
+
+
+var addon=[
+{name:':bunnyflowers',url:
+'qrc:///images/smileys/animals/bunnyflowers.gif'},
+
+ {name:':chick',url:
+'qrc:///images/smileys/animals/chick.gif'},
+
+ {name:':bumblebee',url:
+'qrc:///images/smileys/animals/bee.gif'},
+
+ {name:':ladybird',url:
+'qrc:///images/smileys/animals/ladybird.gif'},
+
+ {name:':bigspider',url:
+'qrc:///images/smileys/animals/bigspider.gif' },
+
+ {name:':cat',url:
+'qrc:///images/smileys/animals/cat.gif'},
+
+ {name:':bunny',url:
+'qrc:///images/smileys/animals/bunny.gif' },
+
+ {name:':cow',url:
+'qrc:///images/smileys/animals/cow.gif' },
+
+ {name:':crab',url:
+'qrc:///images/smileys/animals/crab.gif' },
+
+ {name:':dolphin',url:
+'qrc:///images/smileys/animals/dolphin.gif' },
+
+ {name:':dragonfly',url:
+'qrc:///images/smileys/animals/dragonfly.gif' },
+
+ {name:':frog',url:
+'qrc:///images/smileys/animals/frog.gif'},
+
+ {name:':hamster',url:
+'qrc:///images/smileys/animals/hamster.gif' },
+
+ {name:':monkey',url:
+'qrc:///images/smileys/animals/monkey.gif' },
+
+ {name:':horse',url:
+'qrc:///images/smileys/animals/horse.gif' },
+
+ {name:':parrot',url:
+'qrc:///images/smileys/animals/parrot.gif' },
+
+ {name:':tux',url:
+'qrc:///images/smileys/animals/tux.gif' },
+
+ {name:':snail',url:
+'qrc:///images/smileys/animals/snail.gif' },
+
+ {name:':sheep',url:
+'qrc:///images/smileys/animals/sheep.gif' },
+
+ {name:':dog',url:
+'qrc:///images/smileys/animals/dog.gif'},
+
+ {name:':elephant',url:
+'qrc:///images/smileys/animals/elephant.gif' },
+
+ {name:':fish',url:
+'qrc:///images/smileys/animals/fish.gif' },
+
+ {name:':giraffe',url:
+'qrc:///images/smileys/animals/giraffe.gif' },
+
+ {name:':pig',url:
+'qrc:///images/smileys/animals/pig.gif'},
+
+//Baby
+
+ {name:':baby',url:
+'qrc:///images/smileys/babies/baby.gif' },
+
+ {name:':babycot',url:
+'qrc:///images/smileys/babies/babycot.gif' },
+
+
+ {name:':pregnant',url:
+'qrc:///images/smileys/babies/pregnant.gif' },
+
+ {name:':stork',url:
+'qrc:///images/smileys/babies/stork.gif' },
+
+
+//Confused
+ {name:':confused',url:
+'qrc:///images/smileys/confused/confused.gif' },
+
+ {name:':shrug',url:
+'qrc:///images/smileys/confused/shrug.gif' },
+
+ {name:':stupid',url:
+'qrc:///images/smileys/confused/stupid.gif' },
+
+ {name:':dazed',url:
+'qrc:///images/smileys/confused/dazed.gif' },
+//Cool 'qrc:///images/smileys
+
+ {name:':affro',url:
+'qrc:///images/smileys/cool/affro.gif'},
+
+//Devil/Angel
+
+ {name:':angel',url:
+'qrc:///images/smileys/devilangel/angel.gif'},
+
+ {name:':cherub',url:
+'qrc:///images/smileys/devilangel/cherub.gif'},
+
+ {name:':devilangel',url:
+'qrc:///images/smileys/devilangel/blondedevil.gif' },
+ {name:':catdevil',url:
+'qrc:///images/smileys/devilangel/catdevil.gif'},
+
+ {name:':devillish',url:
+'qrc:///images/smileys/devilangel/devil.gif'},
+
+ {name:':daseesaw',url:
+'qrc:///images/smileys/devilangel/daseesaw.gif'},
+
+ {name:':turnevil',url:
+'qrc:///images/smileys/devilangel/turnevil.gif' },
+
+ {name:':saint',url:
+'qrc:///images/smileys/devilangel/saint.gif'},
+
+ {name:':graveside',url:
+'qrc:///images/smileys/devilangel/graveside.gif'},
+
+//Unpleasent
+
+ {name:':toilet',url:
+'qrc:///images/smileys/disgust/toilet.gif'},
+
+ {name:':fartinbed',url:
+'qrc:///images/smileys/disgust/fartinbed.gif' },
+
+ {name:':fartblush',url:
+'qrc:///images/smileys/disgust/fartblush.gif' },
+
+//Drinks
+
+ {name:':tea',url:
+'qrc:///images/smileys/drink/tea.gif' },
+
+ {name:':drool',url:
+'qrc:///images/smileys/drool/drool.gif'},
+
+//Sad
+
+ {name:':crying',url:
+'qrc:///images/smileys/sad/crying.png'},
+
+ {name:':prisoner',url:
+'qrc:///images/smileys/sad/prisoner.gif' },
+
+ {name:':sigh',url:
+'qrc:///images/smileys/sad/sigh.gif'},
+
+//Smoking - only one smiley in here, maybe it needs moving elsewhere?
+
+ {name:':smoking',url:
+'qrc:///images/smileys/smoking/smoking.gif'},
+
+//Sport
+
+ {name:':basketball',url:
+'qrc:///images/smileys/sport/basketball.gif'},
+
+ {name:':bowling',url:
+'qrc:///images/smileys/sport/bowling.gif'},
+
+ {name:':cycling',url:
+'qrc:///images/smileys/sport/cycling.gif'},
+
+ {name:':darts',url:
+'qrc:///images/smileys/sport/darts.gif'},
+
+ {name:':fencing',url:
+'qrc:///images/smileys/sport/fencing.gif' },
+
+ {name:':juggling',url:
+'qrc:///images/smileys/sport/juggling.gif'},
+
+ {name:':skipping',url:
+'qrc:///images/smileys/sport/skipping.gif'},
+
+ {name:':archery',url:
+'qrc:///images/smileys/sport/archery.gif'},
+
+ {name:':surfing',url:
+'qrc:///images/smileys/sport/surfing.gif' },
+
+ {name:':snooker',url:
+'qrc:///images/smileys/sport/snooker.gif' },
+
+ {name:':horseriding',url:
+'qrc:///images/smileys/sport/horseriding.gif'},
+
+//Love
+
+ {name:':iloveyou',url:
+'qrc:///images/smileys/love/iloveyou.gif'},
+
+ {name:':inlove',url:
+'qrc:///images/smileys/love/inlove.gif'},
+
+ {name:':~love',url:
+'qrc:///images/smileys/love/love.gif' },
+
+ {name:':lovebear',url:
+'qrc:///images/smileys/love/lovebear.gif'},
+
+ {name:':lovebed',url:
+'qrc:///images/smileys/love/lovebed.gif' },
+
+ {name:':loveheart',url:
+'qrc:///images/smileys/love/loveheart.gif' },
+
+//Tired/Sleep
+
+ {name:':countsheep',url:
+'qrc:///images/smileys/tired/countsheep.gif' },
+
+ {name:':hammock',url:
+'qrc:///images/smileys/tired/hammock.gif'},
+
+ {name:':pillow',url:
+'qrc:///images/smileys/tired/pillow.gif' },
+
+ {name:':yawn',url:
+'qrc:///images/smileys/tired/yawn.gif'},
+
+//Fight/Flame/Violent
+
+ {name:':2guns',url:
+'qrc:///images/smileys/fight/2guns.gif' },
+
+ {name:':alienfight',url:
+'qrc:///images/smileys/fight/alienfight.gif' },
+
+ {name:':army',url:
+'qrc:///images/smileys/fight/army.gif'},
+
+ {name:':arrowhead',url:
+'qrc:///images/smileys/fight/arrowhead.gif'},
+
+ {name:':bfg',url:
+'qrc:///images/smileys/fight/bfg.gif' },
+
+ {name:':bowman',url:
+'qrc:///images/smileys/fight/bowman.gif' },
+
+ {name:':chainsaw',url:
+'qrc:///images/smileys/fight/chainsaw.gif'},
+
+ {name:':crossbow',url:
+'qrc:///images/smileys/fight/crossbow.gif'},
+
+ {name:':crusader',url:
+'qrc:///images/smileys/fight/crusader.gif' },
+
+ {name:':dead',url:
+'qrc:///images/smileys/fight/dead.gif' },
+
+ {name:':hammersplat',url:
+'qrc:///images/smileys/fight/hammersplat.gif' },
+
+ {name:':lasergun',url:
+'qrc:///images/smileys/fight/lasergun.gif' },
+
+ {name:':machinegun',url:
+'qrc:///images/smileys/fight/machinegun.gif' },
+
+ {name:':acid',url:
+'qrc:///images/smileys/fight/acid.gif' },
+
+//Fantasy - monsters and dragons fantasy. The other type of fantasy belongs in adult
+
+ {name:':alienmonster',url:
+'qrc:///images/smileys/fantasy/alienmonster.gif' },
+
+ {name:':barbarian',url:
+'qrc:///images/smileys/fantasy/barbarian.gif' },
+
+ {name:':dinosaur',url:
+'qrc:///images/smileys/fantasy/dinosaur.gif'},
+
+ {name:':dragon',url:
+'qrc:///images/smileys/fantasy/dragon.gif'},
+
+ {name:':draco',url:
+'qrc:///images/smileys/fantasy/dragonwhelp.gif'},
+
+ {name:':ghost',url:
+'qrc:///images/smileys/fantasy/ghost.gif'},
+
+ {name:':mummy',url:
+'qrc:///images/smileys/fantasy/mummy.gif'},
+
+//Food
+
+ {name:':apple',url:
+'qrc:///images/smileys/food/apple.gif' },
+
+ {name:':broccoli',url:
+'qrc:///images/smileys/food/broccoli.gif' },
+
+ {name:':cake',url:
+'qrc:///images/smileys/food/cake.gif'},
+
+ {name:':carrot',url:
+'qrc:///images/smileys/food/carrot.gif' },
+
+ {name:':popcorn',url:
+'qrc:///images/smileys/food/popcorn.gif'},
+
+ {name:':tomato',url:
+'qrc:///images/smileys/food/tomato.gif'},
+
+ {name:':banana',url:
+'qrc:///images/smileys/food/banana.gif'},
+
+ {name:':cooking',url:
+'qrc:///images/smileys/food/cooking.gif'},
+
+ {name:':fryegg',url:
+'qrc:///images/smileys/food/fryegg.gif'},
+
+ {name:':birthdaycake',url:
+'qrc:///images/smileys/food/birthdaycake.gif'},
+
+//Happy
+
+ {name:':cloud9',url:
+'qrc:///images/smileys/happy/cloud9.gif'},
+
+ {name:':tearsofjoy',url:
+'qrc:///images/smileys/happy/tearsofjoy.gif' },
+
+//Repsect
+
+ {name:':bow',url:
+'qrc:///images/smileys/respect/bow.gif'},
+
+ {name:':bravo',url:
+'qrc:///images/smileys/respect/bravo.gif'},
+
+ {name:':hailking',url:
+'qrc:///images/smileys/respect/hailking.gif'},
+
+ {name:':number1',url:
+'qrc:///images/smileys/respect/number1.gif' },
+
+//Laugh
+
+ {name:':hahaha',url:
+'qrc:///images/smileys/laugh/hahaha.gif'},
+
+ {name:':loltv',url:
+'qrc:///images/smileys/laugh/loltv.gif' },
+
+ {name:':rofl',url:
+'qrc:///images/smileys/laugh/rofl.gif'},
+
+//Music
+
+ {name:':drums',url:
+'qrc:///images/smileys/music/drums.gif'},
+
+
+ {name:':guitar',url:
+'qrc:///images/smileys/music/guitar.gif'},
+
+ {name:':trumpet',url:
+'qrc:///images/smileys/music/trumpet.gif' },
+
+//smileys that used to be in core
+
+ {name:':headbang',url:
+'qrc:///images/smileys/oldcore/headbang.gif'},
+
+ {name:':beard',url:
+'qrc:///images/smileys/oldcore/beard.png'},
+
+ {name:':whitebeard',url:
+'qrc:///images/smileys/oldcore/whitebeard.png'},
+
+ {name:':shaka',url:
+'qrc:///images/smileys/oldcore/shaka.gif'},
+
+ {name:':\\.../',url:
+'qrc:///images/smileys/oldcore/shaka.gif'},
+
+ {name:':\\ooo/',url:
+'qrc:///images/smileys/oldcore/shaka.gif' },
+
+ {name:':headdesk',url:
+'qrc:///images/smileys/oldcore/headbang.gif' },
+
+//These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
+
+ {name:':-d',url:
+'qrc:///images/smileys/oldcore/laughing.gif'},
+
+ {name:':-o',url:
+'qrc:///images/smileys/oldcore/surprised.gif' },
+
+// Regex killers - stick these at the bottom so they appear at the end of the English and
+// at the start of $OtherLanguage.
+
+ {name:':cool',url:
+'qrc:///images/smileys/cool/cool.gif' },
+
+ {name:':vomit',url:
+'qrc:///images/smileys/disgust/vomit.gif' },
+
+ {name:':golf',url:
+'qrc:///images/smileys/sport/golf.gif' },
+
+ {name:':football',url:
+'qrc:///images/smileys/sport/football.gif'},
+
+ {name:':tennis',url:
+'qrc:///images/smileys/sport/tennis.gif' },
+
+ {name:':alpha',url:
+'qrc:///images/smileys/fight/alpha.png' },
+
+ {name:':marine',url:
+'qrc:///images/smileys/fight/marine.gif' },
+
+ {name:':sabre',url:
+'qrc:///images/smileys/fight/sabre.gif' },
+
+ {name:':tank',url:
+'qrc:///images/smileys/fight/tank.gif' },
+
+ {name:':viking',url:
+'qrc:///images/smileys/fight/viking.gif' },
+
+ {name:':gangs',url:
+'qrc:///images/smileys/fight/gangs.gif' },
+
+ {name:':dj',url:
+'qrc:///images/smileys/music/dj.gif'},
+
+ {name:':elvis',url:
+'qrc:///images/smileys/music/elvis.gif'},
+
+ {name:':violin',url:
+'qrc:///images/smileys/music/violin.gif'},
+]
+
+
+var adult=[
+{
+name:'(o)(o) ',url:
+'qrc:///images/smileys/adult/tits.gif'},
+
+{name:'(.)(.) ',url:
+'qrc:///images/smileys/adult/tits.gif'},
+
+{name:':bong',url:
+'qrc:///images/smileys/adult/bong.gif'},
+
+{name:':sperm',url:
+'qrc:///images/smileys/adult/sperm.gif'},
+
+{name:':drunk',url:
+'qrc:///images/smileys/adult/drunk.gif'},
+
+{name:':finger',url:
+'qrc:///images/smileys/adult/finger.gif'}
+]
diff --git a/src/qml/genericqml/RootStack.qml b/source-linux/qml/calendarqml/CalendarDay.qml
similarity index 51%
rename from src/qml/genericqml/RootStack.qml
rename to source-linux/qml/calendarqml/CalendarDay.qml
index 3898095..21064df 100644
--- a/src/qml/genericqml/RootStack.qml
+++ b/source-linux/qml/calendarqml/CalendarDay.qml
@@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
-// Copyright (C) 2020 Marco R.
+// Copyright (C) 2017 Marco R.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -28,38 +28,51 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-import QtQuick 6.3
-import QtQuick.Controls 6.3
-import QtQuick.Layouts
-StackLayout{
- id:rootstack
- width:rootstackView.width
- height: rootstackView.height
- currentIndex:bar.currentIndex
+import QtQuick 2.0
+import QtQuick.Controls 1.4
- function indexchange(pageindex){currentIndex=pageindex;bar.currentIndex=pageindex}
-
- Loader{
- id: newstab
- property string newstabstatus
- source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
+Item {
+ id: calendarDay
+ width:7*mm
+ height: 7*mm
+ property int dateInt:Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
+ Rectangle {
+ id: placeHolder
+ color: 'lightblue'; antialiasing: true
+ anchors.fill:parent
}
- Loader{
- id: friendstab
- source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
+ Text {
+ id:daytext
+ anchors.right: parent.right
+ anchors.margins: 0.5*mm
+ color:(model.month==monthgrid.month)?"black":"grey"
+ wrapMode: Text.WrapAnywhere
+ text: model.day
+ font.bold: model.today
+ font.pixelSize: 4*mm
}
- Loader{
- id: fotostab
- property string phototabstatus:"Images"
- source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
+ Rectangle {
+ id:eventRect
+ color:"black"
+ anchors.margins: 0.5*mm
+ anchors.bottom: calendarDay.bottom
+ width: parent.width-mm
+ height: mm
+ visible: eventdays.indexOf(dateInt)>-1
}
- Loader{
- id: calendartab
- property string calendartabstatus:"Events"
- source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
- }
- Component.onCompleted: {
- root.rootstackSignal.connect(indexchange);
+ MouseArea {
+ anchors.fill: calendarDay
+ onClicked: {
+ var eventDate=[];
+ var idx = eventdays.indexOf(dateInt);
+ while (idx != -1) {
+ eventDate.push(idx);
+ idx = eventdays.indexOf(dateInt,idx + 1)
+ }
+ var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
+ if (component.status== Component.Ready){
+ var eventlist = component.createObject(calendartab,{"daylist": eventDate})}
+ }
}
}
diff --git a/source-linux/qml/calendarqml/CalendarTab.qml b/source-linux/qml/calendarqml/CalendarTab.qml
new file mode 100644
index 0000000..3f96a62
--- /dev/null
+++ b/source-linux/qml/calendarqml/CalendarTab.qml
@@ -0,0 +1,167 @@
+// This file is part of Friendiqa
+// https://github.com/lubuwest/Friendiqa
+// Copyright (C) 2017 Marco R.
+//
+// This program is free 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.
+//
+// In addition, as a special exception, the copyright holders give
+// permission to link the code of portions of this program with the
+// OpenSSL library under certain conditions as described in each
+// individual source file, and distribute linked combinations including
+// the two.
+//
+// You must obey the GNU General Public License in all respects for all
+// of the code used other than OpenSSL. If you modify file(s) with this
+// exception, you may extend this exception to your version of the
+// file(s), but you are not obligated to do so. If you do not wish to do
+// so, delete this exception statement from your version. If you delete
+// this exception statement from all source files in the program, then
+// also delete it here.
+//
+// This program 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 this program. If not, see