Author: timotei
Date: Sat Jul 30 09:56:51 2011
New Revision: 50473
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50473&view=rev
Log:
eclipse plugin: Fill the installs name in the project
creation page
Modified:
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wizards/WizardProjectPageTemplate.java
Modified:
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wizards/WizardProjectPageTemplate.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wizards/WizardProjectPageTemplate.java?rev=50473&r1=50472&r2=50473&view=diff
==============================================================================
---
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wizards/WizardProjectPageTemplate.java
(original)
+++
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wizards/WizardProjectPageTemplate.java
Sat Jul 30 09:56:51 2011
@@ -15,6 +15,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.wesnoth.installs.WesnothInstall;
+import org.wesnoth.installs.WesnothInstallsUtils;
import org.wesnoth.preferences.Preferences;
import org.wesnoth.preferences.Preferences.Paths;
import org.wesnoth.utils.ResourceUtils;
@@ -50,10 +52,25 @@
lblWesnothInstall.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER,
false, false, 1, 1));
lblWesnothInstall.setText("Wesnoth Install:");
- cmbInstalls_ = new Combo(composite, SWT.NONE);
+ cmbInstalls_ = new Combo( composite, SWT.READ_ONLY );
GridData gd_cmbInstalls = new GridData(SWT.FILL, SWT.CENTER, true,
false, 1, 1);
gd_cmbInstalls.widthHint = 154;
cmbInstalls_.setLayoutData(gd_cmbInstalls);
+
+ // fill the installs
+ String defaultInstallName = Preferences.getDefaultInstallName( );
+ for ( WesnothInstall install : WesnothInstallsUtils.getInstalls( ) ) {
+ cmbInstalls_.add( install.getName( ) );
+
+ // select the default
+ if ( install.getName( ).equals( defaultInstallName ) )
+ cmbInstalls_.select( cmbInstalls_.getItemCount( ) - 1 );
+ }
+
+ // select the first if there is no other selected
+ if ( cmbInstalls_.getSelectionIndex( ) == -1 &&
+ cmbInstalls_.getItemCount( ) > 0 )
+ cmbInstalls_.select( 0 );
}
/**
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits