Commit 3785eb21 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* implemented 3 dialogues, which complain to the user, if s/he didn't provide a file or destination

parent c0cf55a7
...@@ -336,23 +336,34 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -336,23 +336,34 @@ static VLCWizard *_o_sharedInstance = nil;
* store the path or the index and set a flag. * store the path or the index and set a flag.
* complain to the user if s/he didn't provide a path */ * complain to the user if s/he didn't provide a path */
NSString *o_mode; NSString *o_mode;
BOOL stop;
stop = NO;
o_mode = [[o_t2_matrix_inputSourceType selectedCell] title]; o_mode = [[o_t2_matrix_inputSourceType selectedCell] title];
if( [o_mode isEqualToString: _NS("Select a stream")] ) if( [o_mode isEqualToString: _NS("Select a stream")] )
{ {
[o_userSelections setObject:@"YES" forKey:@"newStrm"]; [o_userSelections setObject:@"YES" forKey:@"newStrm"];
if ([[o_t2_fld_pathToNewStrm stringValue] isEqualToString: @""]) if ([[o_t2_fld_pathToNewStrm stringValue] isEqualToString: @""])
{ {
/* FIXME: we should complain to the user that s/he didn't provide a path */ /* set a flag that no file is selected */
stop = YES;
}else{ }else{
[o_userSelections setObject:[o_t2_fld_pathToNewStrm stringValue] forKey:@"pathToNewStrm"]; [o_userSelections setObject:[o_t2_fld_pathToNewStrm stringValue] forKey:@"pathToNewStrm"];
} }
}else{ }else{
if ([o_t2_tbl_plst selectedRow] != -1)
{
[o_userSelections setObject:@"NO" forKey:@"newStrm"]; [o_userSelections setObject:@"NO" forKey:@"newStrm"];
NSNumber * myNumber = [[NSNumber alloc] initWithInt:[o_t2_tbl_plst selectedRow]]; NSNumber * myNumber = [[NSNumber alloc] initWithInt:[o_t2_tbl_plst selectedRow]];
[o_userSelections setObject:myNumber forKey:@"plItemIndex"]; [o_userSelections setObject:myNumber forKey:@"plItemIndex"];
} else {
/* set a flag that no item is selected */
stop = YES;
}
} }
/* show either "Streaming 1" or "Transcode 1" to the user */ /* show either "Streaming 1" or "Transcode 1" to the user */
if (stop == NO)
{
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"]) if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
{ {
/* we are streaming */ /* we are streaming */
...@@ -361,6 +372,19 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -361,6 +372,19 @@ static VLCWizard *_o_sharedInstance = nil;
/* we are just transcoding */ /* we are just transcoding */
[o_tab_pageHolder selectTabViewItemAtIndex:3]; [o_tab_pageHolder selectTabViewItemAtIndex:3];
} }
} else {
/* show a sheet that the user didn't select a file */
[o_wh_txt_title setStringValue: _NS("No input selected")];
[o_wh_txt_text setStringValue: _NS("You selected neither " \
"a new stream nor an existing playlist item. VLC is unable to " \
"guess, which input you want use. \n\n Choose one " \
"before going to the next page.")];
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
}
} }
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 1"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Streaming 1"])
{ {
...@@ -405,14 +429,23 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -405,14 +429,23 @@ static VLCWizard *_o_sharedInstance = nil;
/* store the destination and check whether is it empty */ /* store the destination and check whether is it empty */
if( [[o_t3_fld_address stringValue] isEqualToString: @""] ) if( [[o_t3_fld_address stringValue] isEqualToString: @""] )
{ /* FIXME: complain to the user that "" is no valid dest. */ { /* complain to the user that "" is no valid dest. */
[o_wh_txt_title setStringValue: _NS("No valid destination")];
[o_wh_txt_text setStringValue: _NS("You need to enter " \
"a valid destination you want to stream to. Enter either a " \
"fixed Unicast-IP or a Multicast-IP.\n\n If you don't know "
"what this means, have a look at the VLC Streaming HOWTO." )];
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} else { } else {
[o_userSelections setObject:[o_t3_fld_address stringValue] forKey:@"stmgDest"]; [o_userSelections setObject:[o_t3_fld_address stringValue] forKey:@"stmgDest"];
}
/* let's go to the encap-tab */ /* let's go to the encap-tab */
[o_tab_pageHolder selectTabViewItemAtIndex:4]; [o_tab_pageHolder selectTabViewItemAtIndex:4];
} }
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 1"]) else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Transcode 1"])
{ {
/* check whether the user wants to transcode the video-track and store the related options */ /* check whether the user wants to transcode the video-track and store the related options */
...@@ -739,14 +772,23 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -739,14 +772,23 @@ static VLCWizard *_o_sharedInstance = nil;
{ {
/* check whether the path != "" and store it */ /* check whether the path != "" and store it */
if( [[o_t7_fld_filePath stringValue] isEqualToString: @""] ) if( [[o_t7_fld_filePath stringValue] isEqualToString: @""] )
{ /* FIXME: complain to the user that "" is no valid path */ { /* complain to the user that "" is no valid path */
[o_wh_txt_title setStringValue: _NS("No file selected")];
[o_wh_txt_text setStringValue: _NS("You you need to select " \
"a file, you want to save to. \n\n Enter either a valid path or " \
"choose a location through the button's dialog-box.")];
[NSApp beginSheet: o_wizardhelp_window
modalForWindow: o_wizard_window
modalDelegate: o_wizardhelp_window
didEndSelector: nil
contextInfo: nil];
} else { } else {
[o_userSelections setObject:[o_t7_fld_filePath stringValue] forKey:@"trnscdFilePath"]; [o_userSelections setObject:[o_t7_fld_filePath stringValue] forKey:@"trnscdFilePath"];
}
/* go to "Summary" */ /* go to "Summary" */
[self showSummary]; [self showSummary];
} }
}
} }
- (void)showSummary - (void)showSummary
...@@ -902,7 +944,6 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -902,7 +944,6 @@ static VLCWizard *_o_sharedInstance = nil;
if (returnCode == NSOKButton) if (returnCode == NSOKButton)
{ {
[o_t2_fld_pathToNewStrm setStringValue:[sheet filename]]; [o_t2_fld_pathToNewStrm setStringValue:[sheet filename]];
/* FIXME: store path in a global variable */
} }
} }
......
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