add user list

This commit is contained in:
2020-05-20 00:09:18 +02:00
parent 4fc3d964ce
commit 021139d669
12 changed files with 115 additions and 15 deletions

25
controller_user_info.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "controller_user_info.h"
controller_user_info::controller_user_info(view_user_info *view, session_manager *sesion)
{
this->view=view;
this->sesion=sesion;
this->load_info();
}
void controller_user_info::load_info(){
std::list<std::string> list=this->sesion->get_users_info();
for(std::string data:list){
Gtk::TreeModel::Row row = *(this->view->m_refTreeModel->append());
row[this->view->m_Columns.r_user]=get_first(data);
row[this->view->m_Columns.r_admin]=(get_first(data)=="t");
}
}
std::string controller_user_info::get_first(std::string &info){
int pos = info.find(":");
std::string ret = info.substr(0, pos);
info=info.substr(pos+1, info.size()+1);
return ret;
}