[mistelix] Better destination folder reporting + open it from the build dialog
- From: Jordi Mas <jmas src gnome org>
- To: svn-commits-list gnome org
- Subject: [mistelix] Better destination folder reporting + open it from the build dialog
- Date: Mon, 27 Jul 2009 11:32:44 +0000 (UTC)
commit e86ac8a31b854b0aebbb1ba747f569b11a599670
Author: Jordi Mas <jmas softcatala org>
Date: Mon Jul 27 13:32:41 2009 +0200
Better destination folder reporting + open it from the build dialog
src/Core/DvdProjectBuilder.cs | 6 +-
src/Core/SlideShowsProjectBuilder.cs | 4 +-
src/DataModel/ProjectBuilder.cs | 10 ++
src/Dialogs/BuildProjectDialog.cs | 10 ++-
src/mistelix.glade | 170 ++++++++++++++++++++++++++++++++--
5 files changed, 183 insertions(+), 17 deletions(-)
---
diff --git a/src/Core/DvdProjectBuilder.cs b/src/Core/DvdProjectBuilder.cs
index 4981cad..d811bd4 100644
--- a/src/Core/DvdProjectBuilder.cs
+++ b/src/Core/DvdProjectBuilder.cs
@@ -153,10 +153,6 @@ namespace Mistelix.Core
null,
null,
Mistelix.Debugging ? project.FileToFullPath ("dvd_author_output.txt") : null);
-
- TimeSpan time = DateTime.Now - start_time;
- total.Text = String.Format (Catalog.GetString ("Completed. Time used: {0}"), TimeSpanToStr (time)) + "\n";
- total_handler (this, total);
// Delete temporary files
sp.Destroy ();
@@ -168,6 +164,8 @@ namespace Mistelix.Core
File.Delete (file);
}
}
+
+ OnCreateCompleted (start_time);
Logger.Debug ("DvdProjectBuilder.Create. Thread finished");
}
diff --git a/src/Core/SlideShowsProjectBuilder.cs b/src/Core/SlideShowsProjectBuilder.cs
index 817a707..d271a45 100644
--- a/src/Core/SlideShowsProjectBuilder.cs
+++ b/src/Core/SlideShowsProjectBuilder.cs
@@ -93,9 +93,7 @@ namespace Mistelix.Core
slideshow.Generate (project, OnProgressTaskLocal);
}
- TimeSpan time = DateTime.Now - start_time;
- total.Text = String.Format (Catalog.GetString ("Completed. Time used: {0}"), TimeSpanToStr (time)) + "\n";
- total_handler (this, total);
+ OnCreateCompleted (start_time);
Logger.Debug ("SlideShowsProjectBuilder.Create thread finished");
}
diff --git a/src/DataModel/ProjectBuilder.cs b/src/DataModel/ProjectBuilder.cs
index ec84a57..650f4e2 100644
--- a/src/DataModel/ProjectBuilder.cs
+++ b/src/DataModel/ProjectBuilder.cs
@@ -46,6 +46,16 @@ namespace Mistelix.DataModel
public abstract void Create ();
+ protected void OnCreateCompleted (DateTime start_time)
+ {
+ TimeSpan time = DateTime.Now - start_time;
+ total.Text = String.Format (Catalog.GetString ("Completed. Time used: {0}"), TimeSpanToStr (time)) + "\n";
+ total_handler (this, total);
+
+ total.Text = String.Format (Catalog.GetString ("Destination folder: {0}"), project.Details.OutputDir) + "\n";
+ total_handler (this, total);
+ }
+
public static void EnsureOutputDir (string dir)
{
DirectoryInfo directory = new DirectoryInfo (dir);
diff --git a/src/Dialogs/BuildProjectDialog.cs b/src/Dialogs/BuildProjectDialog.cs
index bd4bd7b..5d062b4 100644
--- a/src/Dialogs/BuildProjectDialog.cs
+++ b/src/Dialogs/BuildProjectDialog.cs
@@ -28,6 +28,7 @@ using Mono.Unix;
using System.Collections;
using System.Threading;
using System.Collections.Generic;
+using System.Diagnostics;
using Mistelix.Widgets;
using Mistelix.DataModel;
@@ -47,7 +48,7 @@ namespace Mistelix.Dialogs
[Glade.Widget] Gtk.ProgressBar total_bar;
[Glade.Widget] Gtk.TextView status_text;
[Glade.Widget] Gtk.TextView textview;
- [Glade.Widget] Gtk.Button generate;
+ [Glade.Widget] Gtk.Button generate_button;
[Glade.Widget] Gtk.Label totalprogress_label;
[Glade.Widget] Gtk.TextBuffer buffer;
Gdk.Color color;
@@ -104,7 +105,7 @@ namespace Mistelix.Dialogs
Logger.Debug ("BuildProjectDialog.OnGenerate");
- generate.Sensitive = false;
+ generate_button.Sensitive = false;
if (project.Details.Type == ProjectType.DVD)
builder = new DvdProjectBuilder (project, OnProgressTotal, OnProgressTask);
@@ -115,5 +116,10 @@ namespace Mistelix.Dialogs
thread = new Thread (threadDelegate);
thread.Start ();
}
+
+ void OnOpenFolder (object sender, EventArgs args)
+ {
+ Process.Start (project.Details.OutputDir);
+ }
}
}
diff --git a/src/mistelix.glade b/src/mistelix.glade
index 2f0a6c3..6800327 100644
--- a/src/mistelix.glade
+++ b/src/mistelix.glade
@@ -1959,13 +1959,94 @@
</child>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox">
+ <widget class="GtkHBox" id="hbutton_box">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
- <widget class="GtkButton" id="button2">
+ <widget class="GtkButton" id="generate_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="OnGenerate" last_modification_time="Sat, 06 Dec 2008 17:28:30 GMT"/>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox28">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image43">
+ <property name="visible">True</property>
+ <property name="stock">gtk-execute</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label70">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Generate</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="close_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@@ -1975,25 +2056,98 @@
<property name="focus_on_click">True</property>
<signal name="clicked" handler="OnCancel" last_modification_time="Sat, 06 Dec 2008 17:31:27 GMT"/>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="generate">
+ <widget class="GtkButton" id="folder_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_Generate</property>
- <property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- <signal name="clicked" handler="OnGenerate" last_modification_time="Sat, 06 Dec 2008 17:28:30 GMT"/>
+ <signal name="clicked" handler="OnOpenFolder" last_modification_time="Sat, 06 Dec 2008 17:28:30 GMT"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox29">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image44">
+ <property name="visible">True</property>
+ <property name="stock">gtk-open</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label71">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Open Destination Folder</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
</packing>
</child>
</widget>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]