mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 17:15:32 +00:00
Added Paste Settings Button (Settings.xm)
what it does: “Paste Settings” is a new button in uYouEnhanced settings that can allow you to paste option keys (k) Example (Clipboard): key: 0 key: 1 key is something like a key that shows `_enabled` so basically `lowContrastMode_enabled` can be used. next the numbers indicate rather they are off or on. 0 = Off/Disabled 1 = On/Enabled for the option.
This commit is contained in:
parent
fc22019286
commit
f14e068347
1 changed files with 27 additions and 0 deletions
|
|
@ -180,6 +180,33 @@ extern NSBundle *uYouPlusBundle();
|
|||
];
|
||||
[sectionItems addObject:developers];
|
||||
|
||||
YTSettingsSectionItem *pasteSettings = [%c(YTSettingsSectionItem)
|
||||
itemWithTitle:LOC(@"Paste Settings")
|
||||
titleDescription:LOC(@"Paste settings from clipboard and apply")
|
||||
accessibilityIdentifier:nil
|
||||
detailTextBlock:nil
|
||||
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSString *settingsString = [[UIPasteboard generalPasteboard] string];
|
||||
|
||||
if (settingsString.length > 0) {
|
||||
NSArray *lines = [settingsString componentsSeparatedByString:@"\n"];
|
||||
|
||||
for (NSString *line in lines) {
|
||||
NSArray *components = [line componentsSeparatedByString:@": "];
|
||||
if (components.count == 2) {
|
||||
NSString *key = components[0];
|
||||
BOOL value = [components[1] intValue];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:value forKey:key];
|
||||
}
|
||||
}
|
||||
}
|
||||
[settingsViewController reloadData];
|
||||
SHOW_RELAUNCH_YT_SNACKBAR;
|
||||
return YES;
|
||||
}
|
||||
];
|
||||
[sectionItems addObject:pasteSettings];
|
||||
|
||||
YTSettingsSectionItem *exitYT = [%c(YTSettingsSectionItem)
|
||||
itemWithTitle:LOC(@"QUIT_YOUTUBE")
|
||||
titleDescription:nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue