diff options
Diffstat (limited to 'QuickActions/QuickActionsPrefs')
-rw-r--r-- | QuickActions/QuickActionsPrefs/QASRootListController.h | 16 | ||||
-rw-r--r-- | QuickActions/QuickActionsPrefs/QASRootListController.m | 35 | ||||
-rw-r--r-- | QuickActions/QuickActionsPrefs/Resources/Root.plist | 50 |
3 files changed, 64 insertions, 37 deletions
diff --git a/QuickActions/QuickActionsPrefs/QASRootListController.h b/QuickActions/QuickActionsPrefs/QASRootListController.h index 6b45016..4ab9029 100644 --- a/QuickActions/QuickActionsPrefs/QASRootListController.h +++ b/QuickActions/QuickActionsPrefs/QASRootListController.h @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2021 Cameron Katri + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ #import <Preferences/PSListController.h> @interface QASRootListController : PSListController diff --git a/QuickActions/QuickActionsPrefs/QASRootListController.m b/QuickActions/QuickActionsPrefs/QASRootListController.m index e781ab6..2fe7cb2 100644 --- a/QuickActions/QuickActionsPrefs/QASRootListController.m +++ b/QuickActions/QuickActionsPrefs/QASRootListController.m @@ -1,5 +1,22 @@ +/* + * Copyright (C) 2021 Cameron Katri + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ #import <Foundation/Foundation.h> #import "QASRootListController.h" +#include <spawn.h> @implementation QASRootListController @@ -12,9 +29,27 @@ return _specifiers; } +-(void)viewDidLoad +{ + [super viewDidLoad]; + UIBarButtonItem *respringButton = [[UIBarButtonItem alloc] initWithTitle:@"Respring" + style:UIBarButtonItemStylePlain + target:self + action:@selector(respring)]; + respringButton.tintColor = [UIColor systemRedColor]; + [self.navigationItem setRightBarButtonItem:respringButton]; +} + -(void)openSource { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://git.cameronkatri.com/tweaks/tree/QuickActions"] options:@{} completionHandler:nil]; } +-(void)respring +{ + pid_t pid; + const char *args[] = {"sbreload", NULL, NULL, NULL}; + posix_spawn(&pid, "usr/bin/sbreload", NULL, NULL, (char *const *)args, NULL); +} + @end diff --git a/QuickActions/QuickActionsPrefs/Resources/Root.plist b/QuickActions/QuickActionsPrefs/Resources/Root.plist index 5b0c436..728dc93 100644 --- a/QuickActions/QuickActionsPrefs/Resources/Root.plist +++ b/QuickActions/QuickActionsPrefs/Resources/Root.plist @@ -7,22 +7,6 @@ <dict> <key>cell</key> <string>PSGroupCell</string> - <key>label</key> - <string>QuickActions</string> - </dict> - <dict> - <key>cell</key> - <string>PSSwitchCell</string> - <key>defaults</key> - <string>com.cameronkatri.quickactions</string> - <key>key</key> - <string>leftOn</string> - <key>label</key> - <string>Custom Left Button</string> - <key>default</key> - <false/> - <key>PostNotification</key> - <string>com.cameronkatri.quickactions/ReloadPrefs</string> </dict> <dict> <key>cell</key> @@ -30,11 +14,11 @@ <key>defaults</key> <string>com.cameronkatri.quickactions</string> <key>label</key> - <string>Left App</string> + <string>Left Apps</string> <key>detail</key> - <string>ATLApplicationListSelectionController</string> + <string>ATLApplicationListMultiSelectionController</string> <key>key</key> - <string>leftApp</string> + <string>leftButtons</string> <key>cellClass</key> <string>ATLApplicationSelectionCell</string> <key>sections</key> @@ -56,22 +40,10 @@ <true/> <key>includeIdentifiersInSearch</key> <true/> - <key>PostNotification</key> - <string>com.cameronkatri.quickactions/ReloadPrefs</string> </dict> <dict> <key>cell</key> - <string>PSSwitchCell</string> - <key>defaults</key> - <string>com.cameronkatri.quickactions</string> - <key>key</key> - <string>rightOn</string> - <key>label</key> - <string>Custom Right Button</string> - <key>default</key> - <false/> - <key>PostNotification</key> - <string>com.cameronkatri.quickactions/ReloadPrefs</string> + <string>PSGroupCell</string> </dict> <dict> <key>cell</key> @@ -79,11 +51,11 @@ <key>defaults</key> <string>com.cameronkatri.quickactions</string> <key>label</key> - <string>Right App</string> + <string>Right Apps</string> <key>detail</key> - <string>ATLApplicationListSelectionController</string> + <string>ATLApplicationListMultiSelectionController</string> <key>key</key> - <string>rightApp</string> + <string>rightButtons</string> <key>cellClass</key> <string>ATLApplicationSelectionCell</string> <key>sections</key> @@ -105,8 +77,12 @@ <true/> <key>includeIdentifiersInSearch</key> <true/> - <key>PostNotification</key> - <string>com.cameronkatri.quickactions/ReloadPrefs</string> + </dict> + <dict> + <key>cell</key> + <string>PSGroupCell</string> + <key>label</key> + <string>Links</string> </dict> <dict> <key>cell</key> |