1 from gi.repository
import Gtk
as gtk
11 self.
window = gtk.Window(gtk.WindowType.TOPLEVEL)
12 self.window.set_title(
'Select Options')
13 self.window.set_border_width(10)
14 self.window.set_default_size(150, 100)
18 entry_box, hours_spinner, mins_spinner, secs_spinner = UIUtils.get_time_spinners(mins=15)
20 button_box = gtk.HButtonBox()
21 cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
22 cancel_button.connect(
'clicked',
lambda w: self.window.destroy())
23 button_box.pack_start(cancel_button,
True,
True, 0)
24 ok_button = gtk.Button(stock=gtk.STOCK_OK)
25 ok_button.connect(
'clicked',
lambda w: self.
split_file(
26 hours_spinner.get_value_as_int(),
27 mins_spinner.get_value_as_int(),
28 secs_spinner.get_value_as_int()))
29 button_box.pack_start(ok_button,
True,
True, 0)
30 button_box.set_layout(gtk.ButtonBoxStyle.EDGE)
32 vbox.pack_start(gtk.Label(
'Please enter a length for the split segments (hour:min:sec):'),
True,
True, 0)
33 vbox.pack_start(entry_box,
True,
True, 0)
34 vbox.pack_end(button_box,
True,
True, 0)
38 self.window.show_all()
41 win_len = hours * 60 * 60 + mins * 60 + secs
43 progress_dialog =
ProgressDialog(title=
'Splitting file', phases=[
'Splitting TRS file...'])
48 progress_dialog.show()
49 splitter.split(win_len, progress_dialog.set_fraction)