]> git.sesse.net Git - vlc/commitdiff
Add "enable/disable all group items" functions in playlist context menu
authorBenjamin Pracht <bigben@videolan.org>
Sun, 4 Apr 2004 08:17:27 +0000 (08:17 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Sun, 4 Apr 2004 08:17:27 +0000 (08:17 +0000)
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index eb113de325b82b0f9c72c035ba09b6357838b657..c40accd5adfdbe69993259310098eaca0e240a89 100644 (file)
         {
             ACTIONS = {
                 deleteItems = id; 
+                disableGroup = id; 
+                enableGroup = id; 
                 handlePopUp = id; 
                 playItem = id; 
                 savePlaylist = id; 
                 "o_ctx_menu" = id; 
                 "o_loop_popup" = id; 
                 "o_mi_delete" = id; 
+                "o_mi_disableGroup" = id; 
+                "o_mi_enableGroup" = id; 
                 "o_mi_info" = id; 
                 "o_mi_play" = id; 
                 "o_mi_save_playlist" = id; 
index 76ca5fc03ee2cb5343828be38a27938023d2c4a7..5910c7a72fa19bb395d724b612bbb581d009247c 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index db901544dab33a5785f70347b070f390404d2e98..6e064b8249499c415e7a19b31d9dd9433e703793 100644 (file)
@@ -57,6 +57,8 @@
     IBOutlet id o_mi_delete;
     IBOutlet id o_mi_selectall;
     IBOutlet id o_mi_toggleItemsEnabled;
+    IBOutlet id o_mi_enableGroup;
+    IBOutlet id o_mi_disableGroup;
 
     IBOutlet id o_random_ckb;
 
@@ -90,6 +92,8 @@
 - (IBAction)playItem:(id)sender;
 - (IBAction)deleteItems:(id)sender;
 - (IBAction)toggleItemsEnabled:(id)sender;
+- (IBAction)enableGroup:(id)sender;
+- (IBAction)disableGroup:(id)sender;
 - (IBAction)selectAll:(id)sender;
 - (IBAction)searchItem:(id)sender;
 - (IBAction)handlePopUp:(id)sender;
index 93611fd619a282f1c19ce090a9bde1d28cafe1de..8745edf6aeda7555e10b04caf534d3c0fa70fad0 100644 (file)
     [o_table_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
     [o_window setExcludedFromWindowsMenu: TRUE];
 
-    [o_mi_toggleItemsEnabled setTarget:self];
 
 //    [o_tbv_info setDataSource: [VLCInfoDataSource init]];
 
@@ -174,6 +173,8 @@ 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_toggleItemsEnabled setTitle: _NS("Item Enabled")];
+    [o_mi_enableGroup setTitle: _NS("Enable all group items")];
+    [o_mi_disableGroup setTitle: _NS("Disable all group items")];
     [o_mi_info setTitle: _NS("Properties")];
 
     [[o_tc_name headerCell] setStringValue:_NS("Name")];
@@ -267,7 +268,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                             FIND_ANYWHERE );
 
-    bool b_state = FALSE;
+    bool b_itemstate = FALSE;
 
     NSPoint pt;
     vlc_bool_t b_rows;
@@ -284,16 +285,17 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [o_mi_selectall setEnabled: b_rows];
     [o_mi_info setEnabled: b_item_sel];
     [o_mi_toggleItemsEnabled setEnabled: b_item_sel];
-
+    [o_mi_enableGroup setEnabled: b_item_sel];
+    [o_mi_disableGroup setEnabled: b_item_sel];
 
     if (p_playlist)
     {
-        b_state = ([o_table_view selectedRow] > -1) ?
+        b_itemstate = ([o_table_view selectedRow] > -1) ?
             p_playlist->pp_items[[o_table_view selectedRow]]->b_enabled : FALSE;
         vlc_object_release(p_playlist);
     }
 
-    [o_mi_toggleItemsEnabled setState: b_state];
+    [o_mi_toggleItemsEnabled setState: b_itemstate];
 
     return( o_ctx_menu );
 }
@@ -430,6 +432,34 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [self playlistUpdated];
 }
 
+- (IBAction)enableGroup:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+
+    if (p_playlist)
+    {
+        playlist_EnableGroup(p_playlist,
+                p_playlist->pp_items[[o_table_view selectedRow]]->i_group);
+        vlc_object_release(p_playlist);
+    }
+}
+
+- (IBAction)disableGroup:(id)sender 
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+
+    if (p_playlist)
+    {
+        playlist_DisableGroup(p_playlist,
+                p_playlist->pp_items[[o_table_view selectedRow]]->i_group);
+        vlc_object_release(p_playlist);
+    }
+}
+
 - (IBAction)selectAll:(id)sender
 {
     [o_table_view selectAll: nil];