From c55f320bd5e20a770668bc39388c7cc590de91ec Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 8 Jan 2008 12:33:25 +0000 Subject: [PATCH] minor bug fix: recompilation dialog may preselect wrong process if several equally named processes exist (implemented in different source files) --- .../cooja/contikimote/ContikiMoteTypeDialog.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java index 6160582ee..1e6ec2a44 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMoteTypeDialog.java,v 1.38 2007/11/29 05:58:42 fros4943 Exp $ + * $Id: ContikiMoteTypeDialog.java,v 1.39 2008/01/08 12:33:25 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -247,7 +247,17 @@ public class ContikiMoteTypeDialog extends JDialog { // Try to find process in current list boolean foundAndSelectedProcess = false; for (Component processCheckBox : myDialog.processPanel.getComponents()) { - if (presetProcess.equals(((JCheckBox) processCheckBox).getText())) { + boolean inCompileFile = false; + + for (File compileFile: moteTypeToConfigure.getCompilationFiles()) { + if (compileFile.getName().equals(((JCheckBox) processCheckBox).getToolTipText())) { + inCompileFile = true; + break; + } + } + + if (inCompileFile && + presetProcess.equals(((JCheckBox) processCheckBox).getText())) { ((JCheckBox) processCheckBox).setSelected(true); foundAndSelectedProcess = true; break;