summaryrefslogtreecommitdiffstats
path: root/QuickActions/QuickActionsPrefs/QASRootListController.m
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/QASRootListController.m
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/QASRootListController.m')
-rw-r--r--QuickActions/QuickActionsPrefs/QASRootListController.m35
1 files changed, 35 insertions, 0 deletions
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