Ejemplo n.º 1
0
	def _on_ok(self, _evt):
		if self._lc_items.GetSelectedItemCount() == 0:
			msg.message_box_info(self._wnd,
					_("Please select one or more items to undelete."))
			return
		idx = -1
		while True:
			idx = self._lc_items.GetNextItem(idx, wx.LIST_NEXT_ALL,
				wx.LIST_STATE_SELECTED)
			if idx == -1:
				self._wnd.EndModal(wx.ID_OK)
				return
			item = self._items[self._lc_items.GetItemData(idx)]
			dict_logic.undelete_dict_item(item, self._session)
Ejemplo n.º 2
0
	def _on_save(self, evt):
		if not self._wnd.Validate():
			return
		if not self._wnd.TransferDataFromWindow():
			return
		details = 0
		if self['rb_details_normal'].GetValue():
			details = 1
		elif self['rb_details_verbose'].GetValue():
			details = 2
		filename = self['tc_filename'].GetValue()
		try:
			with open(filename, 'wt') as dfile:
				if self['rb_format_txt'].GetValue():  # txt
					exporter.dump_tasks_to_text(self._tasks, details, output=dfile)
				else:  # csv
					exporter.dump_tasks_to_csv(self._tasks, details, output=dfile)
			msg.message_box_info(self._wnd, _("Export complete."))
		except IOError as error:
			msg.message_box_error_ex(self._wnd, _("Export Error."),
					str(error))
Ejemplo n.º 3
0
	def _on_btn_reminders(self, _evt):
		if not FrameReminders.check(self.wnd, self._session):
			mbox.message_box_info(self.wnd, _("No active alarms in this moment."),
					_("Alarms"))