| 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 |