Ejemplo n.º 1
0
 def _save_usb_mode(self):
     global glob_current_usb_mode, glob_current_ps3_fw, glob_usb_mode_orig
     try:
         if glob_current_usb_mode == 0:
             os.system('echo Mode MTP > /wymedia/usr/etc/usbcable.conf')
             os.system('echo %s >> /wymedia/usr/etc/usbcable.conf' %
                       (glob_ps3_fw_dict[glob_current_ps3_fw]))
             self._update_initng(0)
         else:
             os.system('echo Mode PS3 > /wymedia/usr/etc/usbcable.conf')
             os.system('echo %s >> /wymedia/usr/etc/usbcable.conf' %
                       (glob_ps3_fw_dict[glob_current_ps3_fw]))
             self._update_initng(1)
         if glob_usb_mode_orig != glob_current_usb_mode:
             w = ConfirmWindow(text=_(
                 'Modifications will take effect after reboot.\nDo you want to reboot now ?'
             ),
                               confirm_action=self._reinit_box,
                               buttons=[
                                   Button(_('Yes'), False),
                                   Button(_('No'), True)
                               ])
             w.show()
     except:
         pass
Ejemplo n.º 2
0
 def confirm(self):
     from pygui.window import ConfirmWindow
     cw = ConfirmWindow(_('Delete %s ?' %
                          '\n'.join(self._get_universes_to_delete())),
                        confirm_action=self._delete)
     cw.buttons[1].connect(self._uncheck_all_items)
     cw.show()
     return None
Ejemplo n.º 3
0
 def __init__(self, text='', confirm_action=None, confirm_args=()):
     ConfirmWindow.__init__(
         self,
         text,
         buttons=[Button(_('Update'), True),
                  Button(_('Cancel'), False)],
         confirm_action=confirm_action,
         confirm_args=confirm_args)
     return None
Ejemplo n.º 4
0
 def prompt_tv_scan(play_on_no=False):
     buttons = [Button(_('Yes'), True), Button(_('No'), False)]
     buttons[0].connect(_fullscan)
     if play_on_no:
         buttons[1].connect(ChannelItem.player.play)
     messbox = ConfirmWindow(
         text=_('Do you want to launch a scan now?'), buttons=buttons)
     messbox.show()
     return None
Ejemplo n.º 5
0
 def _check_action(self):
     w = ConfirmWindow(text=_(
         _('Modifications will take effect after reboot.\nDo you want to reboot now ?'
           )),
                       confirm_action=self.restart_gui,
                       buttons=[
                           Button(_('Yes'), False),
                           Button(_('No'), True)
                       ])
     w.show()
Ejemplo n.º 6
0
 def apply_change(self):
     global glob_led_policy_etree
     glob_led_policy_etree.write('/etc/led_policy.xml', 'UTF-8')
     w = ConfirmWindow(text=_(
         'Modifications will take effect after reboot.\nDo you want to reboot now ?'
     ),
                       confirm_action=self._reinit_box,
                       buttons=[
                           Button(_('Yes'), False),
                           Button(_('No'), True)
                       ])
     w.show()
Ejemplo n.º 7
0
 def _check_action(self):
     from pygui.window.core import Button
     from pygui.window import ConfirmWindow
     w = ConfirmWindow(text=_(
         "You are about to reset the box. Are you sure you want to do it?\nIf 'Yes', box will reboot."
     ),
                       confirm_action=self.reinit_box,
                       buttons=[
                           Button(_('Yes'), False),
                           Button(_('No'), True)
                       ])
     w.show()
     return None
Ejemplo n.º 8
0
 def apply_change(self):
     global glob_setpoint_temp
     output_lines = []
     input_file = os.popen('cat /etc/wyclim/pid.conf')
     input_lines = input_file.readlines()
     input_file.close()
     output = os.open('/etc/wyclim/pid.conf', (os.O_WRONLY | os.O_TRUNC))
     for line in input_lines:
         if 'maxtemp' in line:
             os.write(output,
                      ('maxtemp %d\n' % (glob_setpoint_temp * 1000)))
         else:
             os.write(output, line)
     os.close(output)
     w = ConfirmWindow(text=_(
         'Modifications will take effect after reboot.\nDo you want to reboot now ?'
     ),
                       confirm_action=self._reinit_box,
                       buttons=[
                           Button(_('Yes'), False),
                           Button(_('No'), True)
                       ])
     w.show()
Ejemplo n.º 9
0
def execute_cancel_record(context):
	def __do_cancel(context):
		record = context['selected']
		scheduler = WyRecord().scheduler
		try:
			rule_id = record.periodic_rule.id
			scheduler.RemovePeriodicRecording(rule_id, 'delete_records', False)
		except AttributeError:
			try:
				scheduler.DeleteRecording(record, record.id)
			except SchedulerRecordingRunningError:
				error_title = _('Impossible to cancel recording')
				message = _('This recording has already started.')
				MessageWindow(message, error_title, button=None).show(timeout=5)
				return None
		context['selected'].show_menu()
		return None

	ConfirmWindow(_('Are you sure ?'), confirm_action=__do_cancel, confirm_args=(context,)).show()
	return None
Ejemplo n.º 10
0
	def _check_action(self):
		w = ConfirmWindow(text=_('Are you sure ?'), confirm_action=self.reinit_box, buttons=[Button(_('Yes'), False), Button(_('No'), True)])
		w.show()
Ejemplo n.º 11
0
 def event_stop(self, event):
     w = ConfirmWindow(
         text=_('Do you really want to stop record edition ?'),
         confirm_action=self._stop_playing)
     w.show()
Ejemplo n.º 12
0
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	fl.clear()
	menu = context['menu']
	menu.reload_func()
	menu._update_marker()

context['parent'].show_menu()
win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete)
win.show()
]:
	i: 
	o: 93(t), 117(f)

nname: 0&73
n 0&73(None)[def __do_delete():
	fl = markerlists().get(context['menu'].universe)
	try:
		fl.vfs_delete()
	except RemoveError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
Ejemplo n.º 13
0
	def confirm(self):
		from pygui.window import ConfirmWindow
		cw = ConfirmWindow(_('Delete %s ?' % '\n'.join(self._get_universes_to_delete())), confirm_action=self._delete)
		cw.buttons[1].connect(self._uncheck_all_items)
		cw.show()
Ejemplo n.º 14
0
	def _check_action(self):
		from pygui.window.core import Button
		from pygui.window import ConfirmWindow
		w = ConfirmWindow(text=_("You are about to reset the box. Are you sure you want to do it?\nIf 'Yes', box will reboot."), confirm_action=self.reinit_box, buttons=[Button(_('Yes'), False), Button(_('No'), True)])
		w.show()
Ejemplo n.º 15
0
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[ActionItem.__init__(self, action=self._check_action, **kw)
self.depth = 1
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76e390c>}
nname: 0
n 0(None)[from pygui.window.core import Button
from pygui.window import ConfirmWindow
w = ConfirmWindow(text=_("You are about to reset the box. Are you sure you want to do it?\nIf 'Yes', box will reboot."), confirm_action=self.reinit_box, buttons=[Button(_('Yes'), False), Button(_('No'), True)])
w.show()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76e3dec>}
nname: 0
n 0(None)[import os
from pygui.config import rw_dir
from pygui.facilities.power import reboot
f = open(os.path.join(rw_dir, 'reset-all'), 'w')
f.flush()
os.fsync(f.fileno())
f.close()
Task(reboot).start(delay=1)