-
Notifications
You must be signed in to change notification settings - Fork 21
add implementation to save files #100
base: master
Are you sure you want to change the base?
Conversation
…sktopfilepicker to move code to function
@shalva97 @Wavesonics I got save working and tested on all platforms except macOS. On macOS it is implemented, but I haven't been able to test it for some reason. Running the example compiles it successfully, but it doesn't launch. Could it be because I'm running on Arm and not x64? I will keep trying to get macOS working and tested. In the meantime any info on whether this feature is wanted in the library or if it should be kept in a fork or any feedback on the implementation details would be greatly appreciated. Cheers |
Hi @santiwanti, I am also interested in the saveFilePicker you are implementing. I am wondering if the API youre implementing currently fits the other functions the package offers. Specifically, I would say, the picker should not handle the saving of the contents itself. It should instead take an onFilePicked-function as input which would be provided by the user where the user decides how to work with the selected file. |
@akriese that's a good point. I'm refactoring the code now so that the callback is the same as for the other functions and also refactoring the name from As for contributing I will implement these changes today and after that the only things left will be to test it on MacOS which I haven't been able to do and getting feedback from maintainers to see if anything should be changed. I will ping you once it's ready to test on MacOS. |
A colleague of mine uses macOS (x86, I guess). I could let him test your code, if you give us instructions on how to test it. Can one simply clone the repo and run the example apps? |
I personally think With other filepickers it is similar, that the programmer (user of the package) has to handle file overwrites. At least thats how you have to do it with Swing's |
…rge of writing the contents to the file
I have refactored the code so that the user can choose to do once the new file has been created. The Web code had to be removed and now throws a NotImplemented Exception because there is no way to implement it currently. Besides this everything else is the same. The UX that is a bit strange is the iOS UX because the way it is implemented is that a temporary file is created and then the user can decide where to move the file. That means that the file picker action the user sees is "Move" which is a bit deceptive. Lastly @akriese the Mac code has still not been tested because I can't run it for some reason. To test the app you have to go through the instructions laid out here: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-getting-started.html and after that it's as easy as running the code. |
Hey, sorry for letting you wait. I just tried the jvm example. The example is missing the |
So, on his mac the jvm version works, but sometimes (we cant really tell when), picking an existing file will cut off the file extension of that file. |
...les/android/src/main/java/com/darkrockstudios/libraries/mpfilepicker/android/MainActivity.kt
Outdated
Show resolved
Hide resolved
thanks for all the work. I think it will be okay to keep both file picker dialogs and save file dialogs in this library. First I'd like to merge #89, it will cause conflicts, but should not be much work to fix it. Regarding MacOS, it needs one more compilation target macosArm64 to be added. Anyways, I have MacOS with intel so I can test it on macosX64. |
…pfilepicker/android/MainActivity.kt Co-authored-by: George Shalvashvili <[email protected]>
@shalva97 I didn't want to add the macosArm64 target given that it wasn't already in the project. If you think adding the target is a good idea I would be willing to add it in another PR and test/fix all the logic. In the meantime if you can test the macos saving code that would be great. I can fix the bugs that come up and we can find a way to collaborate more synchronously if it's not working. |
Hi @santiwanti. Do you want to be a maintainer? I will ask @Wavesonics, he usually responds on Kotlin's Slack Personally I dont use this library, there was just my pet project, which used it but I have abandoned that. |
Hey @santiwanti, I just noticed that #89 was merged. Could you fix conflicts so @shalva97 can merge this at some point? :) |
Sorry I was afk for a few days. @shalva97 I would be down to being a maintainer, but lets talk about it more and with @Wavesonics to make sure we are on the same page and don't step on eachothers toes. You can message me on Slack @ swanti. @akriese I will be back in full force tomorrow and will fix conflicts and push the changes. |
@shalva97 @Wavesonics this still has to be tested on an Intel Mac. I haven't been able to test it myself |
...icker/src/macosX64Main/kotlin/com/darkrockstudios/libraries/mpfilepicker/FilePicker.macos.kt
Outdated
Show resolved
Hide resolved
...icker/src/macosX64Main/kotlin/com/darkrockstudios/libraries/mpfilepicker/FilePicker.macos.kt
Outdated
Show resolved
Hide resolved
…ries/mpfilepicker/FilePicker.macos.kt Co-authored-by: George Shalvashvili <[email protected]>
…ries/mpfilepicker/FilePicker.macos.kt Co-authored-by: George Shalvashvili <[email protected]>
I'm interested in the feature, and I have x64 win 11, Linux (Kubuntu) and Mac, and ARM Mac. If you need any of the platforms, I can check it. |
Are there any updates? |
@santiwanti @Wavesonics are there any updates? Can I somehow help you? Is there any ETA? |
Addresses Issue #8
Milestones:
WebThe Web implementation was removed during a refactor due to not being able to implement it.prompt
,message
,nameFieldLabel