1 from gi.repository
import Gtk
as gtk
17 self.
window = gtk.Window(gtk.WindowType.TOPLEVEL)
18 self.window.set_title(
'Pitch Study')
19 self.window.connect(
'destroy',
lambda x: gtk.main_quit())
20 self.window.set_border_width(10)
21 self.window.set_default_size(210, 100)
23 box = gtk.VBox(
False, 5)
24 create_button = UIUtils.create_button(
'Run Batch', UIUtils.BUTTON_ICONS.RUN)
25 create_button.connect(
'clicked',
lambda widget, data=
None:
BatchSelectionWindow(self.props.clips_db_path))
26 box.pack_start(create_button,
False,
False, 0)
28 export_button = UIUtils.create_button(
'Export Results', UIUtils.BUTTON_ICONS.EXPORT)
29 export_button.connect(
'clicked',
lambda widget, data=
None: self.
_export_results())
30 box.pack_start(export_button,
False,
False, 0)
32 options_button = UIUtils.create_button(
'Options', UIUtils.BUTTON_ICONS.RUN)
33 options_button.connect(
'clicked',
lambda widget, data=
None:
OptionsWindow())
34 box.pack_start(options_button,
False,
False, 0)
36 exit_button = UIUtils.create_button(
'Exit', UIUtils.BUTTON_ICONS.EXIT)
37 exit_button.connect(
'clicked',
lambda widget: gtk.main_quit())
38 box.pack_start(exit_button,
False,
False, 0)
41 self.window.show_all()
44 folder = UIUtils.open_folder()
45 if folder
is not None and not folder.endswith(
'\\')
and not folder.endswith(
'/'):
52 pitch_exporter.export_data(self.props.clips_db_path, folder, progress.set_fraction)
53 progress.ensure_finish()
54 UIUtils.show_message_dialog(
'Data exported successfully.')
56 except Exception
as err:
58 print traceback.format_exc()
60 progress.ensure_finish()
61 UIUtils.show_message_dialog(
'There was an error exporting the data.\nPlease make sure the folders are not open in a Windows Explorer window.', dialog_type=gtk.MessageType.WARNING)