def __init__(self, title, message, true_handler=None, false_handler=None): self.outcome = None self.content = StackLayout(orientation='lr-tb', spacing=dp(5)) self.content.add_widget( Label(text=message, size_hint=(None, None), size=(dp(272), dp(84)), halign='center')) yes_button = Button(text='yes', size_hint=(None, None), size=(dp(134), dp(20))) no_button = Button(text='no', size_hint=(None, None), size=(dp(134), dp(20))) self.content.add_widget(yes_button) self.content.add_widget(no_button) Popup.__init__(self, title=title, content=self.content, size_hint=(None, None), size=(dp(300), dp(170)), auto_dismiss=False) self.minimum_width = dp(272) self.true_handler_func = true_handler if true_handler != None else self.dismiss_pass self.false_handler_func = false_handler if false_handler != None else self.dismiss_pass yes_button.bind(on_release=self.dismiss_true) no_button.bind(on_release=self.dismiss_false)
def __init__(self, chan: Channel, app: 'ElectrumWindow', **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.is_closed = chan.is_closed() self.can_be_deleted = chan.can_be_deleted() self.app = app self.chan = chan self.title = _('Channel details') self.node_id = bh2u(chan.node_id) self.channel_id = bh2u(chan.channel_id) self.funding_txid = chan.funding_outpoint.txid self.short_id = format_short_channel_id(chan.short_channel_id) self.capacity = self.app.format_amount_and_units(chan.get_capacity()) self.state = chan.get_state_for_GUI() self.local_ctn = chan.get_latest_ctn(LOCAL) self.remote_ctn = chan.get_latest_ctn(REMOTE) self.local_csv = chan.config[LOCAL].to_self_delay self.remote_csv = chan.config[REMOTE].to_self_delay self.initiator = 'Local' if chan.constraints.is_initiator else 'Remote' feerate_kw = chan.get_latest_feerate(LOCAL) self.feerate = str(quantize_feerate(Transaction.satperbyte_from_satperkw(feerate_kw))) self.can_send = self.app.format_amount_and_units(chan.available_to_spend(LOCAL) // 1000) self.can_receive = self.app.format_amount_and_units(chan.available_to_spend(REMOTE) // 1000) self.is_open = chan.is_open() closed = chan.get_closing_height() if closed: self.closing_txid, closing_height, closing_timestamp = closed msg = messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP self.warning = '' if self.app.wallet.lnworker.channel_db or self.app.wallet.lnworker.is_trampoline_peer(chan.node_id) else _('Warning') + ': ' + msg self.is_frozen_for_sending = chan.is_frozen_for_sending() self.is_frozen_for_receiving = chan.is_frozen_for_receiving() self.update_action_dropdown()
def __init__(self, chan: Channel, app: 'ElectrumWindow', **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.is_closed = chan.is_closed() self.is_redeemed = chan.is_redeemed() self.app = app self.chan = chan self.title = _('Channel details') self.node_id = bh2u(chan.node_id) self.channel_id = bh2u(chan.channel_id) self.funding_txid = chan.funding_outpoint.txid self.short_id = format_short_channel_id(chan.short_channel_id) self.capacity = self.app.format_amount_and_units( chan.constraints.capacity) self.state = chan.get_state_for_GUI() self.local_ctn = chan.get_latest_ctn(LOCAL) self.remote_ctn = chan.get_latest_ctn(REMOTE) self.local_csv = chan.config[LOCAL].to_self_delay self.remote_csv = chan.config[REMOTE].to_self_delay self.initiator = 'Local' if chan.constraints.is_initiator else 'Remote' self.feerate = chan.get_latest_feerate(LOCAL) self.can_send = self.app.format_amount_and_units( chan.available_to_spend(LOCAL) // 1000) self.can_receive = self.app.format_amount_and_units( chan.available_to_spend(REMOTE) // 1000) self.is_open = chan.is_open() closed = chan.get_closing_height() if closed: self.closing_txid, closing_height, closing_timestamp = closed
def __init__(self, chan: Channel, app: 'ElectrumWindow', **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.is_closed = chan.is_closed() self.can_be_deleted = chan.can_be_deleted() self.app = app self.chan = chan self.title = _('Channel details') self.node_id = bh2u(chan.node_id) self.channel_id = bh2u(chan.channel_id) self.funding_txid = chan.funding_outpoint.txid self.short_id = format_short_channel_id(chan.short_channel_id) self.capacity = self.app.format_amount_and_units(chan.get_capacity()) self.state = chan.get_state_for_GUI() self.local_ctn = chan.get_latest_ctn(LOCAL) self.remote_ctn = chan.get_latest_ctn(REMOTE) self.local_csv = chan.config[LOCAL].to_self_delay self.remote_csv = chan.config[REMOTE].to_self_delay self.initiator = 'Local' if chan.constraints.is_initiator else 'Remote' feerate_kw = chan.get_latest_feerate(LOCAL) self.feerate = str(quantize_feerate(Transaction.satperbyte_from_satperkw(feerate_kw))) self.can_send = self.app.format_amount_and_units(chan.available_to_spend(LOCAL) // 1000) self.can_receive = self.app.format_amount_and_units(chan.available_to_spend(REMOTE) // 1000) self.is_open = chan.is_open() closed = chan.get_closing_height() if closed: self.closing_txid, closing_height, closing_timestamp = closed msg = ' '.join([ _("Trampoline routing is enabled, but this channel is with a non-trampoline node."), _("This channel may still be used for receiving, but it is frozen for sending."), _("If you want to keep using this channel, you need to disable trampoline routing in your preferences."), ]) self.warning = '' if self.app.wallet.lnworker.channel_db or self.app.wallet.lnworker.is_trampoline_peer(chan.node_id) else _('Warning') + ': ' + msg
def __init__(self, title, message): Popup.__init__(self) self.auto_dismiss = False self.title = title self.ids.message.text = message self.register_event_type('on_ok')
def __init__(self, sistema): Popup.__init__(self) self.sistema = sistema self.lista_recursos = DropDown() self.btn_lista.bind(on_release=self.lista_recursos.open) self.lista_recursos.bind(on_select=self.usar_recurso)
def __init__(self, chan: AbstractChannel, app: 'ElectrumWindow', **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.chan = chan self.app = app self.short_id = format_short_channel_id(chan.short_channel_id) self.state = chan.get_state_for_GUI() self.title = _('Channel Backup')
def __init__(self, chan: AbstractChannel, channels_list, **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.chan = chan self.channels_list = channels_list self.app = channels_list.app self.short_id = format_short_channel_id(chan.short_channel_id) self.state = chan.get_state_for_GUI() self.title = _('Channel Backup')
def __init__(self, chan: AbstractChannel, app, **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.chan = chan self.app = app self.short_id = format_short_channel_id(chan.short_channel_id) self.capacity = self.app.format_amount_and_units(chan.get_capacity()) self.state = chan.get_state_for_GUI() self.title = _('Channel Backup')
def __init__(self, watchdog, **kwargs): self._watchdog = watchdog Popup.__init__( self, title="Watchdog", content=Label(text=self._watchdog.check_failed_message), size_hint=(None, None), size=(400, 400), **kwargs )
def __init__(self, **kwargs): self.qc = kwargs.pop('qc', False) self.login = kwargs.pop('login', False) Popup.__init__(self, **kwargs) if self.qc: self.confirm_button.text = 'Pass' self.alternate_button.text = 'Fail' elif self.login: self.alternate_button.text = 'Log out' else: self.button_box.remove_widget(self.alternate_button)
def __init__(self, **kwargs): ''' Constructor ''' Popup.__init__(self, **kwargs) ''' Constructor ''' self.size_hint = (0.4, 0.4) self.auto_dismiss = True
def __init__(self, chan: AbstractChannel, app, **kwargs): Popup.__init__(self, **kwargs) Logger.__init__(self) self.chan = chan self.is_funded = chan.get_state() == ChannelState.FUNDED self.can_be_deleted = chan.can_be_deleted() self.funding_txid = chan.funding_outpoint.txid self.app = app self.short_id = format_short_channel_id(chan.short_channel_id) self.capacity = self.app.format_amount_and_units(chan.get_capacity()) self.state = chan.get_state_for_GUI() self.title = _('Channel Backup')
def __init__(self, **kwargs): qc = kwargs.pop('qc', False) self.caller = kwargs.pop('caller', None) self.login = kwargs.pop('login', False) Popup.__init__(self, **kwargs) if qc: self.confirm_button.text = 'Fail' self.alternate_button.text = 'Pass' elif self.login: self.button_box.remove_widget(self.confirm_button) self.button_box.remove_widget(self.alternate_button) else: self.button_box.remove_widget(self.alternate_button)
def __init__(self, object, getter, setter, attribute): Popup.__init__(self, title="Select Color") self.object = object self.getter = getter self.setter = setter self.attribute = attribute self._build() self.ok_btn.bind(on_release=self.okay) self.cancel_btn.bind(on_release=self.cancel) self.register_event_type("on_okay") self.register_event_type("on_cancel")
def __init__(self, procesador): Popup.__init__(self, size_hint=(1.0, 0.5), title='Gantt para %s' % procesador.nombre) self.procesador = procesador self.gantt = self.procesador.gantt self.contenedor = BoxLayout(orientation='vertical', size_hint_x=None) self.procesos = {} scroll = ScrollView() scroll.add_widget(self.contenedor) self.add_widget(scroll)
def __init__( self, onConfirm ) : w, h = screen_size() frm = BoxLayout( orientation="vertical" ) cont = BoxLayout( orientation="vertical" ) cont.spacing = 30 self.plotColor = ColorChooser( label="Plot Color :", rgb=[ 0, 1, 0 ] ) self.axisColor = ColorChooser( label="Axis Color :", rgb=[ 1, 1, 1 ] ) frm.add_widget( self.plotColor ) frm.add_widget( self.axisColor ) xRange = BoxLayout( orientation="vertical" ) xRange.add_widget( Label( text="X range :" ) ) self.xRangeMin = NumericUpDown( value=-1, vstep=0.1 ) self.xRangeMax = NumericUpDown( value=1, vstep=0.1 ) xRange.add_widget( self.xRangeMin ) xRange.add_widget( self.xRangeMax ) yRange = BoxLayout( orientation="vertical" ) yRange.add_widget( Label( text="Y range :" ) ) self.yRangeMin = NumericUpDown( value=-1, vstep=0.1 ) self.yRangeMax = NumericUpDown( value=1, vstep=0.1 ) yRange.add_widget( self.yRangeMin ) yRange.add_widget( self.yRangeMax ) btnConfirm = Button( text="Ok, Plot!" ) btnConfirm.bind( on_press=onConfirm ) btnConfirm.size_hint = 1, 0.1 self.expLabel = Label() self.expLabel.size_hint = 1, 0.1 r = BoxLayout( orientation="horizontal" ) r.spacing = 15 frm.add_widget( r ) r.add_widget( xRange ) r.add_widget( yRange ) cont.add_widget( self.expLabel ) cont.add_widget( frm ) cont.add_widget( btnConfirm ) Popup.__init__( self, \ title = 'Plotting Options', \ content = cont, \ size_hint = ( 0.95,0.95 ) ) setFont( self.content, FONT_NAME, FONT_SIZE ) self.expLabel.font_size = FONT_SIZE+5
def __init__(self, **kwargs): Popup.__init__(self, **kwargs) for toggle in app.toggles: if toggle.toggled: self.tempSetTime2 = toggle.setTime2 - toggle.setTime self.ids.temperature.value = toggle.setTemperature self.selectedHours1 = toggle.setTime // 60 self.selectedMinutes1 = toggle.setTime % 60 ## YEAH ## self.ids.temperature2.value = toggle.setTemperature2 self.selectedHours2 = self.tempSetTime2 // 60 self.selectedMinutes2 = self.tempSetTime2 % 60 self.ids.timePoint2Active.active = toggle.isTimePoint2On
def __init__(self, title, message): self.content = StackLayout(orientation='lr-tb') self.content.add_widget( Label(text=message, size_hint=(None, None), size=(dp(272), dp(60)), halign='center')) self.prog_bar = ProgressBar(max=100, size_hint=(None, None), size=(dp(272), dp(40))) self.prog_bar.value_normalized = 0.0 self.content.add_widget(self.prog_bar) Popup.__init__(self, title=title, content=self.content, size_hint=(None, None), size=(dp(300), dp(170)), auto_dismiss=False)
def __init__(self, title, message, dismiss_text='dismiss'): self.content = StackLayout(orientation='tb-lr') self.content.add_widget( Label(text=message, size_hint=(None, None), size=(dp(272), dp(86)), halign='center')) dismiss_button = Button(text=dismiss_text, size_hint=(None, None), size=(272, 20)) self.content.add_widget(dismiss_button) Popup.__init__(self, title=title, content=self.content, size_hint=(None, None), size=(dp(300), dp(170)), auto_dismiss=False) dismiss_button.bind(on_release=self.dismiss)
def __init__(self, score, **kwargs): self.title = "Koniec zadania" self.size_hint = (None, None) self.size = (550, 400) Popup.__init__(self, **kwargs) # Przygotowanie treści komunikatu box = BoxLayout(orientation="vertical") color = "#00EE00" time = "[color={c}]{s}[/color] sekund".format(s=score, c=color) if score < 60 else "[color={c}]{m:>02}:{s:>02}[/color] minuty".format(m=score // 60, s=score % 60, c=color) l = Label(text=u"[size=45][b]G r a t u l a c j e![/b][/size]\n\nZadanie zostało ukończone w czasie\n\n{time}.".format(time=time), markup=True, font_size=30, halign="center") b = Button(text="Ok", size_hint=(1.0, 0.2), on_release=self.dismiss) box.add_widget(l) box.add_widget(b) self.content = box
def __init__(self, key, update_func, **kwargs): Popup.__init__(self, **kwargs) self.title = key.capitalize() self.update_func = update_func self.ids['numpad'].set_target(self.add_label) self.current_job = App.get_running_app().current_job self.key = key self.wastage = self.current_job.wastage[self.key] self.numpad.enter_button.text = u'\u2795' self.numpad.set_enter_function(self.add_wastage) if self.wastage[0] != 0: self.unit_spinner.text = self.wastage[1] self.unit_spinner.disabled = True self.current_label.text = '{}'.format(self.wastage[0]) else: units = App.get_running_app().config.get( 'General', '{}_units'.format(self.key)) units = units.split(',') self.unit_spinner.text = units[0] self.unit_spinner.values = units self.current_label.text = '0'
def __init__(self,power_supply_channel,dmm_ip,voltage_or_current): Popup.__init__(self) self.calibrator = Calibrator(power_supply_channel,voltage_or_current,dmm_ip,self)
def __init(self): Popup.__init__(self)
def __init__(self, channel_control): Popup.__init__(self) self.dmm_ip.text = "K34461A" self.channel_control = channel_control self.calibration_type = None
def __init__(self, img, rec): Popup.__init__(self) (x, y, w, h) = rec self.image = img[y - 10:y + h + 10, x - 20:x + w + 20]
def __init__(self): Popup.__init__(self) self.content = AlkuContent(self)
def __init__(self, obj, ind): Popup.__init__(self) if ind is False: self.ids.popup.text="Error! Please try again"
def __init__(self, **kwargs): self.info = kwargs['info'] Popup.__init__(self, **kwargs)
def __init__(self, parent): Popup.__init__(self) self.myparent = parent
def __init__(self, title, text): self.text = text Popup.__init__(self, title=title)
def __init__(self, power_supply_channel, dmm_ip, voltage_or_current): Popup.__init__(self) self.calibrator = Calibrator(power_supply_channel, voltage_or_current, dmm_ip, self)
def __init__(self, sistema): Popup.__init__(self) self.sistema = sistema
def __init__(self, title, text, parent): self.myparent = parent Popup.__init__(self, title=" ", separator_color=[0.15, 0.15, 0.15, 0.15]) self.content = VaaraContent(text, self)