#pragma once
|
|
#include <utility>
|
|
#include <set>
|
|
#include <fstream>
|
|
#include <rigid_paradise/config.h>
|
|
|
|
namespace pomodoro
|
|
{
|
|
using pomotask = std::pair<int, std::string>;
|
|
std::set<pomotask> get_pomodoro_tasks()
|
|
{
|
|
std::set<std::pair<int, std::string>> ret;
|
|
std::ifstream tasks(config::get_value("pomodoro.tasks"));
|
|
int counter = 1;
|
|
|
|
while(tasks.good())
|
|
{
|
|
std::string str;
|
|
getline (tasks, str);
|
|
|
|
if(str.size()>1 && str[0] != '#')
|
|
{
|
|
ret.insert(std::make_pair(counter++, str));
|
|
}
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
#define pomodoro_actions_unwrap {\
|
|
std::make_pair<char, std::string>('P',"Productive work"),\
|
|
std::make_pair<char, std::string>('B',"Parallel work"),\
|
|
std::make_pair<char, std::string>('C',"Non productive work"),\
|
|
std::make_pair<char, std::string>('D',"Productive discution or chat"),\
|
|
std::make_pair<char, std::string>('E',"Non productive chat"),\
|
|
std::make_pair<char, std::string>('T',"Learning"),\
|
|
std::make_pair<char, std::string>('S',"Improductive activity"),\
|
|
std::make_pair<char, std::string>('Z',"Break")\
|
|
}
|