eclipse plugin: new campaign wizard should have an ID

This commit is contained in:
Timotei Dolean 2010-05-28 17:06:29 +00:00
parent d0bcb47e35
commit 70137c692c
3 changed files with 21 additions and 0 deletions

View file

@ -130,6 +130,7 @@ public class CampaignNewWizard extends Wizard implements INewWizard {
params.add(new ReplaceableParameter("$$email", page1_.getEmail()));
params.add(new ReplaceableParameter("$$translations_dir", page1_.getTranslationDir()));
params.add(new ReplaceableParameter("$$campaign_id", page2_.getCampaignId()));
params.add(new ReplaceableParameter("$$abrev", page2_.getAbbrev()));
params.add(new ReplaceableParameter("$$define", page2_.getDefine()));
params.add(new ReplaceableParameter("$$difficulties", page2_.getDifficulties()));

View file

@ -23,6 +23,7 @@ public class CampaignPage2 extends WizardPage {
private Text txtDefine_;
private Text txtDifficulties_;
private Text txtFirstScenario_;
private Text txtID_;
/**
* Create the wizard.
@ -76,6 +77,15 @@ public class CampaignPage2 extends WizardPage {
container.setLayout(new GridLayout(5, false));
Label lblId = new Label(container, SWT.NONE);
lblId.setText("ID* :");
txtID_ = new Text(container, SWT.BORDER);
txtID_.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
Label lblAbbreviation = new Label(container, SWT.NONE);
lblAbbreviation.setText("Abbreviation* :");
@ -141,6 +151,12 @@ public class CampaignPage2 extends WizardPage {
{
setPageComplete(false);
if (txtID_.getText().isEmpty())
{
setErrorMessage("Please specify an ID.");
return;
}
if (txtAbbrev_.getText().isEmpty())
{
setErrorMessage("Please specify an abbreviation.");
@ -180,4 +196,7 @@ public class CampaignPage2 extends WizardPage {
public String getFirstScenario() {
return txtFirstScenario_.getText();
}
public String getCampaignId(){
return txtID_.getText();
}
}

View file

@ -6,6 +6,7 @@
[campaign]
#textdomain wesnoth-$$campaign_name
id=$$campaign_id
name= _ "$$campaign_name"
abbrev="$$abrev"
define="$$define"