Esempio n. 1
0
    def __init__(self, win, title, description, original_overscan=None):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        self.kano_button = KanoButton(_("APPLY CHANGES"))
        self.kano_button.connect('button-release-event', self.apply_changes)
        self.kano_button.pack_and_align()

        self.heading = Heading(title, description)
        self.pack_start(self.heading.container, False, False, 0)

        self.win = win
        self.win.set_main_widget(self)

        self.win.top_bar.enable_prev()

        # Launch pipe for the overscan c code
        launch_pipe()

        self.overscan_values = get_overscan_status()
        self.original_overscan = original_overscan

        # Pass original overscan values between the classes
        # If original_overscan hasn't been generated yet, get it from current
        # overscan status. Alternatively, maybe read this from a file in future
        if original_overscan is None:
            self.original_overscan = get_overscan_status()

        # Reset button
        self.reset_button = OrangeButton()
        reset_icon_path = os.path.join(common.media, '/Icons/reset.png')
        reset_image = Gtk.Image().new_from_file(reset_icon_path)
        self.reset_button.set_image(reset_image)
        self.reset_button.connect('button_press_event', self.reset)
    def __init__(self, win, title, description, original_overscan=None):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        self.kano_button = KanoButton("APPLY CHANGES")
        self.kano_button.connect("button-release-event", self.apply_changes)
        self.kano_button.pack_and_align()

        self.heading = Heading(title, description)
        self.pack_start(self.heading.container, False, False, 0)

        self.win = win
        self.win.set_main_widget(self)

        self.win.top_bar.enable_prev()

        # Launch pipe for the overscan c code
        launch_pipe()

        self.overscan_values = get_overscan_status()
        self.original_overscan = original_overscan

        # Pass original overscan values between the classes
        # If original_overscan hasn't been generated yet, get it from current overscan status
        # Alternatively, maybe read this from a file in future
        if original_overscan is None:
            self.original_overscan = get_overscan_status()

        # Reset button
        self.reset_button = OrangeButton()
        reset_image = Gtk.Image().new_from_file(common.media + "/Icons/reset.png")
        self.reset_button.set_image(reset_image)
        self.reset_button.connect("button_press_event", self.reset)
    def __init__(self, _win):
        self.win = _win

        # Launch pipeline
        if not os.path.exists(OVERSCAN_PIPE):
            run_cmd('mknod {} c 100 0'.format(OVERSCAN_PIPE))

        # Get current overscan
        self.original_overscan = get_overscan_status()
        self.overscan_values = get_overscan_status()

        # Listen for key events
        self.win.connect("key-press-event", self.on_key_press)

        # Create UI
        self.template = Template(
            img_path=os.path.join(MEDIA_DIR, "display_test2.png"),
            title="Use UP and DOWN keys",
            description="Stretch or shrink your screen, until the white " \
                        "lines are lined up with the edges",
            button1_text="CONTINUE",
            orange_button_text="Reset"
        )
        self.template.kano_button.connect("button_release_event",
                                          self.apply_changes)
        self.template.kano_button.connect("key_release_event",
                                          self.apply_changes)
        self.template.orange_button.connect("button_release_event",
                                            self.reset)
        self.win.set_main_widget(self.template)

        self.template.kano_button.grab_focus()

        self.win.show_all()
Esempio n. 4
0
    def __init__(self):
        # The command below initialises the overscan pipe as root
        # TODO: This would be nice to refactor.
        run_cmd('sudo kano-init-flow-system-tool init-overscan-pipe')

        self._enabled = True
        self._step = 10
        self._original = get_overscan_status()
        self._current = get_overscan_status()
Esempio n. 5
0
 def go_to_overscan(self, widget, event):
     self.win.clear_win()
     # Check if overscan values are all the same
     overscan_values = get_overscan_status()
     if overscan_values['top'] != overscan_values['bottom'] or \
        overscan_values['top'] != overscan_values['left'] or \
        overscan_values['top'] != overscan_values['right']:
         SetAdvancedOverscan(self.win, overscan_values)
     else:
         SetSimpleOverscan(self.win, overscan_values)
 def go_to_overscan(self, widget, event):
     self.win.clear_win()
     # Check if overscan values are all the same
     overscan_values = get_overscan_status()
     if overscan_values['top'] != overscan_values['bottom'] or \
        overscan_values['top'] != overscan_values['left'] or \
        overscan_values['top'] != overscan_values['right']:
         SetAdvancedOverscan(self.win, overscan_values)
     else:
         SetSimpleOverscan(self.win, overscan_values)