Mark the DFN editor modified after adding / removing an element.

This commit is contained in:
dfighter1985 2014-09-03 00:00:52 +02:00
parent 5e2b448cbe
commit 8bf8cc1d4f
2 changed files with 17 additions and 7 deletions

View file

@ -123,6 +123,8 @@ void GeorgesDFNDialog::onAddClicked()
m_pvt->dfn->addEntry( name.toUtf8().constData() );
log( "Added " + name );
onModified();
}
void GeorgesDFNDialog::onRemoveClicked()
@ -137,6 +139,8 @@ void GeorgesDFNDialog::onRemoveClicked()
delete item;
m_pvt->dfn->removeEntry( row );
onModified();
}
void GeorgesDFNDialog::onCurrentRowChanged( int row )
@ -149,13 +153,7 @@ void GeorgesDFNDialog::onCurrentRowChanged( int row )
void GeorgesDFNDialog::onValueChanged( const QString &key, const QString &value )
{
if( !isModified() )
{
setModified( true );
setWindowTitle( windowTitle() + "*" );
Q_EMIT modified();
}
onModified();
log( m_ui.list->currentItem()->text() + "." + key + " = " + value );
@ -165,6 +163,17 @@ void GeorgesDFNDialog::onValueChanged( const QString &key, const QString &value
}
}
void GeorgesDFNDialog::onModified()
{
if( !isModified() )
{
setModified( true );
setWindowTitle( windowTitle() + "*" );
Q_EMIT modified();
}
}
void GeorgesDFNDialog::log( const QString &msg )
{
QString logMsg = buildLogMsg( msg );

View file

@ -27,6 +27,7 @@ private Q_SLOTS:
void onValueChanged( const QString& key, const QString &value );
private:
void onModified();
void log( const QString &msg );
void setupConnections();