mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CmdColumns: Now shows whether a column is modifiable or read only
This commit is contained in:
parent
3749378867
commit
1236abc7d5
12 changed files with 28 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
2.5.1 () -
|
||||
|
||||
- The default configuration is now 256-color only.
|
||||
- The 'columns' report now shows whether a column is modifiable or read only.
|
||||
|
||||
------ current release ---------------------------
|
||||
|
||||
|
|
|
@ -2002,7 +2002,7 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
! column->modifiable ())
|
||||
throw format (STRING_INVALID_MOD, name, value);
|
||||
|
||||
// String type attributes only get DOM resolution, no eval.
|
||||
// DOM resolution. If it evals, store that, otherwise raw.
|
||||
Variant evaluatedValue;
|
||||
if (name != "project" || Lexer::isDOM (value))
|
||||
{
|
||||
|
@ -2170,7 +2170,7 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
++modCount;
|
||||
}
|
||||
|
||||
// String type columns are not eval'd. Welll, not much.
|
||||
// String type columns are not eval'd. Well, not much.
|
||||
else if (column->type () == "string")
|
||||
{
|
||||
std::string strValue = (std::string) evaluatedValue;
|
||||
|
|
|
@ -73,6 +73,7 @@ int CmdColumns::execute (std::string& output)
|
|||
formats.width (context.getWidth ());
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_COLUMN));
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_TYPE));
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_MODIFY));
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_STYLES));
|
||||
formats.add (Column::factory ("string", STRING_COLUMN_LABEL_EXAMPLES));
|
||||
|
||||
|
@ -99,8 +100,9 @@ int CmdColumns::execute (std::string& output)
|
|||
int row = formats.addRow ();
|
||||
formats.set (row, 0, i == 0 ? name : "");
|
||||
formats.set (row, 1, i == 0 ? context.columns[name]->type () : "");
|
||||
formats.set (row, 2, styles[i] + (i == 0 ? "*" : ""));
|
||||
formats.set (row, 3, i < examples.size () ? examples[i] : "");
|
||||
formats.set (row, 2, i == 0 ? (context.columns[name]->modifiable () ? STRING_COLUMN_LABEL_MODIFY : STRING_COLUMN_LABEL_NOMODIFY) : "");
|
||||
formats.set (row, 3, styles[i] + (i == 0 ? "*" : ""));
|
||||
formats.set (row, 4, i < examples.size () ? examples[i] : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,11 +110,12 @@ int CmdColumns::execute (std::string& output)
|
|||
int row = formats.addRow ();
|
||||
formats.set (row, 0, "<uda>");
|
||||
formats.set (row, 1, "<type>");
|
||||
formats.set (row, 2, "default*");
|
||||
formats.set (row, 2, "Modifiable");
|
||||
formats.set (row, 3, "default*");
|
||||
|
||||
row = formats.addRow ();
|
||||
formats.set (row, 0, "");
|
||||
formats.set (row, 2, "indicator");
|
||||
formats.set (row, 3, "indicator");
|
||||
|
||||
output = optionalBlankLine ()
|
||||
+ formats.render ()
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Geplant"
|
||||
#define STRING_COLUMN_LABEL_UDA "Name"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Typ"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Beschreibung"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Standard"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Erlaubte Werte"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Scheduled"
|
||||
#define STRING_COLUMN_LABEL_UDA "Name"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Type"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Label"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Default"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Allowed Values"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Fiksa"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nomo"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Tipo"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Rubriko"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Defaŭlto"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Valoroj permesataj"
|
||||
|
|
|
@ -225,6 +225,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Programada"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nombre"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Tipo"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Etiqueta"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Defecto"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Valores permitidos"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Planifiée"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nom"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Type"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Étiq"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Défaut"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Valeurs autorisées"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Fissato"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nome"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Tipo"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Etichetta"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Predefinito"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Valori consentiti"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Scheduled"
|
||||
#define STRING_COLUMN_LABEL_UDA "Name"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Type"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Label"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Default"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Allowed Values"
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Zaplanowane"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nazwa"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Typ"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Etykieta"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Domyślne"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Dozwolone Wartości"
|
||||
|
|
|
@ -225,6 +225,8 @@
|
|||
#define STRING_COLUMN_LABEL_SCHED "Agendado"
|
||||
#define STRING_COLUMN_LABEL_UDA "Nome"
|
||||
#define STRING_COLUMN_LABEL_TYPE "Tipo"
|
||||
#define STRING_COLUMN_LABEL_MODIFY "Modifiable"
|
||||
#define STRING_COLUMN_LABEL_NOMODIFY "Read Only"
|
||||
#define STRING_COLUMN_LABEL_LABEL "Rótulo"
|
||||
#define STRING_COLUMN_LABEL_DEFAULT "Por omissão"
|
||||
#define STRING_COLUMN_LABEL_VALUES "Valores Permitidos"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue