New: XcodeCapp 3 tweaks...

- Renamed XcodeSupport to .XcodeSupport.
- Added "Reset Project" to menu, it closes the project in Xcode if necessary, removes .XcodeSupport and .xcodeproj, then reloads.
- Added separate preferences for showing errors panel on warnings/errors. You may not want to see the panel if there are category warnings.
- New status icons (again).
- If an error occurs, the status icon turns red when all processing is done.
- Reworked notifications. Objective-J parsing is notified when done. Xib conversion notifies at beginning and end, because it typically takes a few seconds. Individual file notifications are suppressed if a project is being loaded.
This commit is contained in:
Aparajita Fishman
2013-04-25 13:11:22 -04:00
parent 949af39041
commit bf6ce64209
19 changed files with 388 additions and 278 deletions
+21 -20
View File
@@ -37,6 +37,7 @@ AppController *SharedAppControllerInstance = nil;
@property (nonatomic) NSImage *iconActive;
@property (nonatomic) NSImage *iconInactive;
@property (nonatomic) NSImage *iconWorking;
@property (nonatomic) NSImage *iconError;
@property (nonatomic) NSMenu *menuHistory;
@property NSStatusItem *statusItem;
@@ -104,15 +105,16 @@ AppController *SharedAppControllerInstance = nil;
- (void)registerDefaults
{
NSDictionary *appDefaults = @{
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactMode: @YES,
kDefaultXCCReopenLastProject: @YES,
kDefaultXCCAutoOpenErrorsPanel: @YES,
kDefaultXCCProjectHistory: [NSArray new],
kDefaultMaxRecentProjects: @20
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactMode: @YES,
kDefaultXCCReopenLastProject: @YES,
kDefaultXCCAutoOpenErrorsPanelOnWarnings: @YES,
kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES,
kDefaultXCCProjectHistory: [NSArray new],
kDefaultMaxRecentProjects: @20
};
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -171,6 +173,14 @@ AppController *SharedAppControllerInstance = nil;
return _iconWorking;
}
- (NSImage *)iconError
{
if (!_iconError)
_iconError = [NSImage imageNamed:@"icon-error"];
return _iconError;
}
- (NSMenu *)menuHistory
{
if (!_menuHistory)
@@ -205,7 +215,7 @@ AppController *SharedAppControllerInstance = nil;
- (void)XcodeCappConversionDidStop:(NSNotification *)aNotification
{
if (!self.xcc.isLoadingProject)
self.statusItem.image = self.iconActive;
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
}
- (void)XcodeCappDidPopulateProject:(NSNotification *)aNotification
@@ -214,7 +224,7 @@ AppController *SharedAppControllerInstance = nil;
- (void)XcodeCappListeningDidStart:(NSNotification *)aNotification
{
self.statusItem.image = self.iconActive;
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
self.menuItemListen.title = [NSString stringWithFormat:@"Close “%@”", self.xcc.currentProjectPath.lastPathComponent];
self.menuItemListen.action = @selector(stopListening:);
}
@@ -308,15 +318,6 @@ AppController *SharedAppControllerInstance = nil;
[self updateHistoryMenu];
}
- (IBAction)openInXcode:(id)aSender
{
if (!self.xcc.currentProjectPath)
return;
DLog(@"Opening Xcode project at: %@", self.xcc.XcodeSupportProjectURL.path);
system([[NSString stringWithFormat:@"open \"%@\"", self.xcc.XcodeSupportProjectURL.path] UTF8String]);
}
- (IBAction)openHelp:(id)aSender
{
[self.helpTextView readRTFDFromFile:[[NSBundle mainBundle] pathForResource:@"help" ofType:@"rtfd"]];