Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
6 src/Task.cpp
@@ -1153,7 +1153,8 @@ void Task::validate ()
std::string priority = get ("priority");
if (priority != "H" &&
priority != "M" &&
- priority != "L")
+ priority != "L" &&
+ priority != "D")
throw format (STRING_TASK_VALID_PRIORITY, priority);
}
}
@@ -1261,7 +1262,7 @@ float Task::urgency_c () const
value += urgency_blocking () * context.config.getReal ("urgency.blocking.coefficient");
value += urgency_age () * context.config.getReal ("urgency.age.coefficient");
-/*
+/*
std::cout << "# Urgency for " << id << ":\n"
<< "# pri " << (urgency_priority () * context.config.getReal ("urgency.priority.coefficient"))
<< "# pro " << (urgency_project () * context.config.getReal ("urgency.project.coefficient"))
@@ -1333,6 +1334,7 @@ float Task::urgency_priority () const
if (value == "H") return 1.0;
else if (value == "M") return 0.65;
else if (value == "L") return 0.3;
+ else if (value == "D") return 0.1;
return 0.0;
}
View
3  src/columns/ColPriority.cpp
@@ -62,6 +62,7 @@ bool ColumnPriority::validate (std::string& value)
if (value == "H" ||
value == "M" ||
value == "L" ||
+ value == "D" ||
value == "")
return true;
@@ -91,6 +92,7 @@ void ColumnPriority::measure (Task& task, int& minimum, int& maximum)
if (priority == "H") minimum = maximum = 4;
else if (priority == "M") minimum = maximum = 6;
else if (priority == "L") minimum = maximum = 3;
+ else if (priority == "D") minimum = maximum = 8;
}
else if (_style != "default" &&
_style != "short")
@@ -110,6 +112,7 @@ void ColumnPriority::render (
if (priority == "H") priority = "High";
else if (priority == "M") priority = "Medium";
else if (priority == "L") priority = "Low";
+ else if (priority == "D") priority = "Deferred";
}
lines.push_back (color.colorize (leftJustify (priority, width)));
View
15 src/commands/CmdProjects.cpp
@@ -80,6 +80,7 @@ int CmdProjects::execute (std::string& output)
std::map <std::string, int> unique;
std::map <std::string, int> high;
std::map <std::string, int> medium;
+ std::map <std::string, int> deferred;
std::map <std::string, int> low;
std::map <std::string, int> none;
bool no_project = false;
@@ -95,10 +96,11 @@ int CmdProjects::execute (std::string& output)
if (project == "")
no_project = true;
- if (priority == "H") high[project] += 1;
- else if (priority == "M") medium[project] += 1;
- else if (priority == "L") low[project] += 1;
- else none[project] += 1;
+ if (priority == "H") high[project] += 1;
+ else if (priority == "M") medium[project] += 1;
+ else if (priority == "D") deferred[project] += 1;
+ else if (priority == "L") low[project] += 1;
+ else none[project] += 1;
}
if (unique.size ())
@@ -123,8 +125,9 @@ int CmdProjects::execute (std::string& output)
view.set (row, 1, project->second);
view.set (row, 2, none[project->first]);
view.set (row, 3, low[project->first]);
- view.set (row, 4, medium[project->first]);
- view.set (row, 5, high[project->first]);
+ view.set (row, 4, deferred[project->first]);
+ view.set (row, 5, medium[project->first]);
+ view.set (row, 6, high[project->first]);
}
int number_projects = unique.size ();
View
4 src/en-US.h
@@ -767,7 +767,7 @@
#define STRING_TASK_VALID_REC_DUE "A recurring task must also have a 'due' date."
#define STRING_TASK_VALID_UNTIL "Only recurring tasks may have an 'until' date."
#define STRING_TASK_VALID_RECUR "The recurrence value '{1}' is not valid."
-#define STRING_TASK_VALID_PRIORITY "Priority values may be 'H', 'M' or 'L', not '{1}'."
+#define STRING_TASK_VALID_PRIORITY "Priority values may be 'H', 'M', 'D', or 'L', not '{1}'."
#define STRING_TASK_SAFETY_VALVE "This command has no filter, and will modify all tasks. Are you sure?"
#define STRING_TASK_SAFETY_FAIL "Command prevented from running."
@@ -928,7 +928,7 @@
/*
To be included later, before the 'precendence' line.
-
+
" + - Addition, subtraction\n" \
" ! Inversion\n" \
" ~ !~ Match, no match\n" \
View
9 src/rules.cpp
@@ -123,6 +123,14 @@ static void colorizePriorityH (Task& task, const std::string& rule, Color& c)
}
////////////////////////////////////////////////////////////////////////////////
+static void colorizePriorityD (Task& task, const std::string& rule, Color& c)
+{
+ if (gsColor[rule].nontrivial ())
+ if (task.get ("priority") == "D")
+ c.blend (gsColor[rule]);
+}
+
+////////////////////////////////////////////////////////////////////////////////
static void colorizePriorityNone (Task& task, const std::string& rule, Color& c)
{
if (gsColor[rule].nontrivial ())
@@ -289,6 +297,7 @@ void autoColorize (Task& task, Color& c)
else if (*r == "color.pri.L") colorizePriorityL (task, *r, c);
else if (*r == "color.pri.M") colorizePriorityM (task, *r, c);
else if (*r == "color.pri.H") colorizePriorityH (task, *r, c);
+ else if (*r == "color.pri.D") colorizePriorityD (task, *r, c);
else if (*r == "color.pri.none") colorizePriorityNone (task, *r, c);
else if (*r == "color.active") colorizeActive (task, *r, c);
else if (*r == "color.project.none") colorizeProjectNone (task, *r, c);

No commit comments for this range

Something went wrong with that request. Please try again.