Commit 87c97ae1 authored by Benjamin Pracht's avatar Benjamin Pracht

* Implements selection of a playlist item in the wizard

* The playlist in the wizard had to be displayed as a outlineview if we want to reuse existing code
* cosmetics could still be improved regarding this outline view
* I get this error

2005-07-24 00:08:55.940 VLC[6908] Could not connect the action t3_addressEntered: to target of class VLCWizard

When opening the wizard. I don't know if I messed up something or if it was already here before

* I needed to make some changes to the interface structure regarding the playlist for this : We know have a VLCPlaylist and a VLCPlaylistWizard class. Both are derivated from a VLCPlaylistCommon class that contains methods required by both classes (mostly the datasource, in fact).
parent 46fb23ef
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = VLCPlaylistCommon; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = VLCPlaylistWizard;
LANGUAGE = ObjC;
OUTLETS = {
"o_outline_view" = id;
"o_tc_author" = id;
"o_tc_duration" = id;
"o_tc_name" = id;
};
SUPERCLASS = VLCPlaylistCommon;
},
{
ACTIONS = {
cancelRun = id;
......@@ -29,6 +41,7 @@
"o_btn_backward" = id;
"o_btn_cancel" = id;
"o_btn_forward" = id;
"o_playlist_wizard" = id;
"o_t1_btn_mrInfo_strmg" = id;
"o_t1_btn_mrInfo_trnscd" = id;
"o_t1_matrix_strmgOrTrnscd" = id;
......
......@@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>397 577 356 241 0 0 1440 878 </string>
<string>255 498 356 241 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<string>364.0</string>
<key>IBLockedObjects</key>
<array>
<integer>6</integer>
......@@ -13,12 +13,7 @@
<integer>10</integer>
<integer>270</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
<integer>268</integer>
</array>
<key>IBSystem Version</key>
<string>8C46</string>
<string>7W98</string>
</dict>
</plist>
......@@ -23,7 +23,7 @@
*****************************************************************************/
/*****************************************************************************
* VLCPlaylistView interface
* VLCPlaylistView interface
*****************************************************************************/
@interface VLCPlaylistView : NSOutlineView
{
......@@ -32,18 +32,44 @@
@end
/*****************************************************************************
* VLCPlaylist interface
* VLCPlaylistCommon interface
*****************************************************************************/
@interface VLCPlaylist : NSObject
@interface VLCPlaylistCommon : NSObject
{
IBOutlet id o_tc_name;
IBOutlet id o_tc_author;
IBOutlet id o_tc_duration;
IBOutlet id o_outline_view;
int i_current_view;
}
- (void)initStrings;
- (playlist_item_t *)selectedPlaylistItem;
- (NSOutlineView *)outlineView;
@end
/*****************************************************************************
* VLCPlaylistWizard interface
*****************************************************************************/
@interface VLCPlaylistWizard : VLCPlaylistCommon
{
}
- (IBAction)reloadOutlineView;
@end
/*****************************************************************************
* VLCPlaylist interface
*****************************************************************************/
@interface VLCPlaylist : VLCPlaylistCommon
{
IBOutlet id o_controller;
IBOutlet id o_btn_playlist;
IBOutlet id o_playlist_view;
IBOutlet id o_outline_view;
IBOutlet id o_tc_name;
IBOutlet id o_tc_author;
IBOutlet id o_tc_duration;
IBOutlet id o_status_field;
IBOutlet id o_search_field;
IBOutlet id o_random_ckb;
......@@ -70,20 +96,17 @@
NSImage *o_descendingSortingImage;
NSImage *o_ascendingSortingImage;
NSMutableDictionary *o_outline_dict;
NSMutableArray *o_nodes_array;
NSMutableArray *o_items_array;
NSMutableDictionary *o_outline_dict;
BOOL b_selected_item_met;
BOOL b_isSortDescending;
int i_current_view;
id o_tc_sortColumn;
}
- (void)initStrings;
- (void)searchfieldChanged:(NSNotification *)o_notification;
- (NSMenu *)menuForEvent:(NSEvent *)o_event;
- (NSOutlineView *)outlineView;
- (IBAction)handlePopUp:(id)sender;
- (IBAction)searchItem:(id)sender;
......@@ -105,7 +128,6 @@
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
- (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position inView:(int)i_view enqueue:(BOOL)b_enqueue;
- (playlist_item_t *)selectedPlaylistItem;
@end
This diff is collapsed.
......@@ -39,6 +39,7 @@
IBOutlet id o_wh_txt_title;
IBOutlet id o_wh_txt_text;
IBOutlet id o_wh_btn_okay;
IBOutlet id o_playlist_wizard;
/* page one ("Hello") */
IBOutlet id o_t1_btn_mrInfo_strmg;
......
......@@ -39,6 +39,7 @@
#import "wizard.h"
#import "intf.h"
#import "network.h"
#import "playlist.h"
/*****************************************************************************
* VLCWizard implementation
......@@ -242,9 +243,9 @@ static VLCWizard *_o_sharedInstance = nil;
[o_t2_matrix_inputSourceType selectCellAtRow:0 column:0];
[[o_t2_matrix_inputSourceType cellAtRow:1 column:0] setState: NSOffState];
/* FIXME: we need to refresh the playlist-table as well */
[o_t2_tbl_plst setEnabled:NO];
[o_t2_fld_pathToNewStrm setEnabled:YES];
[o_t2_btn_chooseFile setEnabled:YES];
[o_t2_tbl_plst setEnabled:NO];
/* "Streaming 1" */
[o_t3_fld_address setStringValue: @""];
......@@ -293,8 +294,8 @@ static VLCWizard *_o_sharedInstance = nil;
[[o_t2_matrix_inputSourceType cellAtRow:0 column:0] setTitle: _NS("Select a stream")];
[[o_t2_matrix_inputSourceType cellAtRow:1 column:0] setTitle: _NS("Existing playlist item")];
[o_t2_btn_chooseFile setTitle: _NS("Choose...")];
[[[o_t2_tbl_plst tableColumnWithIdentifier:@"name"] headerCell] setStringValue: _NS("Name")];
[[[o_t2_tbl_plst tableColumnWithIdentifier:@"uri"] headerCell] setStringValue: _NS("URI")];
// [[[o_t2_tbl_plst tableColumnWithIdentifier:@"name"] headerCell] setStringValue: _NS("Name")];
// [[[o_t2_tbl_plst tableColumnWithIdentifier:@"uri"] headerCell] setStringValue: _NS("URI")];
[o_t2_box_prtExtrct setTitle: _NS("Partial Extract")];
[o_t2_ckb_enblPartExtrct setTitle: _NS("Enable")];
[o_t2_ckb_enblPartExtrct setToolTip: _NS("Use this to read only a part of " \
......@@ -389,6 +390,10 @@ static VLCWizard *_o_sharedInstance = nil;
}
[o_btn_backward setEnabled:YES];
[o_tab_pageHolder selectTabViewItemAtIndex:1];
/* Fill the playlist with current playlist items */
[o_playlist_wizard reloadOutlineView];
}
else if ([[[o_tab_pageHolder selectedTabViewItem] label] isEqualToString: @"Input"])
{
......@@ -416,12 +421,25 @@ static VLCWizard *_o_sharedInstance = nil;
{
/* set a flag that no file is selected */
stop = YES;
}else{
}
else
{
[o_userSelections setObject:[@"file://" stringByAppendingString:[o_t2_fld_pathToNewStrm stringValue]] forKey:@"pathToStrm"];
}
}else{
}
else
{
if ([o_t2_tbl_plst selectedRow] != -1)
{
playlist_item_t *p_item =
[o_playlist_wizard selectedPlaylistItem];
if( p_item->i_children <= 0 )
{
[o_userSelections setObject: [NSString stringWithFormat:
@"%s", p_item->input.psz_uri] forKey:@"pathToStrm"];
}
else
stop = YES;
/* FIXME: put the path of the selected pl-item to pathToStrm */
} else {
/* set a flag that no item is selected */
......@@ -443,7 +461,7 @@ static VLCWizard *_o_sharedInstance = nil;
} else {
/* show a sheet that the user didn't select a file */
NSBeginInformationalAlertSheet(_NS("No input selected"), _NS("OK"), @"", @"", o_wizard_window, nil, nil, nil, nil, _NS("You selected neither " \
"a new stream nor an existing playlist item. VLC is unable to " \
"a new stream nor a valid playlist item. VLC is unable to " \
"guess, which input you want use. \n\n Choose one " \
"before going to the next page."));
}
......
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