Exemplo n.º 1
0
	def adjustmentChanged(self, widget):
		## A generic function called when scrolling a scrollbar.
		# See above for description.
		dicEntry = self.adjDic[widget]
		cfg.set(dicEntry[CFGS], widget.get_value())
		if (CLBKS in dicEntry):
			dicEntry[CLBKS](widget)
Exemplo n.º 2
0
	def entryChanged(self, widget):
		## A generic function called when text in an entry is changed.
		# See above for description.
		dicEntry = self.entDic[widget]
		cfg.set(dicEntry[CFGS], widget.get_text())
		if (CLBKS in dicEntry):
			dicEntry[CLBKS](widget)
Exemplo n.º 3
0
	def checkboxToggle(self, widget):
		## A generic function called when toggling a checkbox.
		dicEntry = self.chkDic[widget]
		# First we change the config option apporpriately.
		cfg.set(dicEntry[CFGS], widget.get_active())
		# Then if there's a callback present, call it.
		if (CLBKS in dicEntry):
			dicEntry[CLBKS](widget)
Exemplo n.º 4
0
	def changeAudioDevice(self, widget):
		## Changes the output audio device.
		# Get the active index.
		index = widget.get_active()
		if (index == 0):
			# This is the default/auto option.
			cfg.set('audio/audiosink', '')
			cfg.set('audio/audiodevice', '')
		elif (index >= 2):
			# We don't want to change the settings if the index is 1 (manually set)
			# or 0 (default/auto).
			# Set the sink, and the device (-1 to account for the 'other' option)
			cfg.set('audio/audiosink', 'alsasink')
			cfg.set('audio/audiodevice', self.audioDevDic.keys()[index - 2])
		
		# Set the audio sink.
		if (index != 1): player.setAudioSink()
Exemplo n.º 5
0
	def changeVolume(self, widget, value):
		# Set the new volume on player and configuration.
		player.player.set_property('volume',value)
		cfg.set("audio/volume", value)
Exemplo n.º 6
0
	def extNewFileChanged(self, widget):
		## Changes the saved option for the external file action.
		cfg.set('misc/onextnewfile', widget.get_active())
Exemplo n.º 7
0
	def changeFont(self, widget):
		# Callback when the subtitle font is changed.
		font = widget.get_font_name()
		# Set the config option and apply the change to the player.
		cfg.set('video/subfont', font)
		player.setSubFont(font)
Exemplo n.º 8
0
	def subsEncChanged(self, widget):
		# Set the subtitle encoding
		cfg.set('video/subenc', widget.get_text())
Exemplo n.º 9
0
	def subsExtsChanged(self, widget):
		# Change the automatically detected subtitles extensions.
		cfg.set('video/autosubexts', widget.get_text())
Exemplo n.º 10
0
	def autoSubsToggled(self, widget):
		# Set the automatic subtitles config option.
		cfg.set('video/autosub', widget.get_active())