X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FProjectInsertPage.java;h=2cedd5b567167bf25d11fb2e5ae223a75c144028;hb=45153cb94d13f27f9ffc1e3cc9eff870054c201b;hp=984e6df818ca16cc5dff7011092589c20c25cce8;hpb=0738b9f85c31813c0a6f02b3a51422192c96eb31;p=jSite.git diff --git a/src/de/todesbaum/jsite/gui/ProjectInsertPage.java b/src/de/todesbaum/jsite/gui/ProjectInsertPage.java index 984e6df..2cedd5b 100644 --- a/src/de/todesbaum/jsite/gui/ProjectInsertPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectInsertPage.java @@ -83,6 +83,9 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl /** The number of inserted blocks. */ private volatile int insertedBlocks; + /** Whether the “copy URI to clipboard” button was used. */ + private boolean uriCopied; + /** * Creates a new progress insert wizard page. * @@ -250,6 +253,16 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl projectInserter.setTempDirectory(tempDirectory); } + /** + * Returns whether the “copy URI to clipboard” button was used. + * + * @return {@code true} if an URI was copied to clipboard, {@code false} + * otherwise + */ + public boolean wasUriCopied() { + return uriCopied; + } + // // INTERFACE InsertListener // @@ -321,8 +334,8 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl public void projectInsertFinished(Project project, boolean success, Throwable cause) { if (success) { String copyURILabel = I18n.getMessage("jsite.insert.okay-copy-uri"); - String selectedValue = (String) JOptionPane.showInputDialog(this, I18n.getMessage("jsite.insert.inserted"), I18n.getMessage("jsite.insert.done.title"), JOptionPane.INFORMATION_MESSAGE, null, new Object[] { I18n.getMessage("jsite.insert.okay"), copyURILabel }, copyURILabel); - if (copyURILabel.equals(selectedValue)) { + int selectedValue = JOptionPane.showOptionDialog(this, I18n.getMessage("jsite.insert.inserted"), I18n.getMessage("jsite.insert.done.title"), 0, JOptionPane.INFORMATION_MESSAGE, null, new Object[] { I18n.getMessage("jsite.insert.okay"), copyURILabel }, copyURILabel); + if (selectedValue == 1) { actionCopyURI(); } } else { @@ -352,6 +365,7 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl * Copies the request URI of the project to the clipboard. */ private void actionCopyURI() { + uriCopied = true; Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(new StringSelection(requestURITextField.getText()), this); }