Author: lluis
Date: 2007-12-01 12:21:34 -0500 (Sat, 01 Dec 2007)
New Revision: 90514
Added:
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/gui.stetic
Log:
* MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
Run the translation update in a background thread.
* MonoDevelop.Gettext/GettextTool.cs: New command line tool for
updating translation projects.
* gtk-gui/gui.stetic,
gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
Updated.
Modified: trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog 2007-12-01
17:18:47 UTC (rev 90513)
+++ trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog 2007-12-01
17:21:34 UTC (rev 90514)
@@ -1,3 +1,17 @@
+2007-12-01 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
Run the
+ translation update in a background thread.
+ * MonoDevelop.Gettext/GettextTool.cs: New command line tool for updating
+ translation projects.
+ * gtk-gui/gui.stetic,
+ gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
+ gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
+ gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
+ gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
+ gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
+ Updated.
+
2007-11-22 Mike Krüger <[EMAIL PROTECTED]>
* MonoDevelop.Gettext.Editor/POEditorWidget.cs,
Added:
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -0,0 +1,149 @@
+// GettextTool.cs
+//
+// Author:
+// Lluis Sanchez Gual <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using MonoDevelop.Core.ProgressMonitoring;
+
+namespace MonoDevelop.Gettext
+{
+ public class GettextTool: IApplication
+ {
+ bool help;
+ string file;
+ string project;
+
+ public int Run (string[] arguments)
+ {
+ Console.WriteLine ("MonoDevelop Gettext Update Tool");
+ foreach (string s in arguments)
+ ReadArgument (s);
+
+ if (help) {
+ Console.WriteLine ("gettext-update [options]
[project-file]");
+ Console.WriteLine ("--f --file:FILE Project
or solution file to build.");
+ Console.WriteLine ("--p --project:PROJECT Name
of the project to build.");
+ Console.WriteLine ();
+ return 0;
+ }
+
+ Gnome.Vfs.Vfs.Initialize ();
+
+ if (file == null) {
+ string[] files = Directory.GetFiles (".",
"*.mds");
+ if (files.Length == 0) {
+ Console.WriteLine ("Solution file not
found.");
+ return 1;
+ }
+ file = files [0];
+ }
+
+ ConsoleProgressMonitor monitor = new
ConsoleProgressMonitor ();
+ monitor.IgnoreLogMessages = true;
+
+ CombineEntry centry =
Services.ProjectService.ReadCombineEntry (file, monitor);
+ monitor.IgnoreLogMessages = false;
+
+ Combine combine = centry as Combine;
+ if (combine == null) {
+ Console.WriteLine ("File is not a solution: " +
file);
+ return 1;
+ }
+
+ if (project != null) {
+ centry = combine.FindProject (project);
+
+ if (centry == null) {
+ Console.WriteLine ("The project '" +
project + "' could not be found in " + file);
+ return 1;
+ }
+ TranslationProject tp = centry as
TranslationProject;
+ if (tp == null) {
+ Console.WriteLine ("The project '" +
centry.FileName + "' is not a translation project");
+ return 1;
+ }
+ tp.UpdateTranslations (monitor);
+ }
+ else {
+ foreach (TranslationProject p in
combine.GetAllEntries (typeof(TranslationProject)))
+ p.UpdateTranslations (monitor);
+ }
+
+ return 0;
+ }
+
+ void ReadArgument (string argument)
+ {
+ string optionValuePair;
+
+ if (argument.StartsWith("--")) {
+ optionValuePair = argument.Substring(2);
+ }
+ else if (argument.StartsWith("/") ||
argument.StartsWith("-")) {
+ optionValuePair = argument.Substring(1);
+ } else
+ return;
+
+ string option;
+ string value;
+
+ int indexOfEquals = optionValuePair.IndexOf(':');
+ if (indexOfEquals > 0) {
+ option = optionValuePair.Substring(0,
indexOfEquals);
+ value = optionValuePair.Substring(indexOfEquals
+ 1);
+ }
+ else {
+ option = optionValuePair;
+ value = null;
+ }
+
+ switch (option)
+ {
+ case "f":
+ case "file":
+ file = value;
+ break;
+
+ case "help":
+ case "?":
+ help = true;
+ break;
+
+ case "p":
+ case "project":
+ project = value;
+ break;
+
+ default:
+ throw new Exception("Unknown option '" +
option + "'");
+ }
+ }
+ }
+}
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -189,7 +189,9 @@
try {
project.UpdateTranslations (monitor);
- POEditorWidget.ReloadWidgets ();
+ Gtk.Application.Invoke (delegate {
+ POEditorWidget.ReloadWidgets ();
+ });
} catch (Exception ex) {
monitor.ReportError ("Translation
update failed.", ex);
} finally {
@@ -205,7 +207,7 @@
return;
IProgressMonitor monitor =
IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
currentUpdateTranslationOperation =
monitor.AsyncOperation;
- DispatchService.GuiDispatch (new
StatefulMessageHandler (UpdateTranslationsAsync), new object[] {monitor,
project});
+ DispatchService.BackgroundDispatch (new
StatefulMessageHandler (UpdateTranslationsAsync), new object[] {monitor,
project});
}
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -246,6 +246,8 @@
w13.RightAttach = ((uint)(2));
w13.YOptions = ((Gtk.AttachOptions)(4));
this.notebook1.Add(this.table1);
+ Gtk.Notebook.NotebookChild w14 =
((Gtk.Notebook.NotebookChild)(this.notebook1[this.table1]));
+ w14.TabExpand = false;
// Notebook tab
this.label3 = new Gtk.Label();
this.label3.Name = "label3";
@@ -410,6 +412,7 @@
this.notebook1.Add(this.table2);
Gtk.Notebook.NotebookChild w28 =
((Gtk.Notebook.NotebookChild)(this.notebook1[this.table2]));
w28.Position = 1;
+ w28.TabExpand = false;
// Notebook tab
this.label2 = new Gtk.Label();
this.label2.Name = "label2";
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -63,6 +63,7 @@
this.frame1 = new Gtk.Frame();
this.frame1.Name = "frame1";
this.frame1.ShadowType = ((Gtk.ShadowType)(1));
+ this.frame1.LabelXalign = 0F;
// Container child frame1.Gtk.Container+ContainerChild
this.treeviewTranslations = new Gtk.TreeView();
this.treeviewTranslations.WidthRequest = 200;
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -299,6 +299,8 @@
Gtk.Box.BoxChild w25 =
((Gtk.Box.BoxChild)(this.vbox7[this.vpaned2]));
w25.Position = 0;
this.notebookPages.Add(this.vbox7);
+ Gtk.Notebook.NotebookChild w26 =
((Gtk.Notebook.NotebookChild)(this.notebookPages[this.vbox7]));
+ w26.TabExpand = false;
// Notebook tab
this.label5 = new Gtk.Label();
this.label5.Name = "label5";
@@ -318,6 +320,7 @@
this.toolbarPages.Name = "toolbarPages";
this.toolbarPages.ShowArrow = false;
this.toolbarPages.ToolbarStyle = ((Gtk.ToolbarStyle)(0));
+ this.toolbarPages.IconSize = ((Gtk.IconSize)(3));
this.hbox1.Add(this.toolbarPages);
Gtk.Box.BoxChild w28 =
((Gtk.Box.BoxChild)(this.hbox1[this.toolbarPages]));
w28.Position = 0;
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -124,6 +124,7 @@
this.frame1 = new Gtk.Frame();
this.frame1.Name = "frame1";
this.frame1.ShadowType = ((Gtk.ShadowType)(0));
+ this.frame1.LabelXalign = 0F;
// Container child frame1.Gtk.Container+ContainerChild
this.GtkAlignment2 = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment2.Name = "GtkAlignment2";
@@ -195,6 +196,7 @@
this.frame2 = new Gtk.Frame();
this.frame2.Name = "frame2";
this.frame2.ShadowType = ((Gtk.ShadowType)(0));
+ this.frame2.LabelXalign = 0F;
// Container child frame2.Gtk.Container+ContainerChild
this.GtkAlignment3 = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment3.Name = "GtkAlignment3";
@@ -217,6 +219,7 @@
this.frame3 = new Gtk.Frame();
this.frame3.Name = "frame3";
this.frame3.ShadowType = ((Gtk.ShadowType)(1));
+ this.frame3.LabelXalign = 0F;
// Container child frame3.Gtk.Container+ContainerChild
this.GtkAlignment4 = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment4.Name = "GtkAlignment4";
@@ -246,6 +249,8 @@
w18.Expand = false;
w18.Fill = false;
this.notebook1.Add(this.vbox2);
+ Gtk.Notebook.NotebookChild w19 =
((Gtk.Notebook.NotebookChild)(this.notebook1[this.vbox2]));
+ w19.TabExpand = false;
// Notebook tab
this.label1 = new Gtk.Label();
this.label1.Name = "label1";
@@ -269,6 +274,7 @@
this.notebook1.Add(this.scrolledwindow1);
Gtk.Notebook.NotebookChild w21 =
((Gtk.Notebook.NotebookChild)(this.notebook1[this.scrolledwindow1]));
w21.Position = 1;
+ w21.TabExpand = false;
// Notebook tab
this.label2 = new Gtk.Label();
this.label2.Name = "label2";
@@ -323,6 +329,7 @@
}
this.DefaultWidth = 519;
this.DefaultHeight = 426;
+ this.folderentrySystemPath.Hide();
this.Show();
}
}
Modified:
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs
===================================================================
---
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs
2007-12-01 17:18:47 UTC (rev 90513)
+++
trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs
2007-12-01 17:21:34 UTC (rev 90514)
@@ -92,6 +92,7 @@
this.frame1 = new Gtk.Frame();
this.frame1.Name = "frame1";
this.frame1.ShadowType = ((Gtk.ShadowType)(0));
+ this.frame1.LabelXalign = 0F;
// Container child frame1.Gtk.Container+ContainerChild
this.GtkAlignment2 = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment2.Name = "GtkAlignment2";
@@ -193,6 +194,7 @@
this.frame2 = new Gtk.Frame();
this.frame2.Name = "frame2";
this.frame2.ShadowType = ((Gtk.ShadowType)(0));
+ this.frame2.LabelXalign = 0F;
// Container child frame2.Gtk.Container+ContainerChild
this.GtkAlignment3 = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment3.Name = "GtkAlignment3";
Modified: trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/gui.stetic
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/gui.stetic
2007-12-01 17:18:47 UTC (rev 90513)
+++ trunk/monodevelop/Extras/MonoDevelop.Gettext/gtk-gui/gui.stetic
2007-12-01 17:21:34 UTC (rev 90514)
@@ -2,7 +2,7 @@
<stetic-interface>
<configuration>
<images-root-path>..</images-root-path>
- <target-gtk-version>2.10.2</target-gtk-version>
+ <target-gtk-version>2.8.3</target-gtk-version>
</configuration>
<import>
<widget-library name="../../../build/bin/MonoDevelop.Projects.Gui.dll" />
@@ -296,6 +296,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="TabExpand">False</property>
+ </packing>
</child>
<child>
<widget class="Gtk.Label" id="label3">
@@ -584,6 +587,7 @@
</widget>
<packing>
<property name="Position">1</property>
+ <property name="TabExpand">False</property>
</packing>
</child>
<child>
@@ -631,6 +635,7 @@
<widget class="Gtk.Frame" id="frame1">
<property name="MemberName" />
<property name="ShadowType">None</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.Alignment" id="GtkAlignment2">
<property name="MemberName" />
@@ -750,7 +755,6 @@
<widget class="Gtk.RadioButton" id="radiobuttonKnown">
<property name="MemberName" />
<property name="Label" translatable="yes">_Known
Language</property>
- <property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
@@ -770,6 +774,7 @@
<widget class="Gtk.Frame" id="frame2">
<property name="MemberName" />
<property name="ShadowType">None</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.Alignment" id="GtkAlignment3">
<property name="MemberName" />
@@ -968,6 +973,7 @@
<widget class="Gtk.Frame" id="frame1">
<property name="MemberName" />
<property name="ShadowType">None</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.Alignment" id="GtkAlignment2">
<property name="MemberName" />
@@ -1004,6 +1010,7 @@
<child>
<widget
class="MonoDevelop.Components.FolderEntry" id="folderentrySystemPath">
<property name="MemberName" />
+ <property name="Visible">False</property>
</widget>
<packing>
<property name="TopAttach">1</property>
@@ -1093,6 +1100,7 @@
<widget class="Gtk.Frame" id="frame2">
<property name="MemberName" />
<property name="ShadowType">None</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.Alignment" id="GtkAlignment3">
<property name="MemberName" />
@@ -1120,6 +1128,7 @@
<widget class="Gtk.Frame" id="frame3">
<property name="MemberName" />
<property name="ShadowType">In</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.Alignment"
id="GtkAlignment4">
<property name="MemberName" />
@@ -1166,6 +1175,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="TabExpand">False</property>
+ </packing>
</child>
<child>
<widget class="Gtk.Label" id="label1">
@@ -1194,6 +1206,7 @@
</widget>
<packing>
<property name="Position">1</property>
+ <property name="TabExpand">False</property>
</packing>
</child>
<child>
@@ -1585,6 +1598,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="TabExpand">False</property>
+ </packing>
</child>
<child>
<widget class="Gtk.Label" id="label5">
@@ -1610,6 +1626,7 @@
<property name="MemberName" />
<property name="ShowArrow">False</property>
<property name="ButtonStyle">Icons</property>
+ <property name="IconSize">LargeToolbar</property>
<node name="toolbarPages" type="Toolbar" />
</widget>
<packing>
@@ -1669,6 +1686,7 @@
<widget class="Gtk.Frame" id="frame1">
<property name="MemberName" />
<property name="ShadowType">In</property>
+ <property name="LabelXalign">0</property>
<child>
<widget class="Gtk.TreeView" id="treeviewTranslations">
<property name="MemberName" />
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches