From 09496d741c563c92e16bad63552658d5c1a74348 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 17 Jun 2010 19:54:19 +0200 Subject: [PATCH] =?utf8?q?Implement=20cancelling=20the=20insert=20when=20t?= =?utf8?q?he=20=E2=80=9Ccancel=E2=80=9D=20button=20is=20pressed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/de/todesbaum/jsite/gui/ProjectInsertPage.java | 4 ++-- src/de/todesbaum/jsite/main/Main.java | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) 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); -- 2.7.4