Exemple #1
0
 def __init__(self, *args, **kw):
     global glob_usb_mode_dict, glob_current_usb_mode, glob_ps3_fw_dict, glob_current_ps3_fw, glob_usb_mode_orig
     self._get_psfreedom_conf()
     glob_usb_mode_orig = glob_current_usb_mode
     ParametersSetupItem.__init__(self, *args, **kw)
     self.USBModeItem = PSFreedomCommonSetupItem(name=_(
         'Mode: %s' % (glob_usb_mode_dict[glob_current_usb_mode])),
                                                 type_='setupitem',
                                                 menu=self.menu,
                                                 display_type=None,
                                                 action=self._set_usb_mode)
     self.PS3FwVersionItem = PSFreedomCommonSetupItem(
         name=_('PS3 firmware: v%s' %
                (glob_ps3_fw_dict[glob_current_ps3_fw])),
         type_='setupitem',
         menu=self.menu,
         display_type=None,
         action=self._set_ps3_fw_version)
     self.PSFreedomStatusItem = PSFreedomCommonSetupItem(name=_(
         'Status: %s' % (self._get_psfreedom_status())),
                                                         type_='setupitem',
                                                         menu=self.menu,
                                                         display_type=None,
                                                         action=None)
     self.SaveSettingsItem = ActionItem(name=_('Save settings'),
                                        type_='setupitem',
                                        display_type=None,
                                        action=self._save_usb_mode)
     self.refresh_task = Task(self._refresh_status)
Exemple #2
0
 def __init__(self, extra_num, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.extra_num = extra_num
     self.Start_Extra_Item = ActionItem(_('Start Extra'),
                                        type_='setupitem',
                                        display_type=self._get_extra_status(
                                            'yes', 1),
                                        action=self._start_extra,
                                        args=[])
     self.Stop_Extra_Item = ActionItem(_('Stop Extra'),
                                       type_='setupitem',
                                       display_type=self._get_extra_status(
                                           'no', 1),
                                       action=self._stop_extra,
                                       args=[])
     self.Enable_Extra_Item = ActionItem(
         _('Enable Extra'),
         type_='setupitem',
         display_type=self._get_extra_status('running', 2),
         action=self._enable_extra,
         args=[])
     self.Disable_Extra_Item = ActionItem(
         _('Disable Extra'),
         type_='setupitem',
         display_type=self._get_extra_status('stopped', 2),
         action=self._disable_extra,
         args=[])
     self.preview_list = [
         self.Start_Extra_Item, self.Stop_Extra_Item,
         self.Enable_Extra_Item, self.Disable_Extra_Item
     ]
Exemple #3
0
 def reset_view(self):
     self.preview_list[0].display_type = self._get_extra_status('yes', 1)
     self.preview_list[1].display_type = self._get_extra_status('no', 1)
     self.preview_list[2].display_type = self._get_extra_status(
         'running', 2)
     self.preview_list[3].display_type = self._get_extra_status(
         'stopped', 2)
     for i in range(len(self.preview_list)):
         self.preview_list[i].reset_view()
     ParametersSetupItem.reset_view(self)
Exemple #4
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.preview_list = [
         TransitionParametersSetupItem('photo',
                                       'transition',
                                       config.HMI_PHOTO['transitions'],
                                       'Transition',
                                       type_='setupitem')
     ]
     return None
Exemple #5
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.preview_list = [
         LanguageUserConfigSetupItem(
             domain='video',
             key='language',
             choices_list=config.HMI_VIDEO['languages'],
             name='Default audio track',
             type_='setupitem')
     ]
     return None
Exemple #6
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.preview_list = [
         TVReplayHDParametersSetupItem(name='TVReplay HD videos',
                                       menu=self.menu,
                                       domain='video',
                                       key='tvreplay_hd',
                                       choices_list=sorted(UnicodeDict({
                                           True:
                                           'Yes',
                                           False:
                                           'No'
                                       }),
                                                           reverse=False))
     ]
     return None
Exemple #7
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.preview_list = [
         LanguageUserConfigSetupItem(
             domain='video',
             key='dailymotion_languages',
             choices_list=config.HMI_VIDEO['dailymotion_languages'],
             name=_('Default search language'),
             type_='setupitem'),
         DailyMotionFormatParametersSetupItem(
             domain='video',
             key='dailymotion_formats',
             choices_list=config.HMI_VIDEO['dailymotion_formats'],
             name=_('Default video format'),
             type_='setupitem')
     ]
     return None
Exemple #8
0
 def __init__(self, domain, key, choices_list, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.domain = domain
     self.key = key
     self.choices_list = choices_list
     try:
         value = config.user_config[domain][key]
         self.preview_list = [
             ActionItem(name=self.translation_dict.get(val, str(val)),
                        display_type=(('%s_checked' %
                                       val) if val == value else
                                      ('%s_not_checked' % val)),
                        type_='setupitem',
                        action=self._select_option,
                        args=[val]) for val in choices_list
         ]
     except AttributeError, e:
         PRINT_EXCEPTION(e)
Exemple #9
0
	def __init__(self, device, *args, **kw):
		self.device = device
		if self.device == 'Fan':
			self.prefix = _('Fan Speed : ')
			self.unit = _('Rpm')
			self.div = 1
			self.command = 'cat /sys/devices/platform/stm-pwm/pwm1 | tr -d "\n"'
		elif self.device == 'Cpu':
			self.prefix = _('Cpu Temp : ')
			self.unit = '\xc2\xb0C'
			self.command = 'cat /sys/bus/i2c/devices/0-0048/temp1_input | tr -d "\n"'
			self.div = 1000
		elif self.device == 'Hdd':
			self.prefix = _('Hdd Temp : ')
			self.unit = '\xc2\xb0C'
			self.command = '/wymedia/usr/bin/hddtemp -n /dev/sda 2> /dev/null | tr -d "\n"'
			self.div = 1
		self.name = '%s-- %s'%(self.prefix, self.unit)
		ParametersSetupItem.__init__(self, name=self.name, *args, **kw)
		if self.device == 'Cpu':
			self.preview_list = [CpuTempSetPointItem(name=_('Set Cpu Temp (%d %s)') % (self._get_setpoint_temp(), self.unit), type_='setupitem', menu=self.menu)]
Exemple #10
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.include_scrambled = user_config['tv']['scan_with_scrambled']
     self.all_channels_item = ActionItem(
         _('Free and pay channels'),
         type_='setupitem',
         display_type=('checked'
                       if self.include_scrambled else 'not_checked'),
         action=self.set_include_scrambled,
         args=(True, ))
     self.free_channels_only_item = ActionItem(
         _('Free channels only'),
         type_='setupitem',
         display_type=('not_checked'
                       if self.include_scrambled else 'checked'),
         action=self.set_include_scrambled,
         args=(False, ))
     self.preview_list = [
         self.all_channels_item, self.free_channels_only_item,
         TNTAutomaticScanItem(parent=self,
                              name='Start scan',
                              type_='setupitem')
     ]
     return None
Exemple #11
0
 def browse(self, preview=False):
     c = ParametersSetupItem(name='Copyright', type_='setupitem')
     c.execute = (lambda: LicenseMenu(
         'Licensing', filename='/wymedia/usr/share/doc/licenses.txt').show(
         ))
     return [
         ParametersSetupItem(name='WyDev Version: %s',
                             name_args=version.format_version(
                                 version.wydev_version()),
                             type_='setupitem'),
         ParametersSetupItem(name='WyDev Revision: %s',
                             name_args=version.format_version(
                                 version.wydev_revision()),
                             type_='setupitem'),
         ParametersSetupItem(name='WyPlay Version: %s',
                             name_args=version.format_version(
                                 version.wyplay_version()),
                             type_='setupitem'), c
     ]
Exemple #12
0
 def __init__(self, parent, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     self.parent = parent
     return None
Exemple #13
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     Task(self._get_extras_status).start(delay=1, loop=False)
     Task(self._set_preview_list).start(delay=1, loop=False)
Exemple #14
0
	def __init__(self, *args, **kw):
		ParametersSetupItem.__init__(self, *args, **kw)
		self.refresh_task = Task(self._refresh_infos)
		Task(self._set_preview_list).start(delay=1,loop=False)
Exemple #15
0
	def reset_view(self):
#		log.debug('reset_view call')
		new_name = _('Mem Usage : %d %%') % (self._get_value())
		if new_name != self.name:
			self.name = new_name
			ParametersSetupItem.reset_view(self)
Exemple #16
0
	def __init__(self, *args, **kw):
		self.name = _('Mem Usage : -- %')
		ParametersSetupItem.__init__(self, name=self.name, *args, **kw)
Exemple #17
0
 def __init__(self, *args, **kw):
     ParametersSetupItem.__init__(self, *args, **kw)
     return None
Exemple #18
0
	def reset_view(self):
#		log.debug('reset_view call')
		new_name = '%s%d %s'%(self.prefix, self._get_value(self.command), self.unit)
		if new_name != self.name:
			self.name = new_name
			ParametersSetupItem.reset_view(self)