Polyphase Game Engine
Loading...
Searching...
No Matches
GitRemoteEditDialog.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <string>
6#include <vector>
7#include <cstdint>
8
9struct SshHostEntry
10{
11 std::string mHost;
12 std::string mHostName;
13 std::string mUser;
14};
15
16class GitRemoteEditDialog
17{
18public:
19 enum class Mode
20 {
21 Add,
22 Edit
23 };
24
25 void Open();
26 void SetMode(Mode mode);
27 void SetMode(Mode mode, const std::string& name, const std::string& url);
28 void Draw();
29
30private:
31 void ParseSshConfig();
32 void RebuildUrlFromSshHost();
33
34 bool mIsOpen = false;
35 bool mJustOpened = false;
36
37 Mode mMode = Mode::Add;
38
39 char mRemoteName[128] = {0};
40 char mRemoteUrl[512] = {0};
41
42 // SSH host selection
43 std::vector<SshHostEntry> mSshHosts;
44 bool mSshConfigParsed = false;
45 int32_t mSelectedSshHost = -1; // -1 = custom / HTTPS
46 char mSshRepoPath[256] = {0}; // e.g. "polyphase-engine/tilemaptest00101.git"
47
48 std::string mOriginalName;
49};
50
51GitRemoteEditDialog* GetGitRemoteEditDialog();
52
53#endif