Skip to content

Commit

Permalink
Merge pull request #9 from petebankhead/rc2
Browse files Browse the repository at this point in the history
Update for QuPath v0.3.0-rc2
  • Loading branch information
petebankhead authored Aug 8, 2021
2 parents ced222f + 7fb0609 commit 6fa7ac5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ The extension is intended for the (at the time of writing) not-yet-released
QuPath v0.3.
It is not compatible with earlier QuPath versions.

## Installing

To install the OMERO extension, download the latest `qupath-extension-omero-[version].jar` file from [releases](https://github.com/qupath/qupath-extension-omero/releases) and drag it onto the main QuPath window.

If you haven't installed any extensions before, you'll be prompted to select a QuPath user directory.
The extension will then be copied to a location inside that directory.

You might then need to restart QuPath (but not your computer).


## Building

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
ext.moduleName = 'qupath.extension.omero'
archivesBaseName = 'qupath-extension-omero'
description = "QuPath extension to support image reading using OMERO's web API."
version = "0.3.0-SNAPSHOT"
version = "0.3.0-rc2"

repositories {
mavenCentral()
Expand All @@ -27,7 +27,7 @@ repositories {
dependencies {
implementation "org.apache.commons:commons-text:1.9"

shadow "io.github.qupath:qupath-gui-fx:0.3.0-SNAPSHOT"
shadow "io.github.qupath:qupath-gui-fx:0.3.0-rc2"
shadow "org.slf4j:slf4j-api:1.7.30"
}

Expand Down
30 changes: 8 additions & 22 deletions src/main/java/qupath/lib/images/servers/omero/OmeroExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ public class OmeroExtension implements QuPathExtension, GitHubProject {

private static boolean alreadyInstalled = false;

private static Version minimumVersion = Version.parse("0.3.0-SNAPSHOT");

@Override
public void installExtension(QuPathGUI qupath) {
if (alreadyInstalled || !checkCompatibility())
if (alreadyInstalled)
return;

logger.debug("Installing OMERO extension");

alreadyInstalled = true;
var actionClients = ActionTools.createAction(new OmeroWebClientsCommand(qupath), "Manage server connections");
var actionSendObjects = ActionTools.createAction(new OmeroWritePathObjectsCommand(qupath), "Send annotations to OMERO");
Expand All @@ -89,25 +89,6 @@ public void installExtension(QuPathGUI qupath) {
createServerListMenu(qupath, browseServerMenu);
}


/**
* Check compatibility with the QuPath version.
* @return
*/
private static boolean checkCompatibility() {
try {
var version = QuPathGUI.getVersion();
// If >= the minimum version, we are compatible as far as we know
if (minimumVersion.compareTo(version) <= 0)
return true;
} catch (Exception e) {
logger.debug("Version check exception: " + e.getLocalizedMessage(), e);
}
logger.warn("OMERO extension is not compatible with the current QuPath version ({}.{}.{} required)",
minimumVersion.getMajor(), minimumVersion.getMinor(), minimumVersion.getPatch());
return false;
}


@Override
public String getName() {
Expand Down Expand Up @@ -218,4 +199,9 @@ static Map<OmeroWebClient, OmeroWebImageServerBrowserCommand> getOpenedBrowsers(
public GitHubRepo getRepository() {
return GitHubRepo.create(getName(), "qupath", "qupath-extension-omero");
}

@Override
public Version getQuPathVersion() {
return Version.parse("0.3.0-rc2");
}
}

0 comments on commit 6fa7ac5

Please sign in to comment.