-
-
Notifications
You must be signed in to change notification settings - Fork 274
Allow QFieldCloud to access Project folder view without opening Project #6647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
without opening the project.
🎉 Ta-daaa, freshly created APKs are available for 40d7855: arm64-android |
f71aea5
to
c108993
Compare
|
||
text: qsTr("View Project Folder") | ||
onTriggered: { | ||
cloudProjectsModel.currentProjectId = QFieldCloudUtils.getProjectId(projectActions.projectLocalPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nirvn , i set this because i need project id
to push in qfc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, this should not happen here, worlds will collide. Let's work out a better solution.
MenuItem { | ||
id: viewFile | ||
|
||
enabled: itemMenu.itemMetaType != LocalFilesModel.Folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nirvn , is this condition enough?
MenuItem { | ||
id: pushDatasetToCloud | ||
enabled: (itemMenu.itemMetaType == LocalFilesModel.Dataset && itemMenu.itemType == LocalFilesModel.RasterDataset && cloudProjectsModel.currentProjectId) || (itemMenu.itemMetaType == LocalFilesModel.Folder && itemMenu.itemWithinQFieldCloudProjectFolder) | ||
enabled: (itemMenu.itemMetaType == LocalFilesModel.File) || (itemMenu.itemMetaType == LocalFilesModel.Dataset && itemMenu.itemType == LocalFilesModel.RasterDataset && cloudProjectsModel.currentProjectId) || (itemMenu.itemMetaType == LocalFilesModel.Folder && itemMenu.itemWithinQFieldCloudProjectFolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nirvn , Here i am not sure about (itemMenu.itemMetaType == LocalFilesModel.File) ||
if ( httpCode == 201 ) | ||
{ | ||
qInfo() << QStringLiteral( "Upload succeeded for %1" ).arg( fileName ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get rid of t his
void providerConfigurationChanged(); | ||
void userInformationChanged(); | ||
void pendingAttachmentsUploadFinished(); | ||
void allAttachmentsWritten(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void allAttachmentsWritten(); | |
void pendingAttachmentsAdded(); |
|
||
text: qsTr("View Project Folder") | ||
onTriggered: { | ||
cloudProjectsModel.currentProjectId = QFieldCloudUtils.getProjectId(projectActions.projectLocalPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, this should not happen here, worlds will collide. Let's work out a better solution.
QFieldCloudUtils.addPendingAttachments(projectInfo.cloudUserInformation.username, cloudProjectsModel.currentProjectId, [itemMenu.itemPath], cloudConnection, true); | ||
platformUtilities.uploadPendingAttachments(cloudConnection); | ||
displayToast(qsTr("‘%1’ is being uploaded to QFieldCloud").arg(FileUtils.fileName(itemMenu.itemPath))); | ||
QFieldCloudUtils.addPendingAttachments(cloudConnection.userInformation.username, cloudProjectsModel.currentProjectId, [itemMenu.itemPath], cloudConnection, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, you'll need to change the cloudProjectsModel.currentProjectId to something like:
QFieldCloudUtils.getProjectId(projectActions.projectLocalPath)
And insure that the getProjectId() function there supports children path to a parent cloud project.
cloudConnection.onAllAttachmentsWritten.connect(function handler() { | ||
platformUtilities.uploadPendingAttachments(cloudConnection); | ||
displayToast(qsTr("‘%1’ is being uploaded to QFieldCloud").arg(FileUtils.fileName(itemMenu.itemPath))); | ||
cloudConnection.onAllAttachmentsWritten.disconnect(handler); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd rather have a Connections { target: cloudConnection; enabled: false; function onAllAttachment... } QML item instead of this javascript driven option. Thoughts?
🚀 Description
This pull request enhances QFieldCloud by enabling access to the Project folder view without opening the project. It also adds confirmation when deleting projects and introduces file viewing directly from the folder view.
✨ Key Changes
Demo
Screencast.From.2025-09-13.16-46-47.webm