From f0f3202acf69a57ddb345ba98f64d27651a5e228 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 9 Aug 2016 17:40:03 +0200 Subject: [PATCH] add ShopView --- Classes/Base.lproj/ShopView.xib | 232 +++++++++++++++++++++++++++++ Classes/ShopView.h | 30 ++++ Classes/ShopView.m | 68 +++++++++ Classes/SideMenuTableView.m | 7 + Classes/en.lproj/ShopView.strings | 30 ++++ Classes/fr.lproj/ShopView.strings | 30 ++++ linphone.xcodeproj/project.pbxproj | 22 +++ 7 files changed, 419 insertions(+) create mode 100644 Classes/Base.lproj/ShopView.xib create mode 100644 Classes/ShopView.h create mode 100644 Classes/ShopView.m create mode 100644 Classes/en.lproj/ShopView.strings create mode 100644 Classes/fr.lproj/ShopView.strings diff --git a/Classes/Base.lproj/ShopView.xib b/Classes/Base.lproj/ShopView.xib new file mode 100644 index 000000000..21f64cc1c --- /dev/null +++ b/Classes/Base.lproj/ShopView.xib @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/ShopView.h b/Classes/ShopView.h new file mode 100644 index 000000000..fbad2728b --- /dev/null +++ b/Classes/ShopView.h @@ -0,0 +1,30 @@ +/* AboutViewController.h + * + * Copyright (C) 2009 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 + +#import "UICompositeView.h" + +@interface ShopView : TPMultiLayoutViewController + +- (IBAction)onLinkTap:(id)sender; +- (IBAction)onDialerBackClick:(id)sender; +- (IBAction)onPurchaseButtonClick:(id)sender; + +@end diff --git a/Classes/ShopView.m b/Classes/ShopView.m new file mode 100644 index 000000000..5bef82783 --- /dev/null +++ b/Classes/ShopView.m @@ -0,0 +1,68 @@ +/* AboutViewController.m + * + * Copyright (C) 2009 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 "PhoneMainView.h" +#import "ShopView.h" +#import "LinphoneManager.h" +#import "LinphoneIOSVersion.h" + +@implementation ShopView + +#pragma mark - UICompositeViewDelegate Functions + +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if (compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:self.class + statusBar:StatusBarView.class + tabBar:nil + sideMenu:SideMenuView.class + fullscreen:false + isLeftFragment:YES + fragmentWith:nil]; + } + return compositeDescription; +} + +- (UICompositeViewDescription *)compositeViewDescription { + return self.class.compositeViewDescription; +} + +#pragma mark - ViewController Functions + +- (void)viewDidLoad { + [super viewDidLoad]; + +} + +#pragma mark - Action Functions + +- (IBAction)onLinkTap:(id)sender { + +} + +- (IBAction)onDialerBackClick:(id)sender { + [PhoneMainView.instance popToView:DialerView.compositeViewDescription]; +} + +- (IBAction)onPurchaseButtonClick:(id)sender { + [PhoneMainView.instance popToView:DialerView.compositeViewDescription]; +} +@end diff --git a/Classes/SideMenuTableView.m b/Classes/SideMenuTableView.m index 15c99db3e..5a08be20e 100644 --- a/Classes/SideMenuTableView.m +++ b/Classes/SideMenuTableView.m @@ -11,6 +11,7 @@ #import "PhoneMainView.h" #import "StatusBarView.h" +#import "ShopView.h" @implementation SideMenuEntry @@ -47,6 +48,12 @@ [PhoneMainView.instance changeCurrentView:SettingsView.compositeViewDescription]; }]]; + [_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Shop", nil) + tapBlock:^() { + [PhoneMainView.instance + changeCurrentView:ShopView.compositeViewDescription]; + + }]]; [_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"About", nil) tapBlock:^() { [PhoneMainView.instance diff --git a/Classes/en.lproj/ShopView.strings b/Classes/en.lproj/ShopView.strings new file mode 100644 index 000000000..ff6c0ae4e --- /dev/null +++ b/Classes/en.lproj/ShopView.strings @@ -0,0 +1,30 @@ + +/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "ETk-tB-ZNl"; */ +"ETk-tB-ZNl.accessibilityLabel" = "Add contact"; + +/* Class = "UILabel"; text = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; ObjectID = "ToT-OI-B2F"; */ +"ToT-OI-B2F.text" = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; + +/* Class = "UILabel"; text = "Label"; ObjectID = "Ui2-bF-EnK"; */ +"Ui2-bF-EnK.text" = "Label"; + +/* Class = "UILabel"; text = "LINPHONE"; ObjectID = "fss-Tl-kRy"; */ +"fss-Tl-kRy.text" = "LINPHONE"; + +/* Class = "UILabel"; text = "Linphone Core 3.9.0"; ObjectID = "g2W-u5-yxg"; */ +"g2W-u5-yxg.text" = "Linphone Core 3.9.0"; + +/* Class = "UILabel"; text = "SHOP"; ObjectID = "iNt-9d-7si"; */ +"iNt-9d-7si.text" = "SHOP"; + +/* Class = "UILabel"; text = "Linphone iPhone 3.0"; ObjectID = "oYk-ih-BBi"; */ +"oYk-ih-BBi.text" = "Linphone iPhone 3.0"; + +/* Class = "UILabel"; text = "https://www.linphone.org"; ObjectID = "uis-xz-Qsa"; */ +"uis-xz-Qsa.text" = "https://www.linphone.org"; + +/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "vX8-wO-ZEN"; */ +"vX8-wO-ZEN.accessibilityLabel" = "Add contact"; + +/* Class = "UILabel"; text = "ABOUT"; ObjectID = "wKp-iH-ojJ"; */ +"wKp-iH-ojJ.text" = "ABOUT"; diff --git a/Classes/fr.lproj/ShopView.strings b/Classes/fr.lproj/ShopView.strings new file mode 100644 index 000000000..e598c42d6 --- /dev/null +++ b/Classes/fr.lproj/ShopView.strings @@ -0,0 +1,30 @@ + +/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "ETk-tB-ZNl"; */ +"ETk-tB-ZNl.accessibilityLabel" = "Add contact"; + +/* Class = "UILabel"; text = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; ObjectID = "ToT-OI-B2F"; */ +"ToT-OI-B2F.text" = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; + +/* Class = "UILabel"; text = "Purchase"; ObjectID = "Ui2-bF-EnK"; */ +"Ui2-bF-EnK.text" = "Purchase"; + +/* Class = "UILabel"; text = "LINPHONE"; ObjectID = "fss-Tl-kRy"; */ +"fss-Tl-kRy.text" = "LINPHONE"; + +/* Class = "UILabel"; text = "Linphone Core 3.9.0"; ObjectID = "g2W-u5-yxg"; */ +"g2W-u5-yxg.text" = "Linphone Core 3.9.0"; + +/* Class = "UILabel"; text = "SHOP"; ObjectID = "iNt-9d-7si"; */ +"iNt-9d-7si.text" = "SHOP"; + +/* Class = "UILabel"; text = "Linphone iPhone 3.0"; ObjectID = "oYk-ih-BBi"; */ +"oYk-ih-BBi.text" = "Linphone iPhone 3.0"; + +/* Class = "UILabel"; text = "https://www.linphone.org"; ObjectID = "uis-xz-Qsa"; */ +"uis-xz-Qsa.text" = "https://www.linphone.org"; + +/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "vX8-wO-ZEN"; */ +"vX8-wO-ZEN.accessibilityLabel" = "Add contact"; + +/* Class = "UILabel"; text = "ABOUT"; ObjectID = "wKp-iH-ojJ"; */ +"wKp-iH-ojJ.text" = "ABOUT"; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 7be993c8a..7e7a155e6 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -40,6 +40,8 @@ 34216F401547EBCD00EA9777 /* VideoZoomHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 34216F3F1547EBCD00EA9777 /* VideoZoomHandler.m */; }; 344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDEF14850AE9007420B6 /* libc++.1.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 344ABDF214850AE9007420B6 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 570742581D5A0691004B9C84 /* ShopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 570742561D5A0691004B9C84 /* ShopView.xib */; }; + 570742611D5A09B8004B9C84 /* ShopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5707425F1D5A09B8004B9C84 /* ShopView.m */; }; 630589E71B4E810900EFAE36 /* ChatTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589DF1B4E810900EFAE36 /* ChatTester.m */; }; 630589E81B4E810900EFAE36 /* ContactsTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589E11B4E810900EFAE36 /* ContactsTester.m */; }; 630589EA1B4E810900EFAE36 /* LinphoneTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589E41B4E810900EFAE36 /* LinphoneTestCase.m */; }; @@ -934,6 +936,11 @@ 34216F3F1547EBCD00EA9777 /* VideoZoomHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VideoZoomHandler.m; path = LinphoneUI/VideoZoomHandler.m; sourceTree = ""; }; 344ABDEF14850AE9007420B6 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; + 570742571D5A0691004B9C84 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ShopView.xib; sourceTree = ""; }; + 5707425F1D5A09B8004B9C84 /* ShopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopView.m; sourceTree = ""; }; + 570742601D5A09B8004B9C84 /* ShopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopView.h; sourceTree = ""; }; + 570742631D5A1860004B9C84 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ShopView.strings; sourceTree = ""; }; + 570742651D5A1868004B9C84 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/ShopView.strings; sourceTree = ""; }; 630589DE1B4E810900EFAE36 /* ChatTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatTester.h; sourceTree = ""; }; 630589DF1B4E810900EFAE36 /* ChatTester.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatTester.m; sourceTree = ""; }; 630589E01B4E810900EFAE36 /* ContactsTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsTester.h; sourceTree = ""; }; @@ -1935,7 +1942,10 @@ children = ( 22E0A81D111C44E100B04932 /* AboutView.h */, 22E0A81C111C44E100B04932 /* AboutView.m */, + 5707425F1D5A09B8004B9C84 /* ShopView.m */, + 570742601D5A09B8004B9C84 /* ShopView.h */, 636316D31A1DEBCB0009B839 /* AboutView.xib */, + 570742561D5A0691004B9C84 /* ShopView.xib */, D350F20B15A43BB100149E54 /* AssistantView.h */, D350F20C15A43BB100149E54 /* AssistantView.m */, D38187E015FE348A00C3EDCA /* AssistantView.xib */, @@ -3702,6 +3712,7 @@ 633FEE121D3CD5590014B822 /* chat_message_not_delivered.png in Resources */, 633FEDCE1D3CD5590014B822 /* call_quality_indicator_1.png in Resources */, 633FEF4E1D3CD55A0014B822 /* valid_default.png in Resources */, + 570742581D5A0691004B9C84 /* ShopView.xib in Resources */, 633FEE361D3CD5590014B822 /* conference_exit_over.png in Resources */, 633FEDAA1D3CD5590014B822 /* backspace_disabled.png in Resources */, F0938159188E629800A55DFA /* iTunesArtwork in Resources */, @@ -3858,6 +3869,7 @@ 63B81A101B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */, F03CA84318C72F1A0008889D /* UITextViewNoDefine.m in Sources */, 63B81A0D1B57DA33009604A6 /* TPKeyboardAvoidingCollectionView.m in Sources */, + 570742611D5A09B8004B9C84 /* ShopView.m in Sources */, 63F1DF4F1BCE985F00EDED90 /* UICallConferenceCell.m in Sources */, D37DC6C11594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */, 63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */, @@ -3983,6 +3995,16 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 570742561D5A0691004B9C84 /* ShopView.xib */ = { + isa = PBXVariantGroup; + children = ( + 570742571D5A0691004B9C84 /* Base */, + 570742631D5A1860004B9C84 /* en */, + 570742651D5A1868004B9C84 /* fr */, + ); + name = ShopView.xib; + sourceTree = ""; + }; 63058A0F1B4E821E00EFAE36 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = (