[mistelix] Bug fixes + warning on DVD project needs
- From: Jordi Mas <jmas src gnome org>
- To: svn-commits-list gnome org
- Subject: [mistelix] Bug fixes + warning on DVD project needs
- Date: Mon, 11 May 2009 09:02:30 -0400 (EDT)
commit cb46660d0975d13d6f24fdc9379129fec17223f5
Author: Jordi Mas <jmas softcatala org>
Date: Mon May 11 15:02:22 2009 +0200
Bug fixes + warning on DVD project needs
---
src/backends/DvdAuthor.cs | 17 +++++++++++------
src/backends/Spumux.cs | 15 ++++++++++-----
src/mistelix.cs | 30 +++++++++++++++++++++++++++++-
src/mistelix.glade | 1 +
src/widgets/AuthoringPaneView.cs | 4 ++--
5 files changed, 53 insertions(+), 14 deletions(-)
diff --git a/src/backends/DvdAuthor.cs b/src/backends/DvdAuthor.cs
index cac123e..71c767a 100644
--- a/src/backends/DvdAuthor.cs
+++ b/src/backends/DvdAuthor.cs
@@ -27,6 +27,7 @@ using System.Text;
using System.IO;
using Mistelix.DataModel;
+using Mistelix.Core;
namespace Mistelix.Backends
{
@@ -56,12 +57,16 @@ namespace Mistelix.Backends
sb.Append ("</dvdauthor>\n");
-
- using (FileStream fs = File.Create (project.FileToFullPath (Defines.DVDAUTHOR_FILE)))
- {
- StreamWriter sw = new StreamWriter (fs);
- sw.Write (sb.ToString ());
- sw.Close ();
+ try {
+ using (FileStream fs = File.Create (project.FileToFullPath (Defines.DVDAUTHOR_FILE)))
+ {
+ StreamWriter sw = new StreamWriter (fs);
+ sw.Write (sb.ToString ());
+ sw.Close ();
+ }
+ }
+ catch (IOException e) {
+ Logger.Error ("DvdAuthor.Create. Error accessing file {0}", project.FileToFullPath (Defines.DVDAUTHOR_FILE));
}
}
diff --git a/src/backends/Spumux.cs b/src/backends/Spumux.cs
index 3c66702..09b1976 100644
--- a/src/backends/Spumux.cs
+++ b/src/backends/Spumux.cs
@@ -65,11 +65,16 @@ namespace Mistelix.Backends
sb.Append (" </stream> \n");
sb.Append ("</subpictures> \n");
- using (FileStream fs = File.Create (project.FileToFullPath (Defines.SPUMUX_FILE)))
- {
- StreamWriter sw = new StreamWriter (fs);
- sw.Write (sb.ToString ());
- sw.Close ();
+ try {
+ using (FileStream fs = File.Create (project.FileToFullPath (Defines.SPUMUX_FILE)))
+ {
+ StreamWriter sw = new StreamWriter (fs);
+ sw.Write (sb.ToString ());
+ sw.Close ();
+ }
+ }
+ catch (IOException e) {
+ Logger.Error ("Spumux.Create. Error accessing file {0}", project.FileToFullPath (Defines.SPUMUX_FILE));
}
}
diff --git a/src/mistelix.cs b/src/mistelix.cs
index 656610a..014d661 100644
--- a/src/mistelix.cs
+++ b/src/mistelix.cs
@@ -301,7 +301,35 @@ namespace Mistelix
dependencies_dialog.Dependencies = dependencies;
dependencies_dialog.Run ();
return;
- }
+ }
+
+ if (project.Details.Type == ProjectType.DVD) {
+ if (project.Buttons.Count == 0) {
+ String msg;
+
+ msg = Catalog.GetString ("A DVD project needs at least one button item. You can create a button by dragging a project element into the main DVD menu area.");
+ MessageDialog md = new MessageDialog (app_window,
+ DialogFlags.Modal, MessageType.Warning,
+ ButtonsType.Ok, msg);
+
+ md.Run ();
+ md.Destroy ();
+ return;
+ }
+ if (project.Details.Theme == null) {
+ String msg;
+
+ msg = Catalog.GetString ("A DVD project needs a theme. Use the 'Select DVD Menu Theme' to select a theme.");
+ MessageDialog md = new MessageDialog (app_window,
+ DialogFlags.Modal, MessageType.Warning,
+ ButtonsType.Ok, msg);
+
+ md.Run ();
+ md.Destroy ();
+ return;
+
+ }
+ }
BuildProjectDialog build_dialog = new BuildProjectDialog (project);
build_dialog.Run ();
diff --git a/src/mistelix.glade b/src/mistelix.glade
index c54b01c..2c672f3 100644
--- a/src/mistelix.glade
+++ b/src/mistelix.glade
@@ -237,6 +237,7 @@
<property name="label" translatable="yes">Build...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnBuildProject" last_modification_time="Fri, 10 Oct 2008 18:38:09 GMT"/>
+ <accelerator key="F5" modifiers="0" signal="activate"/>
</widget>
</child>
</widget>
diff --git a/src/widgets/AuthoringPaneView.cs b/src/widgets/AuthoringPaneView.cs
index 789fe83..f28f6a6 100644
--- a/src/widgets/AuthoringPaneView.cs
+++ b/src/widgets/AuthoringPaneView.cs
@@ -181,10 +181,10 @@ namespace Mistelix.Widgets
}
else {
if (project.Buttons.Count == 0)
- DrawText (args.Window, cr, Catalog.GetString ("Drag elements here to add them to the project"));
+ DrawText (args.Window, cr, Catalog.GetString ("Drag elements here to add them to the main DVD menu"));
}
} else {
- DrawText (args.Window, cr, Catalog.GetString ("Start a new project or load an existant one"));
+ DrawText (args.Window, cr, Catalog.GetString ("Start a new project or load an existing one"));
}
if (project != null && safearea)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]