diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85914fb..ea99547 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,7 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0") set(CMAKE_INCLUDE_CURRENT_DIR ON) endif() -find_package(Qt6 REQUIRED COMPONENTS Core Widgets Quick QuickControls2 Sql DBus NetworkAuth Multimedia REQUIRED) +find_package(Qt6 REQUIRED COMPONENTS Core Quick QuickControls2 Widgets Sql DBus NetworkAuth Multimedia REQUIRED) qt_standard_project_setup() diff --git a/src/common/xhr.cpp b/src/common/xhr.cpp index 6951b27..dba9c5d 100644 --- a/src/common/xhr.cpp +++ b/src/common/xhr.cpp @@ -355,7 +355,7 @@ void XHR::onReplyError(QNetworkReply::NetworkError code) void XHR::onReplySuccess() { qDebug() << "!"; - QHashIterator i(params); + //QHashIterator i(params); // while(i.hasNext()) { // i.next(); // //qDebug() << i.key()<< " " << i.value(); diff --git a/src/js/news.js b/src/js/news.js index bbaa08f..12f8743 100644 --- a/src/js/news.js +++ b/src/js/news.js @@ -41,40 +41,42 @@ function requestFriends(login,database,rootwindow,callback){ var result2 = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups }) // /api/statuses/friends not working in Friendica 2/2022 , switching to api/v1/lists and download of all list members - // Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){ - var allfriends=[]; - Helperjs.friendicaRequest(login,"/api/v1/lists",rootwindow,function(listsobj){ - var lists=JSON.parse(listsobj) - for (var list in lists){ - Helperjs.friendicaRequest(login,"/api/v1/lists/"+lists[list].id+"/accounts?limit=0", rootwindow,function (obj){ - var friends=JSON.parse(obj); - var memberarray=[]; + Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){ + //var allfriends=[]; + //Helperjs.friendicaRequest(login,"/api/v1/lists",rootwindow,function(listsobj){ + // var lists=JSON.parse(listsobj) + // for (var list in lists){ + // Helperjs.friendicaRequest(login,"/api/v1/lists/"+lists[list].id+"/accounts?limit=0", rootwindow,function (obj){ + let friendsobj=JSON.parse(obj); + let friends=friendsobj.users; + //var memberarray=[]; for (var i=0;i0){// download contact images and update db var contacturls=[]; var contactnames=[]; - for (var link in newContacts){//print("new contact " +newContacts[link].screen_name); + for (var link in newContacts){ contacturls.push(newContacts[link].profile_image_url); contactnames.push(newContacts[link].screen_name); Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link]) @@ -311,7 +311,7 @@ ApplicationWindow{ systemTray.visible=true systemTray.show(); } - + root.contactdetailsSignal.connect(showContact); if(osSettings.osType=="Android"){ var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml"); var IntentReceiverQml = component.createObject(root); diff --git a/src/qml/newsqml/ContactPage.qml b/src/qml/newsqml/ContactPage.qml index 83cdf6d..4f4e784 100644 --- a/src/qml/newsqml/ContactPage.qml +++ b/src/qml/newsqml/ContactPage.qml @@ -181,8 +181,6 @@ Page { MButton{ id:dmbutton -// height: 6*mm -// width: 8*mm visible: (contact.following=="true") text: qsTr("Direct Message") display: AbstractButton.IconOnly @@ -211,7 +209,7 @@ Page { MButton{ id:approvebutton visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) - //height: 6*mm + width: implicitWidth text:qsTr("Approve") onClicked:{ xhr.setAccount(login); @@ -225,7 +223,7 @@ Page { MButton{ id:rejectbutton visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) - //height: 6*mm + width: implicitWidth text:qsTr("Reject") onClicked:{ xhr.setAccount(login); @@ -239,7 +237,7 @@ Page { MButton{ id:ignorebutton visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) - //height: 6*mm + width: implicitWidth text:qsTr("Ignore") onClicked:{ xhr.setAccount(login); @@ -253,7 +251,7 @@ Page { MButton{ id:followbutton visible:(contact.isFriend==0 || !contact.hasOwnProperty("isFriend")) - //height: 6*mm + width: implicitWidth text:qsTr("Follow") onClicked:{ contactBusy.running=true; @@ -269,7 +267,7 @@ Page { MButton{ id:unfollowbutton visible:(contact.isFriend==1) - //height: 6*mm + width: implicitWidth text:qsTr("Unfollow") onClicked:{ contactBusy.running=true; @@ -284,7 +282,7 @@ Page { MButton{ id: blockbutton visible:(contact.statusnet_blocking!=1) - //height: 6*mm + width: implicitWidth text:qsTr("Block") onClicked:{ contactBusy.running=true; @@ -300,7 +298,7 @@ Page { MButton{ id: unblockbutton visible:(contact.statusnet_blocking==1) - //height: 6*mm + width: implicitWidth text:qsTr("Unblock") onClicked:{ contactBusy.running=true; @@ -358,12 +356,10 @@ Page { } function onSuccess(data,api){ if (api=="/api/statuses/user_timeline"){ - Service.processNews(api,data) + if (data!=""){ + Service.processNews(api,data) + }else{contactBusy.running=false} } - else if (api=="/api/statuses/user_timeline"){ - Service.processNews(api,data) - } - } } diff --git a/src/qml/newsqml/MessageSend.qml b/src/qml/newsqml/MessageSend.qml index 12ed161..6dce620 100644 --- a/src/qml/newsqml/MessageSend.qml +++ b/src/qml/newsqml/MessageSend.qml @@ -292,11 +292,11 @@ Window{ enabled: bodyField.canPaste action: pasteAction } - MenuItem { - text: qsTr("Text") - enabled: bodyField.selectedText - onTriggered: print(bodyField.getFormattedText(bodyField.selectionStart,bodyField.selectionEnd)) - } +// MenuItem { +// text: qsTr("Text") +// enabled: bodyField.selectedText +// onTriggered: print(bodyField.getFormattedText(bodyField.selectionStart,bodyField.selectionEnd)) +// } } DocumentHandler { id: document document: bodyField.textDocument diff --git a/src/qml/newsqml/NewsStack.qml b/src/qml/newsqml/NewsStack.qml index 8349996..44b8608 100644 --- a/src/qml/newsqml/NewsStack.qml +++ b/src/qml/newsqml/NewsStack.qml @@ -266,7 +266,7 @@ Rectangle{ Connections{ target:xhr - function onError(data,url,api,code){print("api "+api+" code "+code+"data"+data) + function onError(data,url,api,code){print("api "+api+" code "+code) newsBusy.running=false; expectScreenUpdate=false; } @@ -314,7 +314,7 @@ Rectangle{ } Timer {id:replytimer; interval: 1000; running: false; repeat: false - onTriggered: {print("replytimer") + onTriggered: {//print("replytimer") newsBusy.running=true; if(newstab.newstabstatus=="Conversation"){ showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)} @@ -556,7 +556,6 @@ Rectangle{ } Component.onCompleted: { - root.contactdetailsSignal.connect(showContact); root.newsSignal.connect(showNews); root.searchSignal.connect(search); try{newsModel.clear()} catch(e){} diff --git a/src/qml/newsqml/NewsVideo.qml b/src/qml/newsqml/NewsVideo.qml index f713c9b..7a72ccc 100644 --- a/src/qml/newsqml/NewsVideo.qml +++ b/src/qml/newsqml/NewsVideo.qml @@ -32,24 +32,14 @@ import QtQuick 6.3 Rectangle{ - color:"grey" - width:toprow.width/2; - height:toprow.width/3 + color:"light grey" + width: 7*root.fontFactor*osSettings.bigFontSize + height: 7*root.fontFactor*osSettings.bigFontSize property var attachment:({}) Image{ anchors.fill: parent source: "qrc:/assets/icons/play.svg" } - // Text{ - // id:noticeText - // text:"\uf144"; - // color:"light grey" - // width:parent.width - // font.pixelSize: parent.height/2 - // x: (parent.width-contentWidth)/2 - // y:parent.height/5 - // } - MouseArea {anchors.fill:parent; onClicked:{ rootstackView.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": Qt.resolvedUrl(attachment.url),"mimetype": attachment.mimetype}); diff --git a/src/qml/newsqml/NewsVideoLarge.qml b/src/qml/newsqml/NewsVideoLarge.qml index 9b2ff5a..8f84683 100644 --- a/src/qml/newsqml/NewsVideoLarge.qml +++ b/src/qml/newsqml/NewsVideoLarge.qml @@ -38,8 +38,14 @@ Page{ id:newsvideofullscreen width:root.width; height:root.height-3*root.fontFactor*osSettings.bigFontSize - property alias source:video.source + property alias source: video.source property string mimetype:"" + + Rectangle{ + anchors.fill: newsvideofullscreen + color: "black" + } + Text{ id:noticeText text:"" @@ -52,72 +58,83 @@ Page{ visible: video.playbackState!=MediaPlayer.PlayingState } - Video { - id:video; - anchors.fill:parent - - onErrorChanged:{ - noticeText.font.pointSize=osSettings.bigFontSize; - noticeText.text=errorString; - Qt.openUrlExternally(source) - } - fillMode: Image.PreserveAspectFit; -// autoLoad: true -// autoPlay: true -// audioRole: MediaPlayer.VideoRole + MediaPlayer { + id: video + audioOutput: AudioOutput {} + videoOutput: videoOutput + Component.onCompleted: {play()} + onErrorChanged: {noticeText.text=errorString;Qt.openUrlExternally(source)} } - ProgressBar{ - id: videoProgress - width: parent.width - height: 2*mm - anchors.bottom: video.bottom - z:2 - visible:video.playbackState!=MediaPlayer.StoppedState - value: video.position/video.duration - + VideoOutput { + id: videoOutput + anchors.fill: parent MouseArea { anchors.fill:parent; onClicked:{ if(video.playbackState!=MediaPlayer.PlayingState){ video.play()} else{video.pause() } + if(Math.round(video.position/video.duration*1000) == 1000){ + video.position=0;video.play() + } + } + } + + Rectangle{ + color:"light grey" + visible: video.playbackState!=MediaPlayer.PlayingState || (Math.round(video.position/video.duration*1000) == 1000) + opacity: 0.5 + anchors.centerIn: videoOutput + width: 5*root.fontFactor*osSettings.bigFontSize + height: 5*root.fontFactor*osSettings.bigFontSize + Image{ + anchors.fill: parent + source: "qrc:/assets/icons/play.svg" } } } - ProgressBar{ id: videoBuffer - width: parent.width - height: 2*mm - anchors.bottom: video.bottom - visible:video.playbackState!=MediaPlayer.StoppedState + width: parent.width-4*mm + x: 2*mm + height: mm + contentItem: Item { + Rectangle { + width: videoBuffer.visualPosition * parent.width + height: parent.height + color: "light blue" + } + } + anchors.bottom: parent.bottom value: video.bufferProgress } - MButton { - id: closeButton - z:2 - anchors.top: parent.top - anchors.topMargin: 1*mm - anchors.right: parent.right - anchors.rightMargin: 1*mm - text: qsTr("Close") - display: AbstractButton.IconOnly - icon.name: "dialog-close" - icon.source: "qrc:/assets/icons/times-circle.svg" - onClicked: {if (rootstackView.depth>1){ rootstackView.pop()} - } - } - - Slider{ id: videoSlider - width: parent.width - height: 3*mm - anchors.top: video.bottom + x: 2*mm + width: parent.width-4*mm + height: 2*mm + z: 2 + anchors.bottom: parent.bottom visible:video.playbackState!=MediaPlayer.StoppedState && video.seekable value: video.position/video.duration - onMoved: video.seek(value*video.duration) + onMoved: video.position=value*video.duration + } + + MButton { + id: closeButton + z:2 + anchors.top: parent.top + anchors.topMargin: 1*mm + anchors.right: parent.right + anchors.rightMargin: 1*mm + opacity: 0.6 + text: qsTr("Close") + display: AbstractButton.IconOnly + icon.name: "dialog-close" + icon.source: "qrc:/assets/icons/times-circle.svg" + onClicked: {if (rootstackView.depth>1){ rootstackView.pop()} + } } } diff --git a/src/qml/newsqml/Newsitem.qml b/src/qml/newsqml/Newsitem.qml index e41ba48..a0e29cd 100644 --- a/src/qml/newsqml/Newsitem.qml +++ b/src/qml/newsqml/Newsitem.qml @@ -73,8 +73,8 @@ Item { Column { id:toprow - 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 + width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *(newsitemobject.indent+1))-mm:newsitem.width-mm + x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*(newsitemobject.indent)+0.5*mm:0.5*mm height: newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height) clip: true Item{id:itemHeader @@ -190,19 +190,11 @@ Item { height:5*mm anchors.bottom: toprow.bottom visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw - //text:"\uf078" -// fontColor: osSettings.secondaryTextColor -// border.color: "transparent" -// color: osSettings.backgroundColor -// gradient: Gradient { -// GradientStop { position: 0.0; color: "transparent" } -// GradientStop { position: 0.5; color: osSettings.backgroundDimColor} -// } - //radius:0 icon.name:"arrow-down" icon.source: "qrc:/assets/icons/chevron-down.svg" icon.width: 2*root.fontFactor*osSettings.bigFontSize icon.height: 2*root.fontFactor*osSettings.bigFontSize + icon.color:"transparent" background: Rectangle{ gradient: Gradient { GradientStop { position: 0.0; color: "transparent" } @@ -216,7 +208,7 @@ Item { } else { toprow.height=Math.min(toprow.implicitHeight,3/4*root.height); icon.name="arrow-down";icon.source="qrc:/assets/icons/chevron-down.svg"; - newsView.positionViewAtIndex(index,ListView.Beginning); + newsitem.ListView.view.positionViewAtIndex(index,ListView.Beginning); } } } diff --git a/src/qml/photoqml/PhotoComponent.qml b/src/qml/photoqml/PhotoComponent.qml index 1488dd3..347f9c3 100644 --- a/src/qml/photoqml/PhotoComponent.qml +++ b/src/qml/photoqml/PhotoComponent.qml @@ -113,7 +113,6 @@ Package { enabled: false } - // onStateChanged: print("State"+photoWrapper.state+index) states: [ State { name: 'stacked'; when: albumWrapper.state == '' diff --git a/src/translations/friendiqa-de.qm b/src/translations/friendiqa-de.qm index 00f2263..cf08a68 100644 Binary files a/src/translations/friendiqa-de.qm and b/src/translations/friendiqa-de.qm differ diff --git a/src/translations/friendiqa-es.qm b/src/translations/friendiqa-es.qm index 4ef4dae..f034d60 100644 Binary files a/src/translations/friendiqa-es.qm and b/src/translations/friendiqa-es.qm differ diff --git a/src/translations/friendiqa-hu.qm b/src/translations/friendiqa-hu.qm index 0ffc93b..8fe3bc1 100644 Binary files a/src/translations/friendiqa-hu.qm and b/src/translations/friendiqa-hu.qm differ diff --git a/src/translations/friendiqa-it.qm b/src/translations/friendiqa-it.qm index 189d882..f6f68d8 100644 Binary files a/src/translations/friendiqa-it.qm and b/src/translations/friendiqa-it.qm differ diff --git a/src/translations/friendiqa-nl.qm b/src/translations/friendiqa-nl.qm index 901001d..7bbc963 100644 Binary files a/src/translations/friendiqa-nl.qm and b/src/translations/friendiqa-nl.qm differ