Added information about packages installed

This commit is contained in:
2020-05-19 20:34:51 +02:00
parent 9eb45f329a
commit 4fc3d964ce
17 changed files with 202 additions and 20 deletions

33
controller_info.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include "controller_info.h"
#include <iostream>
std::string 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;
}
controller_info::controller_info(view_info *view, session_manager *sesion)
{
this->view=view;
this->sesion=sesion;
this->load_info();
}
void controller_info::load_info(){
std::list<std::string> list=this->sesion->get_packages_info();
for(std::string data:list){
Gtk::TreeModel::Row row = *(this->view->m_refTreeModel->append());
row[this->view->m_Columns.r_name]=get_first(data);
row[this->view->m_Columns.r_date]=get_first(data);
row[this->view->m_Columns.r_config]=(get_first(data)=="t");
row[this->view->m_Columns.r_user]=get_first(data);
}
/*row[this->view->m_Columns.r_name] = "firefox";
row[this->view->m_Columns.r_date] = "2020-10-2";
row[this->view->m_Columns.r_config] = true;
row[this->view->m_Columns.r_user] = "pepe";*/
}