mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Merge branch 'recurrence' into 2.6.0
This commit is contained in:
commit
4e7576cb79
65 changed files with 652 additions and 484 deletions
|
@ -30,6 +30,9 @@
|
||||||
(thanks to Flavio Poletti).
|
(thanks to Flavio Poletti).
|
||||||
- TW-1857 Change Task::get call to the more efficient Task::has
|
- TW-1857 Change Task::get call to the more efficient Task::has
|
||||||
(thanks to Zachary Manning).
|
(thanks to Zachary Manning).
|
||||||
|
- TW‐1858 Change signature for dependencyGetBlocked
|
||||||
|
- TW-1859 Change signature of Task::getTags
|
||||||
|
- TW-1860 Change signature of Task::getAnnotations
|
||||||
- TW-1873 Specify different path to extensions/hooks directory
|
- TW-1873 Specify different path to extensions/hooks directory
|
||||||
(thanks to Eli).
|
(thanks to Eli).
|
||||||
- TW-1878 uuids subcommand produces a space-delimited list, not comma-delimited
|
- TW-1878 uuids subcommand produces a space-delimited list, not comma-delimited
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -20,6 +20,7 @@ Newly Deprecated Features in Taskwarrior 2.6.0
|
||||||
- The use of alternate Boolean configuration settings is deprecated. Use values
|
- The use of alternate Boolean configuration settings is deprecated. Use values
|
||||||
"0" for off, and "1" for on. Avoid used of "on", "off", "true", "t",
|
"0" for off, and "1" for on. Avoid used of "on", "off", "true", "t",
|
||||||
"false", "f", "yes", "y", "no", "n".
|
"false", "f", "yes", "y", "no", "n".
|
||||||
|
- The 'PARENT' and 'CHILD' virtual tags are replaced by 'TEMPLATE' and 'INSTANCE'.
|
||||||
|
|
||||||
Removed Features in 2.6.0
|
Removed Features in 2.6.0
|
||||||
|
|
||||||
|
|
|
@ -677,15 +677,16 @@ are:
|
||||||
ANNOTATED Matches if the task has annotations
|
ANNOTATED Matches if the task has annotations
|
||||||
BLOCKED Matches if the task is blocked
|
BLOCKED Matches if the task is blocked
|
||||||
BLOCKING Matches if the task is blocking
|
BLOCKING Matches if the task is blocking
|
||||||
CHILD Matches if the task has a parent
|
CHILD Matches if the task has a parent (deprecated in 2.6.0)
|
||||||
COMPLETED Matches if the task has completed status
|
COMPLETED Matches if the task has completed status
|
||||||
DELETED Matches if the task has deleted status
|
DELETED Matches if the task has deleted status
|
||||||
DUE Matches if the task is due
|
DUE Matches if the task is due
|
||||||
|
INSTANCE Matches if the task is a recurrent instance
|
||||||
LATEST Matches if the task is the newest added task
|
LATEST Matches if the task is the newest added task
|
||||||
MONTH Matches if the task is due this month
|
MONTH Matches if the task is due this month
|
||||||
ORPHAN Matches if the task has any orphaned UDA values
|
ORPHAN Matches if the task has any orphaned UDA values
|
||||||
OVERDUE Matches if the task is overdue
|
OVERDUE Matches if the task is overdue
|
||||||
PARENT Matches if the task is a parent
|
PARENT Matches if the task is a parent (deprecated in 2.6.0)
|
||||||
PENDING Matches if the task has pending status
|
PENDING Matches if the task has pending status
|
||||||
PRIORITY Matches if the task has a priority
|
PRIORITY Matches if the task has a priority
|
||||||
PROJECT Matches if the task has a project
|
PROJECT Matches if the task has a project
|
||||||
|
@ -693,6 +694,7 @@ are:
|
||||||
READY Matches if the task is actionable
|
READY Matches if the task is actionable
|
||||||
SCHEDULED Matches if the task is scheduled
|
SCHEDULED Matches if the task is scheduled
|
||||||
TAGGED Matches if the task has tags
|
TAGGED Matches if the task has tags
|
||||||
|
TEMPLATE Matches if the task is a recurrence template
|
||||||
TODAY Matches if the task is due today
|
TODAY Matches if the task is due today
|
||||||
TOMORROW Matches if the task is due sometime tomorrow
|
TOMORROW Matches if the task is due sometime tomorrow
|
||||||
UDA Matches if the task has any UDA values
|
UDA Matches if the task has any UDA values
|
||||||
|
|
|
@ -300,8 +300,7 @@ bool getDOM (const std::string& name, const Task& task, Variant& value)
|
||||||
|
|
||||||
if (ref.data.size () && size == 3 && elements[0] == "annotations")
|
if (ref.data.size () && size == 3 && elements[0] == "annotations")
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annos;
|
auto annos = ref.getAnnotations ();
|
||||||
ref.getAnnotations (annos);
|
|
||||||
|
|
||||||
int a = strtol (elements[1].c_str (), NULL, 10);
|
int a = strtol (elements[1].c_str (), NULL, 10);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -329,8 +328,7 @@ bool getDOM (const std::string& name, const Task& task, Variant& value)
|
||||||
|
|
||||||
if (ref.data.size () && size == 4 && elements[0] == "annotations" && elements[2] == "entry")
|
if (ref.data.size () && size == 4 && elements[0] == "annotations" && elements[2] == "entry")
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annos;
|
auto annos = ref.getAnnotations ();
|
||||||
ref.getAnnotations (annos);
|
|
||||||
|
|
||||||
int a = strtol (elements[1].c_str (), NULL, 10);
|
int a = strtol (elements[1].c_str (), NULL, 10);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
|
@ -528,10 +528,7 @@ void TF2::dependency_scan ()
|
||||||
{
|
{
|
||||||
if (left.has ("depends"))
|
if (left.has ("depends"))
|
||||||
{
|
{
|
||||||
std::vector <std::string> deps;
|
for (auto& dep : left.getDependencyUUIDs ())
|
||||||
left.getDependencies (deps);
|
|
||||||
|
|
||||||
for (auto& dep : deps)
|
|
||||||
{
|
{
|
||||||
for (auto& right : _tasks)
|
for (auto& right : _tasks)
|
||||||
{
|
{
|
||||||
|
|
66
src/Task.cpp
66
src/Task.cpp
|
@ -1081,13 +1081,14 @@ void Task::removeAnnotations ()
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::getAnnotations (std::map <std::string, std::string>& annotations) const
|
std::map <std::string, std::string> Task::getAnnotations () const
|
||||||
{
|
{
|
||||||
annotations.clear ();
|
std::map <std::string, std::string> a;
|
||||||
|
|
||||||
for (auto& ann : data)
|
for (auto& ann : data)
|
||||||
if (! ann.first.compare (0, 11, "annotation_", 11))
|
if (! ann.first.compare (0, 11, "annotation_", 11))
|
||||||
annotations.insert (ann);
|
a.insert (ann);
|
||||||
|
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1185,35 +1186,33 @@ void Task::removeDependency (int id)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::getDependencies (std::vector <int>& all) const
|
std::vector <int> Task::getDependencyIDs () const
|
||||||
{
|
{
|
||||||
auto deps = split (get ("depends"), ',');
|
std::vector <int> all;
|
||||||
|
for (auto& dep : split (get ("depends"), ','))
|
||||||
all.clear ();
|
|
||||||
|
|
||||||
for (auto& dep : deps)
|
|
||||||
all.push_back (context.tdb2.pending.id (dep));
|
all.push_back (context.tdb2.pending.id (dep));
|
||||||
|
|
||||||
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::getDependencies (std::vector <std::string>& all) const
|
std::vector <std::string> Task::getDependencyUUIDs () const
|
||||||
{
|
{
|
||||||
all = split (get ("depends"), ',');
|
return split (get ("depends"), ',');
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::getDependencies (std::vector <Task>& all) const
|
std::vector <Task> Task::getDependencyTasks () const
|
||||||
{
|
{
|
||||||
std::vector <std::string> deps = split (get ("depends"), ',');
|
std::vector <Task> all;
|
||||||
|
for (auto& dep : split (get ("depends"), ','))
|
||||||
all.clear ();
|
|
||||||
|
|
||||||
for (auto& dep : deps)
|
|
||||||
{
|
{
|
||||||
Task task;
|
Task task;
|
||||||
context.tdb2.get (dep, task);
|
context.tdb2.get (dep, task);
|
||||||
all.push_back (task);
|
all.push_back (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return all;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1260,11 +1259,13 @@ bool Task::hasTag (const std::string& tag) const
|
||||||
#endif
|
#endif
|
||||||
if (tag == "ACTIVE") return has ("start");
|
if (tag == "ACTIVE") return has ("start");
|
||||||
if (tag == "SCHEDULED") return has ("scheduled");
|
if (tag == "SCHEDULED") return has ("scheduled");
|
||||||
if (tag == "CHILD") return has ("parent");
|
if (tag == "CHILD") return has ("parent"); // 2017-01-07: Deprecated in 2.6.0
|
||||||
|
if (tag == "INSTANCE") return has ("template");
|
||||||
if (tag == "UNTIL") return has ("until");
|
if (tag == "UNTIL") return has ("until");
|
||||||
if (tag == "ANNOTATED") return hasAnnotations ();
|
if (tag == "ANNOTATED") return hasAnnotations ();
|
||||||
if (tag == "TAGGED") return has ("tags");
|
if (tag == "TAGGED") return has ("tags");
|
||||||
if (tag == "PARENT") return has ("mask");
|
if (tag == "PARENT") return has ("mask"); // 2017-01-07: Deprecated in 2.6.0
|
||||||
|
if (tag == "TEMPLATE") return has ("last");
|
||||||
if (tag == "WAITING") return get ("status") == "waiting";
|
if (tag == "WAITING") return get ("status") == "waiting";
|
||||||
if (tag == "PENDING") return get ("status") == "pending";
|
if (tag == "PENDING") return get ("status") == "pending";
|
||||||
if (tag == "COMPLETED") return get ("status") == "completed";
|
if (tag == "COMPLETED") return get ("status") == "completed";
|
||||||
|
@ -1313,9 +1314,9 @@ void Task::addTags (const std::vector <std::string>& tags)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Task::getTags (std::vector<std::string>& tags) const
|
std::vector <std::string> Task::getTags () const
|
||||||
{
|
{
|
||||||
tags = split (get ("tags"), ',');
|
return split (get ("tags"), ',');
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1336,12 +1337,15 @@ void Task::removeTag (const std::string& tag)
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// A UDA Orphan is an attribute that is not represented in context.columns.
|
// A UDA Orphan is an attribute that is not represented in context.columns.
|
||||||
void Task::getUDAOrphans (std::vector <std::string>& names) const
|
std::vector <std::string> Task::getUDAOrphanUUIDs () const
|
||||||
{
|
{
|
||||||
|
std::vector <std::string> orphans;
|
||||||
for (auto& it : data)
|
for (auto& it : data)
|
||||||
if (it.first.compare (0, 11, "annotation_", 11) != 0)
|
if (it.first.compare (0, 11, "annotation_", 11) != 0)
|
||||||
if (context.columns.find (it.first) == context.columns.end ())
|
if (context.columns.find (it.first) == context.columns.end ())
|
||||||
names.push_back (it.first);
|
orphans.push_back (it.first);
|
||||||
|
|
||||||
|
return orphans;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1354,8 +1358,7 @@ void Task::substitute (
|
||||||
|
|
||||||
// Get the data to modify.
|
// Get the data to modify.
|
||||||
std::string description = get ("description");
|
std::string description = get ("description");
|
||||||
std::map <std::string, std::string> annotations;
|
auto annotations = getAnnotations ();
|
||||||
getAnnotations (annotations);
|
|
||||||
|
|
||||||
// Count the changes, so we know whether to proceed to annotations, after
|
// Count the changes, so we know whether to proceed to annotations, after
|
||||||
// modifying description.
|
// modifying description.
|
||||||
|
@ -1864,19 +1867,16 @@ float Task::urgency ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
float Task::urgency_inherit () const
|
float Task::urgency_inherit () const
|
||||||
{
|
{
|
||||||
|
float v = FLT_MIN;
|
||||||
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
// Calling dependencyGetBlocked is rather expensive.
|
// Calling dependencyGetBlocked is rather expensive.
|
||||||
// It is called recursively for each dependency in the chain here.
|
// It is called recursively for each dependency in the chain here.
|
||||||
std::vector <Task> blocked;
|
for (auto& task : dependencyGetBlocked (*this))
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
|
||||||
dependencyGetBlocked (*this, blocked);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float v = FLT_MIN;
|
|
||||||
for (auto& task : blocked)
|
|
||||||
{
|
{
|
||||||
// Find highest urgency in all blocked tasks.
|
// Find highest urgency in all blocked tasks.
|
||||||
v = std::max (v, task.urgency ());
|
v = std::max (v, task.urgency ());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
32
src/Task.h
32
src/Task.h
|
@ -125,11 +125,11 @@ public:
|
||||||
bool hasTag (const std::string&) const;
|
bool hasTag (const std::string&) const;
|
||||||
void addTag (const std::string&);
|
void addTag (const std::string&);
|
||||||
void addTags (const std::vector <std::string>&);
|
void addTags (const std::vector <std::string>&);
|
||||||
void getTags (std::vector<std::string>&) const;
|
std::vector <std::string> getTags () const;
|
||||||
void removeTag (const std::string&);
|
void removeTag (const std::string&);
|
||||||
|
|
||||||
bool hasAnnotations () const;
|
bool hasAnnotations () const;
|
||||||
void getAnnotations (std::map <std::string, std::string>&) const;
|
std::map <std::string, std::string> getAnnotations () const;
|
||||||
void setAnnotations (const std::map <std::string, std::string>&);
|
void setAnnotations (const std::map <std::string, std::string>&);
|
||||||
void addAnnotation (const std::string&);
|
void addAnnotation (const std::string&);
|
||||||
void removeAnnotations ();
|
void removeAnnotations ();
|
||||||
|
@ -141,11 +141,11 @@ public:
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
void removeDependency (int);
|
void removeDependency (int);
|
||||||
void removeDependency (const std::string&);
|
void removeDependency (const std::string&);
|
||||||
void getDependencies (std::vector <int>&) const;
|
std::vector <int> getDependencyIDs () const;
|
||||||
void getDependencies (std::vector <std::string>&) const;
|
std::vector <std::string> getDependencyUUIDs () const;
|
||||||
void getDependencies (std::vector <Task>&) const;
|
std::vector <Task> getDependencyTasks () const;
|
||||||
|
|
||||||
void getUDAOrphans (std::vector <std::string>&) const;
|
std::vector <std::string> getUDAOrphanUUIDs () const;
|
||||||
|
|
||||||
void substitute (const std::string&, const std::string&, const std::string&);
|
void substitute (const std::string&, const std::string&, const std::string&);
|
||||||
#endif
|
#endif
|
||||||
|
@ -170,17 +170,17 @@ private:
|
||||||
const std::string decode (const std::string&) const;
|
const std::string decode (const std::string&) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
float urgency_project () const;
|
float urgency_project () const;
|
||||||
float urgency_active () const;
|
float urgency_active () const;
|
||||||
float urgency_scheduled () const;
|
float urgency_scheduled () const;
|
||||||
float urgency_waiting () const;
|
float urgency_waiting () const;
|
||||||
float urgency_blocked () const;
|
float urgency_blocked () const;
|
||||||
float urgency_inherit () const;
|
float urgency_inherit () const;
|
||||||
float urgency_annotations () const;
|
float urgency_annotations () const;
|
||||||
float urgency_tags () const;
|
float urgency_tags () const;
|
||||||
float urgency_due () const;
|
float urgency_due () const;
|
||||||
float urgency_blocking () const;
|
float urgency_blocking () const;
|
||||||
float urgency_age () const;
|
float urgency_age () const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -874,10 +874,7 @@ bool Variant::operator_match (const Variant& other, const Task& task) const
|
||||||
// in the annotations.
|
// in the annotations.
|
||||||
if (left.source () == "description")
|
if (left.source () == "description")
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& a : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
|
|
||||||
for (auto& a : annotations)
|
|
||||||
if (r.match (a.second))
|
if (r.match (a.second))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -909,10 +906,7 @@ bool Variant::operator_match (const Variant& other, const Task& task) const
|
||||||
// in the annotations.
|
// in the annotations.
|
||||||
if (left.source () == "description")
|
if (left.source () == "description")
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& a : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
|
|
||||||
for (auto& a : annotations)
|
|
||||||
if (find (a.second, pattern, searchCaseSensitive) != std::string::npos)
|
if (find (a.second, pattern, searchCaseSensitive) != std::string::npos)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,16 +14,18 @@ set (columns_SRCS Column.cpp Column.h
|
||||||
ColEntry.cpp ColEntry.h
|
ColEntry.cpp ColEntry.h
|
||||||
ColID.cpp ColID.h
|
ColID.cpp ColID.h
|
||||||
ColIMask.cpp ColIMask.h
|
ColIMask.cpp ColIMask.h
|
||||||
|
ColLast.cpp ColLast.h
|
||||||
ColMask.cpp ColMask.h
|
ColMask.cpp ColMask.h
|
||||||
ColModified.cpp ColModified.h
|
ColModified.cpp ColModified.h
|
||||||
ColParent.cpp ColParent.h
|
ColParent.cpp ColParent.h
|
||||||
ColProject.cpp ColProject.h
|
ColProject.cpp ColProject.h
|
||||||
ColRecur.cpp ColRecur.h
|
ColRecur.cpp ColRecur.h
|
||||||
|
ColRType.cpp ColRType.h
|
||||||
ColScheduled.cpp ColScheduled.h
|
ColScheduled.cpp ColScheduled.h
|
||||||
ColStart.cpp ColStart.h
|
ColStart.cpp ColStart.h
|
||||||
ColStatus.cpp ColStatus.h
|
ColStatus.cpp ColStatus.h
|
||||||
ColString.cpp ColString.h
|
|
||||||
ColTags.cpp ColTags.h
|
ColTags.cpp ColTags.h
|
||||||
|
ColTemplate.cpp ColTemplate.h
|
||||||
ColTypeDate.cpp ColTypeDate.h
|
ColTypeDate.cpp ColTypeDate.h
|
||||||
ColTypeDuration.cpp ColTypeDuration.h
|
ColTypeDuration.cpp ColTypeDuration.h
|
||||||
ColTypeNumeric.cpp ColTypeNumeric.h
|
ColTypeNumeric.cpp ColTypeNumeric.h
|
||||||
|
|
|
@ -58,7 +58,7 @@ ColumnDepends::ColumnDepends ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnDepends::setStyle (const std::string& value)
|
void ColumnDepends::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_DEP) _label = _label.substr (0, context.config.get ("dependency.indicator").length ());
|
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_DEP) _label = _label.substr (0, context.config.get ("dependency.indicator").length ());
|
||||||
else if (_style == "count" && _label == STRING_COLUMN_LABEL_DEP) _label = STRING_COLUMN_LABEL_DEP_S;
|
else if (_style == "count" && _label == STRING_COLUMN_LABEL_DEP) _label = STRING_COLUMN_LABEL_DEP_S;
|
||||||
|
@ -68,26 +68,25 @@ void ColumnDepends::setStyle (const std::string& value)
|
||||||
// Set the minimum and maximum widths for the value.
|
// Set the minimum and maximum widths for the value.
|
||||||
void ColumnDepends::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnDepends::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
minimum = maximum = 0;
|
||||||
dependencyGetBlocking (task, blocking);
|
if (task.has (_name))
|
||||||
|
|
||||||
if (_style == "indicator")
|
|
||||||
{
|
{
|
||||||
if (task.has ("depends"))
|
if (_style == "indicator")
|
||||||
minimum = maximum = utf8_width (context.config.get ("dependency.indicator"));
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
|
||||||
else if (_style == "count")
|
|
||||||
{
|
|
||||||
minimum = maximum = 2 + format ((int) blocking.size ()).length ();
|
|
||||||
}
|
|
||||||
else if (_style == "default" ||
|
|
||||||
_style == "list")
|
|
||||||
{
|
|
||||||
minimum = maximum = 0;
|
|
||||||
if (task.has ("depends"))
|
|
||||||
{
|
{
|
||||||
|
minimum = maximum = utf8_width (context.config.get ("dependency.indicator"));
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (_style == "count")
|
||||||
|
{
|
||||||
|
minimum = maximum = 2 + format ((int) dependencyGetBlocking (task).size ()).length ();
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (_style == "default" ||
|
||||||
|
_style == "list")
|
||||||
|
{
|
||||||
|
minimum = maximum = 0;
|
||||||
|
auto blocking = dependencyGetBlocking (task);
|
||||||
|
|
||||||
std::vector <int> blocking_ids;
|
std::vector <int> blocking_ids;
|
||||||
for (auto& i : blocking)
|
for (auto& i : blocking)
|
||||||
blocking_ids.push_back (i.id);
|
blocking_ids.push_back (i.id);
|
||||||
|
@ -104,8 +103,6 @@ void ColumnDepends::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -118,30 +115,31 @@ void ColumnDepends::render (
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "indicator")
|
if (_style == "indicator")
|
||||||
renderStringRight (lines, width, color, context.config.get ("dependency.indicator"));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
renderStringRight (lines, width, color, context.config.get ("dependency.indicator"));
|
||||||
dependencyGetBlocking (task, blocking);
|
}
|
||||||
|
|
||||||
if (_style == "count")
|
else if (_style == "count")
|
||||||
renderStringRight (lines, width, color, '[' + format (static_cast <int>(blocking.size ())) + ']');
|
{
|
||||||
|
renderStringRight (lines, width, color, '[' + format (static_cast <int>(dependencyGetBlocking (task).size ())) + ']');
|
||||||
|
}
|
||||||
|
|
||||||
else if (_style == "default" ||
|
else if (_style == "default" ||
|
||||||
_style == "list")
|
_style == "list")
|
||||||
{
|
{
|
||||||
std::vector <int> blocking_ids;
|
auto blocking = dependencyGetBlocking (task);
|
||||||
for (const auto& t : blocking)
|
|
||||||
blocking_ids.push_back (t.id);
|
|
||||||
|
|
||||||
auto combined = join (" ", blocking_ids);
|
std::vector <int> blocking_ids;
|
||||||
|
for (const auto& t : blocking)
|
||||||
|
blocking_ids.push_back (t.id);
|
||||||
|
|
||||||
std::vector <std::string> all;
|
auto combined = join (" ", blocking_ids);
|
||||||
wrapText (all, combined, width, _hyphenate);
|
|
||||||
|
|
||||||
for (const auto& i : all)
|
std::vector <std::string> all;
|
||||||
renderStringLeft (lines, width, color, i);
|
wrapText (all, combined, width, _hyphenate);
|
||||||
}
|
|
||||||
|
for (const auto& i : all)
|
||||||
|
renderStringLeft (lines, width, color, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,16 +40,17 @@ extern Context context;
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnDescription::ColumnDescription ()
|
ColumnDescription::ColumnDescription ()
|
||||||
{
|
{
|
||||||
_name = "description";
|
_name = "description";
|
||||||
_style = "combined";
|
_style = "combined";
|
||||||
_label = STRING_COLUMN_LABEL_DESC;
|
_label = STRING_COLUMN_LABEL_DESC;
|
||||||
|
_modifiable = true;
|
||||||
|
|
||||||
_styles = {"combined",
|
_styles = {"combined",
|
||||||
"desc",
|
"desc",
|
||||||
"oneline",
|
"oneline",
|
||||||
"truncated",
|
"truncated",
|
||||||
"count",
|
"count",
|
||||||
"truncated_count"};
|
"truncated_count"};
|
||||||
|
|
||||||
_dateformat = context.config.get ("dateformat.annotation");
|
_dateformat = context.config.get ("dateformat.annotation");
|
||||||
if (_dateformat == "")
|
if (_dateformat == "")
|
||||||
|
@ -101,9 +102,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||||
if (min_anno > minimum)
|
if (min_anno > minimum)
|
||||||
minimum = min_anno;
|
minimum = min_anno;
|
||||||
|
|
||||||
std::map <std::string, std::string> annos;
|
for (auto& i : task.getAnnotations ())
|
||||||
task.getAnnotations (annos);
|
|
||||||
for (auto& i : annos)
|
|
||||||
{
|
{
|
||||||
unsigned int len = min_anno + 1 + utf8_width (i.second);
|
unsigned int len = min_anno + 1 + utf8_width (i.second);
|
||||||
if (len > maximum)
|
if (len > maximum)
|
||||||
|
@ -128,9 +127,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||||
if (task.annotation_count)
|
if (task.annotation_count)
|
||||||
{
|
{
|
||||||
auto min_anno = Datetime::length (_dateformat);
|
auto min_anno = Datetime::length (_dateformat);
|
||||||
std::map <std::string, std::string> annos;
|
for (auto& i : task.getAnnotations ())
|
||||||
task.getAnnotations (annos);
|
|
||||||
for (auto& i : annos)
|
|
||||||
maximum += min_anno + 1 + utf8_width (i.second);
|
maximum += min_anno + 1 + utf8_width (i.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,9 +153,6 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
|
||||||
minimum = 4;
|
minimum = 4;
|
||||||
maximum = utf8_width (description) + 1 + 1 + format (task.annotation_count).length () + 1;
|
maximum = utf8_width (description) + 1 + 1 + format (task.annotation_count).length () + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -178,9 +172,7 @@ void ColumnDescription::render (
|
||||||
{
|
{
|
||||||
if (task.annotation_count)
|
if (task.annotation_count)
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annos;
|
for (const auto& i : task.getAnnotations ())
|
||||||
task.getAnnotations (annos);
|
|
||||||
for (const auto& i : annos)
|
|
||||||
{
|
{
|
||||||
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||||
description += '\n' + std::string (_indent, ' ') + dt.toString (_dateformat) + ' ' + i.second;
|
description += '\n' + std::string (_indent, ' ') + dt.toString (_dateformat) + ' ' + i.second;
|
||||||
|
@ -209,9 +201,7 @@ void ColumnDescription::render (
|
||||||
{
|
{
|
||||||
if (task.annotation_count)
|
if (task.annotation_count)
|
||||||
{
|
{
|
||||||
std::map <std::string, std::string> annos;
|
for (const auto& i : task.getAnnotations ())
|
||||||
task.getAnnotations (annos);
|
|
||||||
for (const auto& i : annos)
|
|
||||||
{
|
{
|
||||||
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
Datetime dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||||
description += ' ' + dt.toString (_dateformat) + ' ' + i.second;
|
description += ' ' + dt.toString (_dateformat) + ' ' + i.second;
|
||||||
|
|
|
@ -31,8 +31,9 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnDue::ColumnDue ()
|
ColumnDue::ColumnDue ()
|
||||||
{
|
{
|
||||||
_name = "due";
|
_name = "due";
|
||||||
_label = STRING_COLUMN_LABEL_DUE;
|
_modifiable = true;
|
||||||
|
_label = STRING_COLUMN_LABEL_DUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -31,8 +31,9 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnEntry::ColumnEntry ()
|
ColumnEntry::ColumnEntry ()
|
||||||
{
|
{
|
||||||
_name = "entry";
|
_name = "entry";
|
||||||
_label = STRING_COLUMN_LABEL_ADDED;
|
_modifiable = true;
|
||||||
|
_label = STRING_COLUMN_LABEL_ADDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -40,7 +41,7 @@ ColumnEntry::ColumnEntry ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnEntry::setStyle (const std::string& value)
|
void ColumnEntry::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "age" &&
|
if (_style == "age" &&
|
||||||
_label == STRING_COLUMN_LABEL_ADDED)
|
_label == STRING_COLUMN_LABEL_ADDED)
|
||||||
|
|
|
@ -55,10 +55,6 @@ void ColumnID::measure (Task& task, unsigned int& minimum, unsigned int& maximum
|
||||||
else length = 1 + (int) log10 ((double) task.id); // Slow
|
else length = 1 + (int) log10 ((double) task.id); // Slow
|
||||||
|
|
||||||
minimum = maximum = length;
|
minimum = maximum = length;
|
||||||
|
|
||||||
if (_style != "default" &&
|
|
||||||
_style != "number")
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -68,6 +64,7 @@ void ColumnID::render (
|
||||||
int width,
|
int width,
|
||||||
Color& color)
|
Color& color)
|
||||||
{
|
{
|
||||||
|
// Completed and deleted tasks have no ID.
|
||||||
if (task.id)
|
if (task.id)
|
||||||
renderInteger (lines, width, color, task.id);
|
renderInteger (lines, width, color, task.id);
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,15 +45,8 @@ ColumnIMask::ColumnIMask ()
|
||||||
void ColumnIMask::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnIMask::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
minimum = maximum = task.get (_name).length ();
|
||||||
minimum = maximum = task.get ("imask").length ();
|
|
||||||
|
|
||||||
if (_style != "default" &&
|
|
||||||
_style != "number")
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -64,7 +57,7 @@ void ColumnIMask::render (
|
||||||
Color& color)
|
Color& color)
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
renderStringRight (lines, width, color, task.get ("imask"));
|
renderStringRight (lines, width, color, task.get (_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
63
src/columns/ColLast.cpp
Normal file
63
src/columns/ColLast.cpp
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
// http://www.opensource.org/licenses/mit-license.php
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
|
#include <ColLast.h>
|
||||||
|
#include <format.h>
|
||||||
|
#include <i18n.h>
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
ColumnLast::ColumnLast ()
|
||||||
|
{
|
||||||
|
_name = "last";
|
||||||
|
_style = "number";
|
||||||
|
_label = STRING_COLUMN_LABEL_LAST;
|
||||||
|
_modifiable = false;
|
||||||
|
_styles = {"number"};
|
||||||
|
_examples = {"12"};
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Set the minimum and maximum widths for the value.
|
||||||
|
void ColumnLast::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
|
{
|
||||||
|
minimum = maximum = 0;
|
||||||
|
if (task.has (_name))
|
||||||
|
minimum = maximum = task.get (_name).length ();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void ColumnLast::render (
|
||||||
|
std::vector <std::string>& lines,
|
||||||
|
Task& task,
|
||||||
|
int width,
|
||||||
|
Color& color)
|
||||||
|
{
|
||||||
|
if (task.has (_name))
|
||||||
|
renderStringRight (lines, width, color, task.get (_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
|
@ -24,25 +24,19 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef INCLUDED_COLSTRING
|
#ifndef INCLUDED_COLLAST
|
||||||
#define INCLUDED_COLSTRING
|
#define INCLUDED_COLLAST
|
||||||
|
|
||||||
#include <vector>
|
#include <ColTypeNumeric.h>
|
||||||
#include <string>
|
|
||||||
#include <Column.h>
|
|
||||||
#include <Color.h>
|
|
||||||
#include <Task.h>
|
|
||||||
|
|
||||||
class ColumnString : public Column
|
class ColumnLast : public ColumnTypeNumeric
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColumnString ();
|
ColumnLast ();
|
||||||
void setReport (const std::string&);
|
void measure (Task&, unsigned int&, unsigned int&);
|
||||||
void measure (const std::string&, unsigned int&, unsigned int&);
|
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||||
void render (std::vector <std::string>&, const std::string&, int, Color&);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _hyphenate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -46,12 +46,7 @@ void ColumnMask::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
minimum = maximum = task.get (_name).length ();
|
||||||
minimum = maximum = task.get ("mask").length ();
|
|
||||||
|
|
||||||
if (_style != "default")
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -62,7 +57,7 @@ void ColumnMask::render (
|
||||||
Color& color)
|
Color& color)
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
renderStringLeft (lines, width, color, task.get ("mask"));
|
renderStringLeft (lines, width, color, task.get (_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -45,13 +45,10 @@ ColumnParent::ColumnParent ()
|
||||||
void ColumnParent::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnParent::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default" || _style == "long") minimum = maximum = 36;
|
if (_style == "default" || _style == "long") minimum = maximum = 36;
|
||||||
else if (_style == "short") minimum = maximum = 8;
|
else if (_style == "short") minimum = maximum = 8;
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ ColumnProject::ColumnProject ()
|
||||||
void ColumnProject::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnProject::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
std::string project = task.get (_name);
|
std::string project = task.get (_name);
|
||||||
|
@ -74,10 +73,6 @@ void ColumnProject::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||||
{
|
{
|
||||||
project = indentProject (project, " ", '.');
|
project = indentProject (project, " ", '.');
|
||||||
}
|
}
|
||||||
else if (_style != "default" &&
|
|
||||||
_style != "full" &&
|
|
||||||
_style != "indented")
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
|
|
||||||
minimum = longestWord (project);
|
minimum = longestWord (project);
|
||||||
maximum = utf8_width (project);
|
maximum = utf8_width (project);
|
||||||
|
|
|
@ -25,92 +25,77 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <cmake.h>
|
#include <cmake.h>
|
||||||
#include <ColString.h>
|
#include <ColRType.h>
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <format.h>
|
|
||||||
#include <shared.h>
|
#include <shared.h>
|
||||||
#include <util.h>
|
#include <format.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnString::ColumnString ()
|
ColumnRType::ColumnRType ()
|
||||||
{
|
{
|
||||||
_name = "string";
|
_name = "rtype";
|
||||||
_type = "string";
|
_style = "default";
|
||||||
_style = "left";
|
_label = STRING_COLUMN_LABEL_RTYPE;
|
||||||
_label = "";
|
_modifiable = false;
|
||||||
_styles = {"left",
|
_styles = {"default", "indicator"};
|
||||||
"right",
|
_examples = {"periodic", "chained"};
|
||||||
"left_fixed",
|
|
||||||
"right_fixed"};
|
|
||||||
_examples = {"Hello (wrapped) ",
|
|
||||||
" Hello (wrapped)",
|
|
||||||
"Hello (no-wrap) ",
|
|
||||||
" Hello (no-wrap)"};
|
|
||||||
_hyphenate = context.config.getBoolean ("hyphenate");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// ColumnString is unique - it copies the report name into the label. This is
|
// Overriden so that style <----> label are linked.
|
||||||
// a kludgy reuse of an otherwise unused member.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnString::setReport (const std::string& value)
|
void ColumnRType::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_report = _label = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
|
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RTYPE)
|
||||||
|
_label = _label.substr (0, context.config.get ("rtype.indicator").length ());
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Set the minimum and maximum widths for the value.
|
// Set the minimum and maximum widths for the value.
|
||||||
//
|
void ColumnRType::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
void ColumnString::measure (const std::string& value, unsigned int& minimum, unsigned int& maximum)
|
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
if (task.has (_name))
|
||||||
if (_style == "left" ||
|
|
||||||
_style == "right" ||
|
|
||||||
_style == "default")
|
|
||||||
{
|
{
|
||||||
std::string stripped = Color::strip (value);
|
if (_style == "default")
|
||||||
maximum = longestLine (stripped);
|
minimum = maximum = task.get (_name).length ();
|
||||||
minimum = longestWord (stripped);
|
else if (_style == "indicator")
|
||||||
|
minimum = maximum = 1;
|
||||||
}
|
}
|
||||||
else if (_style == "left_fixed" ||
|
|
||||||
_style == "right_fixed")
|
|
||||||
minimum = maximum = strippedLength (value);
|
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void ColumnString::render (
|
void ColumnRType::render (
|
||||||
std::vector <std::string>& lines,
|
std::vector <std::string>& lines,
|
||||||
const std::string& value,
|
Task& task,
|
||||||
int width,
|
int width,
|
||||||
Color& color)
|
Color& color)
|
||||||
{
|
{
|
||||||
if (_style == "default" || _style == "left")
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
std::vector <std::string> raw;
|
if (_style == "default")
|
||||||
wrapText (raw, value, width, _hyphenate);
|
renderStringRight (lines, width, color, task.get (_name));
|
||||||
|
|
||||||
for (auto& i : raw)
|
else if (_style == "indicator")
|
||||||
renderStringLeft (lines, width, color, i);
|
{
|
||||||
|
std::string value {" "};
|
||||||
|
value[0] = toupper (task.get (_name)[0]);
|
||||||
|
renderStringRight (lines, width, color, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (_style == "right")
|
}
|
||||||
{
|
|
||||||
std::vector <std::string> raw;
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
wrapText (raw, value, width, _hyphenate);
|
bool ColumnRType::validate (const std::string& input) const
|
||||||
|
{
|
||||||
for (auto& i : raw)
|
return input == "periodic" ||
|
||||||
renderStringRight (lines, width, color, i);
|
input == "chained";
|
||||||
}
|
|
||||||
|
|
||||||
else if (_style == "left_fixed")
|
|
||||||
renderStringLeft (lines, width, color, value);
|
|
||||||
|
|
||||||
else if (_style == "right_fixed")
|
|
||||||
renderStringRight (lines, width, color, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
45
src/columns/ColRType.h
Normal file
45
src/columns/ColRType.h
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
// http://www.opensource.org/licenses/mit-license.php
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDED_COLRTYPE
|
||||||
|
#define INCLUDED_COLRTYPE
|
||||||
|
|
||||||
|
#include <ColTypeString.h>
|
||||||
|
|
||||||
|
class ColumnRType : public ColumnTypeString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ColumnRType ();
|
||||||
|
void setStyle (const std::string&);
|
||||||
|
void measure (Task&, unsigned int&, unsigned int&);
|
||||||
|
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||||
|
bool validate (const std::string&) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
|
@ -44,11 +44,12 @@ extern Task& contextTask;
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnRecur::ColumnRecur ()
|
ColumnRecur::ColumnRecur ()
|
||||||
{
|
{
|
||||||
_name = "recur";
|
_name = "recur";
|
||||||
_style = "duration";
|
_style = "duration";
|
||||||
_label = STRING_COLUMN_LABEL_RECUR;
|
_label = STRING_COLUMN_LABEL_RECUR;
|
||||||
_styles = {"duration", "indicator"};
|
_modifiable = true;
|
||||||
_examples = {"weekly", context.config.get ("recurrence.indicator")};
|
_styles = {"duration", "indicator"};
|
||||||
|
_examples = {"weekly", context.config.get ("recurrence.indicator")};
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -56,7 +57,7 @@ ColumnRecur::ColumnRecur ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnRecur::setStyle (const std::string& value)
|
void ColumnRecur::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RECUR)
|
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RECUR)
|
||||||
_label = _label.substr (0, context.config.get ("recurrence.indicator").length ());
|
_label = _label.substr (0, context.config.get ("recurrence.indicator").length ());
|
||||||
|
@ -67,23 +68,17 @@ void ColumnRecur::setStyle (const std::string& value)
|
||||||
void ColumnRecur::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnRecur::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default" ||
|
if (_style == "default" ||
|
||||||
_style == "duration")
|
_style == "duration")
|
||||||
{
|
{
|
||||||
minimum = maximum = Duration (task.get ("recur")).formatISO ().length ();
|
minimum = maximum = Duration (task.get (_name)).formatISO ().length ();
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has ("recur"))
|
minimum = maximum = utf8_width (context.config.get ("recurrence.indicator"));
|
||||||
minimum = maximum = utf8_width (context.config.get ("recurrence.indicator"));
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +93,7 @@ void ColumnRecur::render (
|
||||||
{
|
{
|
||||||
if (_style == "default" ||
|
if (_style == "default" ||
|
||||||
_style == "duration")
|
_style == "duration")
|
||||||
renderStringRight (lines, width, color, Duration (task.get ("recur")).formatISO ());
|
renderStringRight (lines, width, color, Duration (task.get (_name)).formatISO ());
|
||||||
|
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
renderStringRight (lines, width, color, context.config.get ("recurrence.indicator"));
|
renderStringRight (lines, width, color, context.config.get ("recurrence.indicator"));
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnScheduled::ColumnScheduled ()
|
ColumnScheduled::ColumnScheduled ()
|
||||||
{
|
{
|
||||||
_name = "scheduled";
|
_name = "scheduled";
|
||||||
_label = STRING_COLUMN_LABEL_SCHED;
|
_label = STRING_COLUMN_LABEL_SCHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -40,9 +40,9 @@ ColumnScheduled::ColumnScheduled ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnScheduled::setStyle (const std::string& value)
|
void ColumnScheduled::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "countdown" && _label == STRING_COLUMN_LABEL_DUE)
|
if (_style == "countdown" && _label == STRING_COLUMN_LABEL_SCHED)
|
||||||
_label = STRING_COLUMN_LABEL_COUNT;
|
_label = STRING_COLUMN_LABEL_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ ColumnStart::ColumnStart ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnStart::setStyle (const std::string& value)
|
void ColumnStart::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "active" && _label == STRING_COLUMN_LABEL_STARTED)
|
if (_style == "active" && _label == STRING_COLUMN_LABEL_STARTED)
|
||||||
_label = STRING_COLUMN_LABEL_ACTIVE;
|
_label = STRING_COLUMN_LABEL_ACTIVE;
|
||||||
|
@ -58,18 +58,14 @@ void ColumnStart::setStyle (const std::string& value)
|
||||||
void ColumnStart::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnStart::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "active")
|
if (_style == "active")
|
||||||
{
|
minimum = maximum = utf8_width (context.config.get ("active.indicator"));
|
||||||
if (task.has ("start"))
|
|
||||||
minimum = maximum = utf8_width (context.config.get ("active.indicator"));
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
ColumnTypeDate::measure (task, minimum, maximum);
|
ColumnTypeDate::measure (task, minimum, maximum);
|
||||||
|
|
||||||
|
// TODO Throw on bad format.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ ColumnStatus::ColumnStatus ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnStatus::setStyle (const std::string& value)
|
void ColumnStatus::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "short" && _label == STRING_COLUMN_LABEL_STATUS)
|
if (_style == "short" && _label == STRING_COLUMN_LABEL_STATUS)
|
||||||
_label = STRING_COLUMN_LABEL_STAT;
|
_label = STRING_COLUMN_LABEL_STAT;
|
||||||
|
@ -74,8 +74,6 @@ void ColumnStatus::measure (Task& task, unsigned int& minimum, unsigned int& max
|
||||||
}
|
}
|
||||||
else if (_style == "short")
|
else if (_style == "short")
|
||||||
minimum = maximum = 1;
|
minimum = maximum = 1;
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -59,7 +59,7 @@ ColumnTags::ColumnTags ()
|
||||||
// Note that you can not determine which gets called first.
|
// Note that you can not determine which gets called first.
|
||||||
void ColumnTags::setStyle (const std::string& value)
|
void ColumnTags::setStyle (const std::string& value)
|
||||||
{
|
{
|
||||||
_style = value;
|
Column::setStyle (value);
|
||||||
|
|
||||||
if (_style == "indicator" &&
|
if (_style == "indicator" &&
|
||||||
_label == STRING_COLUMN_LABEL_TAGS)
|
_label == STRING_COLUMN_LABEL_TAGS)
|
||||||
|
@ -75,15 +75,11 @@ void ColumnTags::setStyle (const std::string& value)
|
||||||
void ColumnTags::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnTags::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "indicator")
|
if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has ("tags"))
|
minimum = maximum = utf8_width (context.config.get ("tag.indicator"));
|
||||||
minimum = maximum = utf8_width (context.config.get ("tag.indicator"));
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
}
|
||||||
else if (_style == "count")
|
else if (_style == "count")
|
||||||
{
|
{
|
||||||
|
@ -112,8 +108,6 @@ void ColumnTags::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
||||||
else
|
else
|
||||||
minimum = maximum = utf8_width (tags);
|
minimum = maximum = utf8_width (tags);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +157,7 @@ void ColumnTags::modify (Task& task, const std::string& value)
|
||||||
std::string label = " [1;37;43mMODIFICATION[0m ";
|
std::string label = " [1;37;43mMODIFICATION[0m ";
|
||||||
|
|
||||||
// TW-1701
|
// TW-1701
|
||||||
task.set ("tags", "");
|
task.set (_name, "");
|
||||||
|
|
||||||
for (auto& tag : split (value, ','))
|
for (auto& tag : split (value, ','))
|
||||||
{
|
{
|
||||||
|
|
75
src/columns/ColTemplate.cpp
Normal file
75
src/columns/ColTemplate.cpp
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
// http://www.opensource.org/licenses/mit-license.php
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
|
#include <ColTemplate.h>
|
||||||
|
#include <format.h>
|
||||||
|
#include <i18n.h>
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
ColumnTemplate::ColumnTemplate ()
|
||||||
|
{
|
||||||
|
_name = "template";
|
||||||
|
_style = "long";
|
||||||
|
_label = STRING_COLUMN_LABEL_TEMPLATE;
|
||||||
|
_modifiable = false;
|
||||||
|
_styles = {"long", "short"};
|
||||||
|
_examples = {"f30cb9c3-3fc0-483f-bfb2-3bf134f00694", "f30cb9c3"};
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Set the minimum and maximum widths for the value.
|
||||||
|
void ColumnTemplate::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
|
{
|
||||||
|
minimum = maximum = 0;
|
||||||
|
if (task.has (_name))
|
||||||
|
{
|
||||||
|
if (_style == "default" || _style == "long") minimum = maximum = 36;
|
||||||
|
else if (_style == "short") minimum = maximum = 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void ColumnTemplate::render (
|
||||||
|
std::vector <std::string>& lines,
|
||||||
|
Task& task,
|
||||||
|
int width,
|
||||||
|
Color& color)
|
||||||
|
{
|
||||||
|
if (task.has (_name))
|
||||||
|
{
|
||||||
|
// f30cb9c3-3fc0-483f-bfb2-3bf134f00694 default
|
||||||
|
// f30cb9c3 short
|
||||||
|
if (_style == "default" ||
|
||||||
|
_style == "long")
|
||||||
|
renderStringLeft (lines, width, color, task.get(_name));
|
||||||
|
|
||||||
|
else if (_style == "short")
|
||||||
|
renderStringLeft (lines, width, color, task.get (_name).substr (0, 8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
43
src/columns/ColTemplate.h
Normal file
43
src/columns/ColTemplate.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
// http://www.opensource.org/licenses/mit-license.php
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef INCLUDED_COLTEMPLATE
|
||||||
|
#define INCLUDED_COLTEMPLATE
|
||||||
|
|
||||||
|
#include <ColTypeString.h>
|
||||||
|
|
||||||
|
class ColumnTemplate : public ColumnTypeString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ColumnTemplate ();
|
||||||
|
void measure (Task&, unsigned int&, unsigned int&);
|
||||||
|
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
|
@ -72,7 +72,6 @@ ColumnTypeDate::ColumnTypeDate ()
|
||||||
void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
Datetime date (task.get_date (_name));
|
Datetime date (task.get_date (_name));
|
||||||
|
@ -131,8 +130,6 @@ void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& m
|
||||||
if (date > now)
|
if (date > now)
|
||||||
minimum = maximum = Duration (date - now).formatVague ().length ();
|
minimum = maximum = Duration (date - now).formatVague ().length ();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,6 +201,12 @@ void ColumnTypeDate::render (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool ColumnTypeDate::validate (const std::string& input) const
|
||||||
|
{
|
||||||
|
return input.length () ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void ColumnTypeDate::modify (Task& task, const std::string& value)
|
void ColumnTypeDate::modify (Task& task, const std::string& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
ColumnTypeDate ();
|
ColumnTypeDate ();
|
||||||
virtual void measure (Task&, unsigned int&, unsigned int&);
|
virtual void measure (Task&, unsigned int&, unsigned int&);
|
||||||
virtual void render (std::vector <std::string>&, Task&, int, Color&);
|
virtual void render (std::vector <std::string>&, Task&, int, Color&);
|
||||||
|
virtual bool validate (const std::string&) const;
|
||||||
virtual void modify (Task&, const std::string&);
|
virtual void modify (Task&, const std::string&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,12 @@ ColumnTypeDuration::ColumnTypeDuration ()
|
||||||
_type = "duration";
|
_type = "duration";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool ColumnTypeDuration::validate (const std::string& input) const
|
||||||
|
{
|
||||||
|
return input.length () ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void ColumnTypeDuration::modify (Task& task, const std::string& value)
|
void ColumnTypeDuration::modify (Task& task, const std::string& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@ class ColumnTypeDuration : public Column
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColumnTypeDuration ();
|
ColumnTypeDuration ();
|
||||||
|
virtual bool validate (const std::string&) const;
|
||||||
virtual void modify (Task&, const std::string&);
|
virtual void modify (Task&, const std::string&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,12 @@ ColumnTypeNumeric::ColumnTypeNumeric ()
|
||||||
_type = "numeric";
|
_type = "numeric";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool ColumnTypeNumeric::validate (const std::string& input) const
|
||||||
|
{
|
||||||
|
return input.length () ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void ColumnTypeNumeric::modify (Task& task, const std::string& value)
|
void ColumnTypeNumeric::modify (Task& task, const std::string& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@ class ColumnTypeNumeric : public Column
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColumnTypeNumeric ();
|
ColumnTypeNumeric ();
|
||||||
|
virtual bool validate (const std::string&) const;
|
||||||
virtual void modify (Task&, const std::string&);
|
virtual void modify (Task&, const std::string&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,12 @@ ColumnTypeString::ColumnTypeString ()
|
||||||
_type = "string";
|
_type = "string";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool ColumnTypeString::validate (const std::string& input) const
|
||||||
|
{
|
||||||
|
return input.length () ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void ColumnTypeString::modify (Task& task, const std::string& value)
|
void ColumnTypeString::modify (Task& task, const std::string& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,7 @@ class ColumnTypeString : public Column
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColumnTypeString ();
|
ColumnTypeString ();
|
||||||
|
virtual bool validate (const std::string&) const;
|
||||||
virtual void modify (Task&, const std::string&);
|
virtual void modify (Task&, const std::string&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,13 @@ extern Context context;
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnUDAString::ColumnUDAString ()
|
ColumnUDAString::ColumnUDAString ()
|
||||||
{
|
{
|
||||||
_name = "<uda>";
|
_name = "<uda>"; // Gets overwritten at runtime.
|
||||||
_style = "default";
|
_style = "default";
|
||||||
_label = "";
|
_label = "";
|
||||||
_uda = true;
|
_modifiable = true;
|
||||||
_hyphenate = true;
|
_uda = true;
|
||||||
_styles = {_style, "indicator"};
|
_hyphenate = true;
|
||||||
|
_styles = {_style, "indicator"};
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -70,7 +71,6 @@ bool ColumnUDAString::validate (const std::string& value) const
|
||||||
void ColumnUDAString::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUDAString::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
|
@ -78,26 +78,19 @@ void ColumnUDAString::measure (Task& task, unsigned int& minimum, unsigned int&
|
||||||
std::string value = task.get (_name);
|
std::string value = task.get (_name);
|
||||||
if (value != "")
|
if (value != "")
|
||||||
{
|
{
|
||||||
std::string stripped = Color::strip (value);
|
auto stripped = Color::strip (value);
|
||||||
maximum = longestLine (stripped);
|
maximum = longestLine (stripped);
|
||||||
minimum = longestWord (stripped);
|
minimum = longestWord (stripped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
minimum = maximum = utf8_width (indicator);
|
minimum = maximum = utf8_width (indicator);
|
||||||
}
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,14 +114,11 @@ void ColumnUDAString::render (
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
renderStringRight (lines, width, color, indicator);
|
renderStringRight (lines, width, color, indicator);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,30 +156,22 @@ bool ColumnUDANumeric::validate (const std::string& value) const
|
||||||
void ColumnUDANumeric::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUDANumeric::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
if (value != "")
|
if (value != "")
|
||||||
minimum = maximum = value.length ();
|
minimum = maximum = value.length ();
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
minimum = maximum = utf8_width (indicator);
|
minimum = maximum = utf8_width (indicator);
|
||||||
}
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,19 +186,16 @@ void ColumnUDANumeric::render (
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
renderStringRight (lines, width, color, value);
|
renderStringRight (lines, width, color, value);
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
renderStringRight (lines, width, color, indicator);
|
renderStringRight (lines, width, color, indicator);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,12 +233,11 @@ bool ColumnUDADate::validate (const std::string& value) const
|
||||||
void ColumnUDADate::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUDADate::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
if (value != "")
|
if (value != "")
|
||||||
{
|
{
|
||||||
// Determine the output date format, which uses a hierarchy of definitions.
|
// Determine the output date format, which uses a hierarchy of definitions.
|
||||||
|
@ -267,7 +245,7 @@ void ColumnUDADate::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||||
// rc.dateformat.report
|
// rc.dateformat.report
|
||||||
// rc.dateformat
|
// rc.dateformat
|
||||||
Datetime date ((time_t) strtol (value.c_str (), NULL, 10));
|
Datetime date ((time_t) strtol (value.c_str (), NULL, 10));
|
||||||
std::string format = context.config.get ("report." + _report + ".dateformat");
|
auto format = context.config.get ("report." + _report + ".dateformat");
|
||||||
if (format == "")
|
if (format == "")
|
||||||
format = context.config.get ("dateformat.report");
|
format = context.config.get ("dateformat.report");
|
||||||
if (format == "")
|
if (format == "")
|
||||||
|
@ -278,19 +256,12 @@ void ColumnUDADate::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
minimum = maximum = utf8_width (indicator);
|
minimum = maximum = utf8_width (indicator);
|
||||||
}
|
|
||||||
else
|
|
||||||
minimum = maximum = 0;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,13 +276,13 @@ void ColumnUDADate::render (
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
|
|
||||||
// Determine the output date format, which uses a hierarchy of definitions.
|
// Determine the output date format, which uses a hierarchy of definitions.
|
||||||
// rc.report.<report>.dateformat
|
// rc.report.<report>.dateformat
|
||||||
// rc.dateformat.report
|
// rc.dateformat.report
|
||||||
// rc.dateformat.
|
// rc.dateformat.
|
||||||
std::string format = context.config.get ("report." + _report + ".dateformat");
|
auto format = context.config.get ("report." + _report + ".dateformat");
|
||||||
if (format == "")
|
if (format == "")
|
||||||
{
|
{
|
||||||
format = context.config.get ("dateformat.report");
|
format = context.config.get ("dateformat.report");
|
||||||
|
@ -323,14 +294,11 @@ void ColumnUDADate::render (
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
renderStringRight (lines, width, color, indicator);
|
renderStringRight (lines, width, color, indicator);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -368,12 +336,11 @@ bool ColumnUDADuration::validate (const std::string& value) const
|
||||||
void ColumnUDADuration::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUDADuration::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
|
|
||||||
if (task.has (_name))
|
if (task.has (_name))
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
if (value != "")
|
if (value != "")
|
||||||
minimum = maximum = Duration (value).formatISO ().length ();
|
minimum = maximum = Duration (value).formatISO ().length ();
|
||||||
}
|
}
|
||||||
|
@ -390,8 +357,6 @@ void ColumnUDADuration::measure (Task& task, unsigned int& minimum, unsigned int
|
||||||
else
|
else
|
||||||
minimum = maximum = 0;
|
minimum = maximum = 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,19 +371,16 @@ void ColumnUDADuration::render (
|
||||||
{
|
{
|
||||||
if (_style == "default")
|
if (_style == "default")
|
||||||
{
|
{
|
||||||
std::string value = task.get (_name);
|
auto value = task.get (_name);
|
||||||
renderStringRight (lines, width, color, Duration (value).formatISO ());
|
renderStringRight (lines, width, color, Duration (value).formatISO ());
|
||||||
}
|
}
|
||||||
else if (_style == "indicator")
|
else if (_style == "indicator")
|
||||||
{
|
{
|
||||||
if (task.has (_name))
|
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
||||||
{
|
if (indicator == "")
|
||||||
auto indicator = context.config.get ("uda." + _name + ".indicator");
|
indicator = "U";
|
||||||
if (indicator == "")
|
|
||||||
indicator = "U";
|
|
||||||
|
|
||||||
renderStringRight (lines, width, color, indicator);
|
renderStringRight (lines, width, color, indicator);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include <cmake.h>
|
#include <cmake.h>
|
||||||
#include <ColUUID.h>
|
#include <ColUUID.h>
|
||||||
#include <math.h>
|
|
||||||
#include <format.h>
|
#include <format.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
|
|
||||||
|
@ -45,10 +44,10 @@ ColumnUUID::ColumnUUID ()
|
||||||
// Set the minimum and maximum widths for the value.
|
// Set the minimum and maximum widths for the value.
|
||||||
void ColumnUUID::measure (Task&, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUUID::measure (Task&, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
|
// Mandatory attribute, no need to check the value.
|
||||||
|
|
||||||
if (_style == "default" || _style == "long") minimum = maximum = 36;
|
if (_style == "default" || _style == "long") minimum = maximum = 36;
|
||||||
else if (_style == "short") minimum = maximum = 8;
|
else if (_style == "short") minimum = maximum = 8;
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnUntil::ColumnUntil ()
|
ColumnUntil::ColumnUntil ()
|
||||||
{
|
{
|
||||||
_name = "until";
|
_name = "until";
|
||||||
_label = STRING_COLUMN_LABEL_UNTIL;
|
_label = STRING_COLUMN_LABEL_UNTIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -32,11 +32,12 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnUrgency::ColumnUrgency ()
|
ColumnUrgency::ColumnUrgency ()
|
||||||
{
|
{
|
||||||
_name = "urgency";
|
_name = "urgency";
|
||||||
_style = "real";
|
_style = "real";
|
||||||
_label = STRING_COLUMN_LABEL_URGENCY;
|
_label = STRING_COLUMN_LABEL_URGENCY;
|
||||||
_styles = {"real", "integer"};
|
_modifiable = false;
|
||||||
_examples = {"4.6", "4"};
|
_styles = {"real", "integer"};
|
||||||
|
_examples = {"4.6", "4"};
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -48,9 +49,6 @@ void ColumnUrgency::measure (Task& task, unsigned int& minimum, unsigned int& ma
|
||||||
|
|
||||||
else if (_style == "integer")
|
else if (_style == "integer")
|
||||||
minimum = maximum = format ((int)task.urgency ()).length ();
|
minimum = maximum = format ((int)task.urgency ()).length ();
|
||||||
|
|
||||||
else
|
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
ColumnWait::ColumnWait ()
|
ColumnWait::ColumnWait ()
|
||||||
{
|
{
|
||||||
_name = "wait";
|
_name = "wait";
|
||||||
_label = STRING_COLUMN_LABEL_WAIT;
|
_label = STRING_COLUMN_LABEL_WAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -36,16 +36,18 @@
|
||||||
#include <ColEntry.h>
|
#include <ColEntry.h>
|
||||||
#include <ColID.h>
|
#include <ColID.h>
|
||||||
#include <ColIMask.h>
|
#include <ColIMask.h>
|
||||||
|
#include <ColLast.h>
|
||||||
#include <ColMask.h>
|
#include <ColMask.h>
|
||||||
#include <ColModified.h>
|
#include <ColModified.h>
|
||||||
#include <ColParent.h>
|
#include <ColParent.h>
|
||||||
#include <ColProject.h>
|
#include <ColProject.h>
|
||||||
#include <ColRecur.h>
|
#include <ColRecur.h>
|
||||||
|
#include <ColRType.h>
|
||||||
#include <ColScheduled.h>
|
#include <ColScheduled.h>
|
||||||
#include <ColStart.h>
|
#include <ColStart.h>
|
||||||
#include <ColStatus.h>
|
#include <ColStatus.h>
|
||||||
#include <ColString.h>
|
|
||||||
#include <ColTags.h>
|
#include <ColTags.h>
|
||||||
|
#include <ColTemplate.h>
|
||||||
#include <ColUntil.h>
|
#include <ColUntil.h>
|
||||||
#include <ColUrgency.h>
|
#include <ColUrgency.h>
|
||||||
#include <ColUUID.h>
|
#include <ColUUID.h>
|
||||||
|
@ -87,23 +89,23 @@ Column* Column::factory (const std::string& name, const std::string& report)
|
||||||
else if (column_name == "entry") c = new ColumnEntry ();
|
else if (column_name == "entry") c = new ColumnEntry ();
|
||||||
else if (column_name == "id") c = new ColumnID ();
|
else if (column_name == "id") c = new ColumnID ();
|
||||||
else if (column_name == "imask") c = new ColumnIMask ();
|
else if (column_name == "imask") c = new ColumnIMask ();
|
||||||
|
else if (column_name == "last") c = new ColumnLast ();
|
||||||
else if (column_name == "mask") c = new ColumnMask ();
|
else if (column_name == "mask") c = new ColumnMask ();
|
||||||
else if (column_name == "modified") c = new ColumnModified ();
|
else if (column_name == "modified") c = new ColumnModified ();
|
||||||
else if (column_name == "parent") c = new ColumnParent ();
|
else if (column_name == "parent") c = new ColumnParent ();
|
||||||
else if (column_name == "project") c = new ColumnProject ();
|
else if (column_name == "project") c = new ColumnProject ();
|
||||||
else if (column_name == "recur") c = new ColumnRecur ();
|
else if (column_name == "recur") c = new ColumnRecur ();
|
||||||
|
else if (column_name == "rtype") c = new ColumnRType ();
|
||||||
else if (column_name == "scheduled") c = new ColumnScheduled ();
|
else if (column_name == "scheduled") c = new ColumnScheduled ();
|
||||||
else if (column_name == "start") c = new ColumnStart ();
|
else if (column_name == "start") c = new ColumnStart ();
|
||||||
else if (column_name == "status") c = new ColumnStatus ();
|
else if (column_name == "status") c = new ColumnStatus ();
|
||||||
else if (column_name == "tags") c = new ColumnTags ();
|
else if (column_name == "tags") c = new ColumnTags ();
|
||||||
|
else if (column_name == "template") c = new ColumnTemplate ();
|
||||||
else if (column_name == "until") c = new ColumnUntil ();
|
else if (column_name == "until") c = new ColumnUntil ();
|
||||||
else if (column_name == "urgency") c = new ColumnUrgency ();
|
else if (column_name == "urgency") c = new ColumnUrgency ();
|
||||||
else if (column_name == "uuid") c = new ColumnUUID ();
|
else if (column_name == "uuid") c = new ColumnUUID ();
|
||||||
else if (column_name == "wait") c = new ColumnWait ();
|
else if (column_name == "wait") c = new ColumnWait ();
|
||||||
|
|
||||||
// Special non-task column.
|
|
||||||
else if (column_name == "string") c = new ColumnString ();
|
|
||||||
|
|
||||||
// UDA.
|
// UDA.
|
||||||
else if (context.config.has ("uda." + column_name + ".type"))
|
else if (context.config.has ("uda." + column_name + ".type"))
|
||||||
c = Column::uda (column_name);
|
c = Column::uda (column_name);
|
||||||
|
@ -129,15 +131,18 @@ void Column::factory (std::map <std::string, Column*>& all)
|
||||||
c = new ColumnEntry (); all[c->_name] = c;
|
c = new ColumnEntry (); all[c->_name] = c;
|
||||||
c = new ColumnID (); all[c->_name] = c;
|
c = new ColumnID (); all[c->_name] = c;
|
||||||
c = new ColumnIMask (); all[c->_name] = c;
|
c = new ColumnIMask (); all[c->_name] = c;
|
||||||
|
c = new ColumnLast (); all[c->_name] = c;
|
||||||
c = new ColumnMask (); all[c->_name] = c;
|
c = new ColumnMask (); all[c->_name] = c;
|
||||||
c = new ColumnModified (); all[c->_name] = c;
|
c = new ColumnModified (); all[c->_name] = c;
|
||||||
c = new ColumnParent (); all[c->_name] = c;
|
c = new ColumnParent (); all[c->_name] = c;
|
||||||
c = new ColumnProject (); all[c->_name] = c;
|
c = new ColumnProject (); all[c->_name] = c;
|
||||||
c = new ColumnRecur (); all[c->_name] = c;
|
c = new ColumnRecur (); all[c->_name] = c;
|
||||||
|
c = new ColumnRType (); all[c->_name] = c;
|
||||||
c = new ColumnScheduled (); all[c->_name] = c;
|
c = new ColumnScheduled (); all[c->_name] = c;
|
||||||
c = new ColumnStart (); all[c->_name] = c;
|
c = new ColumnStart (); all[c->_name] = c;
|
||||||
c = new ColumnStatus (); all[c->_name] = c;
|
c = new ColumnStatus (); all[c->_name] = c;
|
||||||
c = new ColumnTags (); all[c->_name] = c;
|
c = new ColumnTags (); all[c->_name] = c;
|
||||||
|
c = new ColumnTemplate (); all[c->_name] = c;
|
||||||
c = new ColumnUntil (); all[c->_name] = c;
|
c = new ColumnUntil (); all[c->_name] = c;
|
||||||
c = new ColumnUrgency (); all[c->_name] = c;
|
c = new ColumnUrgency (); all[c->_name] = c;
|
||||||
c = new ColumnUUID (); all[c->_name] = c;
|
c = new ColumnUUID (); all[c->_name] = c;
|
||||||
|
@ -149,7 +154,7 @@ void Column::factory (std::map <std::string, Column*>& all)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Column::uda (std::map <std::string, Column*>& all)
|
void Column::uda (std::map <std::string, Column*>& all)
|
||||||
{
|
{
|
||||||
// For each UDA, instantiate and initialize ColumnUDA().
|
// For each UDA, instantiate and initialize ColumnUDA.
|
||||||
std::set <std::string> udas;
|
std::set <std::string> udas;
|
||||||
|
|
||||||
for (const auto& i : context.config)
|
for (const auto& i : context.config)
|
||||||
|
@ -283,12 +288,6 @@ void Column::setStyle (const std::string& style)
|
||||||
_style = style;
|
_style = style;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
bool Column::validate (const std::string& input) const
|
|
||||||
{
|
|
||||||
return input.length () ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// All integer values are right-justified.
|
// All integer values are right-justified.
|
||||||
void Column::renderInteger (
|
void Column::renderInteger (
|
||||||
|
|
|
@ -57,12 +57,12 @@ public:
|
||||||
virtual void setLabel (const std::string& value) { _label = value; }
|
virtual void setLabel (const std::string& value) { _label = value; }
|
||||||
virtual void setReport (const std::string& value) { _report = value; }
|
virtual void setReport (const std::string& value) { _report = value; }
|
||||||
|
|
||||||
virtual bool validate (const std::string&) const;
|
|
||||||
virtual void measure (const std::string&, unsigned int&, unsigned int&) {};
|
virtual void measure (const std::string&, unsigned int&, unsigned int&) {};
|
||||||
virtual void measure (Task&, unsigned int&, unsigned int&) {};
|
virtual void measure (Task&, unsigned int&, unsigned int&) {};
|
||||||
virtual void renderHeader (std::vector <std::string>&, int, Color&);
|
virtual void renderHeader (std::vector <std::string>&, int, Color&);
|
||||||
virtual void render (std::vector <std::string>&, const std::string&, int, Color&) {};
|
virtual void render (std::vector <std::string>&, const std::string&, int, Color&) {};
|
||||||
virtual void render (std::vector <std::string>&, Task&, int, Color&) {};
|
virtual void render (std::vector <std::string>&, Task&, int, Color&) {};
|
||||||
|
virtual bool validate (const std::string&) const {return false;};
|
||||||
virtual void modify (Task&, const std::string&) {};
|
virtual void modify (Task&, const std::string&) {};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <Table.h>
|
#include <Table.h>
|
||||||
#include <Command.h>
|
#include <Command.h>
|
||||||
#include <ColString.h>
|
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,7 @@ int CmdDenotate::execute (std::string&)
|
||||||
{
|
{
|
||||||
Task before (task);
|
Task before (task);
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
auto annotations = task.getAnnotations ();
|
||||||
task.getAnnotations (annotations);
|
|
||||||
|
|
||||||
if (annotations.size () == 0)
|
if (annotations.size () == 0)
|
||||||
throw std::string (STRING_CMD_DENO_NONE);
|
throw std::string (STRING_CMD_DENO_NONE);
|
||||||
|
|
|
@ -456,10 +456,7 @@ int CmdDiagnostics::execute (std::string& output)
|
||||||
for (auto& task : all)
|
for (auto& task : all)
|
||||||
{
|
{
|
||||||
// Check dependencies
|
// Check dependencies
|
||||||
std::vector <std::string> dependencies;
|
for (auto& uuid : task.getDependencyUUIDs ())
|
||||||
task.getDependencies(dependencies);
|
|
||||||
|
|
||||||
for (auto& uuid : dependencies)
|
|
||||||
{
|
{
|
||||||
if (! context.tdb2.has (uuid))
|
if (! context.tdb2.has (uuid))
|
||||||
{
|
{
|
||||||
|
|
|
@ -224,14 +224,10 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||||
<< "# iMask: " << task.get ("imask") << '\n'
|
<< "# iMask: " << task.get ("imask") << '\n'
|
||||||
<< " Project: " << task.get ("project") << '\n';
|
<< " Project: " << task.get ("project") << '\n';
|
||||||
|
|
||||||
std::vector <std::string> tags;
|
|
||||||
task.getTags (tags);
|
|
||||||
auto allTags = join (" ", tags);
|
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
before << "# " << STRING_EDIT_TAG_SEP << '\n';
|
before << "# " << STRING_EDIT_TAG_SEP << '\n';
|
||||||
|
|
||||||
before << " Tags: " << allTags << '\n'
|
before << " Tags: " << join (" ", task.getTags ()) << '\n'
|
||||||
<< " Description: " << task.get ("description") << '\n'
|
<< " Description: " << task.get ("description") << '\n'
|
||||||
<< " Created: " << formatDate (task, "entry", dateformat) << '\n'
|
<< " Created: " << formatDate (task, "entry", dateformat) << '\n'
|
||||||
<< " Started: " << formatDate (task, "start", dateformat) << '\n'
|
<< " Started: " << formatDate (task, "start", dateformat) << '\n'
|
||||||
|
@ -249,9 +245,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||||
<< "# " << STRING_EDIT_HEADER_14 << '\n'
|
<< "# " << STRING_EDIT_HEADER_14 << '\n'
|
||||||
<< "# " << STRING_EDIT_HEADER_15 << '\n';
|
<< "# " << STRING_EDIT_HEADER_15 << '\n';
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& anno : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
for (auto& anno : annotations)
|
|
||||||
{
|
{
|
||||||
Datetime dt (strtol (anno.first.substr (11).c_str (), NULL, 10));
|
Datetime dt (strtol (anno.first.substr (11).c_str (), NULL, 10));
|
||||||
before << " Annotation: " << dt.toString (dateformat)
|
before << " Annotation: " << dt.toString (dateformat)
|
||||||
|
@ -262,8 +256,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||||
before << " Annotation: " << now.toString (dateformat) << " -- \n";
|
before << " Annotation: " << now.toString (dateformat) << " -- \n";
|
||||||
|
|
||||||
// Add dependencies here.
|
// Add dependencies here.
|
||||||
std::vector <std::string> dependencies;
|
auto dependencies = task.getDependencyUUIDs ();
|
||||||
task.getDependencies (dependencies);
|
|
||||||
std::stringstream allDeps;
|
std::stringstream allDeps;
|
||||||
for (unsigned int i = 0; i < dependencies.size (); ++i)
|
for (unsigned int i = 0; i < dependencies.size (); ++i)
|
||||||
{
|
{
|
||||||
|
@ -312,9 +305,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UDA orphans
|
// UDA orphans
|
||||||
std::vector <std::string> orphans;
|
auto orphans = task.getUDAOrphanUUIDs ();
|
||||||
task.getUDAOrphans (orphans);
|
|
||||||
|
|
||||||
if (orphans.size ())
|
if (orphans.size ())
|
||||||
{
|
{
|
||||||
before << "# " << STRING_EDIT_UDA_ORPHAN_SEP << '\n';
|
before << "# " << STRING_EDIT_UDA_ORPHAN_SEP << '\n';
|
||||||
|
@ -355,9 +346,8 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
||||||
|
|
||||||
// tags
|
// tags
|
||||||
value = findValue (after, "\n Tags:");
|
value = findValue (after, "\n Tags:");
|
||||||
auto tags = split (value, ' ');
|
|
||||||
task.remove ("tags");
|
task.remove ("tags");
|
||||||
task.addTags (tags);
|
task.addTags (split (value, ' '));
|
||||||
|
|
||||||
// description.
|
// description.
|
||||||
value = findMultilineValue (after, "\n Description:", "\n Created:");
|
value = findMultilineValue (after, "\n Description:", "\n Created:");
|
||||||
|
|
|
@ -134,9 +134,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
std::string description = task.get ("description");
|
std::string description = task.get ("description");
|
||||||
int indent = context.config.getInteger ("indent.annotation");
|
int indent = context.config.getInteger ("indent.annotation");
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& anno : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
for (auto& anno : annotations)
|
|
||||||
description += '\n'
|
description += '\n'
|
||||||
+ std::string (indent, ' ')
|
+ std::string (indent, ' ')
|
||||||
+ Datetime (anno.first.substr (11)).toString (dateformatanno)
|
+ Datetime (anno.first.substr (11)).toString (dateformatanno)
|
||||||
|
@ -162,8 +160,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
|
|
||||||
// dependencies: blocked
|
// dependencies: blocked
|
||||||
{
|
{
|
||||||
std::vector <Task> blocked;
|
auto blocked = dependencyGetBlocking (task);
|
||||||
dependencyGetBlocking (task, blocked);
|
|
||||||
if (blocked.size ())
|
if (blocked.size ())
|
||||||
{
|
{
|
||||||
std::stringstream message;
|
std::stringstream message;
|
||||||
|
@ -178,8 +175,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
|
|
||||||
// dependencies: blocking
|
// dependencies: blocking
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
auto blocking = dependencyGetBlocked (task);
|
||||||
dependencyGetBlocked (task, blocking);
|
|
||||||
if (blocking.size ())
|
if (blocking.size ())
|
||||||
{
|
{
|
||||||
std::stringstream message;
|
std::stringstream message;
|
||||||
|
@ -201,6 +197,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// parent
|
// parent
|
||||||
|
// 2017-01-07: Deprecated in 2.6.0
|
||||||
if (task.has ("parent"))
|
if (task.has ("parent"))
|
||||||
{
|
{
|
||||||
row = view.addRow ();
|
row = view.addRow ();
|
||||||
|
@ -209,6 +206,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// mask
|
// mask
|
||||||
|
// 2017-01-07: Deprecated in 2.6.0
|
||||||
if (task.has ("mask"))
|
if (task.has ("mask"))
|
||||||
{
|
{
|
||||||
row = view.addRow ();
|
row = view.addRow ();
|
||||||
|
@ -217,6 +215,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// imask
|
// imask
|
||||||
|
// 2017-01-07: Deprecated in 2.6.0
|
||||||
if (task.has ("imask"))
|
if (task.has ("imask"))
|
||||||
{
|
{
|
||||||
row = view.addRow ();
|
row = view.addRow ();
|
||||||
|
@ -224,6 +223,30 @@ int CmdInfo::execute (std::string& output)
|
||||||
view.set (row, 1, task.get ("imask"));
|
view.set (row, 1, task.get ("imask"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template
|
||||||
|
if (task.has ("template"))
|
||||||
|
{
|
||||||
|
row = view.addRow ();
|
||||||
|
view.set (row, 0, STRING_COLUMN_LABEL_TEMPLATE);
|
||||||
|
view.set (row, 1, task.get ("template"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// last
|
||||||
|
if (task.has ("last"))
|
||||||
|
{
|
||||||
|
row = view.addRow ();
|
||||||
|
view.set (row, 0, STRING_COLUMN_LABEL_LAST);
|
||||||
|
view.set (row, 1, task.get ("last"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// rtype
|
||||||
|
if (task.has ("rtype"))
|
||||||
|
{
|
||||||
|
row = view.addRow ();
|
||||||
|
view.set (row, 0, STRING_COLUMN_LABEL_RTYPE);
|
||||||
|
view.set (row, 1, task.get ("rtype"));
|
||||||
|
}
|
||||||
|
|
||||||
// entry
|
// entry
|
||||||
row = view.addRow ();
|
row = view.addRow ();
|
||||||
view.set (row, 0, STRING_COLUMN_LABEL_ENTERED);
|
view.set (row, 0, STRING_COLUMN_LABEL_ENTERED);
|
||||||
|
@ -300,8 +323,7 @@ int CmdInfo::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// tags ...
|
// tags ...
|
||||||
std::vector <std::string> tags;
|
auto tags = task.getTags ();
|
||||||
task.getTags (tags);
|
|
||||||
if (tags.size ())
|
if (tags.size ())
|
||||||
{
|
{
|
||||||
auto allTags = join (" ", tags);
|
auto allTags = join (" ", tags);
|
||||||
|
@ -320,19 +342,21 @@ int CmdInfo::execute (std::string& output)
|
||||||
if (task.hasTag ("ANNOTATED")) virtualTags += "ANNOTATED ";
|
if (task.hasTag ("ANNOTATED")) virtualTags += "ANNOTATED ";
|
||||||
if (task.hasTag ("BLOCKED")) virtualTags += "BLOCKED ";
|
if (task.hasTag ("BLOCKED")) virtualTags += "BLOCKED ";
|
||||||
if (task.hasTag ("BLOCKING")) virtualTags += "BLOCKING ";
|
if (task.hasTag ("BLOCKING")) virtualTags += "BLOCKING ";
|
||||||
if (task.hasTag ("CHILD")) virtualTags += "CHILD ";
|
if (task.hasTag ("CHILD")) virtualTags += "CHILD "; // 2017-01-07: Deprecated in 2.6.0
|
||||||
if (task.hasTag ("COMPLETED")) virtualTags += "COMPLETED ";
|
if (task.hasTag ("COMPLETED")) virtualTags += "COMPLETED ";
|
||||||
if (task.hasTag ("DELETED")) virtualTags += "DELETED ";
|
if (task.hasTag ("DELETED")) virtualTags += "DELETED ";
|
||||||
if (task.hasTag ("DUE")) virtualTags += "DUE ";
|
if (task.hasTag ("DUE")) virtualTags += "DUE ";
|
||||||
if (task.hasTag ("DUETODAY")) virtualTags += "DUETODAY ";
|
if (task.hasTag ("DUETODAY")) virtualTags += "DUETODAY ";
|
||||||
|
if (task.hasTag ("INSTANCE")) virtualTags += "INSTANCE ";
|
||||||
if (task.hasTag ("MONTH")) virtualTags += "MONTH ";
|
if (task.hasTag ("MONTH")) virtualTags += "MONTH ";
|
||||||
if (task.hasTag ("ORPHAN")) virtualTags += "ORPHAN ";
|
if (task.hasTag ("ORPHAN")) virtualTags += "ORPHAN ";
|
||||||
if (task.hasTag ("OVERDUE")) virtualTags += "OVERDUE ";
|
if (task.hasTag ("OVERDUE")) virtualTags += "OVERDUE ";
|
||||||
if (task.hasTag ("PARENT")) virtualTags += "PARENT ";
|
if (task.hasTag ("PARENT")) virtualTags += "PARENT "; // 2017-01-07: Deprecated in 2.6.0
|
||||||
if (task.hasTag ("PENDING")) virtualTags += "PENDING ";
|
if (task.hasTag ("PENDING")) virtualTags += "PENDING ";
|
||||||
if (task.hasTag ("READY")) virtualTags += "READY ";
|
if (task.hasTag ("READY")) virtualTags += "READY ";
|
||||||
if (task.hasTag ("SCHEDULED")) virtualTags += "SCHEDULED ";
|
if (task.hasTag ("SCHEDULED")) virtualTags += "SCHEDULED ";
|
||||||
if (task.hasTag ("TAGGED")) virtualTags += "TAGGED ";
|
if (task.hasTag ("TAGGED")) virtualTags += "TAGGED ";
|
||||||
|
if (task.hasTag ("TEMPLATE")) virtualTags += "TEMPLATE ";
|
||||||
if (task.hasTag ("TODAY")) virtualTags += "TODAY ";
|
if (task.hasTag ("TODAY")) virtualTags += "TODAY ";
|
||||||
if (task.hasTag ("TOMORROW")) virtualTags += "TOMORROW ";
|
if (task.hasTag ("TOMORROW")) virtualTags += "TOMORROW ";
|
||||||
if (task.hasTag ("UDA")) virtualTags += "UDA ";
|
if (task.hasTag ("UDA")) virtualTags += "UDA ";
|
||||||
|
|
|
@ -140,13 +140,9 @@ int CmdStats::execute (std::string& output)
|
||||||
daysPending += (now.toEpoch () - entry) / 86400.0;
|
daysPending += (now.toEpoch () - entry) / 86400.0;
|
||||||
|
|
||||||
descLength += task.get ("description").length ();
|
descLength += task.get ("description").length ();
|
||||||
|
annotationsT += task.getAnnotations ().size ();
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
auto tags = task.getTags ();
|
||||||
task.getAnnotations (annotations);
|
|
||||||
annotationsT += annotations.size ();
|
|
||||||
|
|
||||||
std::vector <std::string> tags;
|
|
||||||
task.getTags (tags);
|
|
||||||
if (tags.size ())
|
if (tags.size ())
|
||||||
++taggedT;
|
++taggedT;
|
||||||
|
|
||||||
|
|
|
@ -79,10 +79,7 @@ int CmdTags::execute (std::string& output)
|
||||||
std::map <std::string, int> unique;
|
std::map <std::string, int> unique;
|
||||||
for (auto& task : filtered)
|
for (auto& task : filtered)
|
||||||
{
|
{
|
||||||
std::vector <std::string> tags;
|
for (auto& tag : task.getTags ())
|
||||||
task.getTags (tags);
|
|
||||||
|
|
||||||
for (auto& tag : tags)
|
|
||||||
if (unique.find (tag) != unique.end ())
|
if (unique.find (tag) != unique.end ())
|
||||||
unique[tag]++;
|
unique[tag]++;
|
||||||
else
|
else
|
||||||
|
@ -182,13 +179,8 @@ int CmdCompletionTags::execute (std::string& output)
|
||||||
// names as keys.
|
// names as keys.
|
||||||
std::map <std::string, int> unique;
|
std::map <std::string, int> unique;
|
||||||
for (auto& task : filtered)
|
for (auto& task : filtered)
|
||||||
{
|
for (auto& tag : task.getTags ())
|
||||||
std::vector <std::string> tags;
|
|
||||||
task.getTags (tags);
|
|
||||||
|
|
||||||
for (auto& tag : tags)
|
|
||||||
unique[tag] = 0;
|
unique[tag] = 0;
|
||||||
}
|
|
||||||
|
|
||||||
// Add built-in tags to map.
|
// Add built-in tags to map.
|
||||||
unique["nocolor"] = 0;
|
unique["nocolor"] = 0;
|
||||||
|
@ -199,19 +191,21 @@ int CmdCompletionTags::execute (std::string& output)
|
||||||
unique["ANNOTATED"] = 0;
|
unique["ANNOTATED"] = 0;
|
||||||
unique["BLOCKED"] = 0;
|
unique["BLOCKED"] = 0;
|
||||||
unique["BLOCKING"] = 0;
|
unique["BLOCKING"] = 0;
|
||||||
unique["CHILD"] = 0;
|
unique["CHILD"] = 0; // 2017-01-07: Deprecated in 2.6.0
|
||||||
unique["COMPLETED"] = 0;
|
unique["COMPLETED"] = 0;
|
||||||
unique["DELETED"] = 0;
|
unique["DELETED"] = 0;
|
||||||
unique["DUE"] = 0;
|
unique["DUE"] = 0;
|
||||||
unique["DUETODAY"] = 0;
|
unique["DUETODAY"] = 0;
|
||||||
|
unique["INSTANCE"] = 0;
|
||||||
unique["MONTH"] = 0;
|
unique["MONTH"] = 0;
|
||||||
unique["ORPHAN"] = 0;
|
unique["ORPHAN"] = 0;
|
||||||
unique["OVERDUE"] = 0;
|
unique["OVERDUE"] = 0;
|
||||||
unique["PARENT"] = 0;
|
unique["PARENT"] = 0; // 2017-01-07: Deprecated in 2.6.0
|
||||||
unique["PENDING"] = 0;
|
unique["PENDING"] = 0;
|
||||||
unique["READY"] = 0;
|
unique["READY"] = 0;
|
||||||
unique["SCHEDULED"] = 0;
|
unique["SCHEDULED"] = 0;
|
||||||
unique["TAGGED"] = 0;
|
unique["TAGGED"] = 0;
|
||||||
|
unique["TEMPLATE"] = 0;
|
||||||
unique["TODAY"] = 0;
|
unique["TODAY"] = 0;
|
||||||
unique["TOMORROW"] = 0;
|
unique["TOMORROW"] = 0;
|
||||||
unique["UDA"] = 0;
|
unique["UDA"] = 0;
|
||||||
|
|
|
@ -142,9 +142,7 @@ int CmdTimesheet::execute (std::string& output)
|
||||||
std::string description = task.get ("description");
|
std::string description = task.get ("description");
|
||||||
int indent = context.config.getInteger ("indent.annotation");
|
int indent = context.config.getInteger ("indent.annotation");
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& ann : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
for (auto& ann : annotations)
|
|
||||||
description += '\n'
|
description += '\n'
|
||||||
+ std::string (indent, ' ')
|
+ std::string (indent, ' ')
|
||||||
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||||
|
@ -198,9 +196,7 @@ int CmdTimesheet::execute (std::string& output)
|
||||||
std::string description = task.get ("description");
|
std::string description = task.get ("description");
|
||||||
int indent = context.config.getInteger ("indent.annotation");
|
int indent = context.config.getInteger ("indent.annotation");
|
||||||
|
|
||||||
std::map <std::string, std::string> annotations;
|
for (auto& ann : task.getAnnotations ())
|
||||||
task.getAnnotations (annotations);
|
|
||||||
for (auto& ann : annotations)
|
|
||||||
description += '\n'
|
description += '\n'
|
||||||
+ std::string (indent, ' ')
|
+ std::string (indent, ' ')
|
||||||
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
+ Datetime (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||||
|
|
|
@ -38,29 +38,35 @@
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void dependencyGetBlocked (const Task& task, std::vector <Task>& blocked)
|
std::vector <Task> dependencyGetBlocked (const Task& task)
|
||||||
{
|
{
|
||||||
std::string uuid = task.get ("uuid");
|
std::string uuid = task.get ("uuid");
|
||||||
|
|
||||||
auto all = context.tdb2.pending.get_tasks ();
|
std::vector <Task> blocked;
|
||||||
for (auto& it : all)
|
for (auto& it : context.tdb2.pending.get_tasks ())
|
||||||
if (it.getStatus () != Task::completed &&
|
if (it.getStatus () != Task::completed &&
|
||||||
it.getStatus () != Task::deleted &&
|
it.getStatus () != Task::deleted &&
|
||||||
it.has ("depends") &&
|
it.has ("depends") &&
|
||||||
it.get ("depends").find (uuid) != std::string::npos)
|
it.get ("depends").find (uuid) != std::string::npos)
|
||||||
blocked.push_back (it);
|
blocked.push_back (it);
|
||||||
|
|
||||||
|
return blocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void dependencyGetBlocking (const Task& task, std::vector <Task>& blocking)
|
std::vector <Task> dependencyGetBlocking (const Task& task)
|
||||||
{
|
{
|
||||||
std::string depends = task.get ("depends");
|
std::string depends = task.get ("depends");
|
||||||
|
std::vector <Task> blocking;
|
||||||
|
|
||||||
if (depends != "")
|
if (depends != "")
|
||||||
for (auto& it : context.tdb2.pending.get_tasks ())
|
for (auto& it : context.tdb2.pending.get_tasks ())
|
||||||
if (it.getStatus () != Task::completed &&
|
if (it.getStatus () != Task::completed &&
|
||||||
it.getStatus () != Task::deleted &&
|
it.getStatus () != Task::deleted &&
|
||||||
depends.find (it.get ("uuid")) != std::string::npos)
|
depends.find (it.get ("uuid")) != std::string::npos)
|
||||||
blocking.push_back (it);
|
blocking.push_back (it);
|
||||||
|
|
||||||
|
return blocking;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -82,8 +88,7 @@ bool dependencyIsCircular (const Task& task)
|
||||||
while (! s.empty ())
|
while (! s.empty ())
|
||||||
{
|
{
|
||||||
Task& current = s.top ();
|
Task& current = s.top ();
|
||||||
std::vector <std::string> deps_current;
|
auto deps_current = current.getDependencyUUIDs ();
|
||||||
current.getDependencies (deps_current);
|
|
||||||
|
|
||||||
// This is a basic depth first search that always terminates given the
|
// This is a basic depth first search that always terminates given the
|
||||||
// fact that we do not visit any task twice
|
// fact that we do not visit any task twice
|
||||||
|
@ -146,14 +151,12 @@ bool dependencyIsCircular (const Task& task)
|
||||||
//
|
//
|
||||||
void dependencyChainOnComplete (Task& task)
|
void dependencyChainOnComplete (Task& task)
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
auto blocking = dependencyGetBlocking (task);
|
||||||
dependencyGetBlocking (task, blocking);
|
|
||||||
|
|
||||||
// If the task is anything but the tail end of a dependency chain.
|
// If the task is anything but the tail end of a dependency chain.
|
||||||
if (blocking.size ())
|
if (blocking.size ())
|
||||||
{
|
{
|
||||||
std::vector <Task> blocked;
|
auto blocked = dependencyGetBlocked (task);
|
||||||
dependencyGetBlocked (task, blocked);
|
|
||||||
|
|
||||||
// Nag about broken chain.
|
// Nag about broken chain.
|
||||||
if (context.config.getBoolean ("dependency.reminder"))
|
if (context.config.getBoolean ("dependency.reminder"))
|
||||||
|
@ -206,8 +209,7 @@ void dependencyChainOnStart (Task& task)
|
||||||
{
|
{
|
||||||
if (context.config.getBoolean ("dependency.reminder"))
|
if (context.config.getBoolean ("dependency.reminder"))
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
auto blocking = dependencyGetBlocking (task);
|
||||||
dependencyGetBlocking (task, blocking);
|
|
||||||
|
|
||||||
// If the task is anything but the tail end of a dependency chain, nag about
|
// If the task is anything but the tail end of a dependency chain, nag about
|
||||||
// broken chain.
|
// broken chain.
|
||||||
|
|
|
@ -84,8 +84,7 @@ std::string taskDifferences (const Task& before, const Task& after)
|
||||||
{
|
{
|
||||||
if (name == "depends")
|
if (name == "depends")
|
||||||
{
|
{
|
||||||
std::vector <Task> deps_after;
|
auto deps_after = after.getDependencyTasks ();
|
||||||
after.getDependencies (deps_after);
|
|
||||||
|
|
||||||
out << " - "
|
out << " - "
|
||||||
<< format (STRING_FEEDBACK_DEP_SET, taskIdentifiers (deps_after))
|
<< format (STRING_FEEDBACK_DEP_SET, taskIdentifiers (deps_after))
|
||||||
|
@ -110,12 +109,10 @@ std::string taskDifferences (const Task& before, const Task& after)
|
||||||
{
|
{
|
||||||
if (name == "depends")
|
if (name == "depends")
|
||||||
{
|
{
|
||||||
std::vector <Task> deps_before;
|
auto deps_before = before.getDependencyTasks ();
|
||||||
before.getDependencies (deps_before);
|
|
||||||
std::string from = taskIdentifiers (deps_before);
|
std::string from = taskIdentifiers (deps_before);
|
||||||
|
|
||||||
std::vector <Task> deps_after;
|
auto deps_after = after.getDependencyTasks ();
|
||||||
after.getDependencies (deps_after);
|
|
||||||
std::string to = taskIdentifiers (deps_after);
|
std::string to = taskIdentifiers (deps_after);
|
||||||
|
|
||||||
out << " - "
|
out << " - "
|
||||||
|
@ -169,11 +166,7 @@ std::string taskInfoDifferences (
|
||||||
{
|
{
|
||||||
if (name == "depends")
|
if (name == "depends")
|
||||||
{
|
{
|
||||||
std::vector <Task> deps_before;
|
out << format (STRING_FEEDBACK_DEP_DEL, taskIdentifiers (before.getDependencyTasks ()))
|
||||||
before.getDependencies (deps_before);
|
|
||||||
std::string from = taskIdentifiers (deps_before);
|
|
||||||
|
|
||||||
out << format (STRING_FEEDBACK_DEP_DEL, from)
|
|
||||||
<< "\n";
|
<< "\n";
|
||||||
}
|
}
|
||||||
else if (name.substr (0, 11) == "annotation_")
|
else if (name.substr (0, 11) == "annotation_")
|
||||||
|
@ -198,11 +191,7 @@ std::string taskInfoDifferences (
|
||||||
{
|
{
|
||||||
if (name == "depends")
|
if (name == "depends")
|
||||||
{
|
{
|
||||||
std::vector <Task> deps_after;
|
out << format (STRING_FEEDBACK_DEP_WAS_SET, taskIdentifiers (after.getDependencyTasks ()))
|
||||||
after.getDependencies (deps_after);
|
|
||||||
std::string to = taskIdentifiers (deps_after);
|
|
||||||
|
|
||||||
out << format (STRING_FEEDBACK_DEP_WAS_SET, to)
|
|
||||||
<< "\n";
|
<< "\n";
|
||||||
}
|
}
|
||||||
else if (name.substr (0, 11) == "annotation_")
|
else if (name.substr (0, 11) == "annotation_")
|
||||||
|
@ -231,13 +220,8 @@ std::string taskInfoDifferences (
|
||||||
{
|
{
|
||||||
if (name == "depends")
|
if (name == "depends")
|
||||||
{
|
{
|
||||||
std::vector <Task> deps_before;
|
auto from = taskIdentifiers (before.getDependencyTasks ());
|
||||||
before.getDependencies (deps_before);
|
auto to = taskIdentifiers (after.getDependencyTasks ());
|
||||||
std::string from = taskIdentifiers (deps_before);
|
|
||||||
|
|
||||||
std::vector <Task> deps_after;
|
|
||||||
after.getDependencies (deps_after);
|
|
||||||
std::string to = taskIdentifiers (deps_after);
|
|
||||||
|
|
||||||
out << format (STRING_FEEDBACK_DEP_WAS_MOD, from, to)
|
out << format (STRING_FEEDBACK_DEP_WAS_MOD, from, to)
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
@ -334,22 +318,24 @@ void feedback_reserved_tags (const std::string& tag)
|
||||||
tag == "ANNOTATED" ||
|
tag == "ANNOTATED" ||
|
||||||
tag == "BLOCKED" ||
|
tag == "BLOCKED" ||
|
||||||
tag == "BLOCKING" ||
|
tag == "BLOCKING" ||
|
||||||
tag == "CHILD" ||
|
tag == "CHILD" || // Deprecated 2.6.0
|
||||||
tag == "COMPLETED" ||
|
tag == "COMPLETED" ||
|
||||||
tag == "DELETED" ||
|
tag == "DELETED" ||
|
||||||
tag == "DUE" ||
|
tag == "DUE" ||
|
||||||
tag == "DUETODAY" ||
|
tag == "DUETODAY" ||
|
||||||
|
tag == "INSTANCE" ||
|
||||||
tag == "LATEST" ||
|
tag == "LATEST" ||
|
||||||
tag == "MONTH" ||
|
tag == "MONTH" ||
|
||||||
tag == "ORPHAN" ||
|
tag == "ORPHAN" ||
|
||||||
tag == "OVERDUE" ||
|
tag == "OVERDUE" ||
|
||||||
tag == "PARENT" ||
|
tag == "PARENT" || // Deprecated 2.6.0
|
||||||
tag == "PENDING" ||
|
tag == "PENDING" ||
|
||||||
tag == "PRIORITY" ||
|
tag == "PRIORITY" ||
|
||||||
tag == "PROJECT" ||
|
tag == "PROJECT" ||
|
||||||
tag == "READY" ||
|
tag == "READY" ||
|
||||||
tag == "SCHEDULED" ||
|
tag == "SCHEDULED" ||
|
||||||
tag == "TAGGED" ||
|
tag == "TAGGED" ||
|
||||||
|
tag == "TEMPLATE" ||
|
||||||
tag == "TODAY" ||
|
tag == "TODAY" ||
|
||||||
tag == "TOMORROW" ||
|
tag == "TOMORROW" ||
|
||||||
tag == "UDA" ||
|
tag == "UDA" ||
|
||||||
|
@ -397,14 +383,12 @@ void feedback_unblocked (const Task& task)
|
||||||
if (context.verbose ("affected"))
|
if (context.verbose ("affected"))
|
||||||
{
|
{
|
||||||
// Get a list of tasks that depended on this task.
|
// Get a list of tasks that depended on this task.
|
||||||
std::vector <Task> blocked;
|
auto blocked = dependencyGetBlocked (task);
|
||||||
dependencyGetBlocked (task, blocked);
|
|
||||||
|
|
||||||
// Scan all the tasks that were blocked by this task
|
// Scan all the tasks that were blocked by this task
|
||||||
for (auto& i : blocked)
|
for (auto& i : blocked)
|
||||||
{
|
{
|
||||||
std::vector <Task> blocking;
|
auto blocking = dependencyGetBlocking (i);
|
||||||
dependencyGetBlocking (i, blocking);
|
|
||||||
if (blocking.size () == 0)
|
if (blocking.size () == 0)
|
||||||
{
|
{
|
||||||
if (i.id)
|
if (i.id)
|
||||||
|
|
25
src/l10n/check_translations.sh
Executable file
25
src/l10n/check_translations.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
REFERENCE_LANGUAGE_FILE="eng-USA.h"
|
||||||
|
TESTED_LANGUAGE_FILES=`ls *.h | grep -v $REFERENCE_LANGUAGE_FILE`
|
||||||
|
|
||||||
|
# At the beginning, we haven't detected any invalid translation files
|
||||||
|
MISMATCHED=0
|
||||||
|
|
||||||
|
# Generate list of keys, not including defines that are commented out. Strips out the leading whitespace.
|
||||||
|
cat $REFERENCE_LANGUAGE_FILE | grep "^[[:space:]]*#define" | sed -e 's/^ *//' - | cut -f2 -d' ' | sort > identifiers
|
||||||
|
|
||||||
|
# Generate report
|
||||||
|
for LANGUAGE_FILE in $TESTED_LANGUAGE_FILES
|
||||||
|
do
|
||||||
|
echo "Comparing $REFERENCE_LANGUAGE_FILE (left) to $LANGUAGE_FILE (right)"
|
||||||
|
cat $LANGUAGE_FILE | grep "^[[:space:]]*#define" | sed -e 's/^ *//' - | cut -f2 -d' ' | sort | diff identifiers -
|
||||||
|
MISMATCHED=$(($MISMATCHED+$?))
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -f identifiers
|
||||||
|
|
||||||
|
# Exit with number of not synced translations files
|
||||||
|
exit $MISMATCHED
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Wert"
|
#define STRING_COLUMN_LABEL_VALUE "Wert"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Maske"
|
#define STRING_COLUMN_LABEL_MASK "Maske"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Masken-Index"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Masken-Index"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Vorgänger-Aufgabe"
|
#define STRING_COLUMN_LABEL_PARENT "Vorgänger-Aufgabe"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Datum"
|
#define STRING_COLUMN_LABEL_DATE "Datum"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Spalten"
|
#define STRING_COLUMN_LABEL_COLUMN "Spalten"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Unterstützte Formate"
|
#define STRING_COLUMN_LABEL_STYLES "Unterstützte Formate"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Value"
|
#define STRING_COLUMN_LABEL_VALUE "Value"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Mask"
|
#define STRING_COLUMN_LABEL_MASK "Mask"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Mask Index"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Mask Index"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Parent task"
|
#define STRING_COLUMN_LABEL_PARENT "Parent task"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Date"
|
#define STRING_COLUMN_LABEL_DATE "Date"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Columns"
|
#define STRING_COLUMN_LABEL_COLUMN "Columns"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Supported Formats"
|
#define STRING_COLUMN_LABEL_STYLES "Supported Formats"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Valoro"
|
#define STRING_COLUMN_LABEL_VALUE "Valoro"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Masko"
|
#define STRING_COLUMN_LABEL_MASK "Masko"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Mask-indico"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Mask-indico"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Patra tasko"
|
#define STRING_COLUMN_LABEL_PARENT "Patra tasko"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Dato"
|
#define STRING_COLUMN_LABEL_DATE "Dato"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Kolumnoj"
|
#define STRING_COLUMN_LABEL_COLUMN "Kolumnoj"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formaĝoj Subtenataj"
|
#define STRING_COLUMN_LABEL_STYLES "Formaĝoj Subtenataj"
|
||||||
|
|
|
@ -211,7 +211,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Valor"
|
#define STRING_COLUMN_LABEL_VALUE "Valor"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Máscara"
|
#define STRING_COLUMN_LABEL_MASK "Máscara"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Máscara de Índice"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Máscara de Índice"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Tarea madre"
|
#define STRING_COLUMN_LABEL_PARENT "Tarea madre"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Fecha"
|
#define STRING_COLUMN_LABEL_DATE "Fecha"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Columnas"
|
#define STRING_COLUMN_LABEL_COLUMN "Columnas"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formatos soportados"
|
#define STRING_COLUMN_LABEL_STYLES "Formatos soportados"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Valeur"
|
#define STRING_COLUMN_LABEL_VALUE "Valeur"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Masque"
|
#define STRING_COLUMN_LABEL_MASK "Masque"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Indice de masque"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Indice de masque"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Tâche mère"
|
#define STRING_COLUMN_LABEL_PARENT "Tâche mère"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Date"
|
#define STRING_COLUMN_LABEL_DATE "Date"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Colonnes"
|
#define STRING_COLUMN_LABEL_COLUMN "Colonnes"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formats supportés"
|
#define STRING_COLUMN_LABEL_STYLES "Formats supportés"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Valore"
|
#define STRING_COLUMN_LABEL_VALUE "Valore"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Maschera"
|
#define STRING_COLUMN_LABEL_MASK "Maschera"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Indice Maschera"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Indice Maschera"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Task genitore"
|
#define STRING_COLUMN_LABEL_PARENT "Task genitore"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Data"
|
#define STRING_COLUMN_LABEL_DATE "Data"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Colonna"
|
#define STRING_COLUMN_LABEL_COLUMN "Colonna"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formati Supportati"
|
#define STRING_COLUMN_LABEL_STYLES "Formati Supportati"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Value"
|
#define STRING_COLUMN_LABEL_VALUE "Value"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Mask"
|
#define STRING_COLUMN_LABEL_MASK "Mask"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Mask Index"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Mask Index"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Parent task"
|
#define STRING_COLUMN_LABEL_PARENT "Parent task"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Date"
|
#define STRING_COLUMN_LABEL_DATE "Date"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Columns"
|
#define STRING_COLUMN_LABEL_COLUMN "Columns"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Supported Formats"
|
#define STRING_COLUMN_LABEL_STYLES "Supported Formats"
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Wartość"
|
#define STRING_COLUMN_LABEL_VALUE "Wartość"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Maska"
|
#define STRING_COLUMN_LABEL_MASK "Maska"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Indeks Maski"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Indeks Maski"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Zadanie rodzic"
|
#define STRING_COLUMN_LABEL_PARENT "Zadanie rodzic"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Data"
|
#define STRING_COLUMN_LABEL_DATE "Data"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Kolumny"
|
#define STRING_COLUMN_LABEL_COLUMN "Kolumny"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formaty"
|
#define STRING_COLUMN_LABEL_STYLES "Formaty"
|
||||||
|
|
|
@ -211,7 +211,10 @@
|
||||||
#define STRING_COLUMN_LABEL_VALUE "Valor"
|
#define STRING_COLUMN_LABEL_VALUE "Valor"
|
||||||
#define STRING_COLUMN_LABEL_MASK "Máscara"
|
#define STRING_COLUMN_LABEL_MASK "Máscara"
|
||||||
#define STRING_COLUMN_LABEL_MASK_IDX "Índice de Máscara"
|
#define STRING_COLUMN_LABEL_MASK_IDX "Índice de Máscara"
|
||||||
|
#define STRING_COLUMN_LABEL_LAST "Last instance"
|
||||||
|
#define STRING_COLUMN_LABEL_RTYPE "Recurrence type"
|
||||||
#define STRING_COLUMN_LABEL_PARENT "Tarefa mãe"
|
#define STRING_COLUMN_LABEL_PARENT "Tarefa mãe"
|
||||||
|
#define STRING_COLUMN_LABEL_TEMPLATE "Template task"
|
||||||
#define STRING_COLUMN_LABEL_DATE "Data"
|
#define STRING_COLUMN_LABEL_DATE "Data"
|
||||||
#define STRING_COLUMN_LABEL_COLUMN "Colunas"
|
#define STRING_COLUMN_LABEL_COLUMN "Colunas"
|
||||||
#define STRING_COLUMN_LABEL_STYLES "Formatos Suportados"
|
#define STRING_COLUMN_LABEL_STYLES "Formatos Suportados"
|
||||||
|
|
|
@ -52,8 +52,8 @@ std::string colorizeError (const std::string&);
|
||||||
std::string colorizeDebug (const std::string&);
|
std::string colorizeDebug (const std::string&);
|
||||||
|
|
||||||
// dependency.cpp
|
// dependency.cpp
|
||||||
void dependencyGetBlocked (const Task&, std::vector <Task>&);
|
std::vector <Task> dependencyGetBlocked (const Task&);
|
||||||
void dependencyGetBlocking (const Task&, std::vector <Task>&);
|
std::vector <Task> dependencyGetBlocking (const Task&);
|
||||||
bool dependencyIsCircular (const Task&);
|
bool dependencyIsCircular (const Task&);
|
||||||
void dependencyChainOnComplete (Task&);
|
void dependencyChainOnComplete (Task&);
|
||||||
void dependencyChainOnStart (Task&);
|
void dependencyChainOnStart (Task&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue