As of workshop RW/KB, improved / fixed text messages

Also refs #351
* messages can be formatted with style sheet
* fixed: removed command from message
* added originator to command line
* msg parsing now in core
* using ITimestampBased for text messages and status messages
* allow to resize rows to content (view base)
* model / views for text messages
* removed old qt stylesheets
This commit is contained in:
Klaus Basan
2015-03-13 01:53:37 +01:00
parent aee2b2495f
commit 269c65b578
73 changed files with 1301 additions and 1311 deletions

View File

@@ -22,6 +22,7 @@ namespace BlackMisc
void CSimpleCommandParser::parse(const QString &commandLine)
{
this->m_knownCommand = false;
this->m_originalLine = commandLine;
this->m_cleanedLine = commandLine.trimmed().simplified();
if (!this->m_cleanedLine.isEmpty())
@@ -52,8 +53,8 @@ namespace BlackMisc
if (index < 0) { return this->m_originalLine.trimmed(); }
QString p = this->part(index);
int fi = this->m_originalLine.indexOf(p, 0, Qt::CaseInsensitive);
if (fi < 0) return "";
return this->m_originalLine.right(fi + p.length()).trimmed();
if (fi < 0) { return ""; }
return this->m_originalLine.mid(fi).trimmed();
}
int CSimpleCommandParser::countParts() const
@@ -97,7 +98,7 @@ namespace BlackMisc
double CSimpleCommandParser::toDouble(int index, double def) const
{
const QString p = this->part(index);
if (p.isEmpty()) return def;
if (p.isEmpty()) { return def; }
bool ok;
double d = CPqString::parseNumber(p, ok, CPqString::SeparatorsBestGuess);
return ok ? d : def;