Ejemplo n.º 1
0
 def __init__(self, event):
     from scal2.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo
     from scal2.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry
     gtk.VBox.__init__(self)
     self.event = event
     ###########
     hbox = gtk.HBox()
     ###
     pack(hbox, gtk.Label(_('Calendar Type')))
     combo = CalTypeCombo()
     combo.set_active(calTypes.primary)  ## overwritten in updateWidget()
     pack(hbox, combo)
     pack(hbox, gtk.Label(''), 1, 1)
     self.modeCombo = combo
     ###
     pack(self, hbox)
     ###########
     if event.isAllDay:
         self.tzCheck = None
     else:
         hbox = gtk.HBox()
         self.tzCheck = gtk.CheckButton(_('Time Zone'))
         set_tooltip(self.tzCheck, _('For input times of event'))
         pack(hbox, self.tzCheck)
         combo = TimeZoneComboBoxEntry()
         pack(hbox, combo)
         pack(hbox, gtk.Label(''), 1, 1)
         self.tzCombo = combo
         pack(self, hbox)
         self.tzCheck.connect(
             'clicked',
             lambda check: self.tzCombo.set_sensitive(check.get_active()))
     ###########
     hbox = gtk.HBox()
     pack(hbox, gtk.Label(_('Summary')))
     self.summaryEntry = gtk.Entry()
     pack(hbox, self.summaryEntry, 1, 1)
     pack(self, hbox)
     ###########
     self.descriptionInput = TextFrame()
     swin = gtk.ScrolledWindow()
     swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     swin.add_with_viewport(self.descriptionInput)
     ###
     exp = gtk.Expander()
     exp.set_expanded(True)
     exp.set_label(_('Description'))
     exp.add(swin)
     pack(self, exp, 1, 1)
     ###########
     hbox = gtk.HBox()
     pack(hbox, gtk.Label(_('Icon') + ':'))
     self.iconSelect = IconSelectButton()
     pack(hbox, self.iconSelect)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     ##########
     self.modeCombo.connect(
         'changed',
         self.modeComboChanged)  ## right place? before updateWidget? FIXME
Ejemplo n.º 2
0
 def __init__(self, name, stockName, method, tooltip='', text=''):
     #print 'ToolbarItem', name, stockName, method, tooltip, text
     self.method = method
     ######
     if not tooltip:
         tooltip = name.capitalize()
     tooltip = _(tooltip)
     ###
     if not text:
         text = name.capitalize()
     text = _(text)
     ######
     gtk.ToolButton.__init__(
         self,
         gtk.image_new_from_stock(
             getattr(gtk, 'STOCK_%s'%(stockName.upper())),
             gtk.ICON_SIZE_DIALOG,
         ) if stockName else None,
         text,
     )
     self._name = name
     self.desc = tooltip
     self.initVars()
     set_tooltip(self, tooltip)
     self.set_is_important(True)## FIXME
Ejemplo n.º 3
0
 def __init__(self, name, stockName, method, desc='', shortDesc='', enableTooltip=True):
     #print('ToolbarItem', name, stockName, method, desc, text)
     self.method = method
     ######
     if not desc:
         desc = name.capitalize()
     ##
     if not shortDesc:
         shortDesc = desc
     ##
     desc = _(desc)
     shortDesc = _(shortDesc)
     ######
     gtk.ToolButton.__init__(
         self,
         gtk.image_new_from_stock(
             getattr(gtk, 'STOCK_%s'%(stockName.upper())),
             gtk.ICON_SIZE_DIALOG,
         ) if stockName else None,
         shortDesc,
     )
     self._name = name
     self.desc = desc
     #self.shortDesc = shortDesc## FIXME
     self.initVars()
     if enableTooltip:
         set_tooltip(self, desc)## FIXME
     self.set_is_important(True)## FIXME
Ejemplo n.º 4
0
 def __init__(self,
              name,
              stockName,
              method,
              desc='',
              shortDesc='',
              enableTooltip=True):
     #print('ToolbarItem', name, stockName, method, desc, text)
     self.method = method
     ######
     if not desc:
         desc = name.capitalize()
     ##
     if not shortDesc:
         shortDesc = desc
     ##
     desc = _(desc)
     shortDesc = _(shortDesc)
     ######
     gtk.ToolButton.__init__(
         self,
         gtk.image_new_from_stock(
             getattr(gtk, 'STOCK_%s' % (stockName.upper())),
             gtk.ICON_SIZE_DIALOG,
         ) if stockName else None,
         shortDesc,
     )
     self._name = name
     self.desc = desc
     #self.shortDesc = shortDesc## FIXME
     self.initVars()
     if enableTooltip:
         set_tooltip(self, desc)  ## FIXME
     self.set_is_important(True)  ## FIXME
Ejemplo n.º 5
0
	def changeMode(self, mode):
		if mode == self.rule.getMode():
			return
		for i in range(12):
			set_tooltip(
				self.buttons[i],
				locale_man.getMonthName(mode, i + 1),
			)
Ejemplo n.º 6
0
def newSmallNoFocusButton(stock, func, tooltip=''):
	arrow = ConButton()
	arrow.set_relief(2)
	arrow.set_can_focus(False)
	arrow.set_image(gtk.image_new_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR))
	arrow.connect('con-clicked', func)
	if tooltip:
		set_tooltip(arrow, tooltip)
	return arrow
Ejemplo n.º 7
0
def newSmallNoFocusButton(stock, func, tooltip=''):
    arrow = ConButton()
    arrow.set_relief(2)
    arrow.set_can_focus(False)
    arrow.set_image(gtk.image_new_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR))
    arrow.connect('con-clicked', func)
    if tooltip:
        set_tooltip(arrow, tooltip)
    return arrow
Ejemplo n.º 8
0
 def __init__(self, event):
     from scal2.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo
     from scal2.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry
     gtk.VBox.__init__(self)
     self.event = event
     ###########
     hbox = gtk.HBox()
     ###
     pack(hbox, gtk.Label(_('Calendar Type')))
     combo = CalTypeCombo()
     combo.set_active(calTypes.primary)## overwritten in updateWidget()
     pack(hbox, combo)
     pack(hbox, gtk.Label(''), 1, 1)
     self.modeCombo = combo
     ###
     pack(self, hbox)
     ###########
     if event.isAllDay:
         self.tzCheck = None
     else:
         hbox = gtk.HBox()
         self.tzCheck = gtk.CheckButton(_('Time Zone'))
         set_tooltip(self.tzCheck, _('For input times of event'))
         pack(hbox, self.tzCheck)
         combo = TimeZoneComboBoxEntry()
         pack(hbox, combo)
         pack(hbox, gtk.Label(''), 1, 1)
         self.tzCombo = combo
         pack(self, hbox)
         self.tzCheck.connect('clicked', lambda check: self.tzCombo.set_sensitive(check.get_active()))
     ###########
     hbox = gtk.HBox()
     pack(hbox, gtk.Label(_('Summary')))
     self.summaryEntry = gtk.Entry()
     pack(hbox, self.summaryEntry, 1, 1)
     pack(self, hbox)
     ###########
     self.descriptionInput = TextFrame()
     swin = gtk.ScrolledWindow()
     swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     swin.add_with_viewport(self.descriptionInput)
     ###
     exp = gtk.Expander()
     exp.set_expanded(True)
     exp.set_label(_('Description'))
     exp.add(swin)
     pack(self, exp, 1, 1)
     ###########
     hbox = gtk.HBox()
     pack(hbox, gtk.Label(_('Icon')+':'))
     self.iconSelect = IconSelectButton()
     pack(hbox, self.iconSelect)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     ##########
     self.modeCombo.connect('changed', self.modeComboChanged)## right place? before updateWidget? FIXME
Ejemplo n.º 9
0
 def build(self):
     self.im = gtk.Image()
     self.setFocus(False)
     self.im.set_size_request(self.size, self.size)
     self.add(self.im)
     self.connect('enter-notify-event', self.enterNotify)
     self.connect('leave-notify-event', self.leaveNotify)
     self.connect('button-press-event', self.buttonPress)
     self.connect('button-release-event', self.buttonRelease)
     set_tooltip(self, self.desc)  ## FIXME
Ejemplo n.º 10
0
 def build(self):
     self.im = gtk.Image()
     self.setFocus(False)
     self.im.set_size_request(self.size, self.size)
     self.add(self.im)
     self.connect('enter-notify-event', self.enterNotify)
     self.connect('leave-notify-event', self.leaveNotify)
     self.connect('button-press-event', self.buttonPress)
     self.connect('button-release-event', self.buttonRelease)
     set_tooltip(self, self.desc)## FIXME
Ejemplo n.º 11
0
 def __init__(self, rule):
     self.rule = rule
     ###
     gtk.HBox.__init__(self)
     ###
     self.buttons = []
     mode = self.rule.getMode()
     for i in range(12):
         b = gtk.ToggleButton(_(i+1))
         set_tooltip(b, core.getMonthName(mode, i+1))
         pack(self, b)
         self.buttons.append(b)
Ejemplo n.º 12
0
	def __init__(self, rule):
		self.rule = rule
		###
		gtk.HBox.__init__(self)
		###
		self.buttons = []
		mode = self.rule.getMode()
		for i in range(12):
			b = gtk.ToggleButton(_(i+1))
			set_tooltip(b, locale_man.getMonthName(mode, i+1))
			pack(self, b)
			self.buttons.append(b)
Ejemplo n.º 13
0
 def __init__(self, term):
     self.term = term
     #####
     gtk.HBox.__init__(self)
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(False)
     self.trees = gtk.ListStore(str)
     self.treev.set_model(self.trees)
     ##########
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.timeEdited)
     col = gtk.TreeViewColumn(_('Time'), cell, text=0)
     self.treev.append_column(col)
     ####
     self.pack_start(self.treev, 1, 1)
     ##########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     #try:## DeprecationWarning #?????????????
         #toolbar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
         ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #    pass
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.ICON_SIZE_SMALL_TOOLBAR or gtk.ICON_SIZE_MENU
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.deleteClicked)
     toolbar.insert(tb, -1)
     #self.buttonDel = tb
     #######
     self.pack_start(toolbar, 0, 0)
Ejemplo n.º 14
0
 def __init__(self, term):
     self.term = term
     #####
     gtk.HBox.__init__(self)
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(False)
     self.trees = gtk.ListStore(str)
     self.treev.set_model(self.trees)
     ##########
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.timeEdited)
     col = gtk.TreeViewColumn(_('Time'), cell, text=0)
     self.treev.append_column(col)
     ####
     pack(self, self.treev, 1, 1)
     ##########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     #try:## DeprecationWarning #?????????????
     #toolbar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
     ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #	pass
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.ICON_SIZE_SMALL_TOOLBAR or gtk.ICON_SIZE_MENU
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.deleteClicked)
     toolbar.insert(tb, -1)
     #self.buttonDel = tb
     #######
     pack(self, toolbar)
Ejemplo n.º 15
0
 def __init__(self, defaultValue=''):
     self.defaultValue = defaultValue
     #####
     gtk.HBox.__init__(self)
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(False)
     self.trees = gtk.ListStore(str)
     self.treev.set_model(self.trees)
     ##########
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     col = gtk.TreeViewColumn('', cell, text=0)
     self.treev.append_column(col)
     ####
     pack(self, self.treev, 1, 1)
     ##########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     #try:## DeprecationWarning #?????????????
         #toolbar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
         ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #    pass
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.ICON_SIZE_SMALL_TOOLBAR or gtk.ICON_SIZE_MENU
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.moveUpClicked)
     toolbar.insert(tb, -1)
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.moveDownClicked)
     toolbar.insert(tb, -1)
     #######
     pack(self, toolbar)
Ejemplo n.º 16
0
 def __init__(self):  ## parent FIXME
     gtk.Dialog.__init__(self)
     self.set_title(_("Tune Hijri Monthes"))
     self.connect("delete-event", self.onDeleteEvent)
     ############
     self.altMode = 0
     self.altModeDesc = "Gregorian"
     ############
     hbox = gtk.HBox()
     self.topLabel = gtk.Label()
     pack(hbox, self.topLabel)
     self.startDateInput = DateButton()
     self.startDateInput.set_editable(False)  ## FIXME
     self.startDateInput.connect("changed", lambda widget: self.updateEndDates())
     pack(hbox, self.startDateInput)
     pack(self.vbox, hbox)
     ############################
     treev = gtk.TreeView()
     trees = gtk.ListStore(int, str, str, int, str)  ## ym, yearShown, monthShown, monthLenCombo, endDateShown
     treev.set_model(trees)
     # treev.get_selection().connect('changed', self.plugTreevCursorChanged)
     # treev.connect('row-activated', self.plugTreevRActivate)
     # treev.connect('button-press-event', self.plugTreevButtonPress)
     ###
     swin = gtk.ScrolledWindow()
     swin.add(treev)
     swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_("Year"), cell, text=1)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_("Month"), cell, text=2)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererCombo()
     mLenModel = gtk.ListStore(int)
     mLenModel.append([29])
     mLenModel.append([30])
     cell.set_property("model", mLenModel)
     # cell.set_property('has-entry', False)
     cell.set_property("editable", True)
     cell.set_property("text-column", 0)
     cell.connect("edited", self.monthLenCellEdited)
     col = gtk.TreeViewColumn(_("Month Length"), cell, text=3)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_("End Date"), cell, text=4)
     treev.append_column(col)
     ######
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ###
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _("Add"))
     tb.connect("clicked", self.addClicked)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _("Delete"))
     tb.connect("clicked", self.delClicked)
     toolbar.insert(tb, -1)
     ######
     self.treev = treev
     self.trees = trees
     #####
     mainHbox = gtk.HBox()
     pack(mainHbox, swin, 1, 1)
     pack(mainHbox, toolbar)
     pack(self.vbox, mainHbox, 1, 1)
     ######
     dialog_add_button(self, gtk.STOCK_OK, _("_OK"), gtk.RESPONSE_OK)
     dialog_add_button(self, gtk.STOCK_CANCEL, _("_Cancel"), gtk.RESPONSE_CANCEL)
     ##
     resetB = self.add_button(gtk.STOCK_UNDO, gtk.RESPONSE_NONE)
     resetB.set_label(_("_Reset to Defaults"))
     resetB.set_image(gtk.image_new_from_stock(gtk.STOCK_UNDO, gtk.ICON_SIZE_BUTTON))
     resetB.connect("clicked", self.resetToDefaults)
     ##
     self.connect("response", self.onResponse)
     # print(dir(self.get_action_area()))
     # self.get_action_area().set_homogeneous(False)
     ######
     self.vbox.show_all()
Ejemplo n.º 17
0
 def __init__(self):  ## parent FIXME
     gtk.Dialog.__init__(self)
     self.set_title(_('Tune Hijri Monthes'))
     self.connect('delete-event', self.onDeleteEvent)
     ############
     self.altMode = 0
     self.altModeDesc = 'Gregorian'
     ############
     hbox = gtk.HBox()
     self.topLabel = gtk.Label()
     pack(hbox, self.topLabel)
     self.startDateInput = DateButton()
     self.startDateInput.set_editable(False)  ## FIXME
     self.startDateInput.connect('changed',
                                 lambda widget: self.updateEndDates())
     pack(hbox, self.startDateInput)
     pack(self.vbox, hbox)
     ############################
     treev = gtk.TreeView()
     trees = gtk.ListStore(
         int, str, str, int,
         str)  ## ym, yearShown, monthShown, monthLenCombo, endDateShown
     treev.set_model(trees)
     #treev.get_selection().connect('changed', self.plugTreevCursorChanged)
     #treev.connect('row-activated', self.plugTreevRActivate)
     #treev.connect('button-press-event', self.plugTreevButtonPress)
     ###
     swin = gtk.ScrolledWindow()
     swin.add(treev)
     swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_('Year'), cell, text=1)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_('Month'), cell, text=2)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererCombo()
     mLenModel = gtk.ListStore(int)
     mLenModel.append([29])
     mLenModel.append([30])
     cell.set_property('model', mLenModel)
     #cell.set_property('has-entry', False)
     cell.set_property('editable', True)
     cell.set_property('text-column', 0)
     cell.connect('edited', self.monthLenCellEdited)
     col = gtk.TreeViewColumn(_('Month Length'), cell, text=3)
     treev.append_column(col)
     ######
     cell = gtk.CellRendererText()
     col = gtk.TreeViewColumn(_('End Date'), cell, text=4)
     treev.append_column(col)
     ######
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ###
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.delClicked)
     toolbar.insert(tb, -1)
     ######
     self.treev = treev
     self.trees = trees
     #####
     mainHbox = gtk.HBox()
     pack(mainHbox, swin, 1, 1)
     pack(mainHbox, toolbar)
     pack(self.vbox, mainHbox, 1, 1)
     ######
     dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK)
     dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'),
                       gtk.RESPONSE_CANCEL)
     ##
     resetB = self.add_button(gtk.STOCK_UNDO, gtk.RESPONSE_NONE)
     resetB.set_label(_('_Reset to Defaults'))
     resetB.set_image(
         gtk.image_new_from_stock(gtk.STOCK_UNDO, gtk.ICON_SIZE_BUTTON))
     resetB.connect('clicked', self.resetToDefaults)
     ##
     self.connect('response', self.onResponse)
     #print(dir(self.get_action_area()))
     #self.get_action_area().set_homogeneous(False)
     ######
     self.vbox.show_all()
Ejemplo n.º 18
0
 def __init__(self, group):
     gtk.VBox.__init__(self)
     self.group = group
     ########
     self.sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Title'))
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     self.titleEntry = gtk.Entry()
     hbox.pack_start(self.titleEntry, 1, 1)
     self.pack_start(hbox, 0, 0)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Color'))
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     self.colorButton = MyColorButton()
     self.colorButton.set_use_alpha(True) ## FIXME
     hbox.pack_start(self.colorButton, 0, 0)
     self.pack_start(hbox, 0, 0)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Icon'))## FIXME
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     self.iconSelect = common.IconSelectButton()
     hbox.pack_start(self.iconSelect, 0, 0)
     self.pack_start(hbox, 0, 0)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Calendar Type'))
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     combo = gtk.combo_box_new_text()
     for m in core.modules:
         combo.append_text(_(m.desc))
     #if i>0:## FIXME
     #    combo.append_text(_('Julian Day'))
     hbox.pack_start(combo, 0, 0)
     hbox.pack_start(gtk.Label(''), 1, 1)
     self.modeCombo = combo
     self.pack_start(hbox, 0, 0)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Cache Size'))
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     self.cacheSizeSpin = IntSpinButton(0, 9999)
     hbox.pack_start(self.cacheSizeSpin, 0, 0)
     self.pack_start(hbox, 0, 0)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Text Seperator'))
     label.set_alignment(0, 0.5)
     hbox.pack_start(label, 0, 0)
     self.sizeGroup.add_widget(label)
     self.sepEntry = gtk.Entry()
     hbox.pack_start(self.sepEntry, 1, 1)
     self.pack_start(hbox, 0, 0)
     set_tooltip(hbox, _('Using to seperate Summary and Description when displaying event'))
     #####
     #hbox = gtk.HBox()
     #label = gtk.Label(_('Show Full Event Description'))
     #label.set_alignment(0, 0.5)
     #hbox.pack_start(label, 0, 0)
     #self.sizeGroup.add_widget(label)
     #self.showFullEventDescCheck = gtk.CheckButton('')
     #hbox.pack_start(self.showFullEventDescCheck, 1, 1)
     #self.pack_start(hbox, 0, 0)
     ###
     self.modeCombo.connect('changed', self.modeComboChanged)## right place? before updateWidget? FIXME
Ejemplo n.º 19
0
 def __init__(
     self,
     term,
     defaultCourseName=_('New Course'),
     defaultCourseUnits=3,
     enableScrollbars=False,
 ):
     self.term = term  ## UniversityTerm obj
     self.defaultCourseName = defaultCourseName
     self.defaultCourseUnits = defaultCourseUnits
     #####
     gtk.HBox.__init__(self)
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(True)
     self.trees = gtk.ListStore(int, str, int)
     self.treev.set_model(self.trees)
     ##########
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.courseNameEdited)
     #cell.connect('editing-started', lambda cell0, editable, path:
     #	sys.stdout.write('editing-started %s\n'%path))
     #cell.connect('editing-canceled', lambda cell0:sys.stdout.write('editing-canceled\n'))
     col = gtk.TreeViewColumn(_('Course Name'), cell, text=1)
     self.treev.append_column(col)
     ###
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.courseUnitsEdited)
     col = gtk.TreeViewColumn(_('Units'), cell, text=2)
     self.treev.append_column(col)
     ####
     if enableScrollbars:  ## FIXME
         swin = gtk.ScrolledWindow()
         swin.add(self.treev)
         swin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
         pack(self, swin, 1, 1)
     else:
         pack(self, self.treev, 1, 1)
     ##########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     #try:## DeprecationWarning #?????????????
     #toolbar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
     ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #	pass
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.ICON_SIZE_SMALL_TOOLBAR or gtk.ICON_SIZE_MENU
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.deleteClicked)
     toolbar.insert(tb, -1)
     #self.buttonDel = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.moveUpClicked)
     toolbar.insert(tb, -1)
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.moveDownClicked)
     toolbar.insert(tb, -1)
     #######
     pack(self, toolbar)
Ejemplo n.º 20
0
 def __init__(self, widget):
     gtk.Dialog.__init__(self)
     self.set_title(_('Customize'))
     self.set_has_separator(False)
     self.connect('delete-event', self.close)
     dialog_add_button(self, gtk.STOCK_CLOSE, _('_Close'), 0, self.close)
     ###
     self.widget = widget
     self.activeOptionsWidget = None
     ###
     self.model = gtk.TreeStore(bool, str) ## (gdk.Pixbuf, str)
     treev = self.treev = gtk.TreeView(self.model)
     ##
     treev.set_enable_tree_lines(True)
     treev.set_headers_visible(False)
     treev.connect('row-activated', self.rowActivated)
     ##
     col = gtk.TreeViewColumn('Widget')
     ##
     cell = gtk.CellRendererToggle()
     cell.connect('toggled', self.enableCellToggled)
     col.pack_start(cell, expand=False)
     col.add_attribute(cell, 'active', 0)
     ##
     treev.append_column(col)
     col = gtk.TreeViewColumn('Widget')
     ##
     cell = gtk.CellRendererText()
     col.pack_start(cell, expand=False)
     col.add_attribute(cell, 'text', 1)
     ##
     treev.append_column(col)
     ###
     for item in widget.items:
         if isinstance(item, CustomizableCalObj):
             self.appendItemTree(item, None)
     ###
     hbox = gtk.HBox()
     vbox_l = gtk.VBox()
     vbox_l.pack_start(treev, 1, 1)
     hbox.pack_start(vbox_l, 1, 1)
     ###
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     toolbar.set_icon_size(size)
     ## argument2 to image_new_from_stock does not affect
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.upClicked)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.downClicked)
     toolbar.insert(tb, -1)
     ###
     hbox.pack_start(toolbar, 0, 0)
     self.vbox.pack_start(hbox, 1, 1)
     self.vbox_l = vbox_l
     ###
     self.vbox.connect('size-request', self.vboxSizeRequest)
     self.vbox.show_all()
     treev.connect('cursor-changed', self.treevCursorChanged)
Ejemplo n.º 21
0
 def __init__(self, group):
     from scal2.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo
     gtk.VBox.__init__(self)
     self.group = group
     ########
     self.sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Title'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.titleEntry = gtk.Entry()
     pack(hbox, self.titleEntry, 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Color'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.colorButton = MyColorButton()
     self.colorButton.set_use_alpha(True)  ## FIXME
     pack(hbox, self.colorButton)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Icon'))  ## FIXME
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.iconSelect = IconSelectButton()
     pack(hbox, self.iconSelect)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Calendar Type'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     combo = CalTypeCombo()
     pack(hbox, combo)
     pack(hbox, gtk.Label(''), 1, 1)
     self.modeCombo = combo
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Show in Calendar'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInDCalCheck = gtk.CheckButton(_('Day'))
     self.showInWCalCheck = gtk.CheckButton(_('Week'))
     self.showInMCalCheck = gtk.CheckButton(_('Month'))
     pack(hbox, self.showInDCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInWCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInMCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Show in'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInTimeLineCheck = gtk.CheckButton(_('Time Line'))
     self.showInStatusIconCheck = gtk.CheckButton(_('Status Icon'))
     pack(hbox, self.showInTimeLineCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInStatusIconCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Cache Size'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.cacheSizeSpin = IntSpinButton(0, 9999)
     pack(hbox, self.cacheSizeSpin)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Text Seperator'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.sepInput = TextFrame()
     pack(hbox, self.sepInput, 1, 1)
     pack(self, hbox)
     set_tooltip(
         hbox,
         _('Using to seperate Summary and Description when displaying event'
           ))
     #####
     #hbox = gtk.HBox()
     #label = gtk.Label(_('Show Full Event Description'))
     #label.set_alignment(0, 0.5)
     #pack(hbox, label)
     #self.sizeGroup.add_widget(label)
     #self.showFullEventDescCheck = gtk.CheckButton('')
     #pack(hbox, self.showFullEventDescCheck, 1, 1)
     #pack(self, hbox)
     ###
     self.modeCombo.connect(
         'changed',
         self.modeComboChanged)  ## right place? before updateWidget? FIXME
Ejemplo n.º 22
0
 def __init__(self, widget):
     gtk.Dialog.__init__(self)
     self.set_title(_('Customize'))
     self.set_has_separator(False)
     self.connect('delete-event', self.close)
     dialog_add_button(self, gtk.STOCK_CLOSE, _('_Close'), 0, self.close)
     ###
     self._widget = widget
     self.activeOptionsWidget = None
     ###
     self.model = gtk.TreeStore(bool, str)  ## (gdk.Pixbuf, str)
     treev = self.treev = gtk.TreeView(self.model)
     ##
     treev.set_enable_tree_lines(True)
     treev.set_headers_visible(False)
     treev.connect('row-activated', self.rowActivated)
     ##
     col = gtk.TreeViewColumn('Widget')
     ##
     cell = gtk.CellRendererToggle()
     cell.connect('toggled', self.enableCellToggled)
     pack(col, cell)
     col.add_attribute(cell, 'active', 0)
     ##
     treev.append_column(col)
     col = gtk.TreeViewColumn('Widget')
     ##
     cell = gtk.CellRendererText()
     pack(col, cell)
     col.add_attribute(cell, 'text', 1)
     ##
     treev.append_column(col)
     ###
     for item in widget.items:
         if item.customizable:
             self.appendItemTree(item, None)
     ###
     hbox = gtk.HBox()
     vbox_l = gtk.VBox()
     pack(vbox_l, treev, 1, 1)
     pack(hbox, vbox_l, 1, 1)
     ###
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     toolbar.set_icon_size(size)
     ## argument2 to image_new_from_stock does not affect
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.upClicked)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.downClicked)
     toolbar.insert(tb, -1)
     ###
     pack(hbox, toolbar)
     pack(self.vbox, hbox, 1, 1)
     self.vbox_l = vbox_l
     ###
     self.vbox.connect('size-request', self.vboxSizeRequest)
     self.vbox.show_all()
     treev.get_selection().connect('changed', self.treevCursorChanged)
Ejemplo n.º 23
0
 def __init__(self, rule):
     self.rule = rule
     gtk.HBox.__init__(self)
     ###
     self.countLabel = gtk.Label("")
     self.pack_start(self.countLabel, 0, 0)
     ###
     self.editButton = gtk.Button(_("Edit"))
     self.editButton.set_image(gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON))
     self.editButton.connect("clicked", self.showDialog)
     self.pack_start(self.editButton, 0, 0)
     ###
     self.dialog = gtk.Dialog(title=rule.desc)
     ##
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(True)
     self.trees = gtk.ListStore(str)
     self.treev.set_model(self.trees)
     ##
     cell = gtk.CellRendererText()
     cell.set_property("editable", True)
     cell.connect("edited", self.dateCellEdited)
     col = gtk.TreeViewColumn(_("Date"), cell, text=0)
     self.treev.append_column(col)
     ##
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _("Add"))
     tb.connect("clicked", self.addClicked)
     toolbar.insert(tb, -1)
     # self.buttonAdd = tb
     ##
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _("Delete"))
     tb.connect("clicked", self.deleteClicked)
     toolbar.insert(tb, -1)
     # self.buttonDel = tb
     ##
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _("Move up"))
     tb.connect("clicked", self.moveUpClicked)
     toolbar.insert(tb, -1)
     ##
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _("Move down"))
     tb.connect("clicked", self.moveDownClicked)
     toolbar.insert(tb, -1)
     ##
     dialogHbox = gtk.HBox()
     dialogHbox.pack_start(self.treev, 1, 1)
     dialogHbox.pack_start(toolbar, 0, 0)
     self.dialog.vbox.pack_start(dialogHbox, 1, 1)
     self.dialog.vbox.show_all()
     self.dialog.resize(200, 300)
     self.dialog.connect("response", lambda w, e: self.dialog.hide())
     ##
     okButton = self.dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_CANCEL)
     if ui.autoLocale:
         okButton.set_label(_("_OK"))
         okButton.set_image(gtk.image_new_from_stock(gtk.STOCK_OK, gtk.ICON_SIZE_BUTTON))
Ejemplo n.º 24
0
 def changeMode(self, mode):
     if mode!=self.rule.getMode():
         for i in range(12):
             set_tooltip(self.buttons[i], core.getMonthName(mode, i+1))
Ejemplo n.º 25
0
 def __init__(self, rule):
     self.rule = rule
     gtk.HBox.__init__(self)
     ###
     self.countLabel = gtk.Label('')
     pack(self, self.countLabel)
     ###
     self.editButton = gtk.Button(_('Edit'))
     self.editButton.set_image(
         gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON))
     self.editButton.connect('clicked', self.showDialog)
     pack(self, self.editButton)
     ###
     self.dialog = gtk.Dialog(title=rule.desc)
     ##
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(True)
     self.trees = gtk.ListStore(str)
     self.treev.set_model(self.trees)
     ##
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.dateCellEdited)
     col = gtk.TreeViewColumn(_('Date'), cell, text=0)
     self.treev.append_column(col)
     ##
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ##
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.deleteClicked)
     toolbar.insert(tb, -1)
     #self.buttonDel = tb
     ##
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.moveUpClicked)
     toolbar.insert(tb, -1)
     ##
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.moveDownClicked)
     toolbar.insert(tb, -1)
     ##
     dialogHbox = gtk.HBox()
     pack(dialogHbox, self.treev, 1, 1)
     pack(dialogHbox, toolbar)
     pack(self.dialog.vbox, dialogHbox, 1, 1)
     self.dialog.vbox.show_all()
     self.dialog.resize(200, 300)
     self.dialog.connect('response', lambda w, e: self.dialog.hide())
     ##
     okButton = self.dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_CANCEL)
     if ui.autoLocale:
         okButton.set_label(_('_OK'))
         okButton.set_image(
             gtk.image_new_from_stock(gtk.STOCK_OK, gtk.ICON_SIZE_BUTTON))
Ejemplo n.º 26
0
 def __init__(self, term, defaultCourseName=_('New Course'), defaultCourseUnits=3, enableScrollbars=False):
     self.term = term ## UniversityTerm obj
     self.defaultCourseName = defaultCourseName
     self.defaultCourseUnits = defaultCourseUnits
     #####
     gtk.HBox.__init__(self)
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(True)
     self.trees = gtk.ListStore(int, str, int)
     self.treev.set_model(self.trees)
     ##########
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.courseNameEdited)
     #cell.connect('editing-started', lambda cell0, editable, path:
     #    sys.stdout.write('editing-started %s\n'%path))
     #cell.connect('editing-canceled', lambda cell0:sys.stdout.write('editing-canceled\n'))
     col = gtk.TreeViewColumn(_('Course Name'), cell, text=1)
     self.treev.append_column(col)
     ###
     cell = gtk.CellRendererText()
     cell.set_property('editable', True)
     cell.connect('edited', self.courseUnitsEdited)
     col = gtk.TreeViewColumn(_('Units'), cell, text=2)
     self.treev.append_column(col)
     ####
     if enableScrollbars:## FIXME
         swin = gtk.ScrolledWindow()
         swin.add(self.treev)
         swin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
         self.pack_start(swin, 1, 1)
     else:
         self.pack_start(self.treev, 1, 1)
     ##########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     #try:## DeprecationWarning #?????????????
         #toolbar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
         ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #    pass
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.ICON_SIZE_SMALL_TOOLBAR or gtk.ICON_SIZE_MENU
     tb = toolButtonFromStock(gtk.STOCK_ADD, size)
     set_tooltip(tb, _('Add'))
     tb.connect('clicked', self.addClicked)
     toolbar.insert(tb, -1)
     #self.buttonAdd = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_DELETE, size)
     set_tooltip(tb, _('Delete'))
     tb.connect('clicked', self.deleteClicked)
     toolbar.insert(tb, -1)
     #self.buttonDel = tb
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.moveUpClicked)
     toolbar.insert(tb, -1)
     ####
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.moveDownClicked)
     toolbar.insert(tb, -1)
     #######
     self.pack_start(toolbar, 0, 0)
Ejemplo n.º 27
0
 def __init__(self):
     gtk.Dialog.__init__(self)
     self.initVars()
     ud.windowList.appendItem(self)
     ####
     self.syncing = None ## or a tuple of (groupId, statusText)
     self.groupIterById = {}
     self.trashIter = None
     self.isLoaded = False
     ####
     self.set_title(_('Event Manager'))
     self.resize(600, 300)
     self.connect('delete-event', self.onDeleteEvent)
     self.set_transient_for(None)
     self.set_type_hint(gdk.WINDOW_TYPE_HINT_NORMAL)
     ##
     dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK)
     #self.connect('response', lambda w, e: self.hide())
     self.connect('response', self.onResponse)
     self.connect('show', self.onShow)
     #######
     self.searchWin = EventSearchWindow()
     #######
     menubar = gtk.MenuBar()
     ####
     fileItem = gtk.MenuItem(_('_File'))
     fileMenu = gtk.Menu()
     fileItem.set_submenu(fileMenu)
     menubar.append(fileItem)
     ##
     addGroupItem = gtk.MenuItem(_('Add New Group'))
     addGroupItem.connect('activate', self.addGroupBeforeSelection)
     ## or before selected group? FIXME
     fileMenu.append(addGroupItem)
     ##
     searchItem = gtk.MenuItem(_('_Search Events'))## FIXME right place?
     searchItem.connect('activate', self.mbarSearchClicked)
     fileMenu.append(searchItem)
     ##
     exportItem = gtk.MenuItem(_('_Export'))
     exportItem.connect('activate', self.mbarExportClicked)
     fileMenu.append(exportItem)
     ##
     importItem = gtk.MenuItem(_('_Import'))
     importItem.connect('activate', self.mbarImportClicked)
     fileMenu.append(importItem)
     ##
     orphanItem = gtk.MenuItem(_('Check for Orphan Events'))
     orphanItem.connect('activate', self.mbarOrphanClicked)
     fileMenu.append(orphanItem)
     ####
     editItem = gtk.MenuItem(_('_Edit'))
     editMenu = gtk.Menu()
     editItem.set_submenu(editMenu)
     menubar.append(editItem)
     ##
     editEditItem = gtk.MenuItem(_('Edit'))
     editEditItem.connect('activate', self.mbarEditClicked)
     editMenu.append(editEditItem)
     editMenu.connect('show', self.mbarEditMenuPopup)
     self.mbarEditItem = editEditItem
     ##
     editMenu.append(gtk.SeparatorMenuItem())
     ##
     cutItem = gtk.MenuItem(_('Cu_t'))
     cutItem.connect('activate', self.mbarCutClicked)
     editMenu.append(cutItem)
     self.mbarCutItem = cutItem
     ##
     copyItem = gtk.MenuItem(_('_Copy'))
     copyItem.connect('activate', self.mbarCopyClicked)
     editMenu.append(copyItem)
     self.mbarCopyItem = copyItem
     ##
     pasteItem = gtk.MenuItem(_('_Paste'))
     pasteItem.connect('activate', self.mbarPasteClicked)
     editMenu.append(pasteItem)
     self.mbarPasteItem = pasteItem
     ##
     editMenu.append(gtk.SeparatorMenuItem())
     ##
     dupItem = gtk.MenuItem(_('_Duplicate'))
     dupItem.connect('activate', self.duplicateSelectedObj)
     editMenu.append(dupItem)
     self.mbarDupItem = dupItem
     ####
     viewItem = gtk.MenuItem(_('_View'))
     viewMenu = gtk.Menu()
     viewItem.set_submenu(viewMenu)
     menubar.append(viewItem)
     ##
     collapseItem = gtk.MenuItem(_('Collapse All'))
     collapseItem.connect('activate', self.collapseAllClicked)
     viewMenu.append(collapseItem)
     ##
     expandItem = gtk.MenuItem(_('Expand All'))
     expandItem.connect('activate', self.expandAllClicked)
     viewMenu.append(expandItem)
     ##
     viewMenu.append(gtk.SeparatorMenuItem())
     ##
     self.showDescItem = gtk.CheckMenuItem(_('Show _Description'))
     self.showDescItem.set_active(ui.eventManShowDescription)
     self.showDescItem.connect('toggled', self.showDescItemToggled)
     viewMenu.append(self.showDescItem)
     ####
     #testItem = gtk.MenuItem(_('Test'))
     #testMenu = gtk.Menu()
     #testItem.set_submenu(testMenu)
     #menubar.append(testItem)
     ###
     #item = gtk.MenuItem('')
     #item.connect('activate', )
     #testMenu.append(item)
     ####
     menubar.show_all()
     pack(self.vbox, menubar)
     #######
     treeBox = gtk.HBox()
     #####
     self.treev = gtk.TreeView()
     self.treev.set_search_column(2)
     #self.treev.set_headers_visible(False)## FIXME
     #self.treev.get_selection().set_mode(gtk.SELECTION_MULTIPLE)## FIXME
     #self.treev.set_rubber_banding(gtk.SELECTION_MULTIPLE)## FIXME
     #self.treev.connect('realize', self.onTreeviewRealize)
     self.treev.connect('cursor-changed', self.treeviewCursorChanged)## FIXME
     self.treev.connect('button-press-event', self.treeviewButtonPress)
     self.treev.connect('row-activated', self.rowActivated)
     self.treev.connect('key-press-event', self.keyPress)
     #####
     swin = gtk.ScrolledWindow()
     swin.add(self.treev)
     swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     pack(treeBox, swin, 1, 1)
     ###
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
     size = gtk.ICON_SIZE_SMALL_TOOLBAR
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_UP, size)
     set_tooltip(tb, _('Move up'))
     tb.connect('clicked', self.moveUpByButton)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size)
     set_tooltip(tb, _('Move down'))
     tb.connect('clicked', self.moveDownByButton)
     toolbar.insert(tb, -1)
     ###
     tb = toolButtonFromStock(gtk.STOCK_COPY, size)
     set_tooltip(tb, _('Duplicate'))
     tb.connect('clicked', self.duplicateSelectedObj)
     toolbar.insert(tb, -1)
     ###
     pack(treeBox, toolbar)
     #####
     pack(self.vbox, treeBox, 1, 1)
     #######
     self.trees = gtk.TreeStore(int, gdk.Pixbuf, str, str)
     ## event: eid,  event_icon,   event_summary, event_description
     ## group: gid,  group_pixbuf, group_title,   ?description
     ## trash: -1,        trash_icon,   _('Trash'),    ''
     self.treev.set_model(self.trees)
     ###
     col = gtk.TreeViewColumn()
     cell = gtk.CellRendererPixbuf()
     pack(col, cell)
     col.add_attribute(cell, 'pixbuf', 1)
     self.treev.append_column(col)
     ###
     col = gtk.TreeViewColumn(
         _('Summary'),
         gtk.CellRendererText(),
         text=2,
     )
     col.set_resizable(True)
     self.treev.append_column(col)
     ###
     self.colDesc = gtk.TreeViewColumn(
         _('Description'),
         gtk.CellRendererText(),
         text=3,
     )
     if ui.eventManShowDescription:
         self.treev.append_column(self.colDesc)
     ###
     #self.treev.set_search_column(2)## or 3
     ###
     self.toPasteEvent = None ## (path, bool move)
     #####
     self.sbar = gtk.Statusbar()
     self.sbar.set_direction(gtk.TEXT_DIR_LTR)
     #self.sbar.set_has_resize_grip(False)
     pack(self.vbox, self.sbar)
     #####
     self.vbox.show_all()
Ejemplo n.º 28
0
 def __init__(self, group):
     gtk.VBox.__init__(self)
     self.group = group
     ########
     self.sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Title"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.titleEntry = gtk.Entry()
     pack(hbox, self.titleEntry, 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Color"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.colorButton = MyColorButton()
     self.colorButton.set_use_alpha(True)  ## FIXME
     pack(hbox, self.colorButton)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Default Icon"))  ## FIXME
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.iconSelect = IconSelectButton()
     pack(hbox, self.iconSelect)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Default Calendar Type"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     combo = CalTypeCombo()
     pack(hbox, combo)
     pack(hbox, gtk.Label(""), 1, 1)
     self.modeCombo = combo
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Show in Calendar"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInDCalCheck = gtk.CheckButton(_("Day"))
     self.showInWCalCheck = gtk.CheckButton(_("Week"))
     self.showInMCalCheck = gtk.CheckButton(_("Month"))
     pack(hbox, self.showInDCalCheck)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(hbox, self.showInWCalCheck)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(hbox, self.showInMCalCheck)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Show in"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInTimeLineCheck = gtk.CheckButton(_("Time Line"))
     self.showInTrayCheck = gtk.CheckButton(_("Tray"))
     pack(hbox, self.showInTimeLineCheck)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(hbox, self.showInTrayCheck)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Event Cache Size"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.cacheSizeSpin = IntSpinButton(0, 9999)
     pack(hbox, self.cacheSizeSpin)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_("Event Text Seperator"))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.sepInput = TextFrame()
     pack(hbox, self.sepInput, 1, 1)
     pack(self, hbox)
     set_tooltip(hbox, _("Using to seperate Summary and Description when displaying event"))
     #####
     # hbox = gtk.HBox()
     # label = gtk.Label(_('Show Full Event Description'))
     # label.set_alignment(0, 0.5)
     # pack(hbox, label)
     # self.sizeGroup.add_widget(label)
     # self.showFullEventDescCheck = gtk.CheckButton('')
     # pack(hbox, self.showFullEventDescCheck, 1, 1)
     # pack(self, hbox)
     ###
     self.modeCombo.connect("changed", self.modeComboChanged)  ## right place? before updateWidget? FIXME
Ejemplo n.º 29
0
 def __init__(self, group):
     from scal2.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo
     gtk.VBox.__init__(self)
     self.group = group
     ########
     self.sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Title'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.titleEntry = gtk.Entry()
     pack(hbox, self.titleEntry, 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Color'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.colorButton = MyColorButton()
     self.colorButton.set_use_alpha(True) ## FIXME
     pack(hbox, self.colorButton)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Icon'))## FIXME
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.iconSelect = IconSelectButton()
     pack(hbox, self.iconSelect)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Default Calendar Type'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     combo = CalTypeCombo()
     pack(hbox, combo)
     pack(hbox, gtk.Label(''), 1, 1)
     self.modeCombo = combo
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Show in Calendar'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInDCalCheck = gtk.CheckButton(_('Day'))
     self.showInWCalCheck = gtk.CheckButton(_('Week'))
     self.showInMCalCheck = gtk.CheckButton(_('Month'))
     pack(hbox, self.showInDCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInWCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInMCalCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Show in'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.showInTimeLineCheck = gtk.CheckButton(_('Time Line'))
     self.showInStatusIconCheck = gtk.CheckButton(_('Status Icon'))
     pack(hbox, self.showInTimeLineCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(hbox, self.showInStatusIconCheck)
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Cache Size'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.cacheSizeSpin = IntSpinButton(0, 9999)
     pack(hbox, self.cacheSizeSpin)
     pack(self, hbox)
     #####
     hbox = gtk.HBox()
     label = gtk.Label(_('Event Text Seperator'))
     label.set_alignment(0, 0.5)
     pack(hbox, label)
     self.sizeGroup.add_widget(label)
     self.sepInput = TextFrame()
     pack(hbox, self.sepInput, 1, 1)
     pack(self, hbox)
     set_tooltip(hbox, _('Using to seperate Summary and Description when displaying event'))
     #####
     #hbox = gtk.HBox()
     #label = gtk.Label(_('Show Full Event Description'))
     #label.set_alignment(0, 0.5)
     #pack(hbox, label)
     #self.sizeGroup.add_widget(label)
     #self.showFullEventDescCheck = gtk.CheckButton('')
     #pack(hbox, self.showFullEventDescCheck, 1, 1)
     #pack(self, hbox)
     ###
     self.modeCombo.connect('changed', self.modeComboChanged)## right place? before updateWidget? FIXME