write some version information inside the application
authorkoda
Sun, 05 Dec 2010 00:05:21 +0100
changeset 4460 bdace1e2f8aa
parent 4459 6de30ddc184e
child 4461 2f4f5d649bcd
write some version information inside the application
CMakeLists.txt
hedgewars/PascalExports.pas
project_files/HedgewarsMobile/Classes/AboutViewController.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
--- a/CMakeLists.txt	Sat Dec 04 23:30:20 2010 +0300
+++ b/CMakeLists.txt	Sun Dec 05 00:05:21 2010 +0100
@@ -20,7 +20,7 @@
 				     )
 			STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3:\\1" version_suffix ${version_suffix})
 			MESSAGE(STATUS "Building revision ${version_suffix}")
-			set(version_suffix ".${version_suffix}")
+			set(version_suffix "-${version_suffix}")
 		ENDIF()
 	ENDIF()
 ELSE()
--- a/hedgewars/PascalExports.pas	Sat Dec 04 23:30:20 2010 +0300
+++ b/hedgewars/PascalExports.pas	Sun Dec 05 00:05:21 2010 +0100
@@ -36,9 +36,8 @@
 // retrieve protocol information
 procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
 begin
-// http://bugs.freepascal.org/view.php?id=16156
-    if netProto <> nil then netProto^:= cNetProtoVersion;
-    if versionStr <> nil then versionStr^:= cVersionString;
+    netProto^:= cNetProtoVersion;
+    versionStr^:= cVersionString;
 end;
 
 procedure HW_click; cdecl; export;
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.m	Sat Dec 04 23:30:20 2010 +0300
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m	Sun Dec 05 00:05:21 2010 +0100
@@ -91,6 +91,37 @@
     // do nothing
 }
 
+-(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
+    return 95;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
+    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
+    char *fullver;
+    short int proto = 20;
+    HW_versionInfo(&proto, &fullver);
+
+    NSString *footerString = [[NSString alloc] initWithFormat:
+                              @"You are running Hedgewars-iOS %@ based on Hedgewars version %s (protocol %d)",
+                              version, fullver, proto];
+
+    UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 50)];
+    footer.backgroundColor = [UIColor clearColor];
+
+    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, 90)];
+    label.center = CGPointMake(self.tableView.frame.size.width/2, 45);
+    label.textAlignment = UITextAlignmentCenter;
+    label.font = [UIFont systemFontOfSize:16];
+    label.textColor = [UIColor lightGrayColor];
+    label.numberOfLines = 5;
+    label.text = footerString;
+
+    label.backgroundColor = [UIColor clearColor];
+    [footer addSubview:label];
+    [label release];
+    return [footer autorelease];
+}
+
 #pragma mark -
 #pragma mark Memory Management
 -(void) didReceiveMemoryWarning {
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sat Dec 04 23:30:20 2010 +0300
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Dec 05 00:05:21 2010 +0100
@@ -193,6 +193,7 @@
 		61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; };
 		61E2F7441283752C00E12521 /* fb.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E2F7421283752C00E12521 /* fb.png */; };
 		61E2F7451283752C00E12521 /* tw.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E2F7431283752C00E12521 /* tw.png */; };
+		61E5D68D12AB006F00566F29 /* uLandPainted.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E5D68C12AB006F00566F29 /* uLandPainted.pas */; };
 		61EBA62A11DFF2BC0048B68A /* title.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title.png */; };
 		61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920511DF57AC003441C4 /* arrowDown.png */; };
 		61EF920F11DF57AC003441C4 /* arrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920611DF57AC003441C4 /* arrowLeft.png */; };
@@ -971,6 +972,7 @@
 		61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; };
 		61E2F7421283752C00E12521 /* fb.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = fb.png; path = Resources/Icons/fb.png; sourceTree = "<group>"; };
 		61E2F7431283752C00E12521 /* tw.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = tw.png; path = Resources/Icons/tw.png; sourceTree = "<group>"; };
+		61E5D68C12AB006F00566F29 /* uLandPainted.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandPainted.pas; path = ../../hedgewars/uLandPainted.pas; sourceTree = SOURCE_ROOT; };
 		61EBA62811DFF2BC0048B68A /* title.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = title.png; path = Resources/Frontend/title.png; sourceTree = "<group>"; };
 		61EF920511DF57AC003441C4 /* arrowDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowDown.png; path = Resources/Overlay/arrowDown.png; sourceTree = "<group>"; };
 		61EF920611DF57AC003441C4 /* arrowLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowLeft.png; path = Resources/Overlay/arrowLeft.png; sourceTree = "<group>"; };
@@ -1496,6 +1498,7 @@
 		9283015C0F10E48900CC5A3C /* Pascal Sources */ = {
 			isa = PBXGroup;
 			children = (
+				61E5D68C12AB006F00566F29 /* uLandPainted.pas */,
 				61A4A3A112A5CD56004D81E6 /* uCaptions.pas */,
 				61A4A38912A5CCC2004D81E6 /* uCommandHandlers.pas */,
 				61A4A38A12A5CCC2004D81E6 /* uCommands.pas */,
@@ -2408,6 +2411,7 @@
 				61A4A39D12A5CCC2004D81E6 /* uUtils.pas in Sources */,
 				61A4A39E12A5CCC2004D81E6 /* uVariables.pas in Sources */,
 				61A4A3A212A5CD56004D81E6 /* uCaptions.pas in Sources */,
+				61E5D68D12AB006F00566F29 /* uLandPainted.pas in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};