From 665ad78fa19580dc666fb9ed7628183b1d06bfe7 Mon Sep 17 00:00:00 2001 From: konrad Date: Mon, 28 Dec 2009 17:49:39 +0000 Subject: [PATCH] reactivated very basic host tab (most handling is still missing) git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@365 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/iface/msinterface.h | 3 +++ src/mwin/acltabs.cpp | 15 ++++++++------- src/mwin/overview.cpp | 2 +- wob/user.wolf | 5 +++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/iface/msinterface.h b/src/iface/msinterface.h index f4532a2..fa99253 100644 --- a/src/iface/msinterface.h +++ b/src/iface/msinterface.h @@ -33,6 +33,9 @@ class MSInterface:public MInterface /**returns the name of the current user*/ QString currentUser()const{return m_uname;} + /**returns the name used for the host in this session*/ + QString hostName()const{return m_host;} + /**returns whether the user is part of this role*/ bool hasRole(QString)const{return false;} diff --git a/src/mwin/acltabs.cpp b/src/mwin/acltabs.cpp index a6db96c..c0507e6 100644 --- a/src/mwin/acltabs.cpp +++ b/src/mwin/acltabs.cpp @@ -253,7 +253,7 @@ MHostTab::MHostTab(QString pk) p->setEnabled(req->hasRole("gethostkey")); vl->addStretch(10); - if(req->hasRole("gethosts")){ + if(req->hasRight(req->RGetAllHosts)){ updateHosts(); }else{ setEnabled(false); @@ -263,22 +263,23 @@ MHostTab::MHostTab(QString pk) void MHostTab::updateHosts() -{/*TODO +{ bool foundThis=false; QString thisHost=req->hostName(); - QListhsl=req->getAllHosts(); + MTGetAllHosts ah=req->queryGetAllHosts(); + QListhsl=ah.gethosts(); hostmodel->clear(); hostmodel->insertColumns(0,2); hostmodel->insertRows(0,hsl.size()); hostmodel->setHorizontalHeaderLabels(QStringList()<setData(hostmodel->index(i,0),hsl[i].hostId()); - hostmodel->setData(hostmodel->index(i,1),hsl[i].hostKey()); - if(thisHost==hsl[i].hostId()) + hostmodel->setData(hostmodel->index(i,0),hsl[i].name().value()); + hostmodel->setData(hostmodel->index(i,1),hsl[i].key().value()); + if(thisHost==hsl[i].name()) foundThis=true; } hosttable->resizeColumnsToContents(); - thishostbutton->setEnabled(!foundThis && req->hasRole("addhost"));*/ + thishostbutton->setEnabled(!foundThis && req->hasRight(req->RSetHost)); } void MHostTab::newHost() diff --git a/src/mwin/overview.cpp b/src/mwin/overview.cpp index a56190c..c5e0d26 100644 --- a/src/mwin/overview.cpp +++ b/src/mwin/overview.cpp @@ -153,7 +153,7 @@ MOverview::MOverview(QString pk) if(!req->hasRight(req->RGetAllUsers)){ tab->setTabEnabled(tab->indexOf(usertab),false); } - if(!req->hasRole("gethosts")){ + if(!req->hasRight(req->RGetAllHosts)){ tab->setTabEnabled(tab->indexOf(hosttab),false); } } diff --git a/wob/user.wolf b/wob/user.wolf index 4026b7b..7303bf1 100644 --- a/wob/user.wolf +++ b/wob/user.wolf @@ -133,6 +133,10 @@ + + + + @@ -234,6 +238,7 @@ + -- 1.7.2.5