Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorAlan McGovern <alan.mcgovern@gmail.com>2011-11-22 20:54:38 +0400
committerAlan McGovern <alan.mcgovern@gmail.com>2011-11-22 20:55:47 +0400
commitfdd1aa076d51841c1331f2468258b59fb90244a4 (patch)
treeb1954bb93d3db7f39be5b3ede95c706bcee97d1a /main/src
parentf9ae579a747632978643f5b248e3e663489a4c0a (diff)
[MacDev] Add some more sanity checks to try prevent xcode re-opening
Add checks in the applescript itself to ensure we don't restart xcode in the event it is shut down by the time the applescript actually executeis. Partial fix for bug #1648.
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs76
1 files changed, 35 insertions, 41 deletions
diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs
index 5271cf1908..d47896e1ae 100644
--- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs
+++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs
@@ -275,12 +275,6 @@ namespace MonoDevelop.MacDev.XcodeSyncing
}
}
- public void OpenProject ()
- {
- SyncProject ();
- AppleScript.Run (XCODE_OPEN_PROJECT, AppleSdkSettings.XcodePath, xcproj);
- }
-
public void OpenFile (string relativeName)
{
XC4Debug.Log ("Opening file in Xcode: {0}", relativeName);
@@ -351,12 +345,6 @@ namespace MonoDevelop.MacDev.XcodeSyncing
return success;
}
- const string XCODE_OPEN_PROJECT =
-@"tell application ""{0}""
- activate
- open ""{1}""
-end tell";
-
const string XCODE_OPEN_PROJECT_FILE =
@"tell application ""{0}""
activate
@@ -366,45 +354,51 @@ end tell";
const string XCODE_SAVE_IN_PATH =
@"tell application ""{0}""
- set pp to ""{1}""
- set ext to {{ "".storyboard"", "".xib"", "".h"", "".m"" }}
- repeat with d in documents
- if d is modified then
- set f to path of d
- if f starts with pp then
- repeat with e in ext
- if f ends with e then
- save d
- exit repeat
- end if
- end repeat
+ if it is running then
+ set pp to ""{1}""
+ set ext to {{ "".storyboard"", "".xib"", "".h"", "".m"" }}
+ repeat with d in documents
+ if d is modified then
+ set f to path of d
+ if f starts with pp then
+ repeat with e in ext
+ if f ends with e then
+ save d
+ exit repeat
+ end if
+ end repeat
+ end if
end if
- end if
- end repeat
+ end repeat
+ end if
end tell";
const string XCODE_CLOSE_IN_PATH =
@"tell application ""{0}""
- set pp to ""{1}""
- repeat with d in documents
- set f to path of d
- if f starts with pp then
- close d
- return true
- end if
- end repeat
+ if it is running then
+ set pp to ""{1}""
+ repeat with d in documents
+ set f to path of d
+ if f starts with pp then
+ close d
+ return true
+ end if
+ end repeat
+ end if
return false
end tell";
const string XCODE_CHECK_PROJECT_OPEN =
@"tell application ""{0}""
- set pp to ""{1}""
- repeat with p in projects
- if real path of p is pp then
- return true
- exit repeat
- end if
- end repeat
+ if it is running then
+ set pp to ""{1}""
+ repeat with p in projects
+ if real path of p is pp then
+ return true
+ exit repeat
+ end if
+ end repeat
+ end if
return false
end tell";
}