From a2e2d87eb7352a9aaecea33da6aa27e55af4e38d Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Fri, 24 Dec 2021 09:20:23 -0500 Subject: QuickActions: Massive improvements Relicense everything as AGPLv3 --- .../QuickActionsPrefs/QASRootListController.h | 16 +++++++ .../QuickActionsPrefs/QASRootListController.m | 35 +++++++++++++++ .../QuickActionsPrefs/Resources/Root.plist | 50 ++++++---------------- 3 files changed, 64 insertions(+), 37 deletions(-) (limited to 'QuickActions/QuickActionsPrefs') 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 . + */ #import @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 . + */ #import #import "QASRootListController.h" +#include @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 @@ cell PSGroupCell - label - QuickActions - - - cell - PSSwitchCell - defaults - com.cameronkatri.quickactions - key - leftOn - label - Custom Left Button - default - - PostNotification - com.cameronkatri.quickactions/ReloadPrefs cell @@ -30,11 +14,11 @@ defaults com.cameronkatri.quickactions label - Left App + Left Apps detail - ATLApplicationListSelectionController + ATLApplicationListMultiSelectionController key - leftApp + leftButtons cellClass ATLApplicationSelectionCell sections @@ -56,22 +40,10 @@ includeIdentifiersInSearch - PostNotification - com.cameronkatri.quickactions/ReloadPrefs cell - PSSwitchCell - defaults - com.cameronkatri.quickactions - key - rightOn - label - Custom Right Button - default - - PostNotification - com.cameronkatri.quickactions/ReloadPrefs + PSGroupCell cell @@ -79,11 +51,11 @@ defaults com.cameronkatri.quickactions label - Right App + Right Apps detail - ATLApplicationListSelectionController + ATLApplicationListMultiSelectionController key - rightApp + rightButtons cellClass ATLApplicationSelectionCell sections @@ -105,8 +77,12 @@ includeIdentifiersInSearch - PostNotification - com.cameronkatri.quickactions/ReloadPrefs + + + cell + PSGroupCell + label + Links cell -- cgit v1.2.3-56-ge451