Kaydet (Commit) 598615ab authored tarafından Siqi LIU's avatar Siqi LIU

countdown timer for iPad & license page

Change-Id: I516a4e9da4e670f0fdbbfa0f793ccfb308189534
üst 1a412370
//
// PopoverView.h
// Embark
// PopoverView
// https://github.com/runway20/PopoverView
//
// Created by Oliver Rickard on 20/08/2012.
//(MIT Licensed)
//
//Copyright (c) 2012 Runway 20 Inc.
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <UIKit/UIKit.h>
#import "PopoverViewCompatibility.h"
......
//
// PopoverView.m
// Embark
// PopoverView
// https://github.com/runway20/PopoverView
//
// Created by Oliver Rickard on 20/08/2012.
//(MIT Licensed)
//
//Copyright (c) 2012 Runway 20 Inc.
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "PopoverView.h"
#import "PopoverView_Configuration.h"
......
//
// PopoverViewCompatibility.h
// popover
// PopoverView
// https://github.com/runway20/PopoverView
//
// Created by alanduncan on 7/22/13.
// Copyright (c) 2013 Oliver Rickard. All rights reserved.
//(MIT Licensed)
//
//Copyright (c) 2012 Runway 20 Inc.
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef popover_PopoverViewCompatibility_h
#define popover_PopoverViewCompatibility_h
......
//
// PopoverView_Configuration.h
// popover
// PopoverView
// https://github.com/runway20/PopoverView
//
// Created by Bas Pellis on 12/25/12.
// Copyright (c) 2012 Oliver Rickard. All rights reserved.
//(MIT Licensed)
//
//Copyright (c) 2012 Runway 20 Inc.
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#pragma mark Constants - Configure look/feel
......
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <UIKit/UIKit.h>
@interface AboutViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIWebView *aboutWebView;
@end
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "AboutViewController.h"
@interface AboutViewController ()
@end
@implementation AboutViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", nil) style:UIBarButtonItemStyleBordered target:self action:@selector(handleBack)];
[backButton setBackgroundImage:[UIImage imageNamed:@"backButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
self.navigationItem.leftBarButtonItem = backButton;
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"licenses" ofType:@"html" inDirectory:nil]];
[self.aboutWebView loadRequest:[NSURLRequest requestWithURL:url]];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidUnload {
[self setAboutWebView:nil];
[super viewDidUnload];
}
@end
......@@ -322,6 +322,7 @@
[self.timerView setShadowLight];
self.timer.delegate = self;
self.stopWatchTimerScrollView.contentSize = CGSizeMake(1240, 62);
[self.gearButton setShadowLight];
}
- (void)viewDidAppear:(BOOL)animated
......@@ -497,13 +498,12 @@
static BOOL isBlank = NO;
#pragma mark - Popover toggle
- (IBAction)popOverUp:(id)sender {
CGPoint popOverPoint = CGPointMake([self.gearButton.superview convertPoint:self.gearButton.center toView:self.view].x, [self.gearButton.superview convertPoint:self.gearButton.center toView:self.view].y - self.gearButton.frame.size.height/2);
if (!isBlank) {
[PopoverView showPopoverAtPoint:popOverPoint inView:self.view withStringArray:
[PopoverView showPopoverAtPoint:self.gearButton.frame.origin inView:self.gearButton.superview withStringArray:
[NSArray arrayWithObjects:NSLocalizedString(@"Stop Presentation", @"Popover option"), NSLocalizedString(@"Restart", @"Popover option"), NSLocalizedString(@"Blank Screen", @"Popover option"), nil]
delegate:self];
} else {
[PopoverView showPopoverAtPoint:popOverPoint inView:self.view withStringArray:
[PopoverView showPopoverAtPoint:self.gearButton.frame.origin inView:self.gearButton.superview withStringArray:
[NSArray arrayWithObjects:NSLocalizedString(@"Stop Presentation", @"Popover option"), NSLocalizedString(@"Restart", @"Popover option"), NSLocalizedString(@"Resume from blank Screen", @"Popover option"), nil]
delegate:self];
}
......
......@@ -7,6 +7,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "Timer.h"
#import <AudioToolbox/AudioServices.h>
@interface Timer ()
......@@ -28,6 +29,7 @@
int hours, minutes, seconds;
int secondsLeft;
int initSecondsLeft;
int vibrationCount;
- (Timer *) init
{
......@@ -104,6 +106,13 @@ int initSecondsLeft;
disappear = NO;
self.timeLabel.text = @"00:00:00";
[self.delegate setTitle:@"00:00:00" sender:self];
// Vibrate the phone if supported (i.e. this works on iPhone but not iPad)
// On ipad this just get ignored
if (kCountDownTimerVibration && vibrationCount < 3){
vibrationCount++;
NSLog(@"Vibrating...");
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}
}
}
}
......@@ -111,6 +120,8 @@ int initSecondsLeft;
- (void) start
{
// Reset vibration count to 0 on each start so that we vibrate 3 times maxi.
vibrationCount = 0;
switch (self.state) {
case TIMER_STATE_RUNNING:
self.state = TIMER_STATE_PAUSED;
......
......@@ -10,9 +10,11 @@
@interface server_list_vc : UITableViewController <UITableViewDelegate, UITableViewDataSource>
- (void)disableSpinner;
@property (strong, nonatomic) IBOutlet UITableView *serverTable;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuButton;
- (void)disableSpinner;
- (IBAction)onClickMenuButton:(id)sender;
- (void) startSearching;
@end
......@@ -17,7 +17,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
@interface server_list_vc () <NSNetServiceBrowserDelegate, NSNetServiceDelegate>
@interface server_list_vc () <NSNetServiceBrowserDelegate, NSNetServiceDelegate, PopoverViewDelegate>
@property (nonatomic, strong) CommunicationManager *comManager;
@property (nonatomic, weak) NSNotificationCenter* center;
......@@ -45,6 +45,27 @@
@synthesize pinValidationObserver = _pinValidationObserver;
@synthesize serviceBrowser = _serviceBrowser;
- (IBAction)onClickMenuButton:(id)sender {
[PopoverView showPopoverAtPoint:CGPointMake([[sender view] center].x, [[sender view] center].y + [[sender view] frame].size.height * 0.5) inView:[sender view].superview withStringArray:
[NSArray arrayWithObjects:NSLocalizedString(@"Connection Help", @"Popover option"), NSLocalizedString(@"About Impress Remote", @"Popover option"), nil]
delegate:self];
}
- (void)popoverView:(PopoverView *)popoverView didSelectItemAtIndex:(NSInteger)index
{
[popoverView dismiss];
switch (index) {
case 0:
[self performSegueWithIdentifier:@"howtoSegue" sender:self];
break;
case 1:
[self performSegueWithIdentifier:@"aboutSegue" sender:self];
break;
default:
break;
}
}
#pragma mark - helper
- (void) startSearching
{
......@@ -358,6 +379,7 @@
- (void)viewDidUnload {
[self setServerTable:nil];
[self setMenuButton:nil];
[super viewDidUnload];
}
......
<!-- -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
This file is part of the LibreOffice project.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<head>
<title>LibreOffice iOS remote for Impress</title>
<style>
* {
font-family: Helvetica Neue;
text-align: center;
font-size: 100%;
}
#externals p {
font-family: Helvetica Neue;
text-align: left-side;
font-size: 100%;
font-style: italic;
}
</style>
</head>
<body>
<img width="100%" src="./libreoffice_logo.png">
<div id="self">
<h1>Impress Remote for iOS</h1>
<p>Version: 1.0.0 Impress Remote<br>
(Build ID: 1)</p>
<p>Copyright 2013 LibreOffice Contributors and/or their affiliates.
<br>
<a href="www.libreoffice.org">www.libreoffice.org</a>
</p>
<p>This app is released under Mozilla Public License, v. 2.0.</p>
<hr>
</div>
<div id="externals">
<p>This app uses InAppSettingKits, which is released under BSD license that is available <a href="http://www.opensource.org/licenses/bsd-license.php">here</a>.</p>
<p>This app uses SWRevealViewController by Joan Lluch, which is released under BSD license that is available <a href="http://www.opensource.org/licenses/bsd-license.php">here</a>.</p>
<p>This app uses PopoverView by Runway 20 Inc., which is released under MIT license that is available <a href="http://opensource.org/licenses/MIT">here</a>.</p>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment