summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-05-21 17:35:59 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-05-21 17:35:59 -0400
commit61ad66f8eb39f2cb1d6cd2bbf443306ef58dd611 (patch)
tree533ac6a23183e61cbd97cd3ba16593a1962ab07c
parentba4f9b599069b93d2c73e13b43493da5bfe9b40e (diff)
downloadsigen-61ad66f8eb39f2cb1d6cd2bbf443306ef58dd611.tar.gz
sigen-61ad66f8eb39f2cb1d6cd2bbf443306ef58dd611.tar.xz
sigen-61ad66f8eb39f2cb1d6cd2bbf443306ef58dd611.zip
Add method for setting the sigmod at some index as dirty
-rw-r--r--sigmodr/SigmodrUI.cpp10
-rw-r--r--sigmodr/SigmodrUI.h1
2 files changed, 9 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;
diff --git a/sigmodr/SigmodrUI.h b/sigmodr/SigmodrUI.h
index b9ffab26..f5113498 100644
--- a/sigmodr/SigmodrUI.h
+++ b/sigmodr/SigmodrUI.h
@@ -63,6 +63,7 @@ class SigmodrUI : public KXmlGuiWindow, private Ui::formSigmodr
void setChangedTitle(const bool changed);
void setDirty(const bool dirty = true);
+ void setDirty(const bool dirty, const QModelIndex& index);
void newGame();
void openGame();