mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-06 07:57:42 +02:00
Remove useless source code
AccountDetailsViewController and GlobalNotificationSettingsViewController.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
@@ -144,34 +144,11 @@
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Settings" id="7NM-zW-wJT"/>
|
||||
<connections>
|
||||
<segue destination="KeQ-Sp-kmH" kind="show" identifier="showAccountDetails" id="flf-61-vgV"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="ZKJ-22-Asy" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1404" y="96"/>
|
||||
</scene>
|
||||
<!--Account Details View Controller-->
|
||||
<scene sceneID="V8G-Oz-3KA">
|
||||
<objects>
|
||||
<tableViewController hidesBottomBarWhenPushed="YES" id="KeQ-Sp-kmH" customClass="AccountDetailsViewController" sceneMemberID="viewController">
|
||||
<connections>
|
||||
<segue destination="h5x-Kb-9pa" kind="show" identifier="showGlobalNotificationSettings" id="kgj-1g-opx"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="KBx-ZK-1zU" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2297" y="88"/>
|
||||
</scene>
|
||||
<!--Global notification settings-->
|
||||
<scene sceneID="QZt-ZR-Vkj">
|
||||
<objects>
|
||||
<tableViewController title="Global notification settings" hidesBottomBarWhenPushed="YES" id="h5x-Kb-9pa" customClass="GlobalNotificationSettingsViewController" sceneMemberID="viewController"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iOf-Cf-2Ew" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="3237" y="96"/>
|
||||
</scene>
|
||||
<!--RecentsSplitVC-->
|
||||
<scene sceneID="Nki-YV-4Qg">
|
||||
<objects>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import <MatrixKit/MatrixKit.h>
|
||||
|
||||
@interface AccountDetailsViewController : MXKAccountDetailsViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "AccountDetailsViewController.h"
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
|
||||
#import "RageShakeManager.h"
|
||||
|
||||
@interface AccountDetailsViewController()
|
||||
{
|
||||
NSInteger globalNotificationSettingsRowIndex;
|
||||
|
||||
// The "Global Notification Settings" button
|
||||
UIButton *globalNotifSettingsButton;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation AccountDetailsViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
// Setup `MXKViewControllerHandling` properties
|
||||
self.defaultBarTintColor = kVectorNavBarTintColor;
|
||||
self.enableBarTintColorStatusChange = NO;
|
||||
self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
}
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
[super destroy];
|
||||
|
||||
globalNotifSettingsButton = nil;
|
||||
}
|
||||
|
||||
#pragma mark - TableView data source
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
NSInteger count = [super tableView:tableView numberOfRowsInSection:section];
|
||||
|
||||
// Add one button in notification section to edit global notification settings
|
||||
if (section == notificationsSection)
|
||||
{
|
||||
globalNotificationSettingsRowIndex = count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell *cell;
|
||||
|
||||
if (indexPath.section == notificationsSection && indexPath.row == globalNotificationSettingsRowIndex)
|
||||
{
|
||||
MXKTableViewCellWithButton *globalNotifSettingsBtnCell = [tableView dequeueReusableCellWithIdentifier:[MXKTableViewCellWithButton defaultReuseIdentifier]];
|
||||
if (!globalNotifSettingsBtnCell)
|
||||
{
|
||||
globalNotifSettingsBtnCell = [[MXKTableViewCellWithButton alloc] init];
|
||||
}
|
||||
[globalNotifSettingsBtnCell.mxkButton setTitle:NSLocalizedStringFromTable(@"notification_settings_global_notification_settings", @"Vector", nil) forState:UIControlStateNormal];
|
||||
[globalNotifSettingsBtnCell.mxkButton setTitle:NSLocalizedStringFromTable(@"notification_settings_global_notification_settings", @"Vector", nil) forState:UIControlStateHighlighted];
|
||||
[globalNotifSettingsBtnCell.mxkButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
globalNotifSettingsButton = globalNotifSettingsBtnCell.mxkButton;
|
||||
|
||||
cell = globalNotifSettingsBtnCell;
|
||||
}
|
||||
else
|
||||
{
|
||||
cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - TableView delegate
|
||||
|
||||
- (void)onButtonPressed:(id)sender
|
||||
{
|
||||
if (sender == globalNotifSettingsButton)
|
||||
{
|
||||
[self performSegueWithIdentifier:@"showGlobalNotificationSettings" sender:self];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super onButtonPressed:sender];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Segues
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
||||
{
|
||||
// Keep ref on destinationViewController
|
||||
[super prepareForSegue:segue sender:sender];
|
||||
|
||||
if ([[segue identifier] isEqualToString:@"showGlobalNotificationSettings"])
|
||||
{
|
||||
MXKNotificationSettingsViewController *notifSettingsViewController = segue.destinationViewController;
|
||||
notifSettingsViewController.mxAccount = self.mxAccount;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import <MatrixKit/MatrixKit.h>
|
||||
|
||||
@interface GlobalNotificationSettingsViewController : MXKNotificationSettingsViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "GlobalNotificationSettingsViewController.h"
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
|
||||
#import "RageShakeManager.h"
|
||||
|
||||
@implementation GlobalNotificationSettingsViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
// Setup `MXKViewControllerHandling` properties
|
||||
self.defaultBarTintColor = kVectorNavBarTintColor;
|
||||
self.enableBarTintColorStatusChange = NO;
|
||||
self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
}
|
||||
@end
|
||||
@@ -125,30 +125,9 @@
|
||||
// Add observer to handle removed accounts
|
||||
removedAccountObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidRemoveAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
MXKAccount *account = notif.object;
|
||||
if (account)
|
||||
{
|
||||
if (self.childViewControllers.count)
|
||||
{
|
||||
for (id viewController in self.childViewControllers)
|
||||
{
|
||||
// Check whether details of this account was displayed
|
||||
if ([viewController isKindOfClass:[MXKAccountDetailsViewController class]])
|
||||
{
|
||||
MXKAccountDetailsViewController *accountDetailsViewController = viewController;
|
||||
if ([accountDetailsViewController.mxAccount.mxCredentials.userId isEqualToString:account.mxCredentials.userId])
|
||||
{
|
||||
// pop the account details view controller
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh table to remove this account
|
||||
[self.tableView reloadData];
|
||||
|
||||
}];
|
||||
|
||||
// Add observer to handle accounts update
|
||||
@@ -156,6 +135,7 @@
|
||||
|
||||
[self stopActivityIndicator];
|
||||
[self.tableView reloadData];
|
||||
|
||||
}];
|
||||
|
||||
// Add observer to apns
|
||||
@@ -163,6 +143,7 @@
|
||||
|
||||
[self stopActivityIndicator];
|
||||
[self.tableView reloadData];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user