Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Drag config filenames when dragging from the applications table.
Browse files Browse the repository at this point in the history
  • Loading branch information
Manfred committed Jan 10, 2011
1 parent ee1d2c7 commit 226f881
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/PassengerPref.m
Expand Up @@ -110,7 +110,7 @@ - (BOOL) tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)
NSMutableArray *paths = [NSMutableArray arrayWithCapacity:[rowIndexes count]];

for (application in [applications objectsAtIndexes:rowIndexes]) {
[paths addObject:[application path]];
[paths addObject:[application configFilename]];
}
[pboard declareTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil] owner:self];
[pboard setPropertyList:paths forType:NSFilenamesPboardType];
Expand Down
4 changes: 2 additions & 2 deletions app/models/Application.h
Expand Up @@ -11,15 +11,15 @@ enum {

NSArray *environments;

NSString *host, *aliases, *path;
NSString *host, *aliases, *path, *configFilename;
NSUInteger environment;
BOOL dirty, valid, fresh;

NSDictionary *beforeChanges;
}

@property (assign) id delegate;
@property (retain) NSString *host, *aliases, *path;
@property (retain) NSString *host, *aliases, *path, *configFilename;
@property (assign) NSUInteger environment;
@property (assign, getter=isDirty) BOOL dirty;
@property (assign, getter=isValid) BOOL valid;
Expand Down
6 changes: 4 additions & 2 deletions app/models/Application.m
Expand Up @@ -4,7 +4,7 @@
@implementation Application

@synthesize delegate;
@synthesize host, aliases, path;
@synthesize host, aliases, path, configFilename;
@synthesize environment;
@synthesize dirty, valid, fresh;

Expand Down Expand Up @@ -50,7 +50,8 @@ - (void) updateWithAttributes:(NSDictionary *)attributes {
self.host = [attributes objectForKey:@"host"];
self.aliases = [attributes objectForKey:@"aliases"];
self.path = [attributes objectForKey:@"path"];
self.environment = [environments indexOfObject:[attributes objectForKey:@"environment"]];
self.environment = [environments indexOfObject:[attributes objectForKey:@"environment"]];
self.configFilename = [attributes objectForKey:@"config_filename"];
}

- (NSMutableDictionary*) toDictionary {
Expand All @@ -60,6 +61,7 @@ - (NSMutableDictionary*) toDictionary {
[data setValue:self.aliases forKey:@"aliases"];
[data setValue:self.path forKey:@"path"];
[data setValue:[environments objectAtIndex:environment] forKey:@"environment"];
[data setValue:self.configFilename forKey:@"config_filename"];

return data;
}
Expand Down

0 comments on commit 226f881

Please sign in to comment.