// // PLSOverseer.h // Pulse // // Created by Matt Attaway on 1/20/14. // Copyright (c) 2014 Zen of the Monkey. All rights reserved. // #import <Foundation/Foundation.h> #import "FileSystemWatcher.h" @class P4Message; @class PLSOverseer; @protocol PLSOverseerDelegate <NSObject> @required -(void)needPassword:(PLSOverseer*)os; -(void)needPasswordNow:(PLSOverseer*)os; -(void)connectionDown:(PLSOverseer*)os; -(void)connectionUp:(PLSOverseer*)os; @end @interface PLSOverseer : NSObject <FileSystemWatcherDelegate, NSUserNotificationCenterDelegate> @property NSString* port; @property NSString* user; @property NSString* client; @property NSString* charset; @property (strong) NSString* path; @property NSInteger highChange; @property BOOL needsLogin; @property BOOL connectionDown; @property NSObject<PLSOverseerDelegate >* delegate; -(id)initWithSettings:(NSString*)port user:(NSString*)user client:(NSString*)client path:(NSString*)path highChange:(NSInteger)highChange charset:(NSString*)charset; -(id)initWithDictionary:(NSDictionary*)dict; // for FileSystemWatcher delegate -(void)fileEvent:(NSString*)file; // for timer -(void)checkForUpdates:(NSTimer*)theTimer; // for NSUserNotificationCenterDelegate -(BOOL)userNotificationCenter:(NSUserNotificationCenter*)center shouldPresentNotification:(NSUserNotification*)notification; -(NSDictionary*)getSettings; -(void)startTracking; -(void)pauseTracking; -(P4Message*)login:(NSString*)password; // some method to check to see if dead connections have come back @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#21 | 8706 | Matt Attaway |
Infrastructure work to more intelligently handle FSEvents Prior to this change all file system events were equal; chown-ing a file was considered the same as changing the content. With this change we: 1) bundle all of the file events into one operation instead or doing it one file at a time 2) ignore any file events that are not create/delete/modify/rename The interfaces are all in place, but the Overseers are still not taking advantage of this information, so there’s no user visible change at this time. (hopefully) Infrastructure only change |
||
#20 | 8702 | Matt Attaway |
Add the ability to pause updates on a connection After some fun today where I added a gazillion files while running automated tests I realized there is is much to be said for being able to pause your automated friend. This change adds the ability to pause updates on a connection. Syncs and file events are not tracked while updates are paused. Paused connections are also not used when figuring out what the state icon should be. Also fix a bug related to all of this where a server coming online while in the connection dialog would not cause the icon to update. We now do an icon state check after coming out of the connection dialog. In addition, we use the proper timer when coming out of the connection dialog, not always the sync timer. User visible change |
||
#19 | 8692 | Matt Attaway |
Add auto-submit capability to Pulse If you so choose you may now configure Pulse to automatically submit files as soon as they are changed. This is done as part of the file event watcher; files are opened with reconcile and if configured to do so immediately submitted with a boilerplate commit message. For obvious reasons auto-commit is off by default. User visible change |
||
#18 | 8657 | Matt Attaway |
Tidy up constructors and whitespace a bit Finally figured out the proper way to have a designated contructor in Obj-C. Hooray for progress. No user visible change. |
||
#17 | 8656 | Matt Attaway |
Move login check out to a thread too At this point the only Perforce command that is running in the main thread is login from the login dialog itself. This should help keep Pulse peppy. User visible change (less lag) |
||
#16 | 8654 | Matt Attaway |
Move connections checks into threads Getting everything slow off of the main thread. That means you connection checks. User visible change (in so much as it’s less laggy now) |
||
#15 | 8652 | Matt Attaway |
Rework login to take advantage of other clients logging in Previously the Overseer entirely shut down operations when it noticed that the user needed to login. This is all well and good if you only use Pulse, but less helpful if use other clients too. This change introduces a new timer that attempts ‘p4 login -s’ every few seconds to see if there is a valid ticket. This is not unlike the timer that gets enabled when a connection is lost. This change also includes some WIP on submit support that I was too lazy to pull out. User visible changelist |
||
#14 | 8635 | Matt Attaway |
Move reconcile and sync calls off into threads to improve UI performance Not shockingly, running a giant p4 sync in the main thread is a bad idea. With this change I put on my grown up pants and move all of the potentially long running commands into their own threads. User visible change |
||
#13 | 8597 | Matt Attaway |
Handle disconnected servers automatically If Pulse loses its connection with the Perforce server it now reports that the connection is down and starts a new timer to look for a live connection. The Overseer handles all of this on its own; unlike login there’s really nothing for the user to do. This change also fixes a bug where the login dialog was not being properly regenerated for connections after the first. User visible change |
||
#12 | 8595 | Matt Attaway |
WIP on handling connection errors With this change we report the errors to our delegate, but we don’t attempt to recover. That will come with the next checkin. This change does add in the protocol for handling these errors. User visible change |
||
#11 | 8592 | Matt Attaway |
Add less aggressive notification when background processes detect need to login Instead of popping a dialog up right in your face we use a standard notification and change the status icon to indicate Pulse is unhappy. Using the login menu item will log the user is and restart the background processes. User visible change. |
||
#10 | 8590 | Matt Attaway |
Add crude login capabilities This is the first step toward getting the login behavior I want. Right now anytime a Peforce command gets a login error the Overseer ion charge notifies its delegate, which is currently the AppDelegate. The AppDelegate then kicks off the requisite login dialog which gets the password and does the login. There’s no error handling or feedback and the dialog pops up even when it is a background process that hit the error. The next step is to implement the Login menu item and the ‘need login’ tool tip and status icon. User visible (and possibly user annoying) change |
||
#9 | 8575 | Matt Attaway |
Automatically handle Unicode servers; stub out login handling There's a lot going on in this change: * Fixed a bug where charset was always set to none * Added protocol on PLSOverseer so that something can properly handle login errors * PLSAppDelegate implements stubs for the PLSOverseer protocol * PLSOverseers automatically configure themselves for Unicode servers now * Ripped out handleCommonErrors: because it turns out I want to handle the same error in multiple ways. Next step is to properly handle 'p4 login' and request a password. User visible changes. |
||
#8 | 8571 | Matt Attaway |
Expand connection properties for charset; add method to crudely handle common errors This is the next step towards handling login and unicode errors. The interfaces have been widened to track the charset. I’m using a string at this point so that I can just pass in the character set without having to test it; ‘none’ works with non-Unicode servers. The handler just logs what it would do so that I can test the behavior. Next step is to actually ask the user for their password and run login. Still no real functional change. |
||
#7 | 8527 | Matt Attaway |
Improve query efficiency and improve feedback to user This change adds a check for the highest synced changed. Instead of blindly running sync over and over Pulse now runs ‘p4 changes -m 1 //<client>/...' and if the number is higher than the stored value it runs sync and then stores the new highest change. Highest change numbers are written to the preferences to further reduce needless queries. With this change we also fetch the list of changes between the previous high change and the new one so that we can report the number of changes synced. |
||
#6 | 8523 | Matt Attaway |
Prevent double start call to FSEvents This was a bit of shuffling, but the behavior is much tidier now. Overseers do not start overseeing until they are explicitly told to do so. This makes their behavior much more predictable. |
||
#5 | 8522 | Matt Attaway |
Clean up the behavior of the connections dialog All of the Overseers are now paused while the connection dialog is up so that the user can fiddle with their settings in peace. |
||
#4 | 8519 | Matt Attaway |
Finally add a connections dialog to manage connections It’s taken a week to figure out how to manage windows and tabelviews, but this change adds a crude connection dialog to add and remove connections as well as save them out to the preferences file. More to do to make it more sane, but it works for now! |
||
#3 | 8511 | Matt Attaway |
Get a very crude form of reconcile and sync working. Continuing in my purely experimental mode, this change adds rough versions of the core features: 1) Every 5 seconds a timer fires and runs sync to grab new files. The user is made aware of the synced files via an OS X notification. 2) When files are modified ‘p4 reconcile’ is kicked off on the entire workspace Of course there is no error or sanity checking, but it is technically usable for very rough definitions of usable. |
||
#2 | 8509 | Matt Attaway |
Add support for loading multiple connections The code is rough, but Pulse can now load up and start watching multiple paths, each associated with a separate Perforce server. Also cleaned up some white space and normalized the ‘*’ used to denote pointers. |
||
#1 | 8506 | Matt Attaway |
Pull model out of controller; disable dock icon No functional change, but the code is moderately more sane. This change introduces an Overseer object that is responsible for maintaining one path/Port/User/Client combination. All of the delegation responsibilities move to the Overseer, as does FileSystemWatcher configuration. Overall this just sets me up to actually monitor multiple paths. |