Use folder label as "caption" in syncthingctl instead of ID

This makes it easier to identify folders when one is not using
human-readable folder IDs and is more consistent with other UIs.
This commit is contained in:
Martchus 2023-01-28 17:05:49 +01:00
parent 0fbc4c7297
commit f865d1ffbc
1 changed files with 9 additions and 2 deletions

View File

@ -506,8 +506,15 @@ bool Application::findPwd()
void Application::printDir(const RelevantDir &relevantDir) const
{
const SyncthingDir *const dir = relevantDir.dirObj;
cout << " - " << TextAttribute::Bold << dir->id.toLocal8Bit().data() << '\n' << TextAttribute::Reset;
printProperty("Label", dir->label);
cout << " - " << TextAttribute::Bold;
if (dir->label.isEmpty()) {
cout << dir->id.toLocal8Bit().data() << '\n' << TextAttribute::Reset;
} else {
cout << dir->label.toLocal8Bit().data() << '\n' << TextAttribute::Reset;
if (dir->id != dir->label) {
printProperty("ID", dir->id);
}
}
printProperty("Path", dir->path);
printProperty("Status", dir->statusString());
if (!dir->paused) {