From 9612c6a6fd95d98c6ecc6ec5aea53df1ee593cab Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sat, 8 Mar 2014 16:50:42 +0100 Subject: [PATCH] handle also bool boxes --- apps/opencs/view/world/dialoguesubview.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index a946a6f6f..e8b53f2cd 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -37,7 +37,10 @@ mIndexWrapper(NULL) void CSVWorld::DialogueDelegateDispatcherProxy::editorDataCommited() { - emit editorDataCommited(mEditor, mIndexWrapper->mIndex, mDisplay); + if (mIndexWrapper.get()) + { + emit editorDataCommited(mEditor, mIndexWrapper->mIndex, mDisplay); + } } void CSVWorld::DialogueDelegateDispatcherProxy::setIndex(const QModelIndex& index) @@ -79,7 +82,6 @@ CSVWorld::CommandDelegate* CSVWorld::DialogueDelegateDispatcher::makeDelegate(CS void CSVWorld::DialogueDelegateDispatcher::editorDataCommited(QWidget* editor, const QModelIndex& index, CSMWorld::ColumnBase::Display display) { - std::cout<<"triggered"<(mTable->getColumnId(index.column() ) ) ); + if (display == CSMWorld::ColumnBase::Display_Boolean) + { + hasEnums = true; + } + QWidget* editor = NULL; std::map::iterator delegateIt(mDelegates.find(display)); if (delegateIt != mDelegates.end()) @@ -133,7 +140,7 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase:: DialogueDelegateDispatcherProxy* proxy = new DialogueDelegateDispatcherProxy(editor, display); if (hasEnums) //combox is used for all enums { - connect(editor, SIGNAL(currentIndexChanged ( int)), proxy, SLOT(editorDataCommited())); + connect(editor, SIGNAL(currentIndexChanged (int)), proxy, SLOT(editorDataCommited())); } else { connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited()));