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
OGR: add a download option to the protocol data source #8985
OGR: add a download option to the protocol data source #8985
Conversation
Fixes qgis#21091 The issue was due to the /vsicurl/ not being able to open a streaming endpoint. “Things are not always what they seem; the first appearance deceives many; [...]” ― Phaedrus
Hmm I'm uncertain about this approach. In terms of UI implementation, seems like it'd deserve some visual progress report here, does qgsfiledownload do that? More fundamentally, this essentially downloads a dataset into a temp location, adds it to the project, and the data will be lost when relaunching QGIS assuming temp location is regularly wiped. Even if we'd be able to find a way to make these downloaded datasets permanent, it seems to defeat the overall feature here, that is having a layer with a remotely accessed dataset (which can be updated across sessions etc.) What about just popping up a "this dataset can't be opened remotely, use a download manager to copy it locally"? |
Yes, it can be added easily (with abort button too).
I see your point, what about using a file selector dialog to choose the download location instead of a temp dir?
Well, that would have been much faster to implement, just change the error message :) |
:) IMHO, I'd implement an error message for 3.6. If you are interested in investing more time to come up with a way to essentially creating a [x] download and open a local copy of the dataset option, that could be useful for users you want to skip opening their browsers or download manager. I'd make sure the wording clearly explains the resulting layer won't connect remotely. |
Some more thoughts here:
That said: I don't know what to do here: the simpler solution of changing the message will actually change nothing because of the limited visibility of the message itself. |
@elpaso , some thoughts over your thoughts 😉 :
|
This reverts commit cf0d45e.
... and forward all app's message bar messages to the dialog's message bar in case it is modal and visible. Also adds a question dialog when a /vsicurl/ add layer operation failed and offers a chance to try the "normal" opening mode.
@nirvn I've found the solution: the failed URL opens without issues when the URL is pasted in the "File" source instead of the "Protocol" one. So, I added a question dialog in case the protocol URL opening failed, the question dialog asks the user if she wants to try the "normal" way, if the user answers "Yes" the normal way is triggered (and it will probably work). Note that the "normal wayl" does not download and create a local datasource like my first implementation, there is no confusion anymore. I've also added a |
@@ -1853,6 +1854,21 @@ bool QgisApp::event( QEvent *event ) | |||
return done; | |||
} | |||
|
|||
|
|||
QgsMessageBar *QgisApp::visibleMessageBar() |
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 quite like this. I think there's scope to use more in future -- e.g. vector/raster layer properties dialogs currently trigger message bar warnings in the main canvas, so they are a potential use case for this in future.
"loading ..." message and busy cursor
@elpaso , thanks for investigating further and coming up with an alternative, much better. +1 from me. |
@nirvn thank you for your inputs! |
…wnload OGR: add a download option to the protocol data source [needs-docs] Cherry-picked from master 1f8708f
OGR: add a download option to the protocol data source [needs-docs] Cherry-picked from master 1f8708f
I'm not sure whether this is is a feature, looks more like a bugfix to me, btw needs docs
Fixes #21091
The issue was due to the /vsicurl/ not
being able to open a streaming endpoint.
“Things are not always what they seem; the first appearance
deceives many; [...]”
― Phaedrus