//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Created 2006-12-03 18:25:17 by Felix Rauscher
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//this
#include "MediaMenue.H"
#include "MediaSeparator.H"
#include "MediumItem.H"
//c - c++
#include "iostream"
using namespace std;

void MediaMenue :: CreateList()
	{
//Reread fstab
	_mlist->UpdateList();
//print mounted media
	if(_mlist->GetUnMountableMedia().size() >0)
		{
		Add(new MediaSeparator("<====MOUNTED MEDIA====>"));
		_add_media(_mlist->GetUnMountableMedia());
		}
//print not mounted media
	if(_mlist->GetMountableMedia().size() >0)
		{
		Add(new MediaSeparator("<====NOT MOUNTED MEDIA====>"));
		_add_media(_mlist->GetMountableMedia());
		}
	}
	
void MediaMenue :: _add_media(vector<Medium> & med)
	{
	for(unsigned int i=0; i<med.size(); i++)
		{
		cout<<i<<" "<<med[i].GetMountPoint()<<endl;
		Add(new MediumItem(&(med[i])));
		}
	}
	
