Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Add StorageSample
Browse files Browse the repository at this point in the history
  • Loading branch information
grobbins committed Jun 23, 2015
1 parent cc2af53 commit 871dc7b
Show file tree
Hide file tree
Showing 12 changed files with 3,565 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Examples/StorageSample/English.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* Localized versions of Info.plist keys */

NSHumanReadableCopyright = "© Google Inc. 2012";
1,418 changes: 1,418 additions & 0 deletions Examples/StorageSample/English.lproj/MainMenu.xib

Large diffs are not rendered by default.

612 changes: 612 additions & 0 deletions Examples/StorageSample/English.lproj/StorageSampleWindow.xib

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Examples/StorageSample/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.example.StorageSample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions Examples/StorageSample/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This sample should automatically build and copy over the GTL.framework as part of the build-and-run process.
431 changes: 431 additions & 0 deletions Examples/StorageSample/StorageSample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Examples/StorageSample/StorageSampleAppController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright (c) 2012 Google Inc.
*
* 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.
*/

//
// StorageSampleAppController.h
//

#import <Cocoa/Cocoa.h>

@interface StorageSampleAppController : NSObject
@end
35 changes: 35 additions & 0 deletions Examples/StorageSample/StorageSampleAppController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Copyright (c) 2012 Google Inc.
*
* 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.
*/

//
// StorageSampleAppController.m
//

#import "StorageSampleAppController.h"
#import "StorageSampleWindowController.h"

@implementation StorageSampleAppController

- (void)applicationWillFinishLaunching:(NSNotification *)notification {
StorageSampleWindowController* windowController
= [StorageSampleWindowController sharedWindowController];
[windowController showWindow:self];
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
return YES;
}

@end
94 changes: 94 additions & 0 deletions Examples/StorageSample/StorageSampleWindowController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/* Copyright (c) 2012 Google Inc.
*
* 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.
*/

//
// StorageSampleWindowController.h
//

// The sample app controllers are built with ARC, though the sources of
// the GTL library should be built without ARC using the compiler flag
// -fno-objc-arc in the Compile Sources build phase of the application
// target.

#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif

#import <Cocoa/Cocoa.h>

#import "GTLStorage.h"
#import "GTMOAuth2WindowController.h"

@interface StorageSampleWindowController : NSWindowController {
@private
IBOutlet NSTextField *_signedInField;
IBOutlet NSButton *_signedInButton;

IBOutlet NSButton *_bucketListButton;
IBOutlet NSTableView *_bucketListTable;
IBOutlet NSProgressIndicator *_bucketListProgressIndicator;
IBOutlet NSTextView *_bucketListResultTextField;
IBOutlet NSButton *_bucketListCancelButton;

IBOutlet NSButton *_bucketAddButton;
IBOutlet NSWindow *_bucketAddSheet;
IBOutlet NSTextField *_bucketAddName;
IBOutlet NSButton *_bucketDeleteButton;

IBOutlet NSButtonCell *_downloadButton;

IBOutlet NSButton *_uploadButton;
IBOutlet NSProgressIndicator *_uploadProgressIndicator;
IBOutlet NSButton *_pauseUploadButton;
IBOutlet NSButton *_stopUploadButton;

IBOutlet NSSegmentedControl *_segmentedControl;
IBOutlet NSTableView *_detailTable;
IBOutlet NSProgressIndicator *_detailProgressIndicator;
IBOutlet NSTextView *_detailResultTextField;
IBOutlet NSButton *_detailCancelButton;

// Client ID Sheet (Not needed by real applications)
IBOutlet NSButton *_clientIDButton;
IBOutlet NSTextField *_clientIDRequiredTextField;
IBOutlet NSWindow *_clientIDSheet;
IBOutlet NSTextField *_clientIDField;
IBOutlet NSTextField *_clientSecretField;
}

+ (StorageSampleWindowController *)sharedWindowController;

- (IBAction)signInClicked:(id)sender;

- (IBAction)addBucketClicked:(id)sender;
- (IBAction)addBucketCancelClicked:(id)sender;
- (IBAction)addBucketAddClicked:(id)sender;
- (IBAction)deleteBucketClicked:(id)sender;

- (IBAction)uploadFileClicked:(id)sender;
- (IBAction)pauseUploadClicked:(id)sender;
- (IBAction)stopUploadClicked:(id)sender;
- (IBAction)downloadFileClicked:(id)sender;

- (IBAction)segmentedControlClicked:(id)sender;

- (IBAction)loggingCheckboxClicked:(id)sender;

// Client ID Sheet
- (IBAction)clientIDClicked:(id)sender;
- (IBAction)clientIDDoneClicked:(id)sender;
- (IBAction)APIConsoleClicked:(id)sender;

@end
Loading

0 comments on commit 871dc7b

Please sign in to comment.