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

View file

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