From e615d9c843d57e728a3d9a599693512bd8b1615b Mon Sep 17 00:00:00 2001 From: mkutmon Date: Wed, 21 Sep 2016 12:10:25 +0200 Subject: [PATCH] bug fixes #37 #36 #35 --- build.xml | 4 ++-- .../pathvisio/wpclient/actions/UploadAction.java | 8 +++++++- .../wpclient/panels/CreatePathwayPanel.java | 3 +++ .../pathvisio/wpclient/panels/LoginPanel.java | 16 +++------------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/build.xml b/build.xml index ff26581..ddcdcb5 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ - + @@ -51,7 +51,7 @@ includes="**" destdir="build" debug="${debug.mode}" - source="1.5"> + source="1.6"> diff --git a/src/org/pathvisio/wpclient/actions/UploadAction.java b/src/org/pathvisio/wpclient/actions/UploadAction.java index d78983e..8afbc78 100644 --- a/src/org/pathvisio/wpclient/actions/UploadAction.java +++ b/src/org/pathvisio/wpclient/actions/UploadAction.java @@ -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; @@ -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); + } } } diff --git a/src/org/pathvisio/wpclient/panels/CreatePathwayPanel.java b/src/org/pathvisio/wpclient/panels/CreatePathwayPanel.java index 6c8ef27..c4a8d54 100644 --- a/src/org/pathvisio/wpclient/panels/CreatePathwayPanel.java +++ b/src/org/pathvisio/wpclient/panels/CreatePathwayPanel.java @@ -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())); diff --git a/src/org/pathvisio/wpclient/panels/LoginPanel.java b/src/org/pathvisio/wpclient/panels/LoginPanel.java index 345793e..209becc 100644 --- a/src/org/pathvisio/wpclient/panels/LoginPanel.java +++ b/src/org/pathvisio/wpclient/panels/LoginPanel.java @@ -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(