Esempio n. 1
0
 def close_action(self, *_args):
     if not self.canvas.history.is_saved():
         palette_name = self.canvas.doc.model.name or _('Untitled palette')
         ret = wal.yesno_dialog(
             self, self.app.appdata.app_name,
             'Palette "%s" is modified' % palette_name,
             'Do you wish to save changes?')
         if ret:
             if not self.app.save_as_doc(self.canvas.doc, self):
                 LOG.info('Palette window destroying canceled for %s',
                          self.canvas.doc.model.name)
                 return True
     LOG.info('Palette window destroyed for %s', self.canvas.doc.model.name)
     wal.PaletteWindow.destroy(self)
     self.app.drop_win(self)
     return False
Esempio n. 2
0
	def set_container(self, obj):
		if len(obj) == 1 and obj[0].cid > model.PRIMITIVE_CLASS and not \
		obj[0] in self.selection.objs:
			self.pack_container(obj[0])
			return False

		if not len(obj):
			first = _("There is no selected object.")
		elif obj[0] in self.selection.objs:
			first = _("Object from current selection cannot be container.")
		else:
			first = _("Selected object cannot be container.")

		second = _('Do you want to try again?')

		return wal.yesno_dialog(self.app.mw, self.app.appdata.app_name,
				first, second)
	def callback7(self, *args):
		title = 'Info'
		first = 'The document <xxxxxxx yyyyy> has been changed!'
		second = 'Do you wish to save it?.'
		print wal.yesno_dialog(self, title, first, second)