f-spot r3921 - in trunk/extensions: . CDExport
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r3921 - in trunk/extensions: . CDExport
- Date: Fri, 16 May 2008 19:56:56 +0100 (BST)
Author: sdelcroix
Date: Fri May 16 18:56:55 2008
New Revision: 3921
URL: http://svn.gnome.org/viewvc/f-spot?rev=3921&view=rev
Log:
2008-05-16 Stephane Delcroix <sdelcroix novell com>
* CDExport/*: fix the Clean, implement a quick file browser for
the gio version.
Modified:
trunk/extensions/CDExport/CDExport.addin.xml
trunk/extensions/CDExport/CDExport.cs
trunk/extensions/CDExport/CDExport.glade
trunk/extensions/CDExport/Makefile.am
trunk/extensions/ChangeLog
Modified: trunk/extensions/CDExport/CDExport.addin.xml
==============================================================================
--- trunk/extensions/CDExport/CDExport.addin.xml (original)
+++ trunk/extensions/CDExport/CDExport.addin.xml Fri May 16 18:56:55 2008
@@ -1,5 +1,5 @@
<Addin namespace="FSpot"
- version="0.4.3.4"
+ version="0.4.3.5"
name="CD Export"
description="This extension allows you to burn your photos to CD."
author="F-Spot team"
Modified: trunk/extensions/CDExport/CDExport.cs
==============================================================================
--- trunk/extensions/CDExport/CDExport.cs (original)
+++ trunk/extensions/CDExport/CDExport.cs Fri May 16 18:56:55 2008
@@ -19,8 +19,10 @@
[Glade.Widget] Gtk.CheckButton remove_check;
[Glade.Widget] Gtk.CheckButton rotate_check;
[Glade.Widget] Gtk.Label size_label;
+ [Glade.Widget] Gtk.Frame previous_frame;
#if GIO_2_16
+ Gtk.Window listwindow;
System.Uri dest = new System.Uri ("burn:///");
#else
Gnome.Vfs.Uri dest = new Gnome.Vfs.Uri ("burn:///");
@@ -73,6 +75,7 @@
thumb_scrolledwindow.Add (view);
Dialog.ShowAll ();
+ previous_frame.Visible = IsEmpty (dest);
//LoadHistory ();
Dialog.Response += HandleResponse;
@@ -80,9 +83,37 @@
void HandleBrowseExisting (object sender, System.EventArgs args)
{
+#if GIO_2_16
+ if (listwindow == null) {
+ listwindow = new Gtk.Window ("Pending files to write");
+ listwindow.SetDefaultSize (400, 200);
+ listwindow.DeleteEvent += delegate (object o, Gtk.DeleteEventArgs e) {(o as Gtk.Window).Destroy (); listwindow = null;};
+ Gtk.TextView view = new Gtk.TextView ();
+ Gtk.TextBuffer buffer = view.Buffer;
+ Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
+ sw.Add (view);
+ listwindow.Add (sw);
+ } else {
+ ((listwindow.Child as Gtk.ScrolledWindow).Child as Gtk.TextView).Buffer.Text = "";
+ }
+ ListAll (((listwindow.Child as Gtk.ScrolledWindow).Child as Gtk.TextView).Buffer, dest);
+ listwindow.ShowAll ();
+#else
GnomeUtil.UrlShow (null, dest.ToString ());
+#endif
}
+#if GIO_2_16
+ void ListAll (Gtk.TextBuffer t, System.Uri path)
+ {
+ GLib.File f = FileFactory.NewForUri (path);
+ foreach (GLib.FileInfo info in f.EnumerateChildren ("*", FileQueryInfoFlags.None, null)) {
+ t.Text += new System.Uri (path, info.Name).ToString () + Environment.NewLine;
+ if (info.FileType == FileType.Directory)
+ ListAll (t, new System.Uri (path, info.Name + "/"));
+ }
+ }
+#endif
[DllImport ("libc")]
extern static int system (string program);
@@ -122,7 +153,7 @@
GLib.File source = FileFactory.NewForUri (path);
foreach (GLib.FileInfo info in source.EnumerateChildren ("*", FileQueryInfoFlags.None, null)) {
if (info.FileType == FileType.Directory)
- Clean (new System.Uri(path, info.Name));
+ Clean (new System.Uri(path, info.Name + "/"));
FileFactory.NewForUri (new System.Uri (path, info.Name)).Delete ();
}
}
@@ -135,6 +166,20 @@
}
#endif
+#if GIO_2_16
+ bool IsEmpty (System.Uri path)
+ {
+ foreach (GLib.FileInfo fi in FileFactory.NewForUri (path).EnumerateChildren ("*", FileQueryInfoFlags.None, null))
+ return true;
+ return false;
+ }
+#else
+ bool IsEmpty (Gnome.Vfs.Uri path)
+ {
+ return Gnome.Vfs.Directory.GetEntries (path).Length != 0;
+ }
+#endif
+
public void Transfer () {
try {
#if GIO_2_16
@@ -280,6 +325,10 @@
private void HandleResponse (object sender, Gtk.ResponseArgs args)
{
+#if GIO_2_16
+ if (listwindow != null)
+ listwindow.Destroy ();
+#endif
if (args.ResponseId != Gtk.ResponseType.Ok) {
Dialog.Destroy ();
return;
Modified: trunk/extensions/CDExport/CDExport.glade
==============================================================================
--- trunk/extensions/CDExport/CDExport.glade (original)
+++ trunk/extensions/CDExport/CDExport.glade Fri May 16 18:56:55 2008
@@ -2,8 +2,6 @@
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--*- mode: xml -*-->
<glade-interface>
- <requires lib="canvas"/>
- <requires lib="gnome"/>
<widget class="GtkDialog" id="cd_export_dialog">
<property name="visible">True</property>
<property name="title" translatable="yes">Create CD</property>
@@ -18,7 +16,6 @@
<child>
<widget class="GtkFrame" id="frame33">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment37">
@@ -42,44 +39,63 @@
</widget>
</child>
<child>
- <widget class="GtkHBox" id="hbox39">
+ <widget class="GtkFrame" id="previous_frame">
<property name="visible">True</property>
- <property name="spacing">12</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
- <widget class="GtkCheckButton" id="remove_check">
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Write only these photos to CD</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkCheckButton" id="remove_check">
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Write only these photos to CD</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="browse_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Browse Previously Scheduled Files</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="HandleBrowseExisting"/>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
<child>
- <widget class="GtkButton" id="browes_button">
+ <widget class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Browse Previously Scheduled Files</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="HandleBrowseExisting"/>
+ <property name="label" translatable="yes"><b><i>There is some previously scheduled items to write</i></b></property>
+ <property name="use_markup">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="type">label_item</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -89,7 +105,6 @@
<property name="can_focus">True</property>
<property name="label" translatable="yes">Autorotate</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
Modified: trunk/extensions/CDExport/Makefile.am
==============================================================================
--- trunk/extensions/CDExport/Makefile.am (original)
+++ trunk/extensions/CDExport/Makefile.am Fri May 16 18:56:55 2008
@@ -31,7 +31,7 @@
mpack: $(PLUGIN_ASSEMBLY)
mautil p $(PLUGIN_ASSEMBLY)
-$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST)
+$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST) $(PLUGIN_NAME).glade
$(CSC_LIB) -out:$@ $(CSC_DEFINES) $(PLUGIN_SOURCES) $(REFS) $(PKGS) $(ASSEMBLIES) $(RESOURCES)
plugindir = $(pkglibdir)/extensions
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]