197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
gui_startup(100.0)
#-- Shortcut for glade.get_widget()
# Allows access to widgets as direct attributes instead of using .get_widget()
# Also looks in self.channels[] for the named channel plugins
def __getattr__(self, name):
if (name in self.channels):
return self.channels[name] # like self.shoutcast
elif (name in self.features):
return self.features[name] # like self.configwin
else:
return self.get_object(name) # or gives an error if neither exists
# Custom-named widgets are available from .widgets{} not via .get_widget()
def get_widget(self, name):
if name in self.widgets:
return self.widgets[name]
else:
return gtk.Builder.get_object(self, name)
# Run a function in thread
def thread(self, target, *args, **kwargs):
if conf.nothreads:
return target(*args, **kwargs)
thread = Thread(target=target, args=args, kwargs=kwargs)
thread.start()
#self.working.append(thread)
# Returns the currently selected directory/channel object (remembered position)
def channel(self):
return self.channels[self.current_channel]
# List of module titles for channel tabs
|
|
|
|
>
<
|
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
gui_startup(100.0)
#-- Shortcut for glade.get_widget()
# Allows access to widgets as direct attributes instead of using .get_widget()
# Also looks in self.channels[] for the named channel plugins
def __getattr__(self, name):
if name in self.channels:
return self.channels[name] # like self.shoutcast
elif name in self.features:
return self.features[name] # like self.configwin
else:
return self.get_object(name) # or gives an error if neither exists
# Custom-named widgets are available from .widgets{} not via .get_widget()
def get_widget(self, name):
if name in self.widgets:
return self.widgets[name]
else:
return gtk.Builder.get_object(self, name)
# Run function in separate thread.
# Often used in conjunction with uikit.do() for Gtk interactions.
def thread(self, target, *args, **kwargs):
if conf.nothreads:
return target(*args, **kwargs)
thread = Thread(target=target, args=args, kwargs=kwargs)
thread.start()
# Returns the currently selected directory/channel object (remembered position)
def channel(self):
return self.channels[self.current_channel]
# List of module titles for channel tabs
|