Пример #1
0
    def onControl(self, control):
        if control == self.close_button:
            self.stop()
        elif control == self.settings_button:
            utils.open_settings()
        else:
            button = self.getControl(control)
            response = button.send_cmd(control)
            if not response:
                msg = u"{0}: {1}".format(utils.get_string(32103), response.message)
                utils.notify(msg)

                if isinstance(control, xbmcgui.ControlRadioButton):
                    control.setSelected(not control.isSelected())
Пример #2
0
    def onControl(self, control):
        if control == self.close_button:
            self.stop()
        elif control == self.settings_button:
            utils.open_settings()
        else:
            button = self.getControl(control)
            response = button.send_cmd(control)
            if not response:
                msg = u"{0}: {1}".format(utils.get_string(32103),
                                         response.message)
                utils.notify(msg)

                if isinstance(control, xbmcgui.ControlRadioButton):
                    control.setSelected(not control.isSelected())
Пример #3
0
import xbmc
import xbmcaddon
import xbmcgui

from resources.lib import foscam
from resources.lib import utils
from resources.lib import gui


user = utils.get_setting('username')
password = utils.get_setting('password')
host = utils.get_setting('host')
port = utils.get_int_setting('port')

if not host:
    utils.error_dialog(utils.get_string(32101))
    sys.exit(1)

if utils.invalid_user_char(user, show_dialog=True):
    sys.exit(1)

if utils.invalid_password_char(password, show_dialog=True):
    sys.exit(1)

camera = foscam.Camera(host, port, user, password)
success, msg = camera.test()
if not success:
    utils.error_dialog(msg)
    sys.exit(1)

Пример #4
0
def error_dialog(msg):
    xbmcgui.Dialog().ok(utils.get_string(32000), msg, " ", utils.get_string(32102))
    utils.open_settings()
    sys.exit(1)
Пример #5
0
 def send_command(self, command):
     response = command.send()
     if not response:
         msg = u"{0}: {1}".format(utils.get_string(32104), response.message)
         utils.notify(msg)
Пример #6
0
 def send_command(self, command):
     response = command.send()
     if not response:
         msg = u"{0}: {1}".format(utils.get_string(32104), response.message)
         utils.notify(msg)
Пример #7
0
import xbmc
import xbmcaddon
import xbmcgui

from resources.lib import foscam
from resources.lib import utils
from resources.lib import gui

user = utils.get_setting('username')
password = utils.get_setting('password')
host = utils.get_setting('host')
port = utils.get_int_setting('port')

if not host:
    utils.error_dialog(utils.get_string(32101))
    sys.exit(1)

if utils.invalid_user_char(user, show_dialog=True):
    sys.exit(1)

if utils.invalid_password_char(password, show_dialog=True):
    sys.exit(1)

camera = foscam.Camera(host, port, user, password)
success, msg = camera.test()
if not success:
    utils.error_dialog(msg)
    sys.exit(1)