minor bug fix: recompilation dialog may preselect wrong process if several equally named processes exist (implemented in different source files)

This commit is contained in:
fros4943 2008-01-08 12:33:25 +00:00
parent 9c08ab0009
commit c55f320bd5

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.contikimote;
@ -247,7 +247,17 @@ public class ContikiMoteTypeDialog extends JDialog {
// Try to find process in current list // Try to find process in current list
boolean foundAndSelectedProcess = false; boolean foundAndSelectedProcess = false;
for (Component processCheckBox : myDialog.processPanel.getComponents()) { 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); ((JCheckBox) processCheckBox).setSelected(true);
foundAndSelectedProcess = true; foundAndSelectedProcess = true;
break; break;