def on_import_camera_params(self, *_):
     dialog = FileDialog(self.window,
                         'Choose a Camera param Matlab file',
                         'open',
                         current_folder=self.current_folder)
     dialog.add_mime_filter('Matlab file', 'text/plain')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         mat_file = dialog.get_filename()
         dialog.destroy()
         self.open_camera_params_file(mat_file)
     else:
         dialog.destroy()
 def on_open_video(self, *_):
     print("on_open_video")
     dialog = FileDialog(self.window,
                         'Choose a video',
                         'open',
                         current_folder=self.current_folder)
     dialog.add_mime_filter('Video', 'video/quicktime')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         self.video_file = dialog.get_filename()
         dialog.destroy()
         self.open_video_from_file(self.video_file)
     else:
         dialog.destroy()
 def on_open_annotations(self, *_):
     dialog = FileDialog(self.window, 'Choose a annotations csv file', 'open')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         file = dialog.get_filename()
         dialog.destroy()
         self.open_annotations(file)
     else:
         dialog.destroy()
 def on_save_as(self, *_):
     dialog = FileDialog(self.window, 'Save as', 'save', 'untitled.csv')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         self.save_file = dialog.get_filename()
         dialog.destroy()
         self.mouse_draw.save(self.save_file)
     else:
         dialog.destroy()
 def on_export_video(self, *_):
     dialog = FileDialog(self.window, 'Save as', 'save', 'untitled.avi')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         video_export_file = dialog.get_filename()
         print("Exporting video file: '%s' to file: '%s" % (self.video_file, video_export_file))
         video_export_generator = self.export_video_gen(self.window, self.video_file, video_export_file)
         GLib.idle_add(video_export_generator.__next__)
         dialog.destroy()
     else:
         dialog.destroy()
 def on_import_fov(self, *_):
     dialog = FileDialog(self.window,
                         'Choose a FOV file',
                         'open',
                         current_folder=self.current_folder)
     dialog.add_mime_filter('csv', 'test/csv')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         fov_file = dialog.get_filename()
         self.open_fov_file(fov_file)
     dialog.destroy()
 def on_import_drone_log(self, *_):
     dialog = FileDialog(self.window,
                         'Choose a drone log',
                         'open',
                         current_folder=self.current_folder)
     dialog.add_mime_filter('raw log', 'text/plain')
     dialog.add_mime_filter('csv log', 'text/csv')
     response = dialog.run()
     if response == Gtk.ResponseType.OK:
         log_file = dialog.get_filename()
         dialog.destroy()
         self.open_drone_log_from_file(log_file)
     else:
         dialog.destroy()