def moveSelectionToTrash(self): path = self.treev.get_cursor()[0] if not path: return objs = self.getObjsByPath(path) if len(path)==1: self.deleteGroup(path) elif len(path)==2: if confirm(_('Press OK if you want to move event "%s" to trash')%objs[1].summary): self.moveEventToTrash(path)
from scal2.locale_man import tr as _ from scal2.ui_gtk import * from scal2.ui_gtk.utils import confirm from scal2.ui_gtk.drawing import newOutlineSquarePixbuf confirmEventTrash = lambda event:\ confirm(_('Press OK if you want to move event "%s" to trash')%event.summary) def menuItemFromEventGroup(group): item = gtk.ImageMenuItem() item.set_label(group.title) ## image = gtk.Image() image.set_from_pixbuf(newOutlineSquarePixbuf(group.color, 20)) item.set_image(image) return item
def deleteGroup(self, path): index, = path group, = self.getObjsByPath(path) if not confirm(_('Press OK if you want to delete group "%s" and move all its events to trash')%group.title): return self.waitingDo(self._do_deleteGroup, path, group)
from scal2.locale_man import tr as _ from scal2.ui_gtk import * from scal2.ui_gtk.utils import confirm from scal2.ui_gtk.drawing import newOutlineSquarePixbuf confirmEventTrash = lambda event: confirm(_('Press OK if you want to move event "%s" to trash') % event.summary) def menuItemFromEventGroup(group): item = gtk.ImageMenuItem() item.set_label(group.title) ## image = gtk.Image() image.set_from_pixbuf(newOutlineSquarePixbuf(group.color, 20)) item.set_image(image) return item
from scal2 import event_lib from scal2 import ui from scal2.ui_gtk import * from scal2.ui_gtk.utils import toolButtonFromStock, set_tooltip, labelStockMenuItem, TimeZoneComboBoxEntry from scal2.ui_gtk.utils import dialog_add_button, CalTypeCombo, confirm, getStyleColor from scal2.ui_gtk.color_utils import gdkColorToRgb from scal2.ui_gtk.drawing import newOutlineSquarePixbuf from scal2.ui_gtk.mywidgets import TextFrame from scal2.ui_gtk.mywidgets.icon import IconSelectButton from scal2.ui_gtk.mywidgets.multi_spin_button import IntSpinButton, FloatSpinButton confirmEventTrash = lambda event:\ confirm(_('Press OK if you want to move event "%s" to trash')%event.summary) getGroupRow = lambda group, rowBgColor: ( group.id, newOutlineSquarePixbuf( group.color, 20, 0 if group.enable else 15, rowBgColor, ), group.title ) class EventWidget(gtk.VBox): def __init__(self, event):