mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 12:17:19 +02:00
Merge pull request #93 from desbma/taskrc-default-filter
Get default filter from taskrc (fixes #92)
This commit is contained in:
commit
38e4341815
2 changed files with 7 additions and 1 deletions
|
@ -169,7 +169,7 @@ impl TTApp {
|
||||||
help_popup: Help::new(),
|
help_popup: Help::new(),
|
||||||
contexts: vec![],
|
contexts: vec![],
|
||||||
};
|
};
|
||||||
for c in "status:pending ".chars() {
|
for c in app.config.default_filter.chars() {
|
||||||
app.filter.insert(c, 1);
|
app.filter.insert(c, 1);
|
||||||
}
|
}
|
||||||
app.get_context()?;
|
app.get_context()?;
|
||||||
|
|
|
@ -63,6 +63,7 @@ impl TaskWarriorBool for str {
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
pub color: HashMap<String, TColor>,
|
pub color: HashMap<String, TColor>,
|
||||||
|
pub default_filter: String,
|
||||||
pub obfuscate: bool,
|
pub obfuscate: bool,
|
||||||
pub print_empty_columns: bool,
|
pub print_empty_columns: bool,
|
||||||
pub rule_precedence_color: Vec<String>,
|
pub rule_precedence_color: Vec<String>,
|
||||||
|
@ -86,6 +87,7 @@ impl Config {
|
||||||
obfuscate: bool_collection.get("obfuscate").cloned().unwrap_or(false),
|
obfuscate: bool_collection.get("obfuscate").cloned().unwrap_or(false),
|
||||||
print_empty_columns: bool_collection.get("print_empty_columns").cloned().unwrap_or(false),
|
print_empty_columns: bool_collection.get("print_empty_columns").cloned().unwrap_or(false),
|
||||||
color: Self::get_color_collection()?,
|
color: Self::get_color_collection()?,
|
||||||
|
default_filter: Self::get_default_filter(),
|
||||||
rule_precedence_color: Self::get_rule_precedence_color(),
|
rule_precedence_color: Self::get_rule_precedence_color(),
|
||||||
uda_task_report_show_info: Self::get_uda_task_report_show_info(),
|
uda_task_report_show_info: Self::get_uda_task_report_show_info(),
|
||||||
uda_task_report_looping: Self::get_uda_task_report_looping(),
|
uda_task_report_looping: Self::get_uda_task_report_looping(),
|
||||||
|
@ -310,6 +312,10 @@ impl Config {
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_default_filter() -> String {
|
||||||
|
Self::get_config("report.next.filter")
|
||||||
|
}
|
||||||
|
|
||||||
fn get_uda_task_report_show_info() -> bool {
|
fn get_uda_task_report_show_info() -> bool {
|
||||||
Self::get_config("uda.taskwarrior-tui.task-report.show-info")
|
Self::get_config("uda.taskwarrior-tui.task-report.show-info")
|
||||||
.get_bool()
|
.get_bool()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue