diff --git a/Makefile b/Makefile index fb5e1c2..b914584 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ BUILD_DIR := build SRC_DIR := . +PROJECT_VERS := $(shell "$(SRC_DIR)/util/version.sh" --long) + CMAKE := cmake -CMAKEFLAGS = -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +CMAKEFLAGS = -DTEXEDIT_VERSION="$(PROJECT_VERS)" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CARGO := cargo CARGOCHAN := +nightly diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index cbed576..3baffe1 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -22,6 +22,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") endif() endif() +option(TEXEDIT_VERSION "TexEdit project version inform" v0.0.0) + set(TARGET_NAME "${PROJECT_NAME}") set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/../deps/") @@ -45,3 +47,4 @@ target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_LIST_DIR}") target_link_libraries(${TARGET_NAME} cutils ${wxWidgets_LIBRARIES}) +target_compile_definitions(${TARGET_NAME} PRIVATE TEXEDIT_VERSION="${TEXEDIT_VERSION}") diff --git a/frontend/gui/main_frame.cpp b/frontend/gui/main_frame.cpp index 64d2483..8fe75a5 100644 --- a/frontend/gui/main_frame.cpp +++ b/frontend/gui/main_frame.cpp @@ -12,6 +12,7 @@ #include "command_ids.hpp" #include "editor_panel.hpp" +#include #include namespace te { @@ -55,6 +56,8 @@ namespace te { helpMenu->Append(cmds::Menu_URLSourcePage, "Git &Repository"); helpMenu->Append(cmds::Menu_URLFeatureRequest, "&Feature Requests"); helpMenu->Append(cmds::Menu_URLBugReport, "&Bug Reports"); + helpMenu->AppendSeparator(); + helpMenu->Append(wxID_ABOUT, "&About TexEdit"); menuBar->Append(helpMenu, "&Help"); SetMenuBar(menuBar); @@ -66,6 +69,17 @@ 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/"); + + wxAboutBox(aboutInfo); + } + void MainFrame::OnMenuQuit(wxCommandEvent &event) { Close(true); } @@ -88,6 +102,7 @@ namespace te { wxBEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(wxID_EXIT, MainFrame::OnMenuQuit) + EVT_MENU(wxID_ABOUT, MainFrame::OnMenuAbout) EVT_MENU(cmds::Menu_URLSourcePage, MainFrame::OnMenuURLSourcePage) EVT_MENU(cmds::Menu_URLFeatureRequest, MainFrame::OnMenuURLFeatureRequest) EVT_MENU(cmds::Menu_URLBugReport, MainFrame::OnMenuURLBugReport) diff --git a/frontend/gui/main_frame.hpp b/frontend/gui/main_frame.hpp index 87e9fe2..2a5997d 100644 --- a/frontend/gui/main_frame.hpp +++ b/frontend/gui/main_frame.hpp @@ -22,6 +22,7 @@ namespace te { void ShowURL(const std::string &url); + void OnMenuAbout(wxCommandEvent &event); void OnMenuQuit(wxCommandEvent &event); void OnMenuURLSourcePage(wxCommandEvent &event); void OnMenuURLFeatureRequest(wxCommandEvent &event);