def go_to_manzil( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.manzil_number = int(button.get_value()) self.update('manzil-number')
def go_to_ruku( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.ruku_number = int(button.get_value()) self.update('ruku-number')
def go_to_hizb( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.hizb_number = int(button.get_value()) self.update('hizb-number')
def go_to_juz( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.juz_number = int(button.get_value()) self.update('juz-number')
def go_to_ayah( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.ayah_number = int(button.get_value()) self.update('ayah-number')
def go_to_page( self, button: Gtk.SpinButton) -> None: if self.is_updating: return glob.page_number = int(button.get_value()) + self.page_no_start - 1 self.update('page-number')
def _link_gtk_spinbutton_to_settings(settings: ApplicationSettings, spin: Gtk.SpinButton, settings_id: str): """ Link a Gtk.SpinButton to a GSettings ID, so any change in one of them will be reflected in the other one. """ name = spin.get_name() logging.debug( f"[LINK] settings::{settings_id} <-> spinbutton {name} [int]") curr_value = settings.get_int(settings_id) if curr_value: spin.set_value(settings.get_int(settings_id)) settings.connect( f"changed::{settings_id}", lambda s, k: spin.set_value(settings.get_int(settings_id))) spin.connect("change-value", lambda e: settings.set_int(settings_id, spin.get_value()))
def _spinbutton_value_changed_cb(self, spinbutton: Gtk.SpinButton, param_name: str): self._params[param_name] = spinbutton.get_value()
def _on_spin(self, widget: Gtk.SpinButton) -> bool: self.iterc = int(widget.get_value()) return True
def value_changed(self, spin: Gtk.SpinButton) -> None: self.emit('changed', spin.get_value())