|
35 | 35 | #include "InterSpec/SpecMeas.h" |
36 | 36 | #include "SpecUtils/SpecFile.h" |
37 | 37 | #include "InterSpec/InterSpec.h" |
| 38 | +#include "SpecUtils/StringAlgo.h" |
38 | 39 | #include "InterSpec/SimpleDialog.h" |
39 | 40 | #include "InterSpec/PhysicalUnits.h" |
40 | 41 | #include "InterSpec/InterSpecUser.h" |
@@ -232,15 +233,36 @@ class AnaResultDisplay : public WContainerWidget |
232 | 233 | m_algorithm_result_description->setText( ana->algorithm_result_description_ ); |
233 | 234 | m_table->rowAt(AlgorithmResultDescription)->setHidden( m_algorithm_result_description->text().empty() ); |
234 | 235 |
|
| 236 | +#if( ENABLE_EDIT_RESULTS ) |
235 | 237 | string remarktxt; |
236 | | - for( const string &r : ana->remarks_ ) |
| 238 | + for( string r : ana->remarks_ ) |
| 239 | + { |
| 240 | + SpecUtils::ireplace_all( r, "	", " " ); |
237 | 241 | remarktxt += (remarktxt.size() ? "\n" : "") + r; |
238 | | - |
239 | | -#if( ENABLE_EDIT_RESULTS ) |
| 242 | + } |
240 | 243 | m_algorithm_remarks->setText( remarktxt ); |
241 | 244 | #else |
242 | | - const WString remarks = Wt::Utils::htmlEncode( WString::fromUTF8(remarktxt), Wt::Utils::HtmlEncodingFlag::EncodeNewLines ); |
243 | | - m_algorithm_remarks->setText( remarks ); |
| 245 | + string remarktxt; |
| 246 | + for( string r : ana->remarks_ ) |
| 247 | + { |
| 248 | + if( r.empty() ) |
| 249 | + continue; |
| 250 | + |
| 251 | + // Lets make lines line "Top Line 1: Am241	662.45	400.81" semi-reasonable, and have |
| 252 | + // displayed all on the same line. |
| 253 | + // TODO: there are probably a lot better ways to do this, like first check if there are any |
| 254 | + // lines like this, and if so, make a html table. |
| 255 | + // TODO: there are probably a lot of other special cases we can handle. |
| 256 | + SpecUtils::ireplace_all( r, "	", "---mytab---" ); |
| 257 | + r = Wt::Utils::htmlEncode( r, Wt::Utils::HtmlEncodingFlag::EncodeNewLines ); |
| 258 | + SpecUtils::ireplace_all( r, "---mytab---", " " ); |
| 259 | + SpecUtils::ireplace_all( r, ": ", ": " ); |
| 260 | + SpecUtils::ireplace_all( r, "Top Line ", "Top Line " ); |
| 261 | + |
| 262 | + remarktxt += "<div>" + r + "</div>"; |
| 263 | + }//for( string r : ana->remarks_ ) |
| 264 | + |
| 265 | + m_algorithm_remarks->setText( WString::fromUTF8(remarktxt) ); |
244 | 266 | #endif |
245 | 267 |
|
246 | 268 | m_table->rowAt(AlgorithmRemarks)->setHidden( m_algorithm_remarks->text().empty() ); |
|
0 commit comments