From af5b1b30838ea4a931ff9b515a3a34c4d8065617 Mon Sep 17 00:00:00 2001 From: Max Henzerling Date: Tue, 26 Apr 2022 18:31:27 -0700 Subject: [PATCH 1/3] Add option to open record editting subviews in new windows instead of exclusive docking. --- apps/opencs/model/prefs/state.cpp | 3 +++ apps/opencs/view/doc/view.cpp | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index 97039df2eb..0acd8680c8 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -93,6 +93,9 @@ void CSMPrefs::State::declare() "If this option is enabled, types of affected records are selected " "manually before a command execution.\nOtherwise, all associated " "records are deleted/reverted immediately."); + declareBool ("subview-new-window", "Open Record in new window", false) + .setTooltip("When editing a record, open the view in a new window," + " rather than docked in the main view."); declareCategory ("ID Dialogues"); declareBool ("toolbar", "Show toolbar", true); diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index c89437d70d..20e71d057d 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -25,6 +25,8 @@ #include "../world/subviews.hpp" #include "../world/scenesubview.hpp" #include "../world/tablesubview.hpp" +#include "../world/dialoguesubview.hpp" +#include "../world/scriptsubview.hpp" #include "../tools/subviews.hpp" @@ -609,7 +611,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin view = mSubViewFactory.makeSubView (id, *mDocument); } assert(view); - view->setParent(this); + view->setParent(this); // unfloats view view->setEditLock (mDocument->getState() & CSMDoc::State_Locked); mSubViews.append(view); // only after assert @@ -661,6 +663,21 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin this, SLOT(onRequestFocus(const std::string&))); } + if (CSMPrefs::State::get()["ID Tables"]["subview-new-window"].isTrue()) + { + CSVWorld::DialogueSubView* dialogueView = dynamic_cast(view); + if (dialogueView) + { + dialogueView->setFloating(true); + } + + CSVWorld::ScriptSubView* scriptView = dynamic_cast(view); + if (scriptView) + { + scriptView->setFloating(true); + } + } + view->show(); if (!hint.empty()) From 41be5a17f4d262f5e626a65238e0595e2abcefef Mon Sep 17 00:00:00 2001 From: Max Henzerling Date: Thu, 28 Apr 2022 10:52:02 -0700 Subject: [PATCH 2/3] comments from PR --- apps/opencs/view/doc/view.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 20e71d057d..1fea81ce97 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -611,7 +611,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin view = mSubViewFactory.makeSubView (id, *mDocument); } assert(view); - view->setParent(this); // unfloats view + view->setParent(this); view->setEditLock (mDocument->getState() & CSMDoc::State_Locked); mSubViews.append(view); // only after assert @@ -667,15 +667,11 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin { CSVWorld::DialogueSubView* dialogueView = dynamic_cast(view); if (dialogueView) - { dialogueView->setFloating(true); - } CSVWorld::ScriptSubView* scriptView = dynamic_cast(view); if (scriptView) - { scriptView->setFloating(true); - } } view->show(); From 2771fa1bb49fb7749a0f8594a40e87025c11d851 Mon Sep 17 00:00:00 2001 From: Max Henzerling Date: Thu, 28 Apr 2022 13:11:35 -0700 Subject: [PATCH 3/3] create and add issue to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b388f0c18c..29a199808d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,6 +156,7 @@ Feature #6684: Support NiFltAnimationNode Feature #6699: Ignored flag Feature #6706: Save the size of the Options window + Feature #6721: [OpenMW-CS] Add option to open records in new window Task #6201: Remove the "Note: No relevant classes found. No output generated" warnings Task #6264: Remove the old classes in animation.cpp Task #6553: Simplify interpreter instruction registration