Example #1
0
 def on_action_associations_add_activate(self, action):
     """Add a new service association"""
     dialog = UIServiceAssociation(self.ui.dialog_host,
                                   self.model_destinations)
     if dialog.show('', None, None) == Gtk.ResponseType.OK:
         self.model_associations.add_data(
             self.model_associations.count() + 1, dialog.destination,
             dialog.description, model_services.services[dialog.service],
             dialog.arguments)
     dialog.destroy()
Example #2
0
 def on_action_associations_add_activate(self, action):
     """Add a new service association"""
     dialog = UIServiceAssociation(self.ui.dialog_host,
                                   self.model_destinations)
     if dialog.show('', None, None) == Gtk.ResponseType.OK:
         self.model_associations.add_data(
             self.model_associations.count() + 1,
             dialog.destination,
             dialog.description,
             model_services.services[dialog.service],
             dialog.arguments)
     dialog.destroy()
Example #3
0
 def on_action_associations_edit_activate(self, action):
     """Edit the selected service association"""
     selected_row = get_treeview_selected_row(self.ui.tvw_associations)
     if selected_row:
         dialog = UIServiceAssociation(self.ui.dialog_host,
                                       self.model_destinations)
         model = self.model_associations
         selected_key = model.get_key(selected_row)
         selected_iter = model.get_iter(selected_key)
         if dialog.show(model.get_description(selected_row),
                        model.get_destination_name(selected_row),
                        model.get_service_name(selected_row),
                        json.loads(model.get_arguments(
                            selected_row))) == Gtk.ResponseType.OK:
             model.set_data(treeiter=selected_iter,
                            description=dialog.description,
                            destination_name=dialog.destination,
                            service=model_services.services[dialog.service],
                            arguments=dialog.arguments)
         dialog.destroy()
Example #4
0
 def on_action_associations_edit_activate(self, action):
     """Edit the selected service association"""
     selected_row = get_treeview_selected_row(self.ui.tvw_associations)
     if selected_row:
         dialog = UIServiceAssociation(self.ui.dialog_host,
                                       self.model_destinations)
         model = self.model_associations
         selected_key = model.get_key(selected_row)
         selected_iter = model.get_iter(selected_key)
         if dialog.show(
                 model.get_description(selected_row),
                 model.get_destination_name(selected_row),
                 model.get_service_name(selected_row),
                 json.loads(model.get_arguments(selected_row))
                 ) == Gtk.ResponseType.OK:
             model.set_data(
                 treeiter=selected_iter,
                 description=dialog.description,
                 destination_name=dialog.destination,
                 service=model_services.services[dialog.service],
                 arguments=dialog.arguments)
         dialog.destroy()