diff --git a/ProfilesManager.xcodeproj/project.pbxproj b/ProfilesManager.xcodeproj/project.pbxproj
index c41942d..5e27292 100755
--- a/ProfilesManager.xcodeproj/project.pbxproj
+++ b/ProfilesManager.xcodeproj/project.pbxproj
@@ -601,7 +601,7 @@
INFOPLIST_FILE = ProfilesManager/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
- MARKETING_VERSION = 2.5;
+ MARKETING_VERSION = 2.6;
PRODUCT_BUNDLE_IDENTIFIER = org.skyfox.ProfilesManager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -618,7 +618,7 @@
INFOPLIST_FILE = ProfilesManager/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
- MARKETING_VERSION = 2.5;
+ MARKETING_VERSION = 2.6;
PRODUCT_BUNDLE_IDENTIFIER = org.skyfox.ProfilesManager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
diff --git a/ProfilesManager/AppDelegate.m b/ProfilesManager/AppDelegate.m
index 14b386a..b7e4c51 100755
--- a/ProfilesManager/AppDelegate.m
+++ b/ProfilesManager/AppDelegate.m
@@ -18,21 +18,22 @@ @implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
-
+
_window = [[ProfilesManagerWindowController alloc] initWithWindowNibName:@"ProfilesManagerWindowController"];
_window.contentViewController = [[ProfilesManagerViewController alloc] initWithNibName:@"ProfilesManagerViewController" bundle:[NSBundle bundleForClass:[self class]]];
[_window.window orderFront:nil];
+
- NSMenuItem *helpMenu = [_window.window.menu itemWithTag:666];
- NSMenuItem *submenuItem = [helpMenu.submenu itemAtIndex:0];;
- submenuItem.action = @selector(showHelp:);
- submenuItem.target = self;
+ NSMenuItem *helpMenu = [_window.window.menu itemWithTag:666];
+ NSMenuItem *submenuItem = [helpMenu.submenu itemAtIndex:0];;
+ submenuItem.action = @selector(showHelp:);
+ submenuItem.target = self;
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
if (!flag)
{
- [_window.window makeKeyAndOrderFront:self];
+ [_window.window makeKeyAndOrderFront:self];
}
return YES;
}
diff --git a/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib b/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib
index bc2d558..fefd4fb 100644
--- a/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib
+++ b/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib
@@ -16,11 +16,11 @@
-
+
-
+
diff --git a/ProfilesManager/Controller/ProfilesManagerViewController.xib b/ProfilesManager/Controller/ProfilesManagerViewController.xib
index 975f0f3..3089d65 100755
--- a/ProfilesManager/Controller/ProfilesManagerViewController.xib
+++ b/ProfilesManager/Controller/ProfilesManagerViewController.xib
@@ -16,25 +16,25 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -45,9 +45,9 @@
-
+
-
+
@@ -58,9 +58,9 @@
-
+
-
+
@@ -73,7 +73,7 @@
-
+
@@ -86,7 +86,7 @@
-
+
@@ -99,7 +99,7 @@
-
+
@@ -120,7 +120,7 @@
-
+
@@ -128,12 +128,12 @@
-
+
-
+
@@ -153,7 +153,7 @@
-
+
diff --git a/ProfilesManager/Controller/ProfilesManagerWindowController.m b/ProfilesManager/Controller/ProfilesManagerWindowController.m
index bb78b72..5c7e9f0 100644
--- a/ProfilesManager/Controller/ProfilesManagerWindowController.m
+++ b/ProfilesManager/Controller/ProfilesManagerWindowController.m
@@ -11,7 +11,7 @@
#import "GitHubUpdater.h"
#import "NSFileManager+Trash.h"
#import "iAlert.h"
-@interface ProfilesManagerWindowController ()
+@interface ProfilesManagerWindowController ()
@property( atomic, readwrite, strong, nullable ) IBOutlet GitHubUpdater * updater;
@end
@@ -22,8 +22,14 @@ - (void)windowDidLoad {
self.updater = [[ GitHubUpdater alloc] init];
self.updater.user = @"shaojiankui";
self.updater.repository = @"ProfilesManager";
+ self.updater.delegate = self;
[self.updater checkForUpdatesInBackground];
+
+ // Saving a Window’s Position into the User’s Defaults
+ [self setShouldCascadeWindows:NO]; // Tell the controller to not cascade its windows.
+ [self setWindowFrameAutosaveName:@"profile"]; // Specify the autosave name for the window.
+
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
}
@@ -71,6 +77,13 @@ - (IBAction)refreshButtonTouched:(id)sender {
- (IBAction)resetButtonTouched:(id)sender {
// rm ~/Library/Preferences/myapp.plist; sudo killall cfprefsd
// defaults delete ~/Library/Preferences/myapp.plist
+ [[NSUserDefaults standardUserDefaults] setObject:@"fuck" forKey:@"fuck"];
+// [[NSUserDefaults standardUserDefaults] setObject:@"1215 1057 345 181 0 0 3440 1417" forKey:@"NSWindow Frame NSNavPanelAutosaveName"];
+ [[NSUserDefaults standardUserDefaults] setObject:@"{1100, 700}" forKey:@"NSNavPanelExpandedSizeForSaveMode"];
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NSWindow Frame profile"];
+// [NSWindow removeFrameUsingName:@"profile"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+
[self.window setFrame:NSMakeRect(0, 0, 1100, 700) display:YES];
[self.window center];
}
diff --git a/ProfilesManager/Vendor/GitHubUpdates/GitHubInstallWindowController.m b/ProfilesManager/Vendor/GitHubUpdates/GitHubInstallWindowController.m
index 5fcf7e3..d430b5e 100644
--- a/ProfilesManager/Vendor/GitHubUpdates/GitHubInstallWindowController.m
+++ b/ProfilesManager/Vendor/GitHubUpdates/GitHubInstallWindowController.m
@@ -156,6 +156,16 @@ - ( void )windowDidLoad
- ( IBAction )install: ( nullable id )sender
{
+ //安装清除首选项
+ // rm ~/Library/Preferences/myapp.plist; sudo killall cfprefsd
+ // defaults delete ~/Library/Preferences/myapp.plist
+ [[NSUserDefaults standardUserDefaults] setObject:@"fuck" forKey:@"fuck"];
+// [[NSUserDefaults standardUserDefaults] setObject:@"1215 1057 345 181 0 0 3440 1417" forKey:@"NSWindow Frame NSNavPanelAutosaveName"];
+ [[NSUserDefaults standardUserDefaults] setObject:@"{1100, 700}" forKey:@"NSNavPanelExpandedSizeForSaveMode"];
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NSWindow Frame profile"];
+// [NSWindow removeFrameUsingName:@"profile"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+
NSString * app;
( void )sender;
diff --git a/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubInstallWindowController.xib b/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubInstallWindowController.xib
index 44f017d..92c06cd 100644
--- a/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubInstallWindowController.xib
+++ b/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubInstallWindowController.xib
@@ -1,8 +1,8 @@
-
+
-
+
@@ -23,14 +23,14 @@
-
+
-
+
-
+
@@ -38,7 +38,7 @@
-
+
@@ -52,7 +52,7 @@
-
+
@@ -77,7 +77,7 @@
-
+
@@ -88,17 +88,17 @@
-
+
-
+
-
+
-
+
@@ -117,7 +117,7 @@
-
+
@@ -205,7 +205,7 @@ DQ
-
+
diff --git a/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubProgressWindowController.xib b/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubProgressWindowController.xib
index 9e74ce4..d957bad 100644
--- a/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubProgressWindowController.xib
+++ b/ProfilesManager/Vendor/GitHubUpdates/Interface/Base.lproj/GitHubProgressWindowController.xib
@@ -1,8 +1,8 @@
-
+
-
+
@@ -22,7 +22,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -130,6 +130,6 @@ Gw
-
+