Beispiel #1
0
	def run(self):
		if gtk.Dialog.run(self) == gtk.RESPONSE_ACCEPT:
			folder = self.button.get_filename()
			settings.set_option(self.module + '/structure_folder', folder)
			self.destroy()
			return folder
		else:
			self.destroy()
			return None
Beispiel #2
0
	def filteringTreeViewChanged(self, index):
		model = self.modesCB.model()
		value = model.data(model.index(index, 0))
		
		for key in self.toggled.iterkeys():
			self.toggled[key] = False
			
		if value != '':
			self.toggled[value] = True
		print self.toggled
		self.load()
		settings.set_option(self.module + 's/container_filter', index)
Beispiel #3
0
	def filteringTreeViewChanged(self, modeCB):
		value = modeCB.get_active_text()
		
		for key in self.toggled.iterkeys():
			self.toggled[key] = False
			
		if value != None:
			self.toggled[value] = True
		
			
		settings.set_option(self.module + 's/container_filter', modeCB.get_active())
		self.load()
Beispiel #4
0
	def closeEvent(self, e):
		from data.bdd import BDD
		BDD.saveCache()
		if 'music' in self.loadedModules:
			self.playerWidget.stop()
			self.queueManager.saveState()
		if 'videos' in self.loadedModules:
			self.managers['videos'].elementViewer.stop()
			
		settings.set_option('gui/maximized', self.maximized)
		settings.MANAGER.save()
		settings.MANAGER.saveTimer.cancel()
		print 'Good bye'
Beispiel #5
0
	def resizeEvent(self, e):
		if(not self.maximized):
			#pos = self.mapToGlobal(self.pos())
			settings.set_option('gui/window_x', self.pos().x())
			settings.set_option('gui/window_y', self.pos().y())
			settings.set_option('gui/window_width', e.size().width())
			settings.set_option('gui/window_height', e.size().height())
Beispiel #6
0
	def saveState(self):
		i = 0
		queues = {}
		while( i < self.tabWidget.count()):
			t = []
			queue =  self.tabWidget.widget(i)

			for track in queue.model.tracks:
				t.append(track.ID)

			if(type(queue).__name__ == 'Playlist'):
				queues[queue.label] = t
			else:
				queues[i] = t
			i += 1
		settings.set_option('session/queues', queues)
Beispiel #7
0
	def save_state(self):
		i = 0
		queues = {}
		while( i < self.NoteBook.get_n_pages()):
			t = []
			queue =  self.NoteBook.get_nth_page(i)
			model = queue.model
			iter = model.get_iter_first()
			while(iter is not None):
				t.append(model.get_value(iter, 3))
				iter = model.iter_next(iter)
			if(type(queue).__name__=='Playlist'):
				queues[self.NoteBook.get_nth_page(i).tab_label.get_text()] = t
			else:
				queues[i] = t
			i += 1
		settings.set_option('session/queues', queues)
Beispiel #8
0
	def setBrowserMode(self, viewType):
		'''
			Change the widget used to display containers
		'''
		from qt.uc_sections.panel import UC_Panel, UC_Panes
		

		
		if(viewType == 'panel'):
			newObj = UC_Panel(self.module, self.elementSelector)
		else:
			newObj = UC_Panes(self.module, self.elementSelector)
		settings.set_option(self.module + 's/browser_mode', viewType)
			
		index = self.upLayout.indexOf(self.containerBrowser)
		self.containerBrowser.deleteLater()
		self.upLayout.insertWidget(index, newObj, 0)
		
		self.containerBrowser = newObj
Beispiel #9
0
	def setBrowserMode(self, viewType):
		'''
			Hot swap the widget used to display containers
		'''
		from uc_sections.panel import UC_Panel, UC_Panes
		
		if(viewType == 'panel'):
			newObj = UC_Panel(self.module, self.elementSelector)
		else:
			newObj = UC_Panes(self.module, self.elementSelector)
			
		
		box = self.containerBrowser.get_parent()
		self.containerBrowser.destroy()
		box.pack_start(newObj, False)
		#else:
			#box.pack1(newObj, False)
		newObj.show_all()

		self.containerBrowser = newObj
		settings.set_option(self.module + 's/browser_mode', viewType)
Beispiel #10
0
	def resizeEvent(self, event):
		settings.set_option('music/paned_position', event.size().width())
Beispiel #11
0
	def toggleAntagonistic(self, state):
		settings.set_option(self.module + 's/show_antagonistic', self.showAntagonistic.isChecked())
		self.load()
Beispiel #12
0
	def on_width_change(self, *args):
		settings.set_option('music/' + self.name + '_width', self.get_width())
Beispiel #13
0
		def valider(self):
			settings.set_option('pictures/enabled', self.picture_enabled.get_active())
			settings.set_option('videos/enabled', self.video_enabled.get_active())
			
			folders = []
			iter = self.folders.get_iter_first()
			while iter is not None:
				folders.append((self.folders.get_value(iter, 0), self.folders.get_value(iter, 1)))
				iter = self.folders.iter_next(iter)
			settings.set_option('music/folders', folders)
				
			#Music settings:
			settings.set_option('music/playback_lib', self.CB_music_playback_lib.get_active_text())
			settings.set_option('music/panel_icon_size', int(self.CB_icon_size_panel_music.get_active_text()))
			settings.set_option('music/use_performer', self.usePerformerTag.get_active())
			
			settings.set_option('music/filters', self.Box_mfilters.get_config())
			
			#Pictures settings :
			settings.set_option('pictures/panel_icon_size', int(self.CB_icon_size_panel_pictures.get_active_text()))

			#Audioscrobbler settings :
			settings.set_option('music/audioscrobbler_login', self.audioscrobbler_login.get_text())
			settings.set_option('music/audioscrobbler_password', self.audioscrobbler_password.get_text())
			
			#Videos settings
			settings.set_option('videos/playback_lib', self.CB_video_playback_lib.get_active_text())
			
			for UCmodule in ('videos',):
				settings.set_option(UCmodule + '/indexed_extensions', self.widgets[UCmodule].extensions.get_text())
				settings.set_option(UCmodule + '/preload', self.widgets[UCmodule].preload.get_active())
				settings.set_option(UCmodule + '/panel_icon_size', int(self.widgets[UCmodule].CB_icon_size_panel.get_active_text()))
				
			
			settings.MANAGER.save()
Beispiel #14
0
	def toggleAntagonisitc(self, button):
		settings.set_option(self.module + 's/show_antagonistic', self.showAntagonistic.get_active())
		self.load()
Beispiel #15
0
	def columnMoved(self, logicalIndex, oldVisualIndex, newVisualIndex):
		header = self.horizontalHeader()
		for i in range(header.count()):
			self.columnsPos[i] = header.visualIndex(i)
			
		settings.set_option('music/columns_order', self.columnsPos)