View Single Post
Posts: 17 | Thanked: 107 times | Joined on Jan 2017 @ Berlin, Germany
#24
Originally Posted by velox View Post
I've had a quick scan through the prostogram source to help you out and it just seems to do it like this when a button is clicked:

Code:
            var imagePicker = pageStack.push("Sailfish.Pickers.ImagePickerPage")
            imagePicker.selectedContentChanged.connect(function () {
                pageStack.push(Qt.resolvedUrl("SendPhotoPage.qml"),{image_url: imagePicker.selectedContent})
            })
A quick google showed no official documentation about it, but a few questions whether or not Pickers imports are to be allowed in harbour. prostogram does not seem to import pickers as such, only silica.
Thanks, velox. That certainly saved some of my life time. I also saw the exact same code in the sources of Tweetian, so there's a reason that it works for both of the applications...

As you already said - they don't officially import "Sailfish.Pickers", but just reference them in a hard-coded String. Well, that's also most certainly the reason why they passed Harbour QA as Sailfish.Pickers wasn't officially supported until ***ta-daaa*** 16 days ago. I couldn't believe it, but it's now allowed for Harbour: https://github.com/sailfish-sdk/sdk-...mlimports.conf

Of course, there is always a downside: Piepmatz must be able to select 1-4 images and not just a single one. At least on my device ImagePickerPage is not configurable. So in order to achieve my goal I would build it in a way that the dialog needs to be opened up to 4 times in case you want to add 4 images or (illegally) import the ImageModel which comes with Sailfish.Gallery into my page. However, I already found that before and that's what I became angry about as it's not officially supported...

To sum it up: I will stick to my custom solution for the time being and add the SD card path to my model. Should fix TMavica's (and potentially also other's) problem here...
 

The Following User Says Thank You to Ygriega For This Useful Post: