1 # -*- coding: utf-8 -*-
3 # (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 from PyQt4.QtCore import *
27 from PyQt4.QtGui import *
31 class FABGroupTable(QTableWidget):
32 def __init__(self, parent):
33 QTableWidget.__init__(self, parent)
38 def setDatabase(self, db):
42 def dragMoveEvent(self, e):
43 item = self.itemAt(e.pos())
45 group = unicode(item.text())
51 names = unicode(e.mimeData().data(u'text/plain')).split(u'|')
52 group_members = self.db.group_members(group)
59 if n not in group_members:
66 def dropMimeData(self, row, col, data, action):
67 items = unicode(data.data(u'text/plain')).split(u'|')
68 self.emit(SIGNAL("namesAddedToGroup"), row, items)
73 return QStringList([u'text/plain'])