#!/usr/bin/python # Created by Matteo Rattotti on 13/03/06. # Copyright (c) 2006 - 2007 Shiny Frog. All rights reserved. # Contact matteo.rattotti@shinyfrog.net for any problem # 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 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. from Foundation import * from AppKit import * from PyObjCTools import NibClassBuilder class DelibarPreferences(NibClassBuilder.AutoBaseClass): def username(self): return self.userField.stringValue() def password(self): return self.passField.stringValue() def proxy(self): return self.proxyField.stringValue() def setProxy(self, proxyString): self.proxyField.setStringValue_(proxyString) # Slider value def timerValue(self): return self.timerSlider.intValue() # Minute counter string setter def setTimerField(self, minute): self.timerField.setIntValue_(minute) def cloudValue(self): return self.cloudSlider.intValue() def sortValue(self): if self.sortType.cellAtRow_column_(0,0).state() == 1: return "Alpha" else: return "Freq" def nestingValue(self): if self.tagNesting.cellAtRow_column_(0,0).state() == 1: return "Plain" else: return "Nested" def enablePrefs(self, enable): self.sortType.setEnabled_(enable) self.timerSlider.setEnabled_(enable) self.cloudSlider.setEnabled_(enable) self.tagNesting.setEnabled_(enable) #def accountType(self): # if self.accountType.cellAtRow_column_(0,0).state() == 1: # return "del.cio.us" # else: # return "ma.gnolia" def isonStartup(self): return self.startupToggle.state()