/* SSNIBOrganization.m - NIB Organization system * SolarSeek * * Created by Takumi Murayama. * Copyright (C) 2005 SolarSeek * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "SSNIBOrganization.h" #import "SSPreferences.h" @implementation SSNIBOrganization + (void)initialize { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: @"NO", @"fade", @"server.slsknet.org", @"server_url", [NSNumber numberWithInt:2240], @"server_port", [NSNumber numberWithInt:2230], @"client_listen_port", [NSNumber numberWithInt:2230], @"client_listen_port_range_start", [NSNumber numberWithInt:2239], @"client_listen_port_range_end", [NSNumber numberWithInt:156], @"soulseek_version", @"", @"user", @"", @"pwd", [NSNumber numberWithBool:YES], @"auto_login", nil]; [defaults registerDefaults:appDefaults]; } // Preferences handling - (IBAction)openPreferencesWindow:(id)sender { [[SSPreferences sharedPrefsWindowController] showWindow:nil]; } // This makes it possible to drag the first divider around by the sidebarDragButton. - (unsigned int)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point inSubview:(RBSplitSubview*)subview { if (subview==sidebarSplit) { if ([sidebarDragButton mouse:[sidebarDragButton convertPoint:point fromView:sender] inRect:[sidebarDragButton bounds]]) { return 0; // [sidebarSplit position], which we assume to be zero } } return NSNotFound; } @end