]> git.sesse.net Git - vlc/commitdiff
* don't show the statistics-tab if the stats aren't enabled
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 5 Mar 2006 15:42:51 +0000 (15:42 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 5 Mar 2006 15:42:51 +0000 (15:42 +0000)
modules/gui/macosx/playlistinfo.m

index c1ae857d803684e38a9e5149209e30fbb55bad9d..67c3fe1fbdee4b7fed039fa47c56b6a8e3d0e19a 100644 (file)
 {
     if( [o_info_window isVisible] )
     {
-        [o_statUpdateTimer invalidate];
+        if( o_statUpdateTimer )
+            [o_statUpdateTimer invalidate];
         [o_info_window orderOut: sender];
     }
     else
             p_item = p_playlist->status.p_item;
             vlc_object_release( p_playlist );
         }
-        o_statUpdateTimer = [NSTimer scheduledTimerWithTimeInterval: 1 \
-            target: self selector: @selector(updateStatistics:) \
-            userInfo: nil repeats: YES]; 
-        [o_statUpdateTimer fire];
-        [o_statUpdateTimer retain];
+
+        BOOL b_stats = config_GetInt(VLCIntf, "stats");
+        if( b_stats )
+        {
+            o_statUpdateTimer = [NSTimer scheduledTimerWithTimeInterval: 1 \
+                target: self selector: @selector(updateStatistics:) \
+                userInfo: nil repeats: YES]; 
+            [o_statUpdateTimer fire];
+            [o_statUpdateTimer retain];
+        }
 
         [self initPanel:sender];
     }
     [[VLCInfoTreeItem rootItem] refresh];
     [o_outline_view reloadData];
 
-    [self updateStatistics: nil];
+    BOOL b_stats = config_GetInt(VLCIntf, "stats");
+    if(! b_stats )
+    {
+        if( [o_tab_view numberOfTabViewItems] > 2 )
+            [o_tab_view removeTabViewItem: [o_tab_view tabViewItemAtIndex: 2]];
+    }
+    else
+    {
+        [self updateStatistics: nil];
+    }
 
     [o_info_window makeKeyAndOrderFront: sender];
 }