Skip to content

Commit

Permalink
Change save/add button label depending on if existing output is being…
Browse files Browse the repository at this point in the history
… edited or a new one is being created
  • Loading branch information
zakk4223 committed Nov 26, 2015
1 parent 504c4f3 commit 7bbc60d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CocoaSplit/Interface/CSNewOutputWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
@property (strong) NSViewController *pluginViewController;
@property (strong) NSMutableDictionary *compressors;
@property (strong) CompressionSettingsPanelController *compressionPanelController;
@property (strong) NSString *buttonLabel;

@end
4 changes: 3 additions & 1 deletion CocoaSplit/Interface/CSNewOutputWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ -(instancetype) init
NSMutableDictionary *servicePlugins = [[CSPluginLoader sharedPluginLoader] streamServicePlugins];

self.outputTypes = servicePlugins.allKeys;
self.outputDestination = [[OutputDestination alloc] init];
_outputDestination = [[OutputDestination alloc] init];
self.buttonLabel = @"Add";
}

return self;
Expand All @@ -34,6 +35,7 @@ -(instancetype) init
-(void)setOutputDestination:(OutputDestination *)outputDestination
{
_outputDestination = outputDestination;
self.buttonLabel = @"Save";
if (outputDestination.streamServiceObject)
{
self.streamServiceObject = outputDestination.streamServiceObject;
Expand Down
1 change: 1 addition & 0 deletions CocoaSplit/Interface/CSNewOutputWindowController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
</buttonCell>
<connections>
<action selector="addButtonAction:" target="-2" id="8yh-RF-fOs"/>
<binding destination="-2" name="title" keyPath="self.buttonLabel" id="wbi-vq-yJS"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hIE-y0-gxF">
Expand Down

0 comments on commit 7bbc60d

Please sign in to comment.