+- (IBAction)viewPreferences:(id)sender
+{
+ if( o_prefs == nil )
+ {
+ o_prefs = [[VLCPrefs alloc] init];
+ }
+
+ [o_prefs createPrefPanel: @"main"];
+}
+
+- (IBAction)timesliderUpdate:(id)sender
+{
+ float f_updated;
+
+ switch( [[NSApp currentEvent] type] )
+ {
+ case NSLeftMouseUp:
+ case NSLeftMouseDown:
+ f_slider = [sender floatValue];
+ return;
+
+ case NSLeftMouseDragged:
+ f_updated = [sender floatValue];
+ break;
+
+ default:
+ return;
+ }
+
+ intf_thread_t * p_intf = [NSApp getIntf];
+
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ vlc_mutex_lock( &p_playlist->object_lock );
+
+ if( p_playlist->p_input != NULL )
+ {
+ off_t i_tell;
+ NSString * o_time;
+ char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+
+#define p_area p_playlist->p_input->stream.p_selected_area
+ vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
+ i_tell = f_updated / 100. * p_area->i_size;
+ input_OffsetToTime( p_playlist->p_input, psz_time, i_tell );
+ vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+#undef p_area
+
+ o_time = [NSString stringWithCString: psz_time];
+ [o_timefield setStringValue: o_time];
+ }
+
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_release( p_playlist );
+}
+
+- (IBAction)closeError:(id)sender
+{
+ [o_err_msg setString: @""];
+ [o_error performClose: self];
+}
+
+- (IBAction)openReadMe:(id)sender
+{
+ NSString * o_path = [[NSBundle mainBundle]
+ pathForResource: @"README.MacOSX" ofType: @"rtf"];
+
+ [[NSWorkspace sharedWorkspace] openFile: o_path
+ withApplication: @"TextEdit"];
+}
+
+- (IBAction)reportABug:(id)sender
+{
+ NSURL * o_url = [NSURL URLWithString:
+ @"http://www.videolan.org/support/bug-reporting.html"];
+
+ [[NSWorkspace sharedWorkspace] openURL: o_url];
+}
+
+- (IBAction)openWebsite:(id)sender
+{
+ NSURL * o_url = [NSURL URLWithString: @"http://www.videolan.org"];
+
+ [[NSWorkspace sharedWorkspace] openURL: o_url];
+}
+
+- (IBAction)openLicense:(id)sender
+{
+ NSString * o_path = [[NSBundle mainBundle]
+ pathForResource: @"COPYING" ofType: nil];
+
+ [[NSWorkspace sharedWorkspace] openFile: o_path
+ withApplication: @"TextEdit"];
+}
+
+- (IBAction)openCrashLog:(id)sender
+{
+ NSString * o_path = [@"~/Library/Logs/CrashReporter/VLC.crash.log"
+ stringByExpandingTildeInPath];
+
+
+ if ( [[NSFileManager defaultManager] fileExistsAtPath: o_path ] )
+ {
+ [[NSWorkspace sharedWorkspace] openFile: o_path
+ withApplication: @"Console"];
+ }
+ else
+ {
+ NSBeginInformationalAlertSheet(_NS("No CrashLog found"), @"Continue", nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("Either you are running Mac OS X pre 10.2 or you haven't experienced any heavy crashes yet.") );
+
+ }
+}
+
+- (void)windowDidBecomeKey:(NSNotification *)o_notification
+{
+ if( [o_notification object] == o_msgs_panel )
+ {
+ id o_msg;
+ NSEnumerator * o_enum;
+
+ [o_messages setString: @""];
+
+ [o_msg_lock lock];
+
+ o_enum = [o_msg_arr objectEnumerator];
+
+ while( ( o_msg = [o_enum nextObject] ) != nil )
+ {
+ [o_messages insertText: o_msg];
+ }
+
+ [o_msg_lock unlock];
+ }
+}
+