コード例 #1
0
ファイル: edit_list.py プロジェクト: maximerobin/Ufwi
 def _getSelectionObject(self, selected):
     rows = getSelectionRows(selected)
     if not rows:
         return None
     row = rows[0]
     try:
         return self.objects[row]
     except IndexError:
         # Invalid index: ignore
         return None
コード例 #2
0
ファイル: list.py プロジェクト: maximerobin/Ufwi
 def currentAcls(self):
     selections = self.table.selectionModel().selection()
     acls = []
     for row in getSelectionRows(selections):
         try:
             acl_id = self.acl_row2id[row]
         except KeyError:
             # It's an header: skip it
             continue
         acls.append(acl_id)
     return acls
コード例 #3
0
ファイル: generic_links.py プロジェクト: maximerobin/Ufwi
 def delete(self):
     table = self.ui.table
     selection = table.selectionModel().selection()
     rows = getSelectionRows(selection)
     row = rows[0]
     self.saveTableLinks()
     host = unicode(table.item(row, 0).text())
     type = unicode(table.item(row, 1).text())
     generic = unicode(table.item(row, 2).text())
     del self.links_list[host][type][generic]
     self.fillTable()
コード例 #4
0
ファイル: generic_links.py プロジェクト: maximerobin/Ufwi
 def selectionChanged(self, selected=None, deselected=None):
     rows = getSelectionRows(selected)
     self.ui.delete_button.setEnabled(bool(rows))