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
def __init__(self): from scal2.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.Dialog.__init__(self) self.set_title(_('Time Zone')) #### dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.RESPONSE_CANCEL) dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK) ### self.connect('response', self.onResponse) #### label = gtk.Label() label.set_markup(''.join([ _('"Time Zone" property is newly added to events') + '\n', _('But this property needs to be saved for current events') + '\n', _('Select the time zone for your current location') + '\n\n', '<small>', _('If you have been in a different time zone while adding some of your event, you need to edit those events manually and change the time zone' ) + '\n', _('Time zone for All-Day events will be disabled by default'), '</small>', ])) label.set_line_wrap(True) pack(self.vbox, label, 1, 1) #### hbox = gtk.HBox() self.timeZoneInput = TimeZoneComboBoxEntry() pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.timeZoneInput) pack(hbox, gtk.Label(''), 1, 1) hbox.set_border_width(20) pack(self.vbox, hbox, 1, 1) #### self.errorLabel = gtk.Label() pack(self.vbox, self.errorLabel, 1, 1) #### pack(self.vbox, gtk.Label(''), 1, 1) #### self.vbox.show_all()
def __init__(self, container): from scal2.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry self._container = container gtk.Dialog.__init__(self) self.set_title(_('Bulk Edit Events')) #### dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.RESPONSE_CANCEL) dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK) ## self.connect('response', lambda w, e: self.hide()) #### try: title = container.title except AttributeError: event_count = len(container) msg = _('Here you are going to modify these %s events at once.' ) % event_count else: msg = _( 'Here you are going to modify all events inside group "%s" at once.' ) % title msg += ' ' msg += _( 'You better make a backup from your events before doing this. Just right click on group and select "Export" (or a full backup: menu File -> Export)' ) msg += '\n\n' label = gtk.Label(msg) label.set_line_wrap(True) pack(self.vbox, label) #### hbox = gtk.HBox() self.iconRadio = gtk.RadioButton(label=_('Icon')) pack(hbox, self.iconRadio, 1, 1) self.summaryRadio = gtk.RadioButton(label=_('Summary'), group=self.iconRadio) pack(hbox, self.summaryRadio, 1, 1) self.descriptionRadio = gtk.RadioButton(label=_('Description'), group=self.iconRadio) pack(hbox, self.descriptionRadio, 1, 1) self.timeZoneRadio = gtk.RadioButton(label=_('Time Zone'), group=self.iconRadio) pack(hbox, self.timeZoneRadio, 1, 1) pack(self.vbox, hbox) ### self.iconRadio.connect('clicked', self.firstRadioChanged) self.summaryRadio.connect('clicked', self.firstRadioChanged) self.descriptionRadio.connect('clicked', self.firstRadioChanged) self.timeZoneRadio.connect('clicked', self.firstRadioChanged) #### hbox = gtk.HBox() self.iconChangeCombo = gtk.combo_box_new_text() self.iconChangeCombo.append_text('----') self.iconChangeCombo.append_text(_('Change')) self.iconChangeCombo.append_text(_('Change if empty')) pack(hbox, self.iconChangeCombo) pack(hbox, gtk.Label(' ')) self.iconSelect = IconSelectButton() try: self.iconSelect.set_filename(container.icon) except AttributeError: pass pack(hbox, self.iconSelect) pack(hbox, gtk.Label(''), 1, 1) pack(self.vbox, hbox) self.iconHbox = hbox #### self.textVbox = gtk.VBox() ### hbox = gtk.HBox() self.textChangeCombo = gtk.combo_box_new_text() self.textChangeCombo.append_text('----') self.textChangeCombo.append_text(_('Add to beginning')) self.textChangeCombo.append_text(_('Add to end')) self.textChangeCombo.append_text(_('Replace text')) self.textChangeCombo.connect('changed', self.textChangeComboChanged) pack(hbox, self.textChangeCombo) pack(hbox, gtk.Label(''), 1, 1) ## CheckButton(_('Regexp')) pack(self.textVbox, hbox) ### self.textInput1 = TextFrame() pack(self.textVbox, self.textInput1, 1, 1) ### hbox = gtk.HBox() pack(hbox, gtk.Label(_('with'))) pack(hbox, gtk.Label(''), 1, 1) pack(self.textVbox, hbox, 1, 1) self.withHbox = hbox ### self.textInput2 = TextFrame() pack(self.textVbox, self.textInput2, 1, 1) #### pack(self.vbox, self.textVbox, 1, 1) #### hbox = gtk.HBox() self.timeZoneChangeCombo = gtk.combo_box_new_text() self.timeZoneChangeCombo.append_text('----') self.timeZoneChangeCombo.append_text(_('Change')) self.timeZoneChangeCombo.append_text(_('Change if empty')) pack(hbox, self.timeZoneChangeCombo) pack(hbox, gtk.Label(' ')) self.timeZoneInput = TimeZoneComboBoxEntry() pack(hbox, self.timeZoneInput) pack(hbox, gtk.Label(''), 1, 1) pack(self.vbox, hbox, 1, 1) self.timeZoneHbox = hbox #### self.vbox.show_all() self.iconRadio.set_active(True) self.iconChangeCombo.set_active(0) self.textChangeCombo.set_active(0) self.firstRadioChanged()