mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Add configuration to disable looping
This commit is contained in:
parent
0aae32a706
commit
ae6e015069
3 changed files with 52 additions and 22 deletions
|
@ -33,24 +33,6 @@ impl TColor {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Config {
|
||||
pub enabled: bool,
|
||||
pub color: HashMap<String, TColor>,
|
||||
pub obfuscate: bool,
|
||||
pub print_empty_columns: bool,
|
||||
pub rule_precedence_color: Vec<String>,
|
||||
pub uda_task_report_show_info: bool,
|
||||
pub uda_selection_indicator: String,
|
||||
pub uda_selection_bold: bool,
|
||||
pub uda_selection_italic: bool,
|
||||
pub uda_selection_dim: bool,
|
||||
pub uda_selection_blink: bool,
|
||||
pub uda_calendar_months_per_row: usize,
|
||||
pub uda_style_context_active: TColor,
|
||||
pub uda_style_calendar_title: TColor,
|
||||
}
|
||||
|
||||
trait TaskWarriorBool {
|
||||
fn get_bool(&self) -> Option<bool>;
|
||||
}
|
||||
|
@ -79,6 +61,26 @@ impl TaskWarriorBool for str {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Config {
|
||||
pub enabled: bool,
|
||||
pub color: HashMap<String, TColor>,
|
||||
pub obfuscate: bool,
|
||||
pub print_empty_columns: bool,
|
||||
pub rule_precedence_color: Vec<String>,
|
||||
pub uda_task_report_show_info: bool,
|
||||
pub uda_task_report_looping: bool,
|
||||
pub uda_selection_indicator: String,
|
||||
pub uda_selection_bold: bool,
|
||||
pub uda_selection_italic: bool,
|
||||
pub uda_selection_dim: bool,
|
||||
pub uda_selection_blink: bool,
|
||||
pub uda_calendar_months_per_row: usize,
|
||||
pub uda_style_context_active: TColor,
|
||||
pub uda_style_calendar_title: TColor,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn default() -> Result<Self, Box<dyn Error>> {
|
||||
let bool_collection = Self::get_bool_collection();
|
||||
|
@ -89,6 +91,7 @@ impl Config {
|
|||
color: Self::get_color_collection()?,
|
||||
rule_precedence_color: Self::get_rule_precedence_color(),
|
||||
uda_task_report_show_info: Self::get_uda_task_report_show_info(),
|
||||
uda_task_report_looping: Self::get_uda_task_report_looping(),
|
||||
uda_selection_indicator: Self::get_uda_selection_indicator(),
|
||||
uda_selection_bold: Self::get_uda_selection_bold(),
|
||||
uda_selection_italic: Self::get_uda_selection_italic(),
|
||||
|
@ -318,6 +321,14 @@ impl Config {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_uda_task_report_looping() -> bool {
|
||||
let s = Self::get_config("uda.taskwarrior-tui.task-report.looping");
|
||||
match s.get_bool() {
|
||||
Some(b) => b,
|
||||
None => true,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uda_selection_indicator() -> String {
|
||||
let indicator = Self::get_config("uda.taskwarrior-tui.selection.indicator");
|
||||
if indicator.is_empty() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue