[vlc-commits] macosx: clear resume points as well once the user clear recent items list
David Fuhrmann
git at videolan.org
Sun Oct 9 00:45:00 CEST 2016
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Oct 9 00:41:02 2016 +0200| [a071bc7c4f91274cf78e57335ac7718851eac8c0] | committer: David Fuhrmann
macosx: clear resume points as well once the user clear recent items list
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a071bc7c4f91274cf78e57335ac7718851eac8c0
---
.../package/macosx/vlc.xcodeproj/project.pbxproj | 6 +++
modules/gui/macosx/Makefile.am | 1 +
modules/gui/macosx/VLCDocumentController.h | 28 ++++++++++++++
modules/gui/macosx/VLCDocumentController.m | 44 ++++++++++++++++++++++
4 files changed, 79 insertions(+)
diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
index e890ea7..f6523ae 100644
--- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
@@ -24,6 +24,7 @@
/* Begin PBXBuildFile section */
1C15C7DC1B5146DB003AB729 /* VLCResumeDialogController.h in Sources */ = {isa = PBXBuildFile; fileRef = 633121CA1B51122700E636DA /* VLCResumeDialogController.h */; };
1C15C7DD1B5146DB003AB729 /* VLCResumeDialogController.m in Sources */ = {isa = PBXBuildFile; fileRef = 633121CB1B51122700E636DA /* VLCResumeDialogController.m */; };
+ 1C39ABBE1DA9AB9B00FE052A /* VLCDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C39ABBD1DA9AB9B00FE052A /* VLCDocumentController.m */; };
1C51BDE51B7A221B0056B9AA /* TimeSelectionPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1C51BDE31B7A221B0056B9AA /* TimeSelectionPanel.xib */; };
1C57690E19DC93620099F5A6 /* topbar_background.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C57690D19DC93620099F5A6 /* topbar_background.png */; };
1C67C8A51D58C0980079E1C1 /* VLCHelpWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C67C8A41D58C0980079E1C1 /* VLCHelpWindowController.m */; };
@@ -905,6 +906,8 @@
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 1C39ABBC1DA9AB9B00FE052A /* VLCDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCDocumentController.h; path = ../../../modules/gui/macosx/VLCDocumentController.h; sourceTree = "<group>"; };
+ 1C39ABBD1DA9AB9B00FE052A /* VLCDocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCDocumentController.m; path = ../../../modules/gui/macosx/VLCDocumentController.m; sourceTree = "<group>"; };
1C3AABAC1B1BAE7B00FDF001 /* VLC.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = VLC.app; path = ../VLC.app; sourceTree = BUILT_PRODUCTS_DIR; };
1C3AABB01B1BB00A00FDF001 /* VLC-dev.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = "VLC-dev.app"; path = "../VLC-dev.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1C51BDE41B7A221B0056B9AA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/TimeSelectionPanel.xib; sourceTree = "<group>"; };
@@ -1905,6 +1908,8 @@
CC448A6113B68A0B009F72E0 /* VLCCoreInteraction.m */,
7D8BB0B318302AC000FAE9B7 /* VLCDebugMessageWindowController.h */,
7D8BB0B418302AC000FAE9B7 /* VLCDebugMessageWindowController.m */,
+ 1C39ABBC1DA9AB9B00FE052A /* VLCDocumentController.h */,
+ 1C39ABBD1DA9AB9B00FE052A /* VLCDocumentController.m */,
5CCED71014C0D4A90057F8D1 /* VLCExtensionsDialogProvider.h */,
5CCED71114C0D4A90057F8D1 /* VLCExtensionsDialogProvider.m */,
5CCED71214C0D4A90057F8D1 /* VLCExtensionsManager.h */,
@@ -4041,6 +4046,7 @@
1CCB5F881A62A724004C3E90 /* simple_prefs.m in Sources */,
1CCB5F891A62A724004C3E90 /* VLCStringUtility.h in Sources */,
1CCB5F8A1A62A724004C3E90 /* VLCStringUtility.m in Sources */,
+ 1C39ABBE1DA9AB9B00FE052A /* VLCDocumentController.m in Sources */,
1CCB5F8B1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.h in Sources */,
1CCB5F8C1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.m in Sources */,
6BBBB8B71D114628001BD9BA /* VLCRendererDiscovery.m in Sources */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index d8c3678..a49774f 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -29,6 +29,7 @@ libmacosx_plugin_la_SOURCES = \
BWQuincyUI.h BWQuincyUI.m \
CompatibilityFixes.h \
VLCControlsBarCommon.m VLCControlsBarCommon.h \
+ VLCDocumentController.m VLCDocumentController.h \
VLCMainWindowControlsBar.m VLCMainWindowControlsBar.h \
VLCConvertAndSaveWindowController.h VLCConvertAndSaveWindowController.m \
VLCCoreInteraction.h VLCCoreInteraction.m \
diff --git a/modules/gui/macosx/VLCDocumentController.h b/modules/gui/macosx/VLCDocumentController.h
new file mode 100644
index 0000000..5756f17
--- /dev/null
+++ b/modules/gui/macosx/VLCDocumentController.h
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * VLCDocumentController.h
+ *****************************************************************************
+ * Copyright (C) 2016 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+ at interface VLCDocumentController : NSDocumentController
+
+ at end
diff --git a/modules/gui/macosx/VLCDocumentController.m b/modules/gui/macosx/VLCDocumentController.m
new file mode 100644
index 0000000..a752c6b
--- /dev/null
+++ b/modules/gui/macosx/VLCDocumentController.m
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * VLCDocumentController.m
+ ****************************************************************************
+ * Copyright (C) 2016 VLC authors and VideoLAN
+ * Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "VLCDocumentController.h"
+
+#import "VLCMain.h"
+
+ at implementation VLCDocumentController
+
++ (void)load
+{
+ id controller = [[VLCDocumentController alloc] init];
+}
+
+- (IBAction)clearRecentDocuments:(id)sender
+{
+ msg_Dbg(getIntf(), "Clear recent items list and resume points");
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ [defaults setObject:[NSDictionary dictionary] forKey:@"recentlyPlayedMedia"];
+ [defaults setObject:[NSArray array] forKey:@"recentlyPlayedMediaList"];
+ [defaults synchronize];
+
+ [super clearRecentDocuments:sender];
+}
+
+ at end
More information about the vlc-commits
mailing list