/* * GNUnet Setup (Cocoa UI) * Copyright (C) 2009 Heikki Lindholm * * 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. */ #import #import #import typedef enum { GNSetupUserActionNone = 0, GNSetupUserActionDaemonConfig, GNSetupUserActionClientConfig, GNSetupUserActionQuit } GNSetupUserAction; @interface GNSetup : NSObject { struct GNUNET_GE_Context *errorContext; struct GNUNET_GNS_Context *gnsContext; struct GNUNET_GC_Configuration *config; NSMutableArray *gnsOptionsArray; char *configFilename; char *defaultDaemonConfigFilename; char *defaultClientConfigFilename; BOOL isDaemonConfig; BOOL shouldQuit; AuthorizationRef authRef; // authorization for daemon config BOOL isPreauthorized; GNSetupUserAction actionBeforeAlert; struct GNUNET_PluginHandle *cocoaSetupPlugin; Class GNUNETSetupView_class; IBOutlet NSWindow *window; IBOutlet NSMenuItem *daemonConfigMenuItem; IBOutlet NSMenuItem *clientConfigMenuItem; NSString *windowTitle; NSView *rootView; GNUNETSetupView *setupView; } - (id)init; - (void)awakeFromNib; - (BOOL)isReadyToTerminate; - (BOOL)windowShouldClose:(id)window; - (void)windowWillClose:(NSNotification *)notification; - (BOOL)initSetupView; - (void)updateWindowFrame; - (NSString *)getFilenameFromOpenPanel; - (void)displayErrorLoadingAlertWithInfo:(NSString *)info; - (void)displaySaveAlert; - (void)displayErrorSavingAlert; - (void)saveAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo; - (void)errorAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo; - (void)continueInterruptedAction; - (BOOL)preauthorize; - (void)loadAndDisplayConfigOfType:(BOOL)isDaemon; - (IBAction)selectedDaemonConfig:(id)sender; - (IBAction)selectedClientConfig:(id)sender; - (IBAction)saveChangesAction:(id)sender; - (void)getDefaultsFrom:(struct GNUNET_GNS_TreeNode *)pos; - (void)buildOptionList:(NSMutableArray *)optionsArray from:(struct GNUNET_GNS_TreeNode *)pos; - (int)loadConfigOfType:(BOOL)isDaemon fromFile:(const char *)filename; - (int)privilegedLoadConfig; - (int)saveConfig; - (int)privilegedSaveConfig; @end