Remove useless source code

AccountDetailsViewController and GlobalNotificationSettingsViewController.
This commit is contained in:
giomfo 2016-05-23 16:25:02 +02:00
parent 2e8deb0baa
commit 8a937ab2ca
7 changed files with 4 additions and 260 deletions

View file

@ -183,9 +183,7 @@
F094AA2B1B78E42600B1FBBF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F094AA0B1B78E42600B1FBBF /* Localizable.strings */; };
F094AA2C1B78E42600B1FBBF /* Vector.strings in Resources */ = {isa = PBXBuildFile; fileRef = F094AA0D1B78E42600B1FBBF /* Vector.strings */; };
F094AA2E1B78E42600B1FBBF /* countryCodes.plist in Resources */ = {isa = PBXBuildFile; fileRef = F094AA141B78E42600B1FBBF /* countryCodes.plist */; };
F094AA2F1B78E42600B1FBBF /* AccountDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA171B78E42600B1FBBF /* AccountDetailsViewController.m */; };
F094AA301B78E42600B1FBBF /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA191B78E42600B1FBBF /* AuthenticationViewController.m */; };
F094AA321B78E42600B1FBBF /* GlobalNotificationSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA1D1B78E42600B1FBBF /* GlobalNotificationSettingsViewController.m */; };
F094AA351B78E42600B1FBBF /* RecentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA231B78E42600B1FBBF /* RecentsViewController.m */; };
F094AA371B78E42600B1FBBF /* RoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA271B78E42600B1FBBF /* RoomViewController.m */; };
F094AA381B78E42600B1FBBF /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F094AA291B78E42600B1FBBF /* SettingsViewController.m */; };
@ -484,12 +482,8 @@
F094AA0C1B78E42600B1FBBF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
F094AA0E1B78E42600B1FBBF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Vector.strings; sourceTree = "<group>"; };
F094AA141B78E42600B1FBBF /* countryCodes.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = countryCodes.plist; sourceTree = "<group>"; };
F094AA161B78E42600B1FBBF /* AccountDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccountDetailsViewController.h; sourceTree = "<group>"; };
F094AA171B78E42600B1FBBF /* AccountDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountDetailsViewController.m; sourceTree = "<group>"; };
F094AA181B78E42600B1FBBF /* AuthenticationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationViewController.h; sourceTree = "<group>"; };
F094AA191B78E42600B1FBBF /* AuthenticationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationViewController.m; sourceTree = "<group>"; };
F094AA1C1B78E42600B1FBBF /* GlobalNotificationSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalNotificationSettingsViewController.h; sourceTree = "<group>"; };
F094AA1D1B78E42600B1FBBF /* GlobalNotificationSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GlobalNotificationSettingsViewController.m; sourceTree = "<group>"; };
F094AA221B78E42600B1FBBF /* RecentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentsViewController.h; sourceTree = "<group>"; };
F094AA231B78E42600B1FBBF /* RecentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentsViewController.m; sourceTree = "<group>"; };
F094AA261B78E42600B1FBBF /* RoomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoomViewController.h; sourceTree = "<group>"; };
@ -964,15 +958,11 @@
F0BE3DEE1C6CE17200AC3111 /* RoomMemberDetailsViewController.h */,
F0BE3DEF1C6CE17200AC3111 /* RoomMemberDetailsViewController.m */,
F0BE3DF11C6CE28300AC3111 /* RoomMemberDetailsViewController.xib */,
F094AA161B78E42600B1FBBF /* AccountDetailsViewController.h */,
F094AA171B78E42600B1FBBF /* AccountDetailsViewController.m */,
F094AA181B78E42600B1FBBF /* AuthenticationViewController.h */,
F094AA191B78E42600B1FBBF /* AuthenticationViewController.m */,
F047DBB41C576F2200952DA2 /* AuthenticationViewController.xib */,
325F6A371C21810E00C12F51 /* DirectoryViewController.h */,
325F6A381C21810E00C12F51 /* DirectoryViewController.m */,
F094AA1C1B78E42600B1FBBF /* GlobalNotificationSettingsViewController.h */,
F094AA1D1B78E42600B1FBBF /* GlobalNotificationSettingsViewController.m */,
3235CD831C341FAA0084EA40 /* HomeSearchViewController.h */,
3235CD841C341FAA0084EA40 /* HomeSearchViewController.m */,
32D200861C16C2B100A4E396 /* HomeViewController.h */,
@ -1462,7 +1452,6 @@
323A520B1C3183CC00010773 /* UIViewController+VectorSearch.m in Sources */,
717928491C03852C00407D96 /* TableViewCellWithLabelAndTextField.m in Sources */,
32A887211C89B9580037DC17 /* SimpleRoomTitleView.m in Sources */,
F094AA2F1B78E42600B1FBBF /* AccountDetailsViewController.m in Sources */,
F056417B1C7C9FD7002276ED /* TableViewCellWithButton.m in Sources */,
F0CC4DC01C4E26FA003BBE45 /* MediaAlbumTableCell.m in Sources */,
F022285B1C64D529000AF23C /* ExpandedRoomTitleView.m in Sources */,
@ -1488,7 +1477,6 @@
F09E24ED1C6DE24900D39503 /* RoomMemberTitleView.m in Sources */,
325F6A391C21810E00C12F51 /* DirectoryViewController.m in Sources */,
3235CD8D1C34309E0084EA40 /* HomeSearchCellData.m in Sources */,
F094AA321B78E42600B1FBBF /* GlobalNotificationSettingsViewController.m in Sources */,
F094A9A81B78D8F000B1FBBF /* main.m in Sources */,
71B2A3C01C203C7100472061 /* TableViewCellWithLabelAndSwitch.m in Sources */,
F00C47861BFF77C800DBABC9 /* RecentTableViewCell.m in Sources */,

View file

@ -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>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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];
}];