mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 23:36:18 +00:00
Log changes and save log.
This commit is contained in:
parent
2d55f4d648
commit
d294438a9b
1 changed files with 21 additions and 0 deletions
|
@ -77,6 +77,7 @@ void GeorgesTypDialog::write()
|
|||
NLMISC::COXml xml;
|
||||
xml.init( &file );
|
||||
|
||||
m_pvt->typ->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
||||
m_pvt->typ->write( xml.getDocument() );
|
||||
|
||||
xml.flush();
|
||||
|
@ -114,6 +115,8 @@ void GeorgesTypDialog::onAddClicked()
|
|||
def.Value = "";
|
||||
m_pvt->typ->Definitions.push_back( def );
|
||||
|
||||
log( "Added definition " + label );
|
||||
|
||||
onModified();
|
||||
}
|
||||
|
||||
|
@ -130,12 +133,16 @@ void GeorgesTypDialog::onRemoveClicked()
|
|||
break;
|
||||
}
|
||||
|
||||
QString definition = item->text( 0 );
|
||||
|
||||
m_ui.tree->takeTopLevelItem( i );
|
||||
delete item;
|
||||
|
||||
std::vector< NLGEORGES::CType::CDefinition >::iterator itr = m_pvt->typ->Definitions.begin() + i;
|
||||
m_pvt->typ->Definitions.erase( itr );
|
||||
|
||||
log( "Removed definition" + definition );
|
||||
|
||||
onModified();
|
||||
}
|
||||
|
||||
|
@ -150,10 +157,23 @@ void GeorgesTypDialog::onItemChanged( QTreeWidgetItem *item, int column )
|
|||
|
||||
NLGEORGES::CType::CDefinition &def = m_pvt->typ->Definitions[ i ];
|
||||
|
||||
QString logMsg;
|
||||
logMsg = "Changed definition" + QString( def.Label.c_str() );
|
||||
|
||||
if( i == 0 )
|
||||
{
|
||||
logMsg += ".label = ";
|
||||
logMsg += item->text( 0 );
|
||||
def.Label = item->text( 0 ).toUtf8().constData();
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg += ".value = ";
|
||||
logMsg += item->text( 1 );
|
||||
def.Value = item->text( 1 ).toUtf8().constData();
|
||||
}
|
||||
|
||||
log( logMsg );
|
||||
|
||||
onModified();
|
||||
}
|
||||
|
@ -171,6 +191,7 @@ void GeorgesTypDialog::onModified()
|
|||
|
||||
void GeorgesTypDialog::onModified( const QString &k, const QString &v )
|
||||
{
|
||||
log( "Changed " + k + " = " + v );
|
||||
onModified();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue