v0.5.3 events and indentation

This commit is contained in:
LubuWest 2020-05-24 21:14:23 +02:00
commit 18c7255b91
103 changed files with 1601 additions and 1906 deletions

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -36,7 +36,7 @@ Item {
id: calendarDay
width:7*mm
height: 7*mm
property int dateInt: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 {
id: placeHolder
color: 'lightblue'; antialiasing: true
@ -54,7 +54,7 @@ Item {
}
Rectangle {
id:eventRect
color:"black"
color:"grey"
anchors.margins: 0.5*mm
anchors.bottom: calendarDay.bottom
width: parent.width-mm
@ -64,15 +64,9 @@ Item {
MouseArea {
anchors.fill: calendarDay
onClicked: {
var eventDate=[];
var idx = eventdays.indexOf(dateInt);
while (idx != -1) {
eventDate.push(idx);
idx = eventdays.indexOf(dateInt,idx + 1)
}
var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
if (component.status== Component.Ready){
var eventlist = component.createObject(calendartab,{"daylist": eventDate})}
var eventlist = component.createObject(calendartab,{"dayint": dateInt})}
}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import QtQml 2.2
import Qt.labs.calendar 1.0
//import QtQuick.Controls 1.2 as Oldcontrol
@ -51,7 +51,7 @@ Rectangle {
property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
property var events:[]
property var eventdays:[]
//onEventdaysChanged: print(JSON.stringify(eventdays))
function showEvents(friend){
if(friend=="backButton"){Service.eventsfromdb(db,login.username,function(eventArray,dayArray){
@ -94,9 +94,24 @@ Rectangle {
width: 8*mm
text:"\uf021"
onClicked: {
Service.getEvents(db,login, calendartab,function(){
showEvents("")
})}}
calBusy.running=true;
updatenews.setDatabase();
updatenews.login();
updatenews.events();
// Service.getEvents(db,login, calendartab,function(){
// showEvents("")
// })
}}
Connections{
target: updatenews
onSuccess:{
calBusy.running=false;
showEvents("")
}
}
MButton{
id: calendartabstatusButton

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -44,7 +44,7 @@ Rectangle{
x:mm
y:mm
property var daylist:[]
property int dayint: 0
MButton{
id:closeButton
anchors.top: parent.top
@ -71,10 +71,12 @@ Rectangle{
id: eventModel
}
Component.onCompleted:{
for (var i=0; i<daylist.length;i++){
var liststate="";if(daylist.length<2){liststate="large"}
eventModel.append({"event":events[daylist[i]],"eventstatus":liststate});
Component.onCompleted:{//print("daylist"+JSON.stringify(daylist) + dayint)
var currentevents=events.filter(event=>(dayint>=event.startday)&&(dayint<=event.endday));
for (var i=0; i<currentevents.length;i++){
var liststate="";if(currentevents.length<2){liststate="large"};
//print(JSON.stringify(events[daylist[i]]));
eventModel.append({"event":currentevents[i],"eventstatus":liststate});
}
}
@ -86,26 +88,39 @@ Rectangle{
height:eventNameText.height+eventDetailsText.height+mm
border.color: "light grey"
border.width: 1
Text {
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:mm
width:parent.width
x: 8*mm
width:parent.width-8*mm
height:contentHeight
text: new Date(event.start+calendarrectangle.offsetTime).toLocaleTimeString()+": "+event.title
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:mm
x:8*mm
z:4
width: parent.width
width: parent.width-8*mm
height: contentHeight
text: status==""?"":Qt.atob(event.html)
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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/layout.js" as Layoutjs
@ -61,6 +61,8 @@ Page{
x: mm
y: mm
width: root.width/2
visible: users.length>0
onClicked:{
var useritems="";
for (var i=0;i<accountPage.users.length;i++){
@ -73,11 +75,10 @@ Page{
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
newsTypeField.text=obj.newsViewType;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},'username','"+ accountPage.users[i].username+"')}}"
}
var menuString="import QtQuick.Controls 2.4;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
userlistObject.popup() }
}
@ -109,11 +110,11 @@ Page{
// font.pixelSize:3*mm
// x: 4*mm; y: 50*mm
// }
Text {
text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y: 50*mm
}
// Text {
// text: qsTr("News as")
// font.pixelSize:3*mm
// x: 4*mm; y: 50*mm
// }
// Text {
@ -173,7 +174,7 @@ Page{
Rectangle{
color: "light grey"
x: 4*mm; y: 23.5*mm; width: root.width-14*mm; height: 5*mm;
x: 4*mm; y: 23.5*mm; width: root.width-6*mm; height: 5*mm;
TextInput {
id: username
anchors.fill: parent
@ -186,14 +187,14 @@ Page{
}
}
}
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)})
}
}
// 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"
@ -261,20 +262,20 @@ Page{
// }
// }
Rectangle{
x: 4*mm; y: 53.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
color:"light grey"
Text{
id: newsTypeField
anchors.fill: parent
font.pixelSize:3*mm
text:"Conversations"
}
MouseArea{
anchors.fill:parent
onClicked:newstypemenu.popup()
}
}
// Rectangle{
// x: 4*mm; y: 53.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
// color:"light grey"
// Text{
// id: newsTypeField
// anchors.fill: parent
// font.pixelSize:3*mm
// text:"Conversations"
// }
// MouseArea{
// anchors.fill:parent
// onClicked:newstypemenu.popup()
// }
// }
BusyIndicator{
id: accountBusy
@ -306,7 +307,7 @@ Page{
font.pixelSize: 3*mm
onClicked:{
accountBusy.running=true;
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text, maxnews:"",interval: "",newsViewType:newsTypeField.text};
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text, maxnews:"",interval: ""};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
@ -322,6 +323,7 @@ Page{
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
}
else{
if (users.length==0){Service.setDefaultOptions(db);}
filesystem.Directory=userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
@ -352,6 +354,7 @@ Page{
Button {
x: parent.width/2+2*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "-"
font.pixelSize: 3*mm
onClicked:{
@ -368,7 +371,7 @@ Page{
password.text="";
imagestore.text="";
//maxNews.value=0;
newsTypeField.text="Conversations";
//newsTypeField.text="Conversations";
//messageIntervalSlider.value=30;
userButton.text=qsTr("User");
Helperjs.readData(db,"config","",function(storedUsers){
@ -381,6 +384,7 @@ Page{
Button {
x: parent.width/2+8*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "+"
font.pixelSize: 3*mm
onClicked:{
@ -391,7 +395,7 @@ Page{
password.text=""
imagestore.text=""
//maxNews.value=0
newsTypeField.text="Conversations"
//newsTypeField.text="Conversations"
//messageIntervalSlider.value=30
userButton.text=qsTr("User")
}
@ -409,6 +413,7 @@ Page{
id:closeButton
height: 8*mm
width: 5*mm
visible: users.length>0
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
@ -417,19 +422,19 @@ Page{
font.pixelSize: 3*mm
onClicked:{root.pop()}
}
Menu {
id:newstypemenu
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Timeline")
onTriggered: {newsTypeField.text="Timeline"}
}
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Conversations")
onTriggered: {newsTypeField.text="Conversations"}
}
}
// Menu {
// id:newstypemenu
// MenuItem {
// font.pixelSize: 3*mm
// text: qsTr("Timeline")
// onTriggered: {newsTypeField.text="Timeline"}
// }
// MenuItem {
// font.pixelSize: 3*mm
// text: qsTr("Conversations")
// onTriggered: {newsTypeField.text="Conversations"}
// }
// }
Component.onCompleted: {
try{Helperjs.readData(db,"config","",function(storedUsers){
@ -445,12 +450,12 @@ Page{
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
//maxNews.value=obj.maxnews;
newsTypeField.text=obj.newsViewType;
//newsTypeField.text=obj.newsViewType;
//messageIntervalSlider.value=obj.timerInterval;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},"isActive",0)
})}
catch (e){print(e)
catch (e){//print("onCompleted" +users.count +e)
// Helperjs.friendicaWebRequest("https://dir.friendica.social/servers/surprise",accountPage,function(html){
// print(html);
// var bpos=html.indexOf("base ");

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,11 +31,9 @@
import QtQuick 2.11
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
//import "qrc:/js/layout.js" as Layoutjs
//import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
@ -43,85 +41,92 @@ Page{
//anchors.fill: parent
width:root.width
height:root.height
//contentHeight: configBackground.height
//boundsBehavior: Flickable.StopAtBounds
// Rectangle{
// id:configBackground
// color: "white"
// anchors.fill: parent
// width:parent.width
// height:Math.max(90*mm,root.height-12*mm)
// property var users:[]
// property bool registeredUser: true
// property var userdata: ({})
// Text {
// text: qsTr("Image dir.")
// //text: qsTr("Max. News")
// font.pixelSize:3*mm
// x: 4*mm; y: 10*mm
// }
Text {
text: qsTr("Max. News")
//text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y:10*mm
Rectangle{
x: 4*mm; y:13.5*mm; width: parent.width - 14*mm; height: 5*mm;
color:"light grey"
radius: 0.5*mm
Text{
anchors.fill: parent
font.pixelSize:3*mm
text:qsTr("Sync")
}
MouseArea{
anchors.fill:parent
onClicked:root.push("qrc:qml/configqml/SyncConfig.qml");
}
}
// Text {
// text: qsTr("Show Website")
// x: 4*mm; y: 40*mm; width: 20*mm
// }
Text {
text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y: 20*mm
}
Rectangle{
x: 4*mm; y: 23.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
color:"light grey"
radius: 0.5*mm
Text{
id: newsTypeField
anchors.fill: parent
font.pixelSize:3*mm
text:qsTr("Conversations")
}
MouseArea{
anchors.fill:parent
onClicked:newstypemenu.popup()
}
}
Menu {
id:newstypemenu
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Timeline")
onTriggered: {newsTypeField.text=qsTr("Timeline");
Service.updateglobaloptions(root.db,"newsViewType","Timeline");}
}
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Conversations")
onTriggered: {newsTypeField.text=qsTr("Conversations");
Service.updateglobaloptions(root.db,"newsViewType","Conversations");}
}
}
// Rectangle{color: "light grey"; x: 4*mm; y: 13.5*mm; width: root.width-14*mm; height: 5*mm;}
// Flickable {
// id: imagestoreFlickable
// x: 4*mm; y: 13.5*mm; width: root.width-14*mm; height: 5*mm;
// clip: true
// TextInput {
// id: imagestore
// width: imagestoreFlickable.width
// height: imagestoreFlickable.height
// font.pixelSize:3*mm
// wrapMode: TextEdit.NoWrap
// onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
// }
// }
// FileDialog {
// id: imagestoreDialog
// title: "Please choose a directory"
// folder: shortcuts.pictures
// selectFolder: true
// onAccepted: {
// var imagestoreString=imagestoreDialog.folder.toString();
// imagestoreString=imagestoreString.replace(/^(file:\/{2})/,"")+"/"
// imagestore.text=imagestoreString
// }
// }
// Button {
// x: root.width-9*mm; y: 13.5*mm; width: 7*mm; height: 8*mm;
// text: "..."
// onClicked:
// {imagestoreDialog.open()}
// }
Text {
text: qsTr("Max. News")
font.pixelSize:3*mm
x: 4*mm; y:30*mm
}
Slider{ id: maxNews
x:19*mm; y: 13.5*mm;width: root.width/2;height:5*mm
x:19*mm; y: 33.5*mm;width: root.width/2;height:5*mm
from: 0;to:2000; stepSize: 100
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;
radius: 0.5*mm
TextEdit{id:maxNewsText;
anchors.fill: parent
font.pixelSize:3*mm
verticalAlignment:TextEdit.AlignRight
text:maxNews.value
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"max_news",text);
}
}
}
CheckBox{
id: nsfwCheckbox
x: 4*mm
y: 33.5*mm
y: 43.5*mm
font.pixelSize: 3*mm
//width:5*mm
text: qsTr("Hide #nsfw?")
@ -137,69 +142,6 @@ Page{
}
}
Rectangle{color: "light grey"; x: 4*mm; y: 13.5*mm; width: 9*mm; height: 5*mm;
radius: 0.5*mm
TextEdit{id:maxNewsText;
anchors.fill: parent
font.pixelSize:3*mm
verticalAlignment:TextEdit.AlignRight
text:maxNews.value
focus: true
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"max_news",text);
}
}
}
Rectangle{
x: 4*mm; y:23.5*mm; width: parent.width - 14*mm; height: 5*mm;
color:"light grey"
radius: 0.5*mm
Text{
anchors.fill: parent
font.pixelSize:3*mm
text:qsTr("Sync")
}
MouseArea{
anchors.fill:parent
onClicked:root.push("qrc:qml/configqml/SyncConfig.qml");
}
}
// Slider{ id: messageIntervalSlider
// x:22*mm; y: 73.5*mm;width: root.width/2;height:5*mm
// from: 0;to:120; stepSize: 15
// }
// Rectangle{
// x: 4*mm; y: 73.5*mm; width: 9*mm; height: 5*mm;
// TextEdit{
// id: messageIntervalField
// anchors.fill: parent
// font.pixelSize:3*mm
// verticalAlignment:TextEdit.AlignRight
// text:messageIntervalSlider.value
// focus: true
// selectByMouse: true
// }
// }
// Text{x: 14*mm; y: 73.5*mm; width: 5*mm; height: 5*mm;
// font.pixelSize:3*mm
// text:qsTr("Min.")
// }
// CheckBox{
// id:showwebsiteCheckbox
// x:35*mm;y:80*mm
// onClicked:{
// if (checked==true){
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","true")
// root.globaloptions.showWebsiteForLinks="true"
// }
// else {
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","false")
// root.globaloptions.showWebsiteForLinks="false"
// }
// }
// }
MButton {
anchors.right: closeButton.left; anchors.rightMargin: mm;
@ -224,22 +166,4 @@ Page{
font.pixelSize: 3*mm
onClicked:{root.pop()}
}
// Menu {
// id:newstypemenu
// MenuItem {
// text: qsTr("Timeline")
// onTriggered: {newsTypeField.text="Timeline"}
// }
// MenuItem {
// text: qsTr("Conversations")
// onTriggered: {newsTypeField.text="Conversations"}
// }
// }
// Component.onCompleted: {
// Service.readGlobaloptions(db,function(go){
// if(go.hasOwnProperty("max_news")){maxNews.value=go.max_news}else{maxNews.value=1000}
// //if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
// })
// }
}

View file

@ -1,482 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 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.7
import QtQuick.Dialogs 1.2
import QtQuick.Controls 1.2
import "qrc:/js/service.js" as Service
import "qrc:/js/layout.js" as Layoutjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
StackView{
id: configStack
anchors.fill:parent
initialItem: Flickable{
width:root.width-5*mm
height:root.height-12*mm
contentHeight: configBackground.height
boundsBehavior: Flickable.StopAtBounds
Rectangle{
id:configBackground
color: "white"
width:parent.width
height:Math.max(90*mm,root.height-12*mm)
property var users:[]
property bool registeredUser: true
property var userdata: ({})
function setServericon(server){
try {Helperjs.friendicaWebRequest(server+"/api/statusnet/config",configBackground, function (obj){
var serverdata = JSON.parse(obj);
servericon.visible=true;
servericon.source=serverdata.site.logo})} catch(e){print(e)}
}
BlueButton{
id:userButton
text:qsTr("User")
y:mm
width: root.width/2
onClicked:{
var useritems="";
for (var i=0;i<configBackground.users.length;i++){
useritems=useritems+"MenuItem{text:'"+configBackground.users[i].username+
"'; onTriggered: {Service.readConfig(db,function(obj){
configBackground.registeredUser=true;
userButton.text=obj.username;
servername.text=obj.server;
configBackground.setServericon(obj.server);
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
maxNews.value=obj.maxnews;
newsTypeField.text=obj.newsViewType;
if( obj.isActive==0){userButton.fontColor='black'} else {userButton.fontColor='grey'}
},'username','"+configBackground.users[i].username+"')}}"
}
var menuString="import QtQuick.Controls 1.4;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var userlistObject=Qt.createQmlObject(menuString,configBackground,"usermenuOutput")
userlistObject.popup() }
}
Text {
text: qsTr("Server")
font.pixelSize:3*mm
x: 4*mm; y: 10*mm
}
Text {
text: qsTr("Nickname")
font.pixelSize:3*mm
x: 4*mm; y: 20*mm
}
Text {
text: qsTr("Password")
font.pixelSize:3*mm
x: 4*mm; y: 30*mm
}
Text {
text: qsTr("Image dir.")
font.pixelSize:3*mm
x: 4*mm; y: 40*mm
}
Text {
text: qsTr("Max. News")
font.pixelSize:3*mm
x: 4*mm; y: 50*mm
}
Text {
text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y: 60*mm
}
Text {
text: qsTr("Sync Interval (0=None)")
font.pixelSize:3*mm
//visible: false
x: 4*mm; y: 70*mm; //width:35*mm;wrapMode: Text.Wrap
}
// Text {
// text: qsTr("Show Website")
// x: 4*mm; y:80*mm; width: 20*mm
// }
Image{
id:servericon
x:4*mm;y:13.5*mm
width:5*mm; height: 5*mm
visible: false
source:""
MouseArea{
anchors.fill:parent
onClicked:{
Service.showServerConfig(servername.text, configBackground, function(configString){
var serverconfigObject=Qt.createQmlObject(configString,configBackground,"serverconfigOutput");})
}
}
}
BlueButton{
id:serverSearchButton
text:"\uf002"
x:4*mm
y:13.5*mm
width: 5*mm; height:5*mm
visible: servericon.visible?false:true
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 {
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
width: servernameFlickable.width
height: servernameFlickable.height
focus: true
font.pixelSize:3*mm
text:"https://..."
onEditingFinished:{
if((servername.text).substring(0,14) =="https://...http"){
serverstring.text= (serverstring.text).substring(11)
}
configBackground.setServericon(servername.text)
}
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,servernameFlickable)
}
}
Rectangle{
color: "light grey"
x: 4*mm; y: 23.5*mm; width: root.width-14*mm; height: 5*mm;
TextInput {
id: username
anchors.fill: parent
font.pixelSize:3*mm
selectByMouse: true
onEditingFinished:{
if (username.text.indexOf('@')>-1){
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),configBackground)
}
// Helperjs.friendicaWebRequest(servername.text+'/api/users/show?screen_name='+username.text,configBackground,function(obj){
// var screennametest=JSON.parse(obj);
// if (screennametest.hasOwnProperty('status')){
// Helperjs.showMessage(qsTr("Error"),qsTr("Nickname not registered at given server!"),configBackground);
// configBackground.registeredUser=false;
// }else{configBackground.registeredUser=true}
// });
// }
}
}
}
BlueButton {
x: root.width-9*mm; y: 23.5*mm; width:7*mm
text: "\uf234"
onClicked: {
configStack.push({item:"qrc:/qml/configqml/RegisterPage.qml",properties:{url:servername.text+"/register?nickname="+username.getText(0,username.length)}})
}
}
Rectangle{
color: "light grey"
x: 4*mm; y: 33.5*mm; width: root.width-6*mm; height: 5*mm;
TextInput {
id: password
anchors.fill: parent
font.pixelSize:3*mm
selectByMouse: true
echoMode: TextInput.PasswordEchoOnEdit
}
}
Rectangle{color: "light grey"; x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;}
Flickable {
id: imagestoreFlickable
x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;
clip: true
TextInput {
id: imagestore
width: imagestoreFlickable.width
height: imagestoreFlickable.height
font.pixelSize:3*mm
wrapMode: TextEdit.NoWrap
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
}
}
FileDialog {
id: imagestoreDialog
title: "Please choose a directory"
folder: shortcuts.pictures
selectFolder: true
onAccepted: {
var imagestoreString=imagestoreDialog.folder.toString();
imagestoreString=imagestoreString.replace(/^(file:\/{2})/,"")+"/"
imagestore.text=imagestoreString
}
}
BlueButton {
x: root.width-9*mm; y: 43.5*mm; width: 7*mm; height: 5*mm;
text: "..."
onClicked:
{imagestoreDialog.open()}
}
Slider{ id: maxNews
x:19*mm; y: 53.5*mm;width: root.width/2;height:5*mm
minimumValue: 0;maximumValue:2000; stepSize: 100
}
Rectangle{color: "light grey"; x: 4*mm; y: 53.5*mm; width: 9*mm; height: 5*mm;
TextEdit{id:maxNewsText;
anchors.fill: parent
font.pixelSize:3*mm
verticalAlignment:TextEdit.AlignRight
text:maxNews.value
focus: true
selectByMouse: true
}
}
Rectangle{
x: 4*mm; y: 63.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
color:"light grey"
Text{
id: newsTypeField
anchors.fill: parent
font.pixelSize:3*mm
text:"Conversations"
}
MouseArea{
anchors.fill:parent
onClicked:newstypemenu.popup()
}
}
Slider{ id: messageIntervalSlider
x:22*mm; y: 73.5*mm;width: root.width/2;height:5*mm
minimumValue: 0;maximumValue:120; stepSize: 15
}
Rectangle{
x: 4*mm; y: 73.5*mm; width: 9*mm; height: 5*mm;
TextEdit{
id: messageIntervalField
anchors.fill: parent
font.pixelSize:3*mm
verticalAlignment:TextEdit.AlignRight
text:messageIntervalSlider.value
focus: true
selectByMouse: true
}
}
Text{x: 14*mm; y: 73.5*mm; width: 5*mm; height: 5*mm;
font.pixelSize:3*mm
text:qsTr("Min.")
}
// CheckBox{
// id:showwebsiteCheckbox
// x:35*mm;y:80*mm
// onClicked:{
// if (checked==true){
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","true")
// root.globaloptions.showWebsiteForLinks="true"
// }
// else {
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","false")
// root.globaloptions.showWebsiteForLinks="false"
// }
// }
// }
BlueButton {
x: 4*mm; y: 83.5*mm
text: qsTr("Confirm")
onClicked:{
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text,maxnews:maxNewsText.text,interval: messageIntervalField.text, newsViewType:newsTypeField.text};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
else if ((configBackground.registeredUser==false)){errormessage+=qsTr("Nickname not registered at given server! ")}
else if (password.text=="") {errormessage+=qsTr("No password given! ")}
else if (imagestore.text=="") {errormessage+=qsTr("No image directory given!")}
else if (maxNewsText.text=="") {errormessage+=qsTr("No maximum news number given!")}
else {errormessage=""}
if (errormessage=="") {
Helperjs.friendicaRequest(userconfig,"/api/account/verify_credentials?skip_status=true",root,function(obj){
var credentials=JSON.parse(obj);
if (credentials.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
}
else{
filesystem.Directory=userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
Service.storeConfig(db,userconfig);
Service.readConfig(db,function(userconfig){
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
});
configBackground.users=storedUsers});
userButton.color="black"
//reset values
root.login=userconfig;
root.news=[];
},"isActive",0);
Service.requestProfile(userconfig,db,root,function(nc){root.newContacts=nc});
if(osSettings.osType=="Android" && userconfig.timerInterval !=0){
alarm.setAlarm(userconfig.timerInterval);
}
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
}
});
}
else {Helperjs.showMessage(qsTr("Error"), errormessage,root)}
}}
BlueButton {
x: root.width/2+2*mm; y: mm; width: 5*mm; height: 5*mm;
text: "-"
onClicked:{
var userconfig={server: servername.text, username: username.text, password: Qt.btoa(password.text)};
Service.deleteConfig(db,userconfig,function(){
filesystem.Directory=imagestore.text+"contacts";
filesystem.rmDir();
filesystem.Directory=imagestore.text+"albums";
filesystem.rmDir();
configBackground.registeredUser=true;
servername.text="https://...";
servericon.visible=false;
servericon.source="";
username.text="";
password.text="";
imagestore.text="";
maxNews.value=0;
newsTypeField.text="Conversations";
messageIntervalSlider.value=30;
userButton.text=qsTr("User");
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
})
configBackground.users=storedUsers;})
})
}}
BlueButton {
x: root.width/2+8*mm; y: mm; width: 5*mm; height: 5*mm;
text: "+"
onClicked:{
configBackground.registeredUser=true;
servername.text="https://..."
servericon.visible=false;
servericon.source="";
username.text=""
password.text=""
imagestore.text=""
maxNews.value=0
newsTypeField.text="Conversations"
messageIntervalSlider.value=30
userButton.text=qsTr("User")
}
}
BlueButton {
x: root.width/2+14*mm; y: mm; width: 5*mm; height: 5*mm;
text: "?"
onClicked:{
configStack.push({item:"qrc:/qml/configqml/InfoBox.qml"});
}
}
Menu {
id:newstypemenu
MenuItem {
text: qsTr("Timeline")
onTriggered: {newsTypeField.text="Timeline"}
}
MenuItem {
text: qsTr("Conversations")
onTriggered: {newsTypeField.text="Conversations"}
}
}
Component.onCompleted: {
try{Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
})
configBackground.users=storedUsers;
Service.readConfig(db,function(obj){
userButton.text=obj.username;
servername.text=obj.server;
configBackground.setServericon(obj.server);
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
maxNews.value=obj.maxnews;
newsTypeField.text=obj.newsViewType;
messageIntervalSlider.value=obj.timerInterval;
if( obj.isActive==0){userButton.fontColor='black'} else {userButton.fontColor='grey'}},"isActive",0
)
})
// Service.readGlobaloptions(db,function(go){
// if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
// })
}
catch (e){print(e)
Helperjs.friendicaWebRequest("https://dir.friendica.social/servers/surprise",configBackground,function(html){
var bpos=html.indexOf("baseurl");
var baseurl=html.substring(html.indexOf("http",bpos),html.indexOf('"',html.indexOf("http",bpos)));
servername.text=baseurl
})}
}
}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
Rectangle{
@ -43,7 +43,7 @@ Rectangle{
textFormat: Text.RichText
width: root.width-mm
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.5.2 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
text: "<b>Friendiqa v0.5.3 </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>"+
"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>"+

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -29,10 +29,11 @@
// 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.Window 2.0
import QtQuick 2.0
QtObject{
property real appWidth: 500
property real appHeight: 500
property real appWidth: Screen.desktopAvailableWidth/3
property real appHeight: Screen.desktopAvailableHeight/3*2
property int backKey: Qt.Key_Escape
property string osType: "Linux"
//property string attachImageDir:filesystem.homePath+"/Pictures/"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.9
import QtQuick.Controls 2.5
import QtQuick.Controls 2.12
import QtWebView 1.1
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/configqml"
import "qrc:/js/service.js" as Service

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,14 +30,17 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service
Rectangle{
color:"white"
width:root.width
height:root.height
height: root.height
//height:root.height
Text {
text: qsTr("Sync Interval (0=None)")
font.pixelSize:3*mm
@ -47,7 +50,7 @@ Rectangle{
Slider{ id: messageIntervalSlider
x:22*mm; y: 13.5*mm;width: root.width/2;height:5*mm
value: globaloptions.syncinterval
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
from: 0;to:120; stepSize: 15
}
Rectangle{
@ -65,6 +68,7 @@ Rectangle{
if(osSettings.osType=="Android"){
alarm.setAlarm(text);
} else if(osSettings.osType=="Linux" && text !=0){
root.updateSyncinterval(parseInt(text))
}
}
}
@ -74,18 +78,24 @@ Rectangle{
text:qsTr("Min.")
}
Column{
y:22*mm
width: parent.width
spacing:mm
//anchors.fill: parent
SyncComponent{adapter:"Timeline"}
SyncComponent{adapter:"Replies"}
SyncComponent{ adapter:"DirectMessages"}
SyncComponent{ adapter:"Notifications"}
ScrollView{
width: root.width
height: root.height - 25*mm;y:22*mm
clip:true
Column{
//height: implicitHeight
width: parent.width
spacing:mm
//anchors.fill: parent
SyncComponent{adapter:"Timeline"}
SyncComponent{adapter:"Replies"}
SyncComponent{ adapter:"DirectMessages"}
SyncComponent{ adapter:"Notifications"}
SyncComponent{ adapter: "Events"}
}
}
Button{
MButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm

View file

@ -1,92 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 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.4
import "qrc:/qml/genericqml"
Item {
id: contactComponent
height: 8*mm
width: parent.width
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>")
Rectangle {
id: wrapper
width:parent.width
height: 8*mm
border.color: "grey"
color:"white"
Image {
id: photoImage
x:0.5*mm
y:0.5*mm
width: 7*mm
height:7*mm
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
}
Column{
width: wrapper.width-8*mm
anchors.left: photoImage.right
anchors.margins: 1*mm
spacing: mm
Label {
id: namelabel
width: wrapper.width-4
height: 3*mm
text: contact.name
elide:Text.ElideRight
color: "#303030"
font.pixelSize: 3*mm
}
Label {
id: screennamelabel
width: wrapper.width-8*mm
height: 2.5*mm
text: "@"+contact.screen_name
elide:Text.ElideRight
color: "#303030"
font.pixelSize: 2.5*mm
}
}
MouseArea{
anchors.fill: parent
onClicked:{
rootstack.currentIndex=0;
bar.currentIndex=0;
root.contactdetailsSignal(contact)
}
}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
Item {

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
// List of people
import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
//import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service

View file

@ -45,7 +45,7 @@ StackView{
height:osSettings.appHeight
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
property var login: Service.readActiveConfig(db)
property var globaloptions: ({}) //Service.readGlobaloptions(db)
property var globaloptions: Service.readGO(db)
property var contactlist: []
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
signal messageSignal(var friend)
@ -59,6 +59,7 @@ StackView{
signal uploadSignal(var urls)
signal sendtextSignal(var intenttext)
signal changeimage(var method, var type, var id)
signal updateSyncinterval(int interval)
property var news:[]
property var newContacts:[]
//property string contactLoadType: ""
@ -67,7 +68,7 @@ StackView{
onLoginChanged:{
if(login==""){root.push("qrc:/qml/configqml/AccountPage.qml")}
else{root.push(rootStackItem)
newstab.newstabstatus=login.newsViewType;
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts})}
}
@ -105,22 +106,20 @@ StackView{
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
Keys.onReleased: {print("Backkey"+newstab.conversation.length+" "+root.depth)
Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
if (event.key === osSettings.backKey) {
if (rootstack.currentIndex==0){
newstab.active=true;
print(newstab.newstabstatus)
if (newstab.newstabstatus!=login.newsViewType){
newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
if (newstab.newstabstatus!=globaloptions.newsViewType){
newstab.newstabstatus=globaloptions.newsViewType;
if(globaloptions.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
newsSignal(dbnews)
})}
else{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
newsSignal(dbnews)
})}
print(newstab.conversation.length);
}
}
else if (newstab.conversation.length>0){newstab.conversation=[]}
else if (root.depth>1){root.pop()}
@ -287,7 +286,6 @@ StackView{
}
Label{
text: "\uf08b " +qsTr("Quit")
font.pixelSize: 4*mm
width: parent.width
@ -305,9 +303,6 @@ StackView{
}
}
Item{
id:rootStackItem
width:parent.width
@ -395,12 +390,12 @@ StackView{
}
Component.onCompleted: {
forceActiveFocus();
Service.readGlobaloptions(db,function(go){globaloptions=go})
//print(xhr.networktype());
if(osSettings.osType=="Android"){
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
var IntentReceiverQml = component.createObject(root);
} else if (osSettings.osType=="Linux"){
}
else if (osSettings.osType=="Linux"){
var component = Qt.createComponent("qrc:/qml/genericqml/LinuxSync.qml");
var LinuxSyncQml = component.createObject(root);
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
Item {

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import Qt.labs.folderlistmodel 2.1
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs

View file

@ -12,11 +12,17 @@ Item {
}
}
function startSyncTimer(interval){
syncTimer.interval=interval*60000;
//print("synctimer interval "+syncTimer.interval)
syncTimer.start()
}
Component.onCompleted: {
if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
syncTimer.interval=root.globaloptions.syncinterval*60000;
syncTimer.start()
startSyncTimer(root.globaloptions.syncinterval)
}
root.updateSyncinterval.connect(startSyncTimer)
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -29,12 +29,13 @@
// 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.6
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
Button{
id: mButton
width: Math.max(text.width+2*mm,8*mm)
//radius: mm
height: 6*mm
//color: Material.grey
font.pixelSize: 3*mm
background: Rectangle{color:"#F8F8F8"}
background: Rectangle{color:"#F8F8F8";radius: 0.5*mm}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.7
import QtQuick.Controls 1.2
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
//import "qrc:/js/news.js" as Newsjs
//import "qrc:/js/helper.js" as Helperjs

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
// ConversationView with button
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
import "qrc:/qml/newsqml"
@ -83,7 +83,7 @@ Rectangle {
} else { conversationBusy.running=false;
conversationModel.clear();
var currentTime= new Date();
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation, 'method':'refresh', 'options':globaloptions};
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation, 'method':'conversation', 'options':globaloptions};
conversationWorker.sendMessage(msg)
//conversationsymbol.color="grey"
}
@ -186,7 +186,7 @@ Rectangle {
Component.onCompleted: {
if (news.length>0){var currentTime= new Date();
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news,'appendnews':true, 'options':globaloptions};
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news,'method':'conversation', 'options':globaloptions};
conversationWorker.sendMessage(msg)}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -32,7 +32,7 @@
// message.qml
// message with buttons
import QtQuick 2.4
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
//import QtQuick.Dialogs 1.2
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/smiley.js" as Smileyjs
@ -404,6 +404,7 @@ Rectangle{
visible:false //(bodyField.length>1)||(attachImageURLs.length>0)
spacing: mm
height: 12*mm
x: 0.5*mm
MButton{id:permButton
visible: (newsSwipeview.stacktype!=="DirectMessages")
height: 6*mm
@ -473,7 +474,7 @@ Rectangle{
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
}
if (conversation==true){
newstab.newstabstatus=login.newsViewType; newsStack.pop(null)
newstab.newstabstatus=root.globaloptions.newsViewType; newsStack.pop(null)
}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -42,7 +42,7 @@ AnimatedImage {id:gif;
'Rectangle{id:recfullscreen;color:"white";width:root.width;height:root.height;'+
'MouseArea {anchors.fill:parent;onClicked:{recfullscreen.destroy()}}'+
'AnimatedImage {id:giffullscreen;source: "'+gif.source+
'";anchors.centerIn:parent; width:root.width;fillMode: Image.PreserveAspectFit; onStatusChanged: playing = (status == AnimatedImage.Ready);'+
'";anchors.centerIn:parent; width:root.width;height:root.height;fillMode: Image.PreserveAspectFit; onStatusChanged: playing = (status == AnimatedImage.Ready);'+
'}}',root,"Attachmentlarge")
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
@ -162,7 +162,7 @@ StackView{
case "Replies":messagetype=3;break;
default:messagetype=0;
}
if(newstab.newstabstatus=="Timeline"){print("lastnewsid "+lastnews_id);
if(newstab.newstabstatus=="Timeline"){//print("lastnewsid "+lastnews_id);
Newsjs.newsfromdb(root.db,root.login, messagetype,function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
newsWorker.sendMessage(msg);
@ -187,7 +187,8 @@ StackView{
Connections{
target:xhr
onError:{
Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
if (data !="contactlist"){Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);}
newsBusy.running=false;
}
onSuccess:{
// downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
@ -385,7 +386,6 @@ StackView{
}
Component.onCompleted: {
//print(newsSwipeview.stacktype);
root.newstypeSignal.connect(newstypeHandling);
root.messageSignal.connect(onFriendsMessages);
root.contactdetailsSignal.connect(showContact);
@ -396,7 +396,7 @@ StackView{
newsSwipeview.height=rootStackItem.height-12*mm;
newsSwipeview.y=5*mm;
rootStackItem.state=""
login.hasOwnProperty("newsViewType")?newstab.newstabstatus=login.newsViewType:"Conversations"
root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
var messagetype=0;
switch(newsSwipeview.stacktype){
case "Home":messagetype=0;break;
@ -405,17 +405,17 @@ StackView{
case "Replies":messagetype=3;break;
default:messagetype=0;
}
if((login.newsViewType=="Conversations")&&(newsSwipeview.stacktype=="Home")){
if((newstab.newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
Newsjs.chatsfromdb(db,login,messagetype,function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews);
})
}
else{Newsjs.newsfromdb(db,login,messagetype,function(dbnews,lastid){
else{
Newsjs.newsfromdb(db,login,messagetype,function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews)
})}
//}
}
}
}

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
//import QtQuick.Controls.Styles 2.3
//import QtQuick.Dialogs 1.3
import "qrc:/qml/newsqml"
@ -40,25 +40,7 @@ import "qrc:/js/service.js" as Service
Item {
// Connections{
// target:xhr
// onError:{
// Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
// }
// onSuccess:{
// if (api=="/api/statuses/friends_timeline"){
// // downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
// //Service.processNews(api,data);
// if(login.newsViewType=="Timeline"){
// Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
// else{Newsjs.chatsfromdb(db,login.username,function(dbnews){
// showNews(dbnews);
// })}
// }
// }
// }
onHeightChanged: {newsSwipeview.height=height-6*mm}
Timer {id:contacttimer; interval: 50; running: false; repeat: false
onTriggered: {
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
@ -86,6 +68,50 @@ Item {
}
}
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 onFriendsMessages(friend){
newstab.newstabstatus="Contact"
@ -126,7 +152,6 @@ Item {
height: parent.height-6*mm
y: 5*mm
function onDirectMessage(friend){currentIndex=2}
transitions: Transition {
PropertyAnimation { properties: "height";
easing.type: Easing.InOutQuad
@ -167,7 +192,7 @@ Item {
source:(newsSwipeview.currentIndex==3)? "qrc:/qml/newsqml/NewsStack.qml":""
//onLoaded: newsSwipeview.stacktype="Notifications"
}
Component.onCompleted: {root.directmessageSignal.connect(onDirectMessage);}
Component.onCompleted: {root.directmessageSignal.connect(onDirectMessage)}
}
PageIndicator {

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -31,7 +31,7 @@
import QtMultimedia 5.8
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
//import QtQuick.Controls.Styles 1.4
Rectangle{

View file

@ -2,7 +2,7 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -42,8 +42,10 @@ Item {
property int itemindex: index
property var newsitemobject:model.newsitemobject
property string attending: ""
property var friendica_activities_view: getActivitiesView(model.newsitemobject)
onAttendingChanged: {attendLabel.visible=true;
attendLabel.text= qsTr("attending: ")+ qsTr(attending)}
attendLabel.text= qsTr("attending")+": "+ qsTr(attending)}
signal replyto(string parent_id)
@ -80,8 +82,8 @@ Item {
// }
Column {
id:toprow //newscolumn
width: newsitem.width//-8*mm
width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *newsitemobject.indent):newsitem.width//-8*mm
x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*newsitemobject.indent:0
Item{
height: Math.max(profileImage.height+mm,topFlow.implicitHeight+mm)
width: parent.width
@ -128,7 +130,7 @@ Item {
color: "grey"
font.pixelSize: 1.5*mm
horizontalAlignment: Label.AlignRight
text: newsitemobject.dateDiff
text: getDateDiffString(newsitemobject.dateDiff) + " " +qsTr("ago")
}
Label {
id:replytoLabel
@ -166,7 +168,7 @@ Item {
// clip:true
// height: newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
MouseArea{
width: newsitem.width-8*mm-2
width: toprow.width-2
height: itemMessage.height
onPressAndHold: {
pushConversation();
@ -178,7 +180,7 @@ Item {
textFormat: Text.RichText
font.family: "Noto Sans"
text: newsitemobject.statusnet_html//newsitemobject.attachmentList.length>0?newsitemobject.text : newsitemobject.statusnet_html
width: newsitem.width-2
width: toprow.width-2
height:newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
//height: implicitHeight
wrapMode: Text.Wrap
@ -257,7 +259,7 @@ Item {
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: newsitemobject.friendica_activities_view.likeText
text: friendica_activities_view.likeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
@ -266,7 +268,7 @@ Item {
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: newsitemobject.friendica_activities_view.dislikeText
text: friendica_activities_view.dislikeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
@ -275,7 +277,7 @@ Item {
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: newsitemobject.friendica_activities_view.attendyesText
text: friendica_activities_view.attendyesText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
@ -283,7 +285,7 @@ Item {
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: newsitemobject.friendica_activities_view.attendnoText
text: friendica_activities_view.attendnoText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
@ -292,7 +294,7 @@ Item {
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: newsitemobject.friendica_activities_view.attendmaybeText
text: friendica_activities_view.attendmaybeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
@ -315,7 +317,7 @@ Item {
width:newsitem.width/5 //10*mm
height: parent.height
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked:(newsitemobject.friendica_activities_view.self.liked==1)?true:false
checked:(model.newsitemobject.friendica_activities_view.self.liked==1)?true:false
indicator: Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitHeight:4*mm
@ -328,8 +330,14 @@ Item {
}
}
onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.newsitemobject.friendica_activities_view.self.liked=0 }
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.newsitemobject.friendica_activities_view.self.liked=1}}
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false;
newsitemobject.friendica_activities_view.self.liked=1;
newsitem.ListView.view.model.set(index,{"newsitemobject":newsitemobject});
}
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root);
newsitemobject.friendica_activities_view.self.liked=0;
newsitem.ListView.view.model.set(index,{"newsitemobject":newsitemobject});
}}
}
CheckBox{
id: dislikeCheckbox
@ -349,8 +357,14 @@ Item {
}
}
onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.newsitemobject.friendica_activities_view.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.newsitemobject.friendica_activities_view.self.disliked=1}}
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false;
newsitemobject.friendica_activities_view.self.disliked=1;
newsitem.ListView.view.model.set(index,{"newsitemobject":newsitemobject});
}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root);
newsitemobject.friendica_activities_view.self.disliked=0;
newsitem.ListView.view.model.set(index,{"newsitemobject":newsitemobject});
}}
}
CheckBox {

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.11
//import QtQuick.Controls.Styles 1.4
import "qrc:/js/smiley.js" as Smileyjs

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.5
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/image.js" as Imagejs
import "qrc:/qml/genericqml"

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtQuick.Controls 2.12
import "qrc:/qml/photoqml"
Package {
@ -84,7 +84,7 @@ Package {
MouseArea {
width: realImage.paintedWidth; height: realImage.paintedHeight; anchors.centerIn: realImage
onPressAndHold:{
var menuString="import QtQuick 2.5;import QtQuick.Controls 1.4; "+
var menuString="import QtQuick 2.5;import QtQuick.Controls 2.12; "+
"Menu {MenuItem {text:qsTr('Delete on client and server'); onTriggered: {"+
"changeimage('delete','image','"+imageLocation+"');photoModel.remove(index)}}"+
"MenuItem {text:qsTr('Move to album'); onTriggered: {"+

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.5
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import QtQml.Models 2.1
import "qrc:/js/image.js" as Imagejs
import "qrc:/js/helper.js" as Helperjs
@ -276,7 +276,7 @@ StackView{
}}}
}
Rectangle { id: photoBackground; color: 'light grey'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
Rectangle { id: photoBackground; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
ListView { width: parent.width; height:parent.height; model: visualphotoModel.parts.browser; interactive: false }

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// 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
@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.5
import QtQuick.Controls 1.3
import QtQuick.Controls 2.12
import QtQml.Models 2.1
//import "qrc:/js/service.js" as Service
import "qrc:/js/image.js" as Imagejs