Edits the given profile.
        
        :param      parent  | <QWidget>
                    profile | <projexui.widgets.xviewwidget.XViewProfile>
        
        :return     <bool>
170758
def edit(parent, profile):
        
        dlg = XViewProfileDialog(parent)
        dlg.setProfile(profile)
        if ( dlg.exec_() ):
            return True
        return False
572557
@Override
	protected void setProfile(List<Step> sx, List<Step> sy) {
		profile = pair = new SimpleProfilePair<S, C>(getQuery(), getTarget(), sx, sy);
	}
1001019
def saveProfile( self ):
        
        manager = self.parent()
        prof    = manager.currentProfile()
        
        # save the current profile
        save_prof = manager.viewWidget().saveProfile()
        prof.setXmlElement(save_prof.xmlElement())
730860
def saveProfileLayout(self, profile):
        
        if not self.viewWidget():
            text = self.profileText()
            QMessageBox.information(self.window(), 
                                    'Could Not Save {0}'.format(text),
                                    'Error saving layout, '\
                                    'No View Widget Assigned')
            return
        
        # save the profile from the view widget
        prof = self.viewWidget().saveProfile()
        profile.setXmlElement(prof.xmlElement())
        
        if not self.signalsBlocked():
            self.profileChanged.emit(profile)
1197897
def load(
        cls, name=None, parent_name=None, profile_is_live=False, values=None, defaults=None
    ) -> "EnvvarProfile":
        
        instance = cls(
            name=name,
            parent_name=parent_name,
            profile_is_live=profile_is_live,
            values=values,
            defaults=defaults,
        )
        instance._do_load()
        return instance
596722
public void setProfile(OperaProfile profile) {
    options.get(PROFILE).setValue(PROFILE.sanitize(profile));
    supportsPd = true;
  }
340264
def change_parent(sender, instance, **kwargs):
    
    if instance.id is None:
        return
    if len({'task', 'task_id'} & set(instance.changed_fields)) != 0:
        diff = instance.diff
        parent = diff['task'][0] if 'task' in diff else diff['task_id'][0]
        parent_id = parent.item_id if isinstance(parent, Task) else Task.objects.get(pk=parent).item_id
        child_id = instance.item_id
        ItemRelation.objects.filter(parent_id=parent_id, child_id=child_id).delete()
        ItemRelation.objects.create(parent_id=instance.task.item_id, child_id=child_id, visible=True)
    if len({'context', 'context_id'} & set(instance.changed_fields)) != 0:
        diff = instance.diff
        parent = diff['context'][0] if 'context' in diff else diff['context_id'][0]
        parent_id = parent.item_id if isinstance(parent, Context) else Context.objects.get(pk=parent).item_id
        child_id = instance.item_id
        ItemRelation.objects.filter(parent_id=parent_id, child_id=child_id).delete()
        ItemRelation.objects.create(parent_id=instance.context.item_id, child_id=child_id, visible=False)
1081974
def setParent(self, other):
        
        if self._parent == other:
            return False
        
        # remove this layer from its parent
        if self._parent and self in self._parent._children:
            self._parent._children.remove(self)
        
        self._parent = other
        
        # add this layer to its parent's list of children
        if self._parent and not self in self._children:
            self._parent._children.append(self)
        
        self.sync()
        
        return True
1179297
public void setParent( IVarDef parent)
    {
    parent_ = parent;
    pathName_ = null;
    effCondition_ = null;
    position_ = null;
    }
425393
def edit_event_view(request, event_pk):
    '''  '''
    page_name = "Edit Event"
    profile = UserProfile.objects.get(user=request.user)
    event = get_object_or_404(Event, pk=event_pk)

    if event.owner != profile and not request.user.is_superuser:
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    event_form = EventForm(
        request.POST or None,
        profile=profile,
        instance=event,
    )
    if event_form.is_valid():
        event = event_form.save()
        messages.add_message(
            request, messages.SUCCESS,
            MESSAGES['EVENT_UPDATED'].format(event=event.title),
        )
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    return render_to_response('edit_event.html', {
        'page_name': page_name,
        'event_form': event_form,
    }, context_instance=RequestContext(request))
909824
def add_parent(self, parent):
        
        parent.add_child(self)
        self.parent = parent
        return parent
257147
def accept( self ):
        
        if ( not self.uiNameTXT.text() ):
            QMessageBox.information(self,
                                   'Invalid Name',
                                   'You need to supply a name for your layout.')
            return
        
        prof = self.profile()
        if ( not prof ):
            prof = XViewProfile()
        
        prof.setName(nativestring(self.uiNameTXT.text()))
        prof.setVersion(self.uiVersionSPN.value())
        prof.setDescription(nativestring(self.uiDescriptionTXT.toPlainText()))
        prof.setIcon(self.uiIconBTN.filepath())
        
        super(XViewProfileDialog, self).accept()
368576
def _set_parent(self, parent=None):
        
        if parent is not None:
            if not isinstance(parent, Parentable):
                raise ValueError('Parent object must implement Parentable interface.')
            if parent is self or parent._contains(self):
                raise ValueError('Self references are not allowed.')
        self._parent = parent if parent is not None else None
1146676
def setProfiles(self, profiles):
        
        self.blockSignals(True)
        self._profileCombo.blockSignals(True)
        
        self._profiles = profiles[:]
        self._profileCombo.clear()
        self._profileCombo.addItems(map(lambda x: x.name(), profiles))
        
        self._profileCombo.blockSignals(False)
        self.blockSignals(False)
1245092
def createWidget( self, parent ):
        
        widget = self.widgetClass()(parent, self.uiFile())
        widget.setPlugin(self)
        return widget
1101668
def profile(self, func):
        
        pr = cProfile.Profile()
        pr.runcall(func)
        st = pstats.Stats(pr)
        st.stream = None  # make it picklable
        st.strip_dirs()

        # Adds a new profile to the existing accumulated value
        self._accumulator.add(st)
652112
def restoreSettings(self, settings):
        
        settings.beginGroup(self.objectName())
        
        curr_prof = None
        curr_name = unwrapVariant(settings.value('current'))
        
        profiles = []
        for prof_name in settings.childGroups():
            settings.beginGroup(prof_name)
            
            prof_str = unwrapVariant(settings.value('profile'))
            profile  = XViewProfile.fromString(prof_str)
            profile.setName(prof_name)
            
            if prof_name == curr_name:
                curr_prof = profile
            
            profiles.append(profile)
            
            settings.endGroup()
        
        self.blockSignals(True)
        self._profileCombo.blockSignals(True)
        self.setProfiles(profiles)
        
        if curr_prof:
            self.setCurrentProfile(curr_prof)
        
        self._profileCombo.blockSignals(False)
        self.blockSignals(False)
        
        settings.endGroup()