Commit ac4eb790 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* clean up (mostly replacements of nestings of stringByAppendingString by stringWithFormat)

* removed the stupid "wizard help window" and replaced the help sheets with calls of NSBeginInformationalAlertSheet. This might be beautified with NSAlerts in the future, since we don't care for 10.2 anymore.
parent 90b1a99b
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
"t6_mrInfo_sap" = id; "t6_mrInfo_sap" = id;
"t6_mrInfo_ttl" = id; "t6_mrInfo_ttl" = id;
"t7_selectTrnscdDestFile" = id; "t7_selectTrnscdDestFile" = id;
"wh_closeSheet" = id;
}; };
CLASS = VLCWizard; CLASS = VLCWizard;
LANGUAGE = ObjC; LANGUAGE = ObjC;
...@@ -131,11 +130,7 @@ ...@@ -131,11 +130,7 @@
"o_t8_txt_trnscdVideo" = id; "o_t8_txt_trnscdVideo" = id;
"o_t8_txt_ttl" = id; "o_t8_txt_ttl" = id;
"o_tab_pageHolder" = id; "o_tab_pageHolder" = id;
"o_wh_btn_okay" = id;
"o_wh_txt_text" = id;
"o_wh_txt_title" = id;
"o_wizard_window" = id; "o_wizard_window" = id;
"o_wizardhelp_window" = id;
}; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
} }
......
...@@ -11,13 +11,12 @@ ...@@ -11,13 +11,12 @@
<integer>6</integer> <integer>6</integer>
<integer>14</integer> <integer>14</integer>
<integer>10</integer> <integer>10</integer>
<integer>270</integer>
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>6</integer> <integer>6</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8F46</string> <string>8G32</string>
</dict> </dict>
</plist> </plist>
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
IBOutlet id o_btn_forward; IBOutlet id o_btn_forward;
IBOutlet id o_tab_pageHolder; IBOutlet id o_tab_pageHolder;
IBOutlet id o_wizard_window; IBOutlet id o_wizard_window;
IBOutlet id o_wizardhelp_window;
IBOutlet id o_wh_txt_title;
IBOutlet id o_wh_txt_text;
IBOutlet id o_wh_btn_okay;
IBOutlet id o_playlist_wizard; IBOutlet id o_playlist_wizard;
/* page one ("Hello") */ /* page one ("Hello") */
...@@ -170,7 +166,6 @@ ...@@ -170,7 +166,6 @@
- (IBAction)t6_mrInfo_sap:(id)sender; - (IBAction)t6_mrInfo_sap:(id)sender;
- (IBAction)t67_mrInfo_local:(id)sender; - (IBAction)t67_mrInfo_local:(id)sender;
- (IBAction)t7_selectTrnscdDestFile:(id)sender; - (IBAction)t7_selectTrnscdDestFile:(id)sender;
- (IBAction)wh_closeSheet:(id)sender;
+ (VLCWizard *)sharedInstance; + (VLCWizard *)sharedInstance;
......
/***************************************************************************** /*****************************************************************************
* wizard.m: MacOS X Streaming Wizard * wizard.m: MacOS X Streaming Wizard
***************************************************************************** *****************************************************************************
* Copyright (C) 2005 the VideoLAN team * Copyright (C) 2005-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Felix Kühne <fkuehne@users.sf.net> * Authors: Felix Kühne <fkuehne@users.sf.net>
...@@ -73,7 +73,6 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -73,7 +73,6 @@ static VLCWizard *_o_sharedInstance = nil;
{ {
/* some minor cleanup */ /* some minor cleanup */
[o_t2_tbl_plst setEnabled:NO]; [o_t2_tbl_plst setEnabled:NO];
[o_wizardhelp_window setExcludedFromWindowsMenu:YES];
o_userSelections = [[NSMutableDictionary alloc] init]; o_userSelections = [[NSMutableDictionary alloc] init];
[o_btn_backward setEnabled:NO]; [o_btn_backward setEnabled:NO];
...@@ -470,9 +469,6 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -470,9 +469,6 @@ static VLCWizard *_o_sharedInstance = nil;
stringByAppendingString: @":"]]; stringByAppendingString: @":"]];
[o_t8_txt_local setStringValue: [_NS("Local playback") \ [o_t8_txt_local setStringValue: [_NS("Local playback") \
stringByAppendingString: @":"]]; stringByAppendingString: @":"]];
/* wizard help window */
[o_wh_btn_okay setTitle: _NS("OK")];
} }
- (void)initWithExtractValuesFrom: (NSString *)from to: (NSString *)to \ - (void)initWithExtractValuesFrom: (NSString *)from to: (NSString *)to \
...@@ -1154,20 +1150,20 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1154,20 +1150,20 @@ static VLCWizard *_o_sharedInstance = nil;
if(! [[o_userSelections objectForKey:@"partExtractFrom"] isEqualToString:@""] ) if(! [[o_userSelections objectForKey:@"partExtractFrom"] isEqualToString:@""] )
{ {
playlist_ItemAddOption( p_item, [[@"start-time=" \ playlist_ItemAddOption( p_item, [[NSString stringWithFormat: \
stringByAppendingString: [o_userSelections \ @"start-time=%@", [o_userSelections objectForKey: \
objectForKey:@"partExtractFrom"]] UTF8String] ); @"partExtractFrom"]] UTF8String] );
} }
if(! [[o_userSelections objectForKey:@"partExtractTo"] isEqualToString:@""] ) if(! [[o_userSelections objectForKey:@"partExtractTo"] isEqualToString:@""] )
{ {
playlist_ItemAddOption( p_item, [[@"stop-time=" \ playlist_ItemAddOption( p_item, [[NSString stringWithFormat: \
stringByAppendingString: [o_userSelections objectForKey: \ @"stop-time=%@", [o_userSelections objectForKey: \
@"partExtractTo"]] UTF8String] ); @"partExtractTo"]] UTF8String] );
} }
playlist_ItemAddOption( p_item, [[@"ttl=" stringByAppendingString: \ playlist_ItemAddOption( p_item, [[NSString stringWithFormat: \
[o_userSelections objectForKey:@"ttl"]] UTF8String] ); @"ttl=%@", [o_userSelections objectForKey:@"ttl"]] UTF8String] );
playlist_AddItem( p_playlist, p_item, PLAYLIST_GO, PLAYLIST_END ); playlist_AddItem( p_playlist, p_item, PLAYLIST_GO, PLAYLIST_END );
...@@ -1218,25 +1214,21 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1218,25 +1214,21 @@ static VLCWizard *_o_sharedInstance = nil;
if ([[o_userSelections objectForKey:@"partExtract"] isEqualToString: @"YES"]) if ([[o_userSelections objectForKey:@"partExtract"] isEqualToString: @"YES"])
{ {
[o_t8_fld_partExtract setStringValue: [[[[[_NS("yes") \ [o_t8_fld_partExtract setStringValue: [NSString stringWithFormat:
stringByAppendingString:@" - "] stringByAppendingString: \ _NS("yes: from %@ to %@ secs"),
_NS("from ")] stringByAppendingString: [o_userSelections \ [o_userSelections objectForKey:@"partExtractFrom"],
objectForKey:@"partExtractFrom"]] stringByAppendingString: \ [o_userSelections objectForKey:@"partExtractTo"]]];
_NS(" to ")] stringByAppendingString: [o_userSelections \
objectForKey:@"partExtractTo"]]];
} else { } else {
[o_t8_fld_partExtract setStringValue: _NS("no")]; [o_t8_fld_partExtract setStringValue: _NS("no")];
} }
if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"]) if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
{ {
[o_t8_fld_trnscdVideo setStringValue: [[[[[_NS("yes") \ [o_t8_fld_trnscdVideo setStringValue: [NSString stringWithFormat:
stringByAppendingString:@": "] stringByAppendingString: \ _NS("yes: %@ @ %@ kb/s"),
[[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey: \ [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey: \
@"trnscdVideoCodec"] intValue]] objectAtIndex:0]] \ @"trnscdVideoCodec"] intValue]] objectAtIndex:0],
stringByAppendingString:@" @ "] stringByAppendingString: \ [o_userSelections objectForKey:@"trnscdVideoBitrate"]]];
[o_userSelections objectForKey:@"trnscdVideoBitrate"]] \
stringByAppendingString:@" kb/s"]];
} }
else else
{ {
...@@ -1244,13 +1236,11 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1244,13 +1236,11 @@ static VLCWizard *_o_sharedInstance = nil;
} }
if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"]) if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
{ {
[o_t8_fld_trnscdAudio setStringValue: [[[[[_NS("yes") \ [o_t8_fld_trnscdAudio setStringValue: [NSString stringWithFormat:
stringByAppendingString:@": "] stringByAppendingString: \ _NS("yes: %@ @ %@ kb/s"),
[[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey: \ [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey: \
@"trnscdAudioCodec"] intValue]] objectAtIndex:0]] \ @"trnscdAudioCodec"] intValue]] objectAtIndex:0],
stringByAppendingString:@" @ "] stringByAppendingString: \ [o_userSelections objectForKey:@"trnscdAudioBitrate"]]];
[o_userSelections objectForKey:@"trnscdAudioBitrate"]] \
stringByAppendingString:@" kb/s"]];
} }
else else
{ {
...@@ -1270,7 +1260,9 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1270,7 +1260,9 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t8_fld_ttl setStringValue: [o_userSelections objectForKey:@"ttl"]]; [o_t8_fld_ttl setStringValue: [o_userSelections objectForKey:@"ttl"]];
if ([[o_userSelections objectForKey:@"sap"] isEqualToString: @"YES"]) if ([[o_userSelections objectForKey:@"sap"] isEqualToString: @"YES"])
{ {
[o_t8_fld_sap setStringValue: [[_NS("yes") stringByAppendingString:@": "] stringByAppendingString:[o_userSelections objectForKey:@"sapText"]]]; [o_t8_fld_sap setStringValue:
[_NS("yes") stringByAppendingFormat: @": \"%@\"",
[o_userSelections objectForKey:@"sapText"]]];
}else{ }else{
[o_t8_fld_sap setStringValue: _NS("no")]; [o_t8_fld_sap setStringValue: _NS("no")];
} }
...@@ -1462,30 +1454,21 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1462,30 +1454,21 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)t1_mrInfo_streaming:(id)sender - (IBAction)t1_mrInfo_streaming:(id)sender
{ {
/* show a sheet for the help */ /* show a sheet for the help */
/* since NSAlert does not exist on OSX < 10.3, we use our own implementation */ NSBeginInformationalAlertSheet(_NS("Stream to network"), \
[o_wh_txt_title setStringValue: _NS("Stream to network")]; _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, \
[o_wh_txt_text setStringValue: _NS("Use this to stream on a network.")]; _NS("Use this to stream on a network."));
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} }
- (IBAction)t1_mrInfo_transcode:(id)sender - (IBAction)t1_mrInfo_transcode:(id)sender
{ {
/* show a sheet for the help */ /* show a sheet for the help */
[o_wh_txt_title setStringValue: _NS("Transcode/Save to file")]; NSBeginInformationalAlertSheet(_NS("Transcode/Save to file"), \
[o_wh_txt_text setStringValue: _NS("Use this to save a stream to a file. You "\ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, \
_NS("Use this to save a stream to a file. You "\
"have the possibility to reencode the stream. You can save whatever "\ "have the possibility to reencode the stream. You can save whatever "\
"VLC can read.\nPlease notice that VLC is not very suited " \ "VLC can read.\nPlease notice that VLC is not very suited " \
"for file to file transcoding. You should use its transcoding " \ "for file to file transcoding. You should use its transcoding " \
"features to save network streams, for example.")]; "features to save network streams, for example."));
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} }
- (IBAction)t2_addNewStream:(id)sender - (IBAction)t2_addNewStream:(id)sender
...@@ -1658,33 +1641,25 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1658,33 +1641,25 @@ static VLCWizard *_o_sharedInstance = nil;
- (IBAction)t6_mrInfo_ttl:(id)sender - (IBAction)t6_mrInfo_ttl:(id)sender
{ {
/* show a sheet for the help */ /* show a sheet for the help */
[o_wh_txt_title setStringValue: _NS("Time-To-Live (TTL)")]; NSBeginInformationalAlertSheet(_NS("Time-To-Live (TTL)"), \
[o_wh_txt_text setStringValue: _NS("Define the TTL (Time-To-Live) of the stream. "\ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, \
"This parameter is the maximum number of routers your stream can go " \ _NS("Define the TTL (Time-To-Live) of the stream. "\
"through. If you don't know what it means, or if you want to stream on " \ "This parameter is the maximum number of routers your stream can " \
"your local network only, leave this setting to 1.")]; "go through. If you don't know what it means, or if you want to " \
[NSApp beginSheet: o_wizardhelp_window "stream on your local network only, leave this setting to 1."));
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} }
- (IBAction)t6_mrInfo_sap:(id)sender - (IBAction)t6_mrInfo_sap:(id)sender
{ {
/* show a sheet for the help */ /* show a sheet for the help */
[o_wh_txt_title setStringValue: _NS("SAP Announce")]; NSBeginInformationalAlertSheet(_NS("SAP Announce"), \
[o_wh_txt_text setStringValue: _NS("When streaming using UDP, you can " \ _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, \
_NS("When streaming using UDP, you can " \
"announce your streams using the SAP/SDP announcing protocol. This " \ "announce your streams using the SAP/SDP announcing protocol. This " \
"way, the clients won't have to type in the multicast address, it " \ "way, the clients won't have to type in the multicast address, it " \
"will appear in their playlist if they enable the SAP extra interface.\n" \ "will appear in their playlist if they enable the SAP extra " \
"If you want to give a name to your stream, enter it here, " \ "interface.\nIf you want to give a name to your stream, enter it " \
"else, a default name will be used.")]; "here, else, a default name will be used."));
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} }
- (IBAction)t67_mrInfo_local:(id)sender - (IBAction)t67_mrInfo_local:(id)sender
...@@ -1730,11 +1705,4 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1730,11 +1705,4 @@ static VLCWizard *_o_sharedInstance = nil;
} }
} }
- (IBAction)wh_closeSheet:(id)sender
{
/* close the help sheet */
[NSApp endSheet:o_wizardhelp_window];
[o_wizardhelp_window close];
}
@end @end
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