One Time Dialog
#1
Just wondering if anyone has any ideas on a one-time dialog I'd like to display for one of my addons.

I'm looking to adjust the functionality of a particular addon that impact users. Specifically I'm combining some of the addon settings into a new way of setting it up. The result is that if they had settings on the old system they'll have to re-add them to the new one. When the addon updates I'd like to display a one-time notification when the service starts along the lines of "this addon has changed, check your settings or it won't work" so that people don't just assume it will be fine but it isn't.

Is there a good way to do some kind of one time notification? Easiest way I could think of was to display it and then write a boolean value to a file or something to make sure it doesn't pop-up again. I could then remove the code in any future release since it won't be needed. Is there a better way? Or should I just assume users will figure it out?

Thanks for any ideas.
Reply
#2
Just add it to the settings XML, true by default, and make the okay button turn it off!
Reply
#3
^^ indeed. I used the get/setsetting to store a value in the settings.xml which will be hidden that way.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#4
I think people can just figure it out. Note it in the changelog.
Reply
#5
You can maybe add counter instead of boolean, in case you have more of these changes in the future Smile

Or you can just change those settings??
Reply
#6
If you want the message to come up when the addon runs, then I think the suggestions about doing something in the settings.xml won't help. What I do with AS is put in a check for a file in the addon's data folder that has a version number. If the version number in that file is old, the code runs and then updates that file with the current version number.

I have a function called _upgrade() in Artist Slideshow that is called every time the script starts. Then I just update that as needed. For instance, right now it looks like this:
Code:
def _upgrade( self ):
        #this is where any code goes for one time upgrade routines
        loglines, data = readFile( self.CHECKFILE )
        lw.log( loglines )
        if not data:
            self._migrate_info_files()
        loglines, data = readFile( self.CHECKFILE )
        if data == '1.5.4':
            self._migrate_tbn_files()
Reply
#7
Doing the setting thing will certainly 100% work and you don't need any additional files or whatever.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#8
Thanks for the ideas! I'll try some things out, the settings value seems easiest to implement for a one-off. Usually I let users figure it out but I can see some "damn you broke my stuff!" type of comments if they don't think to check the settings after upgrade.
Reply
#9
In words:
If getSetting('foo') != True
show dialog
setSetting('foo') = True

This will simply write the value to the settings.xml and it won't show up in settings menu cause it's not defined by any control.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#10
(2017-01-31, 23:05)Martijn Wrote: Doing the setting thing will certainly 100% work and you don't need any additional files or whatever.

Sorry, I misread the suggestion. I thought they were adding an actual visible setting in the addon settings, not storing the setting. If I have to do this again I might look at the get and set settings.
Reply

Logout Mark Read Team Forum Stats Members Help
One Time Dialog0