Skip to content

Commit

Permalink
bug fixes #37 #36 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
mkutmon committed Sep 21, 2016
1 parent bc85aa3 commit e615d9c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<project name="org.pathvisio.wpclient" default="install" basedir=".">

<property name="pathvisio.dir" value="../../pathvisio"/>
<property name="pathvisio.dir" value="../pathvisio/"/>
<property name="bundle.dest" value="dist"/>
<property name="jar.name" value="org.pathvisio.wpclient.jar"/>

Expand Down Expand Up @@ -51,7 +51,7 @@
includes="**"
destdir="build"
debug="${debug.mode}"
source="1.5">
source="1.6">
<classpath refid="project.class.path"/>
</javac>
</target>
Expand Down
8 changes: 7 additions & 1 deletion src/org/pathvisio/wpclient/actions/UploadAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JOptionPane;

import org.pathvisio.wpclient.WikiPathwaysClientPlugin;
import org.pathvisio.wpclient.panels.CreatePathwayPanel;
Expand All @@ -37,7 +38,12 @@ public UploadAction(WikiPathwaysClientPlugin plugin) {

@Override
public void actionPerformed(ActionEvent e) {
new CreatePathwayPanel(plugin);
if(plugin.getDesktop().getSwingEngine().getCurrentOrganism() == null) {
JOptionPane.showMessageDialog(plugin.getDesktop().getFrame(), "Please specify organism by double clicking on info box\n in the top left corner of the pathway before uploading.",
"Error", JOptionPane.ERROR_MESSAGE);
} else {
new CreatePathwayPanel(plugin);
}
}

}
3 changes: 3 additions & 0 deletions src/org/pathvisio/wpclient/panels/CreatePathwayPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ protected WSPathwayInfo doInBackground() throws Exception {
try {
pk.setTaskName("Uploading pathway.");
Pathway pathway = plugin.getDesktop().getSwingEngine().getEngine().getActivePathway();
if(!description.getText().equals("")) {
pathway.getMappInfo().addComment(description.getText(), "WikiPathways-description");
}
info = plugin.getWpQueries().uploadPathway(pathway);
pk.setTaskName("Adding curation tag.");
plugin.getWpQueries().updateCurationTag( "Curation:UnderConstruction", info.getId(), "", Integer.parseInt(info.getRevision()));
Expand Down
16 changes: 3 additions & 13 deletions src/org/pathvisio/wpclient/panels/LoginPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,11 @@ public boolean login() throws RemoteException, MalformedURLException, ServiceExc
try {
username = UserField.getText();
password = new String(PassField.getPassword());
if (Validator.CheckNonAlpha(username)) {
plugin.getWpQueries().login(username, password);
loggedin = true;
if (!itsKeepBox.isSelected()) {
username = "";
password = "";
}
} else {
JOptionPane.showMessageDialog(plugin.getDesktop().getFrame(),
"Please Enter Valid UserName", "ERROR",
JOptionPane.ERROR_MESSAGE);
plugin.getWpQueries().login(username, password);
loggedin = true;
if (!itsKeepBox.isSelected()) {
username = "";
password = "";
Logger.log.error("Wrong username. \n");
return false;
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(
Expand Down

0 comments on commit e615d9c

Please sign in to comment.