X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fscreens%2Fuserscreen.py;h=6b800b78369a424345812ec64596543990176ef2;hp=9eb2e6c3c9756a0e2832f5098cf3d054065e6322;hb=62dde09f684bc81e571f8c0d8439b39ec9b5cf2f;hpb=908ac46c4760618de030e0cad35479acc06dd22a diff --git a/sface/screens/userscreen.py b/sface/screens/userscreen.py index 9eb2e6c..6b800b7 100644 --- a/sface/screens/userscreen.py +++ b/sface/screens/userscreen.py @@ -59,6 +59,9 @@ class UserView(QTableView): node_data = node_index.data().toString() self.emit(SIGNAL('hostnameClicked(QString)'), node_data) + def hideUnusableColumns(self): + self.hideColumn(SERVER_MEMBERSHIP_STATUS_COLUMN) + class UserModel(QStandardItemModel): def __init__(self, rows=0, columns=4, parent=None): QStandardItemModel.__init__(self, rows, columns, parent) @@ -126,6 +129,19 @@ class UserModel(QStandardItemModel): return change + def getResearchers(self): + researchers = [] + item = self.invisibleRootItem() + children = item.rowCount() + for row in range(0, children): + childName = str(item.child(row, NAME_COLUMN).data(Qt.DisplayRole).toString()) + childStatus = str(item.child(row, MEMBERSHIP_STATUS_COLUMN).data(Qt.DisplayRole).toString()) + + if (childStatus == user_status['add']) or (childStatus == user_status['in']): + researchers.append(childName) + + return researchers + def readUserRecord(self, i): rec_file = config.getAuthorityListFile(i) if os.path.exists(rec_file):