Skip to content
Snippets Groups Projects
Commit 30942ff2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Include git branch/hash in sbbsctrl version info

And export a simple ver() function to be used in MainFormUnit.cpp (for mqtt stuff)
parent f4c01684
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
/* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */ /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
/* $Id: AboutBoxFormUnit.cpp,v 1.14 2020/04/15 05:27:14 rswindell Exp $ */
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...@@ -15,21 +13,9 @@ ...@@ -15,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or * * See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/gpl.html *
* * * *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
...@@ -47,6 +33,8 @@ ...@@ -47,6 +33,8 @@
#include "ftpsrvr.h" #include "ftpsrvr.h"
#include "websrvr.h" #include "websrvr.h"
#include "services.h" #include "services.h"
#include "git_branch.h"
#include "git_hash.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#pragma package(smart_init) #pragma package(smart_init)
...@@ -57,11 +45,9 @@ __fastcall TAboutBoxForm::TAboutBoxForm(TComponent* Owner) ...@@ -57,11 +45,9 @@ __fastcall TAboutBoxForm::TAboutBoxForm(TComponent* Owner)
: TForm(Owner) : TForm(Owner)
{ {
} }
//---------------------------------------------------------------------------
void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
{
Credits->Lines->Clear();
const char* ver(void)
{
DWORD i; DWORD i;
unsigned int len=GetFileVersionInfoSize( unsigned int len=GetFileVersionInfoSize(
Application->ExeName.c_str() // pointer to filename string Application->ExeName.c_str() // pointer to filename string
...@@ -69,8 +55,7 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender) ...@@ -69,8 +55,7 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
); );
BYTE* buf=(BYTE *)malloc(len); BYTE* buf=(BYTE *)malloc(len);
if(buf==NULL) { if(buf==NULL) {
Credits->Lines->Add("MALLOC ERROR!"); return "MALLOC ERROR!";
return;
} }
GetFileVersionInfo( GetFileVersionInfo(
Application->ExeName.c_str() // pointer to filename string Application->ExeName.c_str() // pointer to filename string
...@@ -94,9 +79,9 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender) ...@@ -94,9 +79,9 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
,__BORLANDC__>>8 ,__BORLANDC__>>8
,__BORLANDC__&0xff); ,__BORLANDC__&0xff);
char ver[256]; static char ver[256];
wsprintf(ver,"Synchronet Control Panel v%u.%u.%u.%u%s%s " wsprintf(ver,"Synchronet Control Panel v%u.%u.%u.%u%s%s "
"Compiled %s %s with %s" "Compiled %s/%s %s %s with %s"
,Ver->dwFileVersionMS>>16 ,Ver->dwFileVersionMS>>16
,Ver->dwFileVersionMS&0xffff ,Ver->dwFileVersionMS&0xffff
,Ver->dwFileVersionLS>>16 ,Ver->dwFileVersionLS>>16
...@@ -105,21 +90,31 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender) ...@@ -105,21 +90,31 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
" Debug" : "" " Debug" : ""
,Ver->dwFileFlags&VS_FF_PRERELEASE ? ,Ver->dwFileFlags&VS_FF_PRERELEASE ?
" Pre-release" : "" " Pre-release" : ""
,GIT_BRANCH, GIT_HASH
,__DATE__, __TIME__, compiler ,__DATE__, __TIME__, compiler
); );
return ver;
}
//---------------------------------------------------------------------------
void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
{
Credits->Lines->Clear();
Credits->Lines->Add(bbs_ver()); Credits->Lines->Add(bbs_ver());
Credits->Lines->Add(mail_ver()); Credits->Lines->Add(mail_ver());
Credits->Lines->Add(ftp_ver()); Credits->Lines->Add(ftp_ver());
Credits->Lines->Add(web_ver()); Credits->Lines->Add(web_ver());
Credits->Lines->Add(services_ver()); Credits->Lines->Add(services_ver());
Credits->Lines->Add(ver); Credits->Lines->Add(ver());
Credits->Lines->Add("Synchronet Local Spy ANSI Terminal Emulation" Credits->Lines->Add("Synchronet Local Spy ANSI Terminal Emulation"
+ CopyRight); + CopyRight);
Credits->Lines->Add(AnsiString(js_ver()) Credits->Lines->Add(AnsiString(js_ver())
+ " (c) 1998 Netscape Communications Corp."); + " (c) 1998 Netscape Communications Corp.");
#ifdef USE_CRYPTLIB #ifdef USE_CRYPTLIB
char ver[256];
wsprintf(ver,"Cryptlib v%u.%u.%u" wsprintf(ver,"Cryptlib v%u.%u.%u"
,(CRYPTLIB_VERSION/100) ,(CRYPTLIB_VERSION/100)
,(CRYPTLIB_VERSION/10)%10 ,(CRYPTLIB_VERSION/10)%10
......
/* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */ /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
/* $Id: AboutBoxFormUnit.h,v 1.6 2018/07/24 01:11:28 rswindell Exp $ */
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...@@ -15,21 +13,9 @@ ...@@ -15,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or * * See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/gpl.html *
* * * *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -43,6 +29,7 @@ ...@@ -43,6 +29,7 @@
#include <ExtCtrls.hpp> #include <ExtCtrls.hpp>
#include <Graphics.hpp> #include <Graphics.hpp>
#include "MainFormUnit.h" #include "MainFormUnit.h"
const char* ver(void);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class TAboutBoxForm : public TForm class TAboutBoxForm : public TForm
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment