f-spot r4566 - in trunk/src: . UI.Dialog
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4566 - in trunk/src: . UI.Dialog
- Date: Tue, 4 Nov 2008 13:43:23 +0000 (UTC)
Author: sdelcroix
Date: Tue Nov 4 13:43:23 2008
New Revision: 4566
URL: http://svn.gnome.org/viewvc/f-spot?rev=4566&view=rev
Log:
Various minor changes here and there
Added:
trunk/src/UI.Dialog/AdjustTimeDialog.cs
- copied, changed from r4565, /trunk/src/TimeDialog.cs
trunk/src/UI.Dialog/ProgressDialog.cs
trunk/src/UI.Dialog/ThreadProgressDialog.cs
- copied, changed from r4565, /trunk/src/ThreadProgressDialog.cs
Removed:
trunk/src/ProgressDialog.cs
trunk/src/ThreadProgressDialog.cs
trunk/src/TimeDialog.cs
Modified:
trunk/src/AssemblyInfo.cs.in
trunk/src/BitConverter.cs
trunk/src/BlockProcessor.cs
trunk/src/CameraFileSelectionDialog.cs
trunk/src/CompatFileChooser.cs
trunk/src/MainWindow.cs
trunk/src/Makefile.am
trunk/src/ThumbnailCommand.cs
trunk/src/Updater.cs
Modified: trunk/src/AssemblyInfo.cs.in
==============================================================================
--- trunk/src/AssemblyInfo.cs.in (original)
+++ trunk/src/AssemblyInfo.cs.in Tue Nov 4 13:43:23 2008
@@ -4,6 +4,7 @@
* Authors
* Stephane Delcroix <stephane delcroix org>
*
+ * This is free software. See COPYING for details.
*/
using System.Reflection;
@@ -11,5 +12,5 @@
[assembly: AssemblyVersion("@VERSION@")]
[assembly: AssemblyTitle ("F-Spot")]
-[assembly: AssemblyCopyright ("(c)2003-2007, Novell Inc")]
+[assembly: AssemblyCopyright ("(c)2003-2008, Novell Inc")]
[assembly: AssemblyDescription ("Personal photo management for the GNOME Desktop")]
Modified: trunk/src/BitConverter.cs
==============================================================================
--- trunk/src/BitConverter.cs (original)
+++ trunk/src/BitConverter.cs Tue Nov 4 13:43:23 2008
@@ -2,6 +2,7 @@
using System.Runtime.InteropServices;
namespace FSpot {
+ [Obsolete ("use Mono.DataConvert instead")]
public class BitConverter {
public static uint Swap (uint val, bool little)
{
Modified: trunk/src/BlockProcessor.cs
==============================================================================
--- trunk/src/BlockProcessor.cs (original)
+++ trunk/src/BlockProcessor.cs Tue Nov 4 13:43:23 2008
@@ -1,5 +1,5 @@
/*
- * Filters/JpegFilter.cs
+ * FSpot.BlockProcessor.cs
*
* Author(s)
* Larry Ewing <lewing novell com>
Modified: trunk/src/CameraFileSelectionDialog.cs
==============================================================================
--- trunk/src/CameraFileSelectionDialog.cs (original)
+++ trunk/src/CameraFileSelectionDialog.cs Tue Nov 4 13:43:23 2008
@@ -38,7 +38,7 @@
ListStore preview_list_store;
Db db;
- FSpot.ThreadProgressDialog progress_dialog;
+ ThreadProgressDialog progress_dialog;
System.Collections.ArrayList index_list;
string[] saved_files;
@@ -198,7 +198,7 @@
command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (this.Download));
command_thread.Name = Catalog.GetString ("Transferring Pictures");
- progress_dialog = new FSpot.ThreadProgressDialog (command_thread, 1);
+ progress_dialog = new ThreadProgressDialog (command_thread, 1);
progress_dialog.Start ();
while (command_thread.IsAlive) {
Modified: trunk/src/CompatFileChooser.cs
==============================================================================
--- trunk/src/CompatFileChooser.cs (original)
+++ trunk/src/CompatFileChooser.cs Tue Nov 4 13:43:23 2008
@@ -11,6 +11,7 @@
using Gtk;
using System.Runtime.InteropServices;
+[Obsolete ("This is no longer needed, use a FileChooser instead")]
public class CompatFileChooserDialog {
/* Public interface */
Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs (original)
+++ trunk/src/MainWindow.cs Tue Nov 4 13:43:23 2008
@@ -2116,7 +2116,7 @@
{
PhotoList list = new PhotoList (Selection.Items);
list.Sort (new Photo.CompareDateName ());
- new TimeDialog (db, list);
+ new AdjustTimeDialog (db, list);
}
public void HideLoupe ()
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Tue Nov 4 13:43:23 2008
@@ -204,7 +204,7 @@
$(srcdir)/PixelBuffer.cs \
$(srcdir)/Preferences.cs \
$(srcdir)/PrintOperation.cs \
- $(srcdir)/ProgressDialog.cs \
+ $(srcdir)/ProgressItem.cs \
$(srcdir)/RatingFilter.cs \
$(srcdir)/QueuedSqliteDatabase.cs \
$(srcdir)/RotateCommand.cs \
@@ -219,24 +219,25 @@
$(srcdir)/TagQueryWidget.cs \
$(srcdir)/TagSelectionWidget.cs \
$(srcdir)/TagStore.cs \
- $(srcdir)/ThreadProgressDialog.cs \
$(srcdir)/ThumbnailCache.cs \
$(srcdir)/ThumbnailGenerator.cs \
$(srcdir)/Texture.cs \
$(srcdir)/TextureDisplay.cs \
$(srcdir)/Term.cs \
$(srcdir)/TimeAdaptor.cs \
- $(srcdir)/TimeDialog.cs \
$(srcdir)/TipWindow.cs \
$(srcdir)/UI.Dialog/AboutDialog.cs \
+ $(srcdir)/UI.Dialog/AdjustTimeDialog.cs \
$(srcdir)/UI.Dialog/EditExceptionDialog.cs \
$(srcdir)/UI.Dialog/ExceptionDialog.cs \
$(srcdir)/UI.Dialog/GladeDialog.cs \
$(srcdir)/UI.Dialog/HigMessageDialog.cs \
$(srcdir)/UI.Dialog/LastRollDialog.cs \
$(srcdir)/UI.Dialog/PreferenceDialog.cs \
- $(srcdir)/UI.Dialog/SelectionRatioDialog.cs \
+ $(srcdir)/UI.Dialog/ProgressDialog.cs \
$(srcdir)/UI.Dialog/RepairDbDialog.cs \
+ $(srcdir)/UI.Dialog/SelectionRatioDialog.cs \
+ $(srcdir)/UI.Dialog/ThreadProgressDialog.cs \
$(srcdir)/Updater.cs \
$(srcdir)/UriCollection.cs \
$(srcdir)/Util.cs \
Modified: trunk/src/ThumbnailCommand.cs
==============================================================================
--- trunk/src/ThumbnailCommand.cs (original)
+++ trunk/src/ThumbnailCommand.cs Tue Nov 4 13:43:23 2008
@@ -1,6 +1,7 @@
using System;
using Gtk;
using FSpot;
+using FSpot.UI.Dialog;
public class ThumbnailCommand {
Copied: trunk/src/UI.Dialog/AdjustTimeDialog.cs (from r4565, /trunk/src/TimeDialog.cs)
==============================================================================
--- /trunk/src/TimeDialog.cs (original)
+++ trunk/src/UI.Dialog/AdjustTimeDialog.cs Tue Nov 4 13:43:23 2008
@@ -1,28 +1,21 @@
+/*
+ * FSpot.UI.Dialogs.AdjstTimeDialog.cs
+ *
+ * Author(s):
+ * Larry Ewing <lewing novell com>
+ * Stephane Delcroix <stephane delcroix org>
+ *
+ * This is free software. See COPYING for details.
+ */
+
using System;
using Gtk;
using System.Collections;
using Mono.Unix;
using FSpot.Widgets;
-using FSpot.UI.Dialog;
-
-namespace FSpot {
-// public class TimeChangedEventArgs : PhotoEventArgs {
-// TimeSpan span;
-//
-// public TimeChangedEventArgs (Photo [] items, TimeSpan span)
-// : base (items, true, false)
-// {
-// this.span = span;
-// }
-//
-// public TimeSpan TimeSpan {
-// get {
-// return span;
-// }
-// }
-// }
- public class TimeDialog : GladeDialog
+namespace FSpot.UI.Dialog {
+ public class AdjustTimeDialog : GladeDialog
{
[Glade.Widget] ScrolledWindow view_scrolled;
[Glade.Widget] ScrolledWindow tray_scrolled;
@@ -58,7 +51,7 @@
Db db;
TimeSpan gnome_dateedit_sucks;
- public TimeDialog (Db db, IBrowsableCollection collection) : base ("time_dialog")
+ public AdjustTimeDialog (Db db, IBrowsableCollection collection) : base ("time_dialog")
{
this.db = db;
this.collection = collection;
Added: trunk/src/UI.Dialog/ProgressDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/UI.Dialog/ProgressDialog.cs Tue Nov 4 13:43:23 2008
@@ -0,0 +1,103 @@
+/*
+ * FSpot.UI.Dialog.ProgressDialog.cs
+ *
+ * Author(s):
+ * Ettore Perazzoli
+ * Larry Ewing <lewing novell com>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using GLib;
+using Gtk;
+using System;
+
+using Mono.Unix;
+
+namespace FSpot.UI.Dialog {
+ public class ProgressDialog : Gtk.Dialog {
+
+ private bool cancelled;
+
+ private void HandleResponse (object me, ResponseArgs args)
+ {
+ cancelled = true;
+ }
+
+ public enum CancelButtonType {
+ Cancel,
+ Stop,
+ None
+ };
+
+ private int total_count;
+
+ private ProgressBar progress_bar;
+ public ProgressBar Bar {
+ get { return progress_bar; }
+ }
+
+ private Label message_label;
+ public Label Message {
+ get { return message_label; }
+ }
+
+ private DateTime start_time;
+
+ private Gtk.Button button;
+ public Gtk.Button Button {
+ get {
+ return button;
+ }
+ }
+
+ public ProgressDialog (string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window)
+ {
+ Title = title;
+ this.total_count = total_count;
+
+ if (parent_window != null)
+ this.TransientFor = parent_window;
+
+ HasSeparator = false;
+ BorderWidth = 6;
+ SetDefaultSize (300, -1);
+
+ message_label = new Label (String.Empty);
+ VBox.PackStart (message_label, true, true, 12);
+
+ progress_bar = new ProgressBar ();
+ VBox.PackStart (progress_bar, true, true, 6);
+
+ switch (cancel_button_type) {
+ case CancelButtonType.Cancel:
+ button = (Gtk.Button)AddButton (Gtk.Stock.Cancel, (int) ResponseType.Cancel);
+ break;
+ case CancelButtonType.Stop:
+ button = (Gtk.Button)AddButton (Gtk.Stock.Stop, (int) ResponseType.Cancel);
+ break;
+ }
+
+ Response += new ResponseHandler (HandleResponse);
+ }
+
+ private int current_count;
+
+ // Return true if the operation was cancelled by the user.
+ public bool Update (string message)
+ {
+ current_count ++;
+
+ message_label.Text = message;
+ progress_bar.Text = String.Format (Catalog.GetString ("{0} of {1}"), current_count, total_count);
+ progress_bar.Fraction = (double) current_count / total_count;
+
+ ShowAll ();
+
+ while (Application.EventsPending ())
+ Application.RunIteration ();
+
+ return cancelled;
+ }
+ }
+}
Copied: trunk/src/UI.Dialog/ThreadProgressDialog.cs (from r4565, /trunk/src/ThreadProgressDialog.cs)
==============================================================================
--- /trunk/src/ThreadProgressDialog.cs (original)
+++ trunk/src/UI.Dialog/ThreadProgressDialog.cs Tue Nov 4 13:43:23 2008
@@ -1,34 +1,17 @@
+/*
+ * FSpot.UI.Dialog.ThreadProgressDialog.cs
+ *
+ * Author(s):
+ * Larry Ewing <lewing novell com>
+ * Stephane Delcroix <stephane delcroix org>
+ *
+ * This is free software. See COPYING for details.
+ */
+
using System;
using System.Threading;
-namespace FSpot {
-
-
- public class ProgressItem {
- public ProgressItem () {
-
- }
-
- public delegate void ChangedHandler (ProgressItem item);
- public event ChangedHandler Changed;
-
- double value;
- public double Value {
- get {
- lock (this) {
- return value;
- }
- }
- set {
- lock (this) {
- this.value = value;
- if (Changed != null)
- Changed (this);
- }
- }
- }
- }
-
+namespace FSpot.UI.Dialog {
public class ThreadProgressDialog : Gtk.Dialog {
FSpot.Delay delay;
Modified: trunk/src/Updater.cs
==============================================================================
--- trunk/src/Updater.cs (original)
+++ trunk/src/Updater.cs Tue Nov 4 13:43:23 2008
@@ -5,6 +5,7 @@
using System.Collections;
using Banshee.Database;
using FSpot.Utils;
+using FSpot.UI.Dialog;
namespace FSpot.Database {
public static class Updater {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]