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

@@ -18,11 +18,6 @@ namespace BlackMisc
return QDateTime::fromMSecsSinceEpoch(this->m_timestampMSecsSinceEpoch, Qt::UTC);
}
QString ITimestampBased::getFormattedUtcTimestamp() const
{
return this->getUtcTimestamp().toString("dd hh:mm:ss");
}
void ITimestampBased::setUtcTimestamp(const QDateTime &timestamp)
{
this->m_timestampMSecsSinceEpoch = timestamp.toMSecsSinceEpoch();
@@ -75,6 +70,37 @@ namespace BlackMisc
this->m_timestampMSecsSinceEpoch = QDateTime::currentMSecsSinceEpoch();
}
QString ITimestampBased::getFormattedUtcTimestamp() const
{
return this->getUtcTimestamp().toString("dd hh:mm:ss");
}
QString ITimestampBased::getFormattedUtcTimestampHms() const
{
return this->getUtcTimestamp().toString("hh:mm:ss");
}
QString ITimestampBased::getFormattedUtcTimestampHm() const
{
return this->getUtcTimestamp().toString("hh::mm");
}
QString ITimestampBased::getFormattedUtcTimestampYmdhms() const
{
return this->getUtcTimestamp().toString("yyyy-MM-dd HH:mm::ss");
}
QString ITimestampBased::getFormattedUtcTimestampYmdhmsz() const
{
return this->getUtcTimestamp().toString("yyyy-MM-dd HH:mm:ss.zzz");
}
bool ITimestampBased::canHandleIndex(const CPropertyIndex &index)
{
int i = index.frontCasted<int>();
return (i >= static_cast<int>(IndexUtcTimestamp)) && (i <= static_cast<int>(IndexMSecsSinceEpoch));
}
CVariant ITimestampBased::propertyByIndex(const CPropertyIndex &index) const
{
if (!index.isEmpty())
@@ -88,6 +114,10 @@ namespace BlackMisc
return CVariant::fromValue(this->getMSecsSinceEpoch());
case IndexUtcTimestampFormatted:
return CVariant::fromValue(this->getFormattedUtcTimestamp());
case IndexUtcTimestampFormattedHm:
return CVariant::fromValue(this->getFormattedUtcTimestampHm());
case IndexUtcTimestampFormattedHms:
return CVariant::fromValue(this->getFormattedUtcTimestampHms());
default:
break;
}