From 6cd4d756db3bbac5a44e4441036347741aaffa2d Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 3 Sep 2014 00:00:52 +0200 Subject: [PATCH] Mark the DFN editor modified after adding / removing an element. --HG-- branch : dfighter-tools --- .../georges_editor/georges_dfn_dialog.cpp | 23 +++++++++++++------ .../georges_editor/georges_dfn_dialog.h | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp index 0638f18b9..1a45a9888 100644 --- a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp +++ b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp @@ -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 ); diff --git a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h index 6ce67c2d2..5bfb55f44 100644 --- a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h +++ b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h @@ -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();