From: Benjamin Pracht Date: Mon, 15 Mar 2004 19:33:18 +0000 (+0000) Subject: Make the playlist info window a new object X-Git-Tag: 0.7.2~656 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=136957ea779cccb6afe1debadb6985b3080c07e8;p=vlc Make the playlist info window a new object --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 038df09213..8c1f8170e5 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -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; }, diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index c613eb8263..e7fc769ec5 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 83 64 505 541 0 0 1024 746 + 561 168 505 541 0 0 1024 746 IBEditorPositions 1617 @@ -19,7 +19,9 @@ IBOpenObjects + 1530 21 + 915 IBSystem Version 7D24 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib index 680cf80c1a..a0d5759431 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ diff --git a/modules/gui/macosx/Modules.am b/modules/gui/macosx/Modules.am index 79b6b06174..af54873621 100644 --- a/modules/gui/macosx/Modules.am +++ b/modules/gui/macosx/Modules.am @@ -16,6 +16,8 @@ SOURCES_macosx = \ open.h \ playlist.m \ playlist.h \ + playlistinfo.h \ + playlistinfo.m \ prefs.m \ prefs.h \ prefs_widgets.h \ diff --git a/modules/gui/macosx/about.h b/modules/gui/macosx/about.h index afeacb720c..d6ce84bdf9 100644 --- a/modules/gui/macosx/about.h +++ b/modules/gui/macosx/about.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 * diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m index cf3af32fcb..d9983c0e06 100644 --- a/modules/gui/macosx/about.m +++ b/modules/gui/macosx/about.m @@ -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 * diff --git a/modules/gui/macosx/applescript.h b/modules/gui/macosx/applescript.h index 50dcf7e767..c83e8c6b84 100644 --- a/modules/gui/macosx/applescript.h +++ b/modules/gui/macosx/applescript.h @@ -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 * diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m index 94f3651631..9cfd31f161 100644 --- a/modules/gui/macosx/applescript.m +++ b/modules/gui/macosx/applescript.m @@ -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 * diff --git a/modules/gui/macosx/controls.h b/modules/gui/macosx/controls.h index 750f834590..aea4624d7c 100644 --- a/modules/gui/macosx/controls.h +++ b/modules/gui/macosx/controls.h @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m index 257fd896d6..6ab7a8fc9d 100644 --- a/modules/gui/macosx/controls.m +++ b/modules/gui/macosx/controls.m @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/info.h b/modules/gui/macosx/info.h index 8e9aa52dc1..3b8a3d5b92 100644 --- a/modules/gui/macosx/info.h +++ b/modules/gui/macosx/info.h @@ -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 * diff --git a/modules/gui/macosx/info.m b/modules/gui/macosx/info.m index 5ce07bbf82..4ab2823c16 100644 --- a/modules/gui/macosx/info.m +++ b/modules/gui/macosx/info.m @@ -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 * diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index e591bb76b2..184203b7f8 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 103619e9c5..6ebab401fc 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/macosx.m b/modules/gui/macosx/macosx.m index e31113f1e9..f424fb1fee 100644 --- a/modules/gui/macosx/macosx.m +++ b/modules/gui/macosx/macosx.m @@ -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 * Eugenio Jarosiewicz diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h index 24fecc0cab..11c8c876d5 100644 --- a/modules/gui/macosx/misc.h +++ b/modules/gui/macosx/misc.h @@ -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 * diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 21eaa7e72d..1eaec9463c 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -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 * diff --git a/modules/gui/macosx/open.h b/modules/gui/macosx/open.h index 961573ca68..16ad025b5e 100644 --- a/modules/gui/macosx/open.h +++ b/modules/gui/macosx/open.h @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m index 368adcb41b..0f393197e9 100644 --- a/modules/gui/macosx/open.m +++ b/modules/gui/macosx/open.m @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/output.h b/modules/gui/macosx/output.h index 2f35645b03..357e47313b 100644 --- a/modules/gui/macosx/output.h +++ b/modules/gui/macosx/output.h @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/output.m b/modules/gui/macosx/output.m index de00078e9d..4999c5c526 100644 --- a/modules/gui/macosx/output.m +++ b/modules/gui/macosx/output.m @@ -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 * Christophe Massiot diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h index 6c688f31ef..a4b911cd3e 100644 --- a/modules/gui/macosx/playlist.h +++ b/modules/gui/macosx/playlist.h @@ -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 + diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index d60a0be6e2..a49ac72961 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -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 + diff --git a/modules/gui/macosx/prefs.h b/modules/gui/macosx/prefs.h index 8294e41845..2f710a145d 100644 --- a/modules/gui/macosx/prefs.h +++ b/modules/gui/macosx/prefs.h @@ -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 * diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m index 542e115d6b..a6c53b1f68 100644 --- a/modules/gui/macosx/prefs.m +++ b/modules/gui/macosx/prefs.m @@ -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 * Derk-Jan Hartman diff --git a/modules/gui/macosx/prefs_widgets.h b/modules/gui/macosx/prefs_widgets.h index 71c3ea6ba6..725b069d7b 100644 --- a/modules/gui/macosx/prefs_widgets.h +++ b/modules/gui/macosx/prefs_widgets.h @@ -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 * diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m index 36685bee2b..1368269a1a 100644 --- a/modules/gui/macosx/prefs_widgets.m +++ b/modules/gui/macosx/prefs_widgets.m @@ -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 * diff --git a/modules/gui/macosx/vout.h b/modules/gui/macosx/vout.h index 90cec55304..8d10259196 100644 --- a/modules/gui/macosx/vout.h +++ b/modules/gui/macosx/vout.h @@ -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 * Florian G. Pflug diff --git a/modules/gui/wxwindows/wxwindows.cpp b/modules/gui/wxwindows/wxwindows.cpp index 0ef1d12f2c..57c9aef170 100644 --- a/modules/gui/wxwindows/wxwindows.cpp +++ b/modules/gui/wxwindows/wxwindows.cpp @@ -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 *