Beispiel #1
0
 def createDialog(self):
     if self.dialog:
         return
     print('----- toplevel', self.get_toplevel())
     self.dialog = gtk.Dialog(
         title=self.rule.desc,
         parent=self.get_toplevel(),
     )
     ###
     self.treev = gtk.TreeView()
     self.treev.set_headers_visible(True)
     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.IconSize.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.ResponseType.CANCEL)
     if ui.autoLocale:
         okButton.set_label(_('_OK'))
         okButton.set_image(
             gtk.Image.new_from_stock(gtk.STOCK_OK, gtk.IconSize.BUTTON))
Beispiel #2
0
	def createDialog(self):
		if self.dialog:
			return
		print('----- toplevel', self.get_toplevel())
		self.dialog = gtk.Dialog(
			title=self.rule.desc,
			parent=self.get_toplevel(),
		)
		###
		self.treev = gtk.TreeView()
		self.treev.set_headers_visible(True)
		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.IconSize.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.ResponseType.CANCEL)
		if ui.autoLocale:
			okButton.set_label(_('_OK'))
			okButton.set_image(gtk.Image.new_from_stock(gtk.STOCK_OK, gtk.IconSize.BUTTON))
Beispiel #3
0
	def __init__(self):
		self._widget = gtk.HBox()
		size = gtk.IconSize.SMALL_TOOLBAR
		######
		toolbar = gtk.Toolbar()
		toolbar.set_orientation(gtk.Orientation.VERTICAL)
		########
		treev = ActiveCalsTreeView()
		treev.connect("row-activated", self.activeTreevRActivate)
		treev.connect("focus-in-event", self.activeTreevFocus)
		treev.get_selection().connect(
			"changed",
			self.activeTreevSelectionChanged,
		)
		###
		pack(self._widget, treev.makeSwin())
		####
		self.activeTreev = treev
		self.activeTrees = treev.get_model()
		########
		toolbar = gtk.Toolbar()
		toolbar.set_orientation(gtk.Orientation.VERTICAL)
		####
		tb = gtk.ToolButton()
		tb.set_direction(gtk.TextDirection.LTR)
		tb.action = ""
		self.leftRightButton = tb
		set_tooltip(tb, _("Activate/Inactivate"))
		tb.connect("clicked", self.leftRightClicked)
		toolbar.insert(tb, -1)
		####
		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(self._widget, toolbar)
		########
		treev = InactiveCalsTreeView()
		treev.connect("row-activated", self.inactiveTreevRActivate)
		treev.connect("focus-in-event", self.inactiveTreevFocus)
		treev.get_selection().connect(
			"changed",
			self.inactiveTreevSelectionChanged,
		)
		###
		pack(self._widget, treev.makeSwin())
		####
		self.inactiveTreev = treev
		self.inactiveTrees = treev.get_model()
Beispiel #4
0
 def __init__(self):
     self._widget = gtk.HBox()
     size = gtk.IconSize.SMALL_TOOLBAR
     ######
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.Orientation.VERTICAL)
     ########
     treev = ActiveCalsTreeView()
     treev.connect("row-activated", self.activeTreevRActivate)
     treev.connect("focus-in-event", self.activeTreevFocus)
     treev.get_selection().connect(
         "changed",
         self.activeTreevSelectionChanged,
     )
     ###
     pack(self._widget, treev.makeSwin())
     ####
     self.activeTreev = treev
     self.activeTrees = treev.get_model()
     ########
     toolbar = gtk.Toolbar()
     toolbar.set_orientation(gtk.Orientation.VERTICAL)
     ####
     tb = gtk.ToolButton()
     tb.set_direction(gtk.TextDirection.LTR)
     tb.action = ""
     self.leftRightButton = tb
     set_tooltip(tb, _("Activate/Inactivate"))
     tb.connect("clicked", self.leftRightClicked)
     toolbar.insert(tb, -1)
     ####
     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(self._widget, toolbar)
     ########
     treev = InactiveCalsTreeView()
     treev.connect("row-activated", self.inactiveTreevRActivate)
     treev.connect("focus-in-event", self.inactiveTreevFocus)
     treev.get_selection().connect(
         "changed",
         self.inactiveTreevSelectionChanged,
     )
     ###
     pack(self._widget, treev.makeSwin())
     ####
     self.inactiveTreev = treev
     self.inactiveTrees = treev.get_model()
Beispiel #5
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.IconSize.SMALL_TOOLBAR)
         ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #    pass
     size = gtk.IconSize.SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #6
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.IconSize.SMALL_TOOLBAR)
         ### no different (argument to set_icon_size does not affect) ?????????
     #except:
     #    pass
     size = gtk.IconSize.SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #7
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.IconSize.SMALL_TOOLBAR)
		#	# no different (argument to set_icon_size has no effect) ?????????
		#except:
		#	pass
		size = gtk.IconSize.SMALL_TOOLBAR
		##no different(argument2 to image_new_from_stock has no effect) ?????????
		#### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #8
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.IconSize.SMALL_TOOLBAR)
     ### no different (argument to set_icon_size does not affect) ?????????
     # except:
     #    pass
     size = gtk.IconSize.SMALL_TOOLBAR
     ##no different(argument2 to image_new_from_stock does not affect) ?????????
     #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #9
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.PolicyType.NEVER, gtk.PolicyType.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.IconSize.SMALL_TOOLBAR)
			### no different (argument to set_icon_size does not affect) ?????????
		#except:
		#	pass
		size = gtk.IconSize.SMALL_TOOLBAR
		##no different(argument2 to image_new_from_stock does not affect) ?????????
		#### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #10
0
 def __init__(self, widget, **kwargs):
     gtk.Dialog.__init__(self, **kwargs)
     self.set_title(_('Customize'))
     #self.set_has_separator(False)## not in gtk3
     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) ## (GdkPixbuf.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)
     col.set_property('expand', False)
     ##
     treev.append_column(col)
     col = gtk.TreeViewColumn('Widget')
     col.set_property('expand', False)
     ##
     cell = gtk.CellRendererText()
     pack(col, cell)
     col.add_attribute(cell, 'text', 1)
     col.set_property('expand', True)
     ##
     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.IconSize.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-allocate', self.vboxSizeRequest)
     self.vbox.show_all()
     treev.get_selection().connect('changed', self.treevCursorChanged)
Beispiel #11
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", ....)
		# cell.connect("editing-canceled", ...)
		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.PolicyType.NEVER, gtk.PolicyType.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.IconSize.SMALL_TOOLBAR)
		#	# argument to set_icon_size has no effect
		#except:
		#	pass
		size = gtk.IconSize.SMALL_TOOLBAR
		# no different(argument2 to image_new_from_stock has no effect)
		# gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.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)
Beispiel #12
0
 def __init__(self, **kwargs):
     gtk.Dialog.__init__(self, **kwargs)
     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.PolicyType.AUTOMATIC, gtk.PolicyType.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.IconSize.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.ResponseType.OK)
     dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.ResponseType.CANCEL)
     ##
     resetB = self.add_button(gtk.STOCK_UNDO, gtk.ResponseType.NONE)
     resetB.set_label(_('_Reset to Defaults'))
     resetB.set_image(gtk.Image.new_from_stock(gtk.STOCK_UNDO, gtk.IconSize.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()
Beispiel #13
0
	def __init__(self, **kwargs):
		checkEventsReadOnly()  # FIXME
		gtk.Dialog.__init__(self, **kwargs)
		self.initVars()
		ud.windowList.appendItem(self)
		####
		self.syncing = None ## or a tuple of (groupId, statusText)
		self.groupIterById = {}
		self.trashIter = None
		self.isLoaded = False
		self.loadedGroupIds = set()
		self.eventsIter = {}
		####
		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.WindowTypeHint.NORMAL)
		##
		dialog_add_button(self, gtk.STOCK_OK, _("_OK"), gtk.ResponseType.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 = MenuItem(_("_File"))
		fileMenu = gtk.Menu()
		fileItem.set_submenu(fileMenu)
		menubar.append(fileItem)
		##
		addGroupItem = MenuItem(_("Add New Group"))
		addGroupItem.set_sensitive(not event_lib.allReadOnly)
		addGroupItem.connect("activate", self.addGroupBeforeSelection)
		## or before selected group? FIXME
		fileMenu.append(addGroupItem)
		##
		searchItem = MenuItem(_("_Search Events"))## FIXME right place?
		searchItem.connect("activate", self.mbarSearchClicked)
		fileMenu.append(searchItem)
		##
		exportItem = MenuItem(_("_Export"))
		exportItem.connect("activate", self.mbarExportClicked)
		fileMenu.append(exportItem)
		##
		importItem = MenuItem(_("_Import"))
		importItem.set_sensitive(not event_lib.allReadOnly)
		importItem.connect("activate", self.mbarImportClicked)
		fileMenu.append(importItem)
		##
		orphanItem = MenuItem(_("Check for Orphan Events"))
		orphanItem.set_sensitive(not event_lib.allReadOnly)
		orphanItem.connect("activate", self.mbarOrphanClicked)
		fileMenu.append(orphanItem)
		####
		editItem = MenuItem(_("_Edit"))
		if event_lib.allReadOnly:
			editItem.set_sensitive(False)
		else:
			editMenu = gtk.Menu()
			editItem.set_submenu(editMenu)
			menubar.append(editItem)
			##
			editEditItem = MenuItem(_("Edit"))
			editEditItem.connect("activate", self.mbarEditClicked)
			editMenu.append(editEditItem)
			editMenu.connect("show", self.mbarEditMenuPopup)
			self.mbarEditItem = editEditItem
			##
			editMenu.append(gtk.SeparatorMenuItem())
			##
			cutItem = MenuItem(_("Cu_t"))
			cutItem.connect("activate", self.mbarCutClicked)
			editMenu.append(cutItem)
			self.mbarCutItem = cutItem
			##
			copyItem = MenuItem(_("_Copy"))
			copyItem.connect("activate", self.mbarCopyClicked)
			editMenu.append(copyItem)
			self.mbarCopyItem = copyItem
			##
			pasteItem = MenuItem(_("_Paste"))
			pasteItem.connect("activate", self.mbarPasteClicked)
			editMenu.append(pasteItem)
			self.mbarPasteItem = pasteItem
			##
			editMenu.append(gtk.SeparatorMenuItem())
			##
			dupItem = MenuItem(_("_Duplicate"))
			dupItem.connect("activate", self.duplicateSelectedObj)
			editMenu.append(dupItem)
			self.mbarDupItem = dupItem
			##
			editMenu.append(gtk.SeparatorMenuItem())
			##
			enableAllItem = MenuItem(_("Enable All Groups"))
			enableAllItem.connect("activate", self.enableAllClicked)
			editMenu.append(enableAllItem)
			self.mbarEnableAllItem = enableAllItem
			##
			disableAllItem = MenuItem(_("Disable All Groups"))
			disableAllItem.connect("activate", self.disableAllClicked)
			editMenu.append(disableAllItem)
			self.mbarDisableAllItem = disableAllItem
		####
		viewItem = MenuItem(_("_View"))
		viewMenu = gtk.Menu()
		viewItem.set_submenu(viewMenu)
		menubar.append(viewItem)
		##
		collapseItem = MenuItem(_("Collapse All"))
		collapseItem.connect("activate", self.collapseAllClicked)
		viewMenu.append(collapseItem)
		##
		expandItem = MenuItem(_("Expand All"))
		expandItem.connect("activate", self.expandAllClicked)
		viewMenu.append(expandItem)
		##
		viewMenu.append(gtk.SeparatorMenuItem())
		##
		self.showDescItem = gtk.CheckMenuItem(_("Show _Description"))
		self.showDescItem.set_use_underline(True)
		self.showDescItem.set_active(ui.eventManShowDescription)
		self.showDescItem.connect("toggled", self.showDescItemToggled)
		viewMenu.append(self.showDescItem)
		####
		#testItem = MenuItem(_("Test"))
		#testMenu = gtk.Menu()
		#testItem.set_submenu(testMenu)
		#menubar.append(testItem)
		###
		#item = 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.SelectionMode.MULTIPLE)## FIXME
		#self.treev.set_rubber_banding(gtk.SelectionMode.MULTIPLE)## FIXME
		#self.treev.connect("realize", self.onTreeviewRealize)
		self.treev.get_selection().connect(
			"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.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC)
		pack(treeBox, swin, 1, 1)
		###
		toolbar = gtk.Toolbar()
		toolbar.set_orientation(gtk.Orientation.VERTICAL)
		size = gtk.IconSize.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, GdkPixbuf.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)
		col.set_property("expand", False)
		self.treev.append_column(col)
		self.pixbufCol = col
		###
		col = gtk.TreeViewColumn(
			_("Summary"),
			gtk.CellRendererText(),
			text=2,
		)
		col.set_resizable(True)
		col.set_property("expand", True)
		self.treev.append_column(col)
		###
		self.colDesc = gtk.TreeViewColumn(
			_("Description"),
			gtk.CellRendererText(),
			text=3,
		)
		self.colDesc.set_property("expand", True)
		if ui.eventManShowDescription:
			self.treev.append_column(self.colDesc)
		###
		#self.treev.set_search_column(2)## or 3
		###
		self.toPasteEvent = None ## (treeIter, bool move)
		#####
		self.sbar = gtk.Statusbar()
		self.sbar.set_direction(gtk.TextDirection.LTR)
		#self.sbar.set_has_resize_grip(False)
		pack(self.vbox, self.sbar)
		#####
		self.vbox.show_all()
Beispiel #14
0
	def __init__(self, **kwargs):
		checkEventsReadOnly() ## FIXME
		gtk.Dialog.__init__(self, **kwargs)
		self.initVars()
		ud.windowList.appendItem(self)
		####
		self.syncing = None ## or a tuple of (groupId, statusText)
		self.groupIterById = {}
		self.trashIter = None
		self.isLoaded = False
		self.loadedGroupIds = set()
		self.eventsIter = {}
		####
		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.WindowTypeHint.NORMAL)
		##
		dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.ResponseType.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 = MenuItem(_('_File'))
		fileMenu = gtk.Menu()
		fileItem.set_submenu(fileMenu)
		menubar.append(fileItem)
		##
		addGroupItem = MenuItem(_('Add New Group'))
		addGroupItem.set_sensitive(not event_lib.readOnly)
		addGroupItem.connect('activate', self.addGroupBeforeSelection)
		## or before selected group? FIXME
		fileMenu.append(addGroupItem)
		##
		searchItem = MenuItem(_('_Search Events'))## FIXME right place?
		searchItem.connect('activate', self.mbarSearchClicked)
		fileMenu.append(searchItem)
		##
		exportItem = MenuItem(_('_Export'))
		exportItem.connect('activate', self.mbarExportClicked)
		fileMenu.append(exportItem)
		##
		importItem = MenuItem(_('_Import'))
		importItem.set_sensitive(not event_lib.readOnly)
		importItem.connect('activate', self.mbarImportClicked)
		fileMenu.append(importItem)
		##
		orphanItem = MenuItem(_('Check for Orphan Events'))
		orphanItem.set_sensitive(not event_lib.readOnly)
		orphanItem.connect('activate', self.mbarOrphanClicked)
		fileMenu.append(orphanItem)
		####
		editItem = MenuItem(_('_Edit'))
		if event_lib.readOnly:
			editItem.set_sensitive(False)
		else:
			editMenu = gtk.Menu()
			editItem.set_submenu(editMenu)
			menubar.append(editItem)
			##
			editEditItem = MenuItem(_('Edit'))
			editEditItem.connect('activate', self.mbarEditClicked)
			editMenu.append(editEditItem)
			editMenu.connect('show', self.mbarEditMenuPopup)
			self.mbarEditItem = editEditItem
			##
			editMenu.append(gtk.SeparatorMenuItem())
			##
			cutItem = MenuItem(_('Cu_t'))
			cutItem.connect('activate', self.mbarCutClicked)
			editMenu.append(cutItem)
			self.mbarCutItem = cutItem
			##
			copyItem = MenuItem(_('_Copy'))
			copyItem.connect('activate', self.mbarCopyClicked)
			editMenu.append(copyItem)
			self.mbarCopyItem = copyItem
			##
			pasteItem = MenuItem(_('_Paste'))
			pasteItem.connect('activate', self.mbarPasteClicked)
			editMenu.append(pasteItem)
			self.mbarPasteItem = pasteItem
			##
			editMenu.append(gtk.SeparatorMenuItem())
			##
			dupItem = MenuItem(_('_Duplicate'))
			dupItem.connect('activate', self.duplicateSelectedObj)
			editMenu.append(dupItem)
			self.mbarDupItem = dupItem
		####
		viewItem = MenuItem(_('_View'))
		viewMenu = gtk.Menu()
		viewItem.set_submenu(viewMenu)
		menubar.append(viewItem)
		##
		collapseItem = MenuItem(_('Collapse All'))
		collapseItem.connect('activate', self.collapseAllClicked)
		viewMenu.append(collapseItem)
		##
		expandItem = 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 = MenuItem(_('Test'))
		#testMenu = gtk.Menu()
		#testItem.set_submenu(testMenu)
		#menubar.append(testItem)
		###
		#item = 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.SelectionMode.MULTIPLE)## FIXME
		#self.treev.set_rubber_banding(gtk.SelectionMode.MULTIPLE)## FIXME
		#self.treev.connect('realize', self.onTreeviewRealize)
		self.treev.get_selection().connect('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.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC)
		pack(treeBox, swin, 1, 1)
		###
		toolbar = gtk.Toolbar()
		toolbar.set_orientation(gtk.Orientation.VERTICAL)
		size = gtk.IconSize.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, GdkPixbuf.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)
		col.set_property('expand', False)
		self.treev.append_column(col)
		###
		col = gtk.TreeViewColumn(
			_('Summary'),
			gtk.CellRendererText(),
			text=2,
		)
		col.set_resizable(True)
		col.set_property('expand', True)
		self.treev.append_column(col)
		###
		self.colDesc = gtk.TreeViewColumn(
			_('Description'),
			gtk.CellRendererText(),
			text=3,
		)
		self.colDesc.set_property('expand', True)
		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.TextDirection.LTR)
		#self.sbar.set_has_resize_grip(False)
		pack(self.vbox, self.sbar)
		#####
		self.vbox.show_all()
Beispiel #15
0
	def __init__(self, **kwargs):
		gtk.Dialog.__init__(self, **kwargs)
		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,  # ym (hidden)
			str,  # localized year
			str,  # localized month
			int,  # monthLenCombo
			str,  # localized endDate
		)
		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.PolicyType.AUTOMATIC, gtk.PolicyType.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.IconSize.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.ResponseType.OK,
		)
		dialog_add_button(
			self,
			gtk.STOCK_CANCEL,
			_("_Cancel"),
			gtk.ResponseType.CANCEL,
		)
		##
		resetB = self.add_button(
			gtk.STOCK_UNDO,
			gtk.ResponseType.NONE,
		)
		resetB.set_label(_("_Reset to Defaults"))
		resetB.set_image(gtk.Image.new_from_stock(
			gtk.STOCK_UNDO,
			gtk.IconSize.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()
Beispiel #16
0
 def __init__(self, **kwargs):
     gtk.Dialog.__init__(self, **kwargs)
     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,  # ym (hidden)
         str,  # localized year
         str,  # localized month
         int,  # monthLenCombo
         str,  # localized endDate
     )
     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.PolicyType.AUTOMATIC, gtk.PolicyType.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.IconSize.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.ResponseType.OK,
     )
     dialog_add_button(
         self,
         gtk.STOCK_CANCEL,
         _("_Cancel"),
         gtk.ResponseType.CANCEL,
     )
     ##
     resetB = self.add_button(
         gtk.STOCK_UNDO,
         gtk.ResponseType.NONE,
     )
     resetB.set_label(_("_Reset to Defaults"))
     resetB.set_image(
         gtk.Image.new_from_stock(
             gtk.STOCK_UNDO,
             gtk.IconSize.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()