Commit 7297e3b2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* gui behaviour change: the textfields are no longer disabled if another...

* gui behaviour change: the textfields are no longer disabled if another protocol is enabled through the knobs. the user can click the fields now to switch the protocol. I'm unsure whether this could and should be done in the disc tab as well. closes #914
parent 10a72995
......@@ -324,6 +324,7 @@
};
SUPERCLASS = NSObject;
},
{CLASS = VLCOpenTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; },
{
ACTIONS = {
announceChanged = id;
......
......@@ -13,6 +13,10 @@
<integer>2206</integer>
<integer>2199</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>636</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
<key>IBUsesTextArchiving</key>
......
......@@ -105,6 +105,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (void)setSubPanel;
- (void)openTarget:(int)i_type;
- (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
- (void)textFieldWasClicked:(NSNotification *)o_notification;
- (void)openFileGeneric;
- (void)openFilePathChanged:(NSNotification *)o_notification;
......@@ -137,3 +138,9 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (void)openFile;
@end
@interface VLCOpenTextField : NSTextField
{
}
- (void)mouseDown:(NSEvent *)theEvent;
@end
......@@ -231,6 +231,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
selector: @selector(openNetInfoChanged:)
name: NSControlTextDidChangeNotification
object: o_net_http_url];
/* register clicks on text fields */
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(textFieldWasClicked:)
name: @"VLCOpenTextFieldWasClicked"
object: nil];
}
- (void)setSubPanel
......@@ -385,7 +391,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
else if( [o_label isEqualToString: _NS("Network")] )
{
[self openNetModeChanged: nil];
[self openNetInfoChanged: nil];
}
}
......@@ -403,7 +409,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (void)openNet
{
[self openNetModeChanged: nil];
[self openNetInfoChanged: nil];
[self openTarget: 2];
}
......@@ -649,25 +655,27 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
}
- (IBAction)openNetModeChanged:(id)sender
- (void)textFieldWasClicked:(NSNotification *)o_notification
{
NSString *o_mode;
BOOL b_udp = FALSE;
BOOL b_udpm = FALSE;
BOOL b_http = FALSE;
o_mode = [[o_net_mode selectedCell] title];
if( [o_notification object] == o_net_udp_port )
[o_net_mode selectCellAtRow: 0 column: 0];
else if( [o_notification object] == o_net_udpm_addr ||
[o_notification object] == o_net_udpm_port )
[o_net_mode selectCellAtRow: 1 column: 0];
else
[o_net_mode selectCellAtRow: 2 column: 0];
if( [o_mode isEqualToString: _NS("UDP/RTP")] ) b_udp = TRUE;
else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] ) b_udpm = TRUE;
else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS/RTSP")] ) b_http = TRUE;
[self openNetInfoChanged: nil];
}
[o_net_udp_port setEnabled: b_udp];
[o_net_udp_port_stp setEnabled: b_udp];
[o_net_udpm_addr setEnabled: b_udpm];
[o_net_udpm_port setEnabled: b_udpm];
[o_net_udpm_port_stp setEnabled: b_udpm];
[o_net_http_url setEnabled: b_http];
- (IBAction)openNetModeChanged:(id)sender
{
if( [[sender selectedCell] tag] == 0 )
[o_panel makeFirstResponder: o_net_udp_port];
else if ( [[sender selectedCell] tag] == 1 )
[o_panel makeFirstResponder: o_net_udpm_addr];
else
[o_panel makeFirstResponder: o_net_http_url];
[self openNetInfoChanged: nil];
}
......@@ -679,10 +687,16 @@ static VLCOpen *_o_sharedMainInstance = nil;
if( i_tag == 0 )
{
[o_net_udp_port setIntValue: [o_net_udp_port_stp intValue]];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCOpenTextFieldWasClicked"
object: o_net_udp_port];
[o_panel makeFirstResponder: o_net_udp_port];
}
else if( i_tag == 1 )
{
[o_net_udpm_port setIntValue: [o_net_udpm_port_stp intValue]];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCOpenTextFieldWasClicked"
object: o_net_udpm_port];
[o_panel makeFirstResponder: o_net_udpm_port];
}
[self openNetInfoChanged: nil];
......@@ -845,3 +859,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
@end
@implementation VLCOpenTextField
- (void)mouseDown:(NSEvent *)theEvent
{
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCOpenTextFieldWasClicked"
object: self];
[super mouseDown: theEvent];
}
@end
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment