bugfixes and ts-files

This commit is contained in:
LubuWest 2024-04-15 17:24:30 +02:00
parent 8391b028f4
commit ec102d8d66
29 changed files with 6611 additions and 741 deletions

View File

@ -1,11 +0,0 @@
--- source-linux/qml/friendiqa.qml
+++ source-linux/qml/friendiqa.qml
@@ -193,7 +193,7 @@
color: Material.backgroundColor
}
- header: ToolBar{
+ footer: ToolBar{
background: Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor

View File

@ -73,7 +73,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
int main(int argc, char *argv[]) {
//qDebug()<< "argv Friendiqa"<< (qstrcmp(argv[1],"-service")==0) <<" argv2" <<argv[1];
QCoreApplication::setApplicationName("Friendiqa");
QCoreApplication::setOrganizationName("Friendiqa");
//QCoreApplication::setOrganizationName("Friendiqa");
QApplication app(argc, argv);
if (qstrcmp(argv[1],"-service")==0){
@ -91,7 +91,7 @@ int main(int argc, char *argv[]) {
else{
QQmlApplicationEngine view;
//view.setResizeMode(QQuickView::SizeRootObjectToView);
app.setWindowIcon(QIcon(":/assets/Friendiqa.ico"));
app.setWindowIcon(QIcon("qrc:/assets/Friendiqa.ico"));
QTranslator qtTranslator;
if(qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations"))
{app.installTranslator(&qtTranslator);}

View File

@ -180,7 +180,7 @@ function updateData(database,table, username, key, value, callback,filter,filter
function showMessage(header,message,rootwindow){//print(message);
var cleanmessage=message.replace(/"/g,"-");
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
var messageString='import QtQuick 6.3; import QtQuick.Controls 2.15; Dialog{ visible: true; title:"'+header+'";standardButtons: Dialog.Ok;anchors.centerIn: parent;Label{text:" '+cleanmessage+'"}}';
var messageString='import QtQuick 6.3; import QtQuick.Controls 6.3; Dialog{ visible: true; title:"'+header+'";standardButtons: Dialog.Ok;anchors.centerIn: parent;Label{text:" '+cleanmessage+'"}}';
var messageObject=Qt.createQmlObject(messageString,rootwindow,"messageOutput");
}

View File

@ -74,33 +74,33 @@ function beautify(newsitemobject,msg){
}
}catch(e){print("attachment "+e)}
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(/class=\"attachment-image\"/g,"width=\"600\" ");
for (var format in videoformats){
if (newsitemobject.text.indexOf("."+videoformats[format])>-1){
var videohelper={mimetype:"video/"+videoformats[format]}
var videotext=newsitemobject.text;
while (videotext.indexOf("."+videoformats[format])>-1){
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
try{
for (var format in videoformats){
if (newsitemobject.text.indexOf("."+videoformats[format])>-1){
var videohelper={mimetype:"video/"+videoformats[format]}
var videotext=newsitemobject.text;
while (videotext.indexOf("."+videoformats[format])>-1){
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
}
}
}
}
if (newsitemobject.text.indexOf("/videos/watch/")>-1){
var ptvideohelper={mimetype:"video/mp4"}
var ptvideotext=newsitemobject.text;
while (ptvideotext.indexOf("/videos/watch/")>-1){
var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/");
var ptposend=findend(ptvideotext,ptvideohelperstringposition);
if(ptposend==-1){ptposend=ptvideotext.length};
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
if (newsitemobject.text.indexOf("/videos/watch/")>-1){
var ptvideohelper={mimetype:"video/mp4"}
var ptvideotext=newsitemobject.text;
while (ptvideotext.indexOf("/videos/watch/")>-1){
var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/");
var ptposend=findend(ptvideotext,ptvideohelperstringposition);
if(ptposend==-1){ptposend=ptvideotext.length};
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
}
}
}
}catch(e){print(e)}
newsitemobject.videoAttachmentList=videoAttachmentList;
newsitemobject.imageAttachmentList=imageAttachmentList;
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){
@ -129,7 +129,7 @@ WorkerScript.onMessage = function(msg) {
if (!(typeof(newsitemobject.currentconversation)=='undefined') && (newsitemobject.currentconversation.length>0)){
let n=1;
while ((n<newsitemobject.currentconversation.length)&&(newsitemobject.currentconversation[newsitemobject.currentconversation.length-n].user.statusnet_blocking==true)) {
n++;
n++;
}
if (n<newsitemobject.currentconversation.length){
newsitemobject.lastcomment=beautify(newsitemobject.currentconversation[newsitemobject.currentconversation.length-n],msg);
@ -143,7 +143,7 @@ WorkerScript.onMessage = function(msg) {
var count=0;
var firstReply=0;
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||0)+1;
if (newsitemobject.indent>6){newsitemobject.indent=6};
firstReply=k;
@ -152,7 +152,7 @@ WorkerScript.onMessage = function(msg) {
count+=1
}
}
}}
}}
data=({"newsitemobject": newsitemobject})
}
if(data.newsitemobject.user.statusnet_blocking==true){break}

View File

@ -318,7 +318,7 @@ function processNews(api,data){
usermessages.push(newslist.status);
newslist=usermessages;
}
if (data=="" || api=="/api/v1/statuses"){newsBusy.running=false}
if (data=="" || api=="/api/v1/statuses"){showNews("")}//newsBusy.running=false}
else if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}

View File

@ -179,7 +179,7 @@ Rectangle {
width: 2*root.fontFactor*osSettings.bigFontSize;
display: AbstractButton.IconOnly
text: qsTr("add")
icon.name: "list-add"
icon.name: "list-add-symbolic"
icon.source: "qrc:/assets/icons/plus.svg"
// background: Rectangle{color: osSettings.dialogColor;
// radius: 0.5*mm}

View File

@ -65,7 +65,7 @@ Rectangle{
anchors.rightMargin:mm
width: 2*root.fontFactor*osSettings.bigFontSize;
display: AbstractButton.IconOnly
icon.name: "list-add"
icon.name: "list-add-symbolic"
icon.source: "qrc:/assets/icons/plus.svg"
onClicked: {
rootstackView.push("qrc:/qml/calendarqml/EventCreate.qml",{"startDate": new Date(dayint*86400000)})

View File

@ -90,8 +90,8 @@ Page{
login=userconfig;
news=[];
contactlist=[];
if(rootstackView.depth>1){rootstackSignal(0)}
newstypeSignal("refresh");
if(rootstackView.depth>1){rootstackSignal(0);newstypeSignal("refresh");}
else {rootstackView.replace("qrc:/qml/genericqml/RootStack.qml",StackView.PopTransition)};
},"isActive",0);
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.display_name+"\nScreen Name: "+credentials.username,root)
rootstackView.pop()
@ -259,7 +259,7 @@ Page{
MouseArea{
anchors.fill:parent
onClicked:{
let serverConfigString="import QtQuick 2.0; import QtQuick.Dialogs 6.3; MessageDialog{ visible: true; title:'Server';buttons: MessageDialog.Ok;text: 'Name: "+
let serverConfigString="import QtQuick 6.3; import QtQuick.Dialogs 6.3; MessageDialog{ visible: true; title:'Server';buttons: MessageDialog.Ok;text: 'Name: "+
servericon.serverconfig.site.name+"\nLanguage: "+servericon.serverconfig.site.language+
"\nEmail: "+servericon.serverconfig.site.email+"\nTimezone: "+servericon.serverconfig.site.timezone+"\nClosed: "+servericon.serverconfig.site.closed+
"\nText limit: "+servericon.serverconfig.site.textlimit+"\nShort Url length: "+servericon.serverconfig.site.shorturllength+
@ -275,7 +275,7 @@ Page{
id:serverSearchButton
width: 3*root.fontFactor*osSettings.bigFontSize; height: 2.5*root.fontFactor*osSettings.bigFontSize
//text:"\uf002"
icon.name: "search"
icon.name: "system-search"
font.pointSize: osSettings.bigFontSize
visible: servericon.visible?false:true
onClicked:{Qt.openUrlExternally(Qt.resolvedUrl("https://dir.friendica.social/servers"))}

View File

@ -61,13 +61,13 @@ Page{
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
}
TabButton {
text: qsTr("Start")
visible:osSettings.osType=="Linux"
font.pointSize: osSettings.systemFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
}
// TabButton {
// text: qsTr("Start")
// visible:osSettings.osType=="Linux"
// font.pointSize: osSettings.systemFontSize
// height: 2*root.fontFactor*osSettings.bigFontSize
// width:10*root.fontFactor*osSettings.bigFontSize
// }
}
LeftDrawerLinux{
@ -108,10 +108,10 @@ Page{
source:(configTabView.currentIndex==1)? "qrc:/qml/configqml/SyncConfig.qml":""
}
Loader{
id: startLoader
source:(configTabView.currentIndex==2)? "qrc:/qml/configqml/ConfigStartPage.qml":""
}
// Loader{
// id: startLoader
// source:(configTabView.currentIndex==2)? "qrc:/qml/configqml/ConfigStartPage.qml":""
// }
}
MButton{
id:closeButton

View File

@ -100,7 +100,7 @@ ScrollView{
y:4*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
text: qsTr("Quit")
icon.name: "system-log-out"
icon.name: "system-log-out-symbolic"
icon.source: "qrc:/assets/icons/sign-out.svg"
icon.height: root.fontFactor*osSettings.systemFontSize
icon.width: root.fontFactor*osSettings.systemFontSize

View File

@ -128,7 +128,7 @@ Item{
anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize
anchors.left: searchBox.right
anchors.leftMargin: 0.5*root.fontFactor*osSettings.bigFontSize
icon.name: "search"
icon.name: "system-search"
icon.source: "qrc:/assets/icons/search.svg"
text: qsTr("Close")
display: AbstractButton.IconOnly

View File

@ -217,7 +217,7 @@ Item{
ToolButton{
height: 2*root.fontFactor*osSettings.bigFontSize
width:friendsView.width
icon.name:"list-add-user"
icon.name:"list-add-user-symbolic"
icon.source: "qrc:/assets/icons/user-plus.svg"
icon.width: 2*root.fontFactor*osSettings.bigFontSize
icon.height: 2*root.fontFactor*osSettings.bigFontSize

View File

@ -85,20 +85,20 @@ Item{
Newsjs.requestGroups(root.login,root.db,root,function(){
groupsGridTab.showGroups(root.login.username)})}
}
MButton {
id: newGroupButton
text: "\uf234"
display: AbstractButton.IconOnly
icon.name:"list-add-user"
icon.source: "qrc:/assets/icons/user-plus.svg"
anchors.top: parent.top
anchors.topMargin: mm
anchors.right: updateGroupsButton.left
anchors.rightMargin: mm
onClicked: {
groupsModel.append({"group": {"new":true}});
}
}
// MButton {
// id: newGroupButton
// text: "\uf234"
// display: AbstractButton.IconOnly
// icon.name:"list-add-user"
// icon.source: "qrc:/assets/icons/user-plus.svg"
// 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

View File

@ -57,7 +57,7 @@ ApplicationWindow{
property bool wideScreen : width>height
signal rootstackSignal(int pageindex)
signal fotoSignal(var username, var friend)
signal directmessageSignal(var friend)
signal sendmessageSignal(string type, var newsitemobject)
signal newsSignal(var news)
signal newstypeSignal(var type)
signal friendsSignal(var username)
@ -161,20 +161,20 @@ ApplicationWindow{
// close.accepted=false
// }
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
if (osSettings.osType=="Android" || !iconTrayAvailable){
Qt.quit()
}
else{
systemTray.show();
systemTray.showMessage("",qsTr("Background Sync\n Rightclick or Middleclick to Quit"),"",5000)
root.hide()
}
})
})})
close.accepted=true
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
//if (osSettings.osType=="Android" || !iconTrayAvailable){
Qt.quit()
//}
// else{
// systemTray.show();
// systemTray.showMessage("",qsTr("Background Sync\n Rightclick or Middleclick to Quit"),"",5000)
// root.hide()
// }
})
})})
close.accepted=true
}
//else if (bar.currentIndex==2){fotoSignal(login.username,"backButton");close.accepted=false}
else {rootstackSignal(0);bar.currentIndex=0;close.accepted=false}
@ -192,112 +192,112 @@ ApplicationWindow{
anchors.fill: parent
color: osSettings.backgroundDimColor
}
RowLayout{
anchors.fill: parent
TabBar {
id: bar
Layout.fillWidth: true
onCurrentIndexChanged: {
rootstackSignal(bar.currentIndex);
try{while(rootstackView.depth>1){rootstackView.pop()}}catch(e){}
}
TabButton {
width: bar.width/4
icon.name: "format-list-unordered"
text: qsTr("Posts")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/list.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Posts")
onDoubleClicked: {newstypeSignal("refresh")}
}
TabButton {
width: bar.width/4
icon.name: "group"
text: qsTr("Contacts")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/users.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Contacts")
}
TabButton {
width: bar.width/4
icon.name: "viewimage"
text: qsTr("Images")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/picture-o.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Photos")
}
TabButton {
width: bar.width/4
icon.name: "view-calendar"
text: qsTr("Calendar")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/calendar.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Calendar")
}
TabBar {
id: bar
width: parent.width
//Layout.fillWidth: true
onCurrentIndexChanged: {
rootstackSignal(bar.currentIndex);
try{while(rootstackView.depth>1){rootstackView.pop()}}catch(e){}
}
TabButton {
width: bar.width/4
height: bar.height
icon.name: "format-list-unordered"
text: qsTr("Posts")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/list.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Posts")
onDoubleClicked: {newstypeSignal("refresh")}
}
TabButton {
width: bar.width/4
height: bar.height
icon.name: "group"
text: qsTr("Contacts")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/users.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Contacts")
}
TabButton {
width: bar.width/4
height: bar.height
icon.name: "viewimage"
text: qsTr("Images")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/picture-o.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Photos")
}
TabButton {
width: bar.width/4
height: bar.height
icon.name: "view-calendar"
text: qsTr("Calendar")
display: AbstractButton.IconOnly
icon.source: "qrc:/assets/icons/calendar.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
// background:Rectangle{
// anchors.fill: parent
// color: osSettings.backgroundDimColor
// }
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Calendar")
}
}
}
StackView{id:rootstackView
//y:roottoolbar.height
//anchors.fill: parent
width:root.width
height: root.height-roottoolbar.contentHeight
}
QSystemTrayIcon {
id: systemTray
visible: false
onActivated: {
if(reason === 3){
root.show();
bar.currentIndex=0;
root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
newstypeSignal(newstab.newstabstatus)
systemTray.hide()
} else {
Qt.quit()
}
}
Component.onCompleted: {
icon = root.color<palette.text?iconTrayWhite:iconTrayBlack//iconTray
toolTip = qsTr("Click to open Friendiqa")
//&hide()
}
}
// QSystemTrayIcon {
// id: systemTray
// visible: false
// onActivated: {
// if(reason === 3){
// root.show();
// bar.currentIndex=0;
// root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
// newstypeSignal(newstab.newstabstatus)
// systemTray.hide()
// } else {
// Qt.quit()
// }
// }
// Component.onCompleted: {
// icon = root.color<palette.text?iconTrayWhite:iconTrayBlack//iconTray
// toolTip = qsTr("Click to open Friendiqa")
// //&hide()
// }
// }
Component.onCompleted: {
onLoginChanged(login);

View File

@ -69,7 +69,7 @@ Item {
y:2*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
text: qsTr("Refresh")
icon.name: "view-refresh"
icon.name: "view-refresh-symbolic"
icon.source: "qrc:/assets/icons/refresh.svg"
icon.height: root.fontFactor*osSettings.systemFontSize
icon.width: root.fontFactor*osSettings.systemFontSize
@ -83,7 +83,7 @@ Item {
ToolButton{
y:3.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Home" && newstab.newstabstatus=="Timeline"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Home" && newstab.newstabstatus=="Timeline"
text: qsTr("Timeline")
icon.name: "chronometer"
icon.source: "qrc:/assets/icons/history.svg"
@ -101,7 +101,7 @@ Item {
ToolButton{
y: 5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Home" && newstab.newstabstatus=="Conversations"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Home" && newstab.newstabstatus=="Conversations"
text: qsTr("Conversations")
icon.name: "view-conversation-balloon"
icon.source: "qrc:/assets/icons/comments.svg"
@ -119,9 +119,9 @@ Item {
ToolButton{
y:6.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Replies"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Replies"
text: qsTr("Replies")
icon.name: "mail-reply-all"
icon.name: "mail-reply-all-symbolic"
icon.source: "qrc:/assets/icons/exchange.svg"
icon.height: root.fontFactor*osSettings.systemFontSize
icon.width: root.fontFactor*osSettings.systemFontSize
@ -137,7 +137,7 @@ Item {
ToolButton{
y: 8*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="DirectMessages"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="DirectMessages"
text: qsTr("Direct Messages")
icon.name: "mail-message"
icon.source: "qrc:/assets/icons/envelope.svg"
@ -153,7 +153,7 @@ Item {
ToolButton{
y: 9.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Favorites"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Favorites"
text: qsTr("Favorites")
icon.name: "starred-symbolic"
icon.source: "qrc:/assets/icons/star.svg"
@ -170,7 +170,7 @@ Item {
ToolButton{
y: 11*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Public Timeline"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Public Timeline"
text: qsTr("Public Timeline")
icon.name: "globe"
icon.source: "qrc:/assets/icons/globe.svg"
@ -188,7 +188,7 @@ Item {
ToolButton{
y: 12.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Groupnews"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Groupnews"
text: qsTr("Group news")
icon.name: "group"
icon.source: "qrc:/assets/icons/users.svg"
@ -207,9 +207,9 @@ Item {
ToolButton{
y: 14*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Search"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Search"
text: qsTr("Search")
icon.name: "search"
icon.name: "system-search"
icon.source: "qrc:/assets/icons/search.svg"
icon.height: root.fontFactor*osSettings.systemFontSize
icon.width: root.fontFactor*osSettings.systemFontSize
@ -226,7 +226,7 @@ Item {
ToolButton{
y: 15.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: account.username==login.username && newsSwipeview.stacktype=="Notifications"
font.bold: account.username==root.login.username && newsSwipeview.stacktype=="Notifications"
text: qsTr("Notifications")
icon.name: "notifications"
icon.source: "qrc:/assets/icons/bell.svg"

View File

@ -38,7 +38,7 @@ StackLayout{
height: rootstackView.height
currentIndex:bar.currentIndex
function indexchange(pageindex){currentIndex=pageindex}
function indexchange(pageindex){currentIndex=pageindex;bar.currentIndex=pageindex}
Loader{
id: newstab
@ -59,5 +59,7 @@ StackLayout{
property string calendartabstatus:"Events"
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
}
Component.onCompleted: {root.rootstackSignal.connect(indexchange);}
Component.onCompleted: {
root.rootstackSignal.connect(indexchange);
}
}

View File

@ -181,8 +181,8 @@ Page {
MButton{
id:dmbutton
height: 6*mm
width: 8*mm
// height: 6*mm
// width: 8*mm
visible: (contact.following=="true")
text: qsTr("Direct Message")
display: AbstractButton.IconOnly
@ -190,8 +190,7 @@ Page {
icon.source: "qrc:/assets/icons/envelope.svg"
onClicked:{
rootstackSignal(0);
newsSwipeview.currentIndex=2;
directmessageSignal(contact)
sendmessageSignal("directmessage",{id:"",user:{screen_name:contact.screen_name}})
}
}
@ -212,7 +211,7 @@ Page {
MButton{
id:approvebutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//height: 6*mm
text:qsTr("Approve")
onClicked:{
xhr.setAccount(login);
@ -226,7 +225,7 @@ Page {
MButton{
id:rejectbutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//height: 6*mm
text:qsTr("Reject")
onClicked:{
xhr.setAccount(login);
@ -240,7 +239,7 @@ Page {
MButton{
id:ignorebutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//height: 6*mm
text:qsTr("Ignore")
onClicked:{
xhr.setAccount(login);
@ -254,7 +253,7 @@ Page {
MButton{
id:followbutton
visible:(contact.isFriend==0 || !contact.hasOwnProperty("isFriend"))
height: 6*mm
//height: 6*mm
text:qsTr("Follow")
onClicked:{
contactBusy.running=true;
@ -270,7 +269,7 @@ Page {
MButton{
id:unfollowbutton
visible:(contact.isFriend==1)
height: 6*mm
//height: 6*mm
text:qsTr("Unfollow")
onClicked:{
contactBusy.running=true;
@ -285,7 +284,7 @@ Page {
MButton{
id: blockbutton
visible:(contact.statusnet_blocking!=1)
height: 6*mm
//height: 6*mm
text:qsTr("Block")
onClicked:{
contactBusy.running=true;
@ -301,7 +300,7 @@ Page {
MButton{
id: unblockbutton
visible:(contact.statusnet_blocking==1)
height: 6*mm
//height: 6*mm
text:qsTr("Unblock")
onClicked:{
contactBusy.running=true;

View File

@ -98,11 +98,11 @@ Page {
ListView {
id: conversationView
property string viewtype: "conversation"
width: conversationList.width//-4*mm
height:conversationList.height-2*root.fontFactor*osSettings.bigFontSize//-20*mm
width: conversationList.width
height:conversationList.height-2*root.fontFactor*osSettings.bigFontSize
clip: true
spacing: 0
//footer: MessageSend{conversation:true}
ScrollBar.vertical: ScrollBar { }
model: conversationModel
delegate: Newsitem{}
}

View File

@ -275,7 +275,7 @@ Page{
height:imageUploadView.height-3*root.fontFactor*osSettings.bigFontSize
text: qsTr("Add")
display: AbstractButton.IconOnly
icon.name: "list-add"
icon.name: "list-add-symbolic"
icon.source: "qrc:/assets/icons/plus.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize

View File

@ -48,10 +48,9 @@ Window{
width: parent.width
height: 2/3*parent.height
id: messageSend
title: (reply_to_user!="")?qsTr("Answer to")+" @"+reply_to_user:qsTr("New message")
property bool wideScreen : width>height
property string parentId: ""
//property bool textfocus: false
//property bool conversation: false
property string reply_to_user:""
property string windowstate:""
property alias bodyMessage: bodyField.text
@ -63,12 +62,6 @@ Window{
property var group_allow:login.hasOwnProperty("permissions")?login.permissions[2]:[]
property var group_deny:login.hasOwnProperty("permissions")?login.permissions[3]:[]
// function directmessagePrepare(friend){
// messageSend.state="active";
// reply_to_user=friend.screen_name;
// receiverLabel.text=friend.screen_name;
// }
function sendUrls(urls){
attachImage(urls);
messageSend.state="active";
@ -123,19 +116,6 @@ Window{
messageSend.close()
}
// function setParent(newsitemobject){
// if (newsitemobject!=""){
// messageSend.state="conversation"
// messageSend.reply_to_user=newsitemobject.user.screen_name;
// messageSend.parentId=newsitemobject.id
// } else {
// messageSend.state=null;
// messageSend.reply_to_user="";
// messageSend.parentId="";
// bodyField.text="";
// }
// }
function contactmenu(letter){
Newsjs.listFriends(login,db,function(contacts){
contactModel.clear();
@ -226,7 +206,7 @@ Window{
width: parent.width-2*mm
font.pointSize: osSettings.bigFontSize
placeholderText:qsTr("to:")
text: ""
text: reply_to_user
visible:false
onTextChanged: {
if (text!=""){contactmenu(text)} else {var receiver=getText(0,cursorPosition);contactmenu(receiver+preeditText)}}
@ -257,7 +237,6 @@ Window{
id: bodyField
property string contactprefix:""
property string placeholder: osSettings.osType=="Linux"? qsTr(" Drop your Content here."):""
//anchors.fill: parent
x:mm
height:Math.max(bodyField.contentHeight+4*mm,2.5*root.fontFactor*osSettings.bigFontSize)
width: parent.width
@ -302,19 +281,16 @@ Window{
text: qsTr("Copy")
enabled: bodyField.selectedText
action: copyAction
//onTriggered: bodyField.copy()
}
MenuItem {
text: qsTr("Cut")
enabled: bodyField.selectedText
action: cutAction
//onTriggered: bodyField.cut()
}
MenuItem {
text: qsTr("Paste")
enabled: bodyField.canPaste
action: pasteAction
//onTriggered: bodyField.paste()
}
MenuItem {
text: qsTr("Text")
@ -346,7 +322,7 @@ Window{
if(Helperjs.getCount(db,login,"contacts","screen_name",contact.screen_name)>1){
contact.screen_name=contact.screen_name+"+"+contacts.cid
}
if (newsSwipeview.stacktype=='DirectMessages'){
if (windowstate=='directmessage'){
receiverLabel.text=contact.screen_name;
reply_to_user=contact.screen_name
} else {
@ -354,7 +330,7 @@ Window{
bodyField.insert(bodyField.cursorPosition, bodyField.contactprefix+contact.screen_name+" ");
bodyField.cursorPosition=bodyField.cursorPosition+contact.screen_name.length+1
}
//receiverLabel.text=contact.screen_name;
contactSelector.visible=false
}
delegate: ContactComponent { }
@ -457,7 +433,7 @@ Window{
//text: "\uf044"
text: qsTr("Format")
display: AbstractButton.IconOnly
icon.name: "overflow-menu"
icon.name: "view-more-symbolic"//"overflow-menu"
icon.source: "qrc:/assets/icons/ellipsis-v.svg"
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
@ -498,11 +474,11 @@ Window{
MButton{
id:hastagButton
text: "#"
// display: AbstractButton.IconOnly
// icon.name: "tag-symbolic"
// icon.source: "qrc:/assets/icons/hashtag.svg"
// icon.width: root.fontFactor*osSettings.bigFontSize
// icon.height: root.fontFactor*osSettings.bigFontSize
// display: AbstractButton.IconOnly
// icon.name: "tag-symbolic"
// icon.source: "qrc:/assets/icons/hashtag.svg"
// icon.width: root.fontFactor*osSettings.bigFontSize
// icon.height: root.fontFactor*osSettings.bigFontSize
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Insert previous hashtag")
@ -585,7 +561,7 @@ Window{
// root.directmessageSignal.connect(directmessagePrepare);
root.uploadSignal.connect(sendUrls);
root.sendtextSignal.connect(sendtext);
// if (textfocus==true){bodyField.forceActiveFocus()}
bodyField.forceActiveFocus()
}
StateGroup{

View File

@ -45,6 +45,7 @@ Rectangle{
property string newstabstatus: ""
function newstypeHandling(newstype){
newsModel.clear();
//if (!newsBusy.running) {
try{newsBusy.running=true}catch(e){print("newsBusy.running=true " + e)};
//root.replySignal("");
@ -173,7 +174,7 @@ Rectangle{
newsView.anchors.topMargin=mm
}
function getOldNews(){print("getoldnews")
function getOldNews(){
var currentTime= new Date();
try{var oldnewsitemobject=newsModel.get(newsModel.count-1).newsitemobject;
@ -238,7 +239,12 @@ Rectangle{
if((newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
Newsjs.chatsfromdb(db,login,messagetype,[],function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews);
if (dbnews.length==0){
newstypeHandling()
}
else{
showNews(dbnews);
}
})
}
else if (messagetype==99){
@ -247,7 +253,12 @@ Rectangle{
else{
Newsjs.newsfromdb(db,login,messagetype,function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews)
if (dbnews.length==0){
newstypeHandling()
}
else{
showNews(dbnews);
}
})
}
}
@ -258,7 +269,7 @@ Rectangle{
newsBusy.running=false;
expectScreenUpdate=false;
}
function onSuccess(data,api){print("newsstack api "+api);
function onSuccess(data,api){
const newsApiArray=["/api/statuses/friends_timeline",
"/api/direct_messages/all",
"/api/direct_messages/conversation",
@ -327,7 +338,8 @@ Rectangle{
}
}
Component { id:footerComponent
Component {
id:footerComponent
Rectangle{
border.color: "#EEEEEE"
color: osSettings.dialogColor

View File

@ -145,11 +145,11 @@ Page{
switch (typerequest){
case "Home": return {iconName:"user-home-symbolic",iconUrl:"qrc:/assets/icons/home.svg"};
case "Favorites": return {iconName:"starred-symbolic",iconUrl:"qrc:/assets/icons/star.svg"};
case "Replies": return {iconName:"mail-reply-all",iconUrl:"qrc:/assets/icons/exchange.svg"};
case "Replies": return {iconName:"mail-reply-all-symbolic",iconUrl:"qrc:/assets/icons/exchange.svg"};
case "DirectMessages": return {iconName:"mail-message",iconUrl:"qrc:/assets/icons/envelope.svg"};
case "Public Timeline": return {iconName:"globe",iconUrl:"qrc:/assets/icons/globe.svg"};
case "Group News": return {iconName:"group",iconUrl:"qrc:/assets/icons/users.svg"};
case "Search": return {iconName:"search",iconUrl:"qrc:/assets/icons/search.svg"};
case "Search": return {iconName:"system-search",iconUrl:"qrc:/assets/icons/search.svg"};
case "Notifications": return {iconName:"notifications",iconUrl:"qrc:/assets/icons/bell.svg"};
}
}
@ -184,7 +184,7 @@ Page{
anchors.bottom: newsSwipeview.bottom
// fontColor: "grey"
// border.color: "transparent"
icon.name: "open-for-editing"
icon.name: "document-edit-symbolic" //"open-for-editing"
//text: "o \uf040"
//implicitHeight: root.fontFactor*osSettings.bigFontSize
onClicked:{
@ -225,11 +225,12 @@ Page{
height: newstabitem.height-(newstabbar.height+root.fontFactor*osSettings.systemFontSize)
x: leftDrawer.width
y: newstabbar.height
function onDirectMessage(friend){currentIndex=2}
//function onDirectMessage(friend){currentIndex=2}
onCurrentIndexChanged: {
if(newstypes[currentIndex]){stacktype=newstypes[currentIndex]}
else{stacktype="Home"}
newstabbar.currentIndex=newsSwipeview.currentIndex;
}
Loader{
@ -239,7 +240,6 @@ Page{
source:(newsSwipeview.currentIndex==1)? "qrc:/qml/newsqml/NewsStack.qml":""
}
Loader{
//property var friend:({})
source:(newsSwipeview.currentIndex==2)? "qrc:/qml/newsqml/NewsStack.qml":""
}
Loader{
@ -286,7 +286,7 @@ Page{
}
Component.onCompleted: {
root.directmessageSignal.connect(newsSwipeview.onDirectMessage);
root.sendmessageSignal.connect(openMessageSend);
root.globaloptionsChanged();
}
}

View File

@ -56,7 +56,11 @@ Page{
id:video;
anchors.fill:parent
onErrorChanged:{noticeText.font.pointSize=osSettings.bigFontSize;noticeText.text=errorString;}
onErrorChanged:{
noticeText.font.pointSize=osSettings.bigFontSize;
noticeText.text=errorString;
Qt.openUrlExternally(source)
}
fillMode: Image.PreserveAspectFit;
// autoLoad: true
// autoPlay: true

View File

@ -202,15 +202,19 @@ Item {
icon.source: "qrc:/assets/icons/chevron-down.svg"
icon.width: 2*root.fontFactor*osSettings.bigFontSize
icon.height: 2*root.fontFactor*osSettings.bigFontSize
background: Rectangle{color: "transparent";
radius: 0.5*mm}
background: Rectangle{
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 0.7; color: osSettings.backgroundColor}
}
}
onClicked: {
if (icon.name=="arrow-down"){
toprow.height=toprow.implicitHeight+6*mm;
icon.name=="arrow-up";icon.source="qrc:/assets/icons/chevron-up.svg";
toprow.height=toprow.implicitHeight+5*mm;
icon.name="arrow-up";icon.source="qrc:/assets/icons/chevron-up.svg";
} else {
toprow.height=Math.min(toprow.implicitHeight,3/4*root.height);
icon.name=="arrow-down";icon.source="qrc:/assets/icons/chevron-down.svg";
icon.name="arrow-down";icon.source="qrc:/assets/icons/chevron-down.svg";
newsView.positionViewAtIndex(index,ListView.Beginning);
}
}
@ -291,6 +295,9 @@ Item {
icon.source: "qrc:/assets/icons/smile-o.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Like")
onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false;
@ -312,6 +319,9 @@ Item {
icon.source: favoritedCheckbox.checked?"qrc:/assets/icons/star.svg":"qrc:/assets/icons/frown-o.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Dislike")
onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false;
@ -335,6 +345,10 @@ Item {
icon.width: root.fontFactor*osSettings.systemFontSize
icon.height: root.fontFactor*osSettings.systemFontSize
icon.color: favoritedCheckbox.checked?osSettings.primaryTextColor: osSettings.secondaryTextColor
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Favorite")
checked:(newsitemobject.favorited>0)
onClicked:{
if(!checked){
@ -353,10 +367,14 @@ Item {
visible: (newsitemobject.messagetype!==2)
width: newsitem.width/5
height: parent.height
icon.name: "comment-symbolic"
icon.name: "mail-reply-sender-symbolic"
icon.source: "qrc:/assets/icons/reply.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Reply")
onClicked:{
openMessageSend("reply",newsitemobject)
}
@ -367,11 +385,16 @@ Item {
visible: (newsitemobject.messagetype!==2)
width: newsitem.width/5
height: parent.height
icon.name: "overflow-menu"
icon.name: "view-more-symbolic"//"overflow-menu"
icon.source: "qrc:/assets/icons/ellipsis-v.svg"
icon.width: root.fontFactor*osSettings.bigFontSize
icon.height: root.fontFactor*osSettings.bigFontSize
onClicked:{newsmenu.popup()}
ToolTip.delay: 800
ToolTip.visible: pressed || hovered
ToolTip.text: qsTr("Menu")
onClicked:{
newsmenu.popup()}
}
}
@ -421,7 +444,7 @@ Item {
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
root.sendmessageSignal("directmessage",newsitemobject);
}
}
Action {
@ -489,4 +512,5 @@ Item {
text: qsTr("External")
onTriggered: {Qt.openUrlExternally(newsitemobject.external_url)}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff