def save(self, widget=None): self.get_window().set_cursor(gdk.Cursor(gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration_do(False) path = self.fcw.get_filename() if path in (None, ''): return print('Exporting to html file "%s"'%path) i = self.combo.get_active() months = [] module = calTypes.primaryModule() if i==0: s = getCurrentMonthStatus() months = [s] title = '%s %s'%(core.getMonthName(calTypes.primary, s.month, s.year), _(s.year)) elif i==1: for i in range(1, 13): months.append(getMonthStatus(ui.cell.year, i)) title = '%s %s'%(_('Calendar'), _(ui.cell.year)) elif i==2: y0, m0 = self.ymBox0.get_value() y1, m1 = self.ymBox1.get_value() for ym in range(y0*12+m0-1, y1*12+m1): y, m = divmod(ym, 12) m += 1 months.append(getMonthStatus(y, m)) title = _('Calendar') exportToHtml(path, months, title) self.get_window().set_cursor(gdk.Cursor(gdk.LEFT_PTR)) self.hide()
def save(self, path): print 'save', path self.setCursor(qc.Qt.WaitCursor) #while gtk.events_pending():## FIXME # gtk.main_iteration_do(False) if path in (None, ''): return print 'Exporting to html file "%s"'%path i = self.combo.currentIndex() months = [] module = core.modules[core.primaryMode] if i==0: s = getCurrentMonthStatus() months = [s] title = '%s %s'%(core.getMonthName(core.primaryMode, s.month, s.year), _(s.year)) elif i==1: for i in xrange(1, 13): months.append(getMonthStatus(ui.cell.year, i)) title = '%s %s'%(_('Calendar'), _(ui.cell.year)) elif i==2: y0, m0 = self.ymBox0.getYM() y1, m1 = self.ymBox1.getYM() for ym in xrange(y0*12+m0-1, y1*12+m1): y, m = divmod(ym, 12) m += 1 months.append(getMonthStatus(y, m)) title = _('Calendar') exportToHtml(path, months, title) self.setCursor(qc.Qt.ArrowCursor) self.hide()
def _save(self, path): comboItem = self.combo.get_active() months = [] module = calTypes.primaryModule() if comboItem==0: s = getCurrentMonthStatus() months = [s] title = '%s %s'%(locale_man.getMonthName(calTypes.primary, s.month, s.year), _(s.year)) elif comboItem==1: for i in range(1, 13): months.append(getMonthStatus(ui.cell.year, i)) title = '%s %s'%(_('Calendar'), _(ui.cell.year)) elif comboItem==2: y0, m0 = self.ymBox0.get_value() y1, m1 = self.ymBox1.get_value() for ym in range(y0*12+m0-1, y1*12+m1): y, m = divmod(ym, 12) m += 1 months.append(getMonthStatus(y, m)) title = _('Calendar') exportToHtml(path, months, title) self.hide()