[Unison-hackers] [unison-svn] r481 - in trunk/src: . uimacnew09 uimacnew09/uimacnew.xcodeproj

schmitta at seas.upenn.edu schmitta at seas.upenn.edu
Sat Jan 21 14:13:42 EST 2012


Author: schmitta
Date: 2012-01-21 14:13:41 -0500 (Sat, 21 Jan 2012)
New Revision: 481

Modified:
   trunk/src/RECENTNEWS
   trunk/src/mkProjectInfo.ml
   trunk/src/uimacbridgenew.ml
   trunk/src/uimacnew09/MyController.h
   trunk/src/uimacnew09/MyController.m
   trunk/src/uimacnew09/UnisonToolbar.m
   trunk/src/uimacnew09/uimacnew.xcodeproj/project.pbxproj
Log:
- OS X GUI: fix crash under Lion, because of problems with the toolbar, using
  the fix suggested in http://blitzbasic.com/Community/posts.php?topic=95778.

- OS X GUI: show a modal warning window if there is no archive for the hosts.
  The user can then choose to exit or proceed (proceed is the default). The
  window is not shown if "batch" is true.


Modified: trunk/src/RECENTNEWS
===================================================================
--- trunk/src/RECENTNEWS	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/RECENTNEWS	2012-01-21 19:13:41 UTC (rev 481)
@@ -1,3 +1,13 @@
+CHANGES FROM VERSION 2.44.9
+
+- OS X GUI: fix crash under Lion, because of problems with the toolbar, using
+  the fix suggested in http://blitzbasic.com/Community/posts.php?topic=95778.
+
+- OS X GUI: show a modal warning window if there is no archive for the hosts.
+  The user can then choose to exit or proceed (proceed is the default). The
+  window is not shown if "batch" is true.
+
+-------------------------------
 CHANGES FROM VERSION 2.44.8
 
 * Change uimacnew09 icon to classic "U with arrows"

Modified: trunk/src/mkProjectInfo.ml
===================================================================
--- trunk/src/mkProjectInfo.ml	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/mkProjectInfo.ml	2012-01-21 19:13:41 UTC (rev 481)
@@ -61,3 +61,4 @@
 
 
 
+

Modified: trunk/src/uimacbridgenew.ml
===================================================================
--- trunk/src/uimacbridgenew.ml	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/uimacbridgenew.ml	2012-01-21 19:13:41 UTC (rev 481)
@@ -82,7 +82,22 @@
 let fatalError message =
   Trace.log (message ^ "\n");
   displayFatalError message
+    
+(* Defined in MyController.m; display the warning and ask whether to
+   exit or proceed *)
+external displayWarnPanel : string -> bool = "warnPanel";;
 
+let setWarnPrinter() =
+  Util.warnPrinter :=
+    Some(fun s ->
+      Trace.log ("Warning: " ^ s ^ "\n");
+      if not (Prefs.read Globals.batch) then begin
+	if (displayWarnPanel s) then begin
+          Lwt_unix.run (Update.unlockArchives ());
+          exit Uicommon.fatalExit
+	end
+      end)
+
 let doInOtherThread f =
   Thread.create
     (fun () ->
@@ -316,6 +331,9 @@
        Printf.eprintf "\n"
     );
 
+  (* Install the warning panel, hopefully it's not too late *)
+  setWarnPrinter();
+  
   Lwt_unix.run
     (Uicommon.validateAndFixupPrefs () >>=
      Globals.propagatePrefs);

Modified: trunk/src/uimacnew09/MyController.h
===================================================================
--- trunk/src/uimacnew09/MyController.h	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/uimacnew09/MyController.h	2012-01-21 19:13:41 UTC (rev 481)
@@ -81,6 +81,8 @@
   NSTimer *_timer;
   NSAlert *_timeoutAlert;
   NSUInteger _secondsRemaining;
+    
+  BOOL shouldExitAfterWarning;
 }
 
 - (id)init;

Modified: trunk/src/uimacnew09/MyController.m
===================================================================
--- trunk/src/uimacnew09/MyController.m	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/uimacnew09/MyController.m	2012-01-21 19:13:41 UTC (rev 481)
@@ -307,7 +307,7 @@
 
 - (void)updateToolbar
 {
-    [toolbar validateVisibleItems];	
+  [toolbar validateVisibleItems];	
 	[tableModeSelector setEnabled:((syncable && !duringSync) || afterSync)];
 
 	// Why?
@@ -1175,6 +1175,31 @@
         exit(1);
 }
 
+/* Returns true if we need to exit, false if we proceed */
+
+CAMLprim value warnPanel(value s)
+{
+	NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)];
+    
+  [me performSelectorOnMainThread:@selector(warnPanel:) withObject:str waitUntilDone:TRUE];
+	[str release];
+  if (me -> shouldExitAfterWarning) {
+    return Val_true;
+  } else {
+    return Val_false;
+  }
+}
+
+- (void)warnPanel:(NSString *)msg {
+  int warnVal = NSRunAlertPanel(@"Warning", msg, @"Proceed", @"Exit", nil);
+  NSLog(@"Warning Panel Returned %d",warnVal);
+  if (warnVal == NSAlertAlternateReturn) {
+    shouldExitAfterWarning = YES;
+  } else {
+    shouldExitAfterWarning = FALSE;
+  }
+}
+
 @end
 
 @implementation NSString (_UnisonUtil)

Modified: trunk/src/uimacnew09/UnisonToolbar.m
===================================================================
--- trunk/src/uimacnew09/UnisonToolbar.m	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/uimacnew09/UnisonToolbar.m	2012-01-21 19:13:41 UTC (rev 481)
@@ -153,12 +153,13 @@
 	else if ([whichView isEqual: @"updatesView"]) {
 		return [NSArray arrayWithObjects:   QuitItemIdentifier,
 			RestartItemIdentifier, 
-			NSToolbarSeparatorItemIdentifier,
+			NSToolbarSpaceItemIdentifier,
 			GoItemIdentifier,
 			RescanItemIdentifier,
-			NSToolbarSeparatorItemIdentifier,
+			NSToolbarSpaceItemIdentifier,
 			RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, 
-			SkipItemIdentifier, NSToolbarSeparatorItemIdentifier,
+			SkipItemIdentifier,
+      NSToolbarSpaceItemIdentifier,
 			DiffItemIdentifier, 
 			TableModeIdentifier, nil];
 	}
@@ -177,14 +178,14 @@
 	    GoItemIdentifier, RestartItemIdentifier, RescanItemIdentifier,
 	    RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, 
 	    SkipItemIdentifier, DiffItemIdentifier,
-	    NSToolbarSeparatorItemIdentifier, nil];
+	    NSToolbarSpaceItemIdentifier, nil];
 }
 
 - (void) setView: (NSString *) whichView {
 	if ([whichView isEqual:currentView]) return;
 
 	currentView = whichView;
-
+  
 	int i;
 	NSArray *identifiers;
 	NSString *oldIdentifier;

Modified: trunk/src/uimacnew09/uimacnew.xcodeproj/project.pbxproj
===================================================================
--- trunk/src/uimacnew09/uimacnew.xcodeproj/project.pbxproj	2011-11-28 00:35:54 UTC (rev 480)
+++ trunk/src/uimacnew09/uimacnew.xcodeproj/project.pbxproj	2012-01-21 19:13:41 UTC (rev 481)
@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 45;
+	objectVersion = 46;
 	objects = {
 
 /* Begin PBXAggregateTarget section */
@@ -398,8 +398,11 @@
 /* Begin PBXProject section */
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
 			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0410;
+			};
 			buildConfigurationList = 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */;
-			compatibilityVersion = "Xcode 3.1";
+			compatibilityVersion = "Xcode 3.2";
 			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
@@ -567,7 +570,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				PRODUCT_NAME = "Create ExternalSettings";
 				ZERO_LINK = NO;
 			};
@@ -593,7 +595,6 @@
 				);
 				FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/Frameworks\"";
 				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -611,7 +612,6 @@
 					"-lbigarray",
 					"-lasmrun",
 				);
-				PREBINDING = NO;
 				PRODUCT_NAME = Unison;
 				SECTORDER_FLAGS = "";
 				WARNING_CFLAGS = (
@@ -636,7 +636,6 @@
 					"\"$(SRCROOT)/Frameworks\"",
 				);
 				FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/Frameworks\"";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -652,7 +651,6 @@
 					"-lbigarray",
 					"-lasmrun",
 				);
-				PREBINDING = NO;
 				PRODUCT_NAME = Unison;
 				SECTORDER_FLAGS = "";
 				WARNING_CFLAGS = (
@@ -690,7 +688,6 @@
 					"-lbigarray",
 					"-lasmrun",
 				);
-				PREBINDING = NO;
 				PRODUCT_NAME = Unison;
 				SECTORDER_FLAGS = "";
 				WARNING_CFLAGS = (
@@ -709,7 +706,7 @@
 			buildSettings = {
 				FRAMEWORK_SEARCH_PATHS = "Frameworks/**";
 				LIBRARY_SEARCH_PATHS = "";
-				SDKROOT = macosx10.5;
+				SDKROOT = macosx;
 				USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR;
 			};
 			name = Development;
@@ -720,7 +717,7 @@
 			buildSettings = {
 				FRAMEWORK_SEARCH_PATHS = "Frameworks/**";
 				LIBRARY_SEARCH_PATHS = "";
-				SDKROOT = macosx10.5;
+				SDKROOT = macosx;
 				USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR;
 			};
 			name = Deployment;
@@ -731,7 +728,7 @@
 			buildSettings = {
 				FRAMEWORK_SEARCH_PATHS = "Frameworks/**";
 				LIBRARY_SEARCH_PATHS = "";
-				SDKROOT = macosx10.5;
+				SDKROOT = macosx;
 				USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR;
 			};
 			name = Default;



More information about the Unison-hackers mailing list