f-spot r3597 - in trunk: . Tests/src Tests/src/Query extensions extensions/GalleryExport src src/Query
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r3597 - in trunk: . Tests/src Tests/src/Query extensions extensions/GalleryExport src src/Query
- Date: Fri, 25 Jan 2008 14:23:02 +0000 (GMT)
Author: sdelcroix
Date: Fri Jan 25 14:23:01 2008
New Revision: 3597
URL: http://svn.gnome.org/viewvc/f-spot?rev=3597&view=rev
Log:
2008-01-25 Stephane Delcroix <sdelcroix novell com
* src/Query/LogicalTerm.cs: fixes to pass the tests
2008-01-25 Lorenzo Milesi <maxxer yetopen it>
* configure.in:
* src/Preferences.cs:
* src/f-spot.glade:
* src/Gallery*: moved Gallery export as a standalone extension
Added:
trunk/extensions/GalleryExport/GalleryExport.cs
trunk/extensions/GalleryExport/GalleryExport.glade
trunk/extensions/GalleryExport/GalleryRemote.cs
Removed:
trunk/src/GalleryExport.cs
trunk/src/GalleryRemote.cs
Modified:
trunk/ChangeLog
trunk/Tests/src/ChangeLog
trunk/Tests/src/Makefile
trunk/Tests/src/Query/LogicalTerm.cs
trunk/extensions/ChangeLog
trunk/extensions/GalleryExport/GalleryExport.addin.xml
trunk/extensions/GalleryExport/Makefile.am
trunk/extensions/Makefile.am
trunk/src/Preferences.cs
trunk/src/Query/LogicalTerm.cs
trunk/src/f-spot.glade
Modified: trunk/Tests/src/Makefile
==============================================================================
--- trunk/Tests/src/Makefile (original)
+++ trunk/Tests/src/Makefile Fri Jan 25 14:23:01 2008
@@ -15,6 +15,7 @@
REFS = \
-r:../../src/f-spot.exe \
+ -r:../../src/FSpot.Core.dll \
-r:../../semweb/SemWeb.dll
Modified: trunk/Tests/src/Query/LogicalTerm.cs
==============================================================================
--- trunk/Tests/src/Query/LogicalTerm.cs (original)
+++ trunk/Tests/src/Query/LogicalTerm.cs Fri Jan 25 14:23:01 2008
@@ -24,11 +24,13 @@
object [] tests = {
" (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id = 1)) ", tt1,
" (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id IN (2, 3))) ", new OrTerm (tt2, tt3),
- " photos.tag_id IN (3, 4, 5) ", new OrTerm (tt3, tt4, tt5),
+ " (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id IN (3, 4, 5))) ", new OrTerm (tt3, tt4, tt5),
};
for (int i=0; i < tests.Length; i+=2) {
+ //System.Console.WriteLine ((tests[i+1] as LogicalTerm).SqlClause ());
+ //System.Console.WriteLine (tests[i]);
Assert.AreEqual (tests[i] as string, (tests[i+1] as LogicalTerm).SqlClause ());
}
}
Modified: trunk/extensions/GalleryExport/GalleryExport.addin.xml
==============================================================================
--- trunk/extensions/GalleryExport/GalleryExport.addin.xml (original)
+++ trunk/extensions/GalleryExport/GalleryExport.addin.xml Fri Jan 25 14:23:01 2008
@@ -1,7 +1,7 @@
<Addin namespace="FSpot"
- version="1.0"
+ version="1.0.1"
name="Gallery Export"
- description="This extension allows you to export your photos to Gallery."
+ description="This extension allows you to export your photos to PHP Gallery (http://gallery.menalto.com)."
author="F-Spot team"
url="http://f-spot.org"
defaultEnabled="true"
@@ -12,6 +12,6 @@
</Dependencies>
<Extension path = "/FSpot/Menus/Exports">
- <ExportMenuItem id="Gallery" _label = "Web _Gallery..." class = "FSpot.GalleryExport" />
+ <ExportMenuItem id="Gallery" _label = "Web _Gallery..." class = "G2Export.GalleryExport" />
</Extension>
</Addin>
Added: trunk/extensions/GalleryExport/GalleryExport.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/GalleryExport/GalleryExport.cs Fri Jan 25 14:23:01 2008
@@ -0,0 +1,965 @@
+using System;
+using System.Net;
+using System.IO;
+using System.Text;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Web;
+using Mono.Unix;
+
+using FSpot;
+using FSpot.Filters;
+using FSpot.Widgets;
+using FSpot.Utils;
+using FSpot.UI.Dialog;
+using FSpot.Extensions;
+
+using GalleryRemote;
+
+namespace G2Export {
+ public class GalleryAccount {
+ public GalleryAccount (string name, string url, string username, string password) : this (name, url, username, password, GalleryVersion.VersionUnknown) {}
+ public GalleryAccount (string name, string url, string username, string password, GalleryVersion version)
+ {
+ this.name = name;
+ this.username = username;
+ this.password = password;
+ this.Url = url;
+
+ if (version != GalleryVersion.VersionUnknown) {
+ this.version = version;
+ } else {
+ this.version = Gallery.DetectGalleryVersion(Url);
+ }
+ }
+
+ public Gallery Connect ()
+ {
+ //System.Console.WriteLine ("GalleryAccount.Connect()");
+
+ Gallery gal = null;
+
+ if (version == GalleryVersion.VersionUnknown)
+ this.version = Gallery.DetectGalleryVersion(Url);
+
+ if (version == GalleryVersion.Version1) {
+ gal = new Gallery1 (url, url);
+ } else if (version == GalleryVersion.Version2) {
+ gal = new Gallery2 (url, url);
+ } else {
+ throw new Exception ("Cannot connect to a Gallery for which the version is unknown");
+ }
+
+ System.Console.WriteLine ("Gallery created: " + gal);
+
+ gal.Login (username, password);
+
+ gallery = gal;
+ connected = true;
+
+ return gallery;
+ }
+
+ GalleryVersion version;
+ public GalleryVersion Version{
+ get {
+ return version;
+ }
+ }
+
+ private bool connected;
+ public bool Connected {
+ get {
+ bool retVal = false;
+ if(gallery != null) {
+ retVal = gallery.IsConnected ();
+ }
+ if (connected != retVal) {
+ System.Console.WriteLine ("Connected and retVal for IsConnected() don't agree");
+ }
+ return retVal;
+ }
+ }
+
+ public void MarkChanged ()
+ {
+ connected = false;
+ gallery = null;
+ }
+
+ Gallery gallery;
+ public Gallery Gallery {
+ get {
+ return gallery;
+ }
+ }
+
+ string name;
+ public string Name {
+ get {
+ return name;
+ }
+ set {
+ name = value;
+ }
+ }
+
+ string url;
+ public string Url {
+ get {
+ return url;
+ }
+ set {
+ if (url != value) {
+ url = value;
+ MarkChanged ();
+ }
+ }
+ }
+
+ string username;
+ public string Username {
+ get {
+ return username;
+ }
+ set {
+ if (username != value) {
+ username = value;
+ MarkChanged ();
+ }
+ }
+ }
+
+ string password;
+ public string Password {
+ get {
+ return password;
+ }
+ set {
+ if (password != value) {
+ password = value;
+ MarkChanged ();
+ }
+ }
+ }
+ }
+
+
+ public class GalleryAccountManager
+ {
+ private static GalleryAccountManager instance;
+ string xml_path;
+ ArrayList accounts;
+
+ public delegate void AccountListChangedHandler (GalleryAccountManager manager, GalleryAccount changed_account);
+ public event AccountListChangedHandler AccountListChanged;
+
+ public static GalleryAccountManager GetInstance ()
+ {
+ if (instance == null) {
+ instance = new GalleryAccountManager ();
+ }
+
+ return instance;
+ }
+
+ private GalleryAccountManager ()
+ {
+ // FIXME this xml file path should be be retrieved from a central location not hard coded there
+ this.xml_path = System.IO.Path.Combine (FSpot.Global.BaseDirectory, "Accounts.xml");
+
+ accounts = new ArrayList ();
+ ReadAccounts ();
+ }
+
+ public void MarkChanged ()
+ {
+ MarkChanged (true, null);
+ }
+
+ public void MarkChanged (bool write, GalleryAccount changed_account)
+ {
+ if (write)
+ WriteAccounts ();
+
+ if (AccountListChanged != null)
+ AccountListChanged (this, changed_account);
+ }
+
+ public ArrayList GetAccounts ()
+ {
+ return accounts;
+ }
+
+ public void AddAccount (GalleryAccount account)
+ {
+ AddAccount (account, true);
+ }
+
+ public void AddAccount (GalleryAccount account, bool write)
+ {
+ accounts.Add (account);
+ MarkChanged (write, account);
+ }
+
+ public void RemoveAccount (GalleryAccount account)
+ {
+ accounts.Remove (account);
+ MarkChanged ();
+ }
+
+ public void WriteAccounts ()
+ {
+ System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter (xml_path, System.Text.Encoding.Default);
+
+ writer.Formatting = System.Xml.Formatting.Indented;
+ writer.Indentation = 2;
+ writer.IndentChar = ' ';
+
+ writer.WriteStartDocument (true);
+
+ writer.WriteStartElement ("GalleryRemote");
+ foreach (GalleryAccount account in accounts) {
+ writer.WriteStartElement ("Account");
+ writer.WriteElementString ("Name", account.Name);
+
+ writer.WriteElementString ("Url", account.Url);
+ writer.WriteElementString ("Username", account.Username);
+ writer.WriteElementString ("Password", account.Password);
+ writer.WriteElementString ("Version", account.Version.ToString());
+ writer.WriteEndElement (); //Account
+ }
+ writer.WriteEndElement ();
+ writer.WriteEndDocument ();
+ writer.Close ();
+ }
+
+ private GalleryAccount ParseAccount (System.Xml.XmlNode node)
+ {
+ if (node.Name != "Account")
+
+ return null;
+
+ string name = null;
+ string url = null;
+ string username = null;
+ string password = null;
+ GalleryVersion version = GalleryVersion.VersionUnknown;
+
+ foreach (System.Xml.XmlNode child in node.ChildNodes) {
+ if (child.Name == "Name") {
+ name = child.ChildNodes [0].Value;
+
+ } else if (child.Name == "Url") {
+ url = child.ChildNodes [0].Value;
+ } else if (child.Name == "Password") {
+ password = child.ChildNodes [0].Value;
+ } else if (child.Name == "Username") {
+ username = child.ChildNodes [0].Value;
+ } else if (child.Name == "Version") {
+ string versionString = child.ChildNodes [0].Value;
+ if (versionString == "Version1")
+ version = GalleryVersion.Version1;
+ else if (versionString == "Version2")
+ version = GalleryVersion.Version2;
+ else
+ Console.WriteLine ("Unexpected versions string: " + versionString);
+ }
+ }
+ return new GalleryAccount (name, url, username, password, version);
+ }
+
+ private void ReadAccounts ()
+ {
+
+ if (! File.Exists (xml_path)) {
+ MarkChanged ();
+ return;
+ }
+
+ try {
+ string query = "//GalleryRemote/Account";
+ System.Xml.XmlDocument doc = new System.Xml.XmlDocument ();
+
+ //System.Console.WriteLine ("xml_path: " + xml_path);
+ doc.Load (xml_path);
+ System.Xml.XmlNodeList nodes = doc.SelectNodes (query);
+
+ //System.Console.WriteLine ("selected {0} nodes match {1}", nodes.Count, query);
+ foreach (System.Xml.XmlNode node in nodes) {
+ GalleryAccount account = ParseAccount (node);
+ if (account != null)
+ AddAccount (account, false);
+
+ }
+ } catch (System.Exception e) {
+ // FIXME do something
+ System.Console.WriteLine ("Exception loading gallery accounts");
+ System.Console.WriteLine (e);
+ }
+
+ MarkChanged ();
+ }
+ }
+
+ public class AccountDialog {
+ public AccountDialog (Gtk.Window parent) : this (parent, null, false) {
+ add_dialog.Response += HandleAddResponse;
+ add_button.Sensitive = false;
+ }
+
+ public AccountDialog (Gtk.Window parent, GalleryAccount account, bool show_error)
+ {
+ Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_dialog", "f-spot");
+ xml.Autoconnect (this);
+ add_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_dialog");
+ add_dialog.Modal = false;
+ add_dialog.TransientFor = parent;
+ add_dialog.DefaultResponse = Gtk.ResponseType.Ok;
+
+ this.account = account;
+
+ status_area.Visible = show_error;
+
+ if (account != null) {
+ gallery_entry.Text = account.Name;
+ url_entry.Text = account.Url;
+ password_entry.Text = account.Password;
+ username_entry.Text = account.Username;
+ add_button.Label = Gtk.Stock.Ok;
+ add_dialog.Response += HandleEditResponse;
+ }
+
+ if (remove_button != null)
+ remove_button.Visible = account != null;
+
+ add_dialog.Show ();
+
+ gallery_entry.Changed += HandleChanged;
+ url_entry.Changed += HandleChanged;
+ password_entry.Changed += HandleChanged;
+ username_entry.Changed += HandleChanged;
+ HandleChanged (null, null);
+ }
+
+ private void HandleChanged (object sender, System.EventArgs args)
+ {
+ name = gallery_entry.Text;
+ url = url_entry.Text;
+ password = password_entry.Text;
+ username = username_entry.Text;
+
+ if (name == String.Empty || url == String.Empty || password == String.Empty || username == String.Empty)
+ add_button.Sensitive = false;
+ else
+ add_button.Sensitive = true;
+
+ }
+
+ [GLib.ConnectBefore]
+ protected void HandleAddResponse (object sender, Gtk.ResponseArgs args)
+ {
+ if (args.ResponseId == Gtk.ResponseType.Ok) {
+ try {
+ Uri uri = new Uri (url);
+ if (uri.Scheme != Uri.UriSchemeHttp &&
+ uri.Scheme != Uri.UriSchemeHttps)
+ throw new System.UriFormatException ();
+
+ GalleryAccount created = new GalleryAccount (name,
+ url,
+ username,
+ password);
+
+ created.Connect ();
+ GalleryAccountManager.GetInstance ().AddAccount (created);
+ account = created;
+ } catch (System.UriFormatException) {
+
+ HigMessageDialog md =
+ new HigMessageDialog (add_dialog,
+ Gtk.DialogFlags.Modal |
+ Gtk.DialogFlags.DestroyWithParent,
+ Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
+ Catalog.GetString ("Invalid URL"),
+ Catalog.GetString ("The gallery URL entry does not appear to be a valid URL"));
+ md.Run ();
+ md.Destroy ();
+ return;
+ } catch (GalleryRemote.GalleryException e) {
+ HigMessageDialog md =
+ new HigMessageDialog (add_dialog,
+ Gtk.DialogFlags.Modal |
+ Gtk.DialogFlags.DestroyWithParent,
+ Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
+ Catalog.GetString ("Error while connecting to Gallery"),
+ String.Format (Catalog.GetString ("The following error was encountered while attempting to log in: {0}"), e.Message));
+ if (e.ResponseText != null) {
+ System.Console.WriteLine (e.Message);
+ System.Console.WriteLine (e.ResponseText);
+ }
+ md.Run ();
+ md.Destroy ();
+ return;
+ } catch (System.Net.WebException we) {
+ HigMessageDialog md =
+ new HigMessageDialog (add_dialog,
+ Gtk.DialogFlags.Modal |
+ Gtk.DialogFlags.DestroyWithParent,
+ Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
+ Catalog.GetString ("Error while connecting to Gallery"),
+ String.Format (Catalog.GetString ("The following error was encountered while attempting to log in: {0}"), we.Message));
+ md.Run ();
+ md.Destroy ();
+ return;
+ }
+ }
+ add_dialog.Destroy ();
+ }
+
+ protected void HandleEditResponse (object sender, Gtk.ResponseArgs args)
+ {
+ if (args.ResponseId == Gtk.ResponseType.Ok) {
+ account.Name = name;
+ account.Url = url;
+ account.Username = username;
+ account.Password = password;
+ GalleryAccountManager.GetInstance ().MarkChanged (true, account);
+ } else if (args.ResponseId == Gtk.ResponseType.Reject) {
+ // NOTE we are using Reject to signal the remove action.
+ GalleryAccountManager.GetInstance ().RemoveAccount (account);
+ }
+ add_dialog.Destroy ();
+ }
+
+ private GalleryAccount account;
+ private string name;
+ private string url;
+ private string password;
+ private string username;
+
+ // widgets
+ [Glade.Widget] Gtk.Dialog add_dialog;
+
+ [Glade.Widget] Gtk.Entry url_entry;
+ [Glade.Widget] Gtk.Entry password_entry;
+ [Glade.Widget] Gtk.Entry gallery_entry;
+ [Glade.Widget] Gtk.Entry username_entry;
+
+ [Glade.Widget] Gtk.Button add_button;
+ [Glade.Widget] Gtk.Button remove_button;
+ [Glade.Widget] Gtk.Button cancel_button;
+
+ [Glade.Widget] Gtk.HBox status_area;
+ }
+
+ public class GalleryAddAlbum
+ {
+ [Glade.Widget] Gtk.Dialog add_album_dialog;
+ [Glade.Widget] Gtk.OptionMenu album_optionmenu;
+
+ [Glade.Widget] Gtk.Entry name_entry;
+ [Glade.Widget] Gtk.Entry description_entry;
+ [Glade.Widget] Gtk.Entry title_entry;
+
+ [Glade.Widget] Gtk.Button add_button;
+ [Glade.Widget] Gtk.Button cancel_button;
+
+ private GalleryExport export;
+ private Gallery gallery;
+ private string parent;
+ private string name;
+ private string description;
+ private string title;
+
+ public GalleryAddAlbum (GalleryExport export, Gallery gallery)
+ {
+ Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
+ xml.Autoconnect (this);
+ add_album_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_album_dialog");
+ add_album_dialog.Modal = true;
+ this.export = export;
+ this.gallery = gallery;
+ PopulateAlbums ();
+
+ add_album_dialog.Response += HandleAddResponse;
+
+ name_entry.Changed += HandleChanged;
+ description_entry.Changed += HandleChanged;
+ title_entry.Changed += HandleChanged;
+ HandleChanged (null, null);
+ }
+
+ private void PopulateAlbums ()
+ {
+ Gtk.Menu menu = new Gtk.Menu ();
+ if (gallery.Version == GalleryVersion.Version1) {
+ Gtk.MenuItem top_item = new Gtk.MenuItem (Catalog.GetString ("(TopLevel)"));
+ menu.Append (top_item);
+ }
+
+ foreach (Album album in gallery.Albums) {
+ System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();
+
+ for (int i=0; i < album.Parents.Count; i++) {
+ label_builder.Append (" ");
+ }
+ label_builder.Append (album.Title);
+
+ Gtk.MenuItem item = new Gtk.MenuItem (label_builder.ToString ());
+ ((Gtk.Label)item.Child).UseUnderline = false;
+ menu.Append (item);
+
+ AlbumPermission create_sub = album.Perms & AlbumPermission.CreateSubAlbum;
+
+ if (create_sub == 0)
+ item.Sensitive = false;
+ }
+
+ album_optionmenu.Sensitive = true;
+ menu.ShowAll ();
+ album_optionmenu.Menu = menu;
+ }
+
+ private void HandleChanged (object sender, EventArgs args)
+ {
+ if (gallery.Version == GalleryVersion.Version1) {
+ if (gallery.Albums.Count == 0 || album_optionmenu.History <= 0) {
+ parent = String.Empty;
+ } else {
+ parent = ((Album) gallery.Albums [album_optionmenu.History-1]).Name;
+ }
+ } else {
+ if (gallery.Albums.Count == 0 || album_optionmenu.History < 0) {
+ parent = String.Empty;
+ } else {
+ parent = ((Album) gallery.Albums [album_optionmenu.History]).Name;
+ }
+ }
+ name = name_entry.Text;
+ description = description_entry.Text;
+ title = title_entry.Text;
+
+ if (name == String.Empty || title == String.Empty)
+ add_button.Sensitive = false;
+ else
+ add_button.Sensitive = true;
+ }
+
+ [GLib.ConnectBefore]
+ protected void HandleAddResponse (object sender, Gtk.ResponseArgs args)
+ {
+ if (args.ResponseId == Gtk.ResponseType.Ok) {
+ if (!System.Text.RegularExpressions.Regex.IsMatch (name, "^[A-Za-z0-9_-]+$")) {
+ HigMessageDialog md =
+ new HigMessageDialog (add_album_dialog,
+ Gtk.DialogFlags.Modal |
+ Gtk.DialogFlags.DestroyWithParent,
+ Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
+ Catalog.GetString ("Invalid Gallery name"),
+ Catalog.GetString ("The gallery name contains invalid characters.\nOnly letters, numbers, - and _ are allowed"));
+ md.Run ();
+ md.Destroy ();
+ return;
+ }
+ gallery.NewAlbum (parent, name, title, description);
+ export.HandleAlbumAdded (title);
+ }
+ add_album_dialog.Destroy ();
+ }
+ }
+
+
+ public class GalleryExport : IExporter {
+ public GalleryExport ()
+ {
+ }
+
+ public void Run (IBrowsableCollection selection)
+ {
+ Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_export_dialog", "f-spot");
+ xml.Autoconnect (this);
+ export_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_export_dialog");
+
+ this.items = selection.Items;
+ album_button.Sensitive = false;
+ IconView view = new IconView (selection);
+ view.DisplayDates = false;
+ view.DisplayTags = false;
+
+ export_dialog.Modal = false;
+ export_dialog.TransientFor = null;
+
+ thumb_scrolledwindow.Add (view);
+ view.Show ();
+ export_dialog.Show ();
+
+ GalleryAccountManager manager = GalleryAccountManager.GetInstance ();
+ manager.AccountListChanged += PopulateGalleryOptionMenu;
+ PopulateGalleryOptionMenu (manager, null);
+
+ if (edit_button != null)
+ edit_button.Clicked += HandleEditGallery;
+
+ export_dialog.Response += HandleResponse;
+ connect = true;
+ HandleSizeActive (null, null);
+ Connect ();
+
+ LoadPreference (SCALE_KEY);
+ LoadPreference (SIZE_KEY);
+ LoadPreference (BROWSER_KEY);
+ LoadPreference (META_KEY);
+ LoadPreference (ROTATE_KEY);
+ }
+
+ public const string EXPORT_SERVICE = "gallery/";
+ public const string SCALE_KEY = Preferences.APP_FSPOT_EXPORT + EXPORT_SERVICE + "scale";
+ public const string SIZE_KEY = Preferences.APP_FSPOT_EXPORT + EXPORT_SERVICE + "size";
+ public const string BROWSER_KEY = Preferences.APP_FSPOT_EXPORT + EXPORT_SERVICE + "browser";
+ public const string META_KEY = Preferences.APP_FSPOT_EXPORT + EXPORT_SERVICE + "meta";
+ public const string ROTATE_KEY = Preferences.APP_FSPOT_EXPORT + EXPORT_SERVICE + "rotate";
+
+ private bool scale;
+ private bool rotate;
+ private int size;
+ private bool browser;
+ private bool meta;
+ private bool connect = false;
+
+ IBrowsableItem[] items;
+ int photo_index;
+ FSpot.ThreadProgressDialog progress_dialog;
+
+ ArrayList accounts;
+ private GalleryAccount account;
+ private Album album;
+
+ private string xml_path;
+
+ // Widgets
+ [Glade.Widget] Gtk.Dialog export_dialog;
+ [Glade.Widget] Gtk.OptionMenu gallery_optionmenu;
+ [Glade.Widget] Gtk.OptionMenu album_optionmenu;
+
+ [Glade.Widget] Gtk.Entry width_entry;
+ [Glade.Widget] Gtk.Entry height_entry;
+
+ [Glade.Widget] Gtk.CheckButton browser_check;
+ [Glade.Widget] Gtk.CheckButton scale_check;
+ [Glade.Widget] Gtk.CheckButton meta_check;
+ [Glade.Widget] Gtk.CheckButton rotate_check;
+
+ [Glade.Widget] Gtk.SpinButton size_spin;
+
+ [Glade.Widget] Gtk.Button album_button;
+ [Glade.Widget] Gtk.Button add_button;
+ [Glade.Widget] Gtk.Button edit_button;
+
+ [Glade.Widget] Gtk.Button export_button;
+ [Glade.Widget] Gtk.Button cancel_button;
+
+ [Glade.Widget] Gtk.ScrolledWindow thumb_scrolledwindow;
+
+ System.Threading.Thread command_thread;
+
+
+ private void HandleResponse (object sender, Gtk.ResponseArgs args)
+ {
+ if (args.ResponseId != Gtk.ResponseType.Ok) {
+ export_dialog.Destroy ();
+ return;
+ }
+
+ if (scale_check != null) {
+ scale = scale_check.Active;
+ size = size_spin.ValueAsInt;
+ } else
+ scale = false;
+
+ browser = browser_check.Active;
+ meta = meta_check.Active;
+ rotate = rotate_check.Active;
+
+ if (account != null) {
+ //System.Console.WriteLine ("history = {0}", album_optionmenu.History);
+ album = (Album) account.Gallery.Albums [Math.Max (0, album_optionmenu.History)];
+ photo_index = 0;
+
+ export_dialog.Destroy ();
+
+ command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (this.Upload));
+ command_thread.Name = Catalog.GetString ("Uploading Pictures");
+
+ progress_dialog = new FSpot.ThreadProgressDialog (command_thread, items.Length);
+ progress_dialog.Start ();
+
+ // Save these settings for next time
+ Preferences.Set (SCALE_KEY, scale);
+ Preferences.Set (SIZE_KEY, size);
+ Preferences.Set (BROWSER_KEY, browser);
+ Preferences.Set (META_KEY, meta);
+ Preferences.Set (ROTATE_KEY, rotate);
+ }
+ }
+
+ private void HandleProgressChanged (ProgressItem item)
+ {
+ //System.Console.WriteLine ("Changed value = {0}", item.Value);
+ progress_dialog.Fraction = (photo_index - 1.0 + item.Value) / (double) items.Length;
+ }
+
+ public void HandleSizeActive (object sender, EventArgs args)
+ {
+ size_spin.Sensitive = scale_check.Active;
+ }
+
+
+ private void Upload ()
+ {
+ account.Gallery.Progress = new ProgressItem ();
+ account.Gallery.Progress.Changed += HandleProgressChanged;
+
+ System.Console.WriteLine ("Starting upload");
+
+ FilterSet filters = new FilterSet ();
+ if (account.Version == GalleryVersion.Version1)
+ filters.Add (new WhiteListFilter (new string []{".jpg", ".jpeg", ".png", ".gif"}));
+ if (scale)
+ filters.Add (new ResizeFilter ((uint) size));
+ else if (rotate)
+ filters.Add (new OrientationFilter ());
+
+
+ while (photo_index < items.Length) {
+ IBrowsableItem item = items [photo_index];
+
+ System.Console.WriteLine ("uploading {0}", photo_index);
+
+ progress_dialog.Message = System.String.Format (Catalog.GetString ("Uploading picture \"{0}\""), item.Name);
+ progress_dialog.Fraction = photo_index / (double) items.Length;
+ photo_index++;
+
+ progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} of {1}"), photo_index, items.Length);
+
+
+ FilterRequest req = new FilterRequest (item.DefaultVersionUri);
+
+ filters.Convert (req);
+ try {
+ int id = album.Add (item, req.Current.LocalPath);
+
+ if (item != null && item is Photo && Core.Database != null && id != 0) {
+ Core.Database.Exports.Create ((item as Photo).Id, (item as Photo).DefaultVersionId,
+ ExportStore.Gallery2ExportType,
+ String.Format("{0}:{1}",album.Gallery.Uri.ToString (), id.ToString ()));
+ }
+ } catch (System.Exception e) {
+ progress_dialog.Message = String.Format (Catalog.GetString ("Error uploading picture \"{0}\" to Gallery: {1}"), item.Name, e.Message);
+ progress_dialog.ProgressText = Catalog.GetString ("Error");
+
+ if (progress_dialog.PerformRetrySkip ()) {
+ photo_index--;
+ }
+ }
+ }
+
+ progress_dialog.Message = Catalog.GetString ("Done Sending Photos");
+ progress_dialog.Fraction = 1.0;
+ progress_dialog.ProgressText = Catalog.GetString ("Upload Complete");
+ progress_dialog.ButtonLabel = Gtk.Stock.Ok;
+
+ if (browser) {
+ GnomeUtil.UrlShow (null, album.GetUrl());
+ }
+ }
+
+ private void PopulateGalleryOptionMenu (GalleryAccountManager manager, GalleryAccount changed_account)
+ {
+ Gtk.Menu menu = new Gtk.Menu ();
+ this.account = changed_account;
+ int pos = -1;
+
+ accounts = manager.GetAccounts ();
+ if (accounts == null || accounts.Count == 0) {
+ Gtk.MenuItem item = new Gtk.MenuItem (Catalog.GetString ("(No Gallery)"));
+ menu.Append (item);
+ gallery_optionmenu.Sensitive = false;
+ edit_button.Sensitive = false;
+ } else {
+ int i = 0;
+ foreach (GalleryAccount account in accounts) {
+ if (account == changed_account)
+ pos = i;
+
+ Gtk.MenuItem item = new Gtk.MenuItem (account.Name);
+ menu.Append (item);
+ i++;
+ }
+ gallery_optionmenu.Sensitive = true;
+ edit_button.Sensitive = true;
+ }
+
+ menu.ShowAll ();
+ gallery_optionmenu.Menu = menu;
+ gallery_optionmenu.SetHistory ((uint)pos);
+ }
+
+ private void Connect ()
+ {
+ Connect (null);
+ }
+
+ private void Connect (GalleryAccount selected)
+ {
+ try {
+ if (accounts.Count != 0 && connect) {
+ if (selected == null)
+ account = (GalleryAccount) accounts [gallery_optionmenu.History];
+ else
+ account = selected;
+
+ if (!account.Connected)
+ account.Connect ();
+
+ PopulateAlbumOptionMenu (account.Gallery);
+ album_button.Sensitive = true;
+ }
+ } catch (System.Exception ex) {
+ if (selected != null)
+ account = selected;
+
+ System.Console.WriteLine ("{0}",ex);
+ PopulateAlbumOptionMenu (account.Gallery);
+ album_button.Sensitive = false;
+
+ new AccountDialog (export_dialog, account, true);
+ }
+ }
+
+ private void HandleAccountSelected (object sender, System.EventArgs args)
+ {
+ Connect ();
+ }
+
+ public void HandleAlbumAdded (string title) {
+ GalleryAccount account = (GalleryAccount) accounts [gallery_optionmenu.History];
+ PopulateAlbumOptionMenu (account.Gallery);
+
+ // make the newly created album selected
+ ArrayList albums = account.Gallery.Albums;
+ for (int i=0; i < albums.Count; i++) {
+ if (((Album)albums[i]).Title == title) {
+ album_optionmenu.SetHistory((uint)i);
+ }
+ }
+ }
+
+ private void PopulateAlbumOptionMenu (Gallery gallery)
+ {
+ System.Collections.ArrayList albums = null;
+ if (gallery != null) {
+ //gallery.FetchAlbumsPrune ();
+ gallery.FetchAlbums ();
+ albums = gallery.Albums;
+ }
+
+ Gtk.Menu menu = new Gtk.Menu ();
+
+ bool disconnected = gallery == null || !account.Connected || albums == null;
+
+ if (disconnected || albums.Count == 0) {
+ string msg = disconnected ? Catalog.GetString ("(Not Connected)")
+ : Catalog.GetString ("(No Albums)");
+
+ Gtk.MenuItem item = new Gtk.MenuItem (msg);
+ menu.Append (item);
+
+ export_button.Sensitive = false;
+ album_optionmenu.Sensitive = false;
+ album_button.Sensitive = false;
+
+ if (disconnected)
+ album_button.Sensitive = false;
+ } else {
+ foreach (Album album in albums) {
+ System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();
+
+ for (int i=0; i < album.Parents.Count; i++) {
+ label_builder.Append (" ");
+ }
+ label_builder.Append (album.Title);
+
+ Gtk.MenuItem item = new Gtk.MenuItem (label_builder.ToString ());
+ ((Gtk.Label)item.Child).UseUnderline = false;
+ menu.Append (item);
+
+ AlbumPermission add_permission = album.Perms & AlbumPermission.Add;
+
+ if (add_permission == 0)
+ item.Sensitive = false;
+ }
+
+ export_button.Sensitive = items.Length > 0;
+ album_optionmenu.Sensitive = true;
+ album_button.Sensitive = true;
+ }
+
+ menu.ShowAll ();
+ album_optionmenu.Menu = menu;
+ }
+
+ public void HandleAddGallery (object sender, System.EventArgs args)
+ {
+ new AccountDialog (export_dialog);
+ }
+
+ public void HandleEditGallery (object sender, System.EventArgs args)
+ {
+ new AccountDialog (export_dialog, account, false);
+ }
+
+ public void HandleAddAlbum (object sender, System.EventArgs args)
+ {
+ if (account == null)
+ throw new Exception (Catalog.GetString ("No account selected"));
+
+ new GalleryAddAlbum (this, account.Gallery);
+ }
+
+ void LoadPreference (string key)
+ {
+ object val = Preferences.Get (key);
+
+ if (val == null)
+ return;
+
+ //System.Console.WriteLine ("Setting {0} to {1}", key, val);
+
+ switch (key) {
+ case SCALE_KEY:
+ if (scale_check.Active != (bool) val)
+ scale_check.Active = (bool) val;
+ break;
+
+ case SIZE_KEY:
+ size_spin.Value = (double) (int) val;
+ break;
+
+ case BROWSER_KEY:
+ if (browser_check.Active != (bool) val)
+ browser_check.Active = (bool) val;
+ break;
+
+ case META_KEY:
+ if (meta_check.Active != (bool) val)
+ meta_check.Active = (bool) val;
+ break;
+ case ROTATE_KEY:
+ if (rotate_check.Active != (bool) val)
+ rotate_check.Active = (bool) val;
+ break;
+ }
+ }
+ }
+}
Added: trunk/extensions/GalleryExport/GalleryExport.glade
==============================================================================
--- (empty file)
+++ trunk/extensions/GalleryExport/GalleryExport.glade Fri Jan 25 14:23:01 2008
@@ -0,0 +1,1256 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+ <requires lib="canvas"/>
+ <requires lib="gnome"/>
+ <widget class="GtkDialog" id="gallery_export_dialog">
+ <property name="title" translatable="yes">Export</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox11">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox17">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <widget class="GtkFrame" id="frame8">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment12">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="thumb_scrolledwindow">
+ <property name="width_request">180</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="photo_frame">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Photos</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox11">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkFrame" id="frame9">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment13">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox12">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkHBox" id="hbox20">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="gallery_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Gallery:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">gallery_optionmenu</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkOptionMenu" id="gallery_optionmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="response_id">0</property>
+ <signal name="changed" handler="HandleAccountSelected"/>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="gallery_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="HandleAddGallery"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="edit_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-edit</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="status_label">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Gallery</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame10">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkHBox" id="hbox18">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="album_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Export to Album:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">album_optionmenu</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkOptionMenu" id="album_optionmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="album_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="HandleAddAlbum"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="browser_check">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Open _album in browser when done uploading</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label45">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Album</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame11">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment15">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox14">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkHBox" id="hbox58">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkCheckButton" id="scale_check">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Resize to: </property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="HandleSizeActive"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="size_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">400 0 10000 1 10 10</property>
+ <property name="climb_rate">1</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label153">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">pixels</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="rotate_check">
+ <property name="visible">True</property>
+ <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>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="meta_check">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Export _titles and comments</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label46">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Style</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area11">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="export_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">_Export</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="google_add_album_dialog">
+ <property name="visible">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox12">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">7</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="descroption_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Description:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">description_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="description_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="name_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Album Title:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">title_entry</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="title_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="public_check">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Public Album</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area12">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="gallery_add_album_dialog">
+ <property name="visible">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox12">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">7</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="gallery_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Parent Album:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">album_optionmenu</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="password_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Title:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">title_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="title_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="descroption_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Description:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">description_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="description_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="name_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Album Name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="name_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkOptionMenu" id="album_optionmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="response_id">0</property>
+ <signal name="changed" handler="HandleChanged"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area12">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="google_add_dialog">
+ <property name="visible">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox12">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox63">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkHBox" id="status_area">
+ <property name="border_width">12</property>
+ <child>
+ <widget class="GtkImage" id="image12">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="stock">gtk-dialog-question</property>
+ <property name="icon_size">6</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox64">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <widget class="GtkLabel" id="summary_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><span weight='bold' size='larger'>Error Connecting to Gallery</span>
+</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Please verify that the settings for this gallery are correct.</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="locked_area">
+ <property name="border_width">12</property>
+ <child>
+ <widget class="GtkImage" id="image45">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">6</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox84">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <widget class="GtkLabel" id="label214">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><span weight='bold' size='larger'>Your Google Account is locked</span>
+</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label215">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Please verify that the settings for this gallery are correct.
+Enter the letters as they are shown in the image in
+the 'Captcha' field. <i>Letters are not case-sensitive</i></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">7</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="password_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Password:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">password_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="password_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="username_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Username:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">username_entry</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="username_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="captcha_label">
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Captcha:</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox88">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkEntry" id="captcha_entry">
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImage" id="captcha_image">
+ <property name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area12">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-2</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="gallery_add_dialog">
+ <property name="visible">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox12">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox63">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkHBox" id="status_area">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <child>
+ <widget class="GtkImage" id="image12">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="stock">gtk-dialog-question</property>
+ <property name="icon_size">6</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox64">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <widget class="GtkLabel" id="summary_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><span weight='bold' size='larger'>Error Connecting to Gallery</span>
+</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Please verify that the settings for this gallery are correct.</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">7</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="gallery_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Gallery Name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">gallery_entry</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="gallery_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="password_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Password:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">password_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="password_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="username_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Username:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">username_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="username_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="url_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">U_RL:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">url_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="url_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area12">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-2</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
Added: trunk/extensions/GalleryExport/GalleryRemote.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/GalleryExport/GalleryRemote.cs Fri Jan 25 14:23:01 2008
@@ -0,0 +1,1146 @@
+using System;
+using System.Net;
+using System.IO;
+using System.Text;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Web;
+using Mono.Unix;
+using FSpot;
+
+/* These classes are based off the documentation at
+ *
+ * http://codex.gallery2.org/index.php/Gallery_Remote:Protocol
+ */
+
+namespace GalleryRemote {
+ public enum AlbumPermission : byte
+ {
+ None = 0,
+ Add = 1,
+ Write = 2,
+ Delete = 4,
+ DeleteAlbum = 8,
+ CreateSubAlbum = 16
+ }
+
+ public class Album : IComparable {
+ public int RefNum;
+ public string Name = null;
+ public string Title = null;
+ public string Summary = null;
+ public int ParentRefNum;
+ public int ResizeSize;
+ public int ThumbSize;
+ public ArrayList Images = null;
+ public string BaseURL;
+
+ Gallery gallery;
+
+ public AlbumPermission Perms = AlbumPermission.None;
+
+ public Album Parent {
+ get {
+ if (ParentRefNum != 0)
+ return gallery.LookupAlbum (ParentRefNum);
+ else
+ return null;
+ }
+ }
+
+ protected ArrayList parents = null;
+ public ArrayList Parents {
+ get {
+ if (parents != null)
+ return parents;
+
+ if (Parent == null) {
+ parents = new ArrayList ();
+ } else {
+ parents = Parent.Parents.Clone () as ArrayList;
+ parents.Add (Parent.RefNum);
+ }
+
+ return parents;
+ }
+ }
+
+ public Gallery Gallery {
+ get { return gallery; }
+ }
+
+ public Album (Gallery gallery, string name, int ref_num)
+ {
+ Name = name;
+ this.gallery = gallery;
+ this.RefNum = ref_num;
+ Images = new ArrayList ();
+ }
+
+ public void Rename (string name)
+ {
+ gallery.MoveAlbum (this, name);
+ }
+
+ public void Add (FSpot.IBrowsableItem item)
+ {
+ Add (item, item.DefaultVersionUri.LocalPath);
+ }
+
+ public int Add (FSpot.IBrowsableItem item, string path)
+ {
+ if (item == null)
+ Console.WriteLine ("NO PHOTO");
+
+ return gallery.AddItem (this,
+ path,
+ Path.GetFileName (item.DefaultVersionUri.LocalPath),
+ item.Description,
+ true);
+ }
+
+ public string GetUrl ()
+ {
+ return gallery.GetAlbumUrl(this);
+ }
+
+ public int CompareTo (Object obj)
+ {
+ Album other = obj as Album;
+
+ int numThis = this.Parents.Count;
+ int numOther = other.Parents.Count;
+ int thisVal = -1, otherVal = -1;
+
+ //find where they first differ
+ int maxIters = Math.Min (numThis, numOther);
+ int i = 0;
+ while (i < maxIters) {
+ thisVal = (int)this.Parents[i];
+ otherVal = (int)other.Parents[i];
+ if (thisVal != otherVal) {
+ break;
+ }
+ i++;
+ }
+
+ int retVal;
+ if (i < numThis && i < numOther) {
+ //Parentage differed
+ retVal = thisVal.CompareTo (otherVal);
+
+ } else if (i < numThis) {
+ //other shorter
+ thisVal = (int)this.Parents[i];
+ retVal = thisVal.CompareTo (other.RefNum);
+
+ //if equal, we want to make the shorter one come first
+ if (retVal == 0)
+ retVal = 1;
+
+ } else if (i < numOther) {
+ //this shorter
+ otherVal = (int)other.Parents[i];
+ retVal = this.RefNum.CompareTo (otherVal);
+
+ //if equal, we want to make the shorter one come first
+ if (retVal == 0)
+ retVal = -1;
+
+ } else {
+ //children of the same parent
+ retVal = this.RefNum.CompareTo (other.RefNum);
+ }
+
+ return retVal;
+ }
+ }
+
+ public class Image {
+ public string Name;
+ public int RawWidth;
+ public int RawHeight;
+ public string ResizedName;
+ public int ResizedWidth;
+ public int ResizedHeight;
+ public string ThumbName;
+ public int ThumbWidth;
+ public int ThumbHeight;
+ public int RawFilesize;
+
+ public string Caption;
+ public string Description;
+ public int Clicks;
+
+ public Album Owner;
+
+ public string Url;
+
+ public Image (Album album, string name) {
+ Name = name;
+ Owner = album;
+ }
+ }
+
+ public enum ResultCode {
+ Success = 0,
+ MajorVersionInvalid = 101,
+ MajorMinorVersionInvalid = 102,
+ VersionFormatInvalid = 103,
+ VersionMissing = 104,
+ PasswordWrong = 201,
+ LoginMisssing = 202,
+ UnknownComand = 301,
+ NoAddPermission = 401,
+ NoFilename = 402,
+ UploadPhotoFailed = 403,
+ NoWritePermission = 404,
+ NoCreateAlbumPermission = 501,
+ CreateAlbumFailed = 502,
+ // This result is specific to this implementation
+ UnknownResponse = 1000
+ }
+
+ public class GalleryException : System.Exception {
+ string response_text;
+
+ public string ResponseText {
+ get { return response_text; }
+ }
+
+ public GalleryException (string text) : base (text)
+ {
+ }
+
+ public GalleryException (string text, string full_response) : base (text)
+ {
+ response_text = full_response;
+ }
+ }
+
+ public class GalleryCommandException : GalleryException {
+ ResultCode status;
+
+ public GalleryCommandException (string status_text, ResultCode result) : base (status_text) {
+ status = result;
+ }
+
+ public ResultCode Status {
+ get {
+ return status;
+ }
+ }
+ }
+
+ public abstract class Gallery
+ {
+ protected Uri uri;
+ public Uri Uri{
+ get {
+ return uri;
+ }
+ }
+
+
+ protected string name;
+ public string Name {
+ get {
+ return name;
+ }
+ set {
+ name = value;
+ }
+ }
+
+ string auth_token;
+ public string AuthToken {
+ get {
+ return auth_token;
+ }
+ set {
+ auth_token = value;
+ }
+ }
+
+ protected GalleryVersion version;
+
+ public GalleryVersion Version {
+ get {
+ return version;
+ }
+ }
+
+ protected ArrayList albums;
+ public ArrayList Albums{
+ get {
+ return albums;
+ }
+ }
+
+ protected CookieContainer cookies = null;
+ public FSpot.ProgressItem Progress = null;
+
+ public abstract void Login (string username, string passwd);
+ public abstract ArrayList FetchAlbums ();
+ public abstract ArrayList FetchAlbumsPrune ();
+ public abstract bool MoveAlbum (Album album, string end_name);
+ public abstract int AddItem (Album album, string path, string filename, string caption, bool autorotate);
+ //public abstract Album AlbumProperties (string album);
+ public abstract bool NewAlbum (string parent_name, string name, string title, string description);
+ public abstract ArrayList FetchAlbumImages (Album album, bool include_ablums);
+
+ public abstract string GetAlbumUrl (Album album);
+
+ public Gallery (string name)
+ {
+ this.name = name;
+ cookies = new CookieContainer ();
+ albums = new ArrayList ();
+ }
+
+ public static GalleryVersion DetectGalleryVersion (string url)
+ {
+ //Figure out if the url is for G1 or G2
+ Console.WriteLine ("Detecting Gallery version");
+
+ GalleryVersion version;
+
+ if (url.EndsWith (Gallery1.script_name)) {
+ version = GalleryVersion.Version1;
+ } else if (url.EndsWith (Gallery2.script_name)) {
+ version = GalleryVersion.Version2;
+ } else {
+ //check what script is available on the server
+
+ FormClient client = new FormClient ();
+
+ try {
+ client.Submit (new Uri (Gallery.FixUrl (url, Gallery1.script_name)));
+ version = GalleryVersion.Version1;
+
+ } catch (System.Net.WebException) {
+ try {
+ client.Submit (new Uri (Gallery.FixUrl (url, Gallery2.script_name)));
+ version = GalleryVersion.Version2;
+
+ } catch (System.Net.WebException) {
+ //Uh oh, neither version detected
+ version = GalleryVersion.VersionUnknown;
+ }
+ }
+ }
+
+ Console.WriteLine ("Detected: " + version.ToString());
+ return version;
+ }
+
+
+ public bool IsConnected ()
+ {
+
+ bool retVal = true;
+ //Console.WriteLine ("^^^^^^^Checking IsConnected");
+ foreach (Cookie cookie in cookies.GetCookies(Uri)) {
+ bool isExpired = cookie.Expired;
+ //Console.WriteLine (cookie.Name + " " + (isExpired ? "expired" : "valid"));
+ if (isExpired)
+ retVal = false;
+ }
+ //return cookies.GetCookies(Uri).Count > 0;
+ return retVal;
+ }
+ //Reads until it finds the start of the response
+ protected StreamReader findResponse (HttpWebResponse response)
+ {
+ StreamReader reader = new StreamReader (response.GetResponseStream (), Encoding.UTF8);
+ if (reader == null)
+ throw new GalleryException (Catalog.GetString ("Error reading server response"));
+
+ string line;
+ string full_response = null;
+ while ((line = reader.ReadLine ()) != null) {
+ full_response += line;
+ if (line.IndexOf ("#__GR2PROTO__", 0) > -1)
+ break;
+ }
+
+ if (line == null) {
+ // failed to find the response
+ throw new GalleryException (Catalog.GetString ("Server returned response without Gallery content"), full_response);
+ }
+
+ return reader;
+
+ }
+
+ protected string [] GetNextLine (StreamReader reader)
+ {
+ char [] value_split = new char [1] {'='};
+ bool haveLine = false;
+ string[] array = null;
+ while(!haveLine) {
+ string line = reader.ReadLine ();
+ //Console.WriteLine ("READING: " + line);
+ if (line != null) {
+ array = line.Split (value_split, 2);
+ haveLine = !LineIgnored (array);
+ }
+ else {
+ //end of input
+ return null;
+ }
+ }
+
+ return array;
+ }
+
+ private bool LineIgnored (string[] line)
+ {
+ if (line[0].StartsWith ("debug")) {
+ return true;
+ } else if (line[0].StartsWith ("can_create_root")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected bool ParseLogin (HttpWebResponse response)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ try {
+
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("server_version")) {
+ //FIXME we should use the to determine what capabilities the server has
+ } else if (data[0].StartsWith ("auth_token")) {
+ AuthToken = data[1];
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseLogin(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ return true;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public ArrayList ParseFetchAlbums (HttpWebResponse response)
+ {
+ //Console.WriteLine ("in ParseFetchAlbums()");
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ albums = new ArrayList ();
+ try {
+
+ Album current_album = null;
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ //Console.WriteLine ("Parsing Line: {0}={1}", data[0], data[1]);
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("album.name")) {
+ //this is the URL name
+ int ref_num = -1;
+ if (this.Version == GalleryVersion.Version1) {
+ string [] segments = data[0].Split (new char[1]{'.'});
+ ref_num = int.Parse (segments[segments.Length -1]);
+ } else {
+ ref_num = int.Parse (data[1]);
+ }
+ current_album = new Album (this, data[1], ref_num);
+ albums.Add (current_album);
+ //Console.WriteLine ("current_album: " + data[1]);
+ } else if (data[0].StartsWith ("album.title")) {
+ //this is the display name
+ current_album.Title = data[1];
+ } else if (data[0].StartsWith ("album.summary")) {
+ current_album.Summary = data[1];
+ } else if (data[0].StartsWith ("album.parent")) {
+ //FetchAlbums and G2 FetchAlbumsPrune return ints
+ //G1 FetchAlbumsPrune returns album names (and 0 for root albums)
+ try {
+ current_album.ParentRefNum = int.Parse (data[1]);
+ } catch (System.FormatException) {
+ current_album.ParentRefNum = LookupAlbum (data[1]).RefNum;
+ }
+ //Console.WriteLine ("album.parent data[1]: " + data[1]);
+ } else if (data[0].StartsWith ("album.resize_size")) {
+ current_album.ResizeSize = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("album.thumb_size")) {
+ current_album.ThumbSize = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("album.info.extrafields")) {
+ //ignore, this is the album description
+ } else if (data[0].StartsWith ("album.perms.add")) {
+ if (data[1] == "true")
+ current_album.Perms |= AlbumPermission.Add;
+ } else if (data[0].StartsWith ("album.perms.write")) {
+ if (data[1] == "true")
+ current_album.Perms |= AlbumPermission.Write;
+ } else if (data[0].StartsWith ("album.perms.del_item")) {
+ if (data[1] == "true")
+ current_album.Perms |= AlbumPermission.Delete;
+ } else if (data[0].StartsWith ("album.perms.del_alb")) {
+ if (data[1] == "true")
+ current_album.Perms |= AlbumPermission.DeleteAlbum;
+ } else if (data[0].StartsWith ("album.perms.create_sub")) {
+ if (data[1] == "true")
+ current_album.Perms |= AlbumPermission.CreateSubAlbum;
+ } else if (data[0].StartsWith ("album_count")) {
+ if (Albums.Count != int.Parse (data[1]))
+ Console.WriteLine ("Parsed album count does not match album_count. Something is amiss");
+ } else if (data[0].StartsWith ("auth_token")) {
+ AuthToken = data [1];
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseFetchAlbums(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ //Console.WriteLine (After parse albums.Count + " albums parsed");
+ return albums;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public int ParseAddItem (HttpWebResponse response)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ int item_id = 0;
+ try {
+
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("auth_token")) {
+ AuthToken = data[1];
+ } else if (data[0].StartsWith ("item_name")) {
+ item_id = int.Parse (data [1]);
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseAddItem(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ return item_id;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public bool ParseNewAlbum (HttpWebResponse response)
+ {
+ return ParseBasic (response);
+ }
+
+ public bool ParseMoveAlbum (HttpWebResponse response)
+ {
+ return ParseBasic (response);
+ }
+ /*
+ public Album ParseAlbumProperties (HttpWebResponse response)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ try {
+
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("auto-resize")) {
+ //ignore
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseBasic(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ return true;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+ */
+
+ private bool ParseBasic (HttpWebResponse response)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ try {
+
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("auth_token")) {
+ AuthToken = data[1];
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseBasic(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ return true;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public Album LookupAlbum (string name)
+ {
+ Album match = null;
+
+ foreach (Album album in albums) {
+ if (album.Name == name) {
+ match = album;
+ break;
+ }
+ }
+ return match;
+ }
+
+ public Album LookupAlbum (int ref_num)
+ {
+ // FIXME this is really not the best way to do this
+ Album match = null;
+
+ foreach (Album album in albums) {
+ if (album.RefNum == ref_num) {
+ match = album;
+ break;
+ }
+ }
+ return match;
+ }
+
+ public static string FixUrl(string url, string end)
+ {
+ string fixedUrl = url;
+ if (!url.EndsWith (end)) {
+ if (!url.EndsWith ("/"))
+ fixedUrl = url + "/";
+ fixedUrl = fixedUrl + end;
+ }
+ return fixedUrl;
+
+ }
+
+ }
+
+ public class Gallery1 : Gallery
+ {
+ public const string script_name = "gallery_remote2.php";
+ public Gallery1 (string url) : this (url, url) {}
+ public Gallery1 (string name, string url) : base (name)
+ {
+ this.uri = new Uri (FixUrl (url, script_name));
+ version = GalleryVersion.Version1;
+ }
+
+ public override void Login (string username, string passwd)
+ {
+ //Console.WriteLine ("Gallery1: Attempting to login");
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("cmd", "login");
+ client.Add ("protocol_version", "2.3");
+ client.Add ("uname", username);
+ client.Add ("password", passwd);
+
+ ParseLogin (client.Submit (uri));
+ }
+
+ public override ArrayList FetchAlbums ()
+ {
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("cmd", "fetch-albums");
+ client.Add ("protocol_version", "2.3");
+
+ return ParseFetchAlbums (client.Submit (uri));
+ }
+
+
+ public override bool MoveAlbum (Album album, string end_name)
+ {
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("cmd", "move-album");
+ client.Add ("protocol_version", "2.7");
+ client.Add ("set_albumName", album.Name);
+ client.Add ("set_destalbumName", end_name);
+
+ return ParseMoveAlbum (client.Submit (uri));
+ }
+
+ public override int AddItem (Album album,
+ string path,
+ string filename,
+ string caption,
+ bool autorotate)
+ {
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("cmd", "add-item");
+ client.Add ("protocol_version", "2.9");
+ client.Add ("set_albumName", album.Name);
+ client.Add ("caption", caption);
+ client.Add ("userfile_name", filename);
+ client.Add ("force_filename", filename);
+ client.Add ("auto_rotate", autorotate ? "yes" : "no");
+ client.Add ("userfile", new FileInfo (path));
+
+ return ParseAddItem (client.Submit (uri, Progress));
+ }
+
+ /*
+ public override Album AlbumProperties (string album)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("cmd", "album-properties");
+ client.Add ("protocol_version", "2.3");
+ client.Add ("set_albumName", album);
+
+ return ParseAlbumProperties (client.Submit (uri));
+ }
+ */
+
+ public override bool NewAlbum (string parent_name,
+ string name,
+ string title,
+ string description)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Multipart = true;
+ client.Add ("cmd", "new-album");
+ client.Add ("protocol_version", "2.8");
+ client.Add ("set_albumName", parent_name);
+ client.Add ("newAlbumName", name);
+ client.Add ("newAlbumTitle", title);
+ client.Add ("newAlbumDesc", description);
+
+ return ParseNewAlbum (client.Submit (uri));
+ }
+
+ public override ArrayList FetchAlbumImages (Album album, bool include_ablums)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("cmd", "fetch-album-images");
+ client.Add ("protocol_version","2.3");
+ client.Add ("set_albumName", album.Name);
+ client.Add ("albums_too", include_ablums ? "yes" : "no");
+
+ album.Images = ParseFetchAlbumImages (client.Submit (uri), album);
+ return album.Images;
+ }
+
+ public override ArrayList FetchAlbumsPrune ()
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("cmd", "fetch-albums-prune");
+ client.Add ("protocol_version", "2.3");
+ client.Add ("check_writable", "no");
+ ArrayList a = ParseFetchAlbums (client.Submit (uri));
+ a.Sort();
+ return a;
+ }
+
+ public ArrayList ParseFetchAlbumImages (HttpWebResponse response, Album album)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ try {
+ Image current_image = null;
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("image.name")) {
+ current_image = new Image (album, data[1]);
+ album.Images.Add (current_image);
+ } else if (data[0].StartsWith ("image.raw_width")) {
+ current_image.RawWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.raw_height")) {
+ current_image.RawHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.raw_height")) {
+ current_image.RawHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.raw_filesize")) {
+ } else if (data[0].StartsWith ("image.capturedate.year")) {
+ } else if (data[0].StartsWith ("image.capturedate.mon")) {
+ } else if (data[0].StartsWith ("image.capturedate.mday")) {
+ } else if (data[0].StartsWith ("image.capturedate.hours")) {
+ } else if (data[0].StartsWith ("image.capturedate.minutes")) {
+ } else if (data[0].StartsWith ("image.capturedate.seconds")) {
+ } else if (data[0].StartsWith ("image.hidden")) {
+ } else if (data[0].StartsWith ("image.resizedName")) {
+ current_image.ResizedName = data[1];
+ } else if (data[0].StartsWith ("image.resized_width")) {
+ current_image.ResizedWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.resized_height")) {
+ current_image.ResizedHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.thumbName")) {
+ current_image.ThumbName = data[1];
+ } else if (data[0].StartsWith ("image.thumb_width")) {
+ current_image.ThumbWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.thumb_height")) {
+ current_image.ThumbHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.caption")) {
+ current_image.Caption = data[1];
+ } else if (data[0].StartsWith ("image.extrafield.Description")) {
+ current_image.Description = data[1];
+ } else if (data[0].StartsWith ("image.clicks")) {
+ try {
+ current_image.Clicks = int.Parse (data[1]);
+ } catch (System.FormatException) {
+ current_image.Clicks = 0;
+ }
+ } else if (data[0].StartsWith ("baseurl")) {
+ album.BaseURL = data[1];
+ } else if (data[0].StartsWith ("image_count")) {
+ if (album.Images.Count != int.Parse (data[1]))
+ Console.WriteLine ("Parsed image count for " + album.Name + "(" + album.Images.Count + ") does not match image_count (" + data[1] + "). Something is amiss");
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseFetchAlbumImages(): {0}={1}", data[0], data[1]);
+ }
+ }
+ //Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+
+ //Set the Urls for downloading the images.
+ string baseUrl = album.BaseURL + "/";
+ foreach (Image image in album.Images) {
+ image.Url = baseUrl + image.Name;
+ }
+
+ return album.Images;
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public override string GetAlbumUrl (Album album)
+ {
+ string url = Uri.ToString();
+ url = url.Remove (url.Length - script_name.Length, script_name.Length);
+
+ string path = album.Name;
+
+ url = url + path;
+ url = url.Replace (" ", "+");
+ return url;
+ }
+
+
+ }
+ public class Gallery2 : Gallery
+ {
+ public const string script_name = "main.php";
+
+ public Gallery2 (string url) : this (url, url) {}
+ public Gallery2 (string name, string url) : base (name)
+ {
+ this.uri = new Uri (FixUrl (url, script_name));
+ version = GalleryVersion.Version2;
+ }
+
+ public override void Login (string username, string passwd)
+ {
+ Console.WriteLine ("Gallery2: Attempting to login");
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("g2_form[cmd]", "login");
+ client.Add ("g2_form[protocol_version]", "2.10");
+ client.Add ("g2_form[uname]", username);
+ client.Add ("g2_form[password]", passwd);
+ AddG2Specific (client);
+
+ ParseLogin (client.Submit (uri));
+ }
+
+ public override ArrayList FetchAlbums ()
+ {
+ //FetchAlbums doesn't exist for G2, we have to use FetchAlbumsPrune()
+ return FetchAlbumsPrune ();
+ }
+
+
+ public override bool MoveAlbum (Album album, string end_name)
+ {
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("g2_form[cmd]", "move-album");
+ client.Add ("g2_form[protocol_version]", "2.10");
+ client.Add ("g2_form[set_albumName]", album.Name);
+ client.Add ("g2_form[set_destalbumName]", end_name);
+ AddG2Specific (client);
+
+ return ParseMoveAlbum (client.Submit (uri));
+ }
+
+ public override int AddItem (Album album,
+ string path,
+ string filename,
+ string caption,
+ bool autorotate)
+ {
+ FormClient client = new FormClient (cookies);
+
+ client.Add ("g2_form[cmd]", "add-item");
+ client.Add ("g2_form[protocol_version]", "2.10");
+ client.Add ("g2_form[set_albumName]", album.Name);
+ client.Add ("g2_form[caption]", caption);
+ client.Add ("g2_form[userfile_name]", filename);
+ client.Add ("g2_form[force_filename]", filename);
+ client.Add ("g2_form[auto_rotate]", autorotate ? "yes" : "no");
+ client.Add ("g2_userfile", new FileInfo (path));
+ AddG2Specific (client);
+
+ return ParseAddItem (client.Submit (uri, Progress));
+ }
+
+ /*
+ public override Album AlbumProperties (string album)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("cmd", "album-properties");
+ client.Add ("protocol_version", "2.3");
+ client.Add ("set_albumName", album);
+
+ return ParseAlbumProperties (client.Submit (uri));
+ }
+ */
+
+ public override bool NewAlbum (string parent_name,
+ string name,
+ string title,
+ string description)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Multipart = true;
+ client.Add ("g2_form[cmd]", "new-album");
+ client.Add ("g2_form[protocol_version]", "2.10");
+ client.Add ("g2_form[set_albumName]", parent_name);
+ client.Add ("g2_form[newAlbumName]", name);
+ client.Add ("g2_form[newAlbumTitle]", title);
+ client.Add ("g2_form[newAlbumDesc]", description);
+ AddG2Specific (client);
+
+ return ParseNewAlbum (client.Submit (uri));
+ }
+
+ public override ArrayList FetchAlbumImages (Album album, bool include_ablums)
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("g2_form[cmd]", "fetch-album-images");
+ client.Add ("g2_form[protocol_version]","2.10");
+ client.Add ("g2_form[set_albumName]", album.Name);
+ client.Add ("g2_form[albums_too]", include_ablums ? "yes" : "no");
+ AddG2Specific (client);
+
+ album.Images = ParseFetchAlbumImages (client.Submit (uri), album);
+ return album.Images;
+ }
+
+ public override ArrayList FetchAlbumsPrune ()
+ {
+ FormClient client = new FormClient (cookies);
+ client.Add ("g2_form[cmd]", "fetch-albums-prune");
+ client.Add ("g2_form[protocol_version]", "2.10");
+ client.Add ("g2_form[check_writable]", "no");
+ AddG2Specific (client);
+
+ ArrayList a = ParseFetchAlbums (client.Submit (uri));
+ a.Sort();
+ return a;
+ }
+
+ private void AddG2Specific (FormClient client)
+ {
+ if (AuthToken != null && AuthToken != String.Empty)
+ client.Add("g2_authToken", AuthToken);
+ client.Add("g2_controller", "remote.GalleryRemote");
+ }
+
+ public ArrayList ParseFetchAlbumImages (HttpWebResponse response, Album album)
+ {
+ string [] data;
+ StreamReader reader = null;
+ ResultCode status = ResultCode.UnknownResponse;
+ string status_text = "Error: Unable to parse server response";
+ try {
+ Image current_image = null;
+ string baseUrl = Uri.ToString() + "?g2_view=core.DownloadItem&g2_itemId=";
+ reader = findResponse (response);
+ while ((data = GetNextLine (reader)) != null) {
+ if (data[0] == "status") {
+ status = (ResultCode) int.Parse (data [1]);
+ } else if (data[0].StartsWith ("status_text")) {
+ status_text = data[1];
+ Console.WriteLine ("StatusText : {0}", data[1]);
+ } else if (data[0].StartsWith ("image.name")) {
+ //for G2 this is the number used to download the image.
+ current_image = new Image (album, "awaiting 'title'");
+ album.Images.Add (current_image);
+ current_image.Url = baseUrl + data[1];
+ } else if (data[0].StartsWith ("image.title")) {
+ //for G2 the "title" is the name"
+ current_image.Name = data[1];
+ } else if (data[0].StartsWith ("image.raw_width")) {
+ current_image.RawWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.raw_height")) {
+ current_image.RawHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.raw_height")) {
+ current_image.RawHeight = int.Parse (data[1]);
+ //ignore these for now
+ } else if (data[0].StartsWith ("image.raw_filesize")) {
+ } else if (data[0].StartsWith ("image.forceExtension")) {
+ } else if (data[0].StartsWith ("image.capturedate.year")) {
+ } else if (data[0].StartsWith ("image.capturedate.mon")) {
+ } else if (data[0].StartsWith ("image.capturedate.mday")) {
+ } else if (data[0].StartsWith ("image.capturedate.hours")) {
+ } else if (data[0].StartsWith ("image.capturedate.minutes")) {
+ } else if (data[0].StartsWith ("image.capturedate.seconds")) {
+ } else if (data[0].StartsWith ("image.hidden")) {
+ } else if (data[0].StartsWith ("image.resizedName")) {
+ current_image.ResizedName = data[1];
+ } else if (data[0].StartsWith ("image.resized_width")) {
+ current_image.ResizedWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.resized_height")) {
+ current_image.ResizedHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.thumbName")) {
+ current_image.ThumbName = data[1];
+ } else if (data[0].StartsWith ("image.thumb_width")) {
+ current_image.ThumbWidth = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.thumb_height")) {
+ current_image.ThumbHeight = int.Parse (data[1]);
+ } else if (data[0].StartsWith ("image.caption")) {
+ current_image.Caption = data[1];
+ } else if (data[0].StartsWith ("image.extrafield.Description")) {
+ current_image.Description = data[1];
+ } else if (data[0].StartsWith ("image.clicks")) {
+ try {
+ current_image.Clicks = int.Parse (data[1]);
+ } catch (System.FormatException) {
+ current_image.Clicks = 0;
+ }
+ } else if (data[0].StartsWith ("baseurl")) {
+ album.BaseURL = data[1];
+ } else if (data[0].StartsWith ("image_count")) {
+ if (album.Images.Count != int.Parse (data[1]))
+ Console.WriteLine ("Parsed image count for " + album.Name + "(" + album.Images.Count + ") does not match image_count (" + data[1] + "). Something is amiss");
+ } else {
+ Console.WriteLine ("Unparsed Line in ParseFetchAlbumImages(): {0}={1}", data[0], data[1]);
+ }
+ }
+ Console.WriteLine ("Found: {0} cookies", response.Cookies.Count);
+ if (status != ResultCode.Success) {
+ Console.WriteLine (status_text);
+ throw new GalleryCommandException (status_text, status);
+ }
+
+ return album.Images;
+
+ } finally {
+ if (reader != null)
+ reader.Close ();
+
+ response.Close ();
+ }
+ }
+
+ public override string GetAlbumUrl (Album album)
+ {
+ return Uri.ToString() + "?g2_view=core.ShowItem&g2_itemId=" + album.Name;
+ }
+
+ }
+
+ public enum GalleryVersion : byte
+ {
+ VersionUnknown = 0,
+ Version1 = 1,
+ Version2 = 2
+ }
+}
Modified: trunk/extensions/GalleryExport/Makefile.am
==============================================================================
--- trunk/extensions/GalleryExport/Makefile.am (original)
+++ trunk/extensions/GalleryExport/Makefile.am Fri Jan 25 14:23:01 2008
@@ -1,10 +1,51 @@
include $(top_srcdir)/Makefile.include
-PLUGIN_MANIFEST = GalleryExport.addin.xml
+PLUGIN_NAME = GalleryExport
+
+PLUGIN_MANIFEST = $(PLUGIN_NAME).addin.xml
+
+PLUGIN_ASSEMBLY = $(PLUGIN_NAME).dll
+
+PLUGIN_SOURCES = \
+ $(srcdir)/GalleryExport.cs \
+ $(srcdir)/GalleryRemote.cs
+
+REFS = \
+ -r:../../src/f-spot.exe \
+ -r:../../src/FSpot.Core.dll \
+ -r:../../src/FSpot.Utils.dll \
+ -r:../../semweb/SemWeb.dll \
+ -r:Mono.Posix
+
+PKGS = \
+ -pkg:gtk-sharp-2.0 \
+ -pkg:glade-sharp-2.0
+
+RESOURCES = \
+ -resource:$(PLUGIN_MANIFEST) \
+ -resource:$(PLUGIN_NAME).glade
+
+all: $(PLUGIN_ASSEMBLY)
+
+mpack: $(PLUGIN_ASSEMBLY)
+ mautil p $(PLUGIN_ASSEMBLY)
+
+$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST)
+ $(CSC_LIB) -out:$@ $(PLUGIN_SOURCES) $(REFS) $(PKGS) $(ASSEMBLIES) $(RESOURCES)
plugindir = $(pkglibdir)/extensions
-plugin_DATA = \
- $(PLUGIN_MANIFEST)
-EXTRA_DIST = \
+install-data-hook:
+ rm -f $(plugindir)/GalleryExport.addin.xml
+
+plugin_DATA = \
+ $(PLUGIN_ASSEMBLY)
+
+EXTRA_DIST = \
+ $(PLUGIN_SOURCES) \
$(PLUGIN_MANIFEST)
+
+CLEANFILES = \
+ $(PLUGIN_ASSEMBLY) \
+ $(PLUGIN_ASSEMBLY).mdb \
+ *.mpack
Modified: trunk/extensions/Makefile.am
==============================================================================
--- trunk/extensions/Makefile.am (original)
+++ trunk/extensions/Makefile.am Fri Jan 25 14:23:01 2008
@@ -1,6 +1,6 @@
SUBDIRS = \
- DefaultExporters \
- GalleryExport
+ GalleryExport \
+ DefaultExporters
addinsdir = $(pkglibdir)
addins_DATA = f-spot.global.addins
Modified: trunk/src/Preferences.cs
==============================================================================
--- trunk/src/Preferences.cs (original)
+++ trunk/src/Preferences.cs Fri Jan 25 14:23:01 2008
@@ -7,6 +7,9 @@
{
public class Preferences
{
+ public const string APP_FSPOT = "/apps/f-spot/";
+ public const string APP_FSPOT_EXPORT = APP_FSPOT + "export/";
+
public const string MAIN_WINDOW_MAXIMIZED = "/apps/f-spot/ui/maximized";
public const string MAIN_WINDOW_X = "/apps/f-spot/ui/main_window_x";
@@ -57,12 +60,6 @@
public const string EXPORT_TOKEN_23HQ = "/apps/f-spot/export/tokens/23hq";
public const string EXPORT_TOKEN_ZOOOMR = "/apps/f-spot/export/tokens/zooomr";
- public const string EXPORT_GALLERY_SCALE = "/apps/f-spot/export/gallery/scale";
- public const string EXPORT_GALLERY_SIZE = "/apps/f-spot/export/gallery/size";
- public const string EXPORT_GALLERY_BROWSER = "/apps/f-spot/export/gallery/browser";
- public const string EXPORT_GALLERY_META = "/apps/f-spot/export/gallery/meta";
- public const string EXPORT_GALLERY_ROTATE = "/apps/f-spot/export/gallery/rotate";
-
public const string EXPORT_PICASAWEB_SCALE = "/apps/f-spot/export/picasaweb/scale";
public const string EXPORT_PICASAWEB_SIZE = "/apps/f-spot/export/picasaweb/size";
public const string EXPORT_PICASAWEB_ROTATE = "/apps/f-spot/export/picasaweb/rotate";
@@ -164,7 +161,6 @@
case SHOW_DATES:
case SHOW_RATINGS:
case VIEWER_SHOW_FILENAMES:
- case EXPORT_GALLERY_ROTATE:
case EXPORT_PICASAWEB_SCALE:
case EXPORT_PICASAWEB_ROTATE:
case EXPORT_PICASAWEB_BROWSER:
Modified: trunk/src/Query/LogicalTerm.cs
==============================================================================
--- trunk/src/Query/LogicalTerm.cs (original)
+++ trunk/src/Query/LogicalTerm.cs Fri Jan 25 14:23:01 2008
@@ -44,7 +44,12 @@
private static string SqlClause (string [] tagids)
{
- return String.Format (" (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0})) ", String.Join (", ", tagids));
+ if (tagids.Length == 0)
+ return null;
+ if (tagids.Length == 1)
+ return String.Format (" (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0})) ", tagids[0]);
+ else
+ return String.Format (" (photos.id IN (SELECT photo_id FROM photo_tags WHERE tag_id IN ({0}))) ", String.Join (", ", tagids));
}
}
@@ -115,7 +120,10 @@
public string SqlClause (string op, string[] items)
{
- return " (" + String.Join (String.Format (" {0} ", op), items) + ") ";
+ if (items.Length == 1)
+ return items [0];
+ else
+ return " (" + String.Join (String.Format (" {0} ", op), items) + ") ";
}
}
Modified: trunk/src/f-spot.glade
==============================================================================
--- trunk/src/f-spot.glade (original)
+++ trunk/src/f-spot.glade Fri Jan 25 14:23:01 2008
@@ -2319,409 +2319,6 @@
</widget>
</child>
</widget>
- <widget class="GtkDialog" id="gallery_export_dialog">
- <property name="title" translatable="yes">Export</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="has_separator">False</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox11">
- <property name="visible">True</property>
- <child>
- <widget class="GtkHBox" id="hbox17">
- <property name="visible">True</property>
- <property name="border_width">6</property>
- <child>
- <widget class="GtkFrame" id="frame8">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <widget class="GtkAlignment" id="alignment12">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkScrolledWindow" id="thumb_scrolledwindow">
- <property name="width_request">180</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="photo_frame">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Photos</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox11">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkFrame" id="frame9">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <widget class="GtkAlignment" id="alignment13">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox12">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox20">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="gallery_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Gallery:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">gallery_optionmenu</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkOptionMenu" id="gallery_optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="response_id">0</property>
- <signal name="changed" handler="HandleAccountSelected"/>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="gallery_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="HandleAddGallery"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="edit_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-edit</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="status_label">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label44">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Gallery</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkFrame" id="frame10">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <widget class="GtkAlignment" id="alignment14">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox13">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox18">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="album_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Export to Album:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">album_optionmenu</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkOptionMenu" id="album_optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="response_id">0</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="album_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="HandleAddAlbum"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckButton" id="browser_check">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Open _album in browser when done uploading</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label45">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Album</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkFrame" id="frame11">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <widget class="GtkAlignment" id="alignment15">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox14">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox58">
- <property name="visible">True</property>
- <child>
- <widget class="GtkCheckButton" id="scale_check">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Resize to: </property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="HandleSizeActive"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="size_spin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">400 0 10000 1 10 10</property>
- <property name="climb_rate">1</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label153">
- <property name="visible">True</property>
- <property name="label" translatable="yes">pixels</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckButton" id="rotate_check">
- <property name="visible">True</property>
- <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>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="meta_check">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Export _titles and comments</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label46">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Style</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area11">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- <child>
- <widget class="GtkButton" id="export_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">_Export</property>
- <property name="use_underline">True</property>
- <property name="response_id">-5</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="GtkDialog" id="google_add_album_dialog">
<property name="visible">True</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -2749,181 +2346,8 @@
<property name="mnemonic_widget">description_entry</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="description_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="name_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Album Title:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">title_entry</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="title_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="public_check">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Public Album</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area12">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- <child>
- <widget class="GtkButton" id="add_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="response_id">-5</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="gallery_add_album_dialog">
- <property name="visible">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="has_separator">False</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox12">
- <property name="visible">True</property>
- <child>
- <widget class="GtkTable" id="table10">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">7</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkLabel" id="gallery_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Parent Album:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">album_optionmenu</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="password_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Title:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">title_entry</property>
- </widget>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="title_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="descroption_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Description:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">description_entry</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@@ -2937,8 +2361,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
@@ -2946,19 +2370,17 @@
<widget class="GtkLabel" id="name_label">
<property name="visible">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">_Album Name:</property>
+ <property name="label" translatable="yes">_Album Title:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">name_entry</property>
+ <property name="mnemonic_widget">title_entry</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="name_entry">
+ <widget class="GtkEntry" id="title_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">*</property>
@@ -2966,21 +2388,23 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkOptionMenu" id="album_optionmenu">
+ <widget class="GtkCheckButton" id="public_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="label" translatable="yes">Public Album</property>
+ <property name="use_underline">True</property>
<property name="response_id">0</property>
- <signal name="changed" handler="HandleChanged"/>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@@ -3011,6 +2435,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="response_id">-5</property>
@@ -3318,256 +2743,6 @@
</widget>
</child>
</widget>
- <widget class="GtkDialog" id="gallery_add_dialog">
- <property name="visible">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="has_separator">False</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox12">
- <property name="visible">True</property>
- <child>
- <widget class="GtkVBox" id="vbox63">
- <property name="visible">True</property>
- <child>
- <widget class="GtkHBox" id="status_area">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <child>
- <widget class="GtkImage" id="image12">
- <property name="visible">True</property>
- <property name="yalign">0</property>
- <property name="stock">gtk-dialog-question</property>
- <property name="icon_size">6</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox64">
- <property name="visible">True</property>
- <property name="border_width">6</property>
- <child>
- <widget class="GtkLabel" id="summary_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><span weight='bold' size='larger'>Error Connecting to Gallery</span>
-</property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="description_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Please verify that the settings for this gallery are correct.</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkTable" id="table10">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">7</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkLabel" id="gallery_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Gallery Name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">gallery_entry</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="gallery_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="password_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">password_entry</property>
- </widget>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="password_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="username_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Username:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">username_entry</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="username_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="url_label">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">U_RL:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">url_entry</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="url_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">*</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area12">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- <child>
- <widget class="GtkButton" id="remove_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="response_id">-2</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="add_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="response_id">-5</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="GtkDialog" id="vfs_export_dialog">
<property name="title" translatable="yes">Export</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]