/** 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.
*
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
//
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 {
@SuppressWarnings("synthetic-access")
public void run() {
progressBar.setValue(progressBar.getMaximum());
- progressBar.setString(I18n.getMessage("jsite.insert.done"));
+ progressBar.setString(I18n.getMessage("jsite.insert.done") + " (" + getTransferRate() + " " + I18n.getMessage("jsite.insert.k-per-s") + ")");
wizard.setNextEnabled(true);
wizard.setQuitEnabled(true);
}
* 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);
}