From af009e03a01c025aea5dda7faa6c2c0adbdb4a92 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 2 Jul 2022 11:34:43 +0200 Subject: [PATCH] BugFix New source pannel Clear status of new source pannel when changing type of input. --- UserInterfaceManager.cpp | 22 +++++++++++++++------- UserInterfaceManager.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index bc107d0..ed9b419 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -93,6 +93,7 @@ using namespace std; #include "ImageProcessingShader.h" #include "Metronome.h" #include "VideoBroadcast.h" +#include "MultiFileRecorder.h" #include "TextEditor.h" TextEditor _editor; @@ -5805,6 +5806,17 @@ void Navigator::applyButtonSelection(int index) show_config_ = false; } +void Navigator::clearNewPannel() +{ + new_source_preview_.setSource(); + pattern_type = -1; + custom_pipeline = false; + custom_connected = false; + sourceSequenceFiles.clear(); + sourceMediaFileCurrent.clear(); + new_media_mode_changed = true; +} + void Navigator::clearButtonSelection() { // clear all buttons @@ -5812,12 +5824,7 @@ void Navigator::clearButtonSelection() selected_button[i] = false; // clear new source pannel - new_source_preview_.setSource(); - pattern_type = -1; - custom_pipeline = false; - sourceSequenceFiles.clear(); - sourceMediaFileCurrent.clear(); - new_media_mode_changed = true; + clearNewPannel(); } void Navigator::showPannelSource(int index) @@ -6219,7 +6226,7 @@ void Navigator::RenderNewPannel() }; ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); if (ImGui::Combo("##Origin", &Settings::application.source.new_type, origin_names, IM_ARRAYSIZE(origin_names)) ) - new_source_preview_.setSource(); + clearNewPannel(); ImGui::SetCursorPosY(2.f * width_); @@ -6419,6 +6426,7 @@ void Navigator::RenderNewPannel() bool update_new_source = false; static DialogToolkit::MultipleImagesDialog _selectImagesDialog("Select Images"); + //static bool _create_video_sequence = false; // clic button to load file if ( ImGui::Button( ICON_FA_IMAGES " Open images", ImVec2(ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN, 0)) ) { diff --git a/UserInterfaceManager.h b/UserInterfaceManager.h index b9b2e05..1e77278 100644 --- a/UserInterfaceManager.h +++ b/UserInterfaceManager.h @@ -160,6 +160,7 @@ class Navigator bool custom_pipeline; bool custom_connected; void clearButtonSelection(); + void clearNewPannel(); void applyButtonSelection(int index); // side pannels