📄 intf.m
字号:
[o_extended collapsAll]; [o_extended release]; } if( nib_bookmarks_loaded && o_bookmarks ) [o_bookmarks release]; if( nib_wizard_loaded && o_wizard ) [o_wizard release]; if( o_embedded_list != nil ) [o_embedded_list release]; if( o_interaction_list != nil ) [o_interaction_list release]; if( o_img_pause_pressed != nil ) { [o_img_pause_pressed release]; o_img_pause_pressed = nil; } if( o_img_pause_pressed != nil ) { [o_img_pause_pressed release]; o_img_pause_pressed = nil; } if( o_img_pause != nil ) { [o_img_pause release]; o_img_pause = nil; } if( o_img_play != nil ) { [o_img_play release]; o_img_play = nil; } if( o_msg_arr != nil ) { [o_msg_arr removeAllObjects]; [o_msg_arr release]; o_msg_arr = nil; } if( o_msg_lock != nil ) { [o_msg_lock release]; o_msg_lock = nil; } /* write cached user defaults to disk */ [[NSUserDefaults standardUserDefaults] synchronize]; p_intf->b_die = VLC_TRUE;}- (IBAction)clearRecentItems:(id)sender{ [[NSDocumentController sharedDocumentController] clearRecentDocuments: nil];}- (void)openRecentItem:(id)sender{ [self application: nil openFile: [sender title]];}- (IBAction)intfOpenFile:(id)sender{ if (!nib_open_loaded) { nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; [o_open awakeFromNib]; [o_open openFile]; } else { [o_open openFile]; }}- (IBAction)intfOpenFileGeneric:(id)sender{ if (!nib_open_loaded) { nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; [o_open awakeFromNib]; [o_open openFileGeneric]; } else { [o_open openFileGeneric]; }}- (IBAction)intfOpenDisc:(id)sender{ if (!nib_open_loaded) { nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; [o_open awakeFromNib]; [o_open openDisc]; } else { [o_open openDisc]; }}- (IBAction)intfOpenNet:(id)sender{ if (!nib_open_loaded) { nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; [o_open awakeFromNib]; [o_open openNet]; } else { [o_open openNet]; }}- (IBAction)showWizard:(id)sender{ if (!nib_wizard_loaded) { nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; [o_wizard initStrings]; [o_wizard resetWizard]; [o_wizard showWizard]; } else { [o_wizard resetWizard]; [o_wizard showWizard]; }}- (IBAction)showExtended:(id)sender{ if ( o_extended == nil ) { o_extended = [[VLCExtended alloc] init]; } if (!nib_extended_loaded) { nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self]; [o_extended initStrings]; [o_extended showPanel]; } else { [o_extended showPanel]; }}- (IBAction)showBookmarks:(id)sender{ /* we need the wizard-nib for the bookmarks's extract functionality */ if (!nib_wizard_loaded) { nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; [o_wizard initStrings]; } if (!nib_bookmarks_loaded) { nib_bookmarks_loaded = [NSBundle loadNibNamed:@"Bookmarks" owner:self]; [o_bookmarks showBookmarks]; } else { [o_bookmarks showBookmarks]; }}- (IBAction)viewAbout:(id)sender{ if (!nib_about_loaded) { nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self]; [o_about showPanel]; } else { [o_about showPanel]; }}- (IBAction)viewPreferences:(id)sender{/* GRUIIIIIIIK */ if( o_prefs == nil ) o_prefs = [[VLCPrefs alloc] init]; [o_prefs showPrefs];}- (IBAction)checkForUpdate:(id)sender{ if (!nib_update_loaded) { nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self]; [o_update showUpdateWindow]; } else { [o_update showUpdateWindow]; }}- (IBAction)closeError:(id)sender{ vlc_value_t val; if( [o_err_ckbk_surpress state] == NSOnState ) { val.i_int = -1; var_Set( p_intf->p_vlc, "verbose", val ); } [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)openDocumentation:(id)sender{ NSURL * o_url = [NSURL URLWithString: @"http://www.videolan.org/doc/"]; [[NSWorkspace sharedWorkspace] openURL: o_url];}- (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)openForum:(id)sender{ NSURL * o_url = [NSURL URLWithString: @"http://forum.videolan.org/"]; [[NSWorkspace sharedWorkspace] openURL: o_url];}- (IBAction)openDonate:(id)sender{ NSURL * o_url = [NSURL URLWithString: @"http://www.videolan.org/contribute.html#paypal"]; [[NSWorkspace sharedWorkspace] openURL: o_url];}- (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("Couldn't find any trace of a previous crash.") ); }}- (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]; }}- (IBAction)togglePlaylist:(id)sender{ NSRect o_rect = [o_window frame]; /*First, check if the playlist is visible*/ if( o_rect.size.height <= 200 ) { b_small_window = YES; /* we know we are small, make sure this is actually set (see case below) */ /* make large */ if ( o_size_with_playlist.height > 200 ) { o_rect.size.height = o_size_with_playlist.height; } else { o_rect.size.height = 500; } if ( o_size_with_playlist.width > [o_window minSize].width ) { o_rect.size.width = o_size_with_playlist.width; } else { o_rect.size.width = 500; } o_rect.size.height = (o_size_with_playlist.height > 200) ? o_size_with_playlist.height : 500; o_rect.origin.x = [o_window frame].origin.x; o_rect.origin.y = [o_window frame].origin.y - o_rect.size.height + [o_window minSize].height; [o_btn_playlist setState: YES]; } else { /* make small */ o_rect.size.height = [o_window minSize].height; o_rect.size.width = [o_window minSize].width; o_rect.origin.x = [o_window frame].origin.x; /* Calculate the position of the lower right corner after resize */ o_rect.origin.y = [o_window frame].origin.y + [o_window frame].size.height - [o_window minSize].height; [o_playlist_view setAutoresizesSubviews: NO]; [o_playlist_view removeFromSuperview]; [o_btn_playlist setState: NO]; b_small_window = NO; /* we aren't small here just yet. we are doing an animated resize after this */ } [o_window setFrame: o_rect display:YES animate: YES];}- (void)updateTogglePlaylistState{ if( [o_window frame].size.height <= 200 ) { [o_btn_playlist setState: NO]; } else { [o_btn_playlist setState: YES]; }}- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize{ /* Not triggered on a window resize or maxification of the window. only by window mouse dragging resize */ /*Stores the size the controller one resize, to be able to restore it when toggling the playlist*/ o_size_with_playlist = proposedFrameSize; if( proposedFrameSize.height <= 200 ) { if( b_small_window == NO ) { /* if large and going to small then hide */ b_small_window = YES; [o_playlist_view setAutoresizesSubviews: NO]; [o_playlist_view removeFromSuperview]; } return NSMakeSize( proposedFrameSize.width, [o_window minSize].height); } return proposedFrameSize;}- (void)windowDidResize:(NSNotification *)notif{ if( [o_window frame].size.height > 200 && b_small_window ) { /* If large and co
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -