Force user to the Settings UI window

I have a gadget that requires some user settings before it can function. I'd like to check the settings and if they are blank, say something like "Click here to change settings".

Then when the user clicked the link, I would like to open the settings window just as if the user clicked the little wrench icon.

Right now all I can do is tell them to click the little wrench thingie and hope that they know that that means.

Unless I'm overlooking something in the Sidebar Gadget Object Model, I don't see a function for this. Does one exist It would be nice to have a System.Gadget.Settings.show() function to launch the settings UI.

Donavon




Answer this question

Force user to the Settings UI window

  • Mike3983

    Thanks for the suggestion Jonathan. One problem with that is if the user is in the middle of entering his/her email and password and happens to click elsewhere on the screen (to let's say copy/paste the email address) the flyout goes away. I know I could write all sorts of fancy code to save and restore the text values, but that's not the point. The Setting UI is used for Settings and that's where the user needs to be taken to.

    Sidebar.next needs to allow developers to open the Settings UI dialog in script, hopefully with a method something like System.Gadget.Settings.show(); and not the odd behavior of setting a property System.Gadget.Flyout.show = true; used with flyouts (I would have preferred show() and hide() methods).

    Sidebar.next also needs to provide the ability to set "Always on Top" in script as well (for gadgets that take over the right-click).

    Donavon



  • Artie Sluka

    You could place the settings in a flyout so when you add the gadget a flyout opens.
  • BobInVermont

    You can take over right-click easy enough. Set "oncontextmenu='myFunction()' " on the body or object. And make sure you return false:

    function myFunction() {
    ...
    window.event.returnValue = false;
    }

  • Alan Browne

    Yes, I know. I'm already doing that. My point is that for gadgets that do so, they loose the gadget context menu. Therefore the user looses the ability to set the opacity, set Always on Top, etc. It would be nice to have those APIs available so the gadget could still offer this functionality.



  • MorGas

    Sorry, but this is not supported. It's a better user experience to pick some good defaults, and then let your user change them in the settings dialog. Forcing a user to pick some settings is not great for any application's first run experience.
  • crbeckman

    Brian,

    That's rather narrow minded. You should give the programmer the capability and let him/her decide what is best for the application in question.  Using your argument, there shouldn't be a System.Gadget.close() method either.

    Take the case of an email checker gadget. There are no "good default" values for email address and password. I want to say "Click Here to setup your account information." (where "click here" would open the setting dialog just as if the user clicked on the wrench icon. Instead I have to explain to the user the he/she must go to the Settings dialog.

    Also...

    My gadget takes control of the right click (document.body.oncontextmenu) so currently there is no way for the user to set the following. I'd like to provide the UI and call these functions myself.

    • Detatch from Sidebar
    • Attach to Sidebar
    • Set Opacity

    Donavon

     



  • Strange_Will

    I'd put a request in for v2 to Bruce. This issue was raised during the beta process by myself and a few others, all it needed was the context menu to appear with a right click on the three mini icons that appear when you hover other the Gadget. Unfortunately, it wasn't included.

    There's little point us moaning about it now, we're at RTM so need to program for what we've got. The only work around I can suggest, is to include an area that doesn't capture oncontextmenu - ie your own "settings" button in the Gadget. Not ideal, I know.

  • ToddGibbs

    Can you use a Flyout for settings, instead of the settings page. Not ideal I admit, but at least you can force it open until the user's filled in the details. Fire it by a mouseover event on the body.

  • Force user to the Settings UI window