Browse Source

Chromatic Start

master
GRMrGecko 12 years ago
commit
b2a45eef97
  1. 9
      .gitignore
  2. 22
      About.rtf
  3. 5734
      Chromatic.ai
  4. BIN
      Chromatic.icns
  5. BIN
      Chromatic.png
  6. 415
      Chromatic.xcodeproj/project.pbxproj
  7. 30
      Classes/MGMAddons.h
  8. 80
      Classes/MGMAddons.m
  9. 93
      Classes/MGMController.h
  10. 565
      Classes/MGMController.m
  11. 35
      Classes/Preferences/MGMAdvancedPane.h
  12. 60
      Classes/Preferences/MGMAdvancedPane.m
  13. 36
      Classes/Preferences/MGMGeneralPane.h
  14. 60
      Classes/Preferences/MGMGeneralPane.m
  15. 7
      Classes/Prefix.pch
  16. 14
      Classes/main.m
  17. 1
      Frameworks/GeckoReporter.framework/GeckoReporter
  18. 1
      Frameworks/GeckoReporter.framework/Headers
  19. 1
      Frameworks/GeckoReporter.framework/Resources
  20. BIN
      Frameworks/GeckoReporter.framework/Versions/A/GeckoReporter
  21. 12
      Frameworks/GeckoReporter.framework/Versions/A/Headers/GeckoReporter.h
  22. 16
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMFeedback.h
  23. 12
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMLog.h
  24. 28
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMReporter.h
  25. 20
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMSender.h
  26. 15
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMSenderDelegate.h
  27. 46
      Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMSystemInfo.h
  28. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/English.lproj/GeckoReporter.strings
  29. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/English.lproj/MGMBugWindow.nib
  30. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/English.lproj/MGMContactWindow.nib
  31. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/English.lproj/MGMReportWindow.nib
  32. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/French.lproj/GeckoReporter.strings
  33. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/French.lproj/MGMBugWindow.nib
  34. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/French.lproj/MGMContactWindow.nib
  35. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/French.lproj/MGMReportWindow.nib
  36. 42
      Frameworks/GeckoReporter.framework/Versions/A/Resources/Info.plist
  37. 27
      Frameworks/GeckoReporter.framework/Versions/A/Resources/License.txt
  38. 206
      Frameworks/GeckoReporter.framework/Versions/A/Resources/ModelNames.plist
  39. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/es.lproj/GeckoReporter.strings
  40. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/es.lproj/MGMBugWindow.nib
  41. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/es.lproj/MGMContactWindow.nib
  42. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/es.lproj/MGMReportWindow.nib
  43. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/pt-PT.lproj/GeckoReporter.strings
  44. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/pt-PT.lproj/MGMBugWindow.nib
  45. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/pt-PT.lproj/MGMContactWindow.nib
  46. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/pt-PT.lproj/MGMReportWindow.nib
  47. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/sv.lproj/GeckoReporter.strings
  48. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/sv.lproj/MGMBugWindow.nib
  49. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/sv.lproj/MGMContactWindow.nib
  50. BIN
      Frameworks/GeckoReporter.framework/Versions/A/Resources/sv.lproj/MGMReportWindow.nib
  51. 1
      Frameworks/GeckoReporter.framework/Versions/Current
  52. 1
      Frameworks/MGMUsers.framework/Headers
  53. 1
      Frameworks/MGMUsers.framework/MGMUsers
  54. 1
      Frameworks/MGMUsers.framework/Resources
  55. 19
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMAbout.h
  56. 23
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMFileManager.h
  57. 58
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMJSON.h
  58. 48
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMMD5.h
  59. 61
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferences.h
  60. 29
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMPreferencesPane.h
  61. 101
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMURLBasicHandler.h
  62. 52
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMURLConnectionManager.h
  63. 25
      Frameworks/MGMUsers.framework/Versions/A/Headers/MGMUsers.h
  64. BIN
      Frameworks/MGMUsers.framework/Versions/A/MGMUsers
  65. BIN
      Frameworks/MGMUsers.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
  66. 26
      Frameworks/MGMUsers.framework/Versions/A/Resources/Info.plist
  67. BIN
      Frameworks/MGMUsers.framework/Versions/A/Resources/aboutPane.nib
  68. 1
      Frameworks/MGMUsers.framework/Versions/Current
  69. 1
      Frameworks/Sparkle.framework/Headers
  70. 1
      Frameworks/Sparkle.framework/Resources
  71. 1
      Frameworks/Sparkle.framework/Sparkle
  72. 36
      Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h
  73. 54
      Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
  74. 126
      Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h
  75. 27
      Frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h
  76. 21
      Frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h
  77. 24
      Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist
  78. 153
      Frameworks/Sparkle.framework/Versions/A/Resources/License.txt
  79. 174
      Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist
  80. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib
  81. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/cs.lproj/SUAutomaticUpdateAlert.nib
  82. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/cs.lproj/SUUpdateAlert.nib
  83. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/cs.lproj/SUUpdatePermissionPrompt.nib
  84. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/cs.lproj/Sparkle.strings
  85. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/da.lproj/SUAutomaticUpdateAlert.nib
  86. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/da.lproj/SUUpdateAlert.nib
  87. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/da.lproj/SUUpdatePermissionPrompt.nib
  88. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/da.lproj/Sparkle.strings
  89. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib
  90. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib
  91. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib
  92. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings
  93. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib
  94. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib
  95. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib
  96. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings
  97. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib
  98. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib
  99. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib
  100. BIN
      Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings

9
.gitignore

@ -0,0 +1,9 @@
build
*.zip
*.xcodeproj/*.pbxuser
*.xcodeproj/*.mode*
*.xcodeproj/*.perspective*
*.xcodeproj/xcuserdata
*.xcodeproj/project.xcworkspace/xcuserdata
*.xcworkspace/xcuserdata
Screenshots/*

22
About.rtf

@ -0,0 +1,22 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural
\f0\b\fs36 \cf0 By Mr. Gecko
\b0\fs32 \
\fs34 At {\field{\*\fldinst{HYPERLINK "http://mrgeckosmedia.com/"}}{\fldrslt mrgeckosmedia.com}}
\fs32 \
Special Thanks To\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural
\fs24 \cf0 MegaEduX ({\field{\*\fldinst{HYPERLINK "http://megaedux.com"}}{\fldrslt megaedux.com}})\
RockStar ({\field{\*\fldinst{HYPERLINK "http://rocknthesweater.com"}}{\fldrslt rocknthesweater.com}})\
Steve Bell ({\field{\*\fldinst{HYPERLINK "http://gpgtools.org/"}}{\fldrslt gpgtools.org}})\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 Chromatic uses {\field{\*\fldinst{HYPERLINK "http://sparkle.andymatuschak.org"}}{\fldrslt Sparkle}} for software update, and {\field{\*\fldinst{HYPERLINK "http://opensource.mrgeckosmedia.com/GeckoReporter"}}{\fldrslt GeckoReporter}} for crash and reporting.\
\
Chromatic is an easy way to install and update Chromium, the open source project behind Google Chrome. Chromatic allows you to select a release channel (Stable, Beta, \'85), use the latest build available, or choose a specific build.}

5734
Chromatic.ai
File diff suppressed because it is too large
View File

BIN
Chromatic.icns

BIN
Chromatic.png

After

Width: 512  |  Height: 512  |  Size: 47 KiB

415
Chromatic.xcodeproj/project.pbxproj

@ -0,0 +1,415 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
256AC3DA0F4B6AC300CF3369 /* MGMController.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* MGMController.m */; };
2A2BA1C013AFBA2800146C20 /* ChromaticIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A2BA1BF13AFBA2800146C20 /* ChromaticIcon.png */; };
2A2BA1C213AFBA2D00146C20 /* About.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A2BA1C113AFBA2D00146C20 /* About.rtf */; };
2A53913F13A0FEE100CA59E3 /* GeckoReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913C13A0FEE100CA59E3 /* GeckoReporter.framework */; };
2A53914013A0FEE100CA59E3 /* MGMUsers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913D13A0FEE100CA59E3 /* MGMUsers.framework */; };
2A53914113A0FEE100CA59E3 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913E13A0FEE100CA59E3 /* Sparkle.framework */; };
2A53916113A0FEF500CA59E3 /* GeckoReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913C13A0FEE100CA59E3 /* GeckoReporter.framework */; };
2A53916213A0FEF500CA59E3 /* MGMUsers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913D13A0FEE100CA59E3 /* MGMUsers.framework */; };
2A53916313A0FEF500CA59E3 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A53913E13A0FEE100CA59E3 /* Sparkle.framework */; };
2A5F286E13A2644D000F2348 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A5F286D13A2644D000F2348 /* WebKit.framework */; };
2A5F2A4613A2B153000F2348 /* Advanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A5F2A4213A2B153000F2348 /* Advanced.png */; };
2A5F2A4813A2B153000F2348 /* General.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A5F2A4413A2B153000F2348 /* General.png */; };
2A5F2A4A13A2B1A7000F2348 /* GeneralPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A5F2A4913A2B1A7000F2348 /* GeneralPane.xib */; };
2A5F2A4C13A2B1B3000F2348 /* AdvancedPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A5F2A4B13A2B1B3000F2348 /* AdvancedPane.xib */; };
2A5F2A5013A2B1E9000F2348 /* MGMGeneralPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A5F2A4F13A2B1E9000F2348 /* MGMGeneralPane.m */; };
2A5F2A5313A2B20E000F2348 /* MGMAdvancedPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A5F2A5213A2B20E000F2348 /* MGMAdvancedPane.m */; };
2A6CFA3213A8F6FE0047D11C /* Chromatic.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2A6CFA3113A8F6FE0047D11C /* Chromatic.icns */; };
2AA54D6713ABFB2000FC3A54 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 2AA54D6613ABFB2000FC3A54 /* dsa_pub.pem */; };
2ACA2EEB13A2486D003C69E6 /* MGMAddons.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ACA2EEA13A2486D003C69E6 /* MGMAddons.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
2A53916813A0FEFD00CA59E3 /* Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
2A53916113A0FEF500CA59E3 /* GeckoReporter.framework in Frameworks */,
2A53916213A0FEF500CA59E3 /* MGMUsers.framework in Frameworks */,
2A53916313A0FEF500CA59E3 /* Sparkle.framework in Frameworks */,
);
name = Frameworks;
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
256AC3D80F4B6AC300CF3369 /* MGMController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMController.h; sourceTree = "<group>"; };
256AC3D90F4B6AC300CF3369 /* MGMController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMController.m; sourceTree = "<group>"; };
256AC3F00F4B6AF500CF3369 /* Chromatic_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chromatic_Prefix.pch; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Classes/main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
2A2BA1BF13AFBA2800146C20 /* ChromaticIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ChromaticIcon.png; sourceTree = "<group>"; };
2A2BA1C113AFBA2D00146C20 /* About.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = About.rtf; sourceTree = SOURCE_ROOT; };
2A5390FF13A0F95900CA59E3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2A53913C13A0FEE100CA59E3 /* GeckoReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GeckoReporter.framework; path = Frameworks/GeckoReporter.framework; sourceTree = "<group>"; };
2A53913D13A0FEE100CA59E3 /* MGMUsers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MGMUsers.framework; path = Frameworks/MGMUsers.framework; sourceTree = "<group>"; };
2A53913E13A0FEE100CA59E3 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Sparkle.framework; sourceTree = "<group>"; };
2A5F286D13A2644D000F2348 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
2A5F2A4213A2B153000F2348 /* Advanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Advanced.png; sourceTree = "<group>"; };
2A5F2A4413A2B153000F2348 /* General.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = General.png; sourceTree = "<group>"; };
2A5F2A4913A2B1A7000F2348 /* GeneralPane.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GeneralPane.xib; sourceTree = "<group>"; };
2A5F2A4B13A2B1B3000F2348 /* AdvancedPane.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AdvancedPane.xib; sourceTree = "<group>"; };
2A5F2A4E13A2B1E9000F2348 /* MGMGeneralPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMGeneralPane.h; sourceTree = "<group>"; };
2A5F2A4F13A2B1E9000F2348 /* MGMGeneralPane.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMGeneralPane.m; sourceTree = "<group>"; };
2A5F2A5113A2B20E000F2348 /* MGMAdvancedPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMAdvancedPane.h; sourceTree = "<group>"; };
2A5F2A5213A2B20E000F2348 /* MGMAdvancedPane.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMAdvancedPane.m; sourceTree = "<group>"; };
2A6CFA3113A8F6FE0047D11C /* Chromatic.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Chromatic.icns; sourceTree = SOURCE_ROOT; };
2AA54D6613ABFB2000FC3A54 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
2ACA2EE913A2486D003C69E6 /* MGMAddons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGMAddons.h; sourceTree = "<group>"; };
2ACA2EEA13A2486D003C69E6 /* MGMAddons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGMAddons.m; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Chromatic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chromatic.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
2A53913F13A0FEE100CA59E3 /* GeckoReporter.framework in Frameworks */,
2A53914013A0FEE100CA59E3 /* MGMUsers.framework in Frameworks */,
2A53914113A0FEE100CA59E3 /* Sparkle.framework in Frameworks */,
2A5F286E13A2644D000F2348 /* WebKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
256AC3D80F4B6AC300CF3369 /* MGMController.h */,
256AC3D90F4B6AC300CF3369 /* MGMController.m */,
2ACA2EE913A2486D003C69E6 /* MGMAddons.h */,
2ACA2EEA13A2486D003C69E6 /* MGMAddons.m */,
2A5F2A4D13A2B1D8000F2348 /* Preferences */,
);
path = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
2A53913C13A0FEE100CA59E3 /* GeckoReporter.framework */,
2A53913D13A0FEE100CA59E3 /* MGMUsers.framework */,
2A53913E13A0FEE100CA59E3 /* Sparkle.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
2A5F286D13A2644D000F2348 /* WebKit.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* Chromatic.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* Chromatic */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = Chromatic;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
256AC3F00F4B6AF500CF3369 /* Chromatic_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2A5390FF13A0F95900CA59E3 /* Info.plist */,
2A6CFA3113A8F6FE0047D11C /* Chromatic.icns */,
2A2BA1C113AFBA2D00146C20 /* About.rtf */,
2A2BA1BF13AFBA2800146C20 /* ChromaticIcon.png */,
2AA54D6613ABFB2000FC3A54 /* dsa_pub.pem */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
2A5F2A4013A2B153000F2348 /* Preferences */,
);
path = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
2A5F2A4013A2B153000F2348 /* Preferences */ = {
isa = PBXGroup;
children = (
2A5F2A4413A2B153000F2348 /* General.png */,
2A5F2A4913A2B1A7000F2348 /* GeneralPane.xib */,
2A5F2A4213A2B153000F2348 /* Advanced.png */,
2A5F2A4B13A2B1B3000F2348 /* AdvancedPane.xib */,
);
path = Preferences;
sourceTree = "<group>";
};
2A5F2A4D13A2B1D8000F2348 /* Preferences */ = {
isa = PBXGroup;
children = (
2A5F2A4E13A2B1E9000F2348 /* MGMGeneralPane.h */,
2A5F2A4F13A2B1E9000F2348 /* MGMGeneralPane.m */,
2A5F2A5113A2B20E000F2348 /* MGMAdvancedPane.h */,
2A5F2A5213A2B20E000F2348 /* MGMAdvancedPane.m */,
);
path = Preferences;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Chromatic */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Chromatic" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
2A53916813A0FEFD00CA59E3 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Chromatic;
productInstallPath = "$(HOME)/Applications";
productName = Chromatic;
productReference = 8D1107320486CEB800E47090 /* Chromatic.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Chromatic" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Chromatic */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Chromatic */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
2A5F2A4613A2B153000F2348 /* Advanced.png in Resources */,
2A5F2A4813A2B153000F2348 /* General.png in Resources */,
2A5F2A4A13A2B1A7000F2348 /* GeneralPane.xib in Resources */,
2A5F2A4C13A2B1B3000F2348 /* AdvancedPane.xib in Resources */,
2A6CFA3213A8F6FE0047D11C /* Chromatic.icns in Resources */,
2AA54D6713ABFB2000FC3A54 /* dsa_pub.pem in Resources */,
2A2BA1C013AFBA2800146C20 /* ChromaticIcon.png in Resources */,
2A2BA1C213AFBA2D00146C20 /* About.rtf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
256AC3DA0F4B6AC300CF3369 /* MGMController.m in Sources */,
2ACA2EEB13A2486D003C69E6 /* MGMAddons.m in Sources */,
2A5F2A5013A2B1E9000F2348 /* MGMGeneralPane.m in Sources */,
2A5F2A5313A2B20E000F2348 /* MGMAdvancedPane.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
1DDD58150DA1D0A300B32029 /* English */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
ppc,
i386,
x86_64,
);
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Classes/Prefix.pch;
INFOPLIST_FILE = Resources/Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.4;
"MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
PRODUCT_NAME = Chromatic;
SDKROOT = macosx10.5;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
ppc,
i386,
x86_64,
);
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Classes/Prefix.pch;
INFOPLIST_FILE = Resources/Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.4;
"MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
PRODUCT_NAME = Chromatic;
SDKROOT = macosx10.5;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Chromatic" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Chromatic" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

30
Classes/MGMAddons.h

@ -0,0 +1,30 @@
//
// MGMAddons.h
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import <Cocoa/Cocoa.h>
@interface NSString (MGMAddons)
+ (NSString *)readableMemory:(unsigned long)theBytes;
+ (NSString *)readableTime:(unsigned long)theSeconds;
@end
@interface NSURL (MGMAddons)
- (NSURL *)appendPathComponent:(NSString *)theComponent;
@end

80
Classes/MGMAddons.m

@ -0,0 +1,80 @@
//
// MGMAddons.m
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import "MGMAddons.h"
@implementation NSString (MGMAddons)
+ (NSString *)readableMemory:(unsigned long)theBytes {
double bytes = theBytes;
NSString *types[] = {@"Bytes", @"KB", @"MB", @"GB", @"TB", @"PB", @"EB", @"ZB", @"YB", @"BB"};
int type = 0;
while (bytes>1024 && type<=9) {
bytes /= 1024;
type++;
}
return [NSString stringWithFormat:@"%.02f %@", bytes, types[type]];
}
+ (NSString *)readableTime:(unsigned long)theSeconds {
unsigned long time = theSeconds;
int seconds = time%60;
time = time/60;
int minutes = time%60;
time = time/60;
int hours = time%24;
unsigned long days = time/24;
NSString *string;
if (days!=0) {
string = [NSString stringWithFormat:@"%lu day%@ %02d:%02d:%02d", days, (days==1 ? @"" : @"s"), hours, minutes, seconds];
} else if (hours!=0) {
string = [NSString stringWithFormat:@"%d:%02d:%02d", hours, minutes, seconds];
} else {
string = [NSString stringWithFormat:@"%02d:%02d", minutes, seconds];
}
return string;
}
@end
@implementation NSURL (MGMAddons)
- (NSURL *)appendPathComponent:(NSString *)theComponent {
NSMutableString *string = [NSMutableString string];
if ([self scheme]!=nil)
[string appendFormat:@"%@://", [self scheme]];
if ([self host]!=nil)
[string appendString:[self host]];
if ([self port]!=0)
[string appendFormat:@":%d", [self port]];
if ([self path]!=nil) {
if (theComponent!=nil) {
[string appendString:[[self path] stringByAppendingPathComponent:theComponent]];
if ([theComponent isEqual:@""] || [theComponent hasSuffix:@"/"])
[string appendString:@"/"];
} else {
[string appendString:[self path]];
if ([[self absoluteString] hasSuffix:@"/"])
[string appendString:@"/"];
}
} else {
[string appendString:[@"/" stringByAppendingPathComponent:theComponent]];
}
if ([self query]!=nil)
[string appendFormat:@"?%@", [self query]];
return [NSURL URLWithString:string];
}
@end

93
Classes/MGMController.h

@ -0,0 +1,93 @@
//
// MGMController.h
// Chromatic
//
// Created by Mr. Gecko on 6/9/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import <Cocoa/Cocoa.h>
@class MGMAbout, MGMPreferences, MGMURLConnectionManager, MGMURLBasicHandler, WebView;
extern NSString * const MGMCustomSnapshotURL;
extern NSString * const MGMMoveToTrash;
extern NSString * const MGMDoneSound;
extern NSString * const MGMLaunchWhenDone;
extern NSString * const MGMQuitAfterLaunch;
@interface MGMController : NSObject
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
<NSApplicationDelegate>
#endif
{
IBOutlet NSWindow *mainWindow;
MGMAbout *about;
MGMPreferences *preferences;
MGMURLConnectionManager *connectionManager;
BOOL startingUp;
NSMutableDictionary *channelRevisions;
NSString *chromiumPath;
IBOutlet NSPopUpButton *channelPopUp;
IBOutlet NSTextField *buildWarningField;
IBOutlet NSPopUpButton *buildPopUp;
IBOutlet NSTextField *webKitBuildField;
IBOutlet NSTextField *v8BuildField;
IBOutlet NSTextField *buildDateField;
IBOutlet NSTextField *yourBuildField;
IBOutlet NSTextField *installDateField;
IBOutlet NSTextField *pathField;
IBOutlet NSProgressIndicator *progress;
IBOutlet NSTextField *statusField;
IBOutlet NSButton *launchButton;
IBOutlet NSButton *svnLogsButton;
IBOutlet NSButton *updateButton;
IBOutlet NSWindow *svnLogsWindow;
IBOutlet WebView *svnLogsBrowser;
int startTime;
MGMURLBasicHandler *updateHandler;
NSDate *lastCheck;
unsigned long bytesReceived;
unsigned long averageBytesReceived;
unsigned long totalBytes;
NSMutableArray *bytesReceivedArray;
NSTask *unzipTask;
}
- (void)registerDefaults;
- (IBAction)about:(id)sender;
- (IBAction)preferences:(id)sender;
- (IBAction)donate:(id)sender;
- (IBAction)openSource:(id)sender;
- (IBAction)channelSelect:(id)sender;
- (IBAction)buildSelect:(id)sender;
- (IBAction)choosePath:(id)sender;
- (void)updateChromiumPath;
- (IBAction)launchChromium:(id)sender;
- (IBAction)viewSVNLogs:(id)sender;
- (IBAction)update:(id)sender;
- (void)updateDone;
@end

565
Classes/MGMController.m

@ -0,0 +1,565 @@
//
// MGMController.m
// Chromatic
//
// Created by Mr. Gecko on 6/9/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import "MGMController.h"
#import "MGMAddons.h"
#import <MGMUsers/MGMUsers.h>
#import <GeckoReporter/GeckoReporter.h>
#import <WebKit/WebKit.h>
NSString * const MGMCopyright = @"Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/";
NSString * const MGMVersion = @"MGMVersion";
NSString * const MGMLaunchCount = @"MGMLaunchCount";
NSString * const MGMChannel = @"MGMChannel";
NSString * const MGMChromiumPath = @"MGMChromiumPath";
NSString * const MGMCustomSnapshotURL = @"MGMCustomSnapshotURL";
NSString * const MGMMoveToTrash = @"MGMMoveToTrash";
NSString * const MGMDoneSound = @"MGMDoneSound";
NSString * const MGMLaunchWhenDone = @"MGMLaunchWhenDone";
NSString * const MGMQuitAfterLaunch = @"MGMQuitAfterLaunch";
NSString * const MGMCPApplications = @"/Applications";
NSString * const MGMCPUserApplications = @"~/Applications";
NSString * const MGMCPChromium = @"Chromium.app";
NSString * const MGMCPRevision = @"SVNRevision";
NSString * const MGMChromiumZip = @"chrome-mac.zip";
NSString * const MGMTMPPath = @"/tmp";
NSString * const MGMChannelsURL = @"http://omahaproxy.appspot.com/all.json?os=mac";
static NSString *MGMSnapshotURL = @"http://build.chromium.org/f/chromium/snapshots/Mac/";
NSString * const MGMSVNLogsURL = @"http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&range=%@:%@&mode=html&os=mac";
NSString * const MGMCChannel = @"channel";
NSString * const MGMCRevision = @"base_trunk_revision";
NSString * const MGMCStable = @"stable";
NSString * const MGMCBeta = @"beta";
NSString * const MGMCDev = @"dev";
NSString * const MGMCCanary = @"canary";
NSString * const MGMUBUpdate = @"Update";
NSString * const MGMUBInstall = @"Install";
NSString * const MGMUBCancel = @"Cancel";
@interface NSOpenPanel (MGMIgnore)
- (void)setDirectoryURL:(NSURL *)url;
- (void)setDirectory:(NSString *)path;
@end
@implementation MGMController
- (void)awakeFromNib {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setup) name:MGMGRDoneNotification object:nil];
[MGMReporter sharedReporter];
}
- (void)setup {
connectionManager = [[MGMURLConnectionManager manager] retain];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:MGMVersion]==nil) {
NSString *oldPathKey = @"cPathKey";
[defaults setObject:[defaults stringForKey:oldPathKey] forKey:MGMChromiumPath];
[defaults removeObjectForKey:oldPathKey];
[defaults setObject:[[MGMSystemInfo info] applicationVersion] forKey:MGMVersion];
}
[self registerDefaults];
if ([defaults integerForKey:MGMLaunchCount]!=5) {
[defaults setInteger:[defaults integerForKey:MGMLaunchCount]+1 forKey:MGMLaunchCount];
if ([defaults integerForKey:MGMLaunchCount]==5) {
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Donations"];
[alert setInformativeText:@"Thank you for using Chromatic. Chromatic is donation supported software. If you like using it, please consider giving a donation to help with development."];
[alert addButtonWithTitle:@"Yes"];
[alert addButtonWithTitle:@"No"];
int result = [alert runModal];
if (result==1000)
[self donate:self];
}
}
if ([defaults objectForKey:MGMCustomSnapshotURL]!=nil && ![[defaults objectForKey:MGMCustomSnapshotURL] isEqual:@""])
MGMSnapshotURL = [defaults objectForKey:MGMCustomSnapshotURL];
about = [MGMAbout new];
preferences = [MGMPreferences new];
[preferences addPreferencesPaneClassName:@"MGMGeneralPane"];
[preferences addPreferencesPaneClassName:@"MGMAdvancedPane"];
startingUp = YES;
[mainWindow makeKeyAndOrderFront:self];
[progress startAnimation:self];
[updateButton setEnabled:NO];
[channelPopUp selectItemAtIndex:[defaults integerForKey:MGMChannel]];
channelRevisions = [NSMutableDictionary new];
NSString *path = [defaults objectForKey:MGMChromiumPath];
if (path==nil)
path = [[NSWorkspace sharedWorkspace] fullPathForApplication:@"Chromium"];
if (path==nil) {
NSFileManager *manager = [NSFileManager defaultManager];
if ([manager isWritableFileAtPath:MGMCPApplications]) {
path = [MGMCPApplications stringByAppendingPathComponent:MGMCPChromium];
} else {
if ([manager fileExistsAtPath:[MGMCPUserApplications stringByExpandingTildeInPath]])
[manager createDirectoryAtPath:[MGMCPUserApplications stringByExpandingTildeInPath] withAttributes:nil];
path = [[MGMCPUserApplications stringByExpandingTildeInPath] stringByAppendingPathComponent:MGMCPChromium];
}
}
chromiumPath = [path copy];
[self updateChromiumPath];
MGMURLBasicHandler *handler = [MGMURLBasicHandler handlerWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:MGMChannelsURL]] delegate:self];
[handler setFailWithError:@selector(channels:didFailWithError:)];
[handler setFinish:@selector(channelsFinished:)];
[connectionManager addHandler:handler];
handler = [MGMURLBasicHandler handlerWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:MGMSnapshotURL]] delegate:self];
[handler setFailWithError:@selector(revisions:didFailWithError:)];
[handler setFinish:@selector(revisionsFinished:)];
[connectionManager addHandler:handler];
}
- (void)registerDefaults {
NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
[defaults setObject:[NSNumber numberWithInt:1] forKey:MGMLaunchCount];
[defaults setObject:[NSNumber numberWithInt:4] forKey:MGMChannel];
[defaults setObject:[NSNumber numberWithBool:YES] forKey:MGMMoveToTrash];
[defaults setObject:[NSNumber numberWithBool:YES] forKey:MGMDoneSound];
[defaults setObject:[NSNumber numberWithBool:NO] forKey:MGMLaunchWhenDone];
[defaults setObject:[NSNumber numberWithBool:NO] forKey:MGMQuitAfterLaunch];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}
- (IBAction)about:(id)sender {
[about show];
}
- (IBAction)preferences:(id)sender {
[preferences showPreferences];
}
- (IBAction)donate:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9184741"]];
}
- (IBAction)openSource:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://opensource.mrgeckosmedia.com/Chromatic?application"]];
}
- (void)channels:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError {
NSLog(@"%@", theError);
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Error loading channel info"];
[alert setInformativeText:[theError localizedDescription]];
[alert runModal];
}
- (void)channelsFinished:(MGMURLBasicHandler *)theHandler {
NSArray *versions = [[[[theHandler data] parseJSON] objectAtIndex:0] objectForKey:@"versions"];
if (versions==nil) {
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Error loading channel info"];
[alert setInformativeText:@"The JSON was unable to be parsed."];
[alert runModal];
}
for (int i=0; i<[versions count]; i++) {
NSDictionary *versionInfo = [versions objectAtIndex:i];
[channelRevisions setObject:[[versionInfo objectForKey:MGMCRevision] stringValue] forKey:[versionInfo objectForKey:MGMCChannel]];
}
[progress setIndeterminate:NO];
[progress startAnimation:self];
[progress setDoubleValue:0.25];
}
- (void)revisions:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError {
NSLog(@"%@", theError);
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Error loading revisions"];
[alert setInformativeText:[theError localizedDescription]];
[alert runModal];
}
- (void)revisionsFinished:(MGMURLBasicHandler *)theHandler {
NSString *returnedString = [theHandler string];
[buildPopUp removeAllItems];
[progress setDoubleValue:0.50];
NSMenu *items = [NSMenu new];
unsigned long length = [returnedString length];
NSRange range = NSMakeRange(0, length);
while (range.location!=length) {
NSRange urlRange = [returnedString rangeOfString:@"/\">" options:0 range:range];
if (urlRange.location==NSNotFound)
break;
range.location = urlRange.location+urlRange.length;
range.length = length-range.location;
urlRange = [returnedString rangeOfString:@"</a>" options:0 range:range];
if (urlRange.location==NSNotFound)
continue;
NSRange revisionRange = NSMakeRange(range.location, urlRange.location-range.location);
range.location = urlRange.location+urlRange.length;
range.length = length-range.location;
urlRange = [returnedString rangeOfString:@"/" options:0 range:revisionRange];
if (urlRange.location==NSNotFound)
continue;
revisionRange.length -= 1;
NSMenuItem *item = [NSMenuItem new];
[item setTitle:[returnedString substringWithRange:revisionRange]];
[items addItem:item];
[item release];
}
[buildPopUp setMenu:items];
[items release];
[self channelSelect:self];
}
- (IBAction)channelSelect:(id)sender {
[[NSUserDefaults standardUserDefaults] setInteger:[channelPopUp indexOfSelectedItem] forKey:MGMChannel];
NSArray *revisions = [buildPopUp itemTitles];
NSString *revision = nil;
if ([channelPopUp indexOfSelectedItem]==0)
revision = [channelRevisions objectForKey:MGMCStable];
else if ([channelPopUp indexOfSelectedItem]==1)
revision = [channelRevisions objectForKey:MGMCBeta];
else if ([channelPopUp indexOfSelectedItem]==2)
revision = [channelRevisions objectForKey:MGMCDev];
else if ([channelPopUp indexOfSelectedItem]==3)
revision = [channelRevisions objectForKey:MGMCCanary];
if (revision==nil)
revision = [revisions lastObject];
long itemIndex = [revisions indexOfObject:revision];
if (itemIndex==NSNotFound) {
[buildWarningField setHidden:NO];
for (unsigned int i=0; i<[revisions count]; i++) {
if ([(NSString *)[revisions objectAtIndex:i] compare:revision]==NSOrderedDescending) {
itemIndex = i;
break;
}
}
if (itemIndex==NSNotFound)
itemIndex = [revisions count]-1;
} else {
[buildWarningField setHidden:YES];
}
[buildPopUp selectItemAtIndex:itemIndex];
if (startingUp)
[progress setDoubleValue:0.75];
[self buildSelect:self];
}
- (IBAction)buildSelect:(id)sender {
NSURL *buildURL = [[[NSURL URLWithString:MGMSnapshotURL] appendPathComponent:[buildPopUp titleOfSelectedItem]] appendPathComponent:@"REVISIONS"];
MGMURLBasicHandler *handler = [MGMURLBasicHandler handlerWithRequest:[NSURLRequest requestWithURL:buildURL] delegate:self];
[handler setFailWithError:@selector(revision:didFailWithError:)];
[handler setReceiveResponse:@selector(revision:didReceiveResponse:)];
[handler setFinish:@selector(revisionDidFinish:)];
[connectionManager addHandler:handler];
if (![[yourBuildField stringValue] isEqual:@""] && [buildPopUp indexOfSelectedItem]!=-1 && ![[yourBuildField stringValue] isEqual:[buildPopUp titleOfSelectedItem]])
[svnLogsButton setEnabled:YES];
else
[svnLogsButton setEnabled:NO];
}
- (void)revision:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError {
NSLog(@"%@", theError);
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Error loading revision info"];
[alert setInformativeText:[theError localizedDescription]];
[alert runModal];
if (startingUp) {
[progress setDoubleValue:1.0];
[progress setIndeterminate:YES];
[progress setDoubleValue:0.0];
[progress stopAnimation:self];
[updateButton setEnabled:YES];
startingUp = NO;
}
}
- (void)revision:(MGMURLBasicHandler *)theHandler didReceiveResponse:(NSHTTPURLResponse *)theResponse {
NSString *modified = [[theResponse allHeaderFields] objectForKey:@"Last-Modified"];
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]];
[formatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"];
NSDate *date = [formatter dateFromString:modified];
[formatter release];
formatter = [NSDateFormatter new];
[formatter setDateFormat:@"MMMM d, yyyy hh:mm:ss a"];
NSString *dateString = [formatter stringFromDate:date];
[formatter release];
if (dateString!=nil)
[buildDateField setStringValue:dateString];
else
[buildDateField setStringValue:@"N/A"];
}
- (void)revisionDidFinish:(MGMURLBasicHandler *)theHandler {
NSDictionary *revisionInfo = [[theHandler data] parseJSON];
NSString *webkit = [[revisionInfo objectForKey:@"webkit_revision"] stringValue];
if (webkit!=nil)
[webKitBuildField setStringValue:webkit];
else
[webKitBuildField setStringValue:@"0"];
NSString *v8 = [[revisionInfo objectForKey:@"v8_revision"] stringValue];
if (v8!=nil)
[v8BuildField setStringValue:v8];
else
[v8BuildField setStringValue:@"0"];
if (startingUp) {
[progress setDoubleValue:1.0];
[progress setIndeterminate:YES];
[progress setDoubleValue:0.0];
[progress stopAnimation:self];
[updateButton setEnabled:YES];
startingUp = NO;
}
}
- (IBAction)choosePath:(id)sender {
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
if ([openPanel respondsToSelector:@selector(setDirectory:)])
[openPanel setDirectory:[chromiumPath stringByDeletingLastPathComponent]];
else
[openPanel setDirectoryURL:[NSURL fileURLWithPath:[chromiumPath stringByDeletingLastPathComponent]]];
[openPanel setCanChooseFiles:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setTitle:@"Choose path for Chromium"];
[openPanel setPrompt:@"Choose"];
int result = [openPanel runModal];
if (result==NSOKButton) {
NSString *newPath = [[[openPanel URLs] objectAtIndex:0] path];
NSFileManager *manager = [NSFileManager defaultManager];
if ([manager isWritableFileAtPath:newPath]) {
[chromiumPath release];
chromiumPath = [[newPath stringByAppendingPathComponent:MGMCPChromium] retain];
[[NSUserDefaults standardUserDefaults] setObject:chromiumPath forKey:MGMChromiumPath];
[self updateChromiumPath];
} else {
NSAlert *alert = [[NSAlert new] autorelease];
[alert setInformativeText:@"Not Writable"];
[alert setMessageText:@"The directory you choose is not writable. To beable to use it with Chromatic, you need to change permissions."];
[alert runModal];
}
}
}
- (void)updateChromiumPath {
NSFileManager *manager = [NSFileManager defaultManager];
if ([manager fileExistsAtPath:chromiumPath]) {
NSDictionary *chromiumInfo = (NSDictionary *)CFBundleCopyInfoDictionaryInDirectory((CFURLRef)[NSURL fileURLWithPath:chromiumPath]);
[yourBuildField setStringValue:[chromiumInfo objectForKey:MGMCPRevision]];
[chromiumInfo release];
NSDictionary *chromeAttributes = [manager attributesOfItemAtPath:chromiumPath];
NSDate *date = [chromeAttributes objectForKey:NSFileModificationDate];
NSDateFormatter *formatter = [[NSDateFormatter new] autorelease];
[formatter setDateFormat:@"MMMM d, yyyy hh:mm:ss a"];
[installDateField setStringValue:[formatter stringFromDate:date]];
[launchButton setEnabled:YES];
[updateButton setTitle:MGMUBUpdate];
if (![[yourBuildField stringValue] isEqual:@""] && [buildPopUp indexOfSelectedItem]!=-1 && ![[yourBuildField stringValue] isEqual:[buildPopUp titleOfSelectedItem]])
[svnLogsButton setEnabled:YES];
else
[svnLogsButton setEnabled:NO];
} else {
[launchButton setEnabled:NO];
[svnLogsButton setEnabled:NO];
[yourBuildField setStringValue:@""];
[installDateField setStringValue:@""];
[updateButton setTitle:MGMUBInstall];
}
[pathField setStringValue:[chromiumPath stringByDeletingLastPathComponent]];
}
- (IBAction)launchChromium:(id)sender {
[[NSWorkspace sharedWorkspace] launchApplication:chromiumPath];
if ([[NSUserDefaults standardUserDefaults] boolForKey:MGMQuitAfterLaunch])
[[NSApplication sharedApplication] terminate:self];
}
- (IBAction)viewSVNLogs:(id)sender {
NSString *revision1, *revision2, *tmp;
revision1 = [yourBuildField stringValue];
revision2 = [buildPopUp titleOfSelectedItem];
if ([revision1 compare:revision2]==NSOrderedDescending) {
tmp = revision1;
revision1 = revision2;
revision2 = tmp;
}
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:MGMSVNLogsURL, revision1, revision2]];
[[svnLogsBrowser mainFrame] loadRequest:[NSURLRequest requestWithURL:url]];
[svnLogsWindow makeKeyAndOrderFront:self];
}
- (IBAction)update:(id)sender {
if ([[updateButton title] isEqual:MGMUBCancel]) {
[connectionManager cancelHandler:updateHandler];
[updateHandler release];
updateHandler = nil;
[[NSFileManager defaultManager] removeItemAtPath:[MGMTMPPath stringByAppendingPathComponent:MGMChromiumZip]];
[self updateDone];
} else {
[progress startAnimation:self];
startTime = [[NSDate date] timeIntervalSince1970];
NSURL *url = [[[NSURL URLWithString:MGMSnapshotURL] appendPathComponent:[buildPopUp titleOfSelectedItem]] appendPathComponent:MGMChromiumZip];
[updateHandler release];
updateHandler = [[MGMURLBasicHandler handlerWithRequest:[NSURLRequest requestWithURL:url] delegate:self] retain];
[updateHandler setFile:[MGMTMPPath stringByAppendingPathComponent:MGMChromiumZip]];
[updateHandler setFailWithError:@selector(update:didFailWithError:)];
[updateHandler setReceiveResponse:@selector(update:didReceiveResponse:)];
[updateHandler setBytesReceived:@selector(update:receivedBytes:totalBytes:expectedBytes:)];
[updateHandler setFinish:@selector(updateDidFinish:)];
[updateHandler setSynchronous:NO];
[connectionManager addHandler:updateHandler];
[channelPopUp setEnabled:NO];
[buildPopUp setEnabled:NO];
[updateButton setTitle:MGMUBCancel];
}
}
- (void)windowWillClose:(NSNotification *)notification {
[[svnLogsBrowser mainFrame] loadHTMLString:@"" baseURL:nil];
}
- (void)update:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError {
NSLog(@"%@", theError);
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText:@"Error downloading update"];
[alert setInformativeText:[theError localizedDescription]];
[alert runModal];
}
- (void)update:(MGMURLBasicHandler *)theHandler didReceiveResponse:(NSHTTPURLResponse *)theResponse {
[progress setIndeterminate:NO];
[progress startAnimation:self];
bytesReceivedArray = [NSMutableArray new];
}
- (void)update:(MGMURLBasicHandler *)theHandler receivedBytes:(unsigned long)theBytes totalBytes:(unsigned long)theTotalBytes expectedBytes:(unsigned long)theExpectedBytes {
bytesReceived += theBytes;
if (lastCheck==nil || [lastCheck timeIntervalSinceNow]<-1.0) {
[lastCheck release];
lastCheck = [NSDate new];
while ([bytesReceivedArray count]>15) {
[bytesReceivedArray removeObjectAtIndex:0];
}
[bytesReceivedArray addObject:[NSNumber numberWithUnsignedLong:bytesReceived]];
averageBytesReceived = 0;
for (int i=0; i<[bytesReceivedArray count]; i++) {
averageBytesReceived += [[bytesReceivedArray objectAtIndex:i] unsignedLongValue];
}
averageBytesReceived /= [bytesReceivedArray count];
[statusField setStringValue:[NSString stringWithFormat:@"%@ of %@ (%@/sec) - %@", [NSString readableMemory:theTotalBytes], [NSString readableMemory:theExpectedBytes], [NSString readableMemory:bytesReceived], [NSString readableTime:(theExpectedBytes-theTotalBytes)/averageBytesReceived]]];
bytesReceived = 0;
}
[progress setDoubleValue:(double)theTotalBytes/(double)theExpectedBytes];
totalBytes = theTotalBytes;
}
- (void)updateDidFinish:(MGMURLBasicHandler *)theHandler {
[updateHandler release];
updateHandler = nil;
[bytesReceivedArray release];
bytesReceivedArray = nil;
[updateButton setEnabled:NO];
[progress setIndeterminate:YES];
[progress startAnimation:self];
[statusField setStringValue:@"Uncompressing and installing update."];
unzipTask = [NSTask new];
[unzipTask setLaunchPath:@"/usr/bin/ditto"];
[unzipTask setArguments:[NSArray arrayWithObjects:@"-v", @"-x", @"-k", @"--rsrc", [MGMTMPPath stringByAppendingPathComponent:MGMChromiumZip], MGMTMPPath, nil]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateUnzipped:) name:NSTaskDidTerminateNotification object:unzipTask];
[unzipTask launch];
}
- (void)updateUnzipped:(NSNotification *)theNotification {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSFileManager *manager = [NSFileManager defaultManager];
if ([manager fileExistsAtPath:chromiumPath]) {
if ([defaults boolForKey:MGMMoveToTrash]) {
NSString *trash = [@"~/.Trash" stringByExpandingTildeInPath];
NSInteger tag;
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[chromiumPath stringByDeletingLastPathComponent] destination:trash files:[NSArray arrayWithObject:[chromiumPath lastPathComponent]] tag:&tag];
if (tag!=0)
NSLog(@"Error Deleting: %ld", (long)tag);
} else {
[manager removeItemAtPath:chromiumPath];
}
}
NSString *extractedPath = [[MGMTMPPath stringByAppendingPathComponent:[MGMChromiumZip stringByDeletingPathExtension]] stringByAppendingPathComponent:MGMCPChromium];
if (![manager moveItemAtPath:extractedPath toPath:chromiumPath]) {
NSBeep();
[self updateDone];
[statusField setStringValue:[NSString stringWithFormat:@"Unable to %@ due to an error. This may be a permissions issue.", [[updateButton title] lowercaseString]]];
return;
}
[manager removeItemAtPath:[extractedPath stringByDeletingLastPathComponent]];
[manager removeItemAtPath:[MGMTMPPath stringByAppendingPathComponent:MGMChromiumZip]];
[manager setAttributes:[NSDictionary dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate] ofItemAtPath:chromiumPath];
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
[self updateDone];
int time = [[NSDate date] timeIntervalSince1970]-startTime;
[statusField setStringValue:[NSString stringWithFormat:@"%@ downloaded at %@/sec in %@", [NSString readableMemory:totalBytes], [NSString readableMemory:averageBytesReceived], [NSString readableTime:time]]];
if ([defaults boolForKey:MGMDoneSound]) {
NSSound *done = [NSSound soundNamed:@"Glass"];
[done setDelegate:self];
[done play];
}
[updateButton setEnabled:YES];
if ([defaults boolForKey:MGMLaunchWhenDone] && [defaults boolForKey:MGMDoneSound] && ![defaults boolForKey:MGMQuitAfterLaunch])
[self launchChromium:self];
}
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)didFinish {
if (didFinish) {
[sound release];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults boolForKey:MGMLaunchWhenDone] && [defaults boolForKey:MGMQuitAfterLaunch])
[self launchChromium:self];
}
}
- (void)updateDone {
[self updateChromiumPath];
[channelPopUp setEnabled:YES];
[buildPopUp setEnabled:YES];
[progress setIndeterminate:YES];
[progress setDoubleValue:0.0];
[progress stopAnimation:self];
[statusField setStringValue:@""];
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
if (updateHandler!=nil)
[self update:self];
}
@end

35
Classes/Preferences/MGMAdvancedPane.h

@ -0,0 +1,35 @@
//
// MGMAdvancedPane.h
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import <Cocoa/Cocoa.h>
#import <MGMUsers/MGMPreferencesPane.h>
@interface MGMAdvancedPane : MGMPreferencesPane {
IBOutlet NSView *mainView;
IBOutlet NSTextField *snapshotField;
IBOutlet NSButton *trashButton;
}
- (id)initWithPreferences:(MGMPreferences *)thePreferences;
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem;
+ (NSString *)title;
- (NSView *)preferencesView;
- (IBAction)save:(id)sender;
@end

60
Classes/Preferences/MGMAdvancedPane.m

@ -0,0 +1,60 @@
//
// MGMAdvancedPane.m
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import "MGMAdvancedPane.h"
#import "MGMController.h"
#import <MGMUsers/MGMUsers.h>
@implementation MGMAdvancedPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"AdvancedPane" owner:self]) {
NSLog(@"Unable to load Nib for Advanced Preferences");
[self release];
self = nil;
} else {
if ([preferences stringForKey:MGMCustomSnapshotURL]!=nil)
[snapshotField setStringValue:[preferences stringForKey:MGMCustomSnapshotURL]];
[trashButton setState:([preferences boolForKey:MGMMoveToTrash] ? NSOnState : NSOffState)];
}
}
return self;
}
- (void)dealloc {
[self save:self];
[mainView release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {
[theItem setLabel:[self title]];
[theItem setPaletteLabel:[theItem label]];
[theItem setImage:[NSImage imageNamed:@"Advanced"]];
}
+ (NSString *)title {
return @"Advanced";
}
- (NSView *)preferencesView {
return mainView;
}
- (IBAction)save:(id)sender {
[preferences setObject:[snapshotField stringValue] forKey:MGMCustomSnapshotURL];
[preferences setBool:([trashButton state]==NSOnState) forKey:MGMMoveToTrash];
}
@end

36
Classes/Preferences/MGMGeneralPane.h

@ -0,0 +1,36 @@
//
// MGMGeneralPane.h
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import <Cocoa/Cocoa.h>
#import <MGMUsers/MGMPreferencesPane.h>
@interface MGMGeneralPane : MGMPreferencesPane {
IBOutlet NSView *mainView;
IBOutlet NSButton *doneSoundButton;
IBOutlet NSButton *launchWhenDoneButton;
IBOutlet NSButton *quitAfterLaunchButton;
}
- (id)initWithPreferences:(MGMPreferences *)thePreferences;
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem;
+ (NSString *)title;
- (NSView *)preferencesView;
- (IBAction)save:(id)sender;
@end

60
Classes/Preferences/MGMGeneralPane.m

@ -0,0 +1,60 @@
//
// MGMGeneralPane.m
// Chromatic
//
// Created by Mr. Gecko on 6/10/11.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
// OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
#import "MGMGeneralPane.h"
#import "MGMController.h"
#import <MGMUsers/MGMUsers.h>
@implementation MGMGeneralPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"GeneralPane" owner:self]) {
NSLog(@"Unable to load Nib for General Preferences");
[self release];
self = nil;
} else {
[doneSoundButton setState:([preferences boolForKey:MGMDoneSound] ? NSOnState : NSOffState)];
[launchWhenDoneButton setState:([preferences boolForKey:MGMLaunchWhenDone] ? NSOnState : NSOffState)];
[quitAfterLaunchButton setState:([preferences boolForKey:MGMQuitAfterLaunch] ? NSOnState : NSOffState)];
}
}
return self;
}
- (void)dealloc {
[mainView release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {
[theItem setLabel:[self title]];
[theItem setPaletteLabel:[theItem label]];
[theItem setImage:[NSImage imageNamed:@"General"]];
}
+ (NSString *)title {
return @"General";
}
- (NSView *)preferencesView {
return mainView;
}
- (IBAction)save:(id)sender {
[preferences setBool:([doneSoundButton state]==NSOnState) forKey:MGMDoneSound];
[preferences setBool:([launchWhenDoneButton state]==NSOnState) forKey:MGMLaunchWhenDone];
[preferences setBool:([quitAfterLaunchButton state]==NSOnState) forKey:MGMQuitAfterLaunch];
}
@end

7
Classes/Prefix.pch

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'Chromatic' target in the 'Chromatic' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

14
Classes/main.m

@ -0,0 +1,14 @@
//
// main.m
// Chromatic
//
// Created by James on 6/9/11.
// Copyright 2011 Mr. Gecko's Media. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}

1
Frameworks/GeckoReporter.framework/GeckoReporter

@ -0,0 +1 @@
Versions/Current/GeckoReporter

1
Frameworks/GeckoReporter.framework/Headers

@ -0,0 +1 @@
Versions/Current/Headers

1
Frameworks/GeckoReporter.framework/Resources

@ -0,0 +1 @@
Versions/Current/Resources

BIN
Frameworks/GeckoReporter.framework/Versions/A/GeckoReporter

12
Frameworks/GeckoReporter.framework/Versions/A/Headers/GeckoReporter.h

@ -0,0 +1,12 @@
//
// GeckoReporter.h
// GeckoReporter
//
// Created by Mr. Gecko on 12/27/09.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import "MGMReporter.h"
#import "MGMSender.h"
#import "MGMSystemInfo.h"
#import "MGMLog.h"

16
Frameworks/GeckoReporter.framework/Versions/A/Headers/MGMFeedback.h

@ -0,0 +1,16 @@
//
// MGMFeedback.h
// GeckoReporter
//
// Created by Mr. Gecko on 1/2/10.
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>
@interface MGMFeedback : NSObject {
}
- (IBAction)openBugReport:(id)sender;
- (IBAction)openContact:(id)sender;
@end