Remove unused ConsoleViewController

This commit is contained in:
Gautier Pelloux-Prayer 2014-11-20 10:28:34 +01:00
parent 3d7cbbfda6
commit a4cac69e7c
4 changed files with 0 additions and 220 deletions

View file

@ -1,28 +0,0 @@
/* ConsoleViewController.h
*
* Copyright (C) 2010 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
#import "UICompositeViewController.h"
@interface ConsoleViewController : UIViewController<UICompositeViewDelegate, UIWebViewDelegate> {
}
@property (nonatomic, retain) IBOutlet UIWebView* logsView;
@end

View file

@ -1,153 +0,0 @@
/*ConsoleViewController.h
*
* Copyright (C) 2010 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "ConsoleViewController.h"
@implementation ConsoleViewController
@synthesize logsView;
#pragma mark - Lifecycle Functions
- (id)init {
return [super initWithNibName:@"ConsoleViewController" bundle:[NSBundle mainBundle]];
}
- (void)dealloc {
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
[logsView release];
[super dealloc];
}
#pragma mark - UICompositeViewDelegate Functions
static UICompositeViewDescription *compositeDescription = nil;
+ (UICompositeViewDescription *)compositeViewDescription {
if(compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:@"ConsoleView"
content:@"ConsoleViewController"
stateBar:@"UIStateBar"
stateBarEnabled:true
tabBar:@"UIMainBar"
tabBarEnabled:true
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
}
return compositeDescription;
}
#pragma mark - ViewController Functions
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[logsView loadHTMLString:@"<html><body><pre id=\"content\"></pre></body><html>" baseURL:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneLogsUpdate
object:nil];
}
- (void)viewDidLoad {
[super viewDidLoad];
[logsView setDelegate:self];
UIScrollView *scrollView = [ConsoleViewController defaultScrollView:logsView];
UIEdgeInsets inset = {0, 0, 10, 0};
[scrollView setContentInset:inset];
[scrollView setScrollIndicatorInsets:inset];
[scrollView setBounces:FALSE];
}
#pragma mark - UIWebViewDelegate Functions
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString *logs = [[LinphoneManager instance].logs componentsJoinedByString:@"\n"];
[self addLog:logs scroll:TRUE];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(logsUpdateEvent:)
name:kLinphoneLogsUpdate
object:nil];
}
#pragma mark - Event Functions
- (void)logsUpdateEvent:(NSNotification*)notif {
NSString *log = [notif.userInfo objectForKey: @"log"];
[self addLog:log scroll:FALSE];
}
#pragma mark -
+ (UIScrollView *)defaultScrollView:(UIWebView *)webView {
UIScrollView *scrollView = nil;
if ([[UIDevice currentDevice].systemVersion doubleValue] >= 5.0) {
return webView.scrollView;
} else {
for (UIView *subview in [webView subviews]) {
if ([subview isKindOfClass:[UIScrollView class]]) {
scrollView = (UIScrollView *)subview;
}
}
}
return scrollView;
}
- (void)clear {
NSString *js = @"document.getElementById('content').innerHTML += ''";
[logsView stringByEvaluatingJavaScriptFromString:js];
}
- (void)addLog:(NSString*)log scroll:(BOOL)scroll {
log = [log stringByReplacingOccurrencesOfString:@"\r" withString:@""];
log = [log stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
log = [log stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
log = [log stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"];
log = [log stringByReplacingOccurrencesOfString:@"<" withString:@"&lt;"];
log = [log stringByReplacingOccurrencesOfString:@">" withString:@"&gt;"];
NSMutableString *js = [NSMutableString stringWithFormat:@"document.getElementById('content').innerHTML += \"%@\\n\";", log];
if(scroll) {
[js appendString:@"window.scrollTo(0, document.body.scrollHeight);"];
}
[logsView stringByEvaluatingJavaScriptFromString:js];
}
@end

View file

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ConsoleViewController">
<connections>
<outlet property="logsView" destination="18" id="19"/>
<outlet property="view" destination="4" id="14"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="4">
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<webView contentMode="scaleToFill" id="18" userLabel="logsView">
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<dataDetectorType key="dataDetectorTypes"/>
</webView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</objects>
</document>

View file

@ -100,8 +100,6 @@
22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */; };
22D1B68112A3E0BE001AE361 /* libresolv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 22D1B68012A3E0BE001AE361 /* libresolv.dylib */; };
22E0A822111C44E100B04932 /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0A81C111C44E100B04932 /* AboutViewController.m */; };
22E0A823111C44E100B04932 /* ConsoleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A81E111C44E100B04932 /* ConsoleViewController.xib */; };
22E0A824111C44E100B04932 /* ConsoleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0A81F111C44E100B04932 /* ConsoleViewController.m */; };
22F2508E107141E100AC9B3F /* DialerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F2508C107141E100AC9B3F /* DialerViewController.m */; };
22F254811073D99800AC9B3F /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 22F254801073D99800AC9B3F /* ringback.wav */; };
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
@ -925,9 +923,6 @@
22E0A81B111C44E100B04932 /* AboutViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutViewController.xib; sourceTree = "<group>"; };
22E0A81C111C44E100B04932 /* AboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = "<group>"; };
22E0A81D111C44E100B04932 /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = "<group>"; };
22E0A81E111C44E100B04932 /* ConsoleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConsoleViewController.xib; sourceTree = "<group>"; };
22E0A81F111C44E100B04932 /* ConsoleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleViewController.m; sourceTree = "<group>"; };
22E0A820111C44E100B04932 /* ConsoleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleViewController.h; sourceTree = "<group>"; };
22F2508B107141E100AC9B3F /* DialerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DialerViewController.h; sourceTree = "<group>"; };
22F2508C107141E100AC9B3F /* DialerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = DialerViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
22F254801073D99800AC9B3F /* ringback.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ringback.wav; path = Resources/ringback.wav; sourceTree = "<group>"; };
@ -1848,9 +1843,6 @@
D35E7594159460560066B1C1 /* ChatViewController.h */,
D35E7595159460560066B1C1 /* ChatViewController.m */,
D38187B415FE340500C3EDCA /* ChatViewController.xib */,
22E0A820111C44E100B04932 /* ConsoleViewController.h */,
22E0A81F111C44E100B04932 /* ConsoleViewController.m */,
22E0A81E111C44E100B04932 /* ConsoleViewController.xib */,
D30BBD1215D3EFEB000F93DD /* ContactDetailsDelegate.h */,
D378906215AC373B00BD776C /* ContactDetailsLabelViewController.h */,
D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */,
@ -3024,7 +3016,6 @@
files = (
22F254811073D99800AC9B3F /* ringback.wav in Resources */,
2237D4091084D7A9001383EE /* ring.wav in Resources */,
22E0A823111C44E100B04932 /* ConsoleViewController.xib in Resources */,
22058C71116E305000B08DDD /* linphone_icon_57.png in Resources */,
225CB2FA11ABB76400628906 /* linphone-banner.png in Resources */,
2245F78A1201D38000C4179D /* AboutViewController.xib in Resources */,
@ -3650,7 +3641,6 @@
22F2508E107141E100AC9B3F /* DialerViewController.m in Sources */,
22E0A822111C44E100B04932 /* AboutViewController.m in Sources */,
631C4FB119D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */,
22E0A824111C44E100B04932 /* ConsoleViewController.m in Sources */,
2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */,
2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */,
2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */,