Skip to content

Commit

Permalink
Add licence text to about dialogue
Browse files Browse the repository at this point in the history
  • Loading branch information
kosude committed Apr 15, 2024
1 parent 542e781 commit d708219
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/../deps/")
set(SRCS
"gui/editor_panel.cpp"
"gui/main_frame.cpp"
"gui/prog_info.cpp"
"util/log.cpp"
"main.cpp"
)
Expand Down
9 changes: 2 additions & 7 deletions frontend/gui/main_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "util/except.hpp"
#include "command_ids.hpp"
#include "editor_panel.hpp"
#include "prog_info.hpp"

#include <wx/aboutdlg.h>
#include <wx/splitter.h>
Expand Down Expand Up @@ -70,13 +71,7 @@ namespace te {
}

void MainFrame::OnMenuAbout(wxCommandEvent &event) {
wxAboutDialogInfo aboutInfo{};
aboutInfo.SetName("TexEdit");
aboutInfo.SetVersion(TEXEDIT_VERSION);
aboutInfo.SetDescription("Integrated viewer, compiler and editor for TeX documents");
aboutInfo.SetCopyright("(c) 2024 Jack Bennett");
aboutInfo.SetWebSite("https://kosude.github.io/texedit/");

wxAboutDialogInfo aboutInfo = ProgInfo::GenerateAboutDialogInfo();
wxAboutBox(aboutInfo);
}

Expand Down
22 changes: 22 additions & 0 deletions frontend/gui/prog_info.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024 Jack Bennett.
* All Rights Reserved.
*
* See the LICENCE file for more information.
*/

#include "prog_info.hpp"

namespace te {
wxAboutDialogInfo ProgInfo::GenerateAboutDialogInfo() {
wxAboutDialogInfo info;
info.SetName(name);
info.SetVersion(version);
info.SetDescription(description);
info.SetCopyright(copyright);
info.SetWebSite(website);
info.SetLicence(licence);

return info;
}
}
49 changes: 49 additions & 0 deletions frontend/gui/prog_info.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2024 Jack Bennett.
* All Rights Reserved.
*
* See the LICENCE file for more information.
*/

#pragma once
#ifndef __texedit__about_dialogue_hpp__
#define __texedit__about_dialogue_hpp__

#include <wx/aboutdlg.h>

namespace te {
class ProgInfo {
public:
static constexpr const char *name = "TexEdit";
static constexpr const char *version = TEXEDIT_VERSION;
static constexpr const char *description = "Integrated viewer, compiler and editor for TeX documents";
static constexpr const char *copyright = "(c) 2024 Jack Bennett";
static constexpr const char *website = "https://kosude.github.io/texedit/";
static constexpr const char *licence =
"MIT License\n"
"\n"
"Copyright (c) 2024 Jack Bennett\n"
"\n"
"Permission is hereby granted, free of charge, to any person obtaining a copy "
"of this software and associated documentation files (the \"Software\"), to deal "
"in the Software without restriction, including without limitation the rights "
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell "
"copies of the Software, and to permit persons to whom the Software is "
"furnished to do so, subject to the following conditions:\n"
"\n"
"The above copyright notice and this permission notice shall be included in all "
"copies or substantial portions of the Software.\n"
"\n"
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR "
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, "
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE "
"SOFTWARE.";

static wxAboutDialogInfo GenerateAboutDialogInfo();
};
}

#endif

0 comments on commit d708219

Please sign in to comment.