def __init__(self, parent=None): Base.__init__(self, parent) self.l1 = QLabel(_('&Days of the month:')) self.days = QLineEdit(self) self.days.setToolTip(_('Comma separated list of days of the month.' ' For example: 1, 15')) self.l1.setBuddy(self.days) self.l2 = QLabel(_('Download &after:')) self.time = QTimeEdit(self) self.time.setDisplayFormat('hh:mm AP') self.l2.setBuddy(self.time) self.l.addWidget(self.l1, 0, 0, 1, 1) self.l.addWidget(self.days, 0, 1, 1, 1) self.l.addWidget(self.l2, 1, 0, 1, 1) self.l.addWidget(self.time, 1, 1, 1, 1)
def __init__(self, parent=None): Base.__init__(self, parent) self.days = [QCheckBox(force_unicode(calendar.day_abbr[d]), self) for d in xrange(7)] for i, cb in enumerate(self.days): row = i % 2 col = i // 2 self.l.addWidget(cb, row, col, 1, 1) self.time = QTimeEdit(self) self.time.setDisplayFormat('hh:mm AP') if canonicalize_lang(get_lang()) in {'deu', 'nds'}: self.time.setDisplayFormat('HH:mm') self.hl = QHBoxLayout() self.l1 = QLabel(_('&Download after:')) self.l1.setBuddy(self.time) self.hl.addWidget(self.l1) self.hl.addWidget(self.time) self.l.addLayout(self.hl, 1, 3, 1, 1) self.initialize()