Exemplo n.º 1
0
def test_find_cell_renderer():
  builder = gi.repository.Gtk.Builder()
  builder.add_from_resource(beeps.views.planview.ROUTINE_EDITOR_UI)
  view = builder.get_object('editordialog')
  assert(testhelper.find_cell_renderer(view, 'durationtreeviewcolumn', gi.repository.Gtk.CellRendererText) != None)
  assert(testhelper.find_cell_renderer(view, 'udrationtreeviewcolumn', gi.repository.Gtk.CellRendererText) == None)
  assert(testhelper.find_cell_renderer(view, 'durationtreeviewcolumn', gi.repository.Gtk.CellRendererSpin) == None)
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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')
Exemplo n.º 6
0
 def _do_update_an_interval_time(self):
   assert(int(self._controller.model.routines[0].intervals[0].time) == 1)
   testhelper.find_cell_renderer(self._controller.view, 'durationtreeviewcolumn', gi.repository.Gtk.CellRendererText).emit('edited', '0', 3)
   self._controller.view.get_widget_for_response(gi.repository.Gtk.ResponseType.ACCEPT).emit('clicked')
   assert(int(self._controller.model.routines[0].intervals[0].time) == 3)