]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/open.m
* seperated the open, sout and sub-open dialogues from the main nib
[vlc] / modules / gui / macosx / open.m
index 021a74f61d1e82935b0bf5a75286c171fc325fc2..4bbbbd53e660e6411969ec15d48a5eeac3676fd9 100644 (file)
@@ -129,6 +129,29 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
  *****************************************************************************/
 @implementation VLCOpen
 
+static VLCOpen *_o_sharedMainInstance = nil;
+
++ (VLCOpen *)sharedInstance
+{
+    return _o_sharedMainInstance ? _o_sharedMainInstance : [[self alloc] init];
+}
+
+- (id)init
+{
+    if( _o_sharedMainInstance) {
+        [self dealloc];
+    } else {
+        _o_sharedMainInstance = [super init];
+    }
+    
+    return _o_sharedMainInstance;
+}
+
+- (void)getReady
+{
+    [NSBundle loadNibNamed:@"Open" owner:self];
+}
+
 - (void)awakeFromNib
 {
     intf_thread_t * p_intf = VLCIntf;
@@ -164,7 +187,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
 
     [[o_net_mode cellAtRow:0 column:0] setTitle: _NS("UDP/RTP")];
     [[o_net_mode cellAtRow:1 column:0] setTitle: _NS("UDP/RTP Multicast")];
-    [[o_net_mode cellAtRow:2 column:0] setTitle: _NS("HTTP/FTP/MMS")];
+    [[o_net_mode cellAtRow:2 column:0] setTitle: _NS("HTTP/FTP/MMS/RTSP")];
 
     [o_net_udp_port setIntValue: config_GetInt( p_intf, "server-port" )];
     [o_net_udp_port_stp setIntValue: config_GetInt( p_intf, "server-port" )];
@@ -233,6 +256,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     [o_file_sub_align_lbl setStringValue: _NS("Subtitles justification")];
     [o_file_sub_align_pop removeAllItems];
     [o_file_sub_ok_btn setStringValue: _NS("OK")];
+    [o_file_sub_font_box setTitle: _NS("Font Properties")];
+    [o_file_sub_file_box setTitle: _NS("Subtitle File")];
 
     p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
 
@@ -356,19 +381,19 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     }  
 }
 
-- (IBAction)openFileGeneric:(id)sender
+- (void)openFileGeneric
 {
     [self openFilePathChanged: nil];
     [self openTarget: 0];
 }
 
-- (IBAction)openDisc:(id)sender
+- (void)openDisc
 {
     [self openDiscTypeChanged: nil];
     [self openTarget: 1];
 }
 
-- (IBAction)openNet:(id)sender
+- (void)openNet
 {
     [self openNetModeChanged: nil];
     [self openTarget: 2];
@@ -555,7 +580,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
         if ( [o_device isEqualToString:
                 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
             o_device = @"";
-        o_mrl_string = [NSString stringWithFormat: @"vcd://%@@%i,%i",
+        o_mrl_string = [NSString stringWithFormat: @"vcd://%@@%i:%i",
                         o_device, i_title, i_chapter]; 
     }
     else if ( [o_type isEqualToString: _NS("Audio CD")] )
@@ -575,7 +600,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
             o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
                             o_device]; 
         else
-            o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i,%i",
+            o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i:%i",
                             o_device, i_title, i_chapter]; 
     }
     else /* VIDEO_TS folder */
@@ -584,7 +609,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
             o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
                             o_videots]; 
         else
-            o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i,%i",
+            o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i:%i",
                             o_videots, i_title, i_chapter]; 
     }
 
@@ -627,7 +652,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
 
     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")] ) b_http = TRUE;
+    else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS/RTSP")] ) b_http = TRUE;
 
     [o_net_udp_port setEnabled: b_udp];
     [o_net_udp_port_stp setEnabled: b_udp];
@@ -688,12 +713,12 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
                 [o_mrl_string stringByAppendingFormat: @":%i", i_port]; 
         } 
     }
-    else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS")] )
+    else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS/RTSP")] )
     {
         NSString *o_url = [o_net_http_url stringValue];
 
         if ( ![o_url hasPrefix:@"http:"] && ![o_url hasPrefix:@"ftp:"]
-              && ![o_url hasPrefix:@"mms"] )
+              && ![o_url hasPrefix:@"mms"] && ![o_url hasPrefix:@"rtsp"] )
             o_mrl_string = [NSString stringWithFormat: @"http://%@", o_url];
         else
             o_mrl_string = o_url;
@@ -702,7 +727,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     [o_mrl setStringValue: o_mrl_string];
 }
 
-- (IBAction)openFile:(id)sender
+- (void)openFile
 {
     NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
     int i;