def windowConfigure(self): ''' show a window to choose encryptation''' l = [] l.append(Plugin.Option('encodeType', list, _('Encode:'), \ _('Select the Encryption of this conversation'), 'rijndael', \ self.getEncodeList())) l.append(Plugin.Option('defaultType', bool, _('Default type for this conversation:'), \ _('Is this option default?'), False)) self.configWindow = Plugin.ConfigWindow(_('Config Plugin'), l) response = self.configWindow.run() return response
def configure(self): '''display a configuration dialog''' # name, optionType, label, description, value, options status, langs = commands.getstatusoutput('enchant-lsmod -list-dicts') if status == 0: langs = sorted(list(set(re.sub(' \(.*?\)', '', langs).split('\n')))) else: self.error(_("Error getting dictionaries list")) langs = [] if not langs: self.error(_("No dictionaries found.")) return l = [] l.append( Plugin.Option('lang', list, _('Default language'), _('Set the default language'), self.config.getPluginValue(self.name, 'lang', ''), langs)) response = Plugin.ConfigWindow(_('Spell configuration'), l).run() if response != None and response.has_key('lang'): self.config.setPluginValue(self.name, 'lang', str(response['lang'].value)) self.lang = self.config.getPluginValue(self.name, 'lang', '') self.applyAllConv(self.setLang) return True
def configure( self ): configuration = [] configuration.append(Plugin.Option('', gtk.Widget, '', '', gtk.Label(_("Enable/disable events to be logged:")))) for signal in self.signals: configuration.append(Plugin.Option(signal, bool, self.signals_labels[signal], \ '', bool(int(self.config.getPluginValue(self.name, signal, True))))) configWindow = Plugin.ConfigWindow( 'Logger', configuration ) configWindow.vbox.set_spacing(0) response = configWindow.run() if response != None: for signal in self.signals: if response.has_key(signal): self.config.setPluginValue( self.name, signal, str(int(response[signal].value)) ) self.stop() self.start() return True
def configure(self): '''Configuration Dialog''' l=[] l.append(Plugin.Option('users', str, _('Alowed users:'), '', self.config.getPluginValue( self.name, 'users', '' ))) response = Plugin.ConfigWindow(_('Remote Configuration'), l).run() if response != None: self.users = str(response['users'].value) self.allowed = self.users.split() self.config.setPluginValue(self.name,'users', self.users) return True
def configure(self): dataM = [] dataM.append(Plugin.Option('time', str, _('Check every [min]:'), '',\ self.config.getPluginValue( self.name, 'time', '5' )) ) dataM.append(Plugin.Option('client', str, _('Client to execute:'), '',\ self.config.getPluginValue( self.name, 'client', 'thunderbird' ))) dataM.append( Plugin.Option( 'user', str, _('Username:'******'', self.config.getPluginValue(self.name, 'user', _('user')))) #dataM.append( Plugin.Option( 'pass', str, 'password:'******'', # self.config.getPluginValue( self.name, 'pass', '*****')) ) self.confW = Plugin.ConfigWindow(_('Mail checker config'), dataM) #Let's keep the pass entry secret label = gtk.Label(_('Password:'******'pass', '')) entry.set_visibility(False) #with this op. hbox = gtk.HBox() hbox.pack_start(label) hbox.pack_start(entry) self.confW.vbox.pack_start(hbox) self.confW.vbox.show_all() r = self.confW.run() passwd = str(entry.get_text()) if r is not None: self.config.setPluginValue(self.name, 'time', r['time'].value) self.config.setPluginValue(self.name, 'user', r['user'].value) self.config.setPluginValue(self.name, 'pass', passwd) self.config.setPluginValue(self.name, 'client', r['client'].value) #self.start() return True
def configure(self): '''Configuration Dialog''' l = [] l.append(Plugin.Option('method', list, _('Formatting:'), '', self.config.getPluginValue\ ( self.name, 'method', '' ), METHODLIST)) response = Plugin.ConfigWindow(_('PlusPlus Configuration'), l).run() if response != None: self.method = response['method'].value self.config.setPluginValue(self.name, 'method', self.method) self.controller.refreshUserList() return True
def configure(self): l = [] l.append( Plugin.Option('showStatusImage', bool, _('Show status image:'), _('Show status image:'), self.showStatusImage)) response = Plugin.ConfigWindow(_('StatusHistory plugin config'), l).run() if response != None: self.showStatusImage = response['showStatusImage'].value self.config.setPluginValue(self.name, 'showStatusImage', str(int(self.showStatusImage))) if self.enabled: self.box.remove(self.comboBox) self.addComboBox(self.box) return True
def configure(self): dataM = [] dataM.append( Plugin.Option( 'use_ssl', bool, _('Use SSL'), '', \ bool(int(self.config.getPluginValue(self.name, 'use_ssl', '1' )))) ) dataM.append( Plugin.Option( 'notifications', bool, \ _('Email notification - requires: ') + _('NotifyOsdImproved'), '', \ bool(int(self.config.getPluginValue(self.name, \ 'notifications', '0' )))) ) dataM.append( Plugin.Option( 'time', str, _('Check every [min]:'), '',\ self.config.getPluginValue( self.name, 'time', '5' )) ) dataM.append( Plugin.Option( 'server', str, _('IMAP server:'), '', \ self.config.getPluginValue( self.name, 'server', 'pop.test.com' ))) dataM.append( Plugin.Option('client', str, _('Client to execute:'),'',\ self.config.getPluginValue( self.name, 'client', 'thunderbird' )) ) dataM.append( Plugin.Option( 'user', str, _('Username:'******'', \ self.config.getPluginValue( self.name, 'user', _('user'))) ) #dataM.append( Plugin.Option( 'pass', str, 'password:'******'', self.config.getPluginValue( self.name, 'pass', '*****')) ) self.confW = Plugin.ConfigWindow(_('Mail checker config'), dataM) #Let's keep the pass entry secret label = gtk.Label(_('Password:'******'') entry.set_visibility(False) #with this op. hbox = gtk.HBox() hbox.pack_start(label) hbox.pack_start(entry) self.confW.vbox.pack_start(hbox) self.confW.vbox.show_all() r = self.confW.run() passwd = str(entry.get_text()) if r is not None: self.config.setPluginValue(self.name, 'time', r['time'].value) self.config.setPluginValue(self.name, 'server', r['server'].value) self.config.setPluginValue(self.name, 'user', r['user'].value) self.config.setPluginValue(self.name, 'pass', passwd) self.config.setPluginValue(self.name, 'client', r['client'].value) self.config.setPluginValue(self.name, 'use_ssl', str(int(r['use_ssl'].value))) self.notifications = r['notifications'].value self.config.setPluginValue(self.name, 'notifications', \ str(int(self.notifications))) #self.start() return True
def configure(self): '''display a configuration dialog''' l = [] l.append(Plugin.Option('notifyOnline', bool, \ _('Notify when someone comes online'), '', self.config.\ getPluginValue(self.name, 'notifyOnline', '1') == '1')) l.append(Plugin.Option('notifyOffline', bool, \ _('Notify when someone goes offline'), '', self.config.\ getPluginValue(self.name, 'notifyOffline', '1') == '1')) l.append(Plugin.Option('notifyMail', bool, \ _('Notify when receiving an email'), '', self.config.\ getPluginValue(self.name, 'notifyMail', '1') == '1')) l.append(Plugin.Option('typing', bool, \ _('Notify when someone starts typing'), '', self.config.\ getPluginValue(self.name, 'typing', '1') == '1')) l.append(Plugin.Option('notifyFTInvite', bool, \ _('Notify when someone starts a file transfer'), '', self.config.\ getPluginValue(self.name, 'notifyFTInvite', '1') == '1')) l.append(Plugin.Option('notifyFTFinished', bool, \ _('Notify when a file transfer finish'), '', self.config.\ getPluginValue(self.name, 'notifyFTFinished', '1') == '1')) l.append(Plugin.Option('notifyMessage', bool, \ _('Notify when receiving a message'), '', self.config.\ getPluginValue(self.name, 'notifyMessage', '1') == '1')) #l.append(Plugin.Option('notifyStarted', bool, \ # _('Don`t notify if conversation is started'), '', self.config.\ # getPluginValue(self.name, 'notifyStarted', '1') == '1')) l.append(Plugin.Option('notifyBusy', bool, \ _('Disable notifications when busy'), '', self.config.\ getPluginValue(self.name, 'notifyBusy', '1') == '1')) response = Plugin.ConfigWindow(_('Config LibNotify Plugin'), l).run() if response != None: def check(event): if response.has_key(event): self.config.setPluginValue(self.name, event, \ str(int(response[event].value))) check('notifyOnline') if response.has_key('notifyOffline'): self.config.setPluginValue(self.name, 'notifyOffline', \ str(int(response['notifyOffline'].value))) if response.has_key('notifyMail'): self.config.setPluginValue(self.name, 'notifyMail', \ str(int(response['notifyMail'].value))) if response.has_key('typing'): self.config.setPluginValue(self.name, 'typing', \ str(int(response['typing'].value))) if response.has_key('notifyFTInvite'): self.config.setPluginValue(self.name, 'notifyFTInvite', \ str(int(response['notifyFTInvite'].value))) if response.has_key('notifyFTFinished'): self.config.setPluginValue(self.name, 'notifyFTFinished', \ str(int(response['notifyFTFinished'].value))) if response.has_key('notifyMessage'): self.config.setPluginValue(self.name, 'notifyMessage', \ str(int(response['notifyMessage'].value))) #if response.has_key('notifyStarted'): # self.config.setPluginValue(self.name, 'notifyStarted', \ # str(int(response['notifyStarted'].value))) if response.has_key('notifyBusy'): self.config.setPluginValue(self.name, 'notifyBusy', \ str(int(response['notifyBusy'].value))) self.notifyOnline = (self.config.getPluginValue \ (self.name, 'notifyOnline', '1') == '1') self.notifyOffline = (self.config.getPluginValue \ (self.name, 'notifyOffline', '1') == '1') self.notifyNewMail = (self.config.getPluginValue \ (self.name, 'notifyMail', '1') == '1') self.notifyTyping = (self.config.getPluginValue \ (self.name, 'typing', '1') == '1') self.notifyFTInvite = (self.config.getPluginValue \ (self.name, 'notifyFTInvite', '1') == '1') self.notifyFTFinished = (self.config.getPluginValue \ (self.name, 'notifyFTFinished', '1') == '1') self.notifyNewMsg = (self.config.getPluginValue \ (self.name, 'notifyMessage', '1') == '1') #self.notifyStarted = (self.config.getPluginValue \ # (self.name, 'notifyStarted', '1') == '1') self.notifyBusy = (self.config.getPluginValue \ (self.name, 'notifyBusy', '1') == '1') self.updateTrayIconMenuList(); return True
def configure(self): '''display a configuration dialog''' style = self.config.getPluginValue(self.name, 'style', \ '%title - %artist (%album)') player = self.config.getPluginValue(self.name, 'player', 'Amarok') avatar = self.config.getPluginValue(self.name, 'avatar', '0') == '1' remotefetch = self.config.getPluginValue(self.name, \ 'remotefetch', '0') == '1' #self.updateCustomConf() plugin_names = self.getPluginNames() plugin_names.insert(0, _('Autodetect')) l = [] # name, optionType, label, description, value, options l.append(Plugin.Option('style', str, _('Display style'), \ _('Change display style of the song you are listening, possible ' \ 'variables are %title, %artist and %album'), style)) l.append(Plugin.Option('player', list, _('Music player'), \ _('Select the music player that you are using'), player, \ plugin_names, self.playerChanged)) self.statusLabel = gtk.Label() status_timeout = gobject.timeout_add(2000, self.updateStatus) self.updateStatus() logsButton = gtk.Button(_('Show logs')) logsButton.connect('clicked', self.showLogs) hbox = gtk.HBox() hbox.pack_start(self.statusLabel, True, True) hbox.pack_start(logsButton) status = Plugin.Option('status', gtk.Widget, '', '', hbox) l.append(status) l.append(Plugin.Option('avatar', bool, _('Change Avatar'), \ _('Change Avatar'), avatar)) l.append(Plugin.Option( 'remotefetch', bool, \ _( 'Get cover art from web' ), _( 'Get cover art from web' ), \ remotefetch )) custom = Plugin.Option('custom', dict, _('Custom config'), \ _('Custom config'), None, self.player.customConfig) l.append(custom) self.configWindow = Plugin.ConfigWindow(_('Config Plugin'), l) self.customConfigWidget = custom.widget response = self.configWindow.run() if status_timeout: # this stops the update status timeout gobject.source_remove(status_timeout) if response != None: if response.has_key('player'): self.setPlayer(response['player'].value) self.config.setPluginValue( self.name, 'player', \ response[ 'player' ].value ) if response.has_key('style'): self.player.setStyle(response['style'].value) self.config.setPluginValue( self.name, 'style', \ response['style'].value ) if response.has_key('avatar'): self.avatar = response['avatar'].value self.config.setPluginValue(self.name, 'avatar', \ str(int(response['avatar'].value))) if response.has_key('remotefetch'): self.remotefetch = response['remotefetch'].value self.config.setPluginValue( self.name, 'remotefetch', \ str(int(response[ 'remotefetch' ].value))) if response.has_key('custom'): self.player.customConfig = self.customConfigWidget.data for key in self.player.customConfig.keys(): self.config.setPluginValue(self.name, \ str(self.playername + "_" + key), \ self.player.customConfig[key]) self.player.updateConfig() self.configWindow = None self.statusLabel = None return True
def configure(self): dataM = [] dataM.append(Plugin.Option('time', str, _('Change every [sec]:'), '',\ self.config.getPluginValue( self.name, 'time', '20' )) ) dataM.append( Plugin.Option( 'user_folder', str, 'Image folder:', '',\ self.config.getPluginValue( self.name, 'user_folder',self.controller.config.getAvatarsCachePath())) ) dataM.append(Plugin.Option("random", bool, "Random ?", \ '', bool(int(self.config.getPluginValue(self.name, "random", False))))) dataM.append(Plugin.Option("order", bool, "Order files descending ?", \ '', bool(int(self.config.getPluginValue(self.name, "order", False))))) self.confW = Plugin.ConfigWindow(_('Image Timer config'), dataM) r = self.confW.run() if r is not None: needtostart = 0 OLDt = self.config.getPluginValue(self.name, 'time', '20') OLDuf = self.config.getPluginValue( self.name, 'user_folder', self.controller.config.getAvatarsCachePath()) OLDrnd = bool( int(self.config.getPluginValue(self.name, "random", False))) OLDord = bool( int(self.config.getPluginValue(self.name, "order", False))) if (OLDt != r['time'].value or OLDuf != r['user_folder'].value ) or OLDrnd != r['random'].value or OLDord != r['order'].value: needtostart = 1 if (r['random'].value and r['order'].value): if ((not OLDrnd) and (not OLDord)): r['random'].value = False if ((OLDrnd) and (OLDord)): r['random'].value = False if ((OLDrnd) and (not OLDord)): r['random'].value = False if ((not OLDrnd) and (OLDord)): r['order'].value = False if (OLDord != r['order'].value): self.Indexoflist = 0 self.order = r['order'].value self.config.setPluginValue(self.name, 'time', r['time'].value) self.config.setPluginValue(self.name, 'user_folder', r['user_folder'].value) self.config.setPluginValue(self.name, 'random', str(int(r['random'].value))) self.config.setPluginValue(self.name, 'order', str(int(r['order'].value))) if (needtostart > 0): print self.name + " : restarting " self.thedir = self.config.getPluginValue( self.name, 'user_folder',\ self.controller.config.getAvatarsCachePath() ) self.random = r['random'].value if not self.random: self.Indexoflist = 0 self.stop() self.start() return True