version v0.6
This commit is contained in:
parent
bdc28e632e
commit
8482bde3ed
86 changed files with 7064 additions and 3208 deletions
74
CHANGELOG.md
74
CHANGELOG.md
|
@ -1,72 +1,79 @@
|
||||||
## v0.5.4 ##
|
## v0.6
|
||||||
* More Simplification of account page (images are stored in the private app directory, no permission required)
|
|
||||||
* Image attachment for Android 10 repaired
|
* New language: Hungarian
|
||||||
* Hashtags are saved after message is sent and can be used in later messages
|
* Multiple photos in post open in separate slideshow
|
||||||
* Bugfixes
|
* 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
|
||||||
|
|
||||||
## v0.5.3 ##
|
|
||||||
* Implementation of new events API (incl. sync and notification) for Friendica version >= 20.03
|
* Implementation of new events API (incl. sync and notification) for Friendica version >= 20.03
|
||||||
* Indentation to see replied to newsitem for conversation view
|
* Indentation to see replied to newsitem for conversation view
|
||||||
* News view type config moved from account page to config page
|
* News view type config moved from account page to config page
|
||||||
* Simplification of account page on first start
|
* Simplification of account page on first start
|
||||||
* Bugfixes
|
* Bugfixes
|
||||||
|
|
||||||
|
## v0.5.2
|
||||||
|
|
||||||
## v0.5.2 ##
|
|
||||||
* Redesign of news item
|
* Redesign of news item
|
||||||
* Background sync for Android >8.0
|
* Background sync for Android >8.0
|
||||||
* Bugfixes
|
* Bugfixes
|
||||||
|
|
||||||
|
## v0.5.1
|
||||||
|
|
||||||
## v0.5.1 ##
|
|
||||||
* Videos open in full screen
|
* Videos open in full screen
|
||||||
* Youtube videos open in app
|
* Youtube videos open in app
|
||||||
* Option to minimize #nsfw post
|
* Option to minimize #nsfw post
|
||||||
* Rotate image in messageSend component
|
* Rotate image in messageSend component
|
||||||
|
|
||||||
## v0.5 ##
|
## 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
|
* 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
|
* Android Notifications for News, DMs, Replies
|
||||||
* Global app config separated from account config
|
* Global app config separated from account config
|
||||||
|
|
||||||
|
## v0.4
|
||||||
|
|
||||||
## v0.4 ##
|
|
||||||
* Background sync for friends timeline (interval on config page must be > 0) for Android > 5
|
* Background sync for friends timeline (interval on config page must be > 0) for Android > 5
|
||||||
* Replies timeline
|
* Replies timeline
|
||||||
* Bugfix: App asks for storage permission on first start
|
* Bugfix: App asks for storage permission on first start
|
||||||
|
|
||||||
|
## v0.3.4
|
||||||
|
|
||||||
## v0.3.4 ##
|
|
||||||
* Direct message creation from profile page works again
|
* Direct message creation from profile page works again
|
||||||
* Profile image upload works again
|
* Profile image upload works again
|
||||||
* Viewing private album pictures of contacts works again
|
* Viewing private album pictures of contacts works again
|
||||||
* On first start servername from https://dir.friendica.social/servers/surprise selected
|
* On first start servername from https://dir.friendica.social/servers/surprise selected
|
||||||
* Register button opens webview of registration page on server
|
* Register button opens webview of registration page on server
|
||||||
|
|
||||||
|
## v0.3.3
|
||||||
|
|
||||||
## v0.3.3 ##
|
|
||||||
* Update for OpenSSL and At
|
* Update for OpenSSL and At
|
||||||
* Experimental support for Peertube (links are expanded to video widget)
|
* Experimental support for Peertube (links are expanded to video widget)
|
||||||
* Some Unicode emojis
|
* Some Unicode emojis
|
||||||
* Redesign of contact details (click on contact opens in new stack and shows last news)
|
* Redesign of contact details (click on contact opens in new stack and shows last news)
|
||||||
|
|
||||||
|
## v0.3.2
|
||||||
|
|
||||||
## v0.3.2 ##
|
|
||||||
* For news containing url ending with mp3, mp4, avi, webm, ogg: media can be played in app
|
* 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
|
* Pictures can be renamed or moved to another album
|
||||||
* Bugfix: random crashes for conversations
|
* Bugfix: random crashes for conversations
|
||||||
* Bugfix: attach image to message works again
|
* Bugfix: attach image to message works again
|
||||||
* Bugfix: check for nickname on Server has been removed due to API change
|
* Bugfix: check for nickname on Server has been removed due to API change
|
||||||
|
|
||||||
|
## v0.3.1
|
||||||
|
|
||||||
## v0.3.1 ##
|
|
||||||
* By popular demand: Conversations open in a new stack, like in Twidere
|
* By popular demand: Conversations open in a new stack, like in Twidere
|
||||||
* Conversations open after (long) press on news, 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)
|
* 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)
|
* New messages are html, line breaks work (solves issue #7)
|
||||||
|
|
||||||
|
## v0.3
|
||||||
|
|
||||||
## v0.3 ##
|
|
||||||
* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
|
* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
|
||||||
* Refactoring of news part
|
* Refactoring of news part
|
||||||
* Search button for news
|
* Search button for news
|
||||||
|
@ -75,69 +82,76 @@
|
||||||
* Timeline for selected group
|
* Timeline for selected group
|
||||||
* Small redesign of SendMessage page
|
* Small redesign of SendMessage page
|
||||||
|
|
||||||
|
## v0.2.2
|
||||||
|
|
||||||
## v0.2.2 ##
|
|
||||||
* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
|
* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
|
||||||
* Link to list of public server on Config Tab
|
* Link to list of public server on Config Tab
|
||||||
* Small redesign of SendMessage page
|
* Small redesign of SendMessage page
|
||||||
* Intents for texts/urls (Send text or url from everywhere to create message)
|
* Intents for texts/urls (Send text or url from everywhere to create message)
|
||||||
|
|
||||||
|
## v0.2.1
|
||||||
|
|
||||||
## v0.2.1 ##
|
|
||||||
* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
|
* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
|
||||||
* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
|
* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
|
||||||
* Long posts are automatically truncated
|
* Long posts are automatically truncated
|
||||||
* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
|
* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
|
||||||
|
|
||||||
|
## v0.2
|
||||||
|
|
||||||
|
# News
|
||||||
|
|
||||||
## v0.2 ##
|
|
||||||
# News #
|
|
||||||
* Profile image download completely reworked, resulting in speed improvement
|
* Profile image download completely reworked, resulting in speed improvement
|
||||||
|
|
||||||
# Contacts #
|
# Contacts
|
||||||
|
|
||||||
* New profile tab, data of public and private profiles shown
|
* New profile tab, data of public and private profiles shown
|
||||||
* Change profile picture
|
* 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 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)
|
* 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
|
* News button for forum accounts shows news published via that forum
|
||||||
|
|
||||||
# Images #
|
# Images
|
||||||
|
|
||||||
* Complete rework of image download, fixes bug with private images
|
* Complete rework of image download, fixes bug with private images
|
||||||
* Download all or only new images
|
* Download all or only new images
|
||||||
|
|
||||||
# Config #
|
# Config
|
||||||
|
|
||||||
* Check if nickname exist on server
|
* Check if nickname exist on server
|
||||||
* Check if password is correct
|
* Check if password is correct
|
||||||
* Account deletion now also removes news, image data and events from local db
|
* Account deletion now also removes news, image data and events from local db
|
||||||
|
|
||||||
# Translations #
|
# Translations
|
||||||
|
|
||||||
* Italian thanks to Davide de Prisco
|
* Italian thanks to Davide de Prisco
|
||||||
|
|
||||||
|
|
||||||
## v0.1.2##
|
## v0.1.2##
|
||||||
|
|
||||||
* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
|
* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
|
||||||
|
|
||||||
|
|
||||||
## v0.1.1##
|
## v0.1.1##
|
||||||
|
|
||||||
* FIX: Spanish translation
|
* FIX: Spanish translation
|
||||||
* FIX: Empty Newsview after deletion of first newsitem
|
* FIX: Empty Newsview after deletion of first newsitem
|
||||||
|
|
||||||
|
|
||||||
## v0.1##
|
## v0.1##
|
||||||
|
|
||||||
# News #
|
# News
|
||||||
|
|
||||||
* Native Android image selector for new message
|
* Native Android image selector for new message
|
||||||
* Click on contacts shows contact details on news page
|
* Click on contacts shows contact details on news page
|
||||||
* Fix problem with news list after deletion of item
|
* Fix problem with news list after deletion of item
|
||||||
|
|
||||||
# Contacts #
|
# Contacts
|
||||||
|
|
||||||
* Clean contacts with no news
|
* Clean contacts with no news
|
||||||
|
|
||||||
# Images #
|
# Images
|
||||||
|
|
||||||
* Upload pictures with description to album (permissions cannot be set due to API problems)
|
* 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)
|
* Delete pictures or albums from client and server (long press on picture in overview)
|
||||||
* Fix problem when enlarging photo
|
* Fix problem when enlarging photo
|
||||||
|
|
||||||
# Translations #
|
# Translations
|
||||||
|
|
||||||
* German, Spanish
|
* German, Spanish
|
10
README.md
10
README.md
|
@ -23,7 +23,7 @@ Currently supported:
|
||||||
* Android notifications or Dbus notification (Linux) for new items in friends timeline, replies and DMs
|
* Android notifications or Dbus notification (Linux) for new items in friends timeline, replies and DMs
|
||||||
* Search for news
|
* Search for news
|
||||||
* Click on hashtag in newsitem starts search for news with that word
|
* Click on hashtag in newsitem starts search for news with that word
|
||||||
* Click on image shows image fullscreen
|
* Only first photo attachment in post is shown, click for more images and fullscreen image
|
||||||
* Click on video or youtube video shows video fullscreen
|
* Click on video or youtube 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
|
* 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
|
* Open links in external browser
|
||||||
|
@ -36,7 +36,6 @@ Currently supported:
|
||||||
* Update fetches new posts (up to last 50) since last in local DB
|
* Update fetches new posts (up to last 50) since last in local DB
|
||||||
* More shows older posts from 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
|
* Create new Message with images or direct messages, Contact/Group access rights (can be stored), smileys
|
||||||
* Hashtags are saved after message is sent and can be used in later messages
|
|
||||||
* Send image from Android gallery
|
* Send image from Android gallery
|
||||||
* Send text or urls from other apps to Friendiqa
|
* Send text or urls from other apps to Friendiqa
|
||||||
* Native Android image dialog
|
* Native Android image dialog
|
||||||
|
@ -52,6 +51,7 @@ Currently supported:
|
||||||
* Tabs for own profiles, friends, other contacts and groups
|
* Tabs for own profiles, friends, other contacts and groups
|
||||||
* Show profile(s) of user and change profile picture
|
* Show profile(s) of user and change profile picture
|
||||||
* List of all known contacts with locally downloaded pictures
|
* List of all known contacts with locally downloaded pictures
|
||||||
|
* Show follow requests; approve, deny, ignore requests
|
||||||
* Additional information, last messages and other functionality shown in news tab
|
* 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 pictures of contact (screenscraping of contact's website, works only with certain theme)
|
||||||
* Show public and private events of contact
|
* Show public and private events of contact
|
||||||
|
@ -96,7 +96,7 @@ Currently supported:
|
||||||
* Multiple accounts
|
* Multiple accounts
|
||||||
* View mode for news (tree or timeline)
|
* View mode for news (tree or timeline)
|
||||||
* Maximum news (deleted after use of Quit button)
|
* Maximum news (deleted after use of Quit button)
|
||||||
* Sync home timeline, replies, DM, Notify yes/no
|
* Sync home timeline, replies, DM, Events, friend requests; Notify yes/no
|
||||||
* Hide #nsfw
|
* Hide #nsfw
|
||||||
|
|
||||||
ToDo
|
ToDo
|
||||||
|
@ -111,8 +111,8 @@ ToDo
|
||||||
|
|
||||||
|
|
||||||
# Translations #
|
# Translations #
|
||||||
* German, Spanish, Italian
|
* German, Spanish, Italian, Hungarian
|
||||||
* To contribute translations: Have a look at linux-sources/translations/friendiqa-de.ts and open it with an editor. It's an xml file. Change values and send me the file/do pull request.
|
* To contribute translations: Have a look at linux-sources/translations/friendiqa-de.ts and open it with an editor. It's an xml file. Change values and send me the file to thomasschmidt45 at gmx.net / do pull request.
|
||||||
|
|
||||||
# Install #
|
# 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) To include repo in Fdroid: Open config --> package sources --> plus symbol --> paste url
|
* 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) To include repo in Fdroid: Open config --> package sources --> plus symbol --> paste url
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.5.4" android:versionCode="22" android:installLocation="auto">
|
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6" android:versionCode="25" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
|
||||||
|
|
||||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||||
Remove the comment if you do not require these default features. -->
|
Remove the comment if you do not require these default features. -->
|
||||||
<!-- %%INSERT_FEATURES -->
|
<!-- %%INSERT_FEATURES android:requestLegacyExternalStorage="true" -->
|
||||||
|
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||||
|
|
||||||
|
@ -16,11 +16,13 @@
|
||||||
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
||||||
android:label="Friendiqa"
|
android:label="Friendiqa"
|
||||||
android:extractNativeLibs="true"
|
android:extractNativeLibs="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
|
||||||
android:icon="@drawable/friendiqa"
|
android:icon="@drawable/friendiqa"
|
||||||
android:theme="@android:style/Theme.Holo.Light"
|
android:theme="@android:style/Theme.Holo.Light"
|
||||||
android:logo="@drawable/friendiqa">
|
android:logo="@drawable/friendiqa">
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
|
||||||
|
android:name="androidnative.friendiqa.FriendiqaActivity"
|
||||||
|
android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleTask" android:taskAffinity="">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
|
0
source-android/android/arm/libcrypto_1_1.so
Executable file → Normal file
0
source-android/android/arm/libcrypto_1_1.so
Executable file → Normal file
0
source-android/android/arm/libssl_1_1.so
Executable file → Normal file
0
source-android/android/arm/libssl_1_1.so
Executable file → Normal file
0
source-android/android/arm64/libcrypto_1_1.so
Executable file → Normal file
0
source-android/android/arm64/libcrypto_1_1.so
Executable file → Normal file
0
source-android/android/arm64/libssl_1_1.so
Executable file → Normal file
0
source-android/android/arm64/libssl_1_1.so
Executable file → Normal file
|
@ -1,7 +1,4 @@
|
||||||
# androidBuildToolsVersion=25.0.3
|
|
||||||
# androidCompileSdkVersion=26
|
|
||||||
buildDir=.build
|
buildDir=.build
|
||||||
# qt5AndroidDir=/home/pankraz/Qt/5.11.1/android_armv7/src/android/java
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
android.enforceUniquePackageName=false
|
android.enforceUniquePackageName=false
|
||||||
|
|
0
source-android/android/gradlew
vendored
Executable file → Normal file
0
source-android/android/gradlew
vendored
Executable file → Normal file
|
@ -8,8 +8,6 @@ import java.util.HashMap;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.Manifest.permission;
|
import android.Manifest.permission;
|
||||||
//import android.support.v4.app.ActivityCompat;
|
|
||||||
//import android.support.v4.content.ContextCompat;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
@ -43,6 +41,7 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
|
||||||
//} else {
|
//} else {
|
||||||
|
|
||||||
System.loadLibrary("friendiqa_arm64-v8a");
|
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))) {
|
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();
|
SystemDispatcher.onActivityResume();
|
||||||
} else {
|
} else {
|
||||||
|
@ -94,6 +93,7 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
|
||||||
|
|
||||||
protected void onNewIntent(Intent data) {
|
protected void onNewIntent(Intent data) {
|
||||||
System.loadLibrary("friendiqa_arm64-v8a");
|
System.loadLibrary("friendiqa_arm64-v8a");
|
||||||
|
//System.loadLibrary("friendiqa_armeabi-v7a");
|
||||||
super.onNewIntent(data);
|
super.onNewIntent(data);
|
||||||
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
||||||
String type = data.getType();
|
String type = data.getType();
|
||||||
|
|
|
@ -112,7 +112,6 @@ public class ImagePicker {
|
||||||
return;
|
return;
|
||||||
int requestCode = (Integer) message.get("requestCode");
|
int requestCode = (Integer) message.get("requestCode");
|
||||||
Intent data = (Intent) message.get("data");
|
Intent data = (Intent) message.get("data");
|
||||||
|
|
||||||
if (requestCode == PICK_IMAGE_ACTION) {
|
if (requestCode == PICK_IMAGE_ACTION) {
|
||||||
importImage(data);
|
importImage(data);
|
||||||
} else if (requestCode == TAKE_PHOTO_ACTION) {
|
} else if (requestCode == TAKE_PHOTO_ACTION) {
|
||||||
|
@ -127,8 +126,8 @@ public class ImagePicker {
|
||||||
static private void importImage(Intent data) {
|
static private void importImage(Intent data) {
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
|
|
||||||
Log.d(TAG,"importImage: uri:" + uri);
|
//Log.d(TAG,"importImage: uri:" + uri);
|
||||||
Log.d(TAG,"importImage: type: " + data.getType());
|
//Log.d(TAG,"importImage: type: " + data.getType());
|
||||||
|
|
||||||
if (data.getClipData() != null) {
|
if (data.getClipData() != null) {
|
||||||
importImageFromClipData(data);
|
importImageFromClipData(data);
|
||||||
|
|
|
@ -140,6 +140,7 @@ public class SystemDispatcher {
|
||||||
waitingIntent=null;
|
waitingIntent=null;
|
||||||
isIntentPending=false;
|
isIntentPending=false;
|
||||||
} else { //onIntent start
|
} else { //onIntent start
|
||||||
|
Log.e(TAG,"notInitialized: onIntentStart "+data);
|
||||||
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
|
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
|
||||||
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
|
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
|
||||||
waitingIntent = message;
|
waitingIntent = message;
|
||||||
|
|
|
@ -67,13 +67,13 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QQuickView view;
|
QQmlApplicationEngine view;
|
||||||
//qDebug()<<"FriendiqaMain started";
|
//qDebug()<<"FriendiqaMain started";
|
||||||
QTranslator qtTranslator;
|
QTranslator qtTranslator;
|
||||||
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
|
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
|
||||||
app.installTranslator(&qtTranslator);
|
app.installTranslator(&qtTranslator);
|
||||||
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
||||||
view.engine()->addImageProvider("remoteauthimage",imageProvider);
|
view.addImageProvider("remoteauthimage",imageProvider);
|
||||||
view.rootContext()->setContextProperty("remoteauth", imageProvider);
|
view.rootContext()->setContextProperty("remoteauth", imageProvider);
|
||||||
XHR* xhr = XHR::instance();
|
XHR* xhr = XHR::instance();
|
||||||
view.rootContext()->setContextProperty("xhr", xhr);
|
view.rootContext()->setContextProperty("xhr", xhr);
|
||||||
|
@ -83,8 +83,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) {
|
||||||
view.rootContext()->setContextProperty("alarm", alarm);
|
view.rootContext()->setContextProperty("alarm", alarm);
|
||||||
UPDATENEWS* updatenews = UPDATENEWS::instance();
|
UPDATENEWS* updatenews = UPDATENEWS::instance();
|
||||||
view.rootContext()->setContextProperty("updatenews", updatenews);
|
view.rootContext()->setContextProperty("updatenews", updatenews);
|
||||||
view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
|
view.load(QUrl("qrc:/qml/friendiqa.qml"));
|
||||||
view.show();
|
|
||||||
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
|
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|
|
@ -52,7 +52,8 @@ OTHER_FILES += qml/friendiqa.qml \
|
||||||
|
|
||||||
TRANSLATIONS += translations/friendiqa-de.ts \
|
TRANSLATIONS += translations/friendiqa-de.ts \
|
||||||
translations/friendiqa-es.ts \
|
translations/friendiqa-es.ts \
|
||||||
translations/friendiqa-it.ts
|
translations/friendiqa-it.ts \
|
||||||
|
translations/friendiqa-hu.ts
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
common/uploadableimage.h \
|
common/uploadableimage.h \
|
||||||
|
@ -85,5 +86,3 @@ DISTFILES += \
|
||||||
|
|
||||||
ANDROID_EXTRA_LIBS = $$PWD/android/arm/libcrypto_1_1.so $$PWD/android/arm/libssl_1_1.so $$PWD/android/arm64/libcrypto_1_1.so $$PWD/android/arm64/libssl_1_1.so
|
ANDROID_EXTRA_LIBS = $$PWD/android/arm/libcrypto_1_1.so $$PWD/android/arm/libssl_1_1.so $$PWD/android/arm64/libcrypto_1_1.so $$PWD/android/arm64/libssl_1_1.so
|
||||||
|
|
||||||
ANDROID_ABIS = arm64-v8a
|
|
||||||
android: include(/home/pankraz/git/android_openssl/openssl.pri)
|
|
||||||
|
|
|
@ -36,47 +36,52 @@ import QtQuick.Controls 2.4
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
import "qrc:/js/news.js" as Newsjs
|
import "qrc:/js/news.js" as Newsjs
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
|
||||||
StackView{
|
ApplicationWindow{
|
||||||
id:root
|
id:root
|
||||||
|
title: "Friendiqa"
|
||||||
|
property var globaloptions: Service.readGO(db)
|
||||||
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
|
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
|
||||||
width: osSettings.appWidth
|
visible: true
|
||||||
height:osSettings.appHeight
|
|
||||||
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
|
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
|
||||||
property var login: Service.readActiveConfig(db)
|
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 var contactlist: []
|
||||||
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
|
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
|
||||||
signal messageSignal(var friend)
|
property bool wideScreen : width>height
|
||||||
signal fotoSignal(var username, var friend)
|
signal fotoSignal(var username, var friend)
|
||||||
signal directmessageSignal(var friend)
|
signal directmessageSignal(var friend)
|
||||||
signal newsSignal(var news)
|
signal newsSignal(var news)
|
||||||
signal newstypeSignal(var type)
|
signal newstypeSignal(var type)
|
||||||
signal friendsSignal(var username)
|
signal friendsSignal(var username)
|
||||||
signal contactdetailsSignal(var contact)
|
signal contactdetailsSignal(var contact)
|
||||||
|
signal searchSignal (var searchterm)
|
||||||
signal eventSignal(var contact)
|
signal eventSignal(var contact)
|
||||||
signal uploadSignal(var urls)
|
signal uploadSignal(var urls)
|
||||||
signal sendtextSignal(var intenttext)
|
signal sendtextSignal(var intenttext)
|
||||||
signal changeimage(var method, var type, var id)
|
signal changeimage(var method, var type, var id)
|
||||||
signal updateSyncinterval(int interval)
|
signal updateSyncinterval(int interval)
|
||||||
|
signal replySignal(var newsobject)
|
||||||
property var news:[]
|
property var news:[]
|
||||||
property var newContacts:[]
|
property var newContacts:[]
|
||||||
|
property var contactposts:[]
|
||||||
//property string contactLoadType: ""
|
//property string contactLoadType: ""
|
||||||
property bool imagePicking: false
|
property bool imagePicking: false
|
||||||
|
|
||||||
onLoginChanged:{
|
function onLoginChanged(login){
|
||||||
if(login==""){root.push("qrc:/qml/configqml/AccountPage.qml")}
|
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
|
||||||
else{root.push(rootStackItem)
|
else{//rootstackView.push(rootstack)
|
||||||
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
|
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
|
||||||
Newsjs.getCurrentContacts(login,db,function(contacts){
|
Newsjs.getCurrentContacts(login,db,function(contacts){
|
||||||
contactlist=contacts})}
|
contactlist=contacts})}
|
||||||
}
|
}
|
||||||
onNewContactsChanged:{
|
function onNewContactsChanged(newContacts){
|
||||||
if(newContacts.length>0){// download contact images and update db
|
if(newContacts.length>0){// download contact images and update db
|
||||||
var contacturls=[];
|
var contacturls=[];
|
||||||
var contactnames=[];
|
var contactnames=[];
|
||||||
for (var link in newContacts){
|
for (var link in newContacts){//print("new contact " +newContacts[link].screen_name);
|
||||||
contacturls.push(newContacts[link].profile_image_url);
|
contacturls.push(newContacts[link].profile_image_url);
|
||||||
contactnames.push(newContacts[link].screen_name);
|
contactnames.push(newContacts[link].screen_name);
|
||||||
Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link])
|
Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link])
|
||||||
|
@ -91,9 +96,32 @@ StackView{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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){ //print(JSON.stringify(contact));
|
||||||
|
rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target:xhr
|
target:xhr
|
||||||
onDownloaded:{
|
function onDownloaded(type,url,filename,i){
|
||||||
if(type=="contactlist"){
|
if(type=="contactlist"){
|
||||||
var database=LocalStorage.openDatabaseSync(root.db[0],root.db[1],root.db[2],root.db[3]);
|
var database=LocalStorage.openDatabaseSync(root.db[0],root.db[1],root.db[2],root.db[3]);
|
||||||
var result;
|
var result;
|
||||||
|
@ -104,10 +132,12 @@ StackView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
|
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
|
||||||
|
|
||||||
Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
|
//Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
|
||||||
if (event.key === osSettings.backKey) {
|
onClosing: {
|
||||||
|
//if (event.key === osSettings.backKey) {
|
||||||
if (rootstack.currentIndex==0){
|
if (rootstack.currentIndex==0){
|
||||||
newstab.active=true;
|
newstab.active=true;
|
||||||
if (newstab.newstabstatus!=globaloptions.newsViewType){
|
if (newstab.newstabstatus!=globaloptions.newsViewType){
|
||||||
|
@ -119,278 +149,147 @@ StackView{
|
||||||
Newsjs.chatsfromdb(db,login.username,function(dbnews){
|
Newsjs.chatsfromdb(db,login.username,function(dbnews){
|
||||||
newsSignal(dbnews)
|
newsSignal(dbnews)
|
||||||
})}
|
})}
|
||||||
|
close.accepted=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (newstab.conversation.length>0){newstab.conversation=[]}
|
else if (newstab.conversation.length>0){
|
||||||
else if (root.depth>1){root.pop()}
|
newstab.conversation=[];
|
||||||
else{Service.cleanNews(root.db,function(){
|
close.accepted=false
|
||||||
|
}
|
||||||
|
else if (root.depth>1){
|
||||||
|
root.pop();
|
||||||
|
close.accepted=false
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Service.cleanNews(root.db,function(){
|
||||||
|
Service.cleanHashtags(root.db,function(){
|
||||||
Service.cleanContacts(root.login,root.db,function(){
|
Service.cleanContacts(root.login,root.db,function(){
|
||||||
Qt.quit()})
|
Qt.quit()})
|
||||||
})}
|
})})
|
||||||
|
close.accepted=true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
|
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
|
||||||
else {rootstack.currentIndex=0}
|
else {rootstack.currentIndex=0}
|
||||||
event.accepted = true
|
//event.accepted = true
|
||||||
}}
|
//}
|
||||||
|
|
||||||
Drawer{
|
|
||||||
id: leftDrawer
|
|
||||||
width: 0.66* root.width
|
|
||||||
height: root.height
|
|
||||||
edge: Qt.LeftEdge
|
|
||||||
position: 1.0
|
|
||||||
Column{
|
|
||||||
x:mm
|
|
||||||
width:parent.width-mm
|
|
||||||
Label{
|
|
||||||
text: login.hasOwnProperty("username")?login.username:""
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
height: 6*mm
|
|
||||||
}
|
}
|
||||||
// Label{
|
|
||||||
// text:login.hasOwnProperty("server")?"@"+login.server:""
|
|
||||||
// font.pixelSize: 5*mm
|
|
||||||
// width: parent.width
|
|
||||||
// }
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf021 " + qsTr("Refresh")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
footer:ToolBar{
|
||||||
MouseArea{
|
//position: ToolBar.Footer
|
||||||
|
background: Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked:{
|
color: "#EEEEEE"//"#F8F8F8"
|
||||||
leftDrawer.close();
|
|
||||||
// newstypeSignal("refresh")
|
|
||||||
updatenews.setDatabase();
|
|
||||||
updatenews.login();
|
|
||||||
updatenews.startsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//RowLayout{
|
||||||
|
// anchors.fill: parent
|
||||||
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf1da " + qsTr("Timeline")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("timeline")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf086 " + qsTr("Conversations")
|
|
||||||
width: parent.width
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("conversation")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf005 " + qsTr("Favorites")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("favorites")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Label{
|
|
||||||
text: "\uf0ec " + qsTr("Replies")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("replies")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf0ac " + qsTr("Public Timeline")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("publictimeline")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf0c0 " + qsTr("Group news")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("groupnews")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf002 " + qsTr("Search")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("search")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf085 "+ qsTr("Settings")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {root.push("qrc:qml/configqml/ConfigPage.qml");
|
|
||||||
leftDrawer.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Label{
|
|
||||||
text: "\uf2bb " + qsTr("Accounts")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {root.push("qrc:qml/configqml/AccountPage.qml");
|
|
||||||
leftDrawer.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf08b " +qsTr("Quit")
|
|
||||||
font.pixelSize: 4*mm
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
Service.cleanNews(root.db,function(){
|
|
||||||
Service.cleanContacts(root.login,root.db,function(){
|
|
||||||
Qt.quit()})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item{
|
|
||||||
id:rootStackItem
|
|
||||||
width:parent.width
|
|
||||||
height: parent.height
|
|
||||||
//anchors.fill:parent
|
|
||||||
states: State {
|
|
||||||
name: "fullscreen";
|
|
||||||
PropertyChanges { target: bar; height:0 }
|
|
||||||
PropertyChanges { target: rootstack; height:parent.height }
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: Transition {
|
|
||||||
PropertyAnimation { properties: "height";
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TabBar {
|
TabBar {
|
||||||
id: bar
|
id: bar
|
||||||
width: parent.width
|
width:parent.width
|
||||||
height: 7*mm
|
// Layout.fillWidth: true
|
||||||
position:TabBar.Footer
|
//width: wideScreen?contentWidth:parent.width-10*mm
|
||||||
anchors.top: rootstack.bottom
|
//x: 7*mm
|
||||||
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
|
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf03a"
|
text: "\uf03a"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
height: 6*mm
|
background:Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf0c0"
|
text: "\uf0c0"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
height: 6*mm
|
background:Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf03e"
|
text: "\uf03e"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
height: 6*mm
|
background:Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf073"
|
text: "\uf073"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
height: 6*mm
|
background:Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
StackLayout{
|
|
||||||
|
|
||||||
|
// states: State {
|
||||||
|
// name: "fullscreen";
|
||||||
|
// PropertyChanges { target: bar; height:0 }
|
||||||
|
// PropertyChanges { target: rootstack; height:parent.height }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// transitions: Transition {
|
||||||
|
// PropertyAnimation { properties: "height";
|
||||||
|
// easing.type: Easing.InOutQuad
|
||||||
|
// duration: 1000
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
StackView{id:rootstackView
|
||||||
|
width:root.width
|
||||||
|
height: root.height
|
||||||
|
initialItem: StackLayout{
|
||||||
id:rootstack
|
id:rootstack
|
||||||
width:parent.width
|
width:rootstackView.width
|
||||||
height: parent.height-7*mm
|
height: rootstackView.height//-7*mm
|
||||||
|
//y:wideScreen?7*mm:0
|
||||||
currentIndex:bar.currentIndex
|
currentIndex:bar.currentIndex
|
||||||
|
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: newstab
|
id: newstab
|
||||||
Layout.fillWidth:true
|
Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
property string newstabstatus
|
property string newstabstatus
|
||||||
property var conversation:[]
|
property var conversation:[]
|
||||||
property var contactposts:[]
|
|
||||||
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
|
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: friendstab
|
id: friendstab
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
|
source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: fotostab
|
id: fotostab
|
||||||
property string phototabstatus:"Images"
|
property string phototabstatus:"Images"
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
|
source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: calendartab
|
id: calendartab
|
||||||
property string calendartabstatus:"Events"
|
property string calendartabstatus:"Events"
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
|
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
forceActiveFocus();
|
onLoginChanged(login);
|
||||||
//print(xhr.networktype());
|
globaloptions=Service.readGO(db);
|
||||||
|
//forceActiveFocus();
|
||||||
if(osSettings.osType=="Android"){
|
if(osSettings.osType=="Android"){
|
||||||
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
|
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
|
||||||
var IntentReceiverQml = component.createObject(root);
|
var IntentReceiverQml = component.createObject(root);
|
||||||
|
@ -400,5 +299,5 @@ StackView{
|
||||||
var LinuxSyncQml = component.createObject(root);
|
var LinuxSyncQml = component.createObject(root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
47
source-linux/CMakeLists.txt
Normal file
47
source-linux/CMakeLists.txt
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
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)
|
||||||
|
|
||||||
|
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/alarmlinux.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)
|
|
@ -19,7 +19,6 @@
|
||||||
<file>qml/contactqml/FriendsTab.qml</file>
|
<file>qml/contactqml/FriendsTab.qml</file>
|
||||||
<file>qml/contactqml/GroupComponent.qml</file>
|
<file>qml/contactqml/GroupComponent.qml</file>
|
||||||
<file>qml/contactqml/ProfileComponent.qml</file>
|
<file>qml/contactqml/ProfileComponent.qml</file>
|
||||||
<file>qml/contactqml/ContactDetailsComponent.qml</file>
|
|
||||||
<file>qml/contactqml/Contactlist.qml</file>
|
<file>qml/contactqml/Contactlist.qml</file>
|
||||||
<file>qml/photoqml/PhotoComponent.qml</file>
|
<file>qml/photoqml/PhotoComponent.qml</file>
|
||||||
<file>qml/photoqml/PhotogroupComponent.qml</file>
|
<file>qml/photoqml/PhotogroupComponent.qml</file>
|
||||||
|
@ -237,6 +236,16 @@
|
||||||
<file>common/xhr.cpp</file>
|
<file>common/xhr.cpp</file>
|
||||||
<file>common/xhr.h</file>
|
<file>common/xhr.h</file>
|
||||||
<file>qml/newsqml/MoreComments.qml</file>
|
<file>qml/newsqml/MoreComments.qml</file>
|
||||||
<file>common/filesystemandroid.cpp</file>
|
<file>qml/newsqml/NewsPhotolist.qml</file>
|
||||||
|
<file>qml/genericqml/DrawerAccountComponent.qml</file>
|
||||||
|
<file>qml/configqml/LeftDrawerScrollview.qml</file>
|
||||||
|
<file>qml/genericqml/LeftDrawerLinux.qml</file>
|
||||||
|
<file>qml/genericqml/LeftDrawerAndroid.qml</file>
|
||||||
|
<file>qml/genericqml/DrawerAccountComponentContacts.qml</file>
|
||||||
|
<file>qml/contactqml/ProfileTab.qml</file>
|
||||||
|
<file>qml/contactqml/FriendsListTab.qml</file>
|
||||||
|
<file>qml/contactqml/ContactsListTab.qml</file>
|
||||||
|
<file>qml/contactqml/GroupsListTab.qml</file>
|
||||||
|
<file>qml/calendarqml/EventListItem.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -40,7 +40,6 @@ class ALARM : public QObject
|
||||||
//Q_PROPERTY(int alarmtime READ alarmtime WRITE setAlarm NOTIFY alarmChanged)
|
//Q_PROPERTY(int alarmtime READ alarmtime WRITE setAlarm NOTIFY alarmChanged)
|
||||||
public:
|
public:
|
||||||
static ALARM *instance();
|
static ALARM *instance();
|
||||||
|
|
||||||
explicit ALARM(QObject *parent = 0);
|
explicit ALARM(QObject *parent = 0);
|
||||||
|
|
||||||
//int alarmtime() const;
|
//int alarmtime() const;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QtQml/QQmlEngine>
|
#include <QtQml/QQmlEngine>
|
||||||
#include <QtWebEngine>
|
//#include <QtWebEngine>
|
||||||
//#include <QAndroidService>
|
//#include <QAndroidService>
|
||||||
//#include <QtAndroid>
|
//#include <QtAndroid>
|
||||||
#include <QtQuick>
|
#include <QtQuick>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
#include "updatenews.h"
|
#include "updatenews.h"
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "remoteauthasyncimageprovider.h"
|
#include "remoteauthasyncimageprovider.h"
|
||||||
//#include "alarm.h"
|
#include "alarm.h"
|
||||||
//#include "AndroidNative/systemdispatcher.h"
|
//#include "AndroidNative/systemdispatcher.h"
|
||||||
//#include "AndroidNative/environment.h"
|
//#include "AndroidNative/environment.h"
|
||||||
//#include "AndroidNative/debug.h"
|
//#include "AndroidNative/debug.h"
|
||||||
|
@ -73,15 +73,16 @@ int main(int argc, char *argv[]) {
|
||||||
//return app.exec();
|
//return app.exec();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
QtWebEngine::initialize();
|
//QtWebEngine::initialize();
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QQuickView view;
|
QQmlApplicationEngine view;
|
||||||
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
//QQuickView view;
|
||||||
|
//view.setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
QTranslator qtTranslator;
|
QTranslator qtTranslator;
|
||||||
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
|
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
|
||||||
app.installTranslator(&qtTranslator);
|
app.installTranslator(&qtTranslator);
|
||||||
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
||||||
view.engine()->addImageProvider("remoteauthimage",imageProvider);
|
view.addImageProvider("remoteauthimage",imageProvider);
|
||||||
view.rootContext()->setContextProperty("remoteauth", imageProvider);
|
view.rootContext()->setContextProperty("remoteauth", imageProvider);
|
||||||
XHR* xhr = XHR::instance();
|
XHR* xhr = XHR::instance();
|
||||||
view.rootContext()->setContextProperty("xhr", xhr);
|
view.rootContext()->setContextProperty("xhr", xhr);
|
||||||
|
@ -92,8 +93,8 @@ int main(int argc, char *argv[]) {
|
||||||
UPDATENEWS* updatenews = UPDATENEWS::instance();
|
UPDATENEWS* updatenews = UPDATENEWS::instance();
|
||||||
view.rootContext()->setContextProperty("updatenews", updatenews);
|
view.rootContext()->setContextProperty("updatenews", updatenews);
|
||||||
|
|
||||||
view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
|
view.load(QUrl("qrc:/qml/friendiqa.qml"));
|
||||||
view.show();
|
//view.show();
|
||||||
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
|
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,8 +104,8 @@ void UPDATENEWS::login()
|
||||||
|
|
||||||
|
|
||||||
QSqlQuery syncquery("SELECT * FROM globaloptions",m_db);
|
QSqlQuery syncquery("SELECT * FROM globaloptions",m_db);
|
||||||
// QSqlQuery delquery("DELETE FROM globaloptions WHERE k='sync_interval'",m_db);
|
// QSqlQuery delquery("DELETE FROM globaloptions WHERE k='sync_interval'",m_db);
|
||||||
// delquery.exec();
|
// delquery.exec();
|
||||||
m_updateInterval=0;
|
m_updateInterval=0;
|
||||||
syncindex=0;
|
syncindex=0;
|
||||||
synclist.clear();
|
synclist.clear();
|
||||||
|
@ -136,8 +136,8 @@ void UPDATENEWS::login()
|
||||||
|
|
||||||
void UPDATENEWS::startsync()
|
void UPDATENEWS::startsync()
|
||||||
{ qDebug()<<"Friendiqa start syncing "<<syncindex <<" of "<<synclist.length();
|
{ qDebug()<<"Friendiqa start syncing "<<syncindex <<" of "<<synclist.length();
|
||||||
QObject::connect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(store(QByteArray,QString)));
|
//QObject::connect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(store(QByteArray,QString)));
|
||||||
QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
|
//QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
|
||||||
if (syncindex<synclist.length()){
|
if (syncindex<synclist.length()){
|
||||||
if (synclist[syncindex]=="sync_Timeline"){
|
if (synclist[syncindex]=="sync_Timeline"){
|
||||||
timeline();
|
timeline();
|
||||||
|
@ -147,7 +147,9 @@ void UPDATENEWS::startsync()
|
||||||
directmessages();
|
directmessages();
|
||||||
} else if (synclist[syncindex]=="sync_Notifications") {
|
} else if (synclist[syncindex]=="sync_Notifications") {
|
||||||
notifications();
|
notifications();
|
||||||
} else if (synclist[syncindex]=="sync_Events") {
|
} else if (synclist[syncindex]=="sync_FriendRequests") {
|
||||||
|
friendrequests();
|
||||||
|
}else if (synclist[syncindex]=="sync_Events") {
|
||||||
events();
|
events();
|
||||||
}
|
}
|
||||||
} else if (syncindex==synclist.length()) {
|
} else if (syncindex==synclist.length()) {
|
||||||
|
@ -237,10 +239,8 @@ void UPDATENEWS::notifications()
|
||||||
QObject::connect(&xhr, SIGNAL(downloaded(QString, QString, QString, int)), this, SLOT(updateImageLocation(QString,QString, QString, int)));
|
QObject::connect(&xhr, SIGNAL(downloaded(QString, QString, QString, int)), this, SLOT(updateImageLocation(QString,QString, QString, int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UPDATENEWS::events()
|
void UPDATENEWS::events()
|
||||||
{
|
{ m_api="/api/friendica/events";
|
||||||
m_api="/api/friendica/events";
|
|
||||||
xhr.clearParams();
|
xhr.clearParams();
|
||||||
xhr.setUrl(m_url);
|
xhr.setUrl(m_url);
|
||||||
xhr.setApi(m_api);
|
xhr.setApi(m_api);
|
||||||
|
@ -258,11 +258,24 @@ void UPDATENEWS::events()
|
||||||
QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
|
QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UPDATENEWS::friendrequests()
|
||||||
|
{ m_api="/api/v1/follow_requests";
|
||||||
|
xhr.clearParams();
|
||||||
|
xhr.setUrl(m_url);
|
||||||
|
xhr.setApi(m_api);
|
||||||
|
xhr.get();
|
||||||
|
QObject::disconnect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(store(QByteArray,QString)));
|
||||||
|
QObject::connect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(storeFriendrequests(QByteArray,QString)));
|
||||||
|
QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
|
||||||
|
QObject::connect(&xhr, SIGNAL(downloaded(QString, QString, QString, int)), this, SLOT(updateImageLocation(QString,QString, QString, int)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
||||||
{ if (apiname!=m_api || xhr.downloadtype()!=""){} else {
|
{ if (apiname!=m_api || xhr.downloadtype()!=""){} else {
|
||||||
QJsonDocument news;
|
QJsonDocument news;
|
||||||
//qDebug()<<apiname << serverreply;
|
//qDebug()<<apiname;
|
||||||
QJsonParseError jsonerror;
|
QJsonParseError jsonerror;
|
||||||
news=QJsonDocument::fromJson(serverreply,&jsonerror);
|
news=QJsonDocument::fromJson(serverreply,&jsonerror);
|
||||||
if (news.isArray()){
|
if (news.isArray()){
|
||||||
|
@ -274,7 +287,9 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
||||||
if (testquery.first()) {continue;}
|
if (testquery.first()) {continue;}
|
||||||
}
|
}
|
||||||
QSqlQuery query(m_db);
|
QSqlQuery query(m_db);
|
||||||
query.prepare("INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) " "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
query.prepare("INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,"
|
||||||
|
"geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) "
|
||||||
|
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||||
query.bindValue(0,username);
|
query.bindValue(0,username);
|
||||||
query.bindValue(1,"0");
|
query.bindValue(1,"0");
|
||||||
query.bindValue(2, newsitem["text"].toString().toUtf8().toBase64());
|
query.bindValue(2, newsitem["text"].toString().toUtf8().toBase64());
|
||||||
|
@ -292,7 +307,9 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
||||||
QString friendicaHtml="<b>" + newsitem["friendica_title"].toString() +"</b><br><br>"+newsitem["friendica_html"].toString();
|
QString friendicaHtml="<b>" + newsitem["friendica_title"].toString() +"</b><br><br>"+newsitem["friendica_html"].toString();
|
||||||
query.bindValue(11, friendicaHtml.toUtf8().toBase64());}
|
query.bindValue(11, friendicaHtml.toUtf8().toBase64());}
|
||||||
else{query.bindValue(11, newsitem["friendica_html"].toString().toUtf8().toBase64());}
|
else{query.bindValue(11, newsitem["friendica_html"].toString().toUtf8().toBase64());}
|
||||||
|
if (newsitem["statusnet_conversation_id"].isDouble()){
|
||||||
query.bindValue(12, newsitem["statusnet_conversation_id"].toInt());
|
query.bindValue(12, newsitem["statusnet_conversation_id"].toInt());
|
||||||
|
}else{query.bindValue(12, newsitem["statusnet_conversation_id"].toString());}
|
||||||
QJsonArray likeArray;QJsonArray dislikeArray;QJsonArray attendyesArray;QJsonArray attendnoArray;QJsonArray attendmaybeArray;
|
QJsonArray likeArray;QJsonArray dislikeArray;QJsonArray attendyesArray;QJsonArray attendnoArray;QJsonArray attendmaybeArray;
|
||||||
if (newsitem.toObject().contains("friendica_activities")){
|
if (newsitem.toObject().contains("friendica_activities")){
|
||||||
for (int a=0; a < newsitem["friendica_activities"]["like"].toArray().count();a++){
|
for (int a=0; a < newsitem["friendica_activities"]["like"].toArray().count();a++){
|
||||||
|
@ -382,7 +399,7 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
||||||
QList<QJsonValue> newcontacts=findNewContacts(news);
|
QList<QJsonValue> newcontacts=findNewContacts(news);
|
||||||
if (newcontacts.size()>0){
|
if (newcontacts.size()>0){
|
||||||
updateContacts(newcontacts);
|
updateContacts(newcontacts);
|
||||||
startImagedownload();
|
startImagedownload("contactlist");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(m_updateInterval!=0){
|
if(m_updateInterval!=0){
|
||||||
|
@ -404,6 +421,7 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
|
||||||
|
|
||||||
|
|
||||||
void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QString filename, int index){
|
void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QString filename, int index){
|
||||||
|
//qDebug()<< "update Imagelocation " << downloadtype << " " << imageurl << " " << filename;
|
||||||
if (downloadtype=="contactlist"){
|
if (downloadtype=="contactlist"){
|
||||||
QSqlQuery testquery("SELECT profile_image FROM contacts WHERE profile_image_url ='"+imageurl+ "' AND username = '" +username+"'",m_db);
|
QSqlQuery testquery("SELECT profile_image FROM contacts WHERE profile_image_url ='"+imageurl+ "' AND username = '" +username+"'",m_db);
|
||||||
testquery.first();
|
testquery.first();
|
||||||
|
@ -413,6 +431,22 @@ void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QStr
|
||||||
newcontactnames.clear();
|
newcontactnames.clear();
|
||||||
newcontactimagelinks.clear();
|
newcontactimagelinks.clear();
|
||||||
if(m_updateInterval!=0){
|
if(m_updateInterval!=0){
|
||||||
|
qDebug()<< "contactdownload finished!";
|
||||||
|
syncindex+=1;
|
||||||
|
startsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (downloadtype=="friendrequests"){
|
||||||
|
QSqlQuery testquery("SELECT avatar_static FROM friendshiprequests WHERE avatar ='"+imageurl+ "' AND username = '" +username+"'",m_db);
|
||||||
|
testquery.first();
|
||||||
|
QSqlQuery query("UPDATE friendshiprequests SET avatar_static='"+ filename +"' WHERE avatar ='"+imageurl+ "' AND username = '" +username+"'",m_db);
|
||||||
|
if(!(query.exec())) {qDebug()<< "update friendrequests Imagelocation " << query.lastError();}
|
||||||
|
if (index==(newcontactnames.length()-1)){
|
||||||
|
newcontactnames.clear();
|
||||||
|
newcontactimagelinks.clear();
|
||||||
|
if(m_updateInterval!=0){
|
||||||
|
qDebug()<< "friendrequests finished!";
|
||||||
syncindex+=1;
|
syncindex+=1;
|
||||||
startsync();
|
startsync();
|
||||||
}
|
}
|
||||||
|
@ -421,6 +455,7 @@ void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QStr
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject UPDATENEWS::findNotificationContact(QString contacturl){
|
QJsonObject UPDATENEWS::findNotificationContact(QString contacturl){
|
||||||
|
//qDebug()<< "findNotificationContact "<<contacturl;
|
||||||
QSqlQuery query("SELECT id,url FROM contacts WHERE url='"+contacturl+"' AND username='"+ username+"'",m_db);
|
QSqlQuery query("SELECT id,url FROM contacts WHERE url='"+contacturl+"' AND username='"+ username+"'",m_db);
|
||||||
query.first();
|
query.first();
|
||||||
QJsonObject contact{
|
QJsonObject contact{
|
||||||
|
@ -585,6 +620,107 @@ void UPDATENEWS::updateContacts(QList<QJsonValue> contacts){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UPDATENEWS::storeFriendrequests(QByteArray serverreply,QString apiname)
|
||||||
|
{ if (apiname!=m_api || xhr.downloadtype()!=""){} else {
|
||||||
|
QJsonDocument friendrequests;
|
||||||
|
QJsonParseError jsonerror;
|
||||||
|
friendrequests=QJsonDocument::fromJson(serverreply,&jsonerror);
|
||||||
|
if (friendrequests.isArray()){
|
||||||
|
|
||||||
|
QSqlQuery imagequery("SELECT avatar FROM friendshiprequests",m_db);
|
||||||
|
QList<QString> imageurls;
|
||||||
|
while (imagequery.next()){
|
||||||
|
imageurls.append(imagequery.value(0).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i < friendrequests.array().count();i++){
|
||||||
|
QJsonValue friendrequestitem=friendrequests[i];
|
||||||
|
try{
|
||||||
|
QSqlQuery testquery("SELECT url FROM friendshiprequests WHERE username='"+ username +"' AND url='" + friendrequestitem["url"].toString() +"'",m_db);
|
||||||
|
QSqlQuery query(m_db);
|
||||||
|
if (testquery.first()){
|
||||||
|
query.prepare("UPDATE friendshiprequests SET id=?, usernamef=?, acct=?, display_name=?,locked=?,"
|
||||||
|
"bot=?, discoverable=?, groupf=?, created_at=?,"
|
||||||
|
"note=?, avatar=?, header=?, header_static=?, followers_count=?,"
|
||||||
|
"following_count=?, statuses_count=?, last_status_at=?, emojis=?, fields=? "
|
||||||
|
" WHERE username='"+ username +"' AND url='" + friendrequestitem["url"].toString() +"'");
|
||||||
|
|
||||||
|
query.bindValue(0, friendrequestitem["id"].toInt());
|
||||||
|
query.bindValue(1, friendrequestitem["username"]);
|
||||||
|
query.bindValue(2, friendrequestitem["acct"]);
|
||||||
|
query.bindValue(3, friendrequestitem["display_name"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(4, friendrequestitem["locked"].toBool());
|
||||||
|
query.bindValue(5, friendrequestitem["bot"].toBool());
|
||||||
|
query.bindValue(6, friendrequestitem["discoverable"].toBool());
|
||||||
|
query.bindValue(7, friendrequestitem["group"].toBool());
|
||||||
|
query.bindValue(8, QDateTime::fromString(friendrequestitem["created_at"].toString(),Qt::ISODate).toMSecsSinceEpoch() );
|
||||||
|
query.bindValue(9, friendrequestitem["note"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(10, friendrequestitem["avatar"]);
|
||||||
|
query.bindValue(11, friendrequestitem["header"]);
|
||||||
|
query.bindValue(12, friendrequestitem["header_static"]);
|
||||||
|
query.bindValue(13, friendrequestitem["followers_count"].toInt());
|
||||||
|
query.bindValue(14, friendrequestitem["following_count"].toInt());
|
||||||
|
query.bindValue(15, friendrequestitem["statuses_count"].toInt());
|
||||||
|
query.bindValue(16, QDateTime::fromString(friendrequestitem["last_status_at"].toString(),Qt::ISODate).toMSecsSinceEpoch() );
|
||||||
|
query.bindValue(17, friendrequestitem["emojis"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(18, friendrequestitem["fields"].toString().toUtf8().toBase64());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
query.prepare("INSERT INTO friendshiprequests (username, id, usernamef, acct, display_name, locked,"
|
||||||
|
" created_at, followers_count, following_count, statuses_count, note, url, avatar, avatar_static, "
|
||||||
|
"header, header_static, emojis, moved, fields, bot, groupf, discoverable, last_status_at) "
|
||||||
|
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||||
|
query.bindValue(0, username);
|
||||||
|
query.bindValue(1, friendrequestitem["id"].toInt());
|
||||||
|
query.bindValue(2, friendrequestitem["username"].toString());
|
||||||
|
query.bindValue(3, friendrequestitem["acct"].toString());
|
||||||
|
query.bindValue(4, friendrequestitem["display_name"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(5, friendrequestitem["locked"].toBool());
|
||||||
|
query.bindValue(6, QDateTime::fromString(friendrequestitem["created_at"].toString(),Qt::ISODate).toMSecsSinceEpoch());
|
||||||
|
query.bindValue(7, friendrequestitem["followers_count"].toInt());
|
||||||
|
query.bindValue(8, friendrequestitem["following_count"].toInt());
|
||||||
|
query.bindValue(9, friendrequestitem["statuses_count"].toInt());
|
||||||
|
query.bindValue(10, friendrequestitem["note"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(11, friendrequestitem["url"].toString());
|
||||||
|
query.bindValue(12, friendrequestitem["avatar"].toString());
|
||||||
|
query.bindValue(13, "");
|
||||||
|
query.bindValue(14, friendrequestitem["header"].toString());
|
||||||
|
query.bindValue(15, friendrequestitem["header_static"].toString());
|
||||||
|
query.bindValue(16, friendrequestitem["emojis"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(17, "false");
|
||||||
|
query.bindValue(18, friendrequestitem["fields"].toString().toUtf8().toBase64());
|
||||||
|
query.bindValue(19, friendrequestitem["bot"].toBool());
|
||||||
|
query.bindValue(20, friendrequestitem["group"].toBool());
|
||||||
|
query.bindValue(21, friendrequestitem["discoverable"].toBool());
|
||||||
|
query.bindValue(22, QDateTime::fromString(friendrequestitem["last_status_at"].toString(),Qt::ISODate).toMSecsSinceEpoch());
|
||||||
|
|
||||||
|
if(notifylist.contains("notify_FriendRequests")){
|
||||||
|
alarm.notify("Friend Request: "+ friendrequestitem["acct"].toString(),friendrequestitem["note"].toString(),0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!(query.exec())) {qDebug()<< "friendrequestitem error " << query.lastError() << " " << query.lastQuery();}
|
||||||
|
} catch(...){
|
||||||
|
qDebug() << "Friendiqasync Error inserting friendrequestitem" << friendrequestitem["acct"] << " " ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(imageurls.contains(friendrequestitem["avatar"].toString() )){
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
newcontactimagelinks.append(friendrequestitem["avatar"].toString());
|
||||||
|
newcontactnames.append(friendrequestitem["username"].toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (newcontactimagelinks.length()>0){
|
||||||
|
qDebug() << "start Friendrequests imagedownload";
|
||||||
|
startImagedownload("friendrequests");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QObject::disconnect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(storeFriendrequests(QByteArray,QString)));
|
||||||
|
}
|
||||||
|
|
||||||
void UPDATENEWS::storeEvents(QByteArray serverreply,QString apiname)
|
void UPDATENEWS::storeEvents(QByteArray serverreply,QString apiname)
|
||||||
{ if (apiname!=m_api || xhr.downloadtype()!=""){} else {
|
{ if (apiname!=m_api || xhr.downloadtype()!=""){} else {
|
||||||
|
@ -641,9 +777,9 @@ QString UPDATENEWS::url() const
|
||||||
return m_url;
|
return m_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UPDATENEWS::startImagedownload()
|
void UPDATENEWS::startImagedownload(QString downloadtype)
|
||||||
{
|
{
|
||||||
xhr.setDownloadtype("contactlist");
|
xhr.setDownloadtype(downloadtype );
|
||||||
xhr.setFilelist(newcontactimagelinks);
|
xhr.setFilelist(newcontactimagelinks);
|
||||||
xhr.setContactlist(newcontactnames);
|
xhr.setContactlist(newcontactnames);
|
||||||
xhr.setImagedir(m_imagedir);
|
xhr.setImagedir(m_imagedir);
|
||||||
|
|
|
@ -68,11 +68,13 @@ public slots:
|
||||||
void startsync();
|
void startsync();
|
||||||
void directmessages();
|
void directmessages();
|
||||||
void notifications();
|
void notifications();
|
||||||
|
void friendrequests();
|
||||||
void events();
|
void events();
|
||||||
//void startservice(QString type,QVariantMap map);
|
//void startservice(QString type,QVariantMap map);
|
||||||
void startImagedownload();
|
void startImagedownload(QString downloadtype);
|
||||||
void updateImageLocation(QString downloadtype,QString imageurl, QString filename, int index);
|
void updateImageLocation(QString downloadtype,QString imageurl, QString filename, int index);
|
||||||
void store(QByteArray serverreply,QString apiname);
|
void store(QByteArray serverreply,QString apiname);
|
||||||
|
void storeFriendrequests(QByteArray serverreply,QString apiname);
|
||||||
void storeEvents(QByteArray serverreply,QString apiname);
|
void storeEvents(QByteArray serverreply,QString apiname);
|
||||||
void showError(QString data, QString url,QString api, int code);
|
void showError(QString data, QString url,QString api, int code);
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,7 @@ void XHR::getlist()
|
||||||
{
|
{
|
||||||
if(dlindex < m_filelist.size()) {
|
if(dlindex < m_filelist.size()) {
|
||||||
QString cleanfilename;
|
QString cleanfilename;
|
||||||
if (m_downloadtype=="contactlist"){cleanfilename = m_contactlist.at(dlindex)+"-"+ m_filelist.at(dlindex).section('/',-1).section('?',0,0);
|
if (m_downloadtype=="contactlist" || m_downloadtype=="friendrequests" ){cleanfilename = m_contactlist.at(dlindex)+"-"+ m_filelist.at(dlindex).section('/',-1).section('?',0,0);
|
||||||
XHR::setFilename(imagedir()+"contacts/"+cleanfilename);
|
XHR::setFilename(imagedir()+"contacts/"+cleanfilename);
|
||||||
XHR::setUrl(m_filelist.at(dlindex));}
|
XHR::setUrl(m_filelist.at(dlindex));}
|
||||||
else {
|
else {
|
||||||
|
@ -329,7 +329,7 @@ void XHR::onRequestFinished()
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
file.close();
|
file.close();
|
||||||
emit this->downloaded(m_downloadtype,m_url,m_filename,dlindex);
|
emit this->downloaded(m_downloadtype,m_url,m_filename,dlindex);
|
||||||
if(downloadtype()=="contactlist"){dlindex=dlindex+1;XHR::getlist();}
|
if(downloadtype()=="contactlist" || downloadtype()=="friendrequests"){dlindex=dlindex+1;XHR::getlist();}
|
||||||
|
|
||||||
//reply->deleteLater();
|
//reply->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,12 @@ function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
|
||||||
} else if(xhrequest.readyState === XMLHttpRequest.DONE) {
|
} else if(xhrequest.readyState === XMLHttpRequest.DONE) {
|
||||||
try{ if (xhrequest.responseText!=""){
|
try{ if (xhrequest.responseText!=""){
|
||||||
callback(xhrequest.responseText)
|
callback(xhrequest.responseText)
|
||||||
}else{
|
}else{print("API:\n" +api+" NO RESPONSE");
|
||||||
showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
|
showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
|
||||||
callback(xhrequest.responseText)
|
callback(xhrequest.responseText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e){showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
|
catch (e){print("API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText);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.open(method, login.server+api,true,login.username,Qt.atob(login.password));
|
||||||
|
@ -166,6 +166,20 @@ 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 showMessage(header,message,rootwindow){//print(message);
|
function showMessage(header,message,rootwindow){//print(message);
|
||||||
var cleanmessage=message.replace(/"/g,"-");
|
var cleanmessage=message.replace(/"/g,"-");
|
||||||
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
|
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
|
||||||
|
|
|
@ -177,7 +177,7 @@ function newRequestFriendsAlbumPictures(login,friend,rootwindow,callback){//prin
|
||||||
//commented out for broken remoteauth
|
//commented out for broken remoteauth
|
||||||
Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
|
Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
|
||||||
//Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
|
//Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
|
||||||
try {var obj=JSON.parse(photohtml);print ("Photohtml: "+photohtml)
|
try {var obj=JSON.parse(photohtml);//print ("Photohtml: "+photohtml)
|
||||||
if (obj.hasOwnProperty('status')){
|
if (obj.hasOwnProperty('status')){
|
||||||
Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
|
Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){
|
||||||
getAlbumFromHtml(photohtml,false,rootwindow,callback)})
|
getAlbumFromHtml(photohtml,false,rootwindow,callback)})
|
||||||
|
|
|
@ -334,7 +334,7 @@ function favorite(login,favorited,newsid,rootwindow){
|
||||||
}
|
}
|
||||||
|
|
||||||
function likerequest(login,database,verb,newsid,rootwindow){
|
function likerequest(login,database,verb,newsid,rootwindow){
|
||||||
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){
|
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){print("like "+ obj);
|
||||||
if (obj=='"ok"'){
|
if (obj=='"ok"'){
|
||||||
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||||
db.transaction( function(tx) {
|
db.transaction( function(tx) {
|
||||||
|
@ -461,6 +461,7 @@ function chatsfromdb(database,login,messagetype,callback,stop_time){
|
||||||
helpernews.currentconversation=[];
|
helpernews.currentconversation=[];
|
||||||
for (var h = 0;h<newsrs.rows.length;h++){
|
for (var h = 0;h<newsrs.rows.length;h++){
|
||||||
var helpernews2=newsrs.rows.item(h);
|
var helpernews2=newsrs.rows.item(h);
|
||||||
|
if(helpernews.id!=helpernews2.status_id){
|
||||||
helpernews2.newscount=0;
|
helpernews2.newscount=0;
|
||||||
helpernews2=fetchUsersForNews(database,login.username,helpernews2,allcontacts);
|
helpernews2=fetchUsersForNews(database,login.username,helpernews2,allcontacts);
|
||||||
helpernews2.statusnet_html=Qt.atob(helpernews2.statusnet_html);
|
helpernews2.statusnet_html=Qt.atob(helpernews2.statusnet_html);
|
||||||
|
@ -470,6 +471,7 @@ function chatsfromdb(database,login,messagetype,callback,stop_time){
|
||||||
if (helpernews2.attachments!="" && helpernews2.attachments!==null){helpernews2.attachments=JSON.parse(Qt.atob(helpernews2.attachments))};
|
if (helpernews2.attachments!="" && helpernews2.attachments!==null){helpernews2.attachments=JSON.parse(Qt.atob(helpernews2.attachments))};
|
||||||
helpernews.currentconversation.push(helpernews2)
|
helpernews.currentconversation.push(helpernews2)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
newsArray.push(helpernews);
|
newsArray.push(helpernews);
|
||||||
}
|
}
|
||||||
callback(newsArray,lastid);
|
callback(newsArray,lastid);
|
||||||
|
|
|
@ -57,7 +57,8 @@ function beautify(newsitemobject,msg){
|
||||||
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
|
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
|
||||||
}
|
}
|
||||||
var friendica_activities={self:self}
|
var friendica_activities={self:self}
|
||||||
var attachmentList=[];
|
var imageAttachmentList=[];
|
||||||
|
var videoAttachmentList=[];
|
||||||
var videoformats=["mp4", "avi", "webm","ogg","mp3"]
|
var videoformats=["mp4", "avi", "webm","ogg","mp3"]
|
||||||
try{if(newsitemobject.attachments){
|
try{if(newsitemobject.attachments){
|
||||||
var attachArray=newsitemobject.attachments;
|
var attachArray=newsitemobject.attachments;
|
||||||
|
@ -71,7 +72,7 @@ function beautify(newsitemobject,msg){
|
||||||
else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
|
else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
|
||||||
}
|
}
|
||||||
else {attachhelper.url=attachArray[image].url}
|
else {attachhelper.url=attachArray[image].url}
|
||||||
attachmentList.push(attachhelper)
|
imageAttachmentList.push(attachhelper)
|
||||||
//print("Attachhelper "+attachhelper.url)
|
//print("Attachhelper "+attachhelper.url)
|
||||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url,"")
|
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url,"")
|
||||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
|
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
|
||||||
|
@ -87,7 +88,7 @@ function beautify(newsitemobject,msg){
|
||||||
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
|
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
|
||||||
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
|
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
|
||||||
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
|
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
|
||||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=videohelper.url)){attachmentList.push(videohelper)}
|
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +102,7 @@ function beautify(newsitemobject,msg){
|
||||||
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
|
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
|
||||||
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
|
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
|
||||||
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
|
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
|
||||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ptvideohelper.url)){attachmentList.push(ptvideohelper)}
|
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newsitemobject.text.indexOf("youtube.com/watch?v")>-1){
|
if (newsitemobject.text.indexOf("youtube.com/watch?v")>-1){
|
||||||
|
@ -112,11 +113,11 @@ function beautify(newsitemobject,msg){
|
||||||
var ythelper={mimetype:"video/youtube"}
|
var ythelper={mimetype:"video/youtube"}
|
||||||
ythelper.url=yttext.substring(ythelperstringposition+8,ytposend);
|
ythelper.url=yttext.substring(ythelperstringposition+8,ytposend);
|
||||||
yttext=yttext.substring(ytposend,yttext.length);
|
yttext=yttext.substring(ytposend,yttext.length);
|
||||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ythelper.url)){attachmentList.push(ythelper)}
|
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ythelper.url)){videoAttachmentList.push(ythelper)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newsitemobject.attachmentList=attachmentList;
|
newsitemobject.videoAttachmentList=videoAttachmentList;
|
||||||
|
newsitemobject.imageAttachmentList=imageAttachmentList;
|
||||||
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){
|
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){
|
||||||
newsitemobject.nsfw=true
|
newsitemobject.nsfw=true
|
||||||
} else{newsitemobject.nsfw=false}
|
} else{newsitemobject.nsfw=false}
|
||||||
|
@ -152,9 +153,9 @@ else{
|
||||||
if (j==0){newsitemobject.indent=0}else{
|
if (j==0){newsitemobject.indent=0}else{
|
||||||
for (var k=msg.model.count-1;k>-1;k--){
|
for (var k=msg.model.count-1;k>-1;k--){
|
||||||
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
|
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
|
||||||
newsitemobject.indent=msg.model.get(k).newsitemobject.indent+1;
|
newsitemobject.indent=(msg.model.get(k).newsitemobject.indent||0)+1;
|
||||||
if (newsitemobject.indent>6){newsitemobject.indent=6};
|
if (newsitemobject.indent>6){newsitemobject.indent=6};
|
||||||
break}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
@ -277,10 +277,12 @@ try {Helperjs.friendicaRequest(login,"/api/statusnet/config",rootwindow, functio
|
||||||
|
|
||||||
function readConfig(database,callback,filter,filtervalue) { // reads config
|
function readConfig(database,callback,filter,filtervalue) { // reads config
|
||||||
if (filter){var where = " WHERE "+ filter +" = '" + filtervalue+"'"} else { var where=""}
|
if (filter){var where = " WHERE "+ filter +" = '" + filtervalue+"'"} else { var where=""}
|
||||||
|
//print("readConfig");
|
||||||
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3],initDatabase(database));
|
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3],initDatabase(database));
|
||||||
db.transaction( function(tx) {
|
db.transaction( function(tx) {
|
||||||
var tables = tx.executeSql("SELECT * FROM sqlite_master WHERE type='table'");
|
var tables = tx.executeSql("SELECT * FROM sqlite_master WHERE type='table'");
|
||||||
if (tables.rows.length==0){print("no database");callback("")} else {
|
if (tables.rows.length==0){print("no database");callback("")} else {
|
||||||
|
|
||||||
var rs = tx.executeSql('select * from config'+where);
|
var rs = tx.executeSql('select * from config'+where);
|
||||||
var rsArray=[];
|
var rsArray=[];
|
||||||
if (rs.rows.length>0){
|
if (rs.rows.length>0){
|
||||||
|
@ -289,11 +291,29 @@ function readConfig(database,callback,filter,filtervalue) { // reads config
|
||||||
}
|
}
|
||||||
var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,isActive:rsArray[0].isActive, newsViewType:rsArray[0].newsViewType,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
|
var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,isActive:rsArray[0].isActive, newsViewType:rsArray[0].newsViewType,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
|
||||||
if (rsObject.newsViewType!="" && rsObject.newsViewType!=null){updateNewsviewtype(database,rsObject.newsViewType)}
|
if (rsObject.newsViewType!="" && rsObject.newsViewType!=null){updateNewsviewtype(database,rsObject.newsViewType)}
|
||||||
} else {var rsObject=""}
|
} else {print("config empty");var rsObject=""}
|
||||||
callback(rsObject)}}
|
callback(rsObject)}}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function readAllLogins(database,callback) { // reads config
|
||||||
|
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3],initDatabase(database));
|
||||||
|
db.transaction( function(tx) {
|
||||||
|
var tables = tx.executeSql("SELECT * FROM sqlite_master WHERE type='table'");
|
||||||
|
if (tables.rows.length==0){print("no database");callback("")} else {
|
||||||
|
var rs = tx.executeSql('select * from config');
|
||||||
|
var rsArray=[];
|
||||||
|
if (rs.rows.length>0){
|
||||||
|
for(var i = 0; i < rs.rows.length; i++) {
|
||||||
|
rsArray.push(rs.rows.item(i));
|
||||||
|
rsArray[i].permissions=JSON.parse(rsArray[i].permissions)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback(rsArray)}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function readActiveConfig(database){
|
function readActiveConfig(database){
|
||||||
var obj="";
|
var obj="";
|
||||||
readConfig(database,function(config){obj=config},"isActive", 0);
|
readConfig(database,function(config){obj=config},"isActive", 0);
|
||||||
|
@ -360,7 +380,7 @@ function updateNewsviewtype(database, newsViewtype){
|
||||||
db.transaction( function(tx) {
|
db.transaction( function(tx) {
|
||||||
var rs1 = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', ["newsViewType",newsViewtype])
|
var rs1 = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', ["newsViewType",newsViewtype])
|
||||||
var rs2 = tx.executeSql('UPDATE config SET newsViewType=""');
|
var rs2 = tx.executeSql('UPDATE config SET newsViewType=""');
|
||||||
Helperjs.showMessage(qsTr("Changelog"),qsTr("Setting view type of news has moved from account page to config page."),root)
|
//Helperjs.showMessage(qsTr("Changelog"),qsTr("Setting view type of news has moved from account page to config page."),root)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,6 +453,11 @@ function updateContactInDB(login,database,isFriend,contact){// for newstab and f
|
||||||
|
|
||||||
function processNews(api,data){
|
function processNews(api,data){
|
||||||
try{var newslist=JSON.parse(data)} catch(e){newsBusy.running=false;};
|
try{var newslist=JSON.parse(data)} catch(e){newsBusy.running=false;};
|
||||||
|
if (api=="/api/users/show"){
|
||||||
|
var usermessages=[];
|
||||||
|
usermessages.push(newslist.status);
|
||||||
|
newslist=usermessages;
|
||||||
|
}
|
||||||
if (data==""){}
|
if (data==""){}
|
||||||
else if (typeof(newslist)=='undefined'){
|
else if (typeof(newslist)=='undefined'){
|
||||||
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
|
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
|
||||||
|
@ -475,11 +500,16 @@ function processNews(api,data){
|
||||||
newslist[n].statusnet_html=newslist[n].msg_html;
|
newslist[n].statusnet_html=newslist[n].msg_html;
|
||||||
newslist[n].text=newslist[n].msg;
|
newslist[n].text=newslist[n].msg;
|
||||||
}
|
}
|
||||||
} else {//if(api!="/api/statuses/user_timeline"){
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else {//if(api!="/api/statuses/user_timeline"){
|
||||||
var chatlist=[];
|
var chatlist=[];
|
||||||
var conversationIds=[];
|
var conversationIds=[];
|
||||||
var commentCount=[];
|
var commentCount=[];
|
||||||
|
|
||||||
for (var n in newslist){
|
for (var n in newslist){
|
||||||
|
if (newslist[n]!=null){
|
||||||
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
|
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
|
||||||
if (api=="/api/statuses/replies"){newslist[n].messagetype=3}else{newslist[n].messagetype=0;}
|
if (api=="/api/statuses/replies"){newslist[n].messagetype=3}else{newslist[n].messagetype=0;}
|
||||||
newslist[n].friendica_author=cleanUser(newslist[n].friendica_author);
|
newslist[n].friendica_author=cleanUser(newslist[n].friendica_author);
|
||||||
|
@ -520,6 +550,7 @@ function processNews(api,data){
|
||||||
chatlist[conversationindex]=newslist[n];
|
chatlist[conversationindex]=newslist[n];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//enrich chatlist with old entries
|
//enrich chatlist with old entries
|
||||||
|
|
||||||
for (var count in chatlist){ //print("chat "+JSON.stringify(chatlist[count])+" count: "+commentCount[count])
|
for (var count in chatlist){ //print("chat "+JSON.stringify(chatlist[count])+" count: "+commentCount[count])
|
||||||
|
@ -541,8 +572,8 @@ function processNews(api,data){
|
||||||
newslist.reverse();
|
newslist.reverse();
|
||||||
newstab.conversation=newslist
|
newstab.conversation=newslist
|
||||||
}
|
}
|
||||||
else if (api=="/api/statuses/user_timeline"){
|
else if (api=="/api/statuses/user_timeline" || api=="/api/users/show"){
|
||||||
newstab.contactposts=newslist
|
root.contactposts=newslist
|
||||||
}
|
}
|
||||||
else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notifications")&&(newstab.newstabstatus==="Conversations")){
|
else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notifications")&&(newstab.newstabstatus==="Conversations")){
|
||||||
showNews(chatlist);root.news=newslist
|
showNews(chatlist);root.news=newslist
|
||||||
|
|
|
@ -34,12 +34,15 @@ import QtQuick 2.11
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: calendarDay
|
id: calendarDay
|
||||||
width:7*mm
|
width: root.fontFactor*osSettings.bigFontSize*2//5*mm
|
||||||
height: 7*mm
|
height: root.fontFactor*osSettings.bigFontSize*2//5*mm
|
||||||
property int dateInt: Math.floor(Date.parse(model.date)/86400000) //Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
|
property int dateInt: Math.floor(Date.parse(model.date)/86400000) //Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: placeHolder
|
id: placeHolder
|
||||||
color: 'lightblue'; antialiasing: true
|
color: model.today?'lightblue':'transparent';
|
||||||
|
border.color: 'lightblue'
|
||||||
|
border.width: 2
|
||||||
|
antialiasing: true
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
}
|
}
|
||||||
|
@ -51,7 +54,7 @@ Item {
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
text: model.day
|
text: model.day
|
||||||
font.bold: model.today
|
font.bold: model.today
|
||||||
font.pixelSize: 4*mm
|
font.pointSize: 1.2*osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id:eventRect
|
id:eventRect
|
||||||
|
@ -59,15 +62,15 @@ Item {
|
||||||
anchors.margins: 0.5*mm
|
anchors.margins: 0.5*mm
|
||||||
anchors.bottom: calendarDay.bottom
|
anchors.bottom: calendarDay.bottom
|
||||||
width: parent.width-mm
|
width: parent.width-mm
|
||||||
height: mm
|
height: 0.5*osSettings.systemFontSize//mm
|
||||||
visible: eventdays.indexOf(dateInt)>-1
|
visible: eventdays.indexOf(dateInt)>-1
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: calendarDay
|
anchors.fill: calendarDay
|
||||||
onClicked: {
|
onClicked: {rootstackView.push("qrc:/qml/calendarqml/EventList.qml",{"dayint": dateInt,"events":events});
|
||||||
var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
|
// var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
|
||||||
if (component.status== Component.Ready){
|
// if (component.status== Component.Ready){
|
||||||
var eventlist = component.createObject(calendartab,{"dayint": dateInt})}
|
// var eventlist = component.createObject(calendartab,{"dayint": dateInt})}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,7 @@ import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
import QtQml 2.2
|
import QtQml 2.2
|
||||||
import Qt.labs.calendar 1.0
|
import Qt.labs.calendar 1.0
|
||||||
//import QtQuick.Controls 1.2 as Oldcontrol
|
//import QtQuick.Layouts 1.3
|
||||||
import QtQuick.Layouts 1.3
|
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
import "qrc:/qml/calendarqml"
|
import "qrc:/qml/calendarqml"
|
||||||
|
@ -43,9 +42,9 @@ import "qrc:/qml/genericqml"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id:calendarrectangle
|
id:calendarrectangle
|
||||||
// y:1
|
// y:1
|
||||||
// width:root.width-mm
|
width:parent.width//-mm
|
||||||
// height:root.height-5*mm
|
height:parent.height//-5*mm
|
||||||
anchors.fill: parent
|
// anchors.fill: parent
|
||||||
color: '#fff'
|
color: '#fff'
|
||||||
property date currentTime: new Date()
|
property date currentTime: new Date()
|
||||||
property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
|
property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
|
||||||
|
@ -69,6 +68,12 @@ Rectangle {
|
||||||
events=eventArray;
|
events=eventArray;
|
||||||
eventdays=dayArray;
|
eventdays=dayArray;
|
||||||
calBusy.running=false
|
calBusy.running=false
|
||||||
|
|
||||||
|
var currentevents=events.filter(event=>(currentTime<=event.end));
|
||||||
|
for (var i=0; i<Math.min(5,currentevents.length);i++){
|
||||||
|
var liststate="";
|
||||||
|
eventModel.append({"event":currentevents[i],"eventstatus":liststate});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,6 +88,30 @@ Rectangle {
|
||||||
running: false
|
running: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlueButton{
|
||||||
|
x:mm
|
||||||
|
y:mm
|
||||||
|
z:2
|
||||||
|
visible: !wideScreen
|
||||||
|
fontColor: "grey"
|
||||||
|
border.color: "transparent"
|
||||||
|
text: "\uf0c9"
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
onClicked:{
|
||||||
|
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
|
||||||
|
}
|
||||||
|
|
||||||
|
LeftDrawerLinux{
|
||||||
|
id:leftDrawer
|
||||||
|
property var newstabstatus: newstab.newstabstatus
|
||||||
|
visible: wideScreen&&rootstackView.depth<2
|
||||||
|
width: visible?osSettings.systemFontSize*15:0
|
||||||
|
height: root.height-bar.height
|
||||||
|
}
|
||||||
|
|
||||||
|
LeftDrawerAndroid{
|
||||||
|
id: leftDrawerAndroid
|
||||||
|
}
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id: updateEvents
|
id: updateEvents
|
||||||
|
@ -90,8 +119,7 @@ Rectangle {
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right:calendartabstatusButton.left
|
anchors.right:calendartabstatusButton.left
|
||||||
anchors.rightMargin:mm
|
anchors.rightMargin:mm
|
||||||
height: 6*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
width: 8*mm
|
|
||||||
text:"\uf021"
|
text:"\uf021"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
calBusy.running=true;
|
calBusy.running=true;
|
||||||
|
@ -103,7 +131,7 @@ Rectangle {
|
||||||
// })
|
// })
|
||||||
}}
|
}}
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target: updatenews
|
target: updatenews
|
||||||
|
|
||||||
function onSuccess(api){
|
function onSuccess(api){
|
||||||
|
@ -119,15 +147,15 @@ Connections{
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin:2*mm
|
anchors.rightMargin:2*mm
|
||||||
height: 6*mm
|
width: Math.max(6*root.fontFactor*osSettings.bigFontSize,implicitWidth)
|
||||||
width: Math.max(10*mm,implicitWidth)
|
|
||||||
text: calendartab.calendartabstatus=="Events"?qsTr("Events"):calendartabstatus
|
text: calendartab.calendartabstatus=="Events"?qsTr("Events"):calendartabstatus
|
||||||
Menu {
|
Menu {
|
||||||
id:calendartabmenu
|
id:calendartabmenu
|
||||||
width: 40*mm
|
width: 20*root.fontFactor*osSettings.systemFontSize
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Own Calendar")
|
text: qsTr("Own Calendar")
|
||||||
font.pixelSize: 3*mm
|
//font.pixelSize: 3*mm
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
calendartab.calendartabstatus="Events";
|
calendartab.calendartabstatus="Events";
|
||||||
// calendartabstatusButton.text=qsTr("own Calendar");
|
// calendartabstatusButton.text=qsTr("own Calendar");
|
||||||
|
@ -140,39 +168,50 @@ Connections{
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id: calendarView
|
id: calendarView
|
||||||
x: mm;y:8*mm
|
y:2*root.fontFactor*osSettings.bigFontSize//8*mm
|
||||||
width: parent.width-2*mm; height: parent.height-9*mm
|
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm//newstabitem.width/3*2:newstabitem.width
|
||||||
|
x: leftDrawer.width
|
||||||
|
height: 18*root.fontFactor*osSettings.bigFontSize //parent.height-9*mm
|
||||||
clip: true
|
clip: true
|
||||||
snapMode: ListView.SnapOneItem
|
snapMode: ListView.SnapOneItem
|
||||||
orientation: ListView.Horizontal
|
orientation: ListView.Horizontal
|
||||||
highlightRangeMode: ListView.StrictlyEnforceRange
|
highlightRangeMode: ListView.StrictlyEnforceRange
|
||||||
|
// currentIndex: count
|
||||||
|
// onCurrentIndexChanged:{print("Index "+currentIndex)}
|
||||||
model: CalendarModel {id:calendarModel
|
model: CalendarModel {id:calendarModel
|
||||||
from: new Date()
|
from: new Date()
|
||||||
to: new Date(new Date().valueOf()+93312000000)
|
to: new Date(new Date().valueOf()+93312000000)
|
||||||
}
|
}
|
||||||
delegate:
|
delegate:
|
||||||
ColumnLayout{
|
Item{
|
||||||
width:calendarView.width
|
width:Math.min(23*root.fontFactor*osSettings.bigFontSize,calendarView.width)
|
||||||
|
height: parent.height
|
||||||
Text{
|
Text{
|
||||||
font.bold: true
|
font.bold: true
|
||||||
Layout.fillWidth: true
|
//Layout.fillWidth: true
|
||||||
|
width: parent.width-root.fontFactor*osSettings.bigFontSize
|
||||||
horizontalAlignment:Text.AlignHCenter
|
horizontalAlignment:Text.AlignHCenter
|
||||||
text: model.year
|
text: model.year
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
Text{
|
Text{y:1.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: parent.width-osSettings.bigFontSize
|
||||||
text: Qt.locale().standaloneMonthName(model.month)
|
text: Qt.locale().standaloneMonthName(model.month)
|
||||||
Layout.fillWidth: true
|
//Layout.fillWidth: true
|
||||||
horizontalAlignment:Text.AlignHCenter
|
horizontalAlignment:Text.AlignHCenter
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
DayOfWeekRow{
|
DayOfWeekRow{y:3*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: parent.width-root.fontFactor*osSettings.bigFontSize
|
||||||
locale: monthgrid.locale
|
locale: monthgrid.locale
|
||||||
Layout.fillWidth: true
|
//Layout.fillWidth: true
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
MonthGrid {
|
MonthGrid {y:5*root.fontFactor*osSettings.bigFontSize
|
||||||
id: monthgrid
|
id: monthgrid
|
||||||
Layout.fillWidth: true
|
height: parent.height-5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: parent.width-root.fontFactor*osSettings.bigFontSize
|
||||||
month: model.month
|
month: model.month
|
||||||
year: model.year
|
year: model.year
|
||||||
locale: Qt.locale()
|
locale: Qt.locale()
|
||||||
|
@ -180,6 +219,22 @@ Connections{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScrollIndicator.horizontal: ScrollIndicator { }
|
ScrollIndicator.horizontal: ScrollIndicator { }
|
||||||
|
Component.onCompleted: positionViewAtBeginning()
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: eventlistView
|
||||||
|
y:20*root.fontFactor*osSettings.bigFontSize
|
||||||
|
x: leftDrawer.width
|
||||||
|
height: parent.height-20*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm
|
||||||
|
clip: true
|
||||||
|
model: eventModel
|
||||||
|
delegate: EventListItem{}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{
|
||||||
|
id: eventModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
@ -34,45 +34,42 @@ import QtQuick.Controls 2.12
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
import "qrc:/qml/genericqml"
|
import "qrc:/qml/genericqml"
|
||||||
|
import "qrc:/qml/calendarqml"
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:eventList
|
id:eventList
|
||||||
z:2
|
// height: parent.height
|
||||||
border.color: "grey"
|
// width:parent.width
|
||||||
width: parent.width-4*mm
|
|
||||||
height:parent.height-12*mm
|
//radius: 0.5*mm
|
||||||
x:mm
|
|
||||||
y:mm
|
|
||||||
radius: 0.5*mm
|
|
||||||
property var daylist:[]
|
property var daylist:[]
|
||||||
property int dayint: 0
|
property int dayint: 0
|
||||||
|
property var events:[]
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
onClicked:{eventList.destroy()}
|
onClicked:{rootstackView.pop()}
|
||||||
}
|
}
|
||||||
ListView {
|
ListView {
|
||||||
id: eventlistView
|
id: eventlistView
|
||||||
x: mm
|
|
||||||
y:closeButton.height+2*mm
|
y:closeButton.height+2*mm
|
||||||
width: eventList.width-2*mm
|
width: eventList.width-4*root.fontFactor*osSettings.bigFontSize
|
||||||
height: eventList.height-closeButton.height-4*mm
|
height: eventList.height-closeButton.height-root.fontFactor*osSettings.bigFontSize
|
||||||
clip: true
|
clip: true
|
||||||
model: eventModel
|
model: eventModel
|
||||||
delegate: eventItem
|
delegate: EventListItem{}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: eventModel
|
id: eventModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted:{//print("daylist"+JSON.stringify(daylist) + dayint)
|
Component.onCompleted:{//print("daylist"+JSON.stringify(events) + dayint)
|
||||||
var currentevents=events.filter(event=>(dayint>=event.startday)&&(dayint<=event.endday));
|
var currentevents=events.filter(event=>(dayint>=event.startday)&&(dayint<=event.endday));
|
||||||
for (var i=0; i<currentevents.length;i++){
|
for (var i=0; i<currentevents.length;i++){
|
||||||
var liststate="";if(currentevents.length<2){liststate="large"};
|
var liststate="";if(currentevents.length<2){liststate="large"};
|
||||||
|
@ -80,55 +77,4 @@ Rectangle{
|
||||||
eventModel.append({"event":currentevents[i],"eventstatus":liststate});
|
eventModel.append({"event":currentevents[i],"eventstatus":liststate});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
|
||||||
id:eventItem
|
|
||||||
Rectangle{
|
|
||||||
property string status: eventstatus
|
|
||||||
width:eventlistView.width
|
|
||||||
height:eventNameText.height+eventDetailsText.height+mm
|
|
||||||
border.color: "light grey"
|
|
||||||
border.width: 1
|
|
||||||
radius: 0.5*mm
|
|
||||||
Image {
|
|
||||||
id:profileImage
|
|
||||||
source: ((event.eventOwner.profile_image!="") && (typeof(event.eventOwner.profile_image)=="string"))? "file://"+event.eventOwner.profile_image : event.eventOwner.profile_image_url
|
|
||||||
x:1
|
|
||||||
y:1
|
|
||||||
width: 7*mm
|
|
||||||
height: 7*mm
|
|
||||||
//radius:mm
|
|
||||||
|
|
||||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
id:eventNameText
|
|
||||||
x: 8*mm
|
|
||||||
width:parent.width-8*mm
|
|
||||||
height:contentHeight
|
|
||||||
text: new Date(event.start).toLocaleString(Qt.locale(),Locale.NarrowFormat)+ " - " +(event.end>0?new Date(event.end).toLocaleString(Qt.locale(),Locale.NarrowFormat):" ")+": "+event.title //+calendarrectangle.offsetTime
|
|
||||||
font.pixelSize: 3*mm
|
|
||||||
wrapMode:Text.Wrap
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id:eventDetailsText
|
|
||||||
x:8*mm
|
|
||||||
z:4
|
|
||||||
width: parent.width-8*mm
|
|
||||||
height: contentHeight
|
|
||||||
textFormat: Text.RichText
|
|
||||||
text: status==""?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location)//Qt.atob(event.html)
|
|
||||||
anchors.top: eventNameText.bottom
|
|
||||||
font.pixelSize: 3*mm
|
|
||||||
wrapMode:Text.Wrap
|
|
||||||
onLinkActivated:{Qt.openUrlExternally(link)}
|
|
||||||
}
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{if (status==""){status="large"} else {status=""}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
90
source-linux/qml/calendarqml/EventListItem.qml
Normal file
90
source-linux/qml/calendarqml/EventListItem.qml
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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"
|
||||||
|
import "qrc:/qml/calendarqml"
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
id:eventItem
|
||||||
|
property string status: eventstatus
|
||||||
|
property var currEvent: event
|
||||||
|
width:parent.width
|
||||||
|
height:eventNameText.height+eventDetailsText.height+mm
|
||||||
|
border.color: "light grey"
|
||||||
|
border.width: 1
|
||||||
|
radius: 0.5*mm
|
||||||
|
Image {
|
||||||
|
id:profileImage
|
||||||
|
source: ((event.eventOwner.profile_image!="") && (typeof(event.eventOwner.profile_image)=="string"))? "file://"+event.eventOwner.profile_image : event.eventOwner.profile_image_url
|
||||||
|
x:1
|
||||||
|
y:1
|
||||||
|
width: 7*mm
|
||||||
|
height: 7*mm
|
||||||
|
//radius:mm
|
||||||
|
|
||||||
|
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
id:eventNameText
|
||||||
|
x: 8*mm
|
||||||
|
width:parent.width-8*mm
|
||||||
|
height:contentHeight
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: new Date(event.start).toLocaleString(Qt.locale(),Locale.NarrowFormat)+ " - " +((event.end>0)&&(event.end!=null)?new Date(event.end).toLocaleString(Qt.locale(),Locale.NarrowFormat):"\u221E")+":\n"+event.title //+calendarrectangle.offsetTime
|
||||||
|
wrapMode:Text.Wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id:eventDetailsText
|
||||||
|
x:8*mm
|
||||||
|
z:4
|
||||||
|
width: parent.width-8*mm
|
||||||
|
height: contentHeight
|
||||||
|
textFormat: Text.RichText
|
||||||
|
text: status!="large"?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location)//Qt.atob(event.html)
|
||||||
|
anchors.top: eventNameText.bottom
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
wrapMode:Text.Wrap
|
||||||
|
onLinkActivated:{Qt.openUrlExternally(link)}
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked:{
|
||||||
|
if (status==""){
|
||||||
|
rootstackView.push("qrc:/qml/calendarqml/EventList.qml",{"dayint": event.startday, "events":[event]});
|
||||||
|
} else {rootstackView.pop()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,7 +32,7 @@
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Dialogs 1.2
|
import QtQuick.Dialogs 1.2
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
|
import QtQuick.Layouts 1.12
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
import "qrc:/js/layout.js" as Layoutjs
|
import "qrc:/js/layout.js" as Layoutjs
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
|
@ -55,22 +55,21 @@ Page{
|
||||||
servericon.source=serverdata.site.logo})} catch(e){print(e)}
|
servericon.source=serverdata.site.logo})} catch(e){print(e)}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button{
|
MButton{
|
||||||
id:userButton
|
id:userButton
|
||||||
height: 8*mm
|
|
||||||
text:qsTr("User")
|
text:qsTr("User")
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
x: root.fontFactor*osSettings.bigFontSize
|
||||||
x: mm
|
y: root.fontFactor*osSettings.bigFontSize
|
||||||
y: mm
|
width: root.width/2 - 2*mm
|
||||||
width: root.width/2
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
visible: users.length>0
|
visible: users.length>0
|
||||||
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
var useritems="";
|
var useritems="";
|
||||||
for (var i=0;i<accountPage.users.length;i++){
|
for (var i=0;i<accountPage.users.length;i++){
|
||||||
|
|
||||||
useritems=useritems+"MenuItem{font.pixelSize: 3*mm;width:accountPage.width*2/3; text:'"+accountPage.users[i].username+
|
useritems=useritems+"MenuItem{font.pointSize: osSettings.bigFontSize;width:accountPage.width*2/3; text:'"+accountPage.users[i].username+
|
||||||
"'; onTriggered: {Service.readConfig(db,function(obj){
|
"'; onTriggered: {Service.readConfig(db,function(obj){
|
||||||
userButton.text=obj.username;
|
userButton.text=obj.username;
|
||||||
servername.text=obj.server;
|
servername.text=obj.server;
|
||||||
|
@ -82,43 +81,17 @@ Page{
|
||||||
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
|
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
|
||||||
},'username','"+ accountPage.users[i].username+"')}}"
|
},'username','"+ accountPage.users[i].username+"')}}"
|
||||||
}
|
}
|
||||||
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
|
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service;"+
|
||||||
|
" Menu {width:8*root.fontFactor*osSettings.bigFontSize;"+useritems+"}";
|
||||||
var userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
|
var userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
|
||||||
userlistObject.popup() }
|
userlistObject.popup() }
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
|
||||||
text: qsTr("Server")
|
|
||||||
//font.pixelSize:3*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
x: 4*mm; y: 10*mm
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: qsTr("Nickname")
|
|
||||||
//font.pixelSize:3*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
x: 4*mm; y: 20*mm
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: qsTr("Password")
|
|
||||||
//font.pixelSize:3*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
x: 4*mm; y: 30*mm
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
id: imagedirlabel
|
|
||||||
visible: imagestore.text!=""
|
|
||||||
text: qsTr("Image dir.")
|
|
||||||
//font.pixelSize:3*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
x: 4*mm; y: 40*mm
|
|
||||||
}
|
|
||||||
|
|
||||||
Image{
|
Image{
|
||||||
id:servericon
|
id:servericon
|
||||||
x:4*mm;y:13.5*mm
|
x:root.fontFactor*osSettings.bigFontSize;y:3*root.fontFactor*osSettings.bigFontSize
|
||||||
width:5*mm; height: 5*mm
|
width:2.5*root.fontFactor*osSettings.bigFontSize; height: 2.5*root.fontFactor*osSettings.bigFontSize
|
||||||
visible: false
|
visible: false
|
||||||
source:""
|
source:""
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -129,54 +102,40 @@ Page{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
|
||||||
Button{
|
MButton{
|
||||||
id:serverSearchButton
|
id:serverSearchButton
|
||||||
text:"\uf002"
|
text:"\uf002"
|
||||||
font.pixelSize: 3*mm
|
icon.name: "search"
|
||||||
font.pointSize: 16
|
font.pointSize: osSettings.bigFontSize
|
||||||
x:4*mm
|
x:root.fontFactor*osSettings.bigFontSize
|
||||||
y:13.5*mm
|
y:3*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 5*mm; height:5*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize; height:2*root.fontFactor*osSettings.bigFontSize
|
||||||
visible: servericon.visible?false:true
|
visible: servericon.visible?false:true
|
||||||
onClicked:{Qt.openUrlExternally(Qt.resolvedUrl("https://dir.friendica.social/servers"))}
|
onClicked:{Qt.openUrlExternally(Qt.resolvedUrl("https://dir.friendica.social/servers"))}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{color: "light grey"; x: 10*mm; y: 13.5*mm; width: root.width-12*mm; height: 5*mm;}
|
|
||||||
Flickable {
|
TextField {
|
||||||
id: servernameFlickable
|
|
||||||
x: 10*mm; y: 13.5*mm; width: root.width-12*mm; height: 5*mm;
|
|
||||||
contentWidth: servername.paintedWidth
|
|
||||||
contentHeight: servername.paintedHeight
|
|
||||||
clip: true
|
|
||||||
TextEdit {
|
|
||||||
id: servername
|
id: servername
|
||||||
width: servernameFlickable.width
|
x: 4*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize; width: root.width-18*mm; //height: 5*mm;
|
||||||
height: servernameFlickable.height
|
placeholderText: qsTr("Server")
|
||||||
focus: true
|
font.pointSize: osSettings.systemFontSize
|
||||||
//font.pixelSize:3*mm
|
onEditingFinished: {
|
||||||
font.pointSize: 16
|
if ((servername.text)==""){}
|
||||||
text:"https://"
|
else if((servername.text).substring(0,7) !=="https://"){
|
||||||
onEditingFinished:{
|
servername.text= "https://"+text//(serverstring.text).substring(8)
|
||||||
if((servername.text).substring(0,11) =="https://http"){
|
|
||||||
serverstring.text= (serverstring.text).substring(8)
|
|
||||||
}
|
|
||||||
accountPage.setServericon(servername.text)
|
|
||||||
}
|
|
||||||
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,servernameFlickable)
|
|
||||||
}
|
}
|
||||||
|
accountPage.setServericon(servername.text)}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
TextField {
|
||||||
color: "light grey"
|
|
||||||
x: 4*mm; y: 23.5*mm; width: root.width-6*mm; height: 5*mm;
|
|
||||||
TextInput {
|
|
||||||
id: username
|
id: username
|
||||||
anchors.fill: parent
|
x: root.fontFactor*osSettings.bigFontSize; y: 6*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm; //height: 5*mm;
|
||||||
//font.pixelSize:3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.pointSize: 16
|
placeholderText: qsTr("Nickname")
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
onEditingFinished:{
|
onEditingFinished: {
|
||||||
if (username.text.indexOf('@')>-1){
|
if (username.text.indexOf('@')>-1){
|
||||||
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),accountPage)
|
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),accountPage)
|
||||||
}
|
}
|
||||||
|
@ -184,48 +143,47 @@ Page{
|
||||||
//if (imagestore.text==filesystem.homePath+"/.friendiqa/"){imagestore.text=filesystem.homePath+"/.friendiqa/"+username.text+"/"}
|
//if (imagestore.text==filesystem.homePath+"/.friendiqa/"){imagestore.text=filesystem.homePath+"/.friendiqa/"+username.text+"/"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Button {
|
|
||||||
// x: root.width-9*mm; y: 23.5*mm; width:5*mm; height:5*mm
|
|
||||||
// text: "\uf234"
|
|
||||||
// font.pixelSize: 3*mm
|
|
||||||
// onClicked: {
|
|
||||||
// root.push("qrc:/qml/configqml/RegisterPage.qml",{url:servername.text+"/register?nickname="+username.getText(0,username.length)})
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
color: "light grey"
|
TextField {
|
||||||
x: 4*mm; y: 33.5*mm; width: root.width-6*mm; height: 5*mm;
|
|
||||||
TextInput {
|
|
||||||
id: password
|
id: password
|
||||||
anchors.fill: parent
|
x: root.fontFactor*osSettings.bigFontSize; y: 9*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm; //height: 5*mm;
|
||||||
//font.pixelSize:3*mm
|
//font.pixelSize:3*mm
|
||||||
font.pointSize: 16
|
font.pointSize: osSettings.systemFontSize
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
echoMode: TextInput.PasswordEchoOnEdit
|
echoMode: TextInput.Password
|
||||||
}
|
placeholderText: qsTr("Password")
|
||||||
|
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | Qt.ImhSensitiveData
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{color: "light grey"; x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;visible:imagestore.text!=""}
|
Text {
|
||||||
Flickable {
|
id: imagedirlabel
|
||||||
id: imagestoreFlickable
|
visible: imagestore.text!=""
|
||||||
visible:imagestore.text!="" //filesystem.homePath+"/"+username.text+"/""
|
text: qsTr("Image dir.")
|
||||||
x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;
|
font.pointSize: osSettings.systemFontSize
|
||||||
clip: true
|
x: root.fontFactor*osSettings.bigFontSize; y: 12*root.fontFactor*osSettings.bigFontSize
|
||||||
TextInput {
|
}
|
||||||
|
|
||||||
|
TextField {
|
||||||
id: imagestore
|
id: imagestore
|
||||||
width: imagestoreFlickable.width
|
x: root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize; width: root.width-17*mm; //height: 5*mm;
|
||||||
height: imagestoreFlickable.height
|
visible:imagestore.text!=""
|
||||||
//font.pixelSize:3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.pointSize: 16
|
selectByMouse: true
|
||||||
text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
|
text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
|
||||||
wrapMode: TextEdit.NoWrap
|
wrapMode: TextEdit.NoWrap
|
||||||
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
|
|
||||||
onTextChanged: imagestoredir=imagestore.text
|
onTextChanged: imagestoredir=imagestore.text
|
||||||
}
|
}
|
||||||
|
MButton {
|
||||||
|
x: root.width-3*root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
height: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
visible:imagestore.text!=""
|
||||||
|
text: "..."
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
onClicked:{imagestoreDialog.open()}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: imagestoreDialog
|
id: imagestoreDialog
|
||||||
title: "Please choose a directory"
|
title: "Please choose a directory"
|
||||||
|
@ -238,31 +196,20 @@ Page{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
|
||||||
x: root.width-9*mm; y: 43.5*mm; width: 5*mm; height: 5*mm;
|
|
||||||
visible:imagestore.text!=""
|
|
||||||
text: "..."
|
|
||||||
//font.pixelSize: 3*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
onClicked:{imagestoreDialog.open()}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BusyIndicator{
|
BusyIndicator{
|
||||||
id: accountBusy
|
id: accountBusy
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
y: 53.5*mm
|
y: 16*root.fontFactor*osSettings.bigFontSize
|
||||||
width:10*mm
|
width:10*mm
|
||||||
height: 10*mm
|
height: 10*mm
|
||||||
running: false
|
running: false
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
MButton {
|
||||||
x: 4*mm; y: 53.5*mm
|
x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize
|
||||||
height: 8*mm
|
|
||||||
text: qsTr("Confirm")
|
text: qsTr("Confirm")
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
accountBusy.running=true;
|
accountBusy.running=true;
|
||||||
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir, maxnews:"",interval: ""};
|
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir, maxnews:"",interval: ""};
|
||||||
|
@ -284,7 +231,7 @@ Page{
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (users.length==0){Service.setDefaultOptions(db);}
|
if (users.length==0){Service.setDefaultOptions(db);}
|
||||||
print("imagestore" + userconfig.imagestore + " path "+ filesystem.homePath+"/"+username.text)
|
//print("imagestore" + userconfig.imagestore + " path "+ filesystem.homePath+"/"+username.text)
|
||||||
if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/")
|
if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/")
|
||||||
{//filesystem.Directory=filesystem.homePath;
|
{//filesystem.Directory=filesystem.homePath;
|
||||||
filesystem.makePath(filesystem.homePath+"/"+username.text);
|
filesystem.makePath(filesystem.homePath+"/"+username.text);
|
||||||
|
@ -300,14 +247,15 @@ Page{
|
||||||
});
|
});
|
||||||
accountPage.users=storedUsers});
|
accountPage.users=storedUsers});
|
||||||
//reset values
|
//reset values
|
||||||
root.login=userconfig;
|
login=userconfig;
|
||||||
root.news=[];
|
news=[];
|
||||||
rootstack.currentIndex=0;
|
rootstack.currentIndex=0;
|
||||||
root.newstypeSignal("refresh");
|
newstypeSignal("refresh");
|
||||||
},"isActive",0);
|
},"isActive",0);
|
||||||
|
|
||||||
//Service.requestProfile(userconfig,db,root,function(nc){root.newContacts=nc});
|
//Service.requestProfile(userconfig,db,root,function(nc){root.newContacts=nc});
|
||||||
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
|
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
|
||||||
|
rootstackView.pop()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -316,13 +264,19 @@ Page{
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
Row{
|
||||||
Button {
|
spacing:0.5*mm
|
||||||
x: parent.width/2+2*mm; y: mm; width: 5*mm; height: 8*mm;
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: root.fontFactor*osSettings.bigFontSize
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 1*mm
|
||||||
|
MButton {
|
||||||
|
//x: parent.width/2+4*mm; y: mm;
|
||||||
|
width: 5*mm;
|
||||||
|
//height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
visible: users.length>0
|
visible: users.length>0
|
||||||
text: "-"
|
text: "-"
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
var userconfig={server: servername.text, username: username.text, password: Qt.btoa(password.text)};
|
var userconfig={server: servername.text, username: username.text, password: Qt.btoa(password.text)};
|
||||||
Service.deleteConfig(db,userconfig,function(){
|
Service.deleteConfig(db,userconfig,function(){
|
||||||
|
@ -348,12 +302,13 @@ Page{
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
|
||||||
Button {
|
MButton {
|
||||||
x: parent.width/2+8*mm; y: mm; width: 5*mm; height: 8*mm;
|
//x: parent.width/2+10*mm; y: mm; //width: 5*mm; height: 8*mm;
|
||||||
|
//height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: 5*mm;
|
||||||
visible: users.length>0
|
visible: users.length>0
|
||||||
text: "+"
|
text: "+"
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
servername.text="https://"
|
servername.text="https://"
|
||||||
servericon.visible=false;
|
servericon.visible=false;
|
||||||
|
@ -365,30 +320,26 @@ Page{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
MButton {
|
||||||
x: parent.width/2+14*mm; y: mm; width: 5*mm; height: 8*mm;
|
//x: parent.width-12*mm; y: mm; //width: 5*mm; height: 8*mm;
|
||||||
|
//height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: 5*mm;
|
||||||
text: "?"
|
text: "?"
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
root.push("qrc:/qml/configqml/InfoBox.qml");
|
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 8*mm
|
//height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 5*mm
|
width: 5*mm;
|
||||||
visible: users.length>0
|
visible: users.length>0
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: 1*mm
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 1*mm
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
//font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.pointSize: 16
|
onClicked:{rootstackView.pop()}
|
||||||
onClicked:{root.pop()}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
try{Helperjs.readData(db,"config","",function(storedUsers){
|
try{Helperjs.readData(db,"config","",function(storedUsers){
|
||||||
|
|
|
@ -43,34 +43,36 @@ Page{
|
||||||
height:root.height
|
height:root.height
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
x: 4*mm; y:13.5*mm; width: parent.width - 14*mm; height: 5*mm;
|
x: root.fontFactor*osSettings.bigFontSize; y:4*root.fontFactor*osSettings.bigFontSize;
|
||||||
color:"light grey"
|
width: parent.width - 6*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
|
color:"#F3F3F3"
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
Text{
|
Text{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
text:qsTr("Sync")
|
text:qsTr("Sync")
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
onClicked:root.push("qrc:qml/configqml/SyncConfig.qml");
|
onClicked:rootstackView.push("qrc:qml/configqml/SyncConfig.qml");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("News as")
|
text: qsTr("News as")
|
||||||
font.pixelSize:3*mm
|
font.pointSize:osSettings.systemFontSize
|
||||||
x: 4*mm; y: 20*mm
|
x: root.fontFactor*osSettings.bigFontSize; y: 8*root.fontFactor*osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
x: 4*mm; y: 23.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
|
x: root.fontFactor*osSettings.bigFontSize; y: 10*root.fontFactor*osSettings.bigFontSize;
|
||||||
color:"light grey"
|
width: newsTypeField.contentWidth+2*mm; height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
|
color:"#F3F3F3"
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
Text{
|
Text{
|
||||||
id: newsTypeField
|
id: newsTypeField
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize:3*mm
|
font.pointSize:osSettings.bigFontSize
|
||||||
text:qsTr("Conversations")
|
text:qsTr("Conversations")
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -80,14 +82,15 @@ Page{
|
||||||
}
|
}
|
||||||
Menu {
|
Menu {
|
||||||
id:newstypemenu
|
id:newstypemenu
|
||||||
|
width:8*root.fontFactor*osSettings.bigFontSize
|
||||||
MenuItem {
|
MenuItem {
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
text: qsTr("Timeline")
|
text: qsTr("Timeline")
|
||||||
onTriggered: {newsTypeField.text=qsTr("Timeline");
|
onTriggered: {newsTypeField.text=qsTr("Timeline");
|
||||||
Service.updateglobaloptions(root.db,"newsViewType","Timeline");}
|
Service.updateglobaloptions(root.db,"newsViewType","Timeline");}
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
text: qsTr("Conversations")
|
text: qsTr("Conversations")
|
||||||
onTriggered: {newsTypeField.text=qsTr("Conversations");
|
onTriggered: {newsTypeField.text=qsTr("Conversations");
|
||||||
Service.updateglobaloptions(root.db,"newsViewType","Conversations");}
|
Service.updateglobaloptions(root.db,"newsViewType","Conversations");}
|
||||||
|
@ -97,21 +100,25 @@ Page{
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Max. News")
|
text: qsTr("Max. News")
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
x: 4*mm; y:30*mm
|
x: root.fontFactor*osSettings.bigFontSize; y:14*root.fontFactor*osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider{ id: maxNews
|
Slider{ id: maxNews
|
||||||
x:19*mm; y: 33.5*mm;width: root.width/2;height:5*mm
|
x:6*root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
width: root.width/2;height:2*root.fontFactor*osSettings.bigFontSize
|
||||||
from: 0;to:2000; stepSize: 100
|
from: 0;to:2000; stepSize: 100
|
||||||
value: root.globaloptions.hasOwnProperty("max_news")?root.globaloptions.max_news:1000
|
value: root.globaloptions.hasOwnProperty("max_news")?root.globaloptions.max_news:1000
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{color: "light grey"; x: 4*mm; y: 33.5*mm; width: 9*mm; height: 5*mm;
|
Rectangle{
|
||||||
|
color: "#F3F3F3";
|
||||||
|
x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
TextEdit{id:maxNewsText;
|
TextEdit{id:maxNewsText;
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
verticalAlignment:TextEdit.AlignRight
|
verticalAlignment:TextEdit.AlignRight
|
||||||
text:maxNews.value
|
text:maxNews.value
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
@ -125,10 +132,9 @@ Page{
|
||||||
|
|
||||||
CheckBox{
|
CheckBox{
|
||||||
id: nsfwCheckbox
|
id: nsfwCheckbox
|
||||||
x: 4*mm
|
x: root.fontFactor*osSettings.bigFontSize
|
||||||
y: 43.5*mm
|
y: 20*root.fontFactor*osSettings.bigFontSize
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
//width:5*mm
|
|
||||||
text: qsTr("Hide #nsfw?")
|
text: qsTr("Hide #nsfw?")
|
||||||
checked:(globaloptions["hide_nsfw"]==1)?true:false
|
checked:(globaloptions["hide_nsfw"]==1)?true:false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -146,24 +152,24 @@ Page{
|
||||||
MButton {
|
MButton {
|
||||||
anchors.right: closeButton.left; anchors.rightMargin: mm;
|
anchors.right: closeButton.left; anchors.rightMargin: mm;
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin:root.fontFactor*osSettings.bigFontSize
|
||||||
width: 8*mm; height: 6*mm;
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
text: "?"
|
text: "?"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{
|
onClicked:{
|
||||||
root.push("qrc:/qml/configqml/InfoBox.qml");
|
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MButton{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 6*mm
|
// height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width :8*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin:root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{root.pop()}
|
onClicked:{rootstackView.pop()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,17 +33,18 @@ import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
import "qrc:/qml/genericqml"
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Rectangle{
|
Page{
|
||||||
color:"white"
|
//color:"white"
|
||||||
width:infoBoxText.contentWidth
|
// width:infoBoxText.contentWidth
|
||||||
height:infoBoxText.contentHeight
|
// height:infoBoxText.contentHeight
|
||||||
Text{id:infoBoxText
|
Text{id:infoBoxText
|
||||||
anchors.top:closeButton.bottom
|
anchors.top:closeButton.bottom
|
||||||
anchors.topMargin: mm
|
anchors.topMargin: mm
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
width: root.width-mm
|
width: root.width-mm
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
text: "<b>Friendiqa v0.5.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
|
text: "<b>Friendiqa v0.6 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
|
||||||
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
|
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
|
||||||
"Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
|
"Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
|
||||||
"Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+
|
"Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+
|
||||||
|
@ -56,16 +57,14 @@ Rectangle{
|
||||||
onLinkActivated:{
|
onLinkActivated:{
|
||||||
Qt.openUrlExternally(link)}
|
Qt.openUrlExternally(link)}
|
||||||
}
|
}
|
||||||
Button{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{root.pop()}
|
onClicked:{rootstackView.pop()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
113
source-linux/qml/configqml/LeftDrawerScrollview.qml
Normal file
113
source-linux/qml/configqml/LeftDrawerScrollview.qml
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
import "qrc:/js/service.js" as Service
|
||||||
|
|
||||||
|
ScrollView{
|
||||||
|
id:leftDrawerScrollviewId
|
||||||
|
clip: true
|
||||||
|
width:parent.width-mm
|
||||||
|
height: parent.height
|
||||||
|
contentHeight: leftDrawerColumn.height
|
||||||
|
property string currentnewstabstatus:root.globaloptions.hasOwnProperty("newsViewType")?root.globaloptions.newsViewType:"Conversations";
|
||||||
|
|
||||||
|
Column{
|
||||||
|
id:leftDrawerColumn
|
||||||
|
x:mm
|
||||||
|
y:0.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width-2*mm
|
||||||
|
height: 4*root.fontFactor*osSettings.bigFontSize
|
||||||
|
spacing: 0.7*root.fontFactor*osSettings.bigFontSize
|
||||||
|
Label{
|
||||||
|
width:implicitWidth
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: "\uf085 "+ qsTr("Settings")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{rootstackView.push("qrc:qml/configqml/ConfigPage.qml");
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{y: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:implicitWidth
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: "\uf2bb " + qsTr("Accounts")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{rootstackView.push("qrc:qml/configqml/AccountPage.qml");
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{y: 4*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:implicitWidth
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: "\uf08b " +qsTr("Quit")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
Service.cleanNews(root.db,function(){
|
||||||
|
Service.cleanHashtags(root.db,function(){
|
||||||
|
Service.cleanContacts(root.login,root.db,function(){
|
||||||
|
Qt.quit()})
|
||||||
|
})})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted:{
|
||||||
|
Service.readAllLogins(db,function(accounts){
|
||||||
|
if (accounts.length>0 && bar.currentIndex==0){
|
||||||
|
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*13*root.fontFactor*osSettings.bigFontSize
|
||||||
|
for(var i = 0; i < accounts.length; i++) {
|
||||||
|
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml");
|
||||||
|
var accountQml = accountComponent.createObject(leftDrawerColumn,{
|
||||||
|
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*13*root.fontFactor*osSettings.bigFontSize,
|
||||||
|
"currentnewstabstatus":currentnewstabstatus,
|
||||||
|
"account":accounts[i]});
|
||||||
|
}
|
||||||
|
}else if(accounts.length>0 && bar.currentIndex==1){
|
||||||
|
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*6.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
for(var i = 0; i < accounts.length; i++) {
|
||||||
|
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml");
|
||||||
|
var accountQml = accountComponent.createObject(leftDrawerColumn,{
|
||||||
|
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*6.5*root.fontFactor*osSettings.bigFontSize,
|
||||||
|
"account":accounts[i]});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
}
|
|
@ -37,6 +37,8 @@ QtObject{
|
||||||
property int backKey: Qt.Key_Back
|
property int backKey: Qt.Key_Back
|
||||||
//property string attachImageDir:filesystem.cameraPath+"/"
|
//property string attachImageDir:filesystem.cameraPath+"/"
|
||||||
property string osType: "Android"
|
property string osType: "Android"
|
||||||
|
property int systemFontSize: root.font.pointSize*1.1
|
||||||
|
property int bigFontSize: systemFontSize*1.3
|
||||||
property string imagePickQml: "ImagePicker"
|
property string imagePickQml: "ImagePicker"
|
||||||
property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||||
imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+
|
imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+
|
||||||
|
|
|
@ -32,10 +32,12 @@
|
||||||
import QtQuick.Window 2.0
|
import QtQuick.Window 2.0
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
QtObject{
|
QtObject{
|
||||||
property real appWidth: Screen.desktopAvailableWidth/3
|
property real appWidth: Screen.desktopAvailableWidth/4*3
|
||||||
property real appHeight: Screen.desktopAvailableHeight/3*2
|
property real appHeight: Screen.desktopAvailableHeight/4*3
|
||||||
property int backKey: Qt.Key_Escape
|
property int backKey: Qt.Key_Escape
|
||||||
property string osType: "Linux"
|
property string osType: "Linux"
|
||||||
|
property int systemFontSize: root.font.pointSize*1.1
|
||||||
|
property int bigFontSize: systemFontSize*1.5
|
||||||
//property string attachImageDir:filesystem.homePath+"/Pictures/"
|
//property string attachImageDir:filesystem.homePath+"/Pictures/"
|
||||||
property string imagePickQml: "ImagePickerLinux"
|
property string imagePickQml: "ImagePickerLinux"
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,7 @@ import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
color:"white"
|
color:"white"
|
||||||
//border.color: "light grey"
|
|
||||||
property alias url:htmlview.url
|
property alias url:htmlview.url
|
||||||
// width:root.width-5*mm
|
|
||||||
// height:root.height-12*mm
|
|
||||||
|
|
||||||
WebView {id:htmlview;
|
WebView {id:htmlview;
|
||||||
height:parent.height-7*mm
|
height:parent.height-7*mm
|
||||||
|
@ -55,13 +52,13 @@ Rectangle{
|
||||||
}
|
}
|
||||||
Button{
|
Button{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height:6*mm
|
height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{root.pop()}
|
onClicked:{root.pop()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,22 +39,22 @@ Rectangle{
|
||||||
color: "#EEEEEE" //Material.Grey
|
color: "#EEEEEE" //Material.Grey
|
||||||
property string adapter: ""
|
property string adapter: ""
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 12*mm
|
height: 4*root.fontFactor*osSettings.bigFontSize
|
||||||
Label{
|
Label{
|
||||||
x: mm
|
x: mm
|
||||||
y: 0.5*mm
|
y: 0.5*mm
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text: qsTr(adapter)
|
text: qsTr(adapter)
|
||||||
}
|
}
|
||||||
CheckBox{
|
CheckBox{
|
||||||
id: syncCheckbox
|
id: syncCheckbox
|
||||||
x: mm
|
x: mm
|
||||||
y: 5*mm
|
y: root.fontFactor*osSettings.bigFontSize
|
||||||
width:20*mm
|
width: 10*root.fontFactor*osSettings.bigFontSize
|
||||||
checked:(globaloptions["sync_"+adapter]==1)?true:false
|
checked:(globaloptions["sync_"+adapter]==1)?true:false
|
||||||
//style: CheckBoxStyle {
|
//style: CheckBoxStyle {
|
||||||
text: qsTr("sync")
|
text: qsTr("sync")
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toggle();
|
toggle();
|
||||||
if(syncCheckbox.checked==true){
|
if(syncCheckbox.checked==true){
|
||||||
|
@ -67,13 +67,13 @@ Rectangle{
|
||||||
}
|
}
|
||||||
CheckBox{
|
CheckBox{
|
||||||
id: notifyCheckbox
|
id: notifyCheckbox
|
||||||
x:25*mm
|
x: 10*root.fontFactor*osSettings.bigFontSize
|
||||||
y: 5*mm
|
y: root.fontFactor*osSettings.bigFontSize
|
||||||
width:25*mm
|
width: 10*root.fontFactor*osSettings.bigFontSize
|
||||||
enabled: adapter!="Notifications"
|
enabled: adapter!="Notifications"
|
||||||
checked:(globaloptions["notify_"+adapter]==1)?true:false
|
checked:(globaloptions["notify_"+adapter]==1)?true:false
|
||||||
text: qsTr("notify")
|
text: qsTr("notify")
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toggle();
|
toggle();
|
||||||
if(notifyCheckbox.checked==true){
|
if(notifyCheckbox.checked==true){
|
||||||
|
|
|
@ -43,22 +43,25 @@ Rectangle{
|
||||||
//height:root.height
|
//height:root.height
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Sync Interval (0=None)")
|
text: qsTr("Sync Interval (0=None)")
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
//visible: false
|
//visible: false
|
||||||
x: 4*mm; y: 10*mm; //width:35*mm;wrapMode: Text.Wrap
|
x: root.fontFactor*osSettings.bigFontSize; y: root.fontFactor*osSettings.bigFontSize; //width:35*mm;wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider{ id: messageIntervalSlider
|
Slider{ id: messageIntervalSlider
|
||||||
x:22*mm; y: 13.5*mm;width: root.width/2;height:5*mm
|
x:8*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
width: root.width-10*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
height:2*root.fontFactor*osSettings.bigFontSize
|
||||||
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
|
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
|
||||||
from: 0;to:120; stepSize: 15
|
from: 0;to:120; stepSize: 15
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
x: 4*mm; y: 13.5*mm; width: 9*mm; height: 5*mm;
|
x: root.fontFactor*osSettings.bigFontSize; y:4*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
TextEdit{
|
TextEdit{
|
||||||
id: messageIntervalField
|
id: messageIntervalField
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize:3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
verticalAlignment:TextEdit.AlignRight
|
verticalAlignment:TextEdit.AlignRight
|
||||||
text:messageIntervalSlider.value
|
text:messageIntervalSlider.value
|
||||||
focus: true
|
focus: true
|
||||||
|
@ -66,6 +69,7 @@ Rectangle{
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
Service.updateglobaloptions(root.db,"syncinterval",text);
|
Service.updateglobaloptions(root.db,"syncinterval",text);
|
||||||
if(osSettings.osType=="Android"){
|
if(osSettings.osType=="Android"){
|
||||||
|
//print("setalarm")
|
||||||
alarm.setAlarm(text);
|
alarm.setAlarm(text);
|
||||||
} else if(osSettings.osType=="Linux" && text !=0){
|
} else if(osSettings.osType=="Linux" && text !=0){
|
||||||
root.updateSyncinterval(parseInt(text))
|
root.updateSyncinterval(parseInt(text))
|
||||||
|
@ -73,14 +77,16 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text{x: 14*mm; y: 13.5*mm; width: 5*mm; height: 5*mm;
|
Text{x: 6*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
|
||||||
font.pixelSize:3*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize; height: 1.5*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
text:qsTr("Min.")
|
text:qsTr("Min.")
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView{
|
ScrollView{
|
||||||
width: root.width
|
width: root.width
|
||||||
height: root.height - 25*mm;y:22*mm
|
height: root.height - 10*root.fontFactor*osSettings.bigFontSize;
|
||||||
|
y:7*root.fontFactor*osSettings.bigFontSize
|
||||||
clip:true
|
clip:true
|
||||||
Column{
|
Column{
|
||||||
//height: implicitHeight
|
//height: implicitHeight
|
||||||
|
@ -92,19 +98,19 @@ Rectangle{
|
||||||
SyncComponent{ adapter:"DirectMessages"}
|
SyncComponent{ adapter:"DirectMessages"}
|
||||||
SyncComponent{ adapter:"Notifications"}
|
SyncComponent{ adapter:"Notifications"}
|
||||||
SyncComponent{ adapter: "Events"}
|
SyncComponent{ adapter: "Events"}
|
||||||
|
SyncComponent{adapter: "FriendRequests"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: osSettings.bigFontSize
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
height: 6*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
width: 8*mm
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{root.pop()}
|
onClicked:{rootstackView.pop()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ Rectangle {
|
||||||
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
anchors.left: contactImage.right
|
anchors.left: contactImage.right
|
||||||
anchors.margins: 1*mm
|
anchors.margins: 1*mm
|
||||||
text:Qt.atob(contact.name)
|
text:Qt.atob(contact.name)
|
||||||
|
@ -91,7 +91,7 @@ Rectangle {
|
||||||
width: 5*mm
|
width: 5*mm
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
color: "green"
|
color: "green"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -112,8 +112,6 @@ Rectangle {
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
height:6* mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
96
source-linux/qml/contactqml/ContactsListTab.qml
Normal file
96
source-linux/qml/contactqml/ContactsListTab.qml
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.11
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import QtQuick.Layouts 1.11
|
||||||
|
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"
|
||||||
|
|
||||||
|
Item{
|
||||||
|
id: contactsGridTab
|
||||||
|
Layout.fillWidth:true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
function showContacts(contact){
|
||||||
|
try {contactsModel.clear()} catch(e){print(e)};
|
||||||
|
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
||||||
|
for (var j=0;j<contactsobject.length;j++){
|
||||||
|
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
||||||
|
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
||||||
|
contactsModel.append({"contact":contactsobject[j]});
|
||||||
|
}
|
||||||
|
},"isFriend",0,"screen_name ASC");
|
||||||
|
}
|
||||||
|
MButton {
|
||||||
|
id: cleanButton
|
||||||
|
text: "\uf021"
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: mm
|
||||||
|
anchors.right: parent.right
|
||||||
|
onClicked: {
|
||||||
|
Service.cleanContacts(root.login,root.db,function(){
|
||||||
|
try {contactsModel.clear()} catch(e){print(e)};
|
||||||
|
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
||||||
|
for (var j=0;j<contactsobject.length;j++){
|
||||||
|
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
||||||
|
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
||||||
|
contactsModel.append({"contact":contactsobject[j]});
|
||||||
|
}
|
||||||
|
},"isFriend",0,"screen_name ASC");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ListView {
|
||||||
|
id: contactsView
|
||||||
|
x:mm
|
||||||
|
y:cleanButton.height+2*mm
|
||||||
|
width:contactsGridTab.width-2*mm
|
||||||
|
height:contactsGridTab.height-cleanButton.height-2*mm
|
||||||
|
spacing: 2
|
||||||
|
clip: true
|
||||||
|
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
||||||
|
//add: Transition {
|
||||||
|
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||||
|
// }
|
||||||
|
model: contactsModel
|
||||||
|
delegate: ContactComponent { }
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{id: contactsModel}
|
||||||
|
Component.onCompleted: {
|
||||||
|
friendsTabView.contactsSignal.connect(showContacts);
|
||||||
|
showContacts()
|
||||||
|
}
|
||||||
|
}
|
159
source-linux/qml/contactqml/FriendsListTab.qml
Normal file
159
source-linux/qml/contactqml/FriendsListTab.qml
Normal file
|
@ -0,0 +1,159 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.11
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import QtQuick.Layouts 1.11
|
||||||
|
import QtQuick.LocalStorage 2.0
|
||||||
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
|
import "qrc:/js/news.js" as Newsjs
|
||||||
|
import "qrc:/qml/contactqml"
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
Item{
|
||||||
|
id: friendsGridTab
|
||||||
|
Layout.fillWidth:true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
property int currentContact: 0
|
||||||
|
|
||||||
|
function showFriends(contact){
|
||||||
|
try {friendsModel.clear()} catch(e){print(e)};
|
||||||
|
Helperjs.readData(root.db,"friendshiprequests",login.username,function(friendrequestsobject){
|
||||||
|
for (var i=0;i<friendrequestsobject.length;i++){//print(Qt.atob(friendrequestsobject[i].note));
|
||||||
|
if (friendrequestsobject[i].note!=null){
|
||||||
|
friendrequestsobject[i].description=Qt.atob(friendrequestsobject[i].note);}
|
||||||
|
else{friendrequestsobject[i].description=""}
|
||||||
|
friendrequestsobject[i].name=Qt.atob(friendrequestsobject[i].display_name);
|
||||||
|
friendrequestsobject[i].screen_name=friendrequestsobject[i].usernamef;
|
||||||
|
friendrequestsobject[i].location="";
|
||||||
|
friendrequestsobject[i].profile_image=friendrequestsobject[i].avatar_static;
|
||||||
|
friendrequestsobject[i].profile_image_url=friendrequestsobject[i].avatar;
|
||||||
|
friendrequestsobject[i].curIndex=friendsModel.count;
|
||||||
|
friendsModel.append({"contact":friendrequestsobject[i],"contactType":qsTr("Friend Requests")});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
|
||||||
|
for (var i=0;i<friendsobject.length;i++){
|
||||||
|
if(friendsobject[i].description!=""){
|
||||||
|
friendsobject[i].description=Qt.atob(friendsobject[i].description);}
|
||||||
|
friendsobject[i].name=Qt.atob(friendsobject[i].name);
|
||||||
|
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
|
||||||
|
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
|
||||||
|
}
|
||||||
|
friendsModel.append({"contact":friendsobject[i],"contactType":qsTr("Friends")});
|
||||||
|
}
|
||||||
|
},"isFriend",1,"screen_name ASC");
|
||||||
|
}
|
||||||
|
Connections{
|
||||||
|
target:xhr
|
||||||
|
function onDownloaded(type,url,filename,i){
|
||||||
|
if(type=="contactlist"){
|
||||||
|
//print(url+" "+filename+" "+i)
|
||||||
|
friendsGridTab.currentContact=i+1;
|
||||||
|
if(friendsGridTab.currentContact==root.newContacts.length){
|
||||||
|
friendsGridTab.showFriends(root.login.username)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MButton {
|
||||||
|
id: updateFriendsButton
|
||||||
|
text: "\uf021"
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: mm
|
||||||
|
anchors.right: parent.right
|
||||||
|
onClicked: {
|
||||||
|
try {friendsModel.clear()} catch(e){print(e)};
|
||||||
|
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){});
|
||||||
|
updatenews.setDatabase();
|
||||||
|
updatenews.login();
|
||||||
|
updatenews.friendrequests();
|
||||||
|
//root.contactLoadType="friends";
|
||||||
|
Newsjs.requestFriends(root.login,db,root,function(nc){
|
||||||
|
root.newContacts=nc
|
||||||
|
root.onNewContactsChanged(nc);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ProgressBar{
|
||||||
|
id: newContactsProgress
|
||||||
|
width: 15*mm
|
||||||
|
height: updateFriendsButton.height
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right:updateFriendsButton.left
|
||||||
|
anchors.rightMargin:mm
|
||||||
|
visible: (friendsGridTab.currentContact!=(root.newContacts.length))?true:false
|
||||||
|
value: friendsGridTab.currentContact/root.newContacts.length
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: sectionHeading
|
||||||
|
Rectangle {
|
||||||
|
width: friendsView.width
|
||||||
|
height: childrenRect.height
|
||||||
|
//color: "lightsteelblue"
|
||||||
|
required property string section
|
||||||
|
Text {
|
||||||
|
text: parent.section
|
||||||
|
font.bold: true
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//GridView {
|
||||||
|
ListView{
|
||||||
|
id: friendsView
|
||||||
|
x:mm
|
||||||
|
y:updateFriendsButton.height+mm
|
||||||
|
width:friendsGridTab.width-2*mm
|
||||||
|
height:friendsGridTab.height-(updateFriendsButton.height+5*mm)
|
||||||
|
clip: true
|
||||||
|
spacing: 2
|
||||||
|
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
||||||
|
//add: Transition {
|
||||||
|
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||||
|
// }
|
||||||
|
model: friendsModel
|
||||||
|
delegate: ContactComponent { }
|
||||||
|
section.property: "contactType"
|
||||||
|
section.criteria: ViewSection.FullString
|
||||||
|
section.delegate: sectionHeading
|
||||||
|
}
|
||||||
|
ListModel{id:friendsModel}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.friendsSignal.connect(showFriends);
|
||||||
|
friendsTabView.contactsSignal.connect(showFriends);
|
||||||
|
showFriends(root.login.username);
|
||||||
|
root.newContacts=[]
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
import QtQuick 2.11
|
import QtQuick 2.11
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
//import QtQuick.Controls.Styles 1.4
|
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
import QtQuick.LocalStorage 2.0
|
import QtQuick.LocalStorage 2.0
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
|
@ -45,60 +44,72 @@ Rectangle {
|
||||||
color: "white"
|
color: "white"
|
||||||
|
|
||||||
function showContactdetails(contact){
|
function showContactdetails(contact){
|
||||||
rootstack.currentIndex=0;
|
// rootstack.currentIndex=0;
|
||||||
bar.currentIndex=0;
|
// bar.currentIndex=0;
|
||||||
root.contactdetailsSignal(contact)
|
root.contactdetailsSignal(contact)
|
||||||
}
|
}
|
||||||
|
|
||||||
function showProfile(callback){
|
BlueButton{
|
||||||
var profile=({});
|
x:mm
|
||||||
Helperjs.readData(db,"profiles",login.username,function(profileobject){
|
y:mm
|
||||||
var profilearray=[];
|
z:2
|
||||||
for (var i in profileobject){
|
visible: !wideScreen
|
||||||
profilearray.push(JSON.parse(Qt.atob(profileobject[i].profiledata)));
|
fontColor: "grey"
|
||||||
}
|
border.color: "transparent"
|
||||||
profile.profiles=profilearray;
|
text: "\uf0c9"
|
||||||
});
|
font.pointSize: osSettings.bigFontSize
|
||||||
Helperjs.readData(db,"contacts",login.username,function(owner){
|
onClicked:{
|
||||||
profile.friendica_owner=owner[0];
|
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
|
||||||
},"isFriend",2);
|
|
||||||
callback(profile)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TabBar {
|
TabBar {
|
||||||
id: friendsbar
|
id: friendsbar
|
||||||
width: parent.width
|
width: osSettings.osType=="Android"?parent.width-2*osSettings.bigFontSize:parent.width
|
||||||
height: 9*mm
|
height: 9*mm
|
||||||
|
x: osSettings.osType=="Android"?2*osSettings.bigFontSize:0
|
||||||
|
visible: !wideScreen
|
||||||
position:TabBar.Header
|
position:TabBar.Header
|
||||||
currentIndex: 1
|
currentIndex: 1
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Me")
|
text: qsTr("Me")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
height: 7*mm
|
height: 7*mm
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Friends")
|
text: qsTr("Friends")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
height: 7*mm
|
height: 7*mm
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Contacts")
|
text: qsTr("Contacts")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
height: 7*mm
|
height: 7*mm
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Groups")
|
text: qsTr("Groups")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
height: 7*mm
|
height: 7*mm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LeftDrawerLinux{
|
||||||
|
id:leftDrawer
|
||||||
|
visible: wideScreen&&rootstackView.depth<2
|
||||||
|
width: visible?osSettings.systemFontSize*15:0
|
||||||
|
height: root.height-bar.height
|
||||||
|
}
|
||||||
|
|
||||||
|
LeftDrawerAndroid{
|
||||||
|
id: leftDrawerAndroid
|
||||||
|
}
|
||||||
|
|
||||||
StackLayout{
|
StackLayout{
|
||||||
id:friendsTabView
|
id:friendsTabView
|
||||||
//anchors.fill: parent
|
//anchors.fill: parent
|
||||||
x:mm
|
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm//newstabitem.width/3*2:newstabitem.width
|
||||||
y:10*mm
|
x: leftDrawer.width
|
||||||
width: parent.width-2*mm
|
y: friendsbar.visible?friendsbar.height:0
|
||||||
height: parent.height-10*mm
|
height: friendsbar.visible?parent.height-friendsbar.height-mm:parent.height-mm
|
||||||
currentIndex: friendsbar.currentIndex
|
currentIndex: friendsbar.currentIndex
|
||||||
signal contactsSignal(var contact)
|
signal contactsSignal(var contact)
|
||||||
signal groupsSignal(var username)
|
signal groupsSignal(var username)
|
||||||
|
@ -113,267 +124,26 @@ Rectangle {
|
||||||
else if (currentIndex==3){groupsSignal(root.login.username)}
|
else if (currentIndex==3){groupsSignal(root.login.username)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader{
|
||||||
Item{
|
id: profileLoader
|
||||||
id:profileGridTab
|
source:(friendsTabView.currentIndex==0)? "qrc:/qml/contactqml/ProfileTab.qml":""
|
||||||
Layout.fillWidth:true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Component.onCompleted:{
|
|
||||||
showProfile(function(profile){
|
|
||||||
var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
|
|
||||||
var profilecomp = component.createObject(profileGridTab,{"profile": profile});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Loader{
|
||||||
id: friendsGridTab
|
id: friendsListLoader
|
||||||
Layout.fillWidth:true
|
source:(friendsTabView.currentIndex==1)? "qrc:/qml/contactqml/FriendsListTab.qml":""
|
||||||
Layout.fillHeight: true
|
|
||||||
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;i<friendsobject.length;i++){
|
|
||||||
friendsobject[i].description=Qt.atob(friendsobject[i].description);
|
|
||||||
friendsobject[i].name=Qt.atob(friendsobject[i].name);
|
|
||||||
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
|
|
||||||
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
|
|
||||||
}
|
|
||||||
friendsModel.append({"contact":friendsobject[i]});
|
|
||||||
}
|
|
||||||
},"isFriend",1,"screen_name ASC");
|
|
||||||
}
|
|
||||||
Connections{
|
|
||||||
target:xhr
|
|
||||||
function onDownloaded(type,url,filename,i){
|
|
||||||
if(type=="contactlist"){
|
|
||||||
//print(url+" "+filename+" "+i)
|
|
||||||
friendsGridTab.currentContact=i+1;
|
|
||||||
if(friendsGridTab.currentContact==root.newContacts.length){
|
|
||||||
friendsGridTab.showFriends(root.login.username)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MButton {
|
|
||||||
id: updateFriendsButton
|
|
||||||
text: "\uf021"
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: mm
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
onClicked: {
|
|
||||||
try {friendsModel.clear()} catch(e){print(e)};
|
|
||||||
//root.contactLoadType="friends";
|
|
||||||
Newsjs.requestFriends(root.login,db,root,function(nc){
|
|
||||||
root.newContacts=nc
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressBar{
|
Loader{
|
||||||
id: newContactsProgress
|
id: contactsListLoader
|
||||||
width: 15*mm
|
source:(friendsTabView.currentIndex==2)? "qrc:/qml/contactqml/ContactsListTab.qml":""
|
||||||
height: updateFriendsButton.height
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.right:updateFriendsButton.left
|
|
||||||
anchors.rightMargin:mm
|
|
||||||
visible: (friendsGridTab.currentContact!=(root.newContacts.length))?true:false
|
|
||||||
value: friendsGridTab.currentContact/root.newContacts.length
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//GridView {
|
Loader{
|
||||||
ListView{
|
id: groupsListLoader
|
||||||
id: friendsView
|
source:(friendsTabView.currentIndex==3)? "qrc:/qml/contactqml/GroupsListTab.qml":""
|
||||||
x:mm
|
|
||||||
y:updateFriendsButton.height+2*mm
|
|
||||||
width:friendsGridTab.width-2*mm
|
|
||||||
height:friendsGridTab.height-updateFriendsButton.height-2*mm
|
|
||||||
clip: true
|
|
||||||
spacing: 2
|
|
||||||
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
|
||||||
//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=[]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
|
||||||
id: contactsGridTab
|
|
||||||
Layout.fillWidth:true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
function showContacts(contact){
|
|
||||||
try {contactsModel.clear()} catch(e){print(e)};
|
|
||||||
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
|
||||||
for (var j=0;j<contactsobject.length;j++){
|
|
||||||
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
|
||||||
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
|
||||||
contactsModel.append({"contact":contactsobject[j]});
|
|
||||||
}
|
|
||||||
},"isFriend",0,"screen_name ASC");
|
|
||||||
}
|
|
||||||
MButton {
|
|
||||||
id: cleanButton
|
|
||||||
text: "\uf021"
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: mm
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
onClicked: {
|
|
||||||
Service.cleanContacts(root.login,root.db,function(){
|
|
||||||
try {contactsModel.clear()} catch(e){print(e)};
|
|
||||||
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
|
||||||
for (var j=0;j<contactsobject.length;j++){
|
|
||||||
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
|
||||||
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
|
||||||
contactsModel.append({"contact":contactsobject[j]});
|
|
||||||
}
|
|
||||||
},"isFriend",0,"screen_name ASC");
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListView {
|
|
||||||
id: contactsView
|
|
||||||
x:mm
|
|
||||||
y:cleanButton.height+2*mm
|
|
||||||
width:contactsGridTab.width-2*mm
|
|
||||||
height:contactsGridTab.height-cleanButton.height-2*mm
|
|
||||||
spacing: 2
|
|
||||||
clip: true
|
|
||||||
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
|
||||||
//add: Transition {
|
|
||||||
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
|
||||||
// }
|
|
||||||
model: contactsModel
|
|
||||||
delegate: ContactComponent { }
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{id: contactsModel}
|
|
||||||
Component.onCompleted: {
|
|
||||||
friendsTabView.contactsSignal.connect(showContacts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Item{
|
|
||||||
id: groupsGridTab
|
|
||||||
Layout.fillWidth:true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
function showGroups(username){
|
|
||||||
try {groupsModel.clear()} catch(e){print(e)};
|
|
||||||
Helperjs.readData(db, "groups",root.login.username,function(groupsobject){
|
|
||||||
for (var j=0;j<groupsobject.length;j++){
|
|
||||||
groupsModel.append({"group":groupsobject[j]});
|
|
||||||
}})}
|
|
||||||
|
|
||||||
function updateGroup(login,database,group){
|
|
||||||
// update groups
|
|
||||||
//var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
|
||||||
//var groupdata={"gid":group.id,"name":group.name,"user":group.user};
|
|
||||||
//print("Groupdata "+JSON.stringify(group));
|
|
||||||
var api="";
|
|
||||||
if (group.new){api="/api/friendica/group_create.json?name="+group.name}else{api="/api/friendica/group_update.json?gid="+group.id}
|
|
||||||
xhr.url= login.server + api;
|
|
||||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
|
||||||
xhr.clearParams();
|
|
||||||
xhr.setParam("gid",group.id);
|
|
||||||
xhr.setParam("name",group.name);
|
|
||||||
xhr.setParam("user", group.user);
|
|
||||||
xhr.setParam("json",group);
|
|
||||||
xhr.post();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections{
|
|
||||||
target:xhr
|
|
||||||
function onError(data,url,api,code){print(data)}//if (data=="image"){Helperjs.showMessage()}}
|
|
||||||
function onSuccess(data,api){
|
|
||||||
Newsjs.requestGroups(root.login,root.db,root,function(){
|
|
||||||
showGroups(root.login.username)});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MButton {
|
|
||||||
id: updateGroupsButton
|
|
||||||
text: "\uf021"
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: mm
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: mm
|
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
onClicked: {
|
|
||||||
Newsjs.requestGroups(root.login,root.db,root,function(){
|
|
||||||
groupsGridTab.showGroups(root.login.username)})}
|
|
||||||
}
|
|
||||||
// BlueButton {
|
|
||||||
// id: newGroupButton
|
|
||||||
// text: "\uf234"
|
|
||||||
// anchors.top: parent.top
|
|
||||||
// anchors.topMargin: mm
|
|
||||||
// anchors.right: updateGroupsButton.left
|
|
||||||
// anchors.rightMargin: mm
|
|
||||||
// onClicked: {
|
|
||||||
// groupsModel.append({"group": {"new":true}});
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
GridView {
|
|
||||||
id: groupsView
|
|
||||||
x:mm
|
|
||||||
y:updateGroupsButton.height+2*mm
|
|
||||||
width:groupsGridTab.width-2*mm
|
|
||||||
height:groupsGridTab.height-updateGroupsButton.height-2*mm
|
|
||||||
clip: true
|
|
||||||
cellHeight: 16*mm
|
|
||||||
cellWidth: 17*mm
|
|
||||||
add: Transition {
|
|
||||||
NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
|
||||||
}
|
|
||||||
model: groupsModel
|
|
||||||
delegate: GroupComponent {}
|
|
||||||
//footer:groupFooter
|
|
||||||
}
|
|
||||||
ListModel{
|
|
||||||
id: groupsModel
|
|
||||||
}
|
|
||||||
// Component{
|
|
||||||
// id: groupFooter
|
|
||||||
// Image{
|
|
||||||
// id: footerImage
|
|
||||||
// width: 15*mm
|
|
||||||
// height: 15*mm
|
|
||||||
// fillMode: Image.PreserveAspectFit
|
|
||||||
// source:"qrc:/images/addImage.png"
|
|
||||||
// MouseArea{
|
|
||||||
// anchors.fill: parent
|
|
||||||
// onClicked:{
|
|
||||||
// print("new group")
|
|
||||||
// var component = Qt.createComponent("qrc:/qml/contactqml/GroupComponent.qml");
|
|
||||||
// var imagedialog = component.createObject(groupsView,{"group": []});}
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Component.onCompleted: {
|
|
||||||
friendsTabView.groupsSignal.connect(showGroups);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
//root.contactdetailsSignal.connect(showContactdetails);
|
//root.contactdetailsSignal.connect(showContactdetails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: groupComponent
|
id: groupComponent
|
||||||
|
height: 5*root.fontFactor*osSettings.bigFontSize//8*mm
|
||||||
|
width: groupComponent.ListView.view.width
|
||||||
property var groupmembers:[]
|
property var groupmembers:[]
|
||||||
//property bool newGroup: false
|
//property bool newGroup: false
|
||||||
function groupModelAppend(groupcontacts,callback){
|
function groupModelAppend(groupcontacts,callback){
|
||||||
|
@ -47,49 +49,47 @@ Item {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
width: 16*mm
|
x:0.5*mm
|
||||||
height: 15*mm
|
y:0.5*mm
|
||||||
|
width:parent.width-mm
|
||||||
|
height: parent.height-mm
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
border.color: "grey"
|
border.color: "grey"
|
||||||
color:"white"
|
color:"white"
|
||||||
|
|
||||||
Image {
|
// Image {
|
||||||
id: photoImage
|
// id: photoImage
|
||||||
x:1
|
// x:1
|
||||||
y:1
|
// y:1
|
||||||
width: 10*mm
|
// width: 10*mm
|
||||||
height:10*mm
|
// height:10*mm
|
||||||
source:"qrc:/images/defaultcontact.jpg"
|
// source:"qrc:/images/defaultcontact.jpg"
|
||||||
}
|
// }
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:namelabelRect
|
id:namelabelRect
|
||||||
x: 1
|
x: 1
|
||||||
|
y: 1
|
||||||
width: wrapper.width-2
|
width: wrapper.width-2
|
||||||
height: 3.5*mm
|
height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.top: photoImage.bottom
|
//border.color: "light grey"
|
||||||
border.color: "light grey"
|
|
||||||
TextInput {
|
TextInput {
|
||||||
id: namelabel
|
id: namelabel
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
readOnly: true
|
readOnly: true
|
||||||
text: group.new?"":group.groupname
|
text: group.new?"":group.groupname
|
||||||
color: "#303030"
|
color: "#303030"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id: closeButton
|
id: closeButton
|
||||||
visible: false
|
visible: false
|
||||||
width: 8*mm
|
anchors.right: parent.right
|
||||||
height: 6*mm
|
|
||||||
anchors.left: infobutton.right
|
|
||||||
anchors.margins: mm
|
anchors.margins: mm
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{groupComponent.state="";
|
onClicked:{groupComponent.state="";
|
||||||
if (group.new){groupsModel.remove(index)}
|
if (group.new){groupsModel.remove(index)}
|
||||||
}
|
}
|
||||||
|
@ -97,17 +97,14 @@ Item {
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id:infobutton
|
id:infobutton
|
||||||
width: 4*mm
|
|
||||||
height: 6*mm
|
|
||||||
|
|
||||||
//color:"transparent"
|
|
||||||
text:"?"
|
text:"?"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
anchors.left: photoImage.right
|
anchors.right: parent.right
|
||||||
anchors.leftMargin: mm
|
anchors.rightMargin: mm
|
||||||
anchors.topMargin: mm
|
anchors.topMargin: mm
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
onClicked:{
|
onClicked:{
|
||||||
|
groupComponent.state="large";
|
||||||
//if(group.new){
|
//if(group.new){
|
||||||
Helperjs.readField("members",root.db,"groups",root.login.username,function(groups){
|
Helperjs.readField("members",root.db,"groups",root.login.username,function(groups){
|
||||||
try {groupModel.clear()}catch (e){print(e)}
|
try {groupModel.clear()}catch (e){print(e)}
|
||||||
|
@ -124,15 +121,31 @@ Item {
|
||||||
} //catch(e){}
|
} //catch(e){}
|
||||||
},"groupname",group.groupname);
|
},"groupname",group.groupname);
|
||||||
//}
|
//}
|
||||||
groupComponent.state="large"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: detailsrectangle
|
id: detailsrectangle
|
||||||
anchors.top: namelabelRect.bottom
|
anchors.top: namelabelRect.bottom
|
||||||
anchors.topMargin: mm
|
//anchors.topMargin: mm
|
||||||
opacity: 0
|
x:mm
|
||||||
|
width: parent.width-2*mm
|
||||||
|
height:parent.height -(3*root.fontFactor*osSettings.bigFontSize+mm)
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
ListView{
|
||||||
|
id: groupListView
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: mm
|
||||||
|
clip: true
|
||||||
|
spacing: 2
|
||||||
|
model: groupModel
|
||||||
|
delegate: ContactComponent { }// groupMember
|
||||||
|
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{id: groupModel}
|
||||||
|
|
||||||
// Component {
|
// Component {
|
||||||
// id:groupMember
|
// id:groupMember
|
||||||
|
@ -182,27 +195,13 @@ Item {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ListView{
|
|
||||||
id: groupListView
|
|
||||||
x:1
|
|
||||||
//anchors.top: parent.top
|
|
||||||
width: root.width-10*mm
|
|
||||||
height:groupsView.height - 24*mm
|
|
||||||
clip: true
|
|
||||||
spacing: 2
|
|
||||||
model: groupModel
|
|
||||||
delegate: ContactComponent { }// groupMember
|
|
||||||
function processContactSelection(contactobject){showContactdetails(contactobject)}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{id: groupModel}
|
|
||||||
|
|
||||||
Row{
|
// Row{
|
||||||
anchors.top: groupListView.bottom
|
// anchors.top: groupListView.bottom
|
||||||
anchors.topMargin: mm
|
// anchors.topMargin: mm
|
||||||
spacing: mm
|
// spacing: mm
|
||||||
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
// BlueButton{
|
// BlueButton{
|
||||||
// id: addMembers
|
// id: addMembers
|
||||||
|
@ -258,14 +257,15 @@ Item {
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "large"
|
name: "large"
|
||||||
PropertyChanges { target: namelabel; font.pixelSize: 4*mm; width:groupsView.width; readOnly:false}
|
PropertyChanges { target: groupComponent; height: groupsView.height - 6*root.fontFactor*osSettings.bigFontSize }
|
||||||
PropertyChanges { target: namelabelRect; height: 4.5*mm}
|
PropertyChanges { target: namelabel; font.pointSize: 1.2*osSettings.bigFontSize; readOnly:false}
|
||||||
|
//PropertyChanges { target: namelabelRect; height: 2*osSettings.bigFontSize}
|
||||||
PropertyChanges { target: closeButton; visible: true}
|
PropertyChanges { target: closeButton; visible: true}
|
||||||
PropertyChanges { target: groupComponent; z: 2 }
|
//PropertyChanges { target: groupComponent; z: 2 }
|
||||||
PropertyChanges { target: wrapper; width:groupsView.width;height:groupsView.height -2*mm-1}
|
//PropertyChanges { target: wrapper; width:groupsView.width-2*mm;height:groupsView.height -2*mm-1}
|
||||||
PropertyChanges { target: photoImage; width:15*mm;height:15*mm }
|
//PropertyChanges { target: photoImage; width:15*mm;height:15*mm }
|
||||||
PropertyChanges { target:groupComponent.GridView.view ;contentY:groupComponent.y;contentX:groupComponent.x;interactive:false}
|
//PropertyChanges { target:groupComponent.GridView.view ;contentY:groupComponent.y;contentX:groupComponent.x;interactive:false}
|
||||||
PropertyChanges { target: detailsrectangle; opacity:1 }
|
PropertyChanges { target: detailsrectangle; visible:true }
|
||||||
PropertyChanges { target: infobutton; visible: false}
|
PropertyChanges { target: infobutton; visible: false}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
141
source-linux/qml/contactqml/GroupsListTab.qml
Normal file
141
source-linux/qml/contactqml/GroupsListTab.qml
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.11
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
//import QtQuick.Layouts 1.11
|
||||||
|
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"
|
||||||
|
|
||||||
|
Item{
|
||||||
|
id: groupsGridTab
|
||||||
|
|
||||||
|
function showGroups(username){
|
||||||
|
try {groupsModel.clear()} catch(e){print(e)};
|
||||||
|
Helperjs.readData(db, "groups",root.login.username,function(groupsobject){
|
||||||
|
for (var j=0;j<groupsobject.length;j++){
|
||||||
|
groupsModel.append({"group":groupsobject[j]});
|
||||||
|
}})}
|
||||||
|
|
||||||
|
function updateGroup(login,database,group){
|
||||||
|
// update groups
|
||||||
|
//var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||||
|
//var groupdata={"gid":group.id,"name":group.name,"user":group.user};
|
||||||
|
//print("Groupdata "+JSON.stringify(group));
|
||||||
|
var api="";
|
||||||
|
if (group.new){api="/api/friendica/group_create.json?name="+group.name}else{api="/api/friendica/group_update.json?gid="+group.id}
|
||||||
|
xhr.url= login.server + api;
|
||||||
|
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||||
|
xhr.clearParams();
|
||||||
|
xhr.setParam("gid",group.id);
|
||||||
|
xhr.setParam("name",group.name);
|
||||||
|
xhr.setParam("user", group.user);
|
||||||
|
xhr.setParam("json",group);
|
||||||
|
xhr.post();
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target:xhr
|
||||||
|
function onError(data,url,api,code){print(data)}//if (data=="image"){Helperjs.showMessage()}}
|
||||||
|
function onSuccess(data,api){
|
||||||
|
if(api.startsWith("/api/friendica/group")){
|
||||||
|
Newsjs.requestGroups(root.login,root.db,root,function(){
|
||||||
|
showGroups(root.login.username)});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MButton {
|
||||||
|
id: updateGroupsButton
|
||||||
|
text: "\uf021"
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: mm
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: mm
|
||||||
|
onClicked: {
|
||||||
|
Newsjs.requestGroups(root.login,root.db,root,function(){
|
||||||
|
groupsGridTab.showGroups(root.login.username)})}
|
||||||
|
}
|
||||||
|
// BlueButton {
|
||||||
|
// id: newGroupButton
|
||||||
|
// text: "\uf234"
|
||||||
|
// anchors.top: parent.top
|
||||||
|
// anchors.topMargin: mm
|
||||||
|
// anchors.right: updateGroupsButton.left
|
||||||
|
// anchors.rightMargin: mm
|
||||||
|
// onClicked: {
|
||||||
|
// groupsModel.append({"group": {"new":true}});
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
ListView {
|
||||||
|
id: groupsView
|
||||||
|
x:mm
|
||||||
|
y:updateGroupsButton.height+4*mm
|
||||||
|
width:groupsGridTab.width-2*mm
|
||||||
|
height:groupsGridTab.height-updateGroupsButton.height-2*mm
|
||||||
|
clip: true
|
||||||
|
// cellHeight: 16*mm
|
||||||
|
// cellWidth: 17*mm
|
||||||
|
// add: Transition {
|
||||||
|
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||||
|
// }
|
||||||
|
model: groupsModel
|
||||||
|
delegate: GroupComponent {}
|
||||||
|
//footer:groupFooter
|
||||||
|
}
|
||||||
|
ListModel{
|
||||||
|
id: groupsModel
|
||||||
|
}
|
||||||
|
// Component{
|
||||||
|
// id: groupFooter
|
||||||
|
// Image{
|
||||||
|
// id: footerImage
|
||||||
|
// width: 15*mm
|
||||||
|
// height: 15*mm
|
||||||
|
// fillMode: Image.PreserveAspectFit
|
||||||
|
// source:"qrc:/images/addImage.png"
|
||||||
|
// MouseArea{
|
||||||
|
// anchors.fill: parent
|
||||||
|
// onClicked:{
|
||||||
|
// print("new group")
|
||||||
|
// var component = Qt.createComponent("qrc:/qml/contactqml/GroupComponent.qml");
|
||||||
|
// var imagedialog = component.createObject(groupsView,{"group": []});}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
Component.onCompleted: {
|
||||||
|
friendsTabView.groupsSignal.connect(showGroups);
|
||||||
|
showGroups()
|
||||||
|
}
|
||||||
|
}
|
|
@ -105,16 +105,15 @@ Rectangle {
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: update
|
id: update
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: mm
|
anchors.topMargin: mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
text: "\uf021"
|
text: "\uf021"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Service.requestProfile(root.login,root.db,root,function(nc){
|
Service.requestProfile(root.login,root.db,root,function(nc){
|
||||||
root.newContacts=nc;
|
root.newContacts=nc;
|
||||||
|
root.onNewContactsChanged(nc);
|
||||||
photoImage.source="";
|
photoImage.source="";
|
||||||
showProfile(function(newprofile){
|
showProfile(function(newprofile){
|
||||||
profile=newprofile;
|
profile=newprofile;
|
||||||
|
@ -149,7 +148,7 @@ Rectangle {
|
||||||
imagePicking=true;
|
imagePicking=true;
|
||||||
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||||
osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
|
osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
|
||||||
'}}',profileGridTab,"imagePicker");
|
'}}',profileTab,"imagePicker");
|
||||||
imagePicker.pickImage()
|
imagePicker.pickImage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,16 +171,15 @@ Rectangle {
|
||||||
anchors.top: photoImage.top
|
anchors.top: photoImage.top
|
||||||
anchors.right:photoImage.right
|
anchors.right:photoImage.right
|
||||||
color: "white"
|
color: "white"
|
||||||
font.pixelSize: 4*mm
|
font.pointSize: 1.2*osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id:updatebutton
|
id:updatebutton
|
||||||
height: 6*mm
|
width: 8*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 12*mm
|
|
||||||
visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source
|
visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source
|
||||||
text:qsTr("Update")
|
text:qsTr("Update")
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
anchors.left: photoImage.right
|
anchors.left: photoImage.right
|
||||||
anchors.leftMargin: 0.5*mm
|
anchors.leftMargin: 0.5*mm
|
||||||
anchors.topMargin: mm
|
anchors.topMargin: mm
|
||||||
|
@ -199,7 +197,7 @@ Rectangle {
|
||||||
anchors.left: photoImage.left
|
anchors.left: photoImage.left
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
color: "#303030"
|
color: "#303030"
|
||||||
font.pixelSize: 4*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
anchors.top: photoImage.bottom
|
anchors.top: photoImage.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +210,7 @@ Rectangle {
|
||||||
height: 5*mm+profiletextfield.height
|
height: 5*mm+profiletextfield.height
|
||||||
Text{
|
Text{
|
||||||
y:mm
|
y:mm
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text:"<b>"+qsTr("profile id")+": </b> "+profileid+"<br>"
|
text:"<b>"+qsTr("profile id")+": </b> "+profileid+"<br>"
|
||||||
color:"black"
|
color:"black"
|
||||||
}
|
}
|
||||||
|
@ -222,7 +220,7 @@ Rectangle {
|
||||||
y:4.5*mm
|
y:4.5*mm
|
||||||
width:parent.width-2.5*mm
|
width:parent.width-2.5*mm
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text:profiletext
|
text:profiletext
|
||||||
color:"black"
|
color:"black"
|
||||||
}
|
}
|
||||||
|
@ -234,7 +232,7 @@ Rectangle {
|
||||||
id:namelabeltext
|
id:namelabeltext
|
||||||
width: namelabelflickable.width
|
width: namelabelflickable.width
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
textFormat:Text.RichText
|
textFormat:Text.RichText
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(profile.friendica_owner.description))+"<br> <b>"+qsTr("Location")+":</b> "+profile.friendica_owner.location+"<br> <b>"+qsTr("Posts")+":</b> "+profile.friendica_owner.statuses_count+
|
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(profile.friendica_owner.description))+"<br> <b>"+qsTr("Location")+":</b> "+profile.friendica_owner.location+"<br> <b>"+qsTr("Posts")+":</b> "+profile.friendica_owner.statuses_count+
|
||||||
|
|
65
source-linux/qml/contactqml/ProfileTab.qml
Normal file
65
source-linux/qml/contactqml/ProfileTab.qml
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.11
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
//import QtQuick.Controls.Styles 1.4
|
||||||
|
//import QtQuick.Layouts 1.11
|
||||||
|
//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"
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
Component.onCompleted:{
|
||||||
|
showProfile(function(profile){
|
||||||
|
var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
|
||||||
|
var profilecomp = component.createObject(profileTab,{"profile": profile});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,47 +36,56 @@ import QtQuick.Controls 2.4
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
import "qrc:/js/news.js" as Newsjs
|
import "qrc:/js/news.js" as Newsjs
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
|
||||||
StackView{
|
ApplicationWindow{
|
||||||
id:root
|
id:root
|
||||||
|
title: "Friendiqa"
|
||||||
|
property var globaloptions: Service.readGO(db)
|
||||||
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsLinux.qml");return tmp.createObject(root)}
|
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsLinux.qml");return tmp.createObject(root)}
|
||||||
width: osSettings.appWidth
|
width: globaloptions.hasOwnProperty("appWidth")?globaloptions.appWidth:osSettings.appWidth
|
||||||
height:osSettings.appHeight
|
height:globaloptions.hasOwnProperty("appHeight")?globaloptions.appHeight:osSettings.appHeight
|
||||||
|
visible: true
|
||||||
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
|
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
|
||||||
property var login: Service.readActiveConfig(db)
|
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 var contactlist: []
|
||||||
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
|
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
|
||||||
signal messageSignal(var friend)
|
property bool wideScreen : width>height
|
||||||
signal fotoSignal(var username, var friend)
|
signal fotoSignal(var username, var friend)
|
||||||
signal directmessageSignal(var friend)
|
signal directmessageSignal(var friend)
|
||||||
signal newsSignal(var news)
|
signal newsSignal(var news)
|
||||||
signal newstypeSignal(var type)
|
signal newstypeSignal(var type)
|
||||||
signal friendsSignal(var username)
|
signal friendsSignal(var username)
|
||||||
signal contactdetailsSignal(var contact)
|
signal contactdetailsSignal(var contact)
|
||||||
|
signal searchSignal (var searchterm)
|
||||||
signal eventSignal(var contact)
|
signal eventSignal(var contact)
|
||||||
signal uploadSignal(var urls)
|
signal uploadSignal(var urls)
|
||||||
signal sendtextSignal(var intenttext)
|
signal sendtextSignal(var intenttext)
|
||||||
signal changeimage(var method, var type, var id)
|
signal changeimage(var method, var type, var id)
|
||||||
signal updateSyncinterval(int interval)
|
signal updateSyncinterval(int interval)
|
||||||
|
signal replySignal(var newsobject)
|
||||||
property var news:[]
|
property var news:[]
|
||||||
property var newContacts:[]
|
property var newContacts:[]
|
||||||
|
property var contactposts:[]
|
||||||
//property string contactLoadType: ""
|
//property string contactLoadType: ""
|
||||||
property bool imagePicking: false
|
property bool imagePicking: false
|
||||||
|
|
||||||
onLoginChanged:{
|
function onLoginChanged(login){
|
||||||
if(login==""){root.push("qrc:/qml/configqml/AccountPage.qml")}
|
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
|
||||||
else{root.push(rootStackItem)
|
else{//rootstackView.push(rootstack)
|
||||||
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
|
if (login.newsViewType!="" || login.newsViewType!=null){
|
||||||
|
newstab.newstabstatus=login.newsViewType;}
|
||||||
Newsjs.getCurrentContacts(login,db,function(contacts){
|
Newsjs.getCurrentContacts(login,db,function(contacts){
|
||||||
contactlist=contacts})}
|
contactlist=contacts})
|
||||||
}
|
}
|
||||||
onNewContactsChanged:{
|
}
|
||||||
|
function onNewContactsChanged(newContacts){
|
||||||
if(newContacts.length>0){// download contact images and update db
|
if(newContacts.length>0){// download contact images and update db
|
||||||
var contacturls=[];
|
var contacturls=[];
|
||||||
var contactnames=[];
|
var contactnames=[];
|
||||||
for (var link in newContacts){
|
for (var link in newContacts){//print("new contact " +newContacts[link].screen_name);
|
||||||
contacturls.push(newContacts[link].profile_image_url);
|
contacturls.push(newContacts[link].profile_image_url);
|
||||||
contactnames.push(newContacts[link].screen_name);
|
contactnames.push(newContacts[link].screen_name);
|
||||||
Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link])
|
Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link])
|
||||||
|
@ -91,6 +100,29 @@ StackView{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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){ //print(JSON.stringify(contact));
|
||||||
|
rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target:xhr
|
target:xhr
|
||||||
function onDownloaded(type,url,filename,i){
|
function onDownloaded(type,url,filename,i){
|
||||||
|
@ -104,10 +136,12 @@ StackView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
|
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
|
||||||
|
|
||||||
Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
|
//Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
|
||||||
if (event.key === osSettings.backKey) {
|
onClosing: {
|
||||||
|
//if (event.key === osSettings.backKey) {
|
||||||
if (rootstack.currentIndex==0){
|
if (rootstack.currentIndex==0){
|
||||||
newstab.active=true;
|
newstab.active=true;
|
||||||
if (newstab.newstabstatus!=globaloptions.newsViewType){
|
if (newstab.newstabstatus!=globaloptions.newsViewType){
|
||||||
|
@ -119,294 +153,149 @@ StackView{
|
||||||
Newsjs.chatsfromdb(db,login.username,function(dbnews){
|
Newsjs.chatsfromdb(db,login.username,function(dbnews){
|
||||||
newsSignal(dbnews)
|
newsSignal(dbnews)
|
||||||
})}
|
})}
|
||||||
|
close.accepted=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (newstab.conversation.length>0){newstab.conversation=[]}
|
else if (newstab.conversation.length>0){
|
||||||
else if (root.depth>1){root.pop()}
|
newstab.conversation=[];
|
||||||
|
close.accepted=false
|
||||||
|
}
|
||||||
|
else if (root.depth>1){
|
||||||
|
root.pop();
|
||||||
|
close.accepted=false
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
Service.cleanNews(root.db,function(){
|
Service.cleanNews(root.db,function(){
|
||||||
Service.cleanHashtags(root.db,function(){
|
Service.cleanHashtags(root.db,function(){
|
||||||
Service.cleanContacts(root.login,root.db,function(){
|
Service.cleanContacts(root.login,root.db,function(){
|
||||||
Qt.quit()})
|
Qt.quit()})
|
||||||
})})
|
})})
|
||||||
|
close.accepted=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
|
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
|
||||||
else {rootstack.currentIndex=0}
|
else {rootstack.currentIndex=0}
|
||||||
event.accepted = true
|
//event.accepted = true
|
||||||
}}
|
//}
|
||||||
|
|
||||||
Drawer{
|
|
||||||
id: leftDrawer
|
|
||||||
width: 0.66* root.width
|
|
||||||
height: root.height
|
|
||||||
edge: Qt.LeftEdge
|
|
||||||
position: 1.0
|
|
||||||
Column{
|
|
||||||
x:mm
|
|
||||||
width:parent.width-mm
|
|
||||||
Label{
|
|
||||||
text: login.hasOwnProperty("username")?login.username:""
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
height: 6*mm
|
|
||||||
}
|
}
|
||||||
// Label{
|
|
||||||
// text:login.hasOwnProperty("server")?"@"+login.server:""
|
|
||||||
// font.pixelSize: 5*mm
|
|
||||||
// width: parent.width
|
|
||||||
// }
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf021 " + qsTr("Refresh")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
header: ToolBar{
|
||||||
width: parent.width
|
position: wideScreen?ToolBar.Header:ToolBar.Footer
|
||||||
MouseArea{
|
background: Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"//"#F8F8F8"
|
||||||
|
}
|
||||||
|
RowLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
ToolButton{
|
||||||
|
visible: !wideScreen
|
||||||
|
text: "\uf0c9"
|
||||||
onClicked:{
|
onClicked:{
|
||||||
leftDrawer.close();
|
leftDrawer.visible?leftDrawer.close():leftDrawer.open()}
|
||||||
// newstypeSignal("refresh")
|
|
||||||
updatenews.setDatabase();
|
|
||||||
updatenews.login();
|
|
||||||
updatenews.startsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf1da " + qsTr("Timeline")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("timeline")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf086 " + qsTr("Conversations")
|
|
||||||
width: parent.width
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("conversation")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf005 " + qsTr("Favorites")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("favorites")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Label{
|
|
||||||
text: "\uf0ec " + qsTr("Replies")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("replies")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf0ac " + qsTr("Public Timeline")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("publictimeline")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf0c0 " + qsTr("Group news")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("groupnews")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf002 " + qsTr("Search")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.close();
|
|
||||||
newstypeSignal("search")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf085 "+ qsTr("Settings")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {root.push("qrc:qml/configqml/ConfigPage.qml");
|
|
||||||
leftDrawer.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Label{
|
|
||||||
text: "\uf2bb " + qsTr("Accounts")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {root.push("qrc:qml/configqml/AccountPage.qml");
|
|
||||||
leftDrawer.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label{
|
|
||||||
text: "\uf08b " +qsTr("Quit")
|
|
||||||
//font.pixelSize: 4*mm
|
|
||||||
font.pointSize: 16
|
|
||||||
width: parent.width
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
Service.cleanNews(root.db,function(){
|
|
||||||
Service.cleanHashtags(root.db,function(){
|
|
||||||
Service.cleanContacts(root.login,root.db,function(){
|
|
||||||
Qt.quit()})
|
|
||||||
})})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item{
|
|
||||||
id:rootStackItem
|
|
||||||
width:parent.width
|
|
||||||
height: parent.height
|
|
||||||
//anchors.fill:parent
|
|
||||||
states: State {
|
|
||||||
name: "fullscreen";
|
|
||||||
PropertyChanges { target: bar; height:0 }
|
|
||||||
PropertyChanges { target: rootstack; height:parent.height }
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: Transition {
|
|
||||||
PropertyAnimation { properties: "height";
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TabBar {
|
TabBar {
|
||||||
id: bar
|
id: bar
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 7*mm
|
//width: wideScreen?contentWidth:parent.width-10*mm
|
||||||
position:TabBar.Footer
|
//x: 7*mm
|
||||||
anchors.top: rootstack.bottom
|
|
||||||
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
|
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf03a"
|
text: "\uf03a"
|
||||||
font.pixelSize: 3*mm
|
background:Rectangle{
|
||||||
height: 6*mm
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf0c0"
|
text: "\uf0c0"
|
||||||
font.pixelSize: 3*mm
|
background:Rectangle{
|
||||||
height: 6*mm
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf03e"
|
text: "\uf03e"
|
||||||
font.pixelSize: 3*mm
|
background:Rectangle{
|
||||||
height: 6*mm
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
text: "\uf073"
|
text: "\uf073"
|
||||||
font.pixelSize: 3*mm
|
background:Rectangle{
|
||||||
height: 6*mm
|
anchors.fill: parent
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StackLayout{
|
LeftDrawerAndroid{
|
||||||
|
id: leftDrawer
|
||||||
|
visible:!wideScreen
|
||||||
|
}
|
||||||
|
|
||||||
|
// states: State {
|
||||||
|
// name: "fullscreen";
|
||||||
|
// PropertyChanges { target: bar; height:0 }
|
||||||
|
// PropertyChanges { target: rootstack; height:parent.height }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// transitions: Transition {
|
||||||
|
// PropertyAnimation { properties: "height";
|
||||||
|
// easing.type: Easing.InOutQuad
|
||||||
|
// duration: 1000
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
StackView{id:rootstackView
|
||||||
|
width:root.width
|
||||||
|
height: root.height
|
||||||
|
initialItem: StackLayout{
|
||||||
id:rootstack
|
id:rootstack
|
||||||
width:parent.width
|
width:rootstackView.width
|
||||||
height: parent.height-7*mm
|
height: rootstackView.height//-7*mm
|
||||||
|
//y:wideScreen?7*mm:0
|
||||||
currentIndex:bar.currentIndex
|
currentIndex:bar.currentIndex
|
||||||
|
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: newstab
|
id: newstab
|
||||||
Layout.fillWidth:true
|
Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
property string newstabstatus
|
property string newstabstatus
|
||||||
property var conversation:[]
|
property var conversation:[]
|
||||||
property var contactposts:[]
|
|
||||||
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
|
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: friendstab
|
id: friendstab
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
|
source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: fotostab
|
id: fotostab
|
||||||
property string phototabstatus:"Images"
|
property string phototabstatus:"Images"
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
|
source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: calendartab
|
id: calendartab
|
||||||
property string calendartabstatus:"Events"
|
property string calendartabstatus:"Events"
|
||||||
Layout.fillWidth:true
|
// Layout.fillWidth:true
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
|
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
forceActiveFocus();
|
onLoginChanged(login);
|
||||||
//print(xhr.networktype());
|
globaloptions=Service.readGO(db);
|
||||||
if(osSettings.osType=="Android"){
|
if(osSettings.osType=="Android"){
|
||||||
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
|
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
|
||||||
var IntentReceiverQml = component.createObject(root);
|
var IntentReceiverQml = component.createObject(root);
|
||||||
|
@ -416,5 +305,5 @@ StackView{
|
||||||
var LinuxSyncQml = component.createObject(root);
|
var LinuxSyncQml = component.createObject(root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,12 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: blueButton
|
id: blueButton
|
||||||
width: Math.max(mainText.width+2*mm,8*mm)
|
width: Math.max(mainText.width+2*mm,5*mm)
|
||||||
height: 5*mm
|
height: 5*mm
|
||||||
color:"light blue"//"#EFEAEA" "sky blue"
|
border.color: "light blue"
|
||||||
|
color:"transparent"//"#EFEAEA" "sky blue"
|
||||||
property alias fontColor: mainText.color
|
property alias fontColor: mainText.color
|
||||||
// border.color:"grey"
|
border.width:1
|
||||||
// border.width:1
|
|
||||||
radius: mm
|
radius: mm
|
||||||
property alias text: mainText.text
|
property alias text: mainText.text
|
||||||
property alias font: mainText.font
|
property alias font: mainText.font
|
||||||
|
@ -51,8 +51,9 @@ Rectangle{
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
text: ""
|
text: ""
|
||||||
|
elide: Text.ElideNone
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:buttonArea
|
id:buttonArea
|
||||||
|
|
|
@ -35,15 +35,15 @@ import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: contactComponent
|
id: contactComponent
|
||||||
height: 8*mm
|
height: 5*root.fontFactor*osSettings.systemFontSize//8*mm
|
||||||
width: parent.width
|
width: contactComponent.ListView.view.width//parent.width
|
||||||
property var createdAtDate: new Date(contact.created_at)
|
property var createdAtDate: new Date(contact.created_at)
|
||||||
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
width:parent.width
|
width:parent.width
|
||||||
height: 8*mm
|
height: parent.height//8*mm
|
||||||
radius: 0.5*mm
|
radius: 0.5*mm
|
||||||
border.color: "grey"
|
border.color: "grey"
|
||||||
color:"white"
|
color:"white"
|
||||||
|
@ -51,34 +51,45 @@ Item {
|
||||||
id: photoImage
|
id: photoImage
|
||||||
x:0.5*mm
|
x:0.5*mm
|
||||||
y:0.5*mm
|
y:0.5*mm
|
||||||
width: 7*mm
|
width: 4*root.fontFactor*osSettings.systemFontSize//7*mm
|
||||||
height:7*mm
|
height:4*root.fontFactor*osSettings.systemFontSize//7*mm
|
||||||
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
|
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"}}
|
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column{
|
Flow{
|
||||||
width: wrapper.width-8*mm
|
width: wrapper.width-4*root.fontFactor*osSettings.systemFontSize//8*mm
|
||||||
|
height: wrapper.height-mm
|
||||||
anchors.left: photoImage.right
|
anchors.left: photoImage.right
|
||||||
anchors.margins: 1*mm
|
anchors.margins: 1*mm
|
||||||
spacing: mm
|
//spacing: mm
|
||||||
|
clip: true
|
||||||
Label {
|
Label {
|
||||||
id: namelabel
|
id: namelabel
|
||||||
width: wrapper.width-4
|
width: Math.min(wrapper.width-(photoImage.width+mm),contentWidth)//wrapper.width-4
|
||||||
height: 3*mm
|
height: 1.1*root.fontFactor*osSettings.bigFontSize//3*mm
|
||||||
text: contact.name
|
text: contact.name
|
||||||
elide:Text.ElideRight
|
elide: contentWidth>wrapper.width-4*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
|
||||||
color: "#303030"
|
color: "#303030"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
id: screennamelabel
|
id: screennamelabel
|
||||||
width: wrapper.width-8*mm
|
width: Math.min(wrapper.width-4*root.fontFactor*osSettings.systemFontSize,contentWidth)//contentWidth+2*mm//wrapper.width-8*mm
|
||||||
height: 2.5*mm
|
height: 1.1*root.fontFactor*osSettings.bigFontSize//3*mm
|
||||||
text: "@"+contact.screen_name
|
text: "(@"+contact.screen_name+")"
|
||||||
elide:Text.ElideRight
|
elide: contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
|
||||||
color: "#303030"
|
color: "#303030"
|
||||||
font.pixelSize: 2.5*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
id: descriptionlabel
|
||||||
|
width: Math.min(wrapper.width-4*root.fontFactor*osSettings.systemFontSize,contentWidth)//contentWidth+2*mm//wrapper.width-8*mm
|
||||||
|
height: 2*root.fontFactor*osSettings.systemFontSize//2.5*mm
|
||||||
|
text: contact.description
|
||||||
|
elide:contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
|
||||||
|
color: "#303030"
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
|
235
source-linux/qml/genericqml/DrawerAccountComponent.qml
Normal file
235
source-linux/qml/genericqml/DrawerAccountComponent.qml
Normal file
|
@ -0,0 +1,235 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: drawerAccountComponent
|
||||||
|
property var account: ({})
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
Label{
|
||||||
|
|
||||||
|
y:0.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
height: 1.5*osSettings.bigFontSize*root.fontFactor
|
||||||
|
verticalAlignment:Text.AlignBottom
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
text: account.username
|
||||||
|
}
|
||||||
|
// Label{
|
||||||
|
// text:login.hasOwnProperty("server")?"@"+login.server:""
|
||||||
|
// font.pixelSize: 5*mm
|
||||||
|
// width: parent.width
|
||||||
|
// }
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:2*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: "\uf021 " + qsTr("Refresh")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked: {
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newstypeSignal("refresh")
|
||||||
|
// updatenews.setDatabase();
|
||||||
|
// updatenews.login();
|
||||||
|
// updatenews.startsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:3.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Timeline"
|
||||||
|
text: "\uf1da " + qsTr("Timeline")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Timeline";
|
||||||
|
newstypeSignal("timeline")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Conversations"
|
||||||
|
text: "\uf086 " + qsTr("Conversations")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Conversations";
|
||||||
|
newstypeSignal("conversation")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:6.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Replies"
|
||||||
|
text: "\uf0ec " + qsTr("Replies")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=1
|
||||||
|
currentnewstabstatus="Replies";
|
||||||
|
newstypeSignal("replies")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:8*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="DirectMessages"
|
||||||
|
text: "\uf0e0 " + qsTr("Direct Messages")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=2//newstypeSignal("replies")
|
||||||
|
currentnewstabstatus="DirectMessages";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Label{
|
||||||
|
y:9.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Favorites"
|
||||||
|
text: "\uf005 " + qsTr("Favorites")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Favorites";
|
||||||
|
newstypeSignal("favorites")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:11*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Public Timeline"
|
||||||
|
text: "\uf0ac " + qsTr("Public Timeline")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Public Timeline";
|
||||||
|
newstypeSignal("publictimeline")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:12.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Groupnews"
|
||||||
|
text: "\uf0c0 " + qsTr("Group news")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Groupnews";
|
||||||
|
newstypeSignal("groupnews")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:14*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Search"
|
||||||
|
text: "\uf002 " + qsTr("Search")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=0;
|
||||||
|
currentnewstabstatus="Search";
|
||||||
|
newstypeSignal("search")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:15.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && currentnewstabstatus=="Notifications"
|
||||||
|
text: "\uf0f3 " + qsTr("Notifications")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
newsSwipeview.currentIndex=3;
|
||||||
|
currentnewstabstatus="Notifications";
|
||||||
|
newstypeSignal("notifications")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
126
source-linux/qml/genericqml/DrawerAccountComponentContacts.qml
Normal file
126
source-linux/qml/genericqml/DrawerAccountComponentContacts.qml
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: drawerAccountComponent
|
||||||
|
property var account: ({})
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
Label{
|
||||||
|
|
||||||
|
y:0.5*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
height: 1.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
verticalAlignment:Text.AlignBottom
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
text: account.username
|
||||||
|
}
|
||||||
|
// Label{
|
||||||
|
// text:login.hasOwnProperty("server")?"@"+login.server:""
|
||||||
|
// font.pixelSize: 5*mm
|
||||||
|
// width: parent.width
|
||||||
|
// }
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:2*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && friendsTabView.currentIndex==0
|
||||||
|
text: " "+qsTr("Profile")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
friendsTabView.currentIndex=0;
|
||||||
|
profileLoader.source="";
|
||||||
|
profileLoader.source="qrc:/qml/contactqml/ProfileTab.qml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:3.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && friendsTabView.currentIndex==1
|
||||||
|
text: " "+qsTr("Friends")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
friendsTabView.currentIndex=1
|
||||||
|
friendsListLoader.source="";
|
||||||
|
friendsListLoader.source="qrc:/qml/contactqml/FriendsListTab.qml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && friendsTabView.currentIndex==2
|
||||||
|
text: " "+qsTr("Contacts")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
friendsTabView.currentIndex=2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Label{
|
||||||
|
y:6.5*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width:parent.width
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.bold: account.username==login.username && friendsTabView.currentIndex==3
|
||||||
|
text: " "+qsTr("Groups")
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill:parent
|
||||||
|
onClicked:{
|
||||||
|
login=account;
|
||||||
|
if(!wideScreen){leftDrawerAndroid.close()}
|
||||||
|
friendsTabView.currentIndex=3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ Rectangle{
|
||||||
}
|
}
|
||||||
Button{
|
Button{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 8*mm
|
height: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -126,7 +126,7 @@ Rectangle{
|
||||||
width: fileIsDir?parent.width - 12*mm :imageView.width-mm
|
width: fileIsDir?parent.width - 12*mm :imageView.width-mm
|
||||||
anchors.bottom: folderImage.bottom
|
anchors.bottom: folderImage.bottom
|
||||||
color: fileIsDir?"black":"white"
|
color: fileIsDir?"black":"white"
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
wrapMode:Text.Wrap
|
wrapMode:Text.Wrap
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
@ -138,7 +138,7 @@ Rectangle{
|
||||||
width: 10*mm
|
width: 10*mm
|
||||||
anchors.top: folderImage.top
|
anchors.top: folderImage.top
|
||||||
color: "green"
|
color: "green"
|
||||||
font.pixelSize: 10*mm
|
font.pointSize: 3*osSettings.bigFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
Image{id:folderImage
|
Image{id:folderImage
|
||||||
|
|
|
@ -15,7 +15,7 @@ Item {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SystemDispatcher
|
target: SystemDispatcher
|
||||||
onDispatched: {
|
function onDispatched (type, message) {
|
||||||
if ((type === m_IMAGE_MESSAGE)&& (root.imagePicking==false)) {
|
if ((type === m_IMAGE_MESSAGE)&& (root.imagePicking==false)) {
|
||||||
var h=[];
|
var h=[];
|
||||||
for (var n in message.imageUrls){
|
for (var n in message.imageUrls){
|
||||||
|
|
41
source-linux/qml/genericqml/LeftDrawerAndroid.qml
Normal file
41
source-linux/qml/genericqml/LeftDrawerAndroid.qml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/configqml"
|
||||||
|
|
||||||
|
Drawer{
|
||||||
|
id: leftDrawer
|
||||||
|
width: root.fontFactor*osSettings.systemFontSize*10
|
||||||
|
height: root.height
|
||||||
|
LeftDrawerScrollview{}
|
||||||
|
}
|
55
source-linux/qml/genericqml/LeftDrawerLinux.qml
Normal file
55
source-linux/qml/genericqml/LeftDrawerLinux.qml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/configqml"
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
// id: leftDrawer
|
||||||
|
// width: osSettings.systemFontSize*30
|
||||||
|
// height: root.height-bar.height
|
||||||
|
//y: bar.height
|
||||||
|
signal opened()
|
||||||
|
|
||||||
|
LeftDrawerScrollview{
|
||||||
|
width:parent.width-mm
|
||||||
|
height:parent.height
|
||||||
|
x:mm
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
width: 1
|
||||||
|
height: leftDrawer.height
|
||||||
|
anchors.right: leftDrawer.right
|
||||||
|
color: "#EEEEEE"
|
||||||
|
}
|
||||||
|
Component.onCompleted: {opened();}
|
||||||
|
}
|
|
@ -32,10 +32,11 @@ import QtQuick 2.6
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
Button{
|
Button{
|
||||||
id: mButton
|
id: mButton
|
||||||
width: Math.max(text.width+2*mm,8*mm)
|
property alias color: bg.color
|
||||||
|
width: Math.max(text.width+2*mm,2*root.fontFactor*osSettings.bigFontSize)
|
||||||
//radius: mm
|
//radius: mm
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
//color: Material.grey
|
//color: Material.grey
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
background: Rectangle{color:"#F8F8F8";radius: 0.5*mm}
|
background: Rectangle{id:bg;color:"#F3F3F3";radius: 0.5*mm}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ Rectangle {
|
||||||
id:searchComponent
|
id:searchComponent
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
color: "white"
|
color: "#EEEEEE"
|
||||||
radius:0.5*mm
|
radius:0.5*mm
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin:mm
|
anchors.leftMargin:mm
|
||||||
|
@ -53,7 +53,7 @@ Rectangle {
|
||||||
TextInput {
|
TextInput {
|
||||||
id: searchText
|
id: searchText
|
||||||
focus: true
|
focus: true
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
|
|
@ -33,25 +33,103 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
|
import "qrc:/js/news.js" as Newsjs
|
||||||
|
import "qrc:/js/service.js" as Service
|
||||||
import "qrc:/qml/genericqml"
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
|
Page {
|
||||||
id:contactList
|
id:contactList
|
||||||
color: "white"
|
|
||||||
property var contact:({})
|
property var contact:({})
|
||||||
property string profileimagesource:contact.profile_image
|
property string profileimagesource:contact.profile_image
|
||||||
|
|
||||||
|
//function backRequested(){pageStack.pop()}
|
||||||
|
|
||||||
|
function getDateDiffString (seconds){
|
||||||
|
var timestring="";
|
||||||
|
if (seconds<60) {timestring= Math.round(seconds) + " " +qsTr("seconds");}
|
||||||
|
else if (seconds<90){timestring= Math.round(seconds/60) + " " +qsTr("minute") ;}
|
||||||
|
else if (seconds<3600){timestring= Math.round(seconds/60) + " " +qsTr("minutes");}
|
||||||
|
else if (seconds<5400){timestring= Math.round(seconds/3600) + " " +qsTr("hour");}
|
||||||
|
else if (seconds<86400){timestring= Math.round(seconds/3600) + " " +qsTr("hours");}
|
||||||
|
else if (seconds<129600){timestring= Math.round(seconds/86400) + " " +qsTr("day");}
|
||||||
|
else if (seconds<3888000){timestring= Math.round(seconds/86400) + " " +qsTr("days");}
|
||||||
|
else if (seconds<5832000){timestring= Math.round(seconds/3888000) + " " +qsTr("month");}
|
||||||
|
else if (seconds<69984000){timestring= Math.round(seconds/3888000) + " " +qsTr("months");}
|
||||||
|
else {timestring= Math.round(seconds/46656000) + " " + qsTr("years");}
|
||||||
|
|
||||||
|
return timestring;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getActivitiesView(newsitemobject){
|
||||||
|
var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={};
|
||||||
|
try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_activities')){
|
||||||
|
if (newsitemobject.friendica_activities.like.length>0){
|
||||||
|
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);
|
||||||
|
}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
|
||||||
|
return {likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showConversation(conversationIndex,newsitemobject){
|
||||||
|
if(newsitemobject.messagetype==0 || newsitemobject.messagetype==3){
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {id:contacttimer; interval: 50; running: false; repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
|
||||||
|
root.onNewContactsChanged(root.newContacts);
|
||||||
|
Newsjs.storeNews(login,db,root.news,root)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: contactView
|
id: contactView
|
||||||
x:mm
|
x:mm
|
||||||
y:9*mm
|
y:4*root.fontFactor*osSettings.bigFontSize
|
||||||
width: contactList.width-4*mm
|
width: contactList.width-2*mm
|
||||||
height:contactList.height-10*mm
|
height:contactList.height-7*root.fontFactor*osSettings.bigFontSize
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
property string viewtype: "conversation"
|
||||||
header: contactHeader
|
header: contactHeader
|
||||||
model: contactModel
|
model: contactModel
|
||||||
delegate: Newsitem{}
|
delegate: Newsitem{}
|
||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator{
|
BusyIndicator{
|
||||||
id: contactBusy
|
id: contactBusy
|
||||||
anchors.centerIn:parent
|
anchors.centerIn:parent
|
||||||
|
@ -66,7 +144,7 @@ Rectangle {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
color:"white"
|
color:"white"
|
||||||
width:contactView.width
|
width:contactView.width
|
||||||
height: profileImage.height+namelabel.height+detailtext.height+7*mm
|
height: contactView.width<35*root.fontFactor*osSettings.systemFontSize?(profileImage.height+namelabel.height+detailtext.height+7*mm):Math.max(profileImage.height,(buttonflow.height+namelabel.height+detailtext.height))+7*mm
|
||||||
//height: wrapper.height
|
//height: wrapper.height
|
||||||
property var createdAtDate: new Date(contact.created_at)
|
property var createdAtDate: new Date(contact.created_at)
|
||||||
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
||||||
|
@ -75,7 +153,7 @@ Rectangle {
|
||||||
id: profileImage
|
id: profileImage
|
||||||
x:mm
|
x:mm
|
||||||
y:mm
|
y:mm
|
||||||
width: contactView.width/2
|
width: Math.min(15*root.fontFactor*osSettings.bigFontSize,contactView.width/2) //contactView.width/2
|
||||||
height:width
|
height:width
|
||||||
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
||||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||||
|
@ -84,18 +162,19 @@ Rectangle {
|
||||||
onProfileimagesourceChanged:profileImage.source=profileimagesource
|
onProfileimagesourceChanged:profileImage.source=profileimagesource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Column{id:buttoncolumn
|
Flow{id:buttonflow
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: mm
|
anchors.rightMargin: mm
|
||||||
|
width: contactView.width - (profileImage.width+3*mm)
|
||||||
|
height: (contact.hasOwnProperty("acct"))?21*mm:15*mm//profileImage.height
|
||||||
y: mm
|
y: mm
|
||||||
spacing:4
|
spacing:4
|
||||||
|
|
||||||
MButton{
|
BlueButton{
|
||||||
id:photobutton
|
id:photobutton
|
||||||
height: 6*mm
|
height: 6*mm
|
||||||
width: 8*mm
|
width: 8*mm
|
||||||
text: "\uf03e" // "Photos"
|
text: "\uf03e" // "Photos"
|
||||||
//font.pixelSize: 3*mm
|
|
||||||
visible:(contact.network=="dfrn")
|
visible:(contact.network=="dfrn")
|
||||||
onClicked:{
|
onClicked:{
|
||||||
rootstack.currentIndex=2;
|
rootstack.currentIndex=2;
|
||||||
|
@ -104,17 +183,16 @@ Rectangle {
|
||||||
|
|
||||||
//fotostab.active=true;
|
//fotostab.active=true;
|
||||||
fotoSignal(root.login,contact) ;
|
fotoSignal(root.login,contact) ;
|
||||||
newsStack.pop();
|
rootstackView.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
BlueButton{
|
||||||
id:dmbutton
|
id:dmbutton
|
||||||
height: 6*mm
|
height: 6*mm
|
||||||
width: 8*mm
|
width: 8*mm
|
||||||
visible: (contact.following=="true")
|
visible: (contact.following=="true")
|
||||||
text: "\uf040" //"DM"
|
text: "\uf040" //"DM"
|
||||||
//font.pixelSize: 3*mm
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
rootstack.currentIndex=0;
|
rootstack.currentIndex=0;
|
||||||
newsSwipeview.currentIndex=2;
|
newsSwipeview.currentIndex=2;
|
||||||
|
@ -122,43 +200,88 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
BlueButton{
|
||||||
id:eventbutton
|
id:eventbutton
|
||||||
visible:(contact.network=="dfrn")
|
visible:(contact.network=="dfrn")
|
||||||
height: 6*mm
|
height: 6*mm
|
||||||
width: 8*mm
|
width: 8*mm
|
||||||
text:"\uf073"
|
text:"\uf073"
|
||||||
//font.pixelSize: 3*mm
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
rootstack.currentIndex=3;
|
rootstack.currentIndex=3;
|
||||||
bar.currentIndex=3;
|
bar.currentIndex=3;
|
||||||
calendartab.calendartabstatus="Friend"
|
calendartab.calendartabstatus="Friend"
|
||||||
eventSignal(contact);
|
eventSignal(contact);
|
||||||
newsStack.pop()
|
rootstackView.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BlueButton{
|
||||||
|
id:approvebutton
|
||||||
|
visible:(contact.hasOwnProperty("acct"))
|
||||||
|
height: 6*mm
|
||||||
|
//width: implicitContentWidth+2*mm//8*mm
|
||||||
|
text:qsTr("Approve")
|
||||||
|
onClicked:{
|
||||||
|
|
||||||
}//Column end
|
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/authorize",'',"POST",root,function(returnvalue){
|
||||||
|
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
|
||||||
|
})
|
||||||
|
root.friendsSignal();
|
||||||
|
rootstackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BlueButton{
|
||||||
|
id:rejectbutton
|
||||||
|
visible:(contact.hasOwnProperty("acct"))
|
||||||
|
height: 6*mm
|
||||||
|
//width: implicitContentWidth+2*mm//8*mm
|
||||||
|
text:qsTr("Reject")
|
||||||
|
onClicked:{
|
||||||
|
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/reject",'',"POST",root,function(returnvalue){
|
||||||
|
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
|
||||||
|
})
|
||||||
|
root.friendsSignal();
|
||||||
|
rootstackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BlueButton{
|
||||||
|
id:ignorebutton
|
||||||
|
visible:(contact.hasOwnProperty("acct"))
|
||||||
|
height: 6*mm
|
||||||
|
//width: implicitContentWidth+2*mm//8*mm
|
||||||
|
text:qsTr("Ignore")
|
||||||
|
onClicked:{
|
||||||
|
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/ignore",'',"POST",root,function(returnvalue){
|
||||||
|
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
|
||||||
|
});
|
||||||
|
root.friendsSignal();
|
||||||
|
rootstackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//Flow end
|
||||||
Label {
|
Label {
|
||||||
id: namelabel
|
id: namelabel
|
||||||
x:mm
|
//x:mm
|
||||||
width: contactView.width-2*mm
|
width: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.width-2*mm:contactView.width-17*root.fontFactor*osSettings.bigFontSize
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
text:contact.name+" (@"+contact.screen_name+")"
|
text:contact.name+" (@"+contact.screen_name+")"
|
||||||
wrapMode: Text.Wrap//elide:Text.ElideRight
|
wrapMode: Text.Wrap//elide:Text.ElideRight
|
||||||
color: "#303030"
|
color: "#303030"
|
||||||
font.pixelSize: 4*mm
|
font.pointSize: 1.2*osSettings.bigFontSize
|
||||||
anchors.top: profileImage.bottom
|
font.family: "Noto Sans"
|
||||||
anchors.topMargin: mm
|
anchors.top: contactView.width<35*root.fontFactor*osSettings.systemFontSize?profileImage.bottom:buttonflow.bottom
|
||||||
|
anchors.margins: mm
|
||||||
|
anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
id:detailtext
|
id:detailtext
|
||||||
anchors.top: namelabel.bottom
|
anchors.top: namelabel.bottom
|
||||||
anchors.topMargin: 2*mm
|
anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right
|
||||||
x:mm
|
anchors.margins: 2*mm
|
||||||
width: contactView.width-2*mm
|
//x:mm
|
||||||
|
width: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.width-2*mm:contactView.width-17*root.fontFactor*osSettings.bigFontSize
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
font.pixelSize: 2.5*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
font.family: "Noto Sans"
|
||||||
textFormat:Text.RichText
|
textFormat:Text.RichText
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
|
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
|
||||||
|
@ -173,14 +296,27 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
}//Component end
|
}//Component end
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target:newstab
|
target:xhr
|
||||||
|
function onError(data,url,api,code){
|
||||||
|
if (data !="contactlist"){Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);}
|
||||||
|
contactBusy.running=false;
|
||||||
|
}
|
||||||
|
function onSuccess(data,api){
|
||||||
|
Service.processNews(api,data)
|
||||||
|
replySignal("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target:root
|
||||||
function onContactpostsChanged(){
|
function onContactpostsChanged(){
|
||||||
if (newstab.contactposts.length>0){profileimagesource=newstab.contactposts[0].user.profile_image_url_large}
|
if (root.contactposts.length>0&&root.contactposts[0]!=null){profileimagesource=root.contactposts[0].user.profile_image_url_large}
|
||||||
contactBusy.running=false;
|
contactBusy.running=false;
|
||||||
contactModel.clear();
|
contactModel.clear();
|
||||||
var currentTime= new Date();
|
var currentTime= new Date();
|
||||||
var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts, 'options':globaloptions};
|
var msg = {'currentTime': currentTime, 'model': contactModel,'news':root.contactposts, 'options':globaloptions};
|
||||||
contactWorker.sendMessage(msg)
|
contactWorker.sendMessage(msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,23 +330,24 @@ Rectangle {
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
//font.pixelSize: 3*mm
|
//font.pixelSize: 3*mm
|
||||||
onClicked: {
|
onClicked: {
|
||||||
newsStack.pop()
|
rootstackView.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
xhr.clearParams();
|
xhr.clearParams();
|
||||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||||
xhr.setUrl(login.server);
|
xhr.setUrl(login.server);
|
||||||
xhr.setApi("/api/statuses/user_timeline");
|
if(contact.isFriend==1 || contact.hasOwnProperty("acct")){
|
||||||
|
xhr.setApi("/api/statuses/user_timeline");}
|
||||||
|
else{xhr.setApi("/api/users/show");}
|
||||||
xhr.setParam("user_id",contact.id)
|
xhr.setParam("user_id",contact.id)
|
||||||
xhr.get();
|
xhr.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,19 +36,66 @@ import "qrc:/js/helper.js" as Helperjs
|
||||||
import "qrc:/qml/genericqml"
|
import "qrc:/qml/genericqml"
|
||||||
import "qrc:/qml/newsqml"
|
import "qrc:/qml/newsqml"
|
||||||
|
|
||||||
Rectangle {
|
Page {
|
||||||
id:conversationList
|
id:conversationList
|
||||||
property var news:[]
|
property var news:[]
|
||||||
color: "white"
|
// color: "white"
|
||||||
|
//function backRequested(){pageStack.pop()}
|
||||||
|
// width:root.width
|
||||||
|
// height: root.height-7*mm
|
||||||
|
|
||||||
|
function getDateDiffString (seconds){
|
||||||
|
var timestring="";
|
||||||
|
if (seconds<60) {timestring= Math.round(seconds) + " " +qsTr("seconds");}
|
||||||
|
else if (seconds<90){timestring= Math.round(seconds/60) + " " +qsTr("minute") ;}
|
||||||
|
else if (seconds<3600){timestring= Math.round(seconds/60) + " " +qsTr("minutes");}
|
||||||
|
else if (seconds<5400){timestring= Math.round(seconds/3600) + " " +qsTr("hour");}
|
||||||
|
else if (seconds<86400){timestring= Math.round(seconds/3600) + " " +qsTr("hours");}
|
||||||
|
else if (seconds<129600){timestring= Math.round(seconds/86400) + " " +qsTr("day");}
|
||||||
|
else if (seconds<3888000){timestring= Math.round(seconds/86400) + " " +qsTr("days");}
|
||||||
|
else if (seconds<5832000){timestring= Math.round(seconds/3888000) + " " +qsTr("month");}
|
||||||
|
else if (seconds<69984000){timestring= Math.round(seconds/3888000) + " " +qsTr("months");}
|
||||||
|
else {timestring= Math.round(seconds/46656000) + " " + qsTr("years");}
|
||||||
|
|
||||||
|
return timestring;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getActivitiesView(newsitemobject){
|
||||||
|
var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={};
|
||||||
|
try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_activities')){
|
||||||
|
if (newsitemobject.friendica_activities.like.length>0){
|
||||||
|
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);
|
||||||
|
}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
|
||||||
|
return {likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: conversationView
|
id: conversationView
|
||||||
property string viewtype: "conversation"
|
property string viewtype: "conversation"
|
||||||
x:3*mm
|
//x:3*mm
|
||||||
y:8*mm
|
//y:8*mm
|
||||||
width: conversationList.width-4*mm
|
width: conversationList.width//-4*mm
|
||||||
height:conversationList.height-10*mm
|
height:conversationList.height//-20*mm
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
footer: MessageSend{conversation:true}
|
footer: MessageSend{conversation:true}
|
||||||
|
@ -58,7 +105,7 @@ Rectangle {
|
||||||
BusyIndicator{
|
BusyIndicator{
|
||||||
id: conversationBusy
|
id: conversationBusy
|
||||||
anchors.horizontalCenter: conversationView.horizontalCenter
|
anchors.horizontalCenter: conversationView.horizontalCenter
|
||||||
anchors.top:conversationList.top
|
anchors.top:conversationView.top
|
||||||
anchors.topMargin: 2*mm
|
anchors.topMargin: 2*mm
|
||||||
width:10*mm
|
width:10*mm
|
||||||
height: 10*mm
|
height: 10*mm
|
||||||
|
@ -69,7 +116,7 @@ Rectangle {
|
||||||
target:newstab
|
target:newstab
|
||||||
onConversationChanged:{
|
onConversationChanged:{
|
||||||
if(newstab.conversation.length==0){
|
if(newstab.conversation.length==0){
|
||||||
newsStack.pop()
|
rootstackView.pop()
|
||||||
} else { conversationBusy.running=false;
|
} else { conversationBusy.running=false;
|
||||||
conversationModel.clear();
|
conversationModel.clear();
|
||||||
var currentTime= new Date();
|
var currentTime= new Date();
|
||||||
|
@ -88,16 +135,16 @@ Rectangle {
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
|
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
//newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
|
//newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
|
||||||
newstab.conversation=[];
|
newstab.conversation=[];
|
||||||
|
if (rootstackView.depth>1){ rootstackView.pop()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ Rectangle {
|
||||||
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
anchors.left: contactImage.right
|
anchors.left: contactImage.right
|
||||||
anchors.margins: 1*mm
|
anchors.margins: 1*mm
|
||||||
text:contact.name
|
text:contact.name
|
||||||
|
@ -86,9 +86,8 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
BlueButton {
|
MButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
//width:10*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
|
@ -46,6 +46,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked:{search(hashtagText.text.replace("#",""))}
|
onClicked:{root.searchSignal(hashtagText.text.replace("#",""))}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,9 +43,9 @@ import "qrc:/qml/genericqml"
|
||||||
Rectangle{
|
Rectangle{
|
||||||
color:"#EEEEEE"
|
color:"#EEEEEE"
|
||||||
width:parent.width
|
width:parent.width
|
||||||
height: (newsSwipeview.stacktype!="Notifications")?messageColumn.height+mm:0
|
height: conversation || (newsSwipeview.stacktype!="Notifications")?messageColumn.height+mm:0
|
||||||
id:messageSend
|
id:messageSend
|
||||||
visible:(newsSwipeview.stacktype!="Notifications")?true:false
|
visible:conversation || (newsSwipeview.stacktype!="Notifications")||(newstab.newstabstatus!="Search")?true:false
|
||||||
property string parentId: ""
|
property string parentId: ""
|
||||||
property bool textfocus: false
|
property bool textfocus: false
|
||||||
//property var parentObject:({})
|
//property var parentObject:({})
|
||||||
|
@ -61,14 +61,12 @@ Rectangle{
|
||||||
property var group_allow:login.hasOwnProperty("permissions")?login.permissions[2]:[]
|
property var group_allow:login.hasOwnProperty("permissions")?login.permissions[2]:[]
|
||||||
property var group_deny:login.hasOwnProperty("permissions")?login.permissions[3]:[]
|
property var group_deny:login.hasOwnProperty("permissions")?login.permissions[3]:[]
|
||||||
|
|
||||||
|
|
||||||
function directmessagePrepare(friend){
|
function directmessagePrepare(friend){
|
||||||
messageSend.state="active";
|
messageSend.state="active";
|
||||||
reply_to_user=friend.screen_name;
|
reply_to_user=friend.screen_name;
|
||||||
receiverLabel.text=friend.screen_name;
|
receiverLabel.text=friend.screen_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sendUrls(urls){
|
function sendUrls(urls){
|
||||||
if((urls.length==1 && attachImageURLs.length==0)){
|
if((urls.length==1 && attachImageURLs.length==0)){
|
||||||
attachImage(urls);
|
attachImage(urls);
|
||||||
|
@ -87,15 +85,13 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function attachImage(url){
|
function attachImage(url){
|
||||||
imageAttachment.source=url.toString();
|
imageAttachment.source=url.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
|
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
|
||||||
//xhr.url= login.server + "/api/statuses/update.json";
|
//xhr.url= login.server + "/api/statuses/update.json";
|
||||||
newsBusy.running=true;
|
try{newsBusy.running=true;}catch(e){conversationBusy.running=true}
|
||||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||||
xhr.setUrl(login.server);
|
xhr.setUrl(login.server);
|
||||||
xhr.setApi("/api/statuses/update");
|
xhr.setApi("/api/statuses/update");
|
||||||
|
@ -139,7 +135,7 @@ Rectangle{
|
||||||
reply_to_user=newsitemobject.user.screen_name;
|
reply_to_user=newsitemobject.user.screen_name;
|
||||||
parentId=newsitemobject.id
|
parentId=newsitemobject.id
|
||||||
} else {
|
} else {
|
||||||
messageSend.state="";
|
messageSend.state=null;
|
||||||
reply_to_user="";
|
reply_to_user="";
|
||||||
parentId="";
|
parentId="";
|
||||||
bodyField.text="";
|
bodyField.text="";
|
||||||
|
@ -152,6 +148,9 @@ Rectangle{
|
||||||
Newsjs.listFriends(login,db,function(contacts){
|
Newsjs.listFriends(login,db,function(contacts){
|
||||||
contactModel.clear();
|
contactModel.clear();
|
||||||
for (var i=0;i<contacts.length;i++){
|
for (var i=0;i<contacts.length;i++){
|
||||||
|
if(contacts[i].description!="" &&contacts[i].description!=null){
|
||||||
|
contacts[i].description=Qt.atob(contacts[i].description)
|
||||||
|
}
|
||||||
contactModel.append({"contact":contacts[i]})
|
contactModel.append({"contact":contacts[i]})
|
||||||
}
|
}
|
||||||
contactSelector.visible=true
|
contactSelector.visible=true
|
||||||
|
@ -171,17 +170,36 @@ Rectangle{
|
||||||
// anchors.fill: parent
|
// anchors.fill: parent
|
||||||
// contentHeight: messageColumn.height
|
// contentHeight: messageColumn.height
|
||||||
// boundsBehavior: Flickable.StopAtBounds
|
// boundsBehavior: Flickable.StopAtBounds
|
||||||
|
DropArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
onDropped: {
|
||||||
|
if (messageSend.state==""){messageSend.state="active"}
|
||||||
|
if (drop.keys.includes('text/uri-list')){
|
||||||
|
attachImageURLs.push(drop.text);
|
||||||
|
attachImage(drop.text)}
|
||||||
|
else if (drop.keys.includes('text/html')){
|
||||||
|
bodyField.append(drop.html)}
|
||||||
|
else if (drop.keys.includes('text/plain')){
|
||||||
|
bodyField.append(drop.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Column {
|
Column {
|
||||||
y:0.5*mm
|
y:0.5*mm
|
||||||
id:messageColumn
|
id:messageColumn
|
||||||
spacing: 0.5*mm
|
spacing: 0.5*mm
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 10*mm//implicitHeight
|
height: 11*mm+stackTypeDescription.height//implicitHeight
|
||||||
|
Label{id:stackTypeDescription
|
||||||
|
width: parent.width
|
||||||
|
horizontalAlignment:Text.AlignHCenter
|
||||||
|
text: !conversation &&newsSwipeview.stacktype?qsTr(newsSwipeview.stacktype):""
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
}
|
||||||
TextArea{
|
TextArea{
|
||||||
id:receiverLabel
|
id:receiverLabel
|
||||||
width: messageColumn.width//-8*mm
|
width: messageColumn.width//-8*mm
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
placeholderText:qsTr("to:")
|
placeholderText:qsTr("to:")
|
||||||
text: ""
|
text: ""
|
||||||
visible:false
|
visible:false
|
||||||
|
@ -193,7 +211,7 @@ Rectangle{
|
||||||
id: titleField
|
id: titleField
|
||||||
x: 0.5*mm
|
x: 0.5*mm
|
||||||
width: parent.width-mm
|
width: parent.width-mm
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
placeholderText: qsTr("Title (optional)")
|
placeholderText: qsTr("Title (optional)")
|
||||||
visible: false//(parentId === "") && (bodyField.length>1)
|
visible: false//(parentId === "") && (bodyField.length>1)
|
||||||
onVisibleChanged: if ((visible==true)&&(conversation==true)){
|
onVisibleChanged: if ((visible==true)&&(conversation==true)){
|
||||||
|
@ -211,21 +229,22 @@ Rectangle{
|
||||||
TextArea {
|
TextArea {
|
||||||
id: bodyField
|
id: bodyField
|
||||||
property string contactprefix:""
|
property string contactprefix:""
|
||||||
|
property string placeholder: osSettings.osType=="Linux"? qsTr(" Drop your Content here."):""
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.family: "Noto Sans"
|
font.family: "Noto Sans"
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
placeholderText: conversation?"": qsTr("What's on your mind?")
|
placeholderText: conversation?"": (qsTr("What's on your mind?")+placeholder)
|
||||||
textFormat: TextEdit.RichText //TextEdit.PlainText
|
textFormat: TextEdit.RichText //TextEdit.PlainText
|
||||||
onLineCountChanged: (conversation==true)?conversationView.contentY=conversationView.contentY+3*mm:newsView.contentY=newsView.contentY+3*mm
|
onLineCountChanged: (conversation==true)?conversationView.contentY=conversationView.contentY+3*mm:newsView.contentY=newsView.contentY+3*mm
|
||||||
onLinkActivated:{Qt.openUrlExternally(link)}
|
onLinkActivated:{Qt.openUrlExternally(link)}
|
||||||
onActiveFocusChanged:{
|
onActiveFocusChanged:{//print(placeholder)
|
||||||
if (activeFocus==true){
|
if (activeFocus==true){
|
||||||
if (conversation==true){
|
if (conversation==true){
|
||||||
setParent(conversationModel.get(0).newsitemobject);
|
if(parentId==""){setParent(conversationModel.get(0).newsitemobject);}
|
||||||
messageSend.state="conversation";
|
messageSend.state="conversation";
|
||||||
conversationView.contentY=conversationView.contentY+20*mm
|
try{conversationView.contentY=conversationView.contentY+20*mm}catch(e){}
|
||||||
} else if (textfocus==false){
|
} else if (textfocus==false){
|
||||||
messageSend.state="active";
|
messageSend.state="active";
|
||||||
newsView.positionViewAtBeginning();
|
newsView.positionViewAtBeginning();
|
||||||
|
@ -347,18 +366,18 @@ Rectangle{
|
||||||
height: 12*mm
|
height: 12*mm
|
||||||
x: 0.5*mm
|
x: 0.5*mm
|
||||||
MButton{id:permButton
|
MButton{id:permButton
|
||||||
visible: (newsSwipeview.stacktype!=="DirectMessages")
|
visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages")
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
|
text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
|
||||||
onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
|
onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
|
||||||
}
|
}
|
||||||
MButton {
|
MButton {
|
||||||
id: attachButton
|
id: attachButton
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
text: "\uf03e"
|
text: "\uf03e"
|
||||||
visible:(newsSwipeview.stacktype!="DirectMessages")
|
visible:!conversation?(newsSwipeview.stacktype!="DirectMessages"):true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (attachImageURLs.length>0){//Server currently accepts only one attachment
|
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)
|
Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
|
||||||
|
@ -376,23 +395,23 @@ Rectangle{
|
||||||
MButton{
|
MButton{
|
||||||
id:smileyButton
|
id:smileyButton
|
||||||
text: "\uf118"
|
text: "\uf118"
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
|
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton{
|
MButton{
|
||||||
id:hastagButton
|
id:hastagButton
|
||||||
text: "\uf292"
|
text: "\uf292"
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}}
|
onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}}
|
||||||
}
|
}
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: cancelButton
|
id: cancelButton
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (textfocus==true){messageSend.destroy()}
|
if (textfocus==true){messageSend.destroy()}
|
||||||
|
@ -409,21 +428,21 @@ Rectangle{
|
||||||
}
|
}
|
||||||
MButton {
|
MButton {
|
||||||
id: sendButton
|
id: sendButton
|
||||||
height: 6*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
text: "\uf1d9"
|
text: "\uf1d9"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var title=titleField.text.replace("\"","\'");
|
var title=titleField.text.replace("\"","\'");
|
||||||
var body=bodyField.getFormattedText(0,bodyField.length);
|
var body=bodyField.getFormattedText(0,bodyField.length);
|
||||||
var dmbody=bodyField.getText(0,bodyField.length);
|
var dmbody=bodyField.getText(0,bodyField.length);
|
||||||
if (newsSwipeview.stacktype!=="DirectMessages"){
|
if (conversation || newsSwipeview.stacktype!=="DirectMessages"){
|
||||||
statusUpdate(title,body,parentId,attachImageURLs)}
|
statusUpdate(title,body,parentId,attachImageURLs)}
|
||||||
else {
|
else {
|
||||||
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
|
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
|
||||||
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
|
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
|
||||||
}
|
}
|
||||||
if (conversation==true){
|
if (conversation==true){
|
||||||
newstab.newstabstatus=root.globaloptions.newsViewType; newsStack.pop(null)
|
newstab.newstabstatus=root.globaloptions.newsViewType; rootstackView.pop(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +451,7 @@ Rectangle{
|
||||||
SmileyDialog{id:smileyDialog;x:mm;visible: false}
|
SmileyDialog{id:smileyDialog;x:mm;visible: false}
|
||||||
}
|
}
|
||||||
Component.onCompleted:{
|
Component.onCompleted:{
|
||||||
newsStack.replySignal.connect(setParent);
|
root.replySignal.connect(setParent);
|
||||||
root.directmessageSignal.connect(directmessagePrepare);
|
root.directmessageSignal.connect(directmessagePrepare);
|
||||||
root.uploadSignal.connect(sendUrls);
|
root.uploadSignal.connect(sendUrls);
|
||||||
root.sendtextSignal.connect(sendtext);
|
root.sendtextSignal.connect(sendtext);
|
||||||
|
@ -464,7 +483,7 @@ Rectangle{
|
||||||
target: buttonRow; visible:true
|
target: buttonRow; visible:true
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: titleField; visible:(newsSwipeview.stacktype!="DirectMessages")
|
target: titleField; visible:(!conversation&&newsSwipeview.stacktype!="DirectMessages")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -482,6 +501,9 @@ Rectangle{
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: bodyField; placeholderText:"";focus:true
|
target: bodyField; placeholderText:"";focus:true
|
||||||
}
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: stackTypeDescription; visible:false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ Rectangle{
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
//font.pixelSize: 3*mm
|
|
||||||
text: qsTr("Show all comments")+" (" +comments + ")" //"\uf0dc"
|
text: qsTr("Show all comments")+" (" +comments + ")" //"\uf0dc"
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
|
|
@ -32,19 +32,26 @@
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
AnimatedImage {id:gif;
|
AnimatedImage {id:gif;
|
||||||
width:toprow.width;
|
width:toprow.width;
|
||||||
property string mimetype:""
|
//property string mimetype:""
|
||||||
fillMode: Image.PreserveAspectFit;
|
fillMode: Image.PreserveAspectFit;
|
||||||
onStatusChanged: playing = (status == AnimatedImage.Ready);
|
onStatusChanged: playing = (status == AnimatedImage.Ready)
|
||||||
|
Rectangle{
|
||||||
|
visible: (model.newsitemobject.imageAttachmentList.length>1)&&(gif.status==Image.Ready)
|
||||||
|
opacity: 0.5
|
||||||
|
color: "black"
|
||||||
|
width:imageCountText.contentWidth+mm
|
||||||
|
height: imageCountText.contentHeight+mm
|
||||||
|
x: (gif.width-gif.paintedWidth)/2+gif.paintedWidth-width
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
id: imageCountText
|
||||||
|
text: "+ " + (model.newsitemobject.imageAttachmentList.length-1).toString()
|
||||||
|
color: "white"
|
||||||
|
}
|
||||||
|
}
|
||||||
MouseArea {anchors.fill:parent;
|
MouseArea {anchors.fill:parent;
|
||||||
onClicked:{
|
onClicked:{
|
||||||
if (mimetype!="image/gif"){
|
rootstackView.push("qrc:/qml/newsqml/NewsPhotolist.qml",{"photolistarray": model.newsitemobject.imageAttachmentList})}
|
||||||
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;height:root.height;fillMode: Image.PreserveAspectFit; onStatusChanged: playing = (status == AnimatedImage.Ready);'+
|
|
||||||
'}}',root,"Attachmentlarge")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
134
source-linux/qml/newsqml/NewsPhotolist.qml
Normal file
134
source-linux/qml/newsqml/NewsPhotolist.qml
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
// This file is part of Friendiqa
|
||||||
|
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||||
|
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
|
Page{
|
||||||
|
id:photolistview
|
||||||
|
width:root.width;
|
||||||
|
height:root.height//-7*mm
|
||||||
|
property var photolistarray: []
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: newsphotolistView
|
||||||
|
color: "black"
|
||||||
|
}
|
||||||
|
ListView{
|
||||||
|
id: newsphotolistView
|
||||||
|
anchors.fill: parent
|
||||||
|
orientation: Qt.Horizontal
|
||||||
|
highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
|
||||||
|
model:photolistModel
|
||||||
|
delegate: photoWrapper
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{
|
||||||
|
id: photolistModel
|
||||||
|
}
|
||||||
|
|
||||||
|
MButton {
|
||||||
|
id: closeButton
|
||||||
|
z:2
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 1*mm
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 1*mm
|
||||||
|
text: "\uf057"
|
||||||
|
onClicked: {if (rootstackView.depth>1){ rootstackView.pop()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component {
|
||||||
|
id: photoWrapper
|
||||||
|
|
||||||
|
AnimatedImage {
|
||||||
|
id: realImage;
|
||||||
|
width: photolistview.width; height: photolistview.height
|
||||||
|
antialiasing: true;
|
||||||
|
asynchronous: true
|
||||||
|
autoTransform:true
|
||||||
|
cache: false
|
||||||
|
fillMode: Image.PreserveAspectFit;
|
||||||
|
onStatusChanged: playing = (status == AnimatedImage.Ready);
|
||||||
|
source: url
|
||||||
|
BusyIndicator{
|
||||||
|
running: realImage.status==Image.Loading
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PinchArea {
|
||||||
|
// id:imagePinch
|
||||||
|
// pinch.target: realImage
|
||||||
|
// anchors.fill: realImage
|
||||||
|
// pinch.minimumScale: 0.1
|
||||||
|
// pinch.maximumScale: 10
|
||||||
|
// enabled: false
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BlueButton{
|
||||||
|
width: 5*mm
|
||||||
|
height:photolistview.height
|
||||||
|
anchors.left: newsphotolistView.left
|
||||||
|
visible: newsphotolistView.currentIndex!=0
|
||||||
|
text:"\uf053"
|
||||||
|
fontColor:"grey"
|
||||||
|
border.color: "transparent"
|
||||||
|
color:"transparent"
|
||||||
|
radius:0
|
||||||
|
onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex-1}
|
||||||
|
}
|
||||||
|
|
||||||
|
BlueButton{
|
||||||
|
width: 5*mm
|
||||||
|
height:photolistview.height
|
||||||
|
anchors.right: newsphotolistView.right
|
||||||
|
visible: newsphotolistView.currentIndex!=photolistarray.length-1
|
||||||
|
text:"\uf054"
|
||||||
|
fontColor:"grey"
|
||||||
|
border.color: "transparent"
|
||||||
|
color:"transparent"
|
||||||
|
radius:0
|
||||||
|
onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex+1}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (photolistarray.length>0){
|
||||||
|
photolistarray.forEach(function(photo){
|
||||||
|
photolistModel.append(photo)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,13 +35,27 @@ import "qrc:/js/news.js" as Newsjs
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
|
|
||||||
StackView{
|
Rectangle{
|
||||||
id: newsStack
|
id: newsStack
|
||||||
anchors.fill: parent
|
//anchors.fill: parent
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
property string updateMethodNews: "refresh"
|
property string updateMethodNews: "refresh"
|
||||||
property var allchats: ({})
|
property var allchats: ({})
|
||||||
signal replySignal(var newsobject)
|
|
||||||
property int lastnewsid:0
|
property int lastnewsid:0
|
||||||
|
property string newstabstatus: ""
|
||||||
|
|
||||||
|
BusyIndicator{
|
||||||
|
id: newsBusy
|
||||||
|
//visible: false
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top:parent.top
|
||||||
|
anchors.topMargin: 2*mm
|
||||||
|
width:10*mm
|
||||||
|
height: 10*mm
|
||||||
|
z:2
|
||||||
|
running: false
|
||||||
|
}
|
||||||
|
|
||||||
function newstypeHandling(newstype){
|
function newstypeHandling(newstype){
|
||||||
newsBusy.running=true;
|
newsBusy.running=true;
|
||||||
|
@ -79,19 +93,22 @@ StackView{
|
||||||
break;
|
break;
|
||||||
case "groupnews":
|
case "groupnews":
|
||||||
newsStack.updateMethodNews="refresh";
|
newsStack.updateMethodNews="refresh";
|
||||||
|
newstab.newstabstatus="Groupnews";
|
||||||
Service.showGroups();
|
Service.showGroups();
|
||||||
break;
|
break;
|
||||||
case "search":
|
case "search":
|
||||||
newsView.anchors.topMargin=7*mm;
|
newsView.anchors.topMargin=7*mm;
|
||||||
|
newstab.newstabstatus="Search";
|
||||||
newsBusy.running=false;
|
newsBusy.running=false;
|
||||||
|
var leftoffset=osSettings.osType=="Android"?3*osSettings.bigFontSize:0
|
||||||
var component = Qt.createComponent("qrc:/qml/genericqml/Search.qml");
|
var component = Qt.createComponent("qrc:/qml/genericqml/Search.qml");
|
||||||
var searchItem = component.createObject(newsStack,{y:mm,width:root.width,height: 5*mm});
|
var searchItem = component.createObject(newsStack,{y:mm,x:leftoffset,width:root.width-leftoffset,height: 5*mm});
|
||||||
break;
|
break;
|
||||||
case "refresh":
|
case "refresh":
|
||||||
if (newstab.newstabstatus=="Timeline"){
|
if (newstab.newstabstatus=="Timeline"){
|
||||||
newsStack.updateMethodNews="append"
|
newsStack.updateMethodNews="append"
|
||||||
} else {newsStack.updateMethodNews="refresh"}
|
} else {newsStack.updateMethodNews="refresh"}
|
||||||
//root.contactLoadType="news";
|
//print("Refresh "+newsSwipeview.stacktype+newstab.newstabstatus)
|
||||||
if (newsSwipeview.stacktype=="Home"){
|
if (newsSwipeview.stacktype=="Home"){
|
||||||
Service.updateView(newstab.newstabstatus)
|
Service.updateView(newstab.newstabstatus)
|
||||||
}
|
}
|
||||||
|
@ -121,7 +138,7 @@ StackView{
|
||||||
|
|
||||||
|
|
||||||
function showNews(newsToShow){
|
function showNews(newsToShow){
|
||||||
try{if (newsStack.depth>1){newsStack.pop()}}catch(e){}
|
try{if (rootstackView.depth>1){rootstackView.pop()}}catch(e){}
|
||||||
newsBusy.running=false;
|
newsBusy.running=false;
|
||||||
var currentTime= new Date();
|
var currentTime= new Date();
|
||||||
// downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
|
// downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
|
||||||
|
@ -132,14 +149,12 @@ StackView{
|
||||||
//newsStack.appendNews=false
|
//newsStack.appendNews=false
|
||||||
}
|
}
|
||||||
|
|
||||||
function showContact(contact){ //print(JSON.stringify(contact));
|
|
||||||
//newstab.newstabstatus="Contact";
|
|
||||||
newsStack.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact});
|
|
||||||
}
|
|
||||||
|
|
||||||
function search(term){//print("Search "+term)
|
function search(term){//print("Search "+term)
|
||||||
if (term!=""){
|
if (term!=""){
|
||||||
newstab.newstabstatus="Search";
|
//newstab.newstabstatus="Search";
|
||||||
|
newstabstatus="Search";
|
||||||
newsBusy.running=true;
|
newsBusy.running=true;
|
||||||
newsStack.updateMethodNews="refresh";
|
newsStack.updateMethodNews="refresh";
|
||||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||||
|
@ -151,7 +166,7 @@ StackView{
|
||||||
newsView.anchors.topMargin=mm
|
newsView.anchors.topMargin=mm
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOldNews(){
|
function getOldNews(){print("newstab.newstabstatus" +newstab.newstabstatus)
|
||||||
var currentTime= new Date();
|
var currentTime= new Date();
|
||||||
try{var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;} catch(e){var lastnews_id=99999999999999 }
|
try{var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;} catch(e){var lastnews_id=99999999999999 }
|
||||||
var messagetype=0;
|
var messagetype=0;
|
||||||
|
@ -162,18 +177,28 @@ StackView{
|
||||||
case "Replies":messagetype=3;break;
|
case "Replies":messagetype=3;break;
|
||||||
default:messagetype=0;
|
default:messagetype=0;
|
||||||
}
|
}
|
||||||
if(newstab.newstabstatus=="Timeline"){//print("lastnewsid "+lastnews_id);
|
//if(newstab.newstabstatus=="Timeline"){//print("lastnewsid "+lastnews_id);
|
||||||
|
if(newstabstatus=="Timeline"){
|
||||||
Newsjs.newsfromdb(root.db,root.login, messagetype,function(news){
|
Newsjs.newsfromdb(root.db,root.login, messagetype,function(news){
|
||||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
|
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
|
||||||
newsWorker.sendMessage(msg);
|
newsWorker.sendMessage(msg);
|
||||||
},false,lastnews_id)}
|
},false,lastnews_id)}
|
||||||
else if(newstab.newstabstatus=="Conversations"){
|
//else if(newstab.newstabstatus=="Conversations"){
|
||||||
|
else if(newstabstatus=="Conversations"){
|
||||||
Newsjs.chatsfromdb(root.db,root.login, messagetype,function(news){
|
Newsjs.chatsfromdb(root.db,root.login, messagetype,function(news){
|
||||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
|
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
|
||||||
newsWorker.sendMessage(msg);
|
newsWorker.sendMessage(msg);
|
||||||
},lastnews_id)}
|
},lastnews_id)}
|
||||||
else if (newstab.newstabstatus=="Notifications"){}
|
//else if (newstab.newstabstatus=="Notifications"){}
|
||||||
|
else if (newstabstatus=="Notifications"){}
|
||||||
else{
|
else{
|
||||||
|
switch(newsSwipeview.stacktype){
|
||||||
|
case "Home":messagetype=0;break;
|
||||||
|
case "DirectMessages": messagetype=1;break;
|
||||||
|
case "Notifications":messagetype=2;break;
|
||||||
|
case "Replies":messagetype=3;break;
|
||||||
|
default:messagetype=0;
|
||||||
|
}
|
||||||
//newsStack.appendNews=true;
|
//newsStack.appendNews=true;
|
||||||
try{xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);}catch(e){}
|
try{xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);}catch(e){}
|
||||||
xhr.get()
|
xhr.get()
|
||||||
|
@ -216,12 +241,6 @@ StackView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initialItem: Rectangle {
|
|
||||||
id:newslistRectangle
|
|
||||||
y:1
|
|
||||||
color: "white"
|
|
||||||
//anchors.fill:parent
|
|
||||||
|
|
||||||
Component { id:footerComponent
|
Component { id:footerComponent
|
||||||
Rectangle{
|
Rectangle{
|
||||||
border.color: "#EEEEEE"
|
border.color: "#EEEEEE"
|
||||||
|
@ -229,7 +248,7 @@ StackView{
|
||||||
width:newsView.width
|
width:newsView.width
|
||||||
height:6*mm
|
height:6*mm
|
||||||
Text{
|
Text{
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text:qsTr("More")
|
text:qsTr("More")
|
||||||
}
|
}
|
||||||
|
@ -250,7 +269,7 @@ StackView{
|
||||||
Service.updateView("Replies")
|
Service.updateView("Replies")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {getOldNews();}
|
else {print("Footer newstab.newstabstatus "+newstab.newstabstatus);getOldNews();}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,11 +281,15 @@ StackView{
|
||||||
property bool viewdragged: false
|
property bool viewdragged: false
|
||||||
property bool viewdraggedpositive: false
|
property bool viewdraggedpositive: false
|
||||||
property string viewtype: "news"
|
property string viewtype: "news"
|
||||||
anchors.fill: parent
|
width: parent.width
|
||||||
anchors.margins: mm
|
height: parent.height-3*mm
|
||||||
|
//anchors.fill: parent
|
||||||
|
anchors.margins: 0.5*mm
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
header: MessageSend{id:messagesend;onHeightChanged: newsView.positionViewAtBeginning()}
|
header:
|
||||||
|
MessageSend{id:messagesend;onHeightChanged: newsView.positionViewAtBeginning()}
|
||||||
|
|
||||||
footer: footerComponent
|
footer: footerComponent
|
||||||
model: newsModel
|
model: newsModel
|
||||||
delegate: Newsitem{}
|
delegate: Newsitem{}
|
||||||
|
@ -280,16 +303,16 @@ StackView{
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if((contentY-oldContentY)>15*mm){
|
if((contentY-oldContentY)>15*mm){
|
||||||
swipeIndicator.visible=false;
|
//swipeIndicator.visible=false;
|
||||||
newsSwipeview.height=rootStackItem.height;
|
//newsSwipeview.height=rootstack.height;
|
||||||
newsSwipeview.y=0;
|
//newsSwipeview.y=0;
|
||||||
rootStackItem.state="fullscreen"
|
//rootStackItem.state="fullscreen"
|
||||||
}
|
}
|
||||||
else if ((contentY-oldContentY)<-15*mm){
|
else if ((contentY-oldContentY)<-15*mm){
|
||||||
swipeIndicator.visible=true;
|
//swipeIndicator.visible=true;
|
||||||
newsSwipeview.height=rootStackItem.height-12*mm;
|
//newsSwipeview.height=rootstack.height-12*mm;
|
||||||
newsSwipeview.y=5*mm;
|
//newsSwipeview.y=5*mm;
|
||||||
rootStackItem.state=""
|
//rootStackItem.state=""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,11 +357,12 @@ StackView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onViewdraggedpositiveChanged: {
|
onViewdraggedpositiveChanged: {
|
||||||
if (viewdraggedpositive){
|
if (viewdraggedpositive){print("listview dragged newstab.newstabstatus "+newstab.newstabstatus)
|
||||||
getOldNews();
|
getOldNews();
|
||||||
viewdraggedpositive=false
|
viewdraggedpositive=false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ScrollBar.vertical: ScrollBar { }
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{id: newsModel}
|
ListModel{id: newsModel}
|
||||||
|
@ -348,15 +372,7 @@ StackView{
|
||||||
source: "qrc:/js/newsworker.js"
|
source: "qrc:/js/newsworker.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator{
|
|
||||||
id: newsBusy
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.top:parent.top
|
|
||||||
anchors.topMargin: 2*mm
|
|
||||||
width:10*mm
|
|
||||||
height: 10*mm
|
|
||||||
running: false
|
|
||||||
}
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:downloadNotice
|
id:downloadNotice
|
||||||
property alias text: noticeText.text
|
property alias text: noticeText.text
|
||||||
|
@ -376,23 +392,23 @@ StackView{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: contentWidth
|
width: contentWidth
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text:""
|
text:""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
root.newstypeSignal.connect(newstypeHandling);
|
root.newstypeSignal.connect(newstypeHandling);
|
||||||
root.messageSignal.connect(onFriendsMessages);
|
|
||||||
root.contactdetailsSignal.connect(showContact);
|
root.contactdetailsSignal.connect(showContact);
|
||||||
root.newsSignal.connect(showNews);
|
root.newsSignal.connect(showNews);
|
||||||
|
root.searchSignal.connect(search);
|
||||||
try{newsModel.clear()} catch(e){}
|
try{newsModel.clear()} catch(e){}
|
||||||
swipeIndicator.visible=true;
|
swipeIndicator.visible=true;
|
||||||
newsSwipeview.height=rootStackItem.height-12*mm;
|
//newsSwipeview.height=rootstack.height//-12*mm;
|
||||||
newsSwipeview.y=5*mm;
|
//newsSwipeview.y=5*mm;
|
||||||
rootStackItem.state=""
|
//rootStackItem.state=""
|
||||||
root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
|
root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
|
||||||
|
newstabstatus=newstab.newstabstatus;
|
||||||
var messagetype=0;
|
var messagetype=0;
|
||||||
switch(newsSwipeview.stacktype){
|
switch(newsSwipeview.stacktype){
|
||||||
case "Home":messagetype=0;break;
|
case "Home":messagetype=0;break;
|
||||||
|
@ -401,7 +417,9 @@ StackView{
|
||||||
case "Replies":messagetype=3;break;
|
case "Replies":messagetype=3;break;
|
||||||
default:messagetype=0;
|
default:messagetype=0;
|
||||||
}
|
}
|
||||||
if((newstab.newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
|
|
||||||
|
//if((newstab.newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
|
||||||
|
if((newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
|
||||||
Newsjs.chatsfromdb(db,login,messagetype,function(dbnews,lastid){
|
Newsjs.chatsfromdb(db,login,messagetype,function(dbnews,lastid){
|
||||||
lastnewsid=lastid;
|
lastnewsid=lastid;
|
||||||
showNews(dbnews);
|
showNews(dbnews);
|
||||||
|
@ -413,5 +431,5 @@ StackView{
|
||||||
showNews(dbnews)
|
showNews(dbnews)
|
||||||
})}
|
})}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,20 +31,23 @@
|
||||||
|
|
||||||
import QtQuick 2.11
|
import QtQuick 2.11
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
//import QtQuick.Controls.Styles 2.3
|
|
||||||
//import QtQuick.Dialogs 1.3
|
|
||||||
import "qrc:/qml/newsqml"
|
import "qrc:/qml/newsqml"
|
||||||
|
import "qrc:/qml/genericqml"
|
||||||
import "qrc:/js/news.js" as Newsjs
|
import "qrc:/js/news.js" as Newsjs
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
import "qrc:/js/service.js" as Service
|
import "qrc:/js/service.js" as Service
|
||||||
|
|
||||||
Item {
|
Rectangle{
|
||||||
|
id:newstabitem
|
||||||
|
width:rootstack.width//-5*mm
|
||||||
|
height: rootstack.height-8*mm//rootstack.height-100*mm
|
||||||
|
|
||||||
onHeightChanged: {newsSwipeview.height=height-6*mm}
|
//anchors.fill: parent
|
||||||
|
//onHeightChanged: {newsSwipeview.height=height-5*mm}
|
||||||
Timer {id:contacttimer; interval: 50; running: false; repeat: false
|
Timer {id:contacttimer; interval: 50; running: false; repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
|
|
||||||
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
|
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
|
||||||
|
root.onNewContactsChanged(root.newContacts);
|
||||||
Newsjs.storeNews(login,db,root.news,root)
|
Newsjs.storeNews(login,db,root.news,root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,6 +59,7 @@ Item {
|
||||||
xhr.setUrl(login.server);
|
xhr.setUrl(login.server);
|
||||||
xhr.setApi("/api/conversation/show");
|
xhr.setApi("/api/conversation/show");
|
||||||
xhr.setParam("id",newsitemobject.id)
|
xhr.setParam("id",newsitemobject.id)
|
||||||
|
xhr.setParam("count","200")
|
||||||
xhr.get();
|
xhr.get();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -113,51 +117,101 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onFriendsMessages(friend){
|
|
||||||
newstab.newstabstatus="Contact"
|
// CalendarTab{
|
||||||
Newsjs.newsfromdb(db,root.login.username, 0,function(dbnews){
|
// visible: wideScreen&&rootstackView.depth<2
|
||||||
if (dbnews.length==0){
|
// width: newstabitem.width/3
|
||||||
Newsjs.newsfromdb(db,login.username,0,function(forumnews){
|
// x: newsSwipeview.width
|
||||||
showNews(forumnews)
|
// //anchors.left: newsSwipeview.right
|
||||||
},friend.url)
|
// //anchors.fill: null
|
||||||
}
|
// }
|
||||||
else showNews(dbnews)
|
// Rectangle{
|
||||||
},friend.id)
|
// color: "#F8F8F8"
|
||||||
|
// height: parent.height
|
||||||
|
// width: 0.5*mm
|
||||||
|
// anchors.left: newsSwipeview.right
|
||||||
|
// }
|
||||||
|
BlueButton{
|
||||||
|
x:mm
|
||||||
|
y:mm
|
||||||
|
z:2
|
||||||
|
visible: !wideScreen
|
||||||
|
fontColor: "grey"
|
||||||
|
border.color: "transparent"
|
||||||
|
text: "\uf0c9"
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
onClicked:{
|
||||||
|
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label{
|
LeftDrawerLinux{
|
||||||
text:"\uf0c9 "
|
id:leftDrawer
|
||||||
font.pixelSize: 5* mm
|
property var newstabstatus: newstab.newstabstatus
|
||||||
anchors.left: parent.left
|
visible: wideScreen&&rootstackView.depth<2
|
||||||
anchors.margins: mm
|
width: visible?root.fontFactor*osSettings.systemFontSize*15:0
|
||||||
color: "#B0BEC5"
|
height: root.height-bar.height
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked:{
|
|
||||||
leftDrawer.open()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LeftDrawerAndroid{
|
||||||
|
id: leftDrawerAndroid
|
||||||
}
|
}
|
||||||
}
|
// BlueButton{
|
||||||
Label{
|
// z:2
|
||||||
text:qsTr(newsSwipeview.stacktype)
|
// anchors.left: newsSwipeview.left
|
||||||
font.pixelSize: 3* mm
|
// anchors.verticalCenter: newsSwipeview.verticalCenter//anchors.bottom: newsSwipeview.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
// anchors.margins: mm
|
||||||
anchors.margins: 2*mm
|
// visible: wideScreen && newsSwipeview.currentIndex!=0
|
||||||
}
|
// text:"\uf053"
|
||||||
|
// fontColor:"grey"
|
||||||
|
// border.color: "transparent"
|
||||||
|
// color:"transparent"
|
||||||
|
// radius:0
|
||||||
|
// onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex-1}
|
||||||
|
// }
|
||||||
|
|
||||||
|
// BlueButton{
|
||||||
|
// z:2
|
||||||
|
// anchors.right: newsSwipeview.right
|
||||||
|
// anchors.verticalCenter: newsSwipeview.verticalCenter//anchors.bottom: newsSwipeview.bottom
|
||||||
|
// anchors.margins: mm
|
||||||
|
// visible: wideScreen && newsSwipeview.currentIndex!=3
|
||||||
|
// text:"\uf054"
|
||||||
|
// fontColor:"grey"
|
||||||
|
// border.color: "transparent"
|
||||||
|
// color:"transparent"
|
||||||
|
// radius:0
|
||||||
|
// onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex+1}
|
||||||
|
// }
|
||||||
|
|
||||||
SwipeView{
|
SwipeView{
|
||||||
id: newsSwipeview
|
id: newsSwipeview
|
||||||
property string stacktype:"Home"
|
property string stacktype:"Home"
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
width: parent.width
|
width: wideScreen&&rootstackView.depth<2?newstabitem.width-leftDrawer.width-mm:newstabitem.width-mm//newstabitem.width/3*2:newstabitem.width
|
||||||
height: parent.height-6*mm
|
height: newstabitem.height-4*mm
|
||||||
y: 5*mm
|
x: leftDrawer.width
|
||||||
function onDirectMessage(friend){currentIndex=2}
|
function onDirectMessage(friend){currentIndex=2}
|
||||||
transitions: Transition {
|
// transitions: Transition {
|
||||||
PropertyAnimation { properties: "height";
|
// PropertyAnimation { properties: "height";
|
||||||
easing.type: Easing.InOutQuad
|
// easing.type: Easing.InOutQuad
|
||||||
duration: 1000
|
// duration: 1000
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// Label{
|
||||||
|
// text:"\uf0c9 "
|
||||||
|
// font.pixelSize: 5* mm
|
||||||
|
// anchors.left: parent.left
|
||||||
|
// anchors.margins: mm
|
||||||
|
// color: "#B0BEC5"
|
||||||
|
// MouseArea{
|
||||||
|
// anchors.fill: parent
|
||||||
|
// onClicked:{
|
||||||
|
// leftDrawer.open()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
switch(currentIndex){
|
switch(currentIndex){
|
||||||
|
@ -168,6 +222,7 @@ Item {
|
||||||
default: stacktype="Home";
|
default: stacktype="Home";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//anchors.fill: parent
|
//anchors.fill: parent
|
||||||
Loader{
|
Loader{
|
||||||
id: friendstimeline
|
id: friendstimeline
|
||||||
|
@ -192,16 +247,17 @@ Item {
|
||||||
source:(newsSwipeview.currentIndex==3)? "qrc:/qml/newsqml/NewsStack.qml":""
|
source:(newsSwipeview.currentIndex==3)? "qrc:/qml/newsqml/NewsStack.qml":""
|
||||||
//onLoaded: newsSwipeview.stacktype="Notifications"
|
//onLoaded: newsSwipeview.stacktype="Notifications"
|
||||||
}
|
}
|
||||||
Component.onCompleted: {root.directmessageSignal.connect(onDirectMessage)}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PageIndicator {
|
PageIndicator {
|
||||||
id: swipeIndicator
|
id: swipeIndicator
|
||||||
|
z:5
|
||||||
|
height: root.fontFactor*osSettings.bigFontSize
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
count: newsSwipeview.count
|
count: newsSwipeview.count
|
||||||
currentIndex: newsSwipeview.currentIndex
|
currentIndex: newsSwipeview.currentIndex
|
||||||
|
|
||||||
anchors.bottom: newsSwipeview.bottom
|
anchors.bottom: newsSwipeview.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {root.directmessageSignal.connect(newsSwipeview.onDirectMessage)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,9 @@ Rectangle{
|
||||||
MouseArea {anchors.fill:parent;
|
MouseArea {anchors.fill:parent;
|
||||||
onClicked:{
|
onClicked:{
|
||||||
if(attachment.mimetype=="video/youtube"){
|
if(attachment.mimetype=="video/youtube"){
|
||||||
root.push("qrc:/qml/newsqml/NewsYplayer.qml",{"ytcode":attachment.url,"mimetype":attachment.mimetype});
|
rootstackView.push("qrc:/qml/newsqml/NewsYplayer.qml",{"ytcode":attachment.url,"mimetype":attachment.mimetype});
|
||||||
} else {
|
} else {
|
||||||
root.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": attachment.url,"mimetype": attachment.mimetype});
|
rootstackView.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": attachment.url,"mimetype": attachment.mimetype});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,12 +33,13 @@ import QtMultimedia 5.8
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.12
|
import QtQuick.Controls 2.12
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
|
Page{
|
||||||
id:newsvideofullscreen
|
id:newsvideofullscreen
|
||||||
color:"black"
|
//color:"black"
|
||||||
//border.color: "light grey"
|
//border.color: "light grey"
|
||||||
width:root.width;
|
width:root.width;
|
||||||
height:root.height
|
height:root.height-3*root.fontFactor*osSettings.bigFontSize
|
||||||
property alias source:video.source
|
property alias source:video.source
|
||||||
Text{
|
Text{
|
||||||
id:noticeText
|
id:noticeText
|
||||||
|
@ -46,7 +47,7 @@ Rectangle{
|
||||||
color:"light grey"
|
color:"light grey"
|
||||||
width:parent.width/2
|
width:parent.width/2
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
x:parent.width/2-parent.height/4
|
x:parent.width/2-parent.height/4
|
||||||
y:parent.height/5
|
y:parent.height/5
|
||||||
visible: video.playbackState!=MediaPlayer.PlayingState
|
visible: video.playbackState!=MediaPlayer.PlayingState
|
||||||
|
@ -55,7 +56,7 @@ Rectangle{
|
||||||
Video {id:video;
|
Video {id:video;
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
property string mimetype:""
|
property string mimetype:""
|
||||||
onErrorChanged:{noticeText.font.pixelSize=3*mm;noticeText.text=errorString;}
|
onErrorChanged:{noticeText.font.pointSize=osSettings.bigFontSize;noticeText.text=errorString;}
|
||||||
fillMode: Image.PreserveAspectFit;
|
fillMode: Image.PreserveAspectFit;
|
||||||
autoLoad: true
|
autoLoad: true
|
||||||
autoPlay: true
|
autoPlay: true
|
||||||
|
@ -63,7 +64,7 @@ Rectangle{
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill:parent;
|
anchors.fill:parent;
|
||||||
onClicked:{
|
onClicked:{
|
||||||
root.pop()
|
rootstackView.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +77,7 @@ Rectangle{
|
||||||
z:2
|
z:2
|
||||||
visible:video.playbackState!=MediaPlayer.StoppedState
|
visible:video.playbackState!=MediaPlayer.StoppedState
|
||||||
value: video.position/video.duration
|
value: video.position/video.duration
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill:parent;
|
anchors.fill:parent;
|
||||||
onClicked:{
|
onClicked:{
|
||||||
|
|
|
@ -32,14 +32,16 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import QtQuick 2.8
|
import QtQuick 2.8
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
import "qrc:/js/helper.js" as Helperjs
|
import "qrc:/js/helper.js" as Helperjs
|
||||||
import QtWebView 1.1
|
import QtWebView 1.1
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
|
Page {
|
||||||
id:newsYplayer
|
id:newsYplayer
|
||||||
color:"black"
|
//color:"black"
|
||||||
width:root.width;
|
width:root.width;
|
||||||
height:root.height
|
height:root.height-7*mm
|
||||||
property string url:""
|
property string url:""
|
||||||
property string ytcode:""
|
property string ytcode:""
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import "qrc:/qml/genericqml"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: newsitem
|
id: newsitem
|
||||||
width: newsView.width //parent.width
|
width: newsitemobject.hasOwnProperty("indent")&&newsitemobject.indent>0?parent.width:newsitem.ListView.view.width//parent.width//newsView.width //
|
||||||
height:toprow.height+friendicaActivities.height+controlrow.height+conversationColumn.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
|
height:toprow.height+friendicaActivities.height+controlrow.height+conversationColumn.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
|
||||||
property int itemindex: index
|
property int itemindex: index
|
||||||
property var newsitemobject:model.newsitemobject
|
property var newsitemobject:model.newsitemobject
|
||||||
|
@ -54,28 +54,29 @@ Item {
|
||||||
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
|
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function pushConversation(){
|
function pushConversation(){
|
||||||
if (model.newsitemobject.hasOwnProperty("currentconversation")){
|
if (model.newsitemobject.hasOwnProperty("currentconversation")){
|
||||||
newsStack.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
|
rootstackView.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
|
||||||
else{newsStack.push("qrc:/qml/newsqml/Conversation.qml")};
|
//newsStack.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
|
||||||
|
//else{newsStack.push("qrc:/qml/newsqml/Conversation.qml")};
|
||||||
|
else{rootstackView.push("qrc:/qml/newsqml/Conversation.qml")};
|
||||||
showConversation(index,newsitemobject)
|
showConversation(index,newsitemobject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
|
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width:newsitem.width
|
width:newsitem.width
|
||||||
height:newsitem.height-1
|
height:newsitem.height-1
|
||||||
color: "white"//(newsitemobject.messagetype==1)?"#ffe6e6" : "white"
|
color: "white"
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id:toprow //newscolumn
|
id:toprow //newscolumn
|
||||||
width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *(newsitemobject.indent+1)):newsitem.width//-8*mm
|
width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *(newsitemobject.indent+1)):newsitem.width//-8*mm
|
||||||
x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*(newsitemobject.indent):0
|
x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*(newsitemobject.indent):0
|
||||||
Item{
|
height: newsitemobject.nsfw?5*mm:Math.min(itemHeader.height+itemBody.height,3/4*root.height)
|
||||||
|
clip: true
|
||||||
|
Item{id:itemHeader
|
||||||
height: Math.max(profileImage.height+mm,topFlow.implicitHeight+mm)
|
height: Math.max(profileImage.height+mm,topFlow.implicitHeight+mm)
|
||||||
width: parent.width
|
width: parent.width
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -88,14 +89,14 @@ Item {
|
||||||
source: ((newsitemobject.user.profile_image!="") && (typeof(newsitemobject.user.profile_image)=="string"))? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url
|
source: ((newsitemobject.user.profile_image!="") && (typeof(newsitemobject.user.profile_image)=="string"))? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url
|
||||||
x:1
|
x:1
|
||||||
y:1
|
y:1
|
||||||
width: 7*mm
|
width: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
height: 7*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
//radius:mm
|
//radius:mm
|
||||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||||
}
|
}
|
||||||
Flow{
|
Flow{
|
||||||
id:topFlow
|
id:topFlow
|
||||||
spacing: mm
|
spacing: 0.5*mm
|
||||||
width:parent.width-8*mm
|
width:parent.width-8*mm
|
||||||
anchors.left: profileImage.right
|
anchors.left: profileImage.right
|
||||||
anchors.margins: mm
|
anchors.margins: mm
|
||||||
|
@ -104,7 +105,7 @@ Item {
|
||||||
//color: "grey"
|
//color: "grey"
|
||||||
width:parent.width
|
width:parent.width
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pixelSize: 2.5*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
text: newsitemobject.user.name+" (@"+newsitemobject.user.screen_name+")"+newsitemobject.forumname
|
text: newsitemobject.user.name+" (@"+newsitemobject.user.screen_name+")"+newsitemobject.forumname
|
||||||
}
|
}
|
||||||
|
@ -113,47 +114,46 @@ Item {
|
||||||
id:messageTypeLabel
|
id:messageTypeLabel
|
||||||
color: "grey"
|
color: "grey"
|
||||||
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
|
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.6*osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
id:createdAtLabel
|
id:createdAtLabel
|
||||||
color: "grey"
|
color: "grey"
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.6*osSettings.systemFontSize
|
||||||
horizontalAlignment: Label.AlignRight
|
horizontalAlignment: Label.AlignRight
|
||||||
text: getDateDiffString(newsitemobject.dateDiff) + " " +qsTr("ago")
|
text: " \u00B7 "+getDateDiffString(newsitemobject.dateDiff) + " " +qsTr("ago")
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
id:replytoLabel
|
id:replytoLabel
|
||||||
color: "grey"
|
color: "grey"
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.6*osSettings.systemFontSize
|
||||||
font.family: "Noto Sans"
|
font.family: "Noto Sans"
|
||||||
horizontalAlignment: Label.AlignRight
|
horizontalAlignment: Label.AlignRight
|
||||||
text: try {qsTr("In reply to ")+newsitemobject.reply_user.screen_name
|
text: try {" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name
|
||||||
}catch(e){" "}
|
}catch(e){" "}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Component.onCompleted:print("Newsitemwidth "+newsitem.width+ " Indent "+newsitemobject.indent)
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{id: itemBody
|
||||||
width: toprow.width-2
|
width: toprow.width-2
|
||||||
height: itemMessage.height
|
height: itemMessage.height
|
||||||
onPressAndHold: {
|
onPressAndHold: {pushConversation()}
|
||||||
pushConversation();
|
|
||||||
}
|
|
||||||
Text {
|
Text {
|
||||||
color: "#404040"
|
color: "#404040"
|
||||||
linkColor: "light green"
|
linkColor: "light green"
|
||||||
id: itemMessage
|
id: itemMessage
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
font.family: "Noto Sans"
|
font.family: "Noto Sans"
|
||||||
text: newsitemobject.statusnet_html//newsitemobject.attachmentList.length>0?newsitemobject.text : newsitemobject.statusnet_html
|
font.pointSize: osSettings.systemFontSize
|
||||||
|
text: newsitemobject.statusnet_html
|
||||||
width: toprow.width-2
|
width: toprow.width-2
|
||||||
height:newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
|
//height:newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
|
||||||
//height: implicitHeight
|
height: implicitHeight
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
clip:true
|
clip:true
|
||||||
onLinkActivated:{
|
onLinkActivated:{Qt.openUrlExternally(link)}
|
||||||
Qt.openUrlExternally(link)}
|
|
||||||
Component.onCompleted:{
|
Component.onCompleted:{
|
||||||
if (newsitemobject.messagetype==0){
|
if (newsitemobject.messagetype==0){
|
||||||
var hashtags=[];
|
var hashtags=[];
|
||||||
|
@ -161,24 +161,20 @@ Item {
|
||||||
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
|
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
|
||||||
for (var tags in hashtags){
|
for (var tags in hashtags){
|
||||||
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
|
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (newsitemobject.attachmentList.length>0){
|
if (newsitemobject.imageAttachmentList.length>0){
|
||||||
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
|
if(newsitemobject.imageAttachmentList[0].mimetype.substring(0,5)=="image"){
|
||||||
if(newsitemobject.attachmentList[attachments].mimetype.substring(0,5)=="image"){
|
|
||||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
|
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
|
||||||
var imageQml = component.createObject(toprow,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
|
var imageQml = component.createObject(toprow,{"source":newsitemobject.imageAttachmentList[0].url});
|
||||||
}
|
}
|
||||||
else if(newsitemobject.attachmentList[attachments].mimetype=="text/html"){
|
|
||||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsLink.qml");
|
|
||||||
var linkQml = component.createObject(toprow,{"url":newsitemobject.attachmentList[attachments].url});
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
if (newsitemobject.videoAttachmentList.length>0){
|
||||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
|
var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
|
||||||
//var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
|
//var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
|
||||||
var videoQml = component.createObject(toprow,{"attachment":newsitemobject.attachmentList[attachments]});
|
var videoQml = component.createObject(toprow,{"attachment":newsitemobject.videoAttachmentList[0]});
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newsitemobject.hasOwnProperty("lastcomment")){
|
if (newsitemobject.hasOwnProperty("lastcomment")){
|
||||||
|
@ -190,31 +186,33 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
BlueButton{
|
BlueButton{
|
||||||
width: newsitem.width-8*mm-2
|
width: newsitem.width-2
|
||||||
height:5*mm
|
height:5*mm
|
||||||
//anchors.bottom: messageColumn.bottom//itemMessage.bottom
|
anchors.bottom: toprow.bottom//itemMessage.bottom
|
||||||
visible: itemMessage.implicitHeight>3/4*root.height || newsitemobject.nsfw//messageColumn.implicitHeight>3/4*root.height || newsitemobject.nsfw//itemMessage.implicitHeight>3/4*root.height
|
visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw//messageColumn.implicitHeight>3/4*root.height || newsitemobject.nsfw//itemMessage.implicitHeight>3/4*root.height
|
||||||
text:"\uf078"
|
text:"\uf078"
|
||||||
fontColor:"grey"
|
fontColor:"grey"
|
||||||
border.color: "transparent"
|
border.color: "transparent"
|
||||||
color:"white"
|
color:"white"
|
||||||
// gradient: Gradient {
|
// gradient: Gradient {
|
||||||
// GradientStop { position: 0.0; color: "transparent" }
|
// GradientStop { position: 0.0; color: "transparent" }
|
||||||
// GradientStop { position: 0.5; color: "white" }
|
// GradientStop { position: 0.5; color: "white" }
|
||||||
// }
|
// }
|
||||||
radius:0
|
radius:0
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (text=="\uf078"){
|
if (text=="\uf078"){
|
||||||
itemMessage.height=itemMessage.implicitHeight+10*mm;text="\uf077"
|
toprow.height=toprow.implicitHeight+6*mm;text="\uf077"
|
||||||
} else {
|
} else {
|
||||||
itemMessage.height=Math.min(itemMessage.implicitHeight,3/4*root.height);
|
toprow.height=Math.min(toprow.implicitHeight,3/4*root.height);
|
||||||
text="\uf078";
|
text="\uf078";
|
||||||
newsView.positionViewAtIndex(index,ListView.Beginning);
|
newsView.positionViewAtIndex(index,ListView.Beginning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Bottom row for activities
|
// Bottom row for activities
|
||||||
Flow{
|
Flow{
|
||||||
|
@ -225,7 +223,7 @@ Item {
|
||||||
|
|
||||||
Label{color: "grey"
|
Label{color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
text: friendica_activities_view.likeText
|
text: friendica_activities_view.likeText
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -234,7 +232,7 @@ Item {
|
||||||
}
|
}
|
||||||
Label{color: "grey"
|
Label{color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
text: friendica_activities_view.dislikeText
|
text: friendica_activities_view.dislikeText
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -243,7 +241,7 @@ Item {
|
||||||
}
|
}
|
||||||
Label{color: "grey"
|
Label{color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
text: friendica_activities_view.attendyesText
|
text: friendica_activities_view.attendyesText
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -251,7 +249,7 @@ Item {
|
||||||
}}
|
}}
|
||||||
Label{color: "grey"
|
Label{color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
text: friendica_activities_view.attendnoText
|
text: friendica_activities_view.attendnoText
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -260,7 +258,7 @@ Item {
|
||||||
}
|
}
|
||||||
Label{color: "grey"
|
Label{color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
text: friendica_activities_view.attendmaybeText
|
text: friendica_activities_view.attendmaybeText
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -271,7 +269,7 @@ Item {
|
||||||
id:attendLabel
|
id:attendLabel
|
||||||
color: "grey"
|
color: "grey"
|
||||||
height:3.5*mm
|
height:3.5*mm
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
horizontalAlignment: Label.AlignRight
|
horizontalAlignment: Label.AlignRight
|
||||||
text: (newsitemobject.friendica_activities_view.self.attending)?(qsTr("Attending: ")+ qsTr(newsitemobject.friendica_activities_view.self.attending)):""
|
text: (newsitemobject.friendica_activities_view.self.attending)?(qsTr("Attending: ")+ qsTr(newsitemobject.friendica_activities_view.self.attending)):""
|
||||||
}
|
}
|
||||||
|
@ -280,7 +278,7 @@ Item {
|
||||||
//Bottom row for buttons
|
//Bottom row for buttons
|
||||||
Row{id:controlrow
|
Row{id:controlrow
|
||||||
anchors.top:friendicaActivities.bottom
|
anchors.top:friendicaActivities.bottom
|
||||||
height: 4*mm
|
height: root.fontFactor*osSettings.bigFontSize
|
||||||
CheckBox{
|
CheckBox{
|
||||||
id:likeCheckbox
|
id:likeCheckbox
|
||||||
width:newsitem.width/5 //10*mm
|
width:newsitem.width/5 //10*mm
|
||||||
|
@ -289,10 +287,10 @@ Item {
|
||||||
checked:(model.newsitemobject.friendica_activities_view.self.liked==1)?true:false
|
checked:(model.newsitemobject.friendica_activities_view.self.liked==1)?true:false
|
||||||
indicator: Rectangle{
|
indicator: Rectangle{
|
||||||
implicitWidth: newsitem.width/5 //10*mm
|
implicitWidth: newsitem.width/5 //10*mm
|
||||||
implicitHeight:4*mm
|
implicitHeight:root.fontFactor*osSettings.bigFontSize
|
||||||
Text{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
color:likeCheckbox.checked?"black": "grey"
|
color:likeCheckbox.checked?"black": "grey"
|
||||||
text:likeCheckbox.checked?"\uf118"+"!":"\uf118"
|
text:likeCheckbox.checked?"\uf118"+"!":"\uf118"
|
||||||
|
@ -316,10 +314,10 @@ Item {
|
||||||
checked: (newsitemobject.friendica_activities_view.self.disliked==1)?true:false
|
checked: (newsitemobject.friendica_activities_view.self.disliked==1)?true:false
|
||||||
indicator: Rectangle{
|
indicator: Rectangle{
|
||||||
implicitWidth: newsitem.width/5 //10*mm
|
implicitWidth: newsitem.width/5 //10*mm
|
||||||
implicitHeight:4*mm
|
implicitHeight:root.fontFactor*osSettings.bigFontSize
|
||||||
Text{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
color:dislikeCheckbox.checked?"black": "grey"
|
color:dislikeCheckbox.checked?"black": "grey"
|
||||||
text: dislikeCheckbox.checked?"\uf119"+"!":"\uf119"
|
text: dislikeCheckbox.checked?"\uf119"+"!":"\uf119"
|
||||||
|
@ -343,10 +341,10 @@ Item {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
indicator:Rectangle{
|
indicator:Rectangle{
|
||||||
implicitWidth: newsitem.width/5 //10*mm
|
implicitWidth: newsitem.width/5 //10*mm
|
||||||
implicitHeight:4*mm
|
implicitHeight:root.fontFactor*osSettings.bigFontSize
|
||||||
Text{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
color: favoritedCheckbox.checked?"black":"grey"
|
color: favoritedCheckbox.checked?"black":"grey"
|
||||||
text:"\uf005"
|
text:"\uf005"
|
||||||
|
@ -369,7 +367,7 @@ Item {
|
||||||
id:newsmenusymbol
|
id:newsmenusymbol
|
||||||
color: "grey"
|
color: "grey"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
font.family:fontAwesome.name
|
font.family:fontAwesome.name
|
||||||
text: "\uf142"
|
text: "\uf142"
|
||||||
}
|
}
|
||||||
|
@ -381,10 +379,10 @@ Item {
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
id:newsmenu
|
id:newsmenu
|
||||||
width: 30*mm
|
width: 18*osSettings.FontSize
|
||||||
delegate: MenuItem{
|
delegate: MenuItem{
|
||||||
contentItem: Text{
|
contentItem: Text{
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text: parent.text
|
text: parent.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -394,7 +392,9 @@ Item {
|
||||||
var directmessage=0;
|
var directmessage=0;
|
||||||
if (newsitemobject.messagetype==1){ directmessage=1}
|
if (newsitemobject.messagetype==1){ directmessage=1}
|
||||||
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
|
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
|
||||||
var conversation;newsitem.ListView.view.viewtype=="conversation"?true:false;
|
var conversation;
|
||||||
|
if (newsitem.ListView.view.viewtype=="conversation"){conversation=true}
|
||||||
|
else{conversation=false};
|
||||||
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
|
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -421,10 +421,10 @@ Item {
|
||||||
|
|
||||||
Menu{
|
Menu{
|
||||||
title: qsTr("Attending")
|
title: qsTr("Attending")
|
||||||
width: 20*mm
|
width: 10*osSettings.systemFontSize
|
||||||
delegate: MenuItem{
|
delegate: MenuItem{
|
||||||
contentItem: Text{
|
contentItem: Text{
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
text: parent.text
|
text: parent.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,14 +455,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Action {
|
|
||||||
text: qsTr("Show height")
|
|
||||||
onTriggered: {
|
|
||||||
Helperjs.showMessage("Height",itemMessage.height + "toprow: "+ toprow.height,root)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//MenuItem{
|
//MenuItem{
|
||||||
// text:qsTr("Show on website")
|
// text:qsTr("Show on website")
|
||||||
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
|
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
|
||||||
|
@ -471,8 +463,7 @@ Item {
|
||||||
Column{
|
Column{
|
||||||
id:conversationColumn
|
id:conversationColumn
|
||||||
anchors.top:controlrow.bottom
|
anchors.top:controlrow.bottom
|
||||||
//anchors.right: parent.right
|
|
||||||
width: newsitem.width
|
width: newsitem.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,10 +42,8 @@ Rectangle{
|
||||||
width: messageColumn.width-5*mm
|
width: messageColumn.width-5*mm
|
||||||
height:root.height/2
|
height:root.height/2
|
||||||
|
|
||||||
Button{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -62,20 +60,20 @@ Rectangle{
|
||||||
position:TabBar.Header
|
position:TabBar.Header
|
||||||
TabButton {
|
TabButton {
|
||||||
text:qsTr("Unicode")
|
text:qsTr("Unicode")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Standard")
|
text: qsTr("Standard")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Addon")
|
text: qsTr("Addon")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
text: qsTr("Adult")
|
text: qsTr("Adult")
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +84,7 @@ Rectangle{
|
||||||
anchors.top: closeButton.bottom
|
anchors.top: closeButton.bottom
|
||||||
anchors.topMargin: 1*mm
|
anchors.topMargin: 1*mm
|
||||||
width: smileyDialog.width-2*mm
|
width: smileyDialog.width-2*mm
|
||||||
height: smileyDialog.height-7*mm
|
height: smileyDialog.height-4*root.fontFactor*osSettings.bigFontSize
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: htmlGridTab
|
id: htmlGridTab
|
||||||
GridView {
|
GridView {
|
||||||
|
@ -177,10 +175,6 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id:smileyItem
|
id:smileyItem
|
||||||
|
@ -207,7 +201,7 @@ Rectangle{
|
||||||
width:4.5*mm
|
width:4.5*mm
|
||||||
height: 4.5*mm
|
height: 4.5*mm
|
||||||
textFormat:Text.RichText
|
textFormat:Text.RichText
|
||||||
font.pixelSize: 4*mm
|
font.pointSize: 1.2*osSettings.systemFontSize
|
||||||
text: emoji
|
text: emoji
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
|
|
@ -63,7 +63,7 @@ Rectangle{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateImage(){
|
function updateImage(){
|
||||||
xhr.url= login.server + "/api/friendica/photo/update.json";
|
xhr.url= login.server + "/api/friendica/photo/update.json";
|
||||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||||
xhr.clearParams();
|
xhr.clearParams();
|
||||||
|
@ -119,7 +119,7 @@ function updateImage(){
|
||||||
anchors.rightMargin: 1*mm
|
anchors.rightMargin: 1*mm
|
||||||
spacing:5*mm
|
spacing:5*mm
|
||||||
Text{
|
Text{
|
||||||
font.pixelSize: 3.5*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text:qsTr("Upload to album")
|
text:qsTr("Upload to album")
|
||||||
}
|
}
|
||||||
|
@ -132,17 +132,46 @@ function updateImage(){
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Button{
|
MButton{
|
||||||
id:closeButton
|
id:closeButton
|
||||||
height: 8*mm
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
font.pixelSize: 3*mm
|
width: 2.5*root.fontFactor*osSettings.bigFontSize
|
||||||
onClicked:{photoStack.pop();
|
font.pointSize: osSettings.bigFontSize
|
||||||
//imageDialog.destroy()
|
onClicked:{photoStack.pop()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox{
|
||||||
|
id: album
|
||||||
|
x: 3*mm
|
||||||
|
y: 3*root.fontFactor*osSettings.bigFontSize
|
||||||
|
width: root.width/2;
|
||||||
|
height: 2.5*root.fontFactor*osSettings.bigFontSize//5*mm;
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
editable:true
|
||||||
|
model: albumModel
|
||||||
|
|
||||||
|
// delegate: ItemDelegate {
|
||||||
|
// width: album.width
|
||||||
|
// contentItem: Text {
|
||||||
|
// //text: modelData
|
||||||
|
// color: "white"
|
||||||
|
// font: album.font
|
||||||
|
// font.pixelSize: album.font.pixelSize
|
||||||
|
// elide: Text.ElideRight
|
||||||
|
// verticalAlignment: Text.AlignVCenter
|
||||||
|
// }
|
||||||
|
// //highlighted: album.highlightedIndex === index
|
||||||
|
// }
|
||||||
|
onAccepted: {
|
||||||
|
if (find(currentText) === -1) {
|
||||||
|
albumModel.append({text: editText})
|
||||||
|
currentIndex = find(editText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListModel{id:albumModel}
|
||||||
// Text {
|
// Text {
|
||||||
// text: qsTr("Album")
|
// text: qsTr("Album")
|
||||||
// x: 4*mm; y: 10*mm
|
// x: 4*mm; y: 10*mm
|
||||||
|
@ -161,16 +190,28 @@ function updateImage(){
|
||||||
ListView{
|
ListView{
|
||||||
id: imageUploadView
|
id: imageUploadView
|
||||||
x:3*mm //23*mm
|
x:3*mm //23*mm
|
||||||
y:17*mm
|
y: 11*mm + album.height
|
||||||
width: imageDialog.width-5*mm //25*mm
|
width: imageDialog.width-5*mm //25*mm
|
||||||
height: root.width/2 //25*mm
|
height: parent.height -(9*root.fontFactor*osSettings.bigFontSize)//root.width/2 //25*mm
|
||||||
model: imageUploadModel
|
model: imageUploadModel
|
||||||
delegate: imageDelegate
|
delegate: imageDelegate
|
||||||
footer: imageId==""?imageFooter:null
|
footer: imageId==""?imageFooter:null
|
||||||
clip:true
|
clip:true
|
||||||
orientation: ListView.Horizontal
|
orientation: ListView.Horizontal
|
||||||
spacing: mm
|
spacing: mm
|
||||||
|
DropArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
onDropped: {
|
||||||
|
if (drop.keys.includes('text/uri-list')){
|
||||||
|
var urllist=drop.text.split('\n');
|
||||||
|
for(var i=0;i< urllist.length;i++){
|
||||||
|
attachImage(urllist[i])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BusyIndicator{
|
BusyIndicator{
|
||||||
id: uploadBusy
|
id: uploadBusy
|
||||||
running: false
|
running: false
|
||||||
|
@ -180,6 +221,7 @@ function updateImage(){
|
||||||
width:10*mm
|
width:10*mm
|
||||||
height: 10*mm
|
height: 10*mm
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: imageUploadModel
|
id: imageUploadModel
|
||||||
}
|
}
|
||||||
|
@ -192,7 +234,7 @@ function updateImage(){
|
||||||
Image{
|
Image{
|
||||||
id: uploadImage
|
id: uploadImage
|
||||||
width: root.width/2-mm //20*mm
|
width: root.width/2-mm //20*mm
|
||||||
height: imageUploadView.height-6*mm//height: 14*mm
|
height: imageUploadView.height-(3*root.fontFactor*osSettings.bigFontSize+2*mm)
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source:imageUrl
|
source:imageUrl
|
||||||
onVisibleChanged: descriptionInput.focus=true;
|
onVisibleChanged: descriptionInput.focus=true;
|
||||||
|
@ -207,18 +249,19 @@ function updateImage(){
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
color: "light grey"
|
//color: "light grey"
|
||||||
border.color: "grey"
|
border.color: "grey"
|
||||||
anchors.top: uploadImage.bottom
|
anchors.top: uploadImage.bottom
|
||||||
anchors.topMargin: mm
|
anchors.topMargin: mm
|
||||||
//x: mm; y: 15*mm;
|
//x: mm; y: 15*mm;
|
||||||
width: root.width/2-mm //Math.max(root.width/2-mm, descriptionInput.contentWidth);
|
width: root.width/2-mm //Math.max(root.width/2-mm, descriptionInput.contentWidth);
|
||||||
height: 5*mm;
|
height: 2.5*root.fontFactor*osSettings.bigFontSize +2*mm //5*mm;
|
||||||
TextField{
|
TextField{
|
||||||
//TextInput {
|
//TextInput {
|
||||||
id: descriptionInput
|
id: descriptionInput
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize: 3*mm
|
anchors.margins: mm
|
||||||
|
font.pointSize: osSettings.systemFontSize
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
placeholderText: qsTr("Description")
|
placeholderText: qsTr("Description")
|
||||||
text:description!=""?description:""
|
text:description!=""?description:""
|
||||||
|
@ -248,44 +291,17 @@ function updateImage(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ComboBox{
|
|
||||||
id: album
|
|
||||||
x: 3*mm
|
|
||||||
y: 10*mm
|
|
||||||
width: root.width/2;
|
|
||||||
height: 5*mm;
|
|
||||||
font.pixelSize: 3*mm
|
|
||||||
editable:true
|
|
||||||
model: albumModel
|
|
||||||
|
|
||||||
// delegate: ItemDelegate {
|
|
||||||
// width: album.width
|
|
||||||
// contentItem: Text {
|
|
||||||
// //text: modelData
|
|
||||||
// color: "white"
|
|
||||||
// font: album.font
|
|
||||||
// font.pixelSize: album.font.pixelSize
|
|
||||||
// elide: Text.ElideRight
|
|
||||||
// verticalAlignment: Text.AlignVCenter
|
|
||||||
// }
|
|
||||||
// //highlighted: album.highlightedIndex === index
|
|
||||||
// }
|
|
||||||
onAccepted: {
|
|
||||||
if (find(currentText) === -1) {
|
|
||||||
albumModel.append({text: editText})
|
|
||||||
currentIndex = find(editText)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{id:albumModel}
|
|
||||||
|
|
||||||
Button{
|
Button{
|
||||||
id:uploadButton
|
id:uploadButton
|
||||||
height: 8*mm
|
height: 2*root.fontFactor*osSettings.bigFontSize
|
||||||
x:4*mm; y:root.width/2+18*mm //40*mm
|
x:4*mm;
|
||||||
|
anchors.top:imageUploadView.bottom
|
||||||
|
anchors.topMargin: mm
|
||||||
|
//y:root.width/2+18*mm //40*mm
|
||||||
text: imageId==""?qsTr("Upload"):qsTr("Change")
|
text: imageId==""?qsTr("Upload"):qsTr("Change")
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onClicked:{
|
onClicked:{
|
||||||
if(album.currentText==""){Helperjs.showMessage(qsTr("Error"),qsTr(" No album name given"), imageDialog)}
|
if(album.currentText==""){Helperjs.showMessage(qsTr("Error"),qsTr(" No album name given"), imageDialog)}
|
||||||
else if (imageId!=""){uploadBusy.running=true; updateImage()}
|
else if (imageId!=""){uploadBusy.running=true; updateImage()}
|
||||||
|
|
|
@ -78,7 +78,7 @@ Package {
|
||||||
width:15*mm
|
width:15*mm
|
||||||
anchors.bottom: photoWrapper.bottom
|
anchors.bottom: photoWrapper.bottom
|
||||||
color: "white"
|
color: "white"
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
wrapMode:Text.Wrap
|
wrapMode:Text.Wrap
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -152,6 +152,31 @@ StackView{
|
||||||
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
|
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlueButton{
|
||||||
|
x:mm
|
||||||
|
y:mm
|
||||||
|
z:2
|
||||||
|
visible: !wideScreen
|
||||||
|
fontColor: "grey"
|
||||||
|
border.color: "transparent"
|
||||||
|
text: "\uf0c9"
|
||||||
|
font.pointSize: osSettings.bigFontSize
|
||||||
|
onClicked:{
|
||||||
|
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
|
||||||
|
}
|
||||||
|
|
||||||
|
LeftDrawerLinux{
|
||||||
|
id:leftDrawer
|
||||||
|
property var newstabstatus: newstab.newstabstatus
|
||||||
|
visible: wideScreen&&rootstackView.depth<2
|
||||||
|
width: visible?osSettings.systemFontSize*15:0
|
||||||
|
height: root.height-bar.height
|
||||||
|
}
|
||||||
|
|
||||||
|
LeftDrawerAndroid{
|
||||||
|
id: leftDrawerAndroid
|
||||||
|
}
|
||||||
|
|
||||||
ProgressBar{
|
ProgressBar{
|
||||||
id: newImagesProgress
|
id: newImagesProgress
|
||||||
width: 15*mm
|
width: 15*mm
|
||||||
|
@ -169,8 +194,6 @@ StackView{
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right:updatePhotolist.left
|
anchors.right:updatePhotolist.left
|
||||||
anchors.rightMargin:mm
|
anchors.rightMargin:mm
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
text:"\uf0ee"
|
text:"\uf0ee"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml");
|
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml");
|
||||||
|
@ -184,22 +207,20 @@ StackView{
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right:phototabstatusButton.left
|
anchors.right:phototabstatusButton.left
|
||||||
anchors.rightMargin:mm
|
anchors.rightMargin:mm
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
text:"\uf0ed"
|
text:"\uf0ed"
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
id:photoupdatemenu
|
id:photoupdatemenu
|
||||||
width:40*mm
|
width:8*root.fontFactor*osSettings.bigFontSize
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("All Images")
|
text: qsTr("All Images")
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Imagejs.requestList(root.login,root.db, false, fotostab,function(obj){fotorectangle.newimages=obj})}
|
Imagejs.requestList(root.login,root.db, false, fotostab,function(obj){fotorectangle.newimages=obj})}
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Only new")
|
text: qsTr("Only new")
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Imagejs.requestList(root.login,root.db, true,fotostab,function(obj){fotorectangle.newimages=obj})}
|
Imagejs.requestList(root.login,root.db, true,fotostab,function(obj){fotorectangle.newimages=obj})}
|
||||||
}
|
}
|
||||||
|
@ -213,15 +234,14 @@ StackView{
|
||||||
anchors.topMargin: 0.5*mm
|
anchors.topMargin: 0.5*mm
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin:2*mm
|
anchors.rightMargin:2*mm
|
||||||
height: 6*mm
|
width: Math.max(8*root.fontFactor*osSettings.bigFontSize,implicitWidth)
|
||||||
width: Math.max(10*mm,implicitWidth)
|
|
||||||
text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
|
text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
|
||||||
Menu {
|
Menu {
|
||||||
id:phototabmenu
|
id:phototabmenu
|
||||||
width: 40*mm
|
width: 20*root.fontFactor*osSettings.bigFontSize
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Own Images")
|
text: qsTr("Own Images")
|
||||||
font.pixelSize: 3*mm
|
font.pointSize: osSettings.bigFontSize
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
fotostab.phototabstatus="Images";
|
fotostab.phototabstatus="Images";
|
||||||
// phototabstatusButton.text=qsTr("Own images");
|
// phototabstatusButton.text=qsTr("Own images");
|
||||||
|
@ -246,8 +266,10 @@ StackView{
|
||||||
id: albumgridview
|
id: albumgridview
|
||||||
cellWidth: 17*mm
|
cellWidth: 17*mm
|
||||||
cellHeight: 17*mm
|
cellHeight: 17*mm
|
||||||
x: mm;y:8*mm
|
x: leftDrawer.width//mm;
|
||||||
width: parent.width-2*mm; height: parent.height-9*mm
|
y:8*mm
|
||||||
|
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm //parent.width-2*mm;
|
||||||
|
height: parent.height-9*mm
|
||||||
clip: true
|
clip: true
|
||||||
model: visualphotoModel.parts.album
|
model: visualphotoModel.parts.album
|
||||||
footer:Rectangle{
|
footer:Rectangle{
|
||||||
|
@ -256,7 +278,7 @@ StackView{
|
||||||
width:12*mm
|
width:12*mm
|
||||||
height:6*mm
|
height:6*mm
|
||||||
Text{
|
Text{
|
||||||
font.pixelSize: 1.5*mm
|
font.pointSize: 0.75*osSettings.systemFontSize
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text:qsTr("More")
|
text:qsTr("More")
|
||||||
}
|
}
|
||||||
|
@ -282,11 +304,9 @@ StackView{
|
||||||
|
|
||||||
MButton {
|
MButton {
|
||||||
id: backButton
|
id: backButton
|
||||||
height: 6*mm
|
|
||||||
width: 8*mm
|
|
||||||
text: "\uf057"
|
text: "\uf057"
|
||||||
x: parent.width - backButton.width - 3*mm
|
x: parent.width - backButton.width - root.fontFactor*osSettings.bigFontSize
|
||||||
y: -backButton.height - 4*mm
|
y: -backButton.height - root.fontFactor*osSettings.bigFontSize
|
||||||
z:2
|
z:2
|
||||||
onClicked: {photoBackground.opacity=0}
|
onClicked: {photoBackground.opacity=0}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ Package {
|
||||||
wrapMode:Text.Wrap
|
wrapMode:Text.Wrap
|
||||||
color: "white"
|
color: "white"
|
||||||
font.family: "Monospace"
|
font.family: "Monospace"
|
||||||
font.pixelSize: 2*mm
|
font.pointSize: osSettings.systemFontSize
|
||||||
anchors.bottom: albumWrapper.bottom
|
anchors.bottom: albumWrapper.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ Package {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressAndHold:{
|
onPressAndHold:{
|
||||||
var menuString="import QtQuick.Controls 1.4; Menu {MenuItem{text:qsTr('Delete on client and server'); onTriggered: {deletepics('album',albumname);photogroupModel.remove(index)}}}";
|
var menuString="import QtQuick.Controls 2.12; Menu {MenuItem{text:qsTr('Delete on client and server'); onTriggered: {deletepics('album',albumname);photogroupModel.remove(index)}}}";
|
||||||
var albummenuObject=Qt.createQmlObject(menuString,albumWrapper,"albummenuOutput")
|
var albummenuObject=Qt.createQmlObject(menuString,albumWrapper,"albummenuOutput")
|
||||||
albummenuObject.popup()
|
albummenuObject.popup()
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
BIN
source-linux/translations/friendiqa-hu.qm
Normal file
BIN
source-linux/translations/friendiqa-hu.qm
Normal file
Binary file not shown.
1534
source-linux/translations/friendiqa-hu.ts
Normal file
1534
source-linux/translations/friendiqa-hu.ts
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue