Posts: 1,088
Joined: Nov 2012
Reputation:
51
If it isnt available for the Ok dialog, couldnt you use the yes/no dialog and disable/hide the other button?
Posts: 1,739
Joined: Aug 2011
Reputation:
23
Is that possible, to hide button ?
Posts: 17,859
Joined: Jul 2011
Reputation:
371
imo the OK dialog is there for a reason. If you don't want the OK form the user, use a notification. Else the whole point of the OK is moot
Posts: 3,895
Joined: Sep 2013
Reputation:
358
+1 for what Martijn said. Why would you want to auto-close an OK dialog ? Either you want a response from the user (OK) or you don't, in which case just use a notification, which requires no user intervention.
Learning Linux the hard way !!
Posts: 1,739
Joined: Aug 2011
Reputation:
23
I'll try to explain. I have created a sleeptimer addon that checks for inactivity. When timer reaches zero a dialog should appear and ask the user to continue watching. If no confirmation is given the system shuts down. When using notifications the input from remote seems to trigger the mapped key for that window. That's not what i wanted, i just want the user to press any key to reset timer without triggerring any xbmc action.
Posts: 17,859
Joined: Jul 2011
Reputation:
371
then use the yes/no button
"Do you want to continue watching?
YES - NO (and with NO, shutdown. Which is also the action for autoclose)
Posts: 1,739
Joined: Aug 2011
Reputation:
23
I added a yesnog dialog now but can't seem to get the autoclose to function, it always returns a syntax error.
userchoice = dialog.yesno("Playback stops in 30 sec", "Do you want to continue watching?",,,,,5000)
Also struggling with replacing 30 with a variable.
Any hints/tips/examples?
Posts: 1,088
Joined: Nov 2012
Reputation:
51
prompt = DIALOG.yesno("Playback stops in %s sec" % promptduration, "Do you want to continue watching?", yeslabel = "Hells yeah", nolabel = "Hells no", autoclose=int(promptduration * 1000))
This works in my addon.
You could also use this instead for the text:
"Playback stops in {} sec".format(promptduration)