Added support for custom version strings. See version.cpp.

Originally committed to SVN as r250.
This commit is contained in:
Niels Martin Hansen 2006-03-26 21:16:08 +00:00
parent 99c38fefb0
commit 233ac6ac94
6 changed files with 85 additions and 8 deletions

View file

@ -65,7 +65,7 @@ AboutScreen::AboutScreen(wxWindow *parent,bool easter)
wxString aboutString; wxString aboutString;
wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n"); wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n");
if (translatorCredit == _T("Translated into LANGUAGE by PERSON\n")) translatorCredit.Clear(); if (translatorCredit == _T("Translated into LANGUAGE by PERSON\n")) translatorCredit.Clear();
aboutString += wxString(_T("Aegisub ")) + VERSION_STRING + _(" by ArchMage ZeratuL.\n"); aboutString += wxString(_T("Aegisub ")) + GetAegisubVersionString() + _(" by ArchMage ZeratuL.\n");
aboutString += _("Copyright (c) 2005-2006 - Rodrigo Braz Monteiro.\n\n"); aboutString += _("Copyright (c) 2005-2006 - Rodrigo Braz Monteiro.\n\n");
aboutString += _("Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n"); aboutString += _("Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n");
aboutString += _("Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n"); aboutString += _("Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n");

View file

@ -129,7 +129,7 @@ void AssFile::Load (const wxString _filename,const wxString charset) {
loaded = true; loaded = true;
// Add comments and set vars // Add comments and set vars
AddComment(_T("Script generated by Aegisub ") + wxString(VERSION_STRING)); AddComment(_T("Script generated by Aegisub ") + GetAegisubVersionString());
AddComment(_T("http://www.aegisub.net")); AddComment(_T("http://www.aegisub.net"));
SetScriptInfo(_T("ScriptType"),_T("v4.00+")); SetScriptInfo(_T("ScriptType"),_T("v4.00+"));
AddToRecent(_filename); AddToRecent(_filename);

View file

@ -0,0 +1,27 @@
#!/usr/bin/env python
# This file is used to automatically extract the SVN revision number and
# create a C include file.
# In MSVS, you can add the following Pre-Build Step to use this script:
# cd $(InputDir)core\build
# c:\Python24\python.exe make-svn-rev-header.py
# This is intended for use with a custom version.cpp,
# as described in version.cpp
from xml.dom.minidom import parse
entries_file = parse('../.svn/entries')
def getRevision(entries):
for entry in entries:
if entry.getAttribute("name") == "":
return entry.getAttribute("revision")
revision = getRevision(entries_file.getElementsByTagName("entry"))
outfile = file("svn-revision.h", "w+")
outfile.write("// This file is automatically generated by make-svn-rev-header.py\n")
outfile.write("// Do not modify or add to revision control\n\n")
outfile.write("#define BUILD_SVN_REVISION " + revision + "\n")
outfile.close()

View file

@ -705,7 +705,7 @@ void FrameMain::UpdateTitle() {
newTitle << file.GetFullName(); newTitle << file.GetFullName();
} }
else newTitle << _T("Untitled"); else newTitle << _T("Untitled");
newTitle << _T(" - Aegisub ") << VERSION_STRING; newTitle << _T(" - Aegisub ") << GetAegisubVersionString();
// Get current title // Get current title
wxString curTitle = GetTitle(); wxString curTitle = GetTitle();

53
core/version.cpp Normal file
View file

@ -0,0 +1,53 @@
// Copyright (c) 2005, Rodrigo Braz Monteiro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// -----------------------------------------------------------------------------
//
// AEGISUB
//
// Website: http://aegisub.cellosoft.com
// Contact: mailto:zeratul@cellosoft.com
//
// A note about this file:
// You can exclude version.cpp from your build (but still include version.h),
// and instead provide your own, custom version.cpp file, call it eg.
// my_version.cpp. This way you can easily provide a custom build notice.
//
// If you often distribute SVN builds you are encouraged to label your builds
// in this manner.
#include <wx/string.h>
#include "version.h"
wxString GetAegisubVersionString() {
#ifdef _DEBUG
return T("v1.10 Beta (debug)");
#else
return _T("v1.10 Beta PRE-RELEASE");
#endif
}

View file

@ -33,9 +33,6 @@
// Contact: mailto:zeratul@cellosoft.com // Contact: mailto:zeratul@cellosoft.com
// //
class wxString;
#ifdef _DEBUG wxString GetAegisubVersionString();
#define VERSION_STRING _T("v1.10 Beta (debug)")
#else
#define VERSION_STRING _T("v1.10 Beta PRE-RELEASE")
#endif