summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/Studio')
-rw-r--r--src/Authoring/Studio/Application/StudioApp.cpp58
-rw-r--r--src/Authoring/Studio/Application/StudioApp.h2
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp18
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.h2
4 files changed, 36 insertions, 44 deletions
diff --git a/src/Authoring/Studio/Application/StudioApp.cpp b/src/Authoring/Studio/Application/StudioApp.cpp
index 48cd758c..f7dc7b42 100644
--- a/src/Authoring/Studio/Application/StudioApp.cpp
+++ b/src/Authoring/Studio/Application/StudioApp.cpp
@@ -2011,32 +2011,38 @@ void CStudioApp::OnUndefinedDatainputsFail(
void CStudioApp::toggleEyeball()
{
- CDoc *theDoc = m_core->GetDoc();
- qt3dsdm::IPropertySystem *propertySystem = theDoc->GetStudioSystem()->GetPropertySystem();
- qt3dsdm::TInstanceHandleList selectedInstances
- = theDoc->GetSelectedValue().GetSelectedInstances();
-
- if (selectedInstances.size() > 0) {
- Q3DStudio::ScopedDocumentEditor editor(*theDoc,
- L"Visibility Toggle",
- __FILE__, __LINE__);
- bool boolValue = false;
- SValue value;
- for (size_t idx = 0, end = selectedInstances.size(); idx < end; ++idx) {
- qt3dsdm::Qt3DSDMInstanceHandle handle(selectedInstances[idx]);
-
- if (handle.Valid()) {
- qt3dsdm::Qt3DSDMPropertyHandle property
- = theDoc->GetStudioSystem()->GetClientDataModelBridge()
- ->GetSceneAsset().m_Eyeball;
- if (value.empty()) {
- // First valid handle selects if all are hidden/unhidden
- propertySystem->GetInstancePropertyValue(handle, property, value);
- boolValue = !qt3dsdm::get<bool>(value);
- }
- editor->SetInstancePropertyValue(handle, property, boolValue);
- }
- }
+ CDoc *doc = m_core->GetDoc();
+ if (doc->getSelectedInstancesCount() > 0) {
+ qt3dsdm::Qt3DSDMPropertyHandle property
+ = doc->GetStudioSystem()->GetClientDataModelBridge()->GetSceneAsset().m_Eyeball;
+ SCOPED_DOCUMENT_EDITOR(*doc, tr("Visibility Toggle"))
+ ->toggleBoolPropertyOnSelected(property);
+ }
+}
+
+void CStudioApp::toggleShy()
+{
+ CDoc *doc = m_core->GetDoc();
+ if (doc->getSelectedInstancesCount() > 0) {
+ qt3dsdm::Qt3DSDMPropertyHandle property
+ = doc->GetStudioSystem()->GetClientDataModelBridge()->GetSceneAsset().m_Shy;
+ SCOPED_DOCUMENT_EDITOR(*doc, tr("Shy Toggle"))
+ ->toggleBoolPropertyOnSelected(property);
+ }
+}
+
+void CStudioApp::toggleLocked()
+{
+ CDoc *doc = m_core->GetDoc();
+ if (doc->getSelectedInstancesCount() > 0) {
+ qt3dsdm::Qt3DSDMPropertyHandle property
+ = doc->GetStudioSystem()->GetClientDataModelBridge()->GetSceneAsset().m_Locked;
+ SCOPED_DOCUMENT_EDITOR(*doc, tr("Locked Toggle"))
+ ->toggleBoolPropertyOnSelected(property);
+
+ // Since you are not supposed to be able to select locked objects,
+ // we just assume anything toggled was actually locked and deselect everything
+ doc->DeselectAllItems();
}
}
diff --git a/src/Authoring/Studio/Application/StudioApp.h b/src/Authoring/Studio/Application/StudioApp.h
index a852aaee..c4b10ca9 100644
--- a/src/Authoring/Studio/Application/StudioApp.h
+++ b/src/Authoring/Studio/Application/StudioApp.h
@@ -214,6 +214,8 @@ public:
void SetAutosaveEnabled(bool enabled);
void SetAutosaveInterval(int interval);
void toggleEyeball();
+ void toggleShy();
+ void toggleLocked();
void showPresentationIdUniqueWarning();
void showInvalidFilenameWarning();
void checkDeletedDatainputs();
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
index 506d2484..1d58fd9c 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
@@ -325,13 +325,13 @@ TimelineGraphicsScene::TimelineGraphicsScene(TimelineWidget *timelineWidget)
action = new QAction(this);
action->setShortcut(QKeySequence(Qt::ShiftModifier | Qt::Key_H));
action->setShortcutContext(Qt::ApplicationShortcut);
- connect(action, &QAction::triggered, this, &TimelineGraphicsScene::handleShySelected);
+ connect(action, &QAction::triggered, &g_StudioApp, &CStudioApp::toggleShy);
timelineWidget->addAction(action);
action = new QAction(this);
action->setShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_H));
action->setShortcutContext(Qt::ApplicationShortcut);
- connect(action, &QAction::triggered, this, &TimelineGraphicsScene::handleLockSelected);
+ connect(action, &QAction::triggered, &g_StudioApp, &CStudioApp::toggleLocked);
timelineWidget->addAction(action);
}
@@ -1041,20 +1041,6 @@ void TimelineGraphicsScene::handleEditComponent()
}
}
-void TimelineGraphicsScene::handleShySelected()
-{
- RowTree *selectedRow = m_rowManager->selectedRow();
- if (selectedRow)
- selectedRow->toggleShy();
-}
-
-void TimelineGraphicsScene::handleLockSelected()
-{
- RowTree *selectedRow = m_rowManager->selectedRow();
- if (selectedRow)
- selectedRow->toggleLocked();
-}
-
void TimelineGraphicsScene::handleApplicationFocusLoss()
{
// Hide the timebar tooltip if application loses focus
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.h
index e452c12b..bf02d3bb 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.h
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.h
@@ -116,8 +116,6 @@ private:
void handleMakeComponent();
void handleCopyObjectPath();
void handleEditComponent();
- void handleShySelected();
- void handleLockSelected();
void handleApplicationFocusLoss();
QGraphicsLinearLayout *m_layoutRoot;