Ejemplo n.º 1
0
 def on_autotempradio_toggled(self, button: Gtk.RadioButton):
     active = button.get_active()
     self.builder.get_object('autotempgrid').set_sensitive(active)
     if active:
         dayadj = self.builder.get_object('daytempadj')
         nightadj = self.builder.get_object('nighttempadj')
         self.helper.temperature = (dayadj.get_value(),
                                    nightadj.get_value())
Ejemplo n.º 2
0
    def on_effect_changed(self, radio_button: Gtk.RadioButton,
                          effect: int) -> None:
        if not radio_button.get_active():
            return

        serial_message = 'be'
        config.new("back", "effect", str(effect))
        serial_message += config.parser.get("back", "effect")
        self.application.send_serial(serial_message)
Ejemplo n.º 3
0
 def go_to_quarter(self, button: Gtk.RadioButton) -> None:
     if self.is_updating \
             or not button.get_active():
         return
     radio_quarters = self.container_quarter.get_children()
     for index, radio in enumerate(radio_quarters):
         if button == radio:
             glob.quarter_number = index
             self.update('quarter-number')
             break
Ejemplo n.º 4
0
 def on_radio_reference_toggled(self, w: Gtk.RadioButton):
     if w.get_active():
         cb_reference = self.builder.get_object('cb_reference')
         cb_reference.set_sensitive(True)
         model, cbiter = cb_reference.get_model(), cb_reference.get_active_iter()
         if model is not None and cbiter is not None and cbiter != []:
             if self.dialog_drawer:
                 self.dialog_drawer.set_editing(self._markers[model[cbiter][0]], hide=self._edited_marker)
     else:
         self.builder.get_object('cb_reference').set_sensitive(False)
         if self.dialog_drawer and self._edited_marker and self._edited_pos:
             self.dialog_drawer.set_editing(self._edited_marker, editing_pos=self._edited_pos)
Ejemplo n.º 5
0
    def on_effect_changed(self, radio_button: Gtk.RadioButton,
                          effect: int) -> None:
        if not radio_button.get_active():
            return

        serial_message = 'fe'

        if self.fan_index == -1:
            config.new("front", "effect", str(effect) * 3)
        else:
            config.set_to_index("front", "effect", str(effect), self.fan_index)

        serial_message += config.parser.get("front", "effect")
        self.application.send_serial(serial_message)
Ejemplo n.º 6
0
def on_theme_choice_changed(choice: Gtk.RadioButton, *args):
    """
    @brief      Handler for theme choice change.

    @details    This is called when status of any theme choice radio button is
    changed.

    @param      choice   Gtk.RadioButton

    @param      args     place holder list

    @return     None
    """
    name: str = choice.get_name()
    selected: bool = choice.get_active()
    if selected:
        # print(f"Selected theme: {name}")
        dark_checkbox: Gtk.CheckButton = BUILDER.get_object(
            THEME_DARK_CHECKBOX, )
        dark_mode: bool = dark_checkbox.get_active()
        apply_theme(theme=name, dark=dark_mode)
Ejemplo n.º 7
0
 def _on_parser_set_cyk(self, radio: Gtk.RadioButton) -> None:
     if radio.get_active():
         self.watcher.set_parameters(parser="cyk")
Ejemplo n.º 8
0
 def get_boolean_from_radio_button(radio_button: Gtk.RadioButton) -> bool:
     """
     Checks if a radio button is currently selected and returns the value
     :return: True if the radio button is selected, False otherwise
     """
     return radio_button.get_active()