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 @@ ...@@ -324,6 +324,7 @@
}; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = VLCOpenTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; },
{ {
ACTIONS = { ACTIONS = {
announceChanged = id; announceChanged = id;
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
<integer>2206</integer> <integer>2206</integer>
<integer>2199</integer> <integer>2199</integer>
</array> </array>
<key>IBOpenObjects</key>
<array>
<integer>636</integer>
</array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8L127</string> <string>8L127</string>
<key>IBUsesTextArchiving</key> <key>IBUsesTextArchiving</key>
......
...@@ -105,6 +105,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class ); ...@@ -105,6 +105,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (void)setSubPanel; - (void)setSubPanel;
- (void)openTarget:(int)i_type; - (void)openTarget:(int)i_type;
- (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi; - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
- (void)textFieldWasClicked:(NSNotification *)o_notification;
- (void)openFileGeneric; - (void)openFileGeneric;
- (void)openFilePathChanged:(NSNotification *)o_notification; - (void)openFilePathChanged:(NSNotification *)o_notification;
...@@ -137,3 +138,9 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class ); ...@@ -137,3 +138,9 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (void)openFile; - (void)openFile;
@end @end
@interface VLCOpenTextField : NSTextField
{
}
- (void)mouseDown:(NSEvent *)theEvent;
@end
...@@ -231,6 +231,12 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -231,6 +231,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
selector: @selector(openNetInfoChanged:) selector: @selector(openNetInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_net_http_url]; object: o_net_http_url];
/* register clicks on text fields */
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(textFieldWasClicked:)
name: @"VLCOpenTextFieldWasClicked"
object: nil];
} }
- (void)setSubPanel - (void)setSubPanel
...@@ -385,7 +391,7 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -385,7 +391,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
} }
else if( [o_label isEqualToString: _NS("Network")] ) else if( [o_label isEqualToString: _NS("Network")] )
{ {
[self openNetModeChanged: nil]; [self openNetInfoChanged: nil];
} }
} }
...@@ -403,7 +409,7 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -403,7 +409,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (void)openNet - (void)openNet
{ {
[self openNetModeChanged: nil]; [self openNetInfoChanged: nil];
[self openTarget: 2]; [self openTarget: 2];
} }
...@@ -649,25 +655,27 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -649,25 +655,27 @@ static VLCOpen *_o_sharedMainInstance = nil;
} }
} }
- (IBAction)openNetModeChanged:(id)sender - (void)textFieldWasClicked:(NSNotification *)o_notification
{ {
NSString *o_mode; if( [o_notification object] == o_net_udp_port )
BOOL b_udp = FALSE; [o_net_mode selectCellAtRow: 0 column: 0];
BOOL b_udpm = FALSE; else if( [o_notification object] == o_net_udpm_addr ||
BOOL b_http = FALSE; [o_notification object] == o_net_udpm_port )
[o_net_mode selectCellAtRow: 1 column: 0];
o_mode = [[o_net_mode selectedCell] title]; else
[o_net_mode selectCellAtRow: 2 column: 0];
if( [o_mode isEqualToString: _NS("UDP/RTP")] ) b_udp = TRUE; [self openNetInfoChanged: nil];
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;
[o_net_udp_port setEnabled: b_udp]; - (IBAction)openNetModeChanged:(id)sender
[o_net_udp_port_stp setEnabled: b_udp]; {
[o_net_udpm_addr setEnabled: b_udpm]; if( [[sender selectedCell] tag] == 0 )
[o_net_udpm_port setEnabled: b_udpm]; [o_panel makeFirstResponder: o_net_udp_port];
[o_net_udpm_port_stp setEnabled: b_udpm]; else if ( [[sender selectedCell] tag] == 1 )
[o_net_http_url setEnabled: b_http]; [o_panel makeFirstResponder: o_net_udpm_addr];
else
[o_panel makeFirstResponder: o_net_http_url];
[self openNetInfoChanged: nil]; [self openNetInfoChanged: nil];
} }
...@@ -679,10 +687,16 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -679,10 +687,16 @@ static VLCOpen *_o_sharedMainInstance = nil;
if( i_tag == 0 ) if( i_tag == 0 )
{ {
[o_net_udp_port setIntValue: [o_net_udp_port_stp intValue]]; [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 ) else if( i_tag == 1 )
{ {
[o_net_udpm_port setIntValue: [o_net_udpm_port_stp intValue]]; [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]; [self openNetInfoChanged: nil];
...@@ -845,3 +859,15 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -845,3 +859,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
} }
@end @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