def test_find_cell_model(): builder = gi.repository.Gtk.Builder() builder.add_from_resource(beeps.views.planview.ROUTINE_EDITOR_UI) view = builder.get_object('editordialog') assert(testhelper.find_cell_model(view, 'soundtreeviewcolumn', 'soundsliststore') != None) assert(testhelper.find_cell_model(view, 'osundtreeviewcolumn', 'soundsliststore') == None) assert(testhelper.find_cell_model(view, 'soundtreeviewcolumn', 'osundsliststore') == None)
def _do_create_a_sound_chooser_dialog(self): self._controller.view.get_action_group('editor').lookup_action('interval::add').activate() v = testhelper.find_cell_model(self._controller.view, 'soundtreeviewcolumn', 'soundsliststore') i = '1' gi.repository.GLib.timeout_add(next(testhelper.CallbackDelay()), testhelper.gtk_call_once(self._do_sound_chooser_dialog_close)) testhelper.find_cell_renderer(self._controller.view, 'soundtreeviewcolumn', gi.repository.Gtk.CellRendererCombo).emit('changed', i, v.get_iter(i)) self._controller.view.get_widget_for_response(gi.repository.Gtk.ResponseType.ACCEPT).emit('clicked')
def _do_add_an_interval_sound(self): # add a sound and select it (appears as 3rd row in dropdown) v = testhelper.find_cell_model(self._controller.view, 'soundtreeviewcolumn', 'soundsliststore') it = v.append() v.set(it, v._sound_data(testhelper.SOUND_FILE)) i = '0' testhelper.find_cell_renderer(self._controller.view, 'soundtreeviewcolumn', gi.repository.Gtk.CellRendererCombo).emit('changed', i, v.get_iter(i)) self._controller.view.get_widget_for_response(gi.repository.Gtk.ResponseType.ACCEPT).emit('clicked')
def test_should_provide_the_selected_sound(self): testhelper.Events.routine_created(self._view, self._plan) testhelper.Events.interval_created(self._view, self._plan) liststore = testhelper.find_cell_model(self._view, 'soundtreeviewcolumn', 'soundsliststore') assert(self._view.selected_sound(liststore.get_iter('1')) == 'sound2.oga')
def _do_remove_an_interval_sound(self): v = testhelper.find_cell_model(self._controller.view, 'soundtreeviewcolumn', 'soundsliststore') i = '2' testhelper.find_cell_renderer(self._controller.view, 'soundtreeviewcolumn', gi.repository.Gtk.CellRendererCombo).emit('changed', i, v.get_iter(i)) self._controller.view.get_widget_for_response(gi.repository.Gtk.ResponseType.ACCEPT).emit('clicked')
def _do_remove_an_interval_sound(self): self._controller.view.get_action_group('editor').lookup_action('interval::add').activate() v = testhelper.find_cell_model(self._controller.view, 'soundtreeviewcolumn', 'soundsliststore') i = '1' testhelper.find_cell_renderer(self._controller.view, 'soundtreeviewcolumn', gi.repository.Gtk.CellRendererCombo).emit('changed', i, v.get_iter(i)) self._controller.view.get_widget_for_response(gi.repository.Gtk.ResponseType.ACCEPT).emit('clicked')