Esempio n. 1
0
    def _action(self, objs):
        doc = self.app.current_doc
        paths = self.get_paths_list(objs)
        doc.canvas.set_temp_mode(modes.WAIT_MODE)
        try:
            result = self.do_action(paths)
        except:
            doc.canvas.restore_mode()
            result = []
            msg = _('Error occurred during this operation.')
            msg += '\n' + _(
                'Perhaps this was due to the imperfection of the algorithm.')
            error_dialog(self.app.mw, self.app.appdata.app_name, msg)
            return

        doc.canvas.restore_mode()
        if result:
            style = deepcopy(objs[0].style)
            doc.api.create_curve(result, style)
        elif not result and self.pid == INTERSECTION_MODE:
            msg = _('Selected objects cannot be intersected.')
            msg_dialog(self.app.mw, self.app.appdata.app_name, msg)
            return

        if self.del_check.get_value():
            objs_list = []
            for obj in objs:
                index = obj.parent.childs.index(obj)
                objs_list.append([obj, obj.parent, index])
            doc.api.delete_objects(objs_list)
Esempio n. 2
0
	def _action(self, objs):
		doc = self.app.current_doc
		paths = self.get_paths_list(objs)
		doc.canvas.set_temp_mode(modes.WAIT_MODE)
		try:
			result = self.do_action(paths)
		except:
			doc.canvas.restore_mode()
			result = []
			msg = _('Error occurred during this operation.')
			msg += '\n' + _('Perhaps this was due to the imperfection of the algorithm.')
			error_dialog(self.app.mw, self.app.appdata.app_name, msg)
			return

		doc.canvas.restore_mode()
		if result:
			style = deepcopy(objs[0].style)
			doc.api.create_curve(result, style)
		elif not result and self.pid == INTERSECTION_MODE:
			msg = _('Selected objects cannot be intersected.')
			msg_dialog(self.app.mw, self.app.appdata.app_name, msg)
			return

		if self.del_check.get_value():
			objs_list = []
			for obj in objs:
				index = obj.parent.childs.index(obj)
				objs_list.append([obj, obj.parent, index])
			doc.api.delete_objects(objs_list)
Esempio n. 3
0
 def get_selection(self):
     doc = self.app.current_doc
     objs = [] + doc.selection.objs
     if not self.check_selection(objs):
         msg = _('Selected objects cannot be used for this operation.')
         msg += '\n' + _('Try ungroup selection.')
         msg_dialog(self.app.mw, self.app.appdata.app_name, msg)
         objs = []
     return objs
Esempio n. 4
0
	def get_selection(self):
		doc = self.app.current_doc
		objs = [] + doc.selection.objs
		if not self.check_selection(objs):
			msg = _('Selected objects cannot be used for this operation.')
			msg += '\n' + _('Try ungroup selection.')
			msg_dialog(self.app.mw, self.app.appdata.app_name, msg)
			objs = []
		return objs
Esempio n. 5
0
 def stub(self, *args):
     dialogs.msg_dialog(
         self.mw, self.app.appdata.app_name,
         'Sorry, but this feature is not implemented yet!\n' +
         'Be patient and watch project development of '
         'regularly updating the source code!')
Esempio n. 6
0
	def stub(self, *args):
		dialogs.msg_dialog(self.mw, self.app.appdata.app_name,
				'Sorry, but this feature is not implemented yet!\n' +
				'Be patient and watch project development of regularly updating the source code!')