Esempio n. 1
0
 def __init__(self):
     try:
         self.audio = AlphaUIUtils.GetAudio()
         self.outputs = self.audio.GetOutputs()        
     except:
         print "audiohelper.py::__init__:", sys.exc_info()[0]
     pass
Esempio n. 2
0
 def showMessageAndLaunchUpdates(self):
     registryEntries = []
     if (self.getAlphaUIRegistryInfo(registryEntries)):
         #Screen center 640x360
         ctrl = xbmcgui.ControlImage(
             615, 335, 50, 50, 'special://skin/media/alienware/loading.gif')
         self._win.addControl(ctrl)
         launcherPath = registryEntries[0] + '\\AlphaUIAutoUpdateManager.exe'
         subprocess.Popen(launcherPath)
     else:
         AlphaUIUtils.ShutdownSystem()
Esempio n. 3
0
    def __init__(self):
        self.display = AlphaUIUtils.GetDisplay()
        self.modes = self.display.Modes

        for mode in self.modes:
            if mode.Name == self.getSelectedDisplayResolution():
                self.oldMode = mode
                break
        self.oldRefreshRateIndex = self.oldMode.RefreshRates.index(
            self.getSelectedRefreshRate())
        pass
Esempio n. 4
0
    def __init__(self, bluetoothlistcontrol, addon, language):
        self.IsInitDone = False
        self._isBluetoothOn = True
        self.bluetooth = AlphaUIUtils.Bluetooth()
        self.bluetoothlistcontrol = bluetoothlistcontrol
        self.bluetoothDevices = None
        self.language = language
        self.addon = addon

        self.lock = thread.allocate_lock()
        self.IsInitDone = True

        self.discovertimer = Timer(1.0, self.discoverTimerFunc)
        self.discovertimer.start()
Esempio n. 5
0
    def installHivemind(self,isFresh):
        message = ''
        if(isFresh):
            ret = dialog_yesno(localize(33000),localize(33001))
            log("Dialog YesNo -> {0}".format(ret))
            if(ret):
                waitDialog = WaitDialogHelper().create()
                try:
                    scriptPath = os.path.join(__addonpath__,'resources','lib','launchsetup.vbs')
                    log(('HiveMind setup launcher path = %s') % scriptPath)
                    si = subprocess.STARTUPINFO()
                    si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
                    exitCode = subprocess.call(["cscript.exe", scriptPath, self.setupPath], startupinfo=si)
                    log('HiveMind setup exit code = ' + str(tohex(exitCode, 32)))

                    if (exitCode == 0):
                        if(dialog_yesno(localize(33005),localize(33006))):
                            xbmc.executebuiltin('Skin.SetBool(IsCoreComponentInstalled)')

                            si = subprocess.STARTUPINFO()
                            si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
                            subprocess.call(["shutdown.exe", "/r", "/t", "0" ,"/f"], startupinfo=si)
                    else:
                        dialog_ok(localize(33003),localize(33004) + str(tohex(exitCode, 32)))
                except:
                    pass
                waitDialog.close()
        else:
            waitDialog = WaitDialogHelper().create()
            #try:
            import AlphaUIUtils
            setupPath = os.path.join(__addonpath__,'resources','lib')
            log(('HiveMind setup path = %s') % setupPath)

            retValue = AlphaUIUtils.LaunchHivemindSetup(setupPath)
            log('HiveMind setup return code = ' + str(retValue))

            if (retValue):
                if(dialog_yesno(localize(33005),localize(33006))):
                    si = subprocess.STARTUPINFO()
                    si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
                    subprocess.call(["shutdown.exe", "/r", "/t", "0" ,"/f"], startupinfo=si)
            else:
                dialog_ok(localize(33003))
            #except:
                # dialog_ok(localize(33003))
            waitDialog.close()        
Esempio n. 6
0
    def setAudioOutput(self, selectedIndex):
        if self.IsInitDone:
            retVal = self.audioHelper.setOutput(selectedIndex)
            if retVal:
                confirmDialog = ConfirmDialog()
                ret = confirmDialog.doModal(xbmc.getLocalizedString(31640),
                                            ConfirmDialogType.cancelRestart, 0)
                del confirmDialog

                if ret == 1:
                    AlphaUIUtils.RestartSystem()
            else:
                confirmDialog = ConfirmDialog()
                ret = confirmDialog.doModal(xbmc.getLocalizedString(31641),
                                            ConfirmDialogType.ok, 0)
                del confirmDialog
            print self.audioHelper.getSelectedOutput()
            self.audioOutputSpinControl.selectText(
                self.audioHelper.getSelectedOutput())
            self.setAudioOutputApplyButtonState()
            if self.audioOutputSpinControl.rightArrowEnabled or self.audioOutputSpinControl.leftArrowEnabled:
                self.audioOutputSpinControl.setFocus(True)
Esempio n. 7
0
 def windowsUpdateNow(self):
     xbmc.executebuiltin("ActivateWindow(busydialog)")
     print AlphaUIUtils.UpdateWindowsNow()
     xbmc.executebuiltin("Dialog.Close(busydialog)")
Esempio n. 8
0
    def onAction(self, action):
        if action.getId() != ACTION_SELECT_ITEM:
            for control in self.spinControls:
                retVal = control.forwardInput(action.getId(), 0)
                if retVal:
                    #print "returning true"
                    return;

        if (action.getId() == ACTION_PREVIOUS_MENU or action.getId() == ACTION_NAV_BACK ):
            self.lock.acquire()
            self.IsInitDone = False
            self.lock.release()
            self.alienFXControls.release()
            self.close()
        elif (action.getId() == ACTION_MOVE_DOWN):
            #print "move down -> {0}".format(self.getFocusId())
            #if(self.getFocusId() == BLUETOOTH_ON_RADIO_BUTTON_CONTROL):
            #    if(self.bluetoothOnRadioButton.isSelected()):
            #        self.setFocusId(BLUETOOTH_DISCOVERABILITY_ON_RADIO_BUTTON_CONTROL)
            #    else:
            #        self.setFocusId(BLUETOOTH_DEVICES_LIST_CONTROL)
            #        self.bluetoothDevicesListControl.selectItem(0)
            #elif(self.getFocusId() == BLUETOOTH_DISCOVERABILITY_ON_RADIO_BUTTON_CONTROL):
            #    self.setFocusId(BLUETOOTH_DEVICES_LIST_CONTROL)
            #    self.bluetoothDevicesListControl.selectItem(0)
            #elif (self.getFocusId() == BLUETOOTH_DEVICES_LIST_CONTROL and self.bluetoothDevicesListControl.getSelectedPosition() == 0):
            #    self.setFocusId(BLUETOOTH_ON_RADIO_BUTTON_CONTROL)
            pass
        elif (action.getId() == ACTION_MOVE_UP):
            #print "move down -> {0}".format(self.getFocusId())
            #if(self.getFocusId() == BLUETOOTH_ON_RADIO_BUTTON_CONTROL):
            #    self.setFocusId(BLUETOOTH_DEVICES_LIST_CONTROL)
            #    self.bluetoothDevicesListControl.selectItem(self.bluetoothDevicesListControl.size() - 1)
            #elif(self.getFocusId() == BLUETOOTH_DISCOVERABILITY_ON_RADIO_BUTTON_CONTROL):
            #    self.setFocusId(BLUETOOTH_ON_RADIO_BUTTON_CONTROL)
            #elif (self.getFocusId() == BLUETOOTH_DEVICES_LIST_CONTROL and self.bluetoothDevicesListControl.getSelectedPosition() == (self.bluetoothDevicesListControl.size() - 1)):
            #    if(self.bluetoothOnRadioButton.isSelected()):
            #        self.setFocusId(BLUETOOTH_DISCOVERABILITY_ON_RADIO_BUTTON_CONTROL)
            #    else:
            #       self.setFocusId(BLUETOOTH_ON_RADIO_BUTTON_CONTROL)
            pass
        elif (action.getId() == ACTION_SELECT_ITEM or action.getId() == ACTION_MOUSE_LEFT_CLICK):
            #print "Focused Item is {0}".format(self.getFocusId())
            if (self.getFocusId() == AUDIO_SOURCE_ACTION_CONTROL):
                dialog = SelectDialog("awdialogselect.xml",__addon__.getAddonInfo('path'), "Default")
                dialog._title = __language__(33015)
                dialog._optionList = self.audioHelper.getOutputs()
                dialog.doModal()
                if (dialog._selectedOptionPosition is not None):
                    xbmc.executebuiltin("ActivateWindow(busydialog)")
                    if (self.audioHelper.setOutput(dialog._selectedOptionPosition)):
                        self.audioSourceSelectedIndex = dialog._selectedOptionPosition
                        self.audioSourceLabelControl.setLabel(self.audioHelper.getOutputNameFromIndex(self.audioSourceSelectedIndex))
                        self.updateSpeakerConfig(self.audioSourceSelectedIndex)
                        volume = self.audioHelper.getVolume()
                        self.audioVolumeSliderControl.setPercent(volume)                
                        self.audioVolumeLabelControl.setLabel("{0}%".format(volume))
                        self.setVolumeControlButtons(volume, False)
                        self.refreshMute()
                        xbmc.executebuiltin("Dialog.Close(busydialog)")
                        xbmcgui.Dialog().notification(__language__(33020), __language__(33021), xbmcgui.NOTIFICATION_INFO, 9000)
                    else:
                        xbmc.executebuiltin("Dialog.Close(busydialog)")
                        xbmcgui.Dialog().notification(__language__(33018), __language__(33019), xbmcgui.NOTIFICATION_ERROR, 9000)
                del dialog 
            elif (self.getFocusId() == AUDIO_SPEAKER_CONFIG_ACTION_CONTROL):
                dialog = SelectDialog("awdialogselect.xml",__addon__.getAddonInfo('path'), "Default")
                dialog._title = __language__(33039)
                xbmc.executebuiltin("ActivateWindow(busydialog)")
                dialog._optionList = self.audioHelper.getSpeakerConfigs(self.audioSourceSelectedIndex)
                xbmc.executebuiltin("Dialog.Close(busydialog)")
                dialog.doModal()
                if (dialog._selectedOptionPosition is not None):
                    xbmc.executebuiltin("ActivateWindow(busydialog)")
                    if (self.audioHelper.setSpeakerConfig(self.audioSourceSelectedIndex,dialog._selectedOptionPosition)):
                        self.updateSpeakerConfig(self.audioSourceSelectedIndex)
                        self.refreshMute()
                        xbmc.executebuiltin("Dialog.Close(busydialog)")
                        xbmcgui.Dialog().notification(__language__(33020), __language__(33045), xbmcgui.NOTIFICATION_INFO, 9000)
                    else:
                        xbmc.executebuiltin("Dialog.Close(busydialog)")
                        xbmcgui.Dialog().notification(__language__(33018), __language__(33046), xbmcgui.NOTIFICATION_ERROR, 9000)
                del dialog 
            elif(self.getFocusId() == AUDIO_VOLUME_MUTE_RADIO_CONTROL):
                self.audioHelper.setMute(self.audioVolumeMuteRadioControl.isSelected())
            elif (self.getFocusId() == BLUETOOTH_DEVICES_LIST_CONTROL):
                self.bluetoothHelper.authenticateOrRemoveDevice(self.bluetoothDevicesListControl.getSelectedItem().getProperty('Address'))
            elif (self.getFocusId() == UPDATE_WINDOWS_BUTTON_CONTROL):
                updateDialog = UpdateSelectDialog("awdialogupdateselect.xml",__addon__.getAddonInfo('path'), "Default", updateNowCallback = self.windowsUpdateNow, selectedUpdateOption = self.updateWindowSetting, isCloseAtUpdateVisible = False)
                updateDialog._title = __language__(33065)
                updateDialog.doModal()
                if (updateDialog.getSelectedRadionButton() is not None):
                    self.updateWindowSetting = updateDialog.getSelectedRadionButton()
                    self.updateWindowLabelControl.setLabel(__language__(33070 + self.updateWindowSetting))

                    if (self.updateWindowSetting == 0):
                        AlphaUIUtils.SetWindowsUpdateSetting(1)
                    elif (self.updateWindowSetting == 2):
                        AlphaUIUtils.SetWindowsUpdateSetting(2)
                del updateDialog 

            elif (self.getFocusId() == UPDATE_NVIDIA_BUTTON_CONTROL):
                updateDialog = UpdateSelectDialog("awdialogupdateselect.xml",__addon__.getAddonInfo('path'), "Default", updateNowCallback = self.nVidiaUpdateNow, selectedUpdateOption = 2,isAutomaticUpdateVisible = False, isCloseAtUpdateVisible = False)
                updateDialog._title = __language__(33066)
                updateDialog.doModal()
                if (updateDialog.getSelectedRadionButton() is not None):
                    self.updateNvidiaSetting = updateDialog.getSelectedRadionButton()
                    self.updateNvidiaLabelControl.setLabel(__language__(33070 + self.updateNvidiaSetting))
                del updateDialog 

            elif (self.getFocusId() == UPDATE_ALIENWARE_BUTTON_CONTROL):
                updateDialog = UpdateSelectDialog("awdialogupdateselect.xml",__addon__.getAddonInfo('path'), "Default", updateNowCallback = self.alienwareUpdateNow, selectedUpdateOption = self.updateAlienwareSetting)
                updateDialog._title = __language__(33067)
                updateDialog.doModal()
                if (updateDialog.getSelectedRadionButton() is not None):
                    self.updateAlienwareSetting = updateDialog.getSelectedRadionButton()
                    self.updateAlienwareLabelControl.setLabel(__language__(33070 + self.updateAlienwareSetting))
                    xbmc.executeJSONRPC('{"jsonrpc":"2.0", "id":1, "method":"Settings.SetSettingValue","params":{"setting":"general.addonupdates","value":' + str(self.updateAlienwareSetting) + '}}')
                    xbmc.executeJSONRPC('{"jsonrpc":"2.0", "id":1, "method":"Settings.SetSettingValue","params":{"setting":"general.addonnotifications","value":true}}')
                del updateDialog 
Esempio n. 9
0
import xbmc

try:
    import AlphaUIUtils

    if (not AlphaUIUtils.RestartSystem()):
        xbmc.executebuiltin('Reboot')
except:
    xbmc.executebuiltin('Reboot')
Esempio n. 10
0
import xbmc

try:
    import AlphaUIUtils

    if (not AlphaUIUtils.SleepSystem()):
        xbmc.executebuiltin('Suspend')
except:
    xbmc.executebuiltin('Suspend')
Esempio n. 11
0
import xbmc
import AlphaUIUtils

AlphaUIUtils.RestartSystem()
Esempio n. 12
0
    def initAll(self):
        self.audioSourceLabelControl = self.getControl(AUDIO_SOURCE_LABLE_CONTROL)
        self.audioSpeakerConfigLabelControl = self.getControl(AUDIO_SPEAKER_CONFIG_LABLE_CONTROL)
        self.audioHelper = AudioHelper()  

        self.audioSourceLabelControl.setLabel(self.audioHelper.getSelectedOutput())

        self.audioSourceSelectedIndex = self.audioHelper.getSelectedIndex()      

        self.updateSpeakerConfig(self.audioSourceSelectedIndex)

        self.audioVolumeLabelControl = self.getControl(AUDIO_VOLUME_LABLE_CONTROL)
        self.audioVolumeSliderControl = self.getControl(AUDIO_VOLUME_SLIDER_CONTROL)
        self.audioVolumeMinusButtonControl = self.getControl(AUDIO_VOLUME_MINUS_BUTTON_CONTROL)
        self.audioVolumePlusButtonControl = self.getControl(AUDIO_VOLUME_PLUS_BUTTON_CONTROL)
        self.audioVolumeMuteRadioControl = self.getControl(AUDIO_VOLUME_MUTE_RADIO_CONTROL)

        volume = self.audioHelper.getVolume()
        self.audioVolumeSliderControl.setPercent(volume)
        self.audioVolumeLabelControl.setLabel("{0}%".format(volume))
        self.setVolumeControlButtons(volume, False)

        self.wifilist = self.getControl(WIFI_LIST_CONTROL)
        self.wifiNetworkLabelControl = self.getControl(WIFI_NETWORK_LABEL_CONTROL)
        self.wifihelper = WiFiHelper(self.wifilist, __language__)
        self.wifihelper.FillList()

        self.spinControls = []
        self.alienFXControls = AlienFXLights(self)

        alienFxBrightness = []

        for x in range(0,101):
            alienFxBrightness.append('{0}%'.format(x))

        self.alienFxHeadSpinControl = SpinControl(self,ALIENFX_HEAD_GROUP_CONTROL,ALIENFX_HEAD_LABEL_CONTROL,self.alienFxHeadColorChanged, self.alienFxHeadUpCallback, self.alienFxHeadDownCallback, self.alienFXControls.colors,ALIENFX_HEAD_SPIN_LEFT, ALIENFX_HEAD_SPIN_RIGHT, ALIENFX_HEAD_LEFT_FOCUS, ALIENFX_HEAD_RIGHT_FOCUS)
        self.alienFxHeadSpinControl.selectText(self.alienFXControls.zone1SelectedColor)

        self.alienFxCornerSpinControl = SpinControl(self,ALIENFX_CORNER_GROUP_CONTROL,ALIENFX_CORNER_LABEL_CONTROL,self.alienFxCornerColorChanged, self.alienFxCornerUpCallback, self.alienFxCornerDownCallback, self.alienFXControls.colors,ALIENFX_CORNER_SPIN_LEFT, ALIENFX_CORNER_SPIN_RIGHT, ALIENFX_CORNER_LEFT_FOCUS, ALIENFX_CORNER_RIGHT_FOCUS)
        self.alienFxCornerSpinControl.selectText(self.alienFXControls.zone2SelectedColor)

        self.alienFxBrightnessImageControl = self.getControl(ALIENFX_BRIGHTNESS_IMAGE_CONTROL)
        self.alienFxBrightnessSpinControl = SpinControl(self,ALIENFX_BRIGHTNESS_GROUP_CONTROL,ALIENFX_BRIGHTNESS_LABEL_CONTROL,self.alienFxBrightnessChanged, self.alienFxBrightnessUpCallback, self.alienFxBrightnessDownCallback, alienFxBrightness,ALIENFX_BRIGHTNESS_SPIN_LEFT, ALIENFX_BRIGHTNESS_SPIN_RIGHT, ALIENFX_BRIGHTNESS_LEFT_FOCUS,ALIENFX_BRIGHTNESS_RIGHT_FOCUS)
        self.alienFxBrightnessSpinControl.selectText('{0}%'.format(self.alienFXControls.brightnessSpinIndex))
        self.setAlienFxBrightnessImage(self.alienFXControls.brightnessSpinIndex)
        
        self.spinControls.append(self.alienFxHeadSpinControl)  
        self.spinControls.append(self.alienFxCornerSpinControl)  
        self.spinControls.append(self.alienFxBrightnessSpinControl)  

        self.bluetoothOnRadioButton = self.getControl(BLUETOOTH_ON_RADIO_BUTTON_CONTROL)
        self.bluetoothDiscoverabilityRadioButton = self.getControl(BLUETOOTH_DISCOVERABILITY_ON_RADIO_BUTTON_CONTROL)
        self.bluetoothDevicesListControl = self.getControl(BLUETOOTH_DEVICES_LIST_CONTROL)

        self.bluetoothHelper = BluetoothHelper(self.bluetoothDevicesListControl,__addon__,__language__)
        self.bluetoothOnRadioButton.setSelected(self.bluetoothHelper.isBluetoothOn())

        self.updateWindowLabelControl = self.getControl(UPDATE_WINDOWS_LABEL_CONTROL)
        self.updateNvidiaLabelControl = self.getControl(UPDATE_NVIDIA_LABEL_CONTROL)
        self.updateAlienwareLabelControl = self.getControl(UPDATE_ALIENWARE_LABEL_CONTROL)

        self.updateWindowSetting = AlphaUIUtils.GetWindowsUpdateSetting()
        if (self.updateWindowSetting == 1):
            self.updateWindowSetting = 0
        self.updateWindowLabelControl.setLabel(__language__(33070 + self.updateWindowSetting))

        json_response = json.loads(xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "general.addonupdates"}, "id": 1 }'))
        self.updateAlienwareSetting = json_response['result']['value']
        self.updateAlienwareLabelControl.setLabel(__language__(33070 + self.updateAlienwareSetting))


        self.updateNvidiaLabelControl.setLabel(__language__(33070 + 2))

        self.refreshMute()

        self.lock = thread.allocate_lock()

        self.IsInitDone = True
Esempio n. 13
0
    if __name__ == '__main__':
        monitor = xbmc.Monitor()

        if not monitor.waitForAbort(3):

            programs = getPrograms(CATEGORY_ALL)

            if (programs):
                for program in programs:

                    if (program.type == TYPE_ADDON):
                        if (program.startAtBoot):

                            if (program.mouseKeyboardOnLoad):
                                AlphaUIUtils.EnableDisableControllerMouse(True)

                            xbmc.executebuiltin(program.path)

                    elif (program.type == TYPE_WIN32):
                        if (program.startAtBoot):
                            print(program.name + " : startAtBoot -> " +
                                  str(program.startAtBoot))
                            AlphaUIUtils.LaunchApplication(
                                unicode(program.path),
                                unicode(os.path.dirname(program.path)),
                                unicode(""), program.elevatePermission,
                                program.mouseKeyboardOnLoad,
                                program.mouseKeyboardOnLoad)

except:
Esempio n. 14
0
    except Exception, e:
        log(e.message)
        log(e.__class__.__name__)
        traceback.print_exc(e)

    return steamExe


if (__name__ == "__main__"):
    if (xbmcgui.Window(10004).getProperty(
            'service.aw.customizations.isComponentInstalled') == "False"):
        customizationAddon = xbmcaddon.Addon(id='service.aw.customizations')
        customizationAddonLanguage = customizationAddon.getLocalizedString

        xbmcgui.Dialog().ok(__addonname__, customizationAddonLanguage(33011))
    else:
        import AlphaUIUtils

        steamExePath = getSteamExePath()

        result = AlphaUIUtils.LaunchApplication(
            unicode(steamExePath), unicode(os.path.dirname(steamExePath)),
            unicode("steam://open/bigpicture"), True, False, False)

        if not result:
            customizationAddon = xbmcaddon.Addon(
                id='service.aw.customizations')
            customizationAddonLanguage = customizationAddon.getLocalizedString
            xbmcgui.Dialog().ok(__addonname__,
                                customizationAddonLanguage(33020))
Esempio n. 15
0
import xbmc
import xbmcgui


def setWindowSetting(key, value):
    win = xbmcgui.Window(10111)
    win.setProperty(key, value)


try:
    import AlphaUIUtils

    if __name__ == '__main__':
        try:
            setWindowSetting("IsAlphaConsoleAcount",
                             str(AlphaUIUtils.IsAlphaConsoleAcount()))
            #setWindowSetting("LaunchFirtTime",True)
        except:
            setWindowSetting("IsAlphaConsoleAcount", "False")
except:
    setWindowSetting("IsAlphaConsoleAcount", "False")
Esempio n. 16
0
 def checkCableConnection(self):
     return AlphaUIUtils.IsHDMICableConnected()
Esempio n. 17
0
import xbmc
import AlphaUIUtils

AlphaUIUtils.LaunchSteam()
Esempio n. 18
0
                xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=False)

            if (not viewModeId):
                xbmc.executebuiltin('Container.SetViewMode(%s)' % '500')
        elif (actionName == 'launchgame'):
            xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=False)
            gameId = args['gameid'][0]
            gameType = args['gametype'][0]
            try:

                if (gameType == "1"):
                    steamExePath = getSteamExePath()

                    result = AlphaUIUtils.LaunchApplication(
                        unicode(steamExePath),
                        unicode(os.path.dirname(steamExePath)),
                        unicode("-applaunch ") + unicode(gameId) +
                        unicode(" -steamos -bigpicture"), True, False, True)

                    if not result:
                        customizationAddon = xbmcaddon.Addon(
                            id='service.aw.customizations')
                        customizationAddonLanguage = customizationAddon.getLocalizedString
                        xbmcgui.Dialog().ok(__addonname__,
                                            customizationAddonLanguage(33020))

                elif (gameType == "2" or gameType == "4" or gameType == "5"
                      or gameType == CUSTOM_GAME_TYPE):
                    gamePath = args['gamepath'][0]
                    #subprocess.Popen(gamePath, cwd=os.path.dirname(gamePath))
                    result = AlphaUIUtils.LaunchApplication(
Esempio n. 19
0
import AlphaUIUtils

AlphaUIUtils.ToggleHDMISource()
Esempio n. 20
0
        xbmcgui.Dialog().ok(__addonname__,
                            __customizationaddonlanguage__(33011))
    else:
        import AlphaUIUtils
        try:

            name, exePath, gamePath = parseConfigurationFile()

            launchPath = exePath.replace('/', '\\')

            #if (not exeName or not exePath or not os.path.isfile(launchPath)):
            if (not os.path.isfile(launchPath)):
                if (xbmcgui.Dialog().yesno(
                        __addonname__, __customizationaddonlanguage__(33018),
                        '', __customizationaddonlanguage__(33019))):
                    AlphaUIUtils.EnableDisableControllerMouse(True)
                    webbrowser.open('http://www.battle.net')
            else:

                #subprocess.Popen(launchPath,cwd=os.path.dirname(launchPath))
                log(launchPath)
                log(os.path.dirname(launchPath))
                result = AlphaUIUtils.LaunchApplication(
                    unicode(launchPath), unicode(os.path.dirname(launchPath)),
                    unicode(""), True, False, False)
                if not result:
                    customizationAddon = xbmcaddon.Addon(
                        id='service.aw.customizations')
                    customizationAddonLanguage = customizationAddon.getLocalizedString
                    xbmcgui.Dialog().ok(__addonname__,
                                        customizationAddonLanguage(33020))
Esempio n. 21
0
import xbmc
import AlphaUIUtils

# Decide which power menu to first show
# Then each powermenu has it's own onload method "update_power_menu.py"
# that takes care of switching back/forth when mouse connects/disconnects

has_mouse = False
try:
    has_mouse = AlphaUIUtils.IsMouseConnected()
except Exception, e:
    xbmc.log(str(e))

if has_mouse:
    xbmc.executebuiltin("ReplaceWindow(4001)")
else:
    xbmc.executebuiltin("ReplaceWindow(4001)")
Esempio n. 22
0
 def enableHDMIIn(self):
     AlphaUIUtils.ToggleHDMISource()
     pass        
Esempio n. 23
0
import xbmc
import AlphaUIUtils

AlphaUIUtils.SleepSystem()
Esempio n. 24
0
import time
import random
import xbmc
import AlphaUIUtils

original_state = False
original_state = AlphaUIUtils.IsMouseConnected()
while True:
    try:
        new_state = AlphaUIUtils.IsMouseConnected()
        time.sleep(1)
    except Exception, e:
        xbmc.log(str(e))

    if original_state and not new_state:  # Had mouse connected, now we don't
        print "LOST MOUSE"
        xbmc.executebuiltin("ReplaceWindow(4000)")
        break
    elif not original_state and new_state:  # Did NOT have mouse connected, but now we do:
        print "GAINED MOUSE"
        xbmc.executebuiltin("ReplaceWindow(4001)")
        break
Esempio n. 25
0
    import xbmc
    import xbmcgui
    import json
    import AlphaUIUtils

    def writeHomeWindowSetting(key, value):
        win = xbmcgui.Window(10000)
        win.setProperty(key, value)
 
    if __name__ == '__main__':
        monitor = xbmc.Monitor()
        lastkeyboardlayouts = [unicode("English QWERTY")]
        lastskintheme = unicode("SKINDEFAULT")
        while True:                
            try:
                writeHomeWindowSetting("IsHDMIInCableConnected",str(AlphaUIUtils.IsHDMICableConnected()))
            except:
                writeHomeWindowSetting("IsHDMIInCableConnected","False")     

            try:
                json_response = json.loads(xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "locale.keyboardlayouts"}, "id": 1 }'))
                if(lastkeyboardlayouts != json_response['result']['value']):
                    lastkeyboardlayouts = json_response['result']['value']
                    keyboardlayouts = None
                    for lastkeyboardlayout in lastkeyboardlayouts:
                        if(not keyboardlayouts):
                            keyboardlayouts = lastkeyboardlayout;
                        else:
                            keyboardlayouts = keyboardlayouts + "|" + lastkeyboardlayout;
                    if(not keyboardlayouts):
                        keyboardlayouts = unicode("English QWERTY")
Esempio n. 26
0
import AlphaUIUtils

AlphaUIUtils.CloseLauncher()
Esempio n. 27
0
 def extractIcon(self, filePath, extractIconPath):
     return AlphaUIUtils.GetIconFromExecutable(unicode(filePath),
                                               unicode(extractIconPath))
Esempio n. 28
0
import xbmc
import xbmcgui
import os;

def setWindowSetting(key, value):
    win = xbmcgui.Window(10111)
    win.setProperty(key, value)

try:
    import AlphaUIUtils

    if __name__ == '__main__':
        try:
            setWindowSetting("IsAlphaConsoleAcount",str(AlphaUIUtils.IsAlphaConsoleAcount()))
            #setWindowSetting("LaunchFirtTime",True)
        except:
            setWindowSetting("IsAlphaConsoleAcount","False")     
except:
    setWindowSetting("IsAlphaConsoleAcount","False")  

try:
  if os.environ.get( "USERNAME" ) == "Alpha Console":
      setWindowSetting("IsAlphaConsoleAcount","True")
except:
  pass;