Commit 136957ea authored by Benjamin Pracht's avatar Benjamin Pracht

Make the playlist info window a new object

parent dcaa5aab
......@@ -328,25 +328,17 @@
ACTIONS = {
deleteItems = id;
handlePopUp = id;
infoCancel = id;
infoOk = id;
playItem = id;
savePlaylist = id;
searchItem = id;
selectAll = id;
togglePlaylistInfoPanel = id;
toggleWindow = id;
};
CLASS = VLCPlaylist;
LANGUAGE = ObjC;
OUTLETS = {
"o_author_lbl" = id;
"o_author_txt" = id;
"o_btn_info_cancel" = id;
"o_btn_info_ok" = id;
"o_btn_playlist" = id;
"o_ctx_menu" = id;
"o_info_window" = id;
"o_loop_popup" = id;
"o_mi_delete" = id;
"o_mi_info" = id;
......@@ -362,11 +354,25 @@
"o_tc_duration" = id;
"o_tc_id" = id;
"o_tc_name" = id;
"o_window" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {infoCancel = id; infoOk = id; togglePlaylistInfoPanel = id; };
CLASS = VLCPlaylistInfo;
LANGUAGE = ObjC;
OUTLETS = {
"o_author_lbl" = id;
"o_author_txt" = id;
"o_btn_cancel" = id;
"o_btn_ok" = id;
"o_info_window" = id;
"o_title_lbl" = id;
"o_title_txt" = id;
"o_uri_lbl" = id;
"o_uri_txt" = id;
"o_window" = id;
"o_vlc_playlist" = id;
};
SUPERCLASS = NSObject;
},
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>83 64 505 541 0 0 1024 746 </string>
<string>561 168 505 541 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
......@@ -19,7 +19,9 @@
<array/>
<key>IBOpenObjects</key>
<array>
<integer>1530</integer>
<integer>21</integer>
<integer>915</integer>
</array>
<key>IBSystem Version</key>
<string>7D24</string>
......
......@@ -16,6 +16,8 @@ SOURCES_macosx = \
open.h \
playlist.m \
playlist.h \
playlistinfo.h \
playlistinfo.m \
prefs.m \
prefs.h \
prefs_widgets.h \
......
......@@ -2,7 +2,7 @@
* about.h: MacOS X About Panel
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: about.h,v 1.2 2003/05/11 23:17:30 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......
......@@ -2,7 +2,7 @@
* about.m: MacOS X About Panel
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: about.m,v 1.3 2003/09/20 19:37:53 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......
......@@ -2,7 +2,7 @@
* applescript.h: MacOS X AppleScript support
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: applescript.h,v 1.1 2003/03/06 11:43:07 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......
......@@ -2,7 +2,7 @@
* applescript.m: MacOS X AppleScript support
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: applescript.m,v 1.6 2004/01/20 15:34:43 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......
......@@ -2,7 +2,7 @@
* controls.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.h,v 1.9 2004/01/25 17:01:57 murray Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.m,v 1.62 2004/03/03 11:34:19 bigben Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* info.h: MacOS X info panel
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: info.h,v 1.2 2003/02/23 05:53:53 jlj Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......
......@@ -2,7 +2,7 @@
* info.m: MacOS X info panel
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: info.m,v 1.9 2004/01/09 22:11:04 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
*
......
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: intf.h,v 1.56 2004/01/25 17:01:57 murray Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: intf.m,v 1.115 2004/01/30 12:44:21 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.24 2004/03/03 12:01:57 titer Exp $
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......
......@@ -2,7 +2,7 @@
* misc.h: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: misc.h,v 1.3 2003/11/15 22:42:16 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......
......@@ -2,7 +2,7 @@
* misc.m: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: misc.m,v 1.3 2003/11/15 22:42:16 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......
......@@ -2,7 +2,7 @@
* open.h: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: open.h,v 1.17 2004/01/25 17:01:57 murray Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* open.m: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: open.m,v 1.43 2004/01/27 22:19:04 bigben Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* output.h: MacOS X Output Dialog
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: output.h,v 1.4 2003/11/06 18:35:19 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -2,7 +2,7 @@
* output.m: MacOS X Output Dialog
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: output.m,v 1.18 2004/01/25 17:01:57 murray Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......
......@@ -75,6 +75,7 @@
IBOutlet id o_author_txt;
IBOutlet id o_btn_info_ok;
IBOutlet id o_btn_info_cancel;
IBOutlet id o_tbv_info;
NSImage *o_descendingSortingImage;
NSImage *o_ascendingSortingImage;
......@@ -98,8 +99,7 @@
/*For playlist info window*/
- (IBAction)togglePlaylistInfoPanel:(id)sender;
- (IBAction)infoCancel:(id)sender;
- (IBAction)infoOk:(id)sender;
- (int)selectedPlaylistItem;
@end
......@@ -136,7 +136,9 @@
[NSArray arrayWithObjects: NSFilenamesPboardType, nil]];
[o_table_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
[o_window setExcludedFromWindowsMenu: TRUE];
[o_info_window setExcludedFromWindowsMenu: TRUE];
// [o_tbv_info setDataSource: [VLCInfoDataSource init]];
/* We need to check whether _defaultTableHeaderSortImage exists, since it
belongs to an Apple hidden private API, and then can "disapear" at any time*/
......@@ -170,6 +172,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_mi_delete setTitle: _NS("Delete")];
[o_mi_selectall setTitle: _NS("Select All")];
[o_mi_info setTitle: _NS("Proprieties")];
[[o_tc_name headerCell] setStringValue:_NS("Name")];
[[o_tc_author headerCell] setStringValue:_NS("Author")];
[[o_tc_duration headerCell] setStringValue:_NS("Duration")];
......@@ -179,13 +182,6 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
[[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
[[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
[o_info_window setTitle: _NS("Proprieties")];
[o_uri_lbl setStringValue: _NS("URI")];
[o_title_lbl setStringValue: _NS("Title")];
[o_author_lbl setStringValue: _NS("Author")];
[o_btn_info_ok setTitle: _NS("OK")];
[o_btn_info_cancel setTitle: _NS("Cancel")];
}
- (void) tableView:(NSTableView*)o_tv
......@@ -205,7 +201,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
}
if( o_tc_sortColumn == o_tc )
{
{
b_isSortDescending = !b_isSortDescending;
}
else if( o_tc == o_tc_name || o_tc == o_tc_author ||
......@@ -620,60 +616,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_table_view scrollRowToVisible: i_row];
}
/*For info window*/
- (IBAction)togglePlaylistInfoPanel:(id)sender
- (int)selectedPlaylistItem
{
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist;
if( [o_info_window isVisible] )
{
[o_info_window orderOut: sender];
}
else
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if (p_playlist)
{
int i_item = [o_table_view selectedRow];
[o_uri_txt setStringValue:[NSString stringWithUTF8String: p_playlist->pp_items[i_item]->psz_uri]];
[o_title_txt setStringValue:[NSString stringWithUTF8String: p_playlist->pp_items[i_item]->psz_name]];
[o_author_txt setStringValue:[NSString stringWithUTF8String: playlist_GetInfo(p_playlist, i_item ,_("General"),_("Author") )]];
vlc_object_release ( p_playlist );
}
[o_info_window makeKeyAndOrderFront: sender];
}
return [o_table_view selectedRow];
}
- (IBAction)infoCancel:(id)sender
{
[self togglePlaylistInfoPanel:self];
}
- (IBAction)infoOk:(id)sender
{
int i_item = [o_table_view selectedRow];
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if (p_playlist)
{
vlc_mutex_lock(&p_playlist->pp_items[i_item]->lock);
p_playlist->pp_items[i_item]->psz_uri = strdup([[o_uri_txt stringValue] cString]);
p_playlist->pp_items[i_item]->psz_name = strdup([[o_title_txt stringValue] cString]);
playlist_ItemAddInfo(p_playlist->pp_items[i_item],_("General"),_("Author"), [[o_author_txt stringValue] cString]);
vlc_mutex_unlock(&p_playlist->pp_items[i_item]->lock);
vlc_object_release ( p_playlist );
}
[self togglePlaylistInfoPanel:self];
[self playlistUpdated];
}
@end
@implementation VLCPlaylist (NSTableDataSource)
......@@ -906,3 +853,4 @@ vlc_object_release( p_playlist );
@end
......@@ -2,7 +2,7 @@
* prefs.h: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.h,v 1.15 2004/02/19 19:38:58 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......
......@@ -2,7 +2,7 @@
* prefs.m: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: prefs.m,v 1.41 2004/02/19 19:38:58 hartman Exp $
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
......
......@@ -2,7 +2,7 @@
* prefs_widgets.h: Preferences controls
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: prefs_widgets.h,v 1.1 2003/11/17 06:31:22 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan.org>
*
......
......@@ -2,7 +2,7 @@
* prefs_widgets.m: Preferences controls
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: prefs_widgets.m,v 1.1 2003/11/17 06:31:22 hartman Exp $
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan.org>
*
......
......@@ -2,7 +2,7 @@
* vout.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.h,v 1.25 2004/02/28 13:53:35 titer Exp $
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......
......@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id: wxwindows.cpp,v 1.39 2004/02/26 12:04:14 gbazin Exp $
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......
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