From d8734ff0823f84310c14e43774fca02532d4071d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Wed, 20 Sep 2023 13:15:33 +0200 Subject: [PATCH] Separate contextual menu from general --- src/Platform/ReportExcel.cc | 4 ++-- src/Platform/Results.cc | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Platform/ReportExcel.cc b/src/Platform/ReportExcel.cc index ad816a2..41891e9 100644 --- a/src/Platform/ReportExcel.cc +++ b/src/Platform/ReportExcel.cc @@ -93,12 +93,12 @@ namespace platform { format_set_num_format(style, "#,##0.000000"); } else if (name == "ints") { format_set_font_size(style, normalSize); - format_set_num_format(style, "###,###"); + format_set_num_format(style, "###,##0"); format_set_border(style, LXW_BORDER_THIN); } else if (name == "floats") { format_set_border(style, LXW_BORDER_THIN); format_set_font_size(style, normalSize); - format_set_num_format(style, "#,###.00"); + format_set_num_format(style, "#,##0.00"); } } diff --git a/src/Platform/Results.cc b/src/Platform/Results.cc index 8568600..725952c 100644 --- a/src/Platform/Results.cc +++ b/src/Platform/Results.cc @@ -126,7 +126,7 @@ namespace platform { return; } cout << Colors::YELLOW() << "Showing " << files.at(index).getFilename() << endl; - ReportConsole reporter(data, idx); + ReportConsole reporter(data, compare, idx); reporter.show(); } void Results::menu() @@ -134,9 +134,21 @@ namespace platform { char option; int index; bool finished = false; + string color, context; string filename, line, options = "qldhsre"; while (!finished) { - cout << Colors::RESET() << "Choose option (quit='q', list='l', delete='d', hide='h', sort='s', report='r', excel='e'): "; + if (indexList) { + color = Colors::GREEN(); + context = " (quit='q', list='l', delete='d', hide='h', sort='s', report='r', excel='e'): "; + options = "qldhsre"; + } else { + color = Colors::MAGENTA(); + context = " (quit='q', list='l'): "; + options = "ql"; + } + cout << Colors::RESET() << color; + + cout << "Choose option " << context; getline(cin, line); if (line.size() == 0) continue;