Beispiel #1
0
 def _do_search(self):
     if self.groupCheck.get_active():
         groupIds = [
             self.groupCombo.get_active()
         ]
     else:
         groupIds = ui.eventGroups.getEnableIds()
     ###
     conds = {}
     conds['text'] = self.textInput.get_text()
     if self.timeFromCheck.get_active():
         conds['time_from'] = self.timeFromInput.get_epoch(core.primaryMode)
     if self.timeToCheck.get_active():
         conds['time_to'] = self.timeToInput.get_epoch(core.primaryMode)
     if self.modifiedFromCheck.get_active():
         conds['modified_from'] = self.modifiedFromInput.get_epoch(core.primaryMode)
     if self.typeCheck.get_active():
         index = self.typeCombo.get_active()
         cls = event_lib.classes.event[index]
         conds['type'] = cls.name
     ###
     self.trees.clear()
     for gid in groupIds:
         group = ui.eventGroups[gid]
         for evData in group.search(conds):
             self.trees.append(None, (
                 group.id,
                 evData['id'],
                 group.title,
                 pixbufFromFile(evData['icon']),
                 evData['summary'],
                 evData['description'],
             ))
     self.resultLabel.set_label(_('Found %s events')%_(len(self.trees)))
Beispiel #2
0
 def appendTrash(self):
     self.trashIter = self.trees.append(None, (
         -1,
         pixbufFromFile(ui.eventTrash.icon),
         ui.eventTrash.title,
         '',
     ))
     for event in ui.eventTrash:
         self.trees.append(self.trashIter, self.getEventRow(event))
Beispiel #3
0
 def editTrash(self, obj=None):
     TrashEditorDialog().run()
     self.trees.set_value(
         self.trashIter,
         1,
         pixbufFromFile(ui.eventTrash.icon),
     )
     self.trees.set_value(
         self.trashIter,
         2,
         ui.eventTrash.title,
     )
Beispiel #4
0
 def rowActivated(self, treev, path, col):
     try:
         gid = self.trees[path][0]
         eid = self.trees[path][1]
     except:
         return
     group = ui.eventGroups[gid]
     event = group[eid]
     event = EventEditorDialog(
         event,
         title=_('Edit ')+event.desc,
         parent=self,
     ).run()
     if event is None:
         return
     ui.reloadGroups.append(gid)
     eventIter = self.trees.get_iter(path)
     self.trees.set_value(eventIter, 3, pixbufFromFile(event.icon))
     self.trees.set_value(eventIter, 4, event.summary)
     self.trees.set_value(eventIter, 5, event.getShownDescription())
Beispiel #5
0
 def reloadEvents(self):
     self.trees.clear()
     self.trashIter = self.trees.append(None, (
         -1,
         pixbufFromFile(ui.eventTrash.icon),
         ui.eventTrash.title,
         '',
     ))
     for group in ui.eventGroups:
         self.appendGroupTree(group)
     for event in ui.eventTrash:
         self.trees.append(self.trashIter, self.getEventRow(event))
     self.treeviewCursorChanged()
     ####
     ui.newGroups = []
     ui.changedGroups = []
     ui.newEvents = []
     ui.changedEvents = []
     ui.trashedEvents = []
     ####
     self.isLoaded = True
Beispiel #6
0
	def editEventByPath(self, path):
		from scal2.ui_gtk.event.editor import EventEditorDialog
		try:
			gid = self.trees[path][0]
			eid = self.trees[path][1]
		except:
			return
		group = ui.eventGroups[gid]
		event = group[eid]
		event = EventEditorDialog(
			event,
			title=_('Edit ')+event.desc,
			parent=self,
		).run()
		if event is None:
			return
		###
		ui.eventDiff.add('e', event)
		###
		eventIter = self.trees.get_iter(path)
		self.trees.set_value(eventIter, 3, pixbufFromFile(event.icon))
		self.trees.set_value(eventIter, 4, event.summary)
		self.trees.set_value(eventIter, 5, event.getShownDescription())
Beispiel #7
0
 def editEventByPath(self, path):
     from scal2.ui_gtk.event.editor import EventEditorDialog
     try:
         gid = self.trees[path][0]
         eid = self.trees[path][1]
     except:
         return
     group = ui.eventGroups[gid]
     event = group[eid]
     event = EventEditorDialog(
         event,
         title=_('Edit ')+event.desc,
         parent=self,
     ).run()
     if event is None:
         return
     ###
     ui.eventDiff.add('e', event)
     ###
     eventIter = self.trees.get_iter(path)
     self.trees.set_value(eventIter, 3, pixbufFromFile(event.icon))
     self.trees.set_value(eventIter, 4, event.summary)
     self.trees.set_value(eventIter, 5, event.getShownDescription())
Beispiel #8
0
	def _do_search(self):
		if self.groupCheck.get_active():
			groupIds = [
				self.groupCombo.get_active()
			]
		else:
			groupIds = ui.eventGroups.getEnableIds()
		###
		conds = {}
		if self.textCSensCheck.get_active():
			conds['text'] = self.textInput.get_text()
		else:
			conds['text_lower'] = self.textInput.get_text().lower()
		if self.timeFromCheck.get_active():
			conds['time_from'] = self.timeFromInput.get_epoch(calTypes.primary)
		if self.timeToCheck.get_active():
			conds['time_to'] = self.timeToInput.get_epoch(calTypes.primary)
		if self.modifiedFromCheck.get_active():
			conds['modified_from'] = self.modifiedFromInput.get_epoch(calTypes.primary)
		if self.typeCheck.get_active():
			index = self.typeCombo.get_active()
			cls = event_lib.classes.event[index]
			conds['type'] = cls.name
		###
		self.trees.clear()
		for gid in groupIds:
			group = ui.eventGroups[gid]
			for evData in group.search(conds):
				self.trees.append(None, (
					group.id,
					evData['id'],
					group.title,
					pixbufFromFile(evData['icon']),
					evData['summary'],
					evData['description'],
				))
		self.resultLabel.set_label(_('Found %s events')%_(len(self.trees)))