From: David ‘Bombe’ Roden Date: Thu, 17 Jun 2010 17:54:19 +0000 (+0200) Subject: Implement cancelling the insert when the “cancel” button is pressed. X-Git-Tag: 0.9.2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=09496d741c563c92e16bad63552658d5c1a74348;p=jSite.git Implement cancelling the insert when the “cancel” button is pressed. --- diff --git a/src/de/todesbaum/jsite/gui/ProjectInsertPage.java b/src/de/todesbaum/jsite/gui/ProjectInsertPage.java index 86305aa..b722ceb 100644 --- a/src/de/todesbaum/jsite/gui/ProjectInsertPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectInsertPage.java @@ -206,7 +206,7 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl public void pageAdded(TWizard wizard) { this.wizard.setPreviousName(I18n.getMessage("jsite.wizard.previous")); this.wizard.setPreviousEnabled(false); - this.wizard.setNextName(I18n.getMessage("jsite.wizard.next")); + this.wizard.setNextName(I18n.getMessage("jsite.general.cancel")); this.wizard.setQuitName(I18n.getMessage("jsite.wizard.quit")); } @@ -215,7 +215,6 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl */ public void startInsert() { running = true; - wizard.setNextEnabled(false); copyURIAction.setEnabled(false); progressBar.setValue(0); progressBar.setString(I18n.getMessage("jsite.insert.starting")); @@ -400,6 +399,7 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl public void run() { progressBar.setValue(progressBar.getMaximum()); progressBar.setString(I18n.getMessage("jsite.insert.done") + " (" + getTransferRate() + " " + I18n.getMessage("jsite.insert.k-per-s") + ")"); + wizard.setNextName(I18n.getMessage("jsite.wizard.next")); wizard.setNextEnabled(true); wizard.setQuitEnabled(true); } diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index 09b6a5d..442b16d 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -540,9 +540,14 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen nodeMenu.setEnabled(false); optionsPreferencesAction.setEnabled(false); } else if ("page.project.insert".equals(pageName)) { - showPage(PageType.PAGE_PROJECTS); - nodeMenu.setEnabled(true); - optionsPreferencesAction.setEnabled(true); + ProjectInsertPage projectInsertPage = (ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT); + if (projectInsertPage.isRunning()) { + projectInsertPage.stopInsert(); + } else { + showPage(PageType.PAGE_PROJECTS); + nodeMenu.setEnabled(true); + optionsPreferencesAction.setEnabled(true); + } } else if ("page.preferences".equals(pageName)) { showPage(PageType.PAGE_PROJECTS); optionsPreferencesAction.setEnabled(true);