Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Jan 2011
    Location
    Germany
    Posts
    227

    MessageBox for UserInteraction

    For a plugin I would like to ask for user interaction.

    The Plugin updates some prefs and then a binary has to be restarted to take all updates into effect.
    Now I would like to have some user interaction before the restart is issued: Basically a YES no NO interaction.

    I thought of doing this in the way LMS asks for a rescan.
    I found some code lines here: https://github.com/Logitech/slimserv...ttings.pm#L188

    But these do actually not work in my case. I basically changed the "doRescanNow" to "doRestart" and in the "Settings.pm" I am asking if the param "doRestart"
    exists...

    How would I have to implement that?
    Or is this functionality just meant for rescans?
    LMS-7.9@solaris. 2x Radio, 2x Duet, 1x Chromecast v1, ShairTunes, 1x Philips Hue System

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,746

    MessageBox for UserInteraction

    What does not work? The popup? The restart?
    --

    Michael

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Location
    Germany
    Posts
    227
    Well, after digging a lot more in the code I got it solved.

    It was quite hard to figure it out, but I have to admit it is implemented quite handy.
    It's really great somtimes to learn from the LMS code...
    LMS-7.9@solaris. 2x Radio, 2x Duet, 1x Chromecast v1, ShairTunes, 1x Philips Hue System

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Location
    Germany
    Posts
    227
    Quote Originally Posted by mherger View Post
    What does not work? The popup? The restart?
    --

    Michael
    I your code everything as expected.

    In my one there was a problem, that there was no popup.

    This was due to a very tricky function in the JavaScript part:

    1. I had to use a IIFE function call, like "(function (){}()", using a lot of brackets...
    2. For handing over parameters it is "(functione (param){}(param)", which is weird...

    I simply found that out by occasion as it is quite rare....
    LMS-7.9@solaris. 2x Radio, 2x Duet, 1x Chromecast v1, ShairTunes, 1x Philips Hue System

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •