Simon Brown Posted January 13, 2009 Share Posted January 13, 2009 Hi, how can I get my FileType plugin to save with a dialog? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted January 13, 2009 Share Posted January 13, 2009 There should be overloads for things like OnCreateSaveConfigUI or something like that. If you can't find them in FileType or whatever the class is, you can try deriving from PropertyBasedFileType too. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Simon Brown Posted January 13, 2009 Author Share Posted January 13, 2009 I've got that working now, but I can't work out how to get it to show a preview or the amount of space the file will take up. Is there a RefreshEffectToken (something like that name) equivalent for FileType dialogs? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted January 14, 2009 Share Posted January 14, 2009 Aren't there some plugins with the source available that you can look at? Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Simon Brown Posted January 14, 2009 Author Share Posted January 14, 2009 I've found a simpler FileType to try. Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted January 14, 2009 Author Share Posted January 14, 2009 I can add a UI, but it still doesn't show a preview nor the file size. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 15, 2009 Share Posted January 15, 2009 For saving it automatically does all of that for you. And if you use IndirectUI (which you really should be!), even the data binding and "Refresh the token" is handled for you. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 15, 2009 Share Posted January 15, 2009 Also, in order to get the Save dialog, your plugin must support saving and loading, as well as configuration of saving. These are specified as parameters to the base constructor. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Simon Brown Posted January 15, 2009 Author Share Posted January 15, 2009 My FileType does use IU and supports saving, loading and the configuration of saving, and yet the dialog looks like this: (Click for larger version) My plugin does receive the variables correctly. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 16, 2009 Share Posted January 16, 2009 Your save code is throwing an exception then. Run with the debugger attached. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Simon Brown Posted January 16, 2009 Author Share Posted January 16, 2009 If I click "OK" my plugin saves a (valid) animated GIF. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 16, 2009 Share Posted January 16, 2009 Logical conclusions don't prevent code from crashing. I'll repeat what I said: attach the debugger. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Simon Brown Posted January 16, 2009 Author Share Posted January 16, 2009 Unfortunately I can't as I am using the express edition. I'll try a try block. Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted January 16, 2009 Author Share Posted January 16, 2009 Thanks, it works. The try block didn't catch it but when I replaced it with code to perform a standard GIF save which worked, and I eventually realised that the problem was that my plugin was closing the output stream so that PDN could not. :oops: Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 16, 2009 Share Posted January 16, 2009 Can't wait to see the updated plugin! Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Simon Brown Posted January 16, 2009 Author Share Posted January 16, 2009 I've managed to add a delay setting, now I just need to work out how to change the loop setting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.