save osw profile when temporarily leaving osw layout tool

This commit is contained in:
TrueZhuanjia committed 2025-07-24 19:25:05 +08:00
1 parent b7d7b9a058
commit 08ef392fca
2 files changed
+12

No files matched your search

@@ -14,6 +14,7 @@
#import "OnScreenButtonState.h" #import "OnScreenButtonState.h"
#import "OSCProfilesManager.h" #import "OSCProfilesManager.h"
@interface LayoutOnScreenControls () @interface LayoutOnScreenControls ()
@end @end
@@ -240,6 +240,11 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OSCLayoutChanged) name:@"OSCLayoutChanged" object:nil]; // used to notifiy this view controller that the user made a change to the OSC layout so that the VC can either fade in or out its 'Undo button' which will signify to the user whether there are any OSC layout changes to undo [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OSCLayoutChanged) name:@"OSCLayoutChanged" object:nil]; // used to notifiy this view controller that the user made a change to the OSC layout so that the VC can either fade in or out its 'Undo button' which will signify to the user whether there are any OSC layout changes to undo
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillResignActive:)
name:UIApplicationWillResignActiveNotification
object:nil];
OnScreenWidgetView.editMode = true; OnScreenWidgetView.editMode = true;
[self handleMissingToolBarIcon:toolbarRootView]; [self handleMissingToolBarIcon:toolbarRootView];
[self profileRefresh]; [self profileRefresh];
@@ -247,6 +252,11 @@
#pragma mark - Class Helper Functions #pragma mark - Class Helper Functions
- (void)applicationWillResignActive:(NSNotification *)notification {
[self saveTapped:nil];
}
/* fades the 'Undo Button' in or out depending on whether the user has any OSC layout changes to undo */ /* fades the 'Undo Button' in or out depending on whether the user has any OSC layout changes to undo */
- (void) OSCLayoutChanged { - (void) OSCLayoutChanged {
if ([self.layoutOSC.layoutChanges count] > 0) { if ([self.layoutOSC.layoutChanges count] > 0) {
@@ -1109,6 +1119,7 @@
} }
- (void) presentProfilesTableView{ - (void) presentProfilesTableView{
[self saveTapped:nil];
UIStoryboard *storyboard; UIStoryboard *storyboard;
BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone); BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
if (isIPhone) { if (isIPhone) {