- Task now supports a default project and priority for new tasks, via
the new "default.project" and "default.priority" configuration variables (thanks to Vincent Fleuranceau).
This commit is contained in:
@@ -16,6 +16,9 @@ represents a feature release, and the Z represents a patch.
|
|||||||
(thanks to Vincent Fleuranceau)
|
(thanks to Vincent Fleuranceau)
|
||||||
+ Task now allows mixed case attribute names (pri:, PRI:, Pri: ...) and
|
+ Task now allows mixed case attribute names (pri:, PRI:, Pri: ...) and
|
||||||
commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau)
|
commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau)
|
||||||
|
+ Task now supports a default project and priority for new tasks, via
|
||||||
|
the new "default.project" and "default.priority" configuration variables
|
||||||
|
(thanks to Vincent Fleuranceau)
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -248,6 +248,16 @@
|
|||||||
<dd>
|
<dd>
|
||||||
Colors any task where the description contains X.
|
Colors any task where the description contains X.
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt>default.project</dt>
|
||||||
|
<dd>
|
||||||
|
Provides a default project name for the "task add ..." command.
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>default.priority</dt>
|
||||||
|
<dd>
|
||||||
|
Provides a default priority for the "task add ..." command.
|
||||||
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -100,6 +100,9 @@
|
|||||||
color is disabled (thanks to Vincent Fleuranceau).
|
color is disabled (thanks to Vincent Fleuranceau).
|
||||||
<li>Task now allows mixed case attribute names (pri:, PRI:, Pri: ...)
|
<li>Task now allows mixed case attribute names (pri:, PRI:, Pri: ...)
|
||||||
and commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau).
|
and commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau).
|
||||||
|
<li>Task now supports a default project and priority for new tasks, via
|
||||||
|
the new "default.project" and "default.priority" configuration variables
|
||||||
|
(thanks to Vincent Fleuranceau).
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -66,6 +66,20 @@ void handleAdd (const TDB& tdb, T& task, Config& conf)
|
|||||||
task.setAttribute ("mask", "");
|
task.setAttribute ("mask", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
|
// Override with default.project, if not specified.
|
||||||
|
if (task.getAttribute ("project") == "")
|
||||||
|
task.setAttribute ("project", conf.get ("default.project", ""));
|
||||||
|
|
||||||
|
// Override with default.priority, if not specified.
|
||||||
|
if (task.getAttribute ("priority") == "")
|
||||||
|
{
|
||||||
|
std::string defaultPriority = conf.get ("default.priority", "");
|
||||||
|
if (validPriority (defaultPriority))
|
||||||
|
task.setAttribute ("priority", defaultPriority);
|
||||||
|
}
|
||||||
|
/**/
|
||||||
|
|
||||||
if (task.getDescription () == "")
|
if (task.getDescription () == "")
|
||||||
throw std::string ("Cannot add a blank task.");
|
throw std::string ("Cannot add a blank task.");
|
||||||
|
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ bool validDate (std::string& date, Config& conf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static bool validPriority (const std::string& input)
|
bool validPriority (const std::string& input)
|
||||||
{
|
{
|
||||||
if (input != "H" &&
|
if (input != "H" &&
|
||||||
input != "M" &&
|
input != "M" &&
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ for (typeof (c) *foreach_p = & (c); \
|
|||||||
|
|
||||||
// parse.cpp
|
// parse.cpp
|
||||||
void parse (std::vector <std::string>&, std::string&, T&, Config&);
|
void parse (std::vector <std::string>&, std::string&, T&, Config&);
|
||||||
|
bool validPriority (const std::string&);
|
||||||
bool validDate (std::string&, Config&);
|
bool validDate (std::string&, Config&);
|
||||||
|
|
||||||
// task.cpp
|
// task.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user