Skip to content

Commit

Permalink
Merge pull request #34 from jburel/12145-rnd-settings
Browse files Browse the repository at this point in the history
12145 rnd settings
  • Loading branch information
joshmoore committed May 18, 2014
2 parents 0dbcd2d + 174eb3a commit a363cd2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ public void actionPerformed(ActionEvent e)
}

viewedByMenu.add(thumbnailsMenuItem);
viewedByMenu.show(source, location.x, location.y);
if (source != null && source.isVisible()) {
viewedByMenu.show(source, location.x, location.y);
}
}

/** Displays all the thumbnails. */
Expand Down
21 changes: 19 additions & 2 deletions components/tools/OmeroPy/src/omero/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5969,8 +5969,8 @@ def _prepareRE (self, rdid=None):
ctx = self._conn.SERVICE_OPTS.copy()

ctx.setOmeroGroup(self.details.group.id.val)
if self._conn.canBeAdmin():
ctx.setOmeroUser(self.details.owner.id.val)
#if self._conn.canBeAdmin():
# ctx.setOmeroUser(self.details.owner.id.val)
re.lookupPixels(pid, ctx)
if rdid is None:
rdid = self._getRDef()
Expand Down Expand Up @@ -7559,6 +7559,23 @@ def saveDefaults (self):
self._re.saveCurrentSettings(ctx)
return True

@assert_re()
def resetDefaults(self):
if not self.canAnnotate():
return False
ns = self._conn.CONFIG.IMG_ROPTSNS
if ns:
opts = self._collectRenderOptions()
self.removeAnnotations(ns)
ann = omero.gateway.CommentAnnotationWrapper()
ann.setNs(ns)
ann.setValue('&'.join(['='.join(map(str, x)) for x in opts.items()]))
self.linkAnnotation(ann)
ctx = self._conn.SERVICE_OPTS.copy()
ctx.setOmeroGroup(self.details.group.id.val)
self._re.resetDefaults(ctx)
return True

def countArchivedFiles (self):
"""
Returns the number of Original 'archived' Files linked to primary pixels.
Expand Down
6 changes: 3 additions & 3 deletions components/tools/OmeroWeb/omeroweb/webgateway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,8 +1639,8 @@ def applyRenderingSettings(image, rdef):
@jsonp
def reset_image_rdef_json (request, iid, conn=None, **kwargs):
"""
Try to remove all rendering defs the logged in user has for this image.
Reset rendering defs default for this image. Do not delete other related settings.
@param request: http request
@param iid: Image ID
@param conn: L{omero.gateway.BlitzGateway}
Expand All @@ -1649,7 +1649,7 @@ def reset_image_rdef_json (request, iid, conn=None, **kwargs):

img = conn.getObject("Image", iid)

if img is not None and img.resetRDefs():
if img is not None and img.resetDefaults():
user_id = conn.getEventContext().userId
server_id = request.session['connector'].server_id
webgateway_cache.invalidateObject(server_id, user_id, img)
Expand Down

0 comments on commit a363cd2

Please sign in to comment.