INSTINCT Code Coverage Report


Directory: src/
File: internal/gui/menus/FileMenu.cpp
Date: 2025-11-25 23:34:18
Exec Total Coverage
Lines: 0 25 0.0%
Functions: 0 1 0.0%
Branches: 0 18 0.0%

Line Branch Exec Source
1 // This file is part of INSTINCT, the INS Toolkit for Integrated
2 // Navigation Concepts and Training by the Institute of Navigation of
3 // the University of Stuttgart, Germany.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 #include "FileMenu.hpp"
10
11 #include <imgui.h>
12 #include <imgui_node_editor.h>
13
14 #include "internal/FlowManager.hpp"
15
16 #include <iostream>
17
18 ✗ void NAV::gui::menus::ShowFileMenu(GlobalActions& globalAction)
19 {
20 ✗ if (ImGui::MenuItem("New Flow", "Ctrl+N"))
21 {
22 ✗ if (flow::HasUnsavedChanges())
23 {
24 ✗ globalAction = GlobalActions::Clear;
25 }
26 else
27 {
28 ✗ flow::DeleteAllNodes();
29 ✗ flow::DiscardChanges();
30 ✗ flow::SetCurrentFilename("");
31 }
32 }
33 ✗ if (ImGui::MenuItem("Open Flow", "Ctrl+O"))
34 {
35 ✗ globalAction = GlobalActions::Load;
36 }
37 ✗ if (ImGui::BeginMenu("Open Recent", false))
38 {
39 ✗ ImGui::MenuItem("fish_hat.c");
40 ✗ ImGui::MenuItem("fish_hat.inl");
41 ✗ ImGui::MenuItem("fish_hat.h");
42 ✗ ImGui::MenuItem("fish_hat.h");
43 // ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
44 ✗ ImGui::Separator();
45 ✗ ImGui::MenuItem("More...");
46 ✗ ImGui::EndMenu();
47 }
48 ✗ if (ImGui::MenuItem("Save", "Ctrl+S"))
49 {
50 ✗ flow::SaveFlow(globalAction);
51 }
52 ✗ if (ImGui::MenuItem("Save As..", "Ctrl+Shift+S"))
53 {
54 ✗ globalAction = GlobalActions::SaveAs;
55 }
56
57 ✗ ImGui::Separator();
58
59 ✗ if (ImGui::MenuItem("Quit", "Ctrl+Q"))
60 {
61 ✗ globalAction = GlobalActions::Quit;
62 }
63 ✗ }
64