Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.1 kB
3
Indexable
Never
QMap<QString, ToolElement> condition2tool = {
		{ "recordAudio", { QCoreApplication::translate("AddTrackButton.menu", "Record audio"), "AUDIO_RECORD_CLICKED", {}, [this] { emit voiceOverRequested(); } } },
		{ "videocapture", { QCoreApplication::translate("AddTrackButton.menu", "Record video"), "VIDEO_CAPTURE_CLICKED", "videocapture" } },
		{ "screencapture", { QCoreApplication::translate("AddTrackButton.menu", "Record screen"), "SCREEN_CAPTURE_CLICKED", "screencapture" } },
	};

	for (auto const & condition : Configuration::menuActionsIds)
	{
		assert(condition2tool.contains(condition) && "Unknown tool in EditPanel menu");
	}

	if (Configuration::menuActionsIds.contains("recordAudio"))
		addToolElement(m_ui->recordAudioAction, "recordAudio", condition2tool.value("recordAudio"));
	if (Configuration::menuActionsIds.contains("videocapture"))
		addToolElement(m_ui->videocaptureAction, "videocapture", condition2tool.value("videocapture"));
	if (Configuration::menuActionsIds.contains("screencapture"))
		addToolElement(m_ui->screencaptureAction, "screencapture", condition2tool.value("screencapture"));