summaryrefslogtreecommitdiffstats
path: root/QuickActions/QuickActionsPrefs
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-12-24 09:20:23 -0500
committerCameron Katri <me@cameronkatri.com>2021-12-24 09:20:23 -0500
commita2e2d87eb7352a9aaecea33da6aa27e55af4e38d (patch)
treed81c11c700866eb3041773dd9e3bbe1175678133 /QuickActions/QuickActionsPrefs
parent615b0aefe92fb5d7b1fae821f91eb98e3f403bfe (diff)
downloadtweaks-a2e2d87eb7352a9aaecea33da6aa27e55af4e38d.tar.gz
tweaks-a2e2d87eb7352a9aaecea33da6aa27e55af4e38d.tar.zst
tweaks-a2e2d87eb7352a9aaecea33da6aa27e55af4e38d.zip
QuickActions: Massive improvements
Relicense everything as AGPLv3
Diffstat (limited to 'QuickActions/QuickActionsPrefs')
-rw-r--r--QuickActions/QuickActionsPrefs/QASRootListController.h16
-rw-r--r--QuickActions/QuickActionsPrefs/QASRootListController.m35
-rw-r--r--QuickActions/QuickActionsPrefs/Resources/Root.plist50
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>