changeset 207:ac5f87626abd xml-basic

Basic XML translations
author Dan.Kulinski@dank-laptop.Global.Local
date Sun, 14 Aug 2011 14:38:06 -0600
parents 77043c3e0d94
children 256f2f2f6e8c
files FrmMain.cs FrmMain.resx translations/en.translation
diffstat 3 files changed, 61 insertions(+), 33 deletions(-) [+]
line diff
     1.1 --- a/FrmMain.cs	Sun Aug 14 01:29:18 2011 +0000
     1.2 +++ b/FrmMain.cs	Sun Aug 14 14:38:06 2011 -0600
     1.3 @@ -100,6 +100,7 @@
     1.4  		private ToolStripPanel toolStripPanel;
     1.5  		private ToolStripSeparator toolStripSeparator4;
     1.6  		private IBBToolStripMenuItem miPreferences;
     1.7 +        private ToolStripMenuItem miExportArmyAsBasicXml;
     1.8  		private IBBToolStripMenuItem miAbout;
     1.9  
    1.10  
    1.11 @@ -291,6 +292,7 @@
    1.12              this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
    1.13              this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
    1.14              this.toolStripPanel = new System.Windows.Forms.ToolStripPanel();
    1.15 +            this.miExportArmyAsBasicXml = new System.Windows.Forms.ToolStripMenuItem();
    1.16              this.menuStrip.SuspendLayout();
    1.17              this.mainToolStrip.SuspendLayout();
    1.18              ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit();
    1.19 @@ -328,20 +330,20 @@
    1.20              this.toolStripSeparator2,
    1.21              this.miExit});
    1.22              this.menuFile.Name = "menuFile";
    1.23 -            this.menuFile.Size = new System.Drawing.Size(33, 20);
    1.24 +            this.menuFile.Size = new System.Drawing.Size(35, 20);
    1.25              this.menuFile.Text = "&file";
    1.26              // 
    1.27              // miNewArmy
    1.28              // 
    1.29              this.miNewArmy.Name = "miNewArmy";
    1.30 -            this.miNewArmy.Size = new System.Drawing.Size(164, 22);
    1.31 +            this.miNewArmy.Size = new System.Drawing.Size(160, 22);
    1.32              this.miNewArmy.Text = "&new army";
    1.33              this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click);
    1.34              // 
    1.35              // miOpenArmy
    1.36              // 
    1.37              this.miOpenArmy.Name = "miOpenArmy";
    1.38 -            this.miOpenArmy.Size = new System.Drawing.Size(164, 22);
    1.39 +            this.miOpenArmy.Size = new System.Drawing.Size(160, 22);
    1.40              this.miOpenArmy.Text = "&open army";
    1.41              this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click);
    1.42              // 
    1.43 @@ -349,7 +351,7 @@
    1.44              // 
    1.45              this.miSaveArmy.Enabled = false;
    1.46              this.miSaveArmy.Name = "miSaveArmy";
    1.47 -            this.miSaveArmy.Size = new System.Drawing.Size(164, 22);
    1.48 +            this.miSaveArmy.Size = new System.Drawing.Size(160, 22);
    1.49              this.miSaveArmy.Text = "&save army";
    1.50              this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click);
    1.51              // 
    1.52 @@ -357,23 +359,24 @@
    1.53              // 
    1.54              this.miSaveArmyAs.Enabled = false;
    1.55              this.miSaveArmyAs.Name = "miSaveArmyAs";
    1.56 -            this.miSaveArmyAs.Size = new System.Drawing.Size(164, 22);
    1.57 +            this.miSaveArmyAs.Size = new System.Drawing.Size(160, 22);
    1.58              this.miSaveArmyAs.Text = "save army &as...";
    1.59              this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click);
    1.60              // 
    1.61              // miExportArmyAs
    1.62              // 
    1.63              this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
    1.64 -            this.miExportArmyAsBasicHTML});
    1.65 +            this.miExportArmyAsBasicHTML,
    1.66 +            this.miExportArmyAsBasicXml});
    1.67              this.miExportArmyAs.Enabled = false;
    1.68              this.miExportArmyAs.Name = "miExportArmyAs";
    1.69 -            this.miExportArmyAs.Size = new System.Drawing.Size(164, 22);
    1.70 +            this.miExportArmyAs.Size = new System.Drawing.Size(160, 22);
    1.71              this.miExportArmyAs.Text = "export army as...";
    1.72              // 
    1.73              // miExportArmyAsBasicHTML
    1.74              // 
    1.75              this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML";
    1.76 -            this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(130, 22);
    1.77 +            this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(152, 22);
    1.78              this.miExportArmyAsBasicHTML.Text = "&basic html";
    1.79              this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click);
    1.80              // 
    1.81 @@ -381,31 +384,31 @@
    1.82              // 
    1.83              this.miCloseArmy.Enabled = false;
    1.84              this.miCloseArmy.Name = "miCloseArmy";
    1.85 -            this.miCloseArmy.Size = new System.Drawing.Size(164, 22);
    1.86 +            this.miCloseArmy.Size = new System.Drawing.Size(160, 22);
    1.87              this.miCloseArmy.Text = "&close army";
    1.88              this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click);
    1.89              // 
    1.90              // toolStripSeparator1
    1.91              // 
    1.92              this.toolStripSeparator1.Name = "toolStripSeparator1";
    1.93 -            this.toolStripSeparator1.Size = new System.Drawing.Size(161, 6);
    1.94 +            this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
    1.95              // 
    1.96              // miReloadFiles
    1.97              // 
    1.98              this.miReloadFiles.Name = "miReloadFiles";
    1.99 -            this.miReloadFiles.Size = new System.Drawing.Size(164, 22);
   1.100 +            this.miReloadFiles.Size = new System.Drawing.Size(160, 22);
   1.101              this.miReloadFiles.Text = "&reload files";
   1.102              this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click);
   1.103              // 
   1.104              // toolStripSeparator2
   1.105              // 
   1.106              this.toolStripSeparator2.Name = "toolStripSeparator2";
   1.107 -            this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6);
   1.108 +            this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6);
   1.109              // 
   1.110              // miExit
   1.111              // 
   1.112              this.miExit.Name = "miExit";
   1.113 -            this.miExit.Size = new System.Drawing.Size(164, 22);
   1.114 +            this.miExit.Size = new System.Drawing.Size(160, 22);
   1.115              this.miExit.Text = "e&xit";
   1.116              this.miExit.Click += new System.EventHandler(this.miExit_Click);
   1.117              // 
   1.118 @@ -417,14 +420,14 @@
   1.119              this.toolStripSeparator4,
   1.120              this.miPreferences});
   1.121              this.menuEdit.Name = "menuEdit";
   1.122 -            this.menuEdit.Size = new System.Drawing.Size(36, 20);
   1.123 +            this.menuEdit.Size = new System.Drawing.Size(39, 20);
   1.124              this.menuEdit.Text = "&edit";
   1.125              // 
   1.126              // miUndo
   1.127              // 
   1.128              this.miUndo.Enabled = false;
   1.129              this.miUndo.Name = "miUndo";
   1.130 -            this.miUndo.Size = new System.Drawing.Size(142, 22);
   1.131 +            this.miUndo.Size = new System.Drawing.Size(135, 22);
   1.132              this.miUndo.Text = "&undo";
   1.133              this.miUndo.Click += new System.EventHandler(this.miUndo_Click);
   1.134              // 
   1.135 @@ -432,19 +435,19 @@
   1.136              // 
   1.137              this.miRedo.Enabled = false;
   1.138              this.miRedo.Name = "miRedo";
   1.139 -            this.miRedo.Size = new System.Drawing.Size(142, 22);
   1.140 +            this.miRedo.Size = new System.Drawing.Size(135, 22);
   1.141              this.miRedo.Text = "&redo";
   1.142              this.miRedo.Click += new System.EventHandler(this.miRedo_Click);
   1.143              // 
   1.144              // toolStripSeparator4
   1.145              // 
   1.146              this.toolStripSeparator4.Name = "toolStripSeparator4";
   1.147 -            this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6);
   1.148 +            this.toolStripSeparator4.Size = new System.Drawing.Size(132, 6);
   1.149              // 
   1.150              // miPreferences
   1.151              // 
   1.152              this.miPreferences.Name = "miPreferences";
   1.153 -            this.miPreferences.Size = new System.Drawing.Size(142, 22);
   1.154 +            this.miPreferences.Size = new System.Drawing.Size(135, 22);
   1.155              this.miPreferences.Text = "&preferences";
   1.156              this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click);
   1.157              // 
   1.158 @@ -453,13 +456,13 @@
   1.159              this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.160              this.miAbout});
   1.161              this.menuHelp.Name = "menuHelp";
   1.162 -            this.menuHelp.Size = new System.Drawing.Size(39, 20);
   1.163 +            this.menuHelp.Size = new System.Drawing.Size(42, 20);
   1.164              this.menuHelp.Text = "&help";
   1.165              // 
   1.166              // miAbout
   1.167              // 
   1.168              this.miAbout.Name = "miAbout";
   1.169 -            this.miAbout.Size = new System.Drawing.Size(109, 22);
   1.170 +            this.miAbout.Size = new System.Drawing.Size(105, 22);
   1.171              this.miAbout.Text = "&about";
   1.172              this.miAbout.Click += new System.EventHandler(this.miAbout_Click);
   1.173              // 
   1.174 @@ -475,7 +478,7 @@
   1.175              this.bttnRedo});
   1.176              this.mainToolStrip.Location = new System.Drawing.Point(0, 24);
   1.177              this.mainToolStrip.Name = "mainToolStrip";
   1.178 -            this.mainToolStrip.Size = new System.Drawing.Size(182, 25);
   1.179 +            this.mainToolStrip.Size = new System.Drawing.Size(151, 25);
   1.180              this.mainToolStrip.TabIndex = 8;
   1.181              // 
   1.182              // bttnNewArmy
   1.183 @@ -556,8 +559,8 @@
   1.184              this.statusBar.ShowPanels = true;
   1.185              this.statusBar.Size = new System.Drawing.Size(790, 22);
   1.186              this.statusBar.TabIndex = 1;
   1.187 +            this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem);
   1.188              this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick);
   1.189 -            this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem);
   1.190              // 
   1.191              // sbMainPanel
   1.192              // 
   1.193 @@ -591,6 +594,13 @@
   1.194              this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
   1.195              this.toolStripPanel.Size = new System.Drawing.Size(790, 0);
   1.196              // 
   1.197 +            // miExportArmyAsBasicXml
   1.198 +            // 
   1.199 +            this.miExportArmyAsBasicXml.Name = "miExportArmyAsBasicXml";
   1.200 +            this.miExportArmyAsBasicXml.Size = new System.Drawing.Size(152, 22);
   1.201 +            this.miExportArmyAsBasicXml.Text = "basic xm&l";
   1.202 +            this.miExportArmyAsBasicXml.Click += new System.EventHandler(this.miExportArmyAsBasicXml_Click);
   1.203 +            // 
   1.204              // FrmMain
   1.205              // 
   1.206              this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.207 @@ -1421,5 +1431,22 @@
   1.208  			FrmPreferences prefsForm = new FrmPreferences(Preferences);
   1.209  			prefsForm.Show(this);
   1.210  		}
   1.211 +
   1.212 +        private void miExportArmyAsBasicXml_Click(object sender, EventArgs e)
   1.213 +        {
   1.214 +            SaveFileDialog dialog = new SaveFileDialog();
   1.215 +            dialog.Filter = Translation.GetTranslation("armyExportBasicXmlFilter", "XML pages") + "|*.xml";
   1.216 +            dialog.Title = Translation.GetTranslation("exportArmyDialog", "Export army");
   1.217 +
   1.218 +            DialogResult dr = dialog.ShowDialog(this);
   1.219 +
   1.220 +            if (dr == DialogResult.OK)
   1.221 +            {
   1.222 +                Army army = CurrentArmy;
   1.223 +                string filePath = dialog.FileName;
   1.224 +                log.DebugFormat("Exporting {0} to {1} as basic XML", army.Name, filePath);
   1.225 +                WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(army, filePath);
   1.226 +            }
   1.227 +        }
   1.228  	}
   1.229  }
     2.1 --- a/FrmMain.resx	Sun Aug 14 01:29:18 2011 +0000
     2.2 +++ b/FrmMain.resx	Sun Aug 14 14:38:06 2011 -0600
     2.3 @@ -112,36 +112,36 @@
     2.4      <value>2.0</value>
     2.5    </resheader>
     2.6    <resheader name="reader">
     2.7 -    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     2.8 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     2.9    </resheader>
    2.10    <resheader name="writer">
    2.11 -    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    2.12 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    2.13    </resheader>
    2.14 -  <metadata name="undoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.15 +  <metadata name="undoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.16      <value>17, 17</value>
    2.17    </metadata>
    2.18 -  <metadata name="redoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.19 +  <metadata name="redoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.20      <value>122, 17</value>
    2.21    </metadata>
    2.22 -  <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.23 +  <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.24      <value>334, 17</value>
    2.25    </metadata>
    2.26 -  <metadata name="openArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.27 +  <metadata name="openArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.28      <value>438, 17</value>
    2.29    </metadata>
    2.30 -  <metadata name="saveArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.31 +  <metadata name="saveArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.32      <value>573, 17</value>
    2.33    </metadata>
    2.34 -  <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.35 +  <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.36      <value>835, 17</value>
    2.37    </metadata>
    2.38 -  <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.39 +  <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.40      <value>17, 54</value>
    2.41    </metadata>
    2.42 -  <metadata name="catToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.43 +  <metadata name="catToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    2.44      <value>138, 54</value>
    2.45    </metadata>
    2.46 -  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    2.47 +  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    2.48    <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    2.49      <value>
    2.50          AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAA
     3.1 --- a/translations/en.translation	Sun Aug 14 01:29:18 2011 +0000
     3.2 +++ b/translations/en.translation	Sun Aug 14 14:38:06 2011 -0600
     3.3 @@ -9,6 +9,7 @@
     3.4  	<translation id="miSaveArmyAs">Save army &amp;as...</translation>
     3.5  	<translation id="miExportArmyAs">&amp;Export army</translation>
     3.6  	<translation id="miExportArmyAsBasicHTML">Basic HTML</translation>
     3.7 +  <translation id="miExportArmyAsBasicXml">Basic XML</translation>
     3.8  	<translation id="miCloseArmy">&amp;Close army</translation>
     3.9  	<translation id="miReloadFiles">&amp;Reload files</translation>
    3.10  	<translation id="miExit">E&amp;xit</translation>