def user_ack(): if number_of_selected_events > 1: text = _("Are you sure you want to delete %d events?" % number_of_selected_events) else: text = _("Are you sure you want to delete this event?") return _ask_question(text) == wx.YES
def delete_category(parent_ctrl, db, cat): delete_warning = _("Are you sure you want to " "delete category '%s'?") % cat.name if cat.parent is None: update_warning = _("Events belonging to '%s' will no longer " "belong to a category.") % cat.name else: update_warning = _("Events belonging to '%s' will now belong " "to '%s'.") % (cat.name, cat.parent.name) question = "%s\n\n%s" % (delete_warning, update_warning) if gui_utils._ask_question(question, parent_ctrl) == wx.YES: db.delete_category(cat)
def run(self, main_frame): if not has_pysvg_module(): display_error_message(_("Could not find pysvg Python package. It is needed to export to SVG."), self) return helper = WildcardHelper(_("SVG files"), ["svg"]) wildcard = helper.wildcard_string() dialog = wx.FileDialog(main_frame, message=_("Export to SVG"), wildcard=wildcard, style=wx.FD_SAVE) if dialog.ShowModal() == wx.ID_OK: path = helper.get_path(dialog) overwrite_question = _("File '%s' exists. Overwrite?") % path if (not os.path.exists(path) or _ask_question(overwrite_question, main_frame) == wx.YES): main_frame.main_panel.timeline_panel.timeline_canvas.SaveAsSvg(path) dialog.Destroy()
def run(self, main_frame): if not has_pysvg_module(): display_error_message(_("Could not find pysvg Python package. It is needed to export to SVG."), self) return helper = WildcardHelper(_("SVG files"), ["svg"]) wildcard = helper.wildcard_string() dialog = wx.FileDialog(main_frame, message=_("Export to SVG"), wildcard=wildcard, style=wx.FD_SAVE) if dialog.ShowModal() == wx.ID_OK: path = helper.get_path(dialog) overwrite_question = _("File '%s' exists. Overwrite?") % path if (not os.path.exists(path) or _ask_question(overwrite_question, main_frame) == wx.YES): scene = main_frame.main_panel.get_scene() view_properties = main_frame.main_panel.get_view_properties() export(path, scene, view_properties) dialog.Destroy()
def overwrite_existing_path(main_frame, path): if os.path.exists(path): overwrite_question = _("File '%s' exists. Overwrite?") % path return _ask_question(overwrite_question, main_frame) == wx.YES return True
def ask_question(self, question): return _ask_question(question, self)