mirror of
https://github.com/mtheall/ftpd.git
synced 2024-11-23 01:29:51 +00:00
Add "Quit" menu option
This commit is contained in:
parent
afe0d4b1f2
commit
4a8925fef3
@ -3,7 +3,7 @@
|
||||
// - RFC 3659 (https://tools.ietf.org/html/rfc3659)
|
||||
// - suggested implementation details from https://cr.yp.to/ftp/filesystem.html
|
||||
//
|
||||
// Copyright (C) 2023 Michael Theall
|
||||
// Copyright (C) 2024 Michael Theall
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -48,6 +48,9 @@ public:
|
||||
/// \brief Draw server and all of its sessions
|
||||
void draw ();
|
||||
|
||||
/// \brief Whether server wants to quit
|
||||
bool quit ();
|
||||
|
||||
/// \brief Create server
|
||||
static UniqueFtpServer create ();
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
// - RFC 3659 (https://tools.ietf.org/html/rfc3659)
|
||||
// - suggested implementation details from https://cr.yp.to/ftp/filesystem.html
|
||||
//
|
||||
// Copyright (C) 2023 Michael Theall
|
||||
// Copyright (C) 2024 Michael Theall
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -322,6 +322,11 @@ void FtpServer::draw ()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FtpServer::quit ()
|
||||
{
|
||||
return m_quit;
|
||||
}
|
||||
|
||||
UniqueFtpServer FtpServer::create ()
|
||||
{
|
||||
updateFreeSpace ();
|
||||
@ -490,9 +495,16 @@ void FtpServer::showMenu ()
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Separator ();
|
||||
|
||||
if (ImGui::MenuItem ("About"))
|
||||
m_showAbout = true;
|
||||
|
||||
ImGui::Separator ();
|
||||
|
||||
if (ImGui::MenuItem ("Quit"))
|
||||
m_quit = true;
|
||||
|
||||
ImGui::EndMenu ();
|
||||
}
|
||||
ImGui::EndMenuBar ();
|
||||
@ -713,7 +725,7 @@ void FtpServer::showAbout ()
|
||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize))
|
||||
{
|
||||
ImGui::TextUnformatted (STATUS_STRING);
|
||||
ImGui::TextWrapped ("Copyright © 2023 Michael Theall, Dave Murphy, TuxSH");
|
||||
ImGui::TextWrapped ("Copyright © 2024 Michael Theall, Dave Murphy, TuxSH");
|
||||
ImGui::Separator ();
|
||||
ImGui::Text ("Platform: %s", io.BackendPlatformName);
|
||||
ImGui::Text ("Renderer: %s", io.BackendRendererName);
|
||||
|
@ -3,7 +3,7 @@
|
||||
// - RFC 3659 (https://tools.ietf.org/html/rfc3659)
|
||||
// - suggested implementation details from https://cr.yp.to/ftp/filesystem.html
|
||||
//
|
||||
// Copyright (C) 2023 Michael Theall
|
||||
// Copyright (C) 2024 Michael Theall
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -56,7 +56,7 @@ int main ()
|
||||
|
||||
auto server = FtpServer::create ();
|
||||
|
||||
while (platform::loop ())
|
||||
while (!server->quit () && platform::loop ())
|
||||
{
|
||||
server->draw ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user