summaryrefslogtreecommitdiffstats
path: root/sigmodr/SigmodrUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/SigmodrUI.cpp')
-rw-r--r--sigmodr/SigmodrUI.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/sigmodr/SigmodrUI.cpp b/sigmodr/SigmodrUI.cpp
index 72e452cc..5e0b235f 100644
--- a/sigmodr/SigmodrUI.cpp
+++ b/sigmodr/SigmodrUI.cpp
@@ -169,10 +169,16 @@ void SigmodrUI::setChangedTitle(const bool changed)
void SigmodrUI::setDirty(const bool dirty)
{
+ setDirty(dirty, m_editedIndex);
setChangedTitle(dirty);
actionCollection()->action("file_save")->setEnabled(dirty);
}
+void SigmodrUI::setDirty(const bool dirty, const QModelIndex& index)
+{
+ treeSigmod->setDirty(treeSigmod->game(index), dirty);
+}
+
void SigmodrUI::newGame()
{
Game* game = new Game;
@@ -493,12 +499,12 @@ void SigmodrUI::on_treeSigmod_clicked(const QModelIndex& index)
if ((m_editedIndex.internalId() != index.internalId()) || closeWidget())
{
if (treeSigmod->model()->removeRow(index.row(), index.parent()))
- setDirty();
+ setDirty(true, index);
}
break;
case 3:
if (treeSigmod->model()->insertRow(treeSigmod->model()->rowCount(index), index))
- setDirty();
+ setDirty(true, index);
break;
default:
break;