-Subproject commit 78355da33ddaffcb7bc9bd460cb38f184962f3bf
+Subproject commit 20e74a13c1a904064b0544b398b677cc30f28ae8
- (IBAction)authenticationLogin:(id)sender {
// XXX hardcoded for now
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
- NSString *loginURL = [NSString stringWithFormat:@"https://pithos.dev.grnet.gr/login?next=pithos://%@_%d",
- [processInfo processName], [processInfo processIdentifier]];
+ NSString *loginURL = [NSString stringWithFormat:@"%@?next=pithos://%@_%d",
+ ((pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate]).loginURLPrefix,
+ [processInfo processName],
+ [processInfo processIdentifier]];
if ([authenticationRenewCheckBox state] == NSOnState)
loginURL = [loginURL stringByAppendingString:@"&renew="];
NSLog(@"loginURL: %@", loginURL);
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>LSMinimumSystemVersion</key>
- <string>${MACOSX_DEPLOYMENT_TARGET}</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
</array>
</dict>
</array>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>PithosStorageURLPrefix</key>
+ <string>https://pithos.dev.grnet.gr/v1</string>
+ <key>PithosPublicURLPrefix</key>
+ <string>https://pithos.dev.grnet.gr</string>
+ <key>PithosLoginURLPrefix</key>
+ <string>https://pithos.dev.grnet.gr/login</string>
+ <key>PithosAboutURL</key>
+ <string>https://pithos.dev.grnet.gr/docs</string>
</dict>
</plist>
NSString *storageURLPrefix;
NSString *publicURLPrefix;
+ NSString *loginURLPrefix;
+ NSString *aboutURL;
}
- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
@property (nonatomic, readonly) NSString *storageURLPrefix;
@property (nonatomic, readonly) NSString *publicURLPrefix;
+@property (nonatomic, readonly) NSString *loginURLPrefix;
+@property (nonatomic, readonly) NSString *aboutURL;
@end
#import "ASIDownloadCache.h"
@implementation pithos_macosAppDelegate
-@synthesize storageURLPrefix, publicURLPrefix;
+@synthesize storageURLPrefix, publicURLPrefix, loginURLPrefix, aboutURL;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
- // XXX hardcoded for now
- storageURLPrefix = @"https://pithos.dev.grnet.gr/v1";
- publicURLPrefix = @"https://pithos.dev.grnet.gr";
+ NSURL *testURL;
+ storageURLPrefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"PithosStorageURLPrefix"];
+ if (!storageURLPrefix) {
+ storageURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr/v1"];
+ } else {
+ testURL = [NSURL URLWithString:storageURLPrefix];
+ if (!testURL || !testURL.scheme || !testURL.host)
+ storageURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr/v1"];
+ }
+ [storageURLPrefix retain];
+
+ publicURLPrefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"PithosPublicURLPrefix"];
+ if (!publicURLPrefix) {
+ publicURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr"];
+ } else {
+ testURL = [NSURL URLWithString:publicURLPrefix];
+ if (!testURL || !testURL.scheme || !testURL.host)
+ publicURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr"];
+ }
+ [publicURLPrefix retain];
+
+ loginURLPrefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"PithosLoginURLPrefix"];
+ if (!loginURLPrefix) {
+ loginURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr/login"];
+ } else {
+ testURL = [NSURL URLWithString:loginURLPrefix];
+ if (!testURL || !testURL.scheme || !testURL.host)
+ loginURLPrefix = [NSString stringWithString:@"https://pithos.dev.grnet.gr/login"];
+ }
+ [loginURLPrefix retain];
+
+ aboutURL = [[NSUserDefaults standardUserDefaults] stringForKey:@"PithosAboutURL"];
+ if (!aboutURL) {
+ aboutURL = [NSString stringWithString:@"https://pithos.dev.grnet.gr/docs"];
+ } else {
+ testURL = [NSURL URLWithString:aboutURL];
+ if (!testURL || !testURL.scheme || !testURL.host)
+ aboutURL = [NSString stringWithString:@"https://pithos.dev.grnet.gr/docs"];
+ }
+ [aboutURL retain];
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
andSelector:@selector(handleAppleEvent:withReplyEvent:)
}
- (IBAction)aboutPithos:(id)sender {
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://pithos.dev.grnet.gr/docs"]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:self.aboutURL]];
}
#pragma mark -