From 77bf1efc1ad9293d1dd2ce6a0dc1c453fb3eaa98 Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Sun, 26 Mar 2017 09:14:32 -0400 Subject: [PATCH] Editor: Fix labels for creator user inputs --- apps/opencs/view/world/infocreator.cpp | 16 ++++++++++------ apps/opencs/view/world/pathgridcreator.cpp | 2 +- apps/opencs/view/world/startscriptcreator.cpp | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/opencs/view/world/infocreator.cpp b/apps/opencs/view/world/infocreator.cpp index d3bc29ab7f..f68c69094e 100644 --- a/apps/opencs/view/world/infocreator.cpp +++ b/apps/opencs/view/world/infocreator.cpp @@ -45,16 +45,20 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id, CSMWorld::IdCompletionManager& completionManager) : GenericCreator (data, undoStack, id) { - QLabel *label = new QLabel ("Topic", this); + // Determine if we're dealing with topics or journals. + CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic; + QString labelText = "Topic"; + if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos) + { + displayType = CSMWorld::ColumnBase::Display_Journal; + labelText = "Journal"; + } + + QLabel *label = new QLabel (labelText, this); insertBeforeButtons (label, false); // Add topic/journal ID input with auto-completion. // Only existing topic/journal IDs are accepted so no ID validation is performed. - CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic; - if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos) - { - displayType = CSMWorld::ColumnBase::Display_Journal; - } mTopic = new CSVWidget::DropLineEdit(displayType, this); mTopic->setCompleter(completionManager.getCompleter(displayType).get()); insertBeforeButtons (mTopic, true); diff --git a/apps/opencs/view/world/pathgridcreator.cpp b/apps/opencs/view/world/pathgridcreator.cpp index 26523f0c38..95628a5d96 100644 --- a/apps/opencs/view/world/pathgridcreator.cpp +++ b/apps/opencs/view/world/pathgridcreator.cpp @@ -32,7 +32,7 @@ CSVWorld::PathgridCreator::PathgridCreator( { setManualEditing(false); - QLabel *label = new QLabel("Cell ID", this); + QLabel *label = new QLabel("Cell", this); insertBeforeButtons(label, false); // Add cell ID input with auto-completion. diff --git a/apps/opencs/view/world/startscriptcreator.cpp b/apps/opencs/view/world/startscriptcreator.cpp index 00c4852240..0eb6bae40e 100644 --- a/apps/opencs/view/world/startscriptcreator.cpp +++ b/apps/opencs/view/world/startscriptcreator.cpp @@ -34,7 +34,7 @@ CSVWorld::StartScriptCreator::StartScriptCreator( setManualEditing(false); // Add script ID input label. - QLabel *label = new QLabel("Script ID", this); + QLabel *label = new QLabel("Script", this); insertBeforeButtons(label, false); // Add script ID input with auto-completion.