2012-03-07, 23:00
is there a way to popup a msgbox like the built-in Notification command, but with eg. Yes and No buttons which can each have there own command(s) behind them.
regards Eddict
regards Eddict
Eddict Wrote:is there a way to popup a msgbox like the built-in Notification command, but with eg. Yes and No buttons which can each have there own command(s) behind them.
regards Eddict
dialog = xbmcgui.Dialog()
dialog.yesno(heading, line1[, line2, line3,nolabel,yeslabel])
(2012-03-12, 13:31)Eddict Wrote: ok that's good news. i was already diggin into some 'how to write an xbmc add-on' pages, but, although i am a developer, that seemed not that easy...
anybody has an eample available of an Pyhton script using a Yes/No Msgbox ? (i did some Googling, but quite some links point to EasyGui library. is this needed?)
import xbmc
import xbmcaddon
import xbmcgui
from service import AutoUpdater
addon_id = "service.libraryautoupdate"
Addon = xbmcaddon.Addon(addon_id)
autoUpdate = AutoUpdater()
nextRun = autoUpdate.calcNextRun()
#check if we should run updates
runUpdate = xbmcgui.Dialog().yesno(Addon.getLocalizedString(30010),Addon.getLocalizedString(30011) + nextRun,Addon.getLocalizedString(30012))
if(runUpdate):
#run the program
xbmc.log("Update Library Manual Run...")
autoUpdate.runUpdates()
import xbmc
import xbmcgui
dialog = xbmcgui.Dialog()
i = dialog.yesno("Are you sane", "At least some of the time")
if i == 0:
dialog.ok("Are you sane", "You should be locked up immediately")
else:
dialog.ok("Are you sane", "Congratulations")
<keymap>
<global>
<keyboard>
<space mod="ctrl">RunScript(special://masterprofile/test.py)</space>
</keyboard>
</global>
</keymap>
xbmc.executebuiltin("Notification(Are you sane, You should be locked up immediately)")