def __init__(self, assistant):
        self._assistant = assistant
        self._table = Gtk.Table()

        self._table.attach(
            create_left_label("Filename:"), 0, 1, 0, 1, Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK
        )

        self._filename = Gtk.Entry()
        self._filename.set_editable(False)
        self._table.attach(self._filename, 1, 2, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.SHRINK)
        button = Gtk.Button("Choose File")
        button.connect("clicked", self._set_filename)
        self._table.attach(button, 2, 3, 0, 1, Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._table.attach(
            create_left_label("Frames per Second:"), 0, 1, 1, 2, Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK
        )
        button = Gtk.SpinButton()
        button.configure(Gtk.Adjustment(self._assistant.fps, 0, 99, 1, 5, 10), 1, 2)
        button.set_alignment(-1)
        button.connect("value-changed", self._fps_changed)
        self._table.attach(align(button, 0), 1, 3, 1, 2, Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._table.attach(Gtk.Label(), 1, 2, 2, 3, Gtk.AttachOptions.EXPAND, Gtk.AttachOptions.EXPAND)
    def __init__(self, assistant):
        self._assistant = assistant
        self._vbox = Gtk.VBox()

        self._vbox.pack_start(create_left_label(), True, True, 0)

        self._vbox.pack_start(Gtk.Label('Choose Function:'), False, False, 5)

        table = Gtk.Table()
        table.set_row_spacings(5)

        buttongroup = None
        i = 0

        self._plugins = [
            SpeedText()]
        self._pluginmap = {}

        for plugin in self._plugins:
            button = Gtk.RadioButton(buttongroup, plugin.title)
            if buttongroup is None:
                buttongroup = button
                self._assistant.plugin = plugin

            line = i * 2

            table.attach(button, 0, 2, line, line+1)

            table.attach(Gtk.Label('\t'), 0, 1, line+1, line+2)
            label = create_left_label()
            label.set_use_markup(True)
            label.set_markup('<i>' + plugin.description + '</i>')
            table.attach(label, 0, 1, line+1, line+2)

            self._pluginmap[button] = plugin

            button.connect("toggled", self.toggle, i)

            i += 1

        self._vbox.pack_start(table, False, False, 0)

        self._vbox.pack_start(create_left_label(), True, True, 0)
Beispiel #3
0
    def __init__(self, assistant):
        self._assistant = assistant
        self._duration = timedelta()
        self._offset = timedelta()
        self._track_starttime = None
        self._track_endtime = None
        self._userediting = True

        self._vbox = Gtk.VBox()

        frame = Gtk.Frame()
        label = Gtk.Label()
        label.set_use_markup(True)
        label.set_markup('<b>Track Information</b>')
        frame.set_label_widget(label)
        table = Gtk.Table()
        table.set_row_spacings(5)
        table.set_col_spacings(5)

        table.attach(create_left_label('Start of Track:'), 0, 1, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        self._track_start = create_left_label()
        table.attach(self._track_start, 1, 2, 0, 1)

        table.attach(create_left_label('End of Track:'), 0, 1, 1, 2,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        self._track_end = create_left_label()
        table.attach(self._track_end, 1, 2, 1, 2)

        frame.add(table)
        self._vbox.pack_start(frame, False, False, 5)

        self._offset_frame = Gtk.Frame()
        label = create_left_label()
        label.set_use_markup(True)
        label.set_markup('<b>Choose Time:</b>')
        self._offset_frame.set_label_widget(label)
        table = Gtk.Table()
        table.set_row_spacings(5)
        table.set_col_spacings(5)

        table.attach(create_left_label('Offset:'), 0, 1, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._start_hours = Gtk.SpinButton()
        self._start_hours.set_adjustment(Gtk.Adjustment(0, 0, 999, 1, 5, 0))
        table.attach(self._start_hours, 1, 2, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        self._start_hours.connect("value-changed", self.offset_changed)
        table.attach(create_left_label('h'), 2, 3, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._start_mins = Gtk.SpinButton()
        self._start_mins.set_adjustment(Gtk.Adjustment(0, 0, 59, 1, 5, 0))
        self._start_mins.connect("value-changed", self.offset_changed)
        table.attach(self._start_mins, 3, 4, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        table.attach(create_left_label('m'), 4, 5, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._start_secs = Gtk.SpinButton()
        self._start_secs.set_adjustment(Gtk.Adjustment(0, 0, 59, 1, 5, 0))
        self._start_secs.connect("value-changed", self.offset_changed)
        table.attach(self._start_secs, 5, 6, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        table.attach(create_left_label('s'), 6, 7, 0, 1,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._start_status = create_left_label()
        table.attach(self._start_status, 1, 8, 1, 2)

        table.attach(create_left_label('Resulting Start:'), 0, 1, 2, 3,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._start_time = create_left_label('')
        self._start_time.set_use_markup(True)
        table.attach(self._start_time, 1, 8, 2, 3)

        table.attach(Gtk.HSeparator(), 0, 8, 3, 4)

        table.attach(create_left_label('Duration:'), 0, 1, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._dur_hours = Gtk.SpinButton()
        self._dur_hours.set_adjustment(Gtk.Adjustment(0, 0, 999, 1, 5, 0))
        self._dur_hours.connect("value-changed", self.duration_changed)
        table.attach(self._dur_hours, 1, 2, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        table.attach(create_left_label('h'), 2, 3, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._dur_mins = Gtk.SpinButton()
        self._dur_mins.set_adjustment(Gtk.Adjustment(0, 0, 59, 1, 5, 0))
        self._dur_mins.connect("value-changed", self.duration_changed)
        table.attach(self._dur_mins, 3, 4, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        table.attach(create_left_label('m'), 4, 5, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._dur_secs = Gtk.SpinButton()
        self._dur_secs.set_adjustment(Gtk.Adjustment(0, 0, 59, 1, 5, 0))
        self._dur_secs.connect("value-changed", self.duration_changed)
        table.attach(self._dur_secs, 5, 6, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)
        table.attach(create_left_label('s'), 6, 7, 4, 5,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._dur_status = create_left_label()
        table.attach(self._dur_status, 1, 8, 5, 6)

        table.attach(create_left_label('Resulting End:'), 0, 1, 6, 7,
                     Gtk.AttachOptions.SHRINK, Gtk.AttachOptions.SHRINK)

        self._end_time = create_left_label()
        self._end_time.set_use_markup(True)
        table.attach(self._end_time, 1, 8, 6, 7)

        self._offset_frame.add(table)
        self._vbox.pack_start(self._offset_frame, False, False, 5)