[f-spot] Pull all of the main app code into Clients/MainApp/



commit 6b79077c9fb22582eb5b4def96f4610e16084083
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sun Aug 8 14:07:54 2010 +0200

    Pull all of the main app code into Clients/MainApp/
    
    Most of the stuff in there should move somewhere else. The fact that the
    bulk of our code lives there shows how tangled up everything is.
    
    "make run" is currently broken.

 configure.ac                                       |   11 +-
 extensions/Tools/MergeDb/MergeDb.cs                |    1 +
 po/POTFILES.in                                     |  161 ++--
 src/AssemblyInfo.cs.in                             |   70 +-
 src/{ => Clients/MainApp}/DependentListStore.cs    |    0
 src/{ => Clients/MainApp}/ExportStore.cs           |   22 +-
 .../MainApp/FSpot.ColorAdjustment}/Adjustment.cs   |    6 +-
 .../MainApp/FSpot.ColorAdjustment}/AutoStretch.cs  |    6 +-
 .../MainApp/FSpot.ColorAdjustment}/Desaturate.cs   |    2 +-
 .../FSpot.ColorAdjustment}/FullColorAdjustment.cs  |   10 +-
 .../MainApp/FSpot.ColorAdjustment}/SepiaTone.cs    |    2 +-
 src/{ => Clients/MainApp/FSpot.Database}/Db.cs     |   18 +-
 .../MainApp/FSpot.Database}/Tests/UpdaterTests.cs  |    3 +-
 .../MainApp/FSpot.Database}/Updater.cs             |  166 ++--
 .../MainApp/FSpot.Editors}/AutoStretchEditor.cs    |    0
 .../MainApp/FSpot.Editors}/ColorEditor.cs          |    0
 .../MainApp/FSpot.Editors}/CropEditor.cs           |    0
 .../MainApp/FSpot.Editors}/DesaturateEditor.cs     |    0
 .../MainApp/FSpot.Editors}/Editor.cs               |    0
 .../MainApp/FSpot.Editors}/RedEyeEditor.cs         |    0
 .../MainApp/FSpot.Editors}/SepiaEditor.cs          |    0
 .../MainApp/FSpot.Editors}/SoftFocusEditor.cs      |    4 +-
 .../MainApp/FSpot.Editors}/TiltEditor.cs           |    4 +-
 .../FSpot.Extensions}/CommandMenuItemNode.cs       |    0
 .../FSpot.Extensions}/ComplexMenuItemNode.cs       |    2 +-
 .../FSpot.Extensions}/ExportMenuItemNode.cs        |    0
 .../MainApp/FSpot.Extensions}/ICommand.cs          |    0
 .../MainApp/FSpot.Extensions}/IExporter.cs         |    0
 .../MainApp/FSpot.Extensions}/IMenuGenerator.cs    |    0
 .../MainApp/FSpot.Extensions}/IService.cs          |    0
 .../MainApp/FSpot.Extensions}/MenuNode.cs          |    8 +-
 .../FSpot.Extensions}/PhotoSelectionCondition.cs   |    4 +-
 .../MainApp/FSpot.Extensions}/PopupCommands.cs     |    4 +-
 .../MainApp/FSpot.Extensions}/ServiceNode.cs       |    2 +-
 .../MainApp/FSpot.Extensions}/SidebarPage.cs       |    6 +-
 .../MainApp/FSpot.Extensions}/SidebarPageNode.cs   |    0
 .../MainApp/FSpot.Extensions}/TransitionNode.cs    |    2 +-
 .../MainApp/FSpot.Extensions}/ViewModeCondition.cs |    2 +-
 .../MainApp/FSpot.Filters}/ChmodFilter.cs          |    6 +-
 .../MainApp/FSpot.Filters}/FilterRequest.cs        |    8 +-
 .../MainApp/FSpot.Filters}/FilterSet.cs            |   12 +-
 .../MainApp/FSpot.Filters}/IFilter.cs              |    0
 .../MainApp/FSpot.Filters}/JpegFilter.cs           |    0
 .../MainApp/FSpot.Filters}/ResizeFilter.cs         |    0
 .../MainApp/FSpot.Filters}/SharpFilter.cs          |    0
 .../MainApp/FSpot.Filters}/UniqueNameFilter.cs     |    2 +-
 .../MainApp/FSpot.Filters}/WhiteListFilter.cs      |    4 +-
 .../MainApp/FSpot.Imaging}/Ciff.cs                 |   40 +-
 .../MainApp/FSpot.Imaging}/DCRawFile.cs            |    2 +-
 .../MainApp/FSpot.Imaging}/IOChannel.cs            |    0
 .../MainApp/FSpot.Imaging}/ImageFile.cs            |   20 +-
 .../MainApp/FSpot.Imaging}/InternalProcess.cs      |    0
 .../MainApp/FSpot.Imaging}/RafFile.cs              |   10 +-
 .../MainApp/FSpot.Imaging}/Tests/ImageFileTests.cs |    3 +-
 .../MainApp/FSpot.Imaging}/Tiff.cs                 |   13 +-
 .../MainApp/FSpot.Import}/FileImportSource.cs      |    0
 .../MainApp/FSpot.Import}/ImportController.cs      |    0
 .../MainApp/FSpot.Import}/ImportSource.cs          |    0
 .../MainApp/FSpot.Import}/MetadataImporter.cs      |    0
 .../MainApp/FSpot.Jobs}/CalculateHashJob.cs        |    9 +-
 .../MainApp/FSpot.Jobs}/SyncMetadataJob.cs         |    0
 .../FSpot.Loaders}/AreaPreparedEventArgs.cs        |    2 +-
 .../MainApp/FSpot.Loaders}/AreaUpdatedEventArgs.cs |    2 +-
 .../MainApp/FSpot.Loaders}/GdkImageLoader.cs       |    4 +-
 .../MainApp/FSpot.Loaders}/IImageLoader.cs         |    2 +-
 .../MainApp/FSpot.Loaders}/ImageLoader.cs          |    0
 .../MainApp/FSpot.Query}/HiddenTag.cs              |   20 +-
 .../MainApp/FSpot.UI.Dialog}/AboutDialog.cs        |   10 +-
 .../MainApp/FSpot.UI.Dialog}/AdjustTimeDialog.cs   |   21 +-
 .../MainApp/FSpot.UI.Dialog}/BuilderDialog.cs      |    0
 .../MainApp/FSpot.UI.Dialog}/DateRangeDialog.cs    |   14 +-
 .../FSpot.UI.Dialog}/EditExceptionDialog.cs        |    4 +-
 .../MainApp/FSpot.UI.Dialog}/EditTagDialog.cs      |   12 +-
 .../MainApp/FSpot.UI.Dialog}/EditTagIconDialog.cs  |   39 +-
 .../MainApp/FSpot.UI.Dialog}/GladeDialog.cs        |    6 +-
 .../MainApp/FSpot.UI.Dialog}/ImportDialog.cs       |    0
 .../FSpot.UI.Dialog}/ImportFailureDialog.cs        |    0
 .../MainApp/FSpot.UI.Dialog}/LastRollDialog.cs     |   28 +-
 .../MainApp/FSpot.UI.Dialog}/PreferenceDialog.cs   |    6 +-
 .../MainApp/FSpot.UI.Dialog}/ProgressDialog.cs     |   40 +-
 .../MainApp/FSpot.UI.Dialog}/RatingFilterDialog.cs |    8 +-
 .../MainApp/FSpot.UI.Dialog}/RepairDbDialog.cs     |    8 +-
 .../MainApp/FSpot.UI.Dialog}/RepairDialog.cs       |    6 +-
 .../FSpot.UI.Dialog}/SelectionRatioDialog.cs       |   14 +-
 .../MainApp/FSpot.UI.Dialog}/TagSelectionDialog.cs |   12 +-
 .../FSpot.UI.Dialog}/ThreadProgressDialog.cs       |   20 +-
 .../FSpot.UI.Dialog}/ui/AdjustTimeDialog.ui        |    0
 .../MainApp/FSpot.UI.Dialog}/ui/CreateTagDialog.ui |    0
 .../MainApp/FSpot.UI.Dialog}/ui/DateRangeDialog.ui |    0
 .../MainApp/FSpot.UI.Dialog}/ui/EditTagDialog.ui   |    0
 .../FSpot.UI.Dialog}/ui/EditTagIconDialog.ui       |    0
 .../ui/LastImportRollFilterDialog.ui               |    0
 .../FSpot.UI.Dialog}/ui/PreferenceDialog.ui        |    0
 .../FSpot.UI.Dialog}/ui/RatingFilterDialog.ui      |    0
 .../MainApp/FSpot.UI.Dialog}/ui/RepairDialog.ui    |    0
 src/{ => Clients/MainApp/FSpot.Utils}/Util.cs      |   46 +-
 .../FSpot.Widgets}/CellRendererTextProgress.cs     |   72 +-
 .../MainApp/FSpot.Widgets}/CompositeUtils.cs       |   10 +-
 .../MainApp/FSpot.Widgets}/Dissolve.cs             |   40 +-
 .../MainApp/FSpot.Widgets}/EditorPage.cs           |    4 +-
 .../MainApp/FSpot.Widgets}/Filmstrip.cs            |   92 +-
 .../MainApp/FSpot.Widgets}/FindBar.cs              |    2 +-
 .../MainApp/FSpot.Widgets}/FolderTreeModel.cs      |   81 +-
 .../MainApp/FSpot.Widgets}/FolderTreePage.cs       |    4 +-
 .../MainApp/FSpot.Widgets}/FolderTreeView.cs       |   64 +-
 .../MainApp/FSpot.Widgets}/IEffect.cs              |    2 +-
 .../MainApp/FSpot.Widgets}/ITransition.cs          |    2 +-
 .../MainApp/FSpot.Widgets}/IconView.cs             |    6 +-
 .../MainApp/FSpot.Widgets}/ImageInfo.cs            |   56 +-
 .../MainApp/FSpot.Widgets}/InfoBox.cs              |  218 ++--
 src/{ => Clients/MainApp/FSpot.Widgets}/Loupe.cs   |   83 +-
 .../MainApp/FSpot.Widgets}/MetadataDisplay.cs      |  144 ++--
 .../MainApp/FSpot.Widgets}/PanZoom.cs              |   70 +-
 .../MainApp/FSpot.Widgets}/PhotoImageView.cs       |   48 +-
 .../MainApp/FSpot.Widgets}/PreviewPopup.cs         |   40 +-
 .../MainApp/FSpot.Widgets}/Push.cs                 |   28 +-
 .../MainApp/FSpot.Widgets}/QueryView.cs            |    6 +-
 .../MainApp/FSpot.Widgets}/RatingMenuItem.cs       |    2 +-
 .../MainApp/FSpot.Widgets}/Reveal.cs               |   30 +-
 .../MainApp/FSpot.Widgets}/ScalingIconView.cs      |   16 +-
 .../MainApp/FSpot.Widgets}/Sharpener.cs            |   39 +-
 .../MainApp/FSpot.Widgets}/Sidebar.cs              |   46 +-
 .../MainApp/FSpot.Widgets}/SlideShow.cs            |    8 +-
 .../MainApp/FSpot.Widgets}/SoftFocus.cs            |    0
 .../MainApp/FSpot.Widgets}/TagEntry.cs             |   60 +-
 .../MainApp/FSpot.Widgets}/TagMenu.cs              |   26 +-
 .../MainApp/FSpot.Widgets}/TagView.cs              |   28 +-
 .../MainApp/FSpot.Widgets}/Tests/FindBarTests.cs   |    0
 .../MainApp/FSpot.Widgets}/TrayView.cs             |   14 +-
 .../MainApp/FSpot.Widgets}/ViewContext.cs          |    0
 .../MainApp/FSpot.Widgets}/Wipe.cs                 |   30 +-
 src/{ => Clients/MainApp}/FSpot.addin.xml          |    6 +-
 src/{ => Clients/MainApp/FSpot}/Accelerometer.cs   |    6 +-
 src/{ => Clients/MainApp/FSpot}/App.cs             |    1 +
 src/{ => Clients/MainApp/FSpot}/BitConverter.cs    |   22 +-
 src/{ => Clients/MainApp/FSpot}/ColorManagement.cs |    0
 src/{ => Clients/MainApp/FSpot}/ControlOverlay.cs  |   40 +-
 src/{ => Clients/MainApp/FSpot}/DragDropTargets.cs |   14 +-
 src/{ => Clients/MainApp/FSpot}/Fader.cs           |    8 +-
 .../MainApp/FSpot}/FolderQueryWidget.cs            |   46 +-
 src/{ => Clients/MainApp/FSpot}/FullScreenView.cs  |   44 +-
 src/{ => Clients/MainApp/FSpot}/GroupAdaptor.cs    |    6 +-
 src/{ => Clients/MainApp/FSpot}/GroupSelector.cs   |  272 +++---
 src/{ => Clients/MainApp/FSpot}/Histogram.cs       |   34 +-
 src/{ => Clients/MainApp/FSpot}/InfoOverlay.cs     |    6 +-
 src/{ => Clients/MainApp/FSpot}/ItemAction.cs      |   30 +-
 src/{ => Clients/MainApp/FSpot}/MainWindow.cs      | 1239 ++++++++++----------
 src/{ => Clients/MainApp/FSpot}/MemorySurface.cs   |   18 +-
 src/{ => Clients/MainApp/FSpot}/Photo.cs           |    0
 src/{ => Clients/MainApp/FSpot}/PhotoEventArgs.cs  |    0
 src/{ => Clients/MainApp/FSpot}/PhotoList.cs       |    2 +-
 src/{ => Clients/MainApp/FSpot}/PhotoLoader.cs     |    4 +-
 src/{ => Clients/MainApp/FSpot}/PhotoPopup.cs      |    4 +-
 src/{ => Clients/MainApp/FSpot}/PhotoQuery.cs      |   38 +-
 src/{ => Clients/MainApp/FSpot}/PhotoVersion.cs    |    0
 src/{ => Clients/MainApp/FSpot}/PhotoView.cs       |  132 +-
 src/{ => Clients/MainApp/FSpot}/PixbufCache.cs     |   54 +-
 src/{ => Clients/MainApp/FSpot}/Preferences.cs     |   24 +-
 src/{ => Clients/MainApp/FSpot}/PrintOperation.cs  |   14 +-
 src/{ => Clients/MainApp/FSpot}/ProgressItem.cs    |    3 +-
 src/{ => Clients/MainApp/FSpot}/QueryWidget.cs     |   49 +-
 src/{ => Clients/MainApp/FSpot}/RotateCommand.cs   |   40 +-
 .../MainApp/FSpot}/SelectionDataExtensions.cs      |   38 +-
 src/{ => Clients/MainApp/FSpot}/SendEmail.cs       |   60 +-
 src/{ => Clients/MainApp/FSpot}/SingleView.cs      |  108 +-
 src/{ => Clients/MainApp/FSpot}/TagQueryWidget.cs  |    6 +-
 .../MainApp/FSpot}/TagSelectionWidget.cs           |  385 +++---
 src/{ => Clients/MainApp/FSpot}/Term.cs            |   12 +-
 src/{ => Clients/MainApp/FSpot}/ThumbnailCache.cs  |    0
 .../MainApp/FSpot}/ThumbnailGenerator.cs           |    0
 src/{ => Clients/MainApp/FSpot}/TimeAdaptor.cs     |   38 +-
 src/{ => Clients/MainApp/FSpot}/TipWindow.cs       |    6 +-
 src/{ => Clients/MainApp/FSpot}/UriCollection.cs   |    3 +-
 src/{ => Clients/MainApp/FSpot}/Vector.cs          |    6 +-
 .../MainApp/FSpot}/XScreenSaverSlide.cs            |   20 +-
 src/{ => Clients/MainApp/FSpot}/main.cs            |    2 +-
 src/{ => Clients/MainApp}/ImageLoaderThread.cs     |   36 +-
 src/{ => Clients/MainApp}/JobStore.cs              |   17 +-
 src/Clients/MainApp/Makefile.am                    |  212 ++++
 src/{ => Clients/MainApp}/MetaStore.cs             |   24 +-
 src/{ => Clients/MainApp}/PhotoStore.cs            |   81 +-
 src/{ => Clients/MainApp}/PhotoTagMenu.cs          |    8 +-
 src/{ => Clients/MainApp}/PhotoVersionCommands.cs  |   22 +-
 src/{ => Clients/MainApp}/PhotoVersionMenu.cs      |    0
 src/{ => Clients/MainApp}/PixbufUtils.cs           |   72 +-
 src/{ => Clients/MainApp}/RollStore.cs             |    3 +-
 src/{ => Clients/MainApp}/TagCommands.cs           |    4 +-
 src/{ => Clients/MainApp}/TagPopup.cs              |    8 +-
 src/{ => Clients/MainApp}/TagStore.cs              |   25 +-
 src/{ => Clients/MainApp}/ThumbnailCommand.cs      |    4 +-
 src/{ => Clients/MainApp}/f-spot.exe.config.in     |    0
 src/{ => Clients/MainApp}/f-spot.glade             |    0
 src/{ => Clients/MainApp}/f-spot.in                |    6 +-
 src/Clients/MainApp/tmp                            |   83 ++
 src/{ => Clients/MainApp}/ui/import.ui             |    0
 src/{ => Clients/MainApp}/ui/mail_dialog.ui        |    0
 src/{ => Clients/MainApp}/ui/main_window.ui        |    0
 src/{ => Clients/MainApp}/ui/single_view.ui        |    0
 .../MainApp}/ui/tag_selection_dialog.ui            |    0
 .../MainApp}/ui/version_name_dialog.ui             |    0
 src/{ => Clients/MainApp}/ui/viewer_preferences.ui |    0
 src/Clients/Makefile.am                            |    2 +
 src/FSpot.Database/FSpotDatabaseConnection.cs      |   32 -
 src/FSpot.Database/Makefile.am                     |   14 -
 src/Makefile.am                                    |  220 +----
 205 files changed, 3069 insertions(+), 2984 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 74193f2..402ec7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -268,7 +268,7 @@ AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 
-AC_CONFIG_FILES([src/f-spot],[chmod +x src/f-spot])
+AC_CONFIG_FILES([src/Clients/MainApp/f-spot],[chmod +x src/Clients/MainApp/f-spot])
 
 GNOME_ICON_THEME_PREFIX=`$PKG_CONFIG --variable=prefix gnome-icon-theme`
 AC_SUBST(GNOME_ICON_THEME_PREFIX)
@@ -349,6 +349,8 @@ lib/Hyena/Hyena.Data.Sqlite/Makefile
 lib/Hyena/Hyena.Gui/Makefile
 lib/TagLib/Makefile
 
+src/AssemblyInfo.cs
+
 src/Core/Makefile
 src/Core/FSpot.Cms/Makefile
 src/Core/FSpot.Cms/FSpot.Cms.dll.config
@@ -356,6 +358,10 @@ src/Core/FSpot.Core/Makefile
 src/Core/FSpot.Core/FSpot.Core.dll.config
 src/Core/FSpot.Core/FSpot.Core/Defines.cs
 
+src/Clients/Makefile
+src/Clients/MainApp/Makefile
+src/Clients/MainApp/f-spot.exe.config
+
 docs/Makefile
 icons/Makefile
 tools/Makefile
@@ -364,12 +370,9 @@ src/Utils/Makefile
 src/Bling/Makefile
 src/JobScheduler/Makefile
 src/Query/Makefile
-src/FSpot.Database/Makefile
 src/Widgets/Makefile
 src/Widgets/FSpot.Widgets.dll.config
 src/Platform/Makefile
-src/AssemblyInfo.cs
-src/f-spot.exe.config
 src/Makefile
 extensions/Makefile
 extensions/Editors/Makefile
diff --git a/extensions/Tools/MergeDb/MergeDb.cs b/extensions/Tools/MergeDb/MergeDb.cs
index ccd997a..bd21b6c 100644
--- a/extensions/Tools/MergeDb/MergeDb.cs
+++ b/extensions/Tools/MergeDb/MergeDb.cs
@@ -15,6 +15,7 @@ using Gtk;
 
 using FSpot;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Extensions;
 using FSpot.Query;
 using FSpot.UI.Dialog;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 91b7db5..f592eb4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -51,90 +51,83 @@ extensions/Tools/MergeDb/PickFolderDialog.cs
 extensions/Tools/ScreensaverConfig/ScreensaverConfig.addin.xml
 [type: gettext/glade]extensions/Tools/ScreensaverConfig/ScreensaverConfigDialog.ui
 f-spot.schemas.in
-src/App.cs
-src/Editors/AutoStretchEditor.cs
-src/Editors/ColorEditor.cs
-src/Editors/CropEditor.cs
-src/Editors/DesaturateEditor.cs
-src/Editors/RedEyeEditor.cs
-src/Editors/SepiaEditor.cs
-src/Editors/SoftFocusEditor.cs
-src/Editors/TiltEditor.cs
-src/Filters/ResizeFilter.cs
-src/Filters/SharpFilter.cs
-src/FSpot.addin.xml
-src/f-spot.glade
-src/FullScreenView.cs
-src/GroupSelector.cs
-src/Imaging/ImageFile.cs
-src/Import/ImportController.cs
-src/Import/MetadataImporter.cs
-src/ItemAction.cs
-src/Jobs/SyncMetadataJob.cs
-src/Loupe.cs
-src/MainWindow.cs
-src/Photo.cs
-src/PhotoPopup.cs
-src/PhotoStore.cs
-src/PhotoTagMenu.cs
-src/PhotoVersionCommands.cs
-src/PhotoVersionMenu.cs
-src/PhotoView.cs
-src/Preferences.cs
-src/PrintOperation.cs
-src/QueryWidget.cs
-src/RotateCommand.cs
-src/SendEmail.cs
-src/Sharpener.cs
-src/SingleView.cs
-src/TagCommands.cs
-src/TagPopup.cs
-src/TagQueryWidget.cs
-src/TagSelectionWidget.cs
-src/TagStore.cs
-src/Term.cs
-src/ThumbnailCommand.cs
-src/UI.Dialog/AboutDialog.cs
-src/UI.Dialog/AdjustTimeDialog.cs
-src/UI.Dialog/DateRangeDialog.cs
-src/UI.Dialog/EditExceptionDialog.cs
-src/UI.Dialog/EditTagDialog.cs
-src/UI.Dialog/EditTagIconDialog.cs
-src/UI.Dialog/ImportDialog.cs
-src/UI.Dialog/ImportFailureDialog.cs
-src/UI.Dialog/PreferenceDialog.cs
-src/UI.Dialog/ProgressDialog.cs
-src/UI.Dialog/RepairDbDialog.cs
-src/UI.Dialog/SelectionRatioDialog.cs
-src/UI.Dialog/ThreadProgressDialog.cs
-[type: gettext/glade]src/UI.Dialog/ui/AdjustTimeDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/CreateTagDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/DateRangeDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/EditTagDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/EditTagIconDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/LastImportRollFilterDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/PreferenceDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/RatingFilterDialog.ui
-[type: gettext/glade]src/UI.Dialog/ui/RepairDialog.ui
-[type: gettext/glade]src/ui/import.ui
-[type: gettext/glade]src/ui/mail_dialog.ui
-[type: gettext/glade]src/ui/main_window.ui
-[type: gettext/glade]src/ui/single_view.ui
-[type: gettext/glade]src/ui/tag_selection_dialog.ui
-[type: gettext/glade]src/ui/viewer_preferences.ui
-src/Updater.cs
-src/Util.cs
-src/Utils/Unix.cs
+src/Clients/MainApp/FSpot.addin.xml
+src/Clients/MainApp/FSpot/App.cs
+src/Clients/MainApp/FSpot.Database/Updater.cs
+src/Clients/MainApp/FSpot.Editors/AutoStretchEditor.cs
+src/Clients/MainApp/FSpot.Editors/ColorEditor.cs
+src/Clients/MainApp/FSpot.Editors/CropEditor.cs
+src/Clients/MainApp/FSpot.Editors/DesaturateEditor.cs
+src/Clients/MainApp/FSpot.Editors/RedEyeEditor.cs
+src/Clients/MainApp/FSpot.Editors/SepiaEditor.cs
+src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
+src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
+src/Clients/MainApp/FSpot/FullScreenView.cs
+src/Clients/MainApp/f-spot.glade
+src/Clients/MainApp/FSpot/GroupSelector.cs
+src/Clients/MainApp/FSpot.Import/ImportController.cs
+src/Clients/MainApp/FSpot.Import/MetadataImporter.cs
+src/Clients/MainApp/FSpot/ItemAction.cs
+src/Clients/MainApp/FSpot.Jobs/SyncMetadataJob.cs
+src/Clients/MainApp/FSpot/MainWindow.cs
+src/Clients/MainApp/FSpot/Photo.cs
+src/Clients/MainApp/FSpot/PhotoView.cs
+src/Clients/MainApp/FSpot/Preferences.cs
+src/Clients/MainApp/FSpot/PrintOperation.cs
+src/Clients/MainApp/FSpot/QueryWidget.cs
+src/Clients/MainApp/FSpot/RotateCommand.cs
+src/Clients/MainApp/FSpot/SendEmail.cs
+src/Clients/MainApp/FSpot/SingleView.cs
+src/Clients/MainApp/FSpot/TagQueryWidget.cs
+src/Clients/MainApp/FSpot/TagSelectionWidget.cs
+src/Clients/MainApp/FSpot/Term.cs
+src/Clients/MainApp/FSpot.UI.Dialog/AboutDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/AdjustTimeDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/DateRangeDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/EditExceptionDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/EditTagDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/EditTagIconDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/ImportFailureDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/ProgressDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/RepairDbDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/SelectionRatioDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/ThreadProgressDialog.cs
+src/Clients/MainApp/FSpot.UI.Dialog/ui/AdjustTimeDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/CreateTagDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/DateRangeDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagIconDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/LastImportRollFilterDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/PreferenceDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/RatingFilterDialog.ui
+src/Clients/MainApp/FSpot.UI.Dialog/ui/RepairDialog.ui
+src/Clients/MainApp/FSpot.Widgets/EditorPage.cs
+src/Clients/MainApp/FSpot.Widgets/Filmstrip.cs
+src/Clients/MainApp/FSpot.Widgets/FindBar.cs
+src/Clients/MainApp/FSpot.Widgets/FolderTreePage.cs
+src/Clients/MainApp/FSpot.Widgets/FolderTreeView.cs
+src/Clients/MainApp/FSpot.Widgets/InfoBox.cs
+src/Clients/MainApp/FSpot.Widgets/MetadataDisplay.cs
+src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
+src/Clients/MainApp/FSpot.Widgets/Sharpener.cs
+src/Clients/MainApp/FSpot.Widgets/Sidebar.cs
+src/Clients/MainApp/FSpot.Widgets/TagMenu.cs
+src/Clients/MainApp/PhotoStore.cs
+src/Clients/MainApp/PhotoTagMenu.cs
+src/Clients/MainApp/PhotoVersionCommands.cs
+src/Clients/MainApp/PhotoVersionMenu.cs
+src/Clients/MainApp/TagCommands.cs
+src/Clients/MainApp/TagPopup.cs
+src/Clients/MainApp/TagStore.cs
+src/Clients/MainApp/ThumbnailCommand.cs
+src/Clients/MainApp/ui/import.ui
+src/Clients/MainApp/ui/mail_dialog.ui
+src/Clients/MainApp/ui/main_window.ui
+src/Clients/MainApp/ui/single_view.ui
+src/Clients/MainApp/ui/tag_selection_dialog.ui
+src/Clients/MainApp/ui/viewer_preferences.ui
 src/Widgets/CustomPrintWidget.cs
-src/Widgets/EditorPage.cs
-src/Widgets/Filmstrip.cs
-src/Widgets/FindBar.cs
-src/Widgets/FolderTreePage.cs
-src/Widgets/FolderTreeView.cs
-src/Widgets/InfoBox.cs
-src/Widgets/MetadataDisplay.cs
 src/Widgets/OpenWithMenu.cs
-src/Widgets/RatingMenuItem.cs
-src/Widgets/Sidebar.cs
-src/Widgets/TagMenu.cs
 tools/f-spot-screensaver.desktop.in
diff --git a/src/AssemblyInfo.cs.in b/src/AssemblyInfo.cs.in
index 6ce23d3..a64ead6 100644
--- a/src/AssemblyInfo.cs.in
+++ b/src/AssemblyInfo.cs.in
@@ -1,16 +1,64 @@
-/*
- * AssemblyInfo.cs
- *
- * Authors
- *   Stephane Delcroix <stephane delcroix org>
- *
- * This is free software. See COPYING for details.
- */
-
+using System;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
-[assembly: AssemblyVersion("@VERSION@")]
+[assembly: ApplicationVersion ("@VERSION@", "@DISPLAY_VERSION@")]
+[assembly: ApplicationBuildInformation ("@BUILD_VENDOR_ID@", "@BUILD_HOST_OS@", "@BUILD_HOST_CPU@", "@BUILD_TIME@")]
+
+[assembly: AssemblyVersion ("@ASM_VERSION@")]
 [assembly: AssemblyTitle ("F-Spot")]
-[assembly: AssemblyCopyright ("(c)2003-2008, Novell Inc")]
 [assembly: AssemblyDescription ("Personal photo management for the GNOME Desktop")]
+[assembly: AssemblyCopyright ("Copyright (C) 2003-2010 Novell Inc. and others")]
+[assembly: AssemblyCompany ("Novell, Inc.")]
+
+[AttributeUsage (AttributeTargets.Assembly, Inherited = false)]
+internal sealed class ApplicationVersionAttribute : Attribute
+{
+    private string release_version;
+    public string ReleaseVersion {
+        get { return release_version; }
+    }
+
+    private string display_version;
+    public string DisplayVersion {
+        get { return display_version; }
+    }
+
+    public ApplicationVersionAttribute (string releaseVersion, string displayVersion)
+    {
+        release_version = releaseVersion;
+        display_version = displayVersion;
+    }
+}
+
+[AttributeUsage (AttributeTargets.Assembly, Inherited = false)]
+internal sealed class ApplicationBuildInformationAttribute : Attribute
+{
+    private string vendor;
+    public string Vendor {
+        get { return vendor; }
+    }
+
+    private string host_os;
+    public string HostOperatingSystem {
+        get { return host_os; }
+    }
+
+    private string host_cpu;
+    public string HostCpu {
+        get { return host_cpu; }
+    }
+
+    private string build_time;
+    public string BuildTime {
+        get { return build_time; }
+    }
+
+    public ApplicationBuildInformationAttribute (string vendor, string hostOs, string hostCpu, string time)
+    {
+        this.vendor = vendor;
+        this.host_os = hostOs;
+        this.host_cpu = hostCpu;
+        this.build_time = time;
+    }
+}
diff --git a/src/DependentListStore.cs b/src/Clients/MainApp/DependentListStore.cs
similarity index 100%
rename from src/DependentListStore.cs
rename to src/Clients/MainApp/DependentListStore.cs
diff --git a/src/ExportStore.cs b/src/Clients/MainApp/ExportStore.cs
similarity index 95%
rename from src/ExportStore.cs
rename to src/Clients/MainApp/ExportStore.cs
index ab85756..c81956b 100644
--- a/src/ExportStore.cs
+++ b/src/Clients/MainApp/ExportStore.cs
@@ -45,7 +45,7 @@ public class ExportItem : DbItem {
 }
 
 public class ExportStore : DbStore<ExportItem> {
-	
+
 	public const string FlickrExportType = "fspot:Flickr";
 	public const string OldFolderExportType = "fspot:Folder"; //This is obsolete and meant to be remove once db reach rev4
 	public const string FolderExportType = "fspot:FolderUri";
@@ -67,13 +67,13 @@ public class ExportStore : DbStore<ExportItem> {
 
 	private ExportItem LoadItem (IDataReader reader)
 	{
-		return new ExportItem (Convert.ToUInt32 (reader["id"]), 
+		return new ExportItem (Convert.ToUInt32 (reader["id"]),
 				       Convert.ToUInt32 (reader["image_id"]),
-				       Convert.ToUInt32 (reader["image_version_id"]), 
-				       reader["export_type"].ToString (), 
+				       Convert.ToUInt32 (reader["image_version_id"]),
+				       reader["export_type"].ToString (),
 				       reader["export_token"].ToString ());
 	}
-	
+
 	private void LoadAllItems ()
 	{
 		IDataReader reader = Database.Query("SELECT id, image_id, image_version_id, export_type, export_token FROM exports");
@@ -89,7 +89,7 @@ public class ExportStore : DbStore<ExportItem> {
 	{
 		int id = Database.Execute(new HyenaSqliteCommand("INSERT INTO exports (image_id, image_version_id, export_type, export_token) VALUES (?, ?, ?, ?)",
 		image_id, image_version_id, export_type, export_token));
-		
+
 		ExportItem item = new ExportItem ((uint)id, image_id, image_version_id, export_type, export_token);
 
 		AddToCache (item);
@@ -97,15 +97,15 @@ public class ExportStore : DbStore<ExportItem> {
 
 		return item;
 	}
-	
+
 	public override void Commit (ExportItem item)
 	{
 		Database.Execute(new HyenaSqliteCommand("UPDATE exports SET image_id = ?, image_version_id = ?, export_type = ? SET export_token = ? WHERE id = ?",
                     item.ImageId, item.ImageVersionId, item.ExportType, item.ExportToken, item.Id));
-		
+
 		EmitChanged (item);
 	}
-	
+
 	public override ExportItem Get (uint id)
 	{
             // we never use this
@@ -114,7 +114,7 @@ public class ExportStore : DbStore<ExportItem> {
 
 	public ArrayList GetByImageId (uint image_id, uint image_version_id)
 	{
-        
+
 		IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT id, image_id, image_version_id, export_type, export_token FROM exports WHERE image_id = ? AND image_version_id = ?",
                     image_id, image_version_id));
 		ArrayList list = new ArrayList ();
@@ -125,7 +125,7 @@ public class ExportStore : DbStore<ExportItem> {
 
 		return list;
 	}
-	
+
 	public override void Remove (ExportItem item)
 	{
 		RemoveFromCache (item);
diff --git a/src/ColorAdjustment/Adjustment.cs b/src/Clients/MainApp/FSpot.ColorAdjustment/Adjustment.cs
similarity index 99%
rename from src/ColorAdjustment/Adjustment.cs
rename to src/Clients/MainApp/FSpot.ColorAdjustment/Adjustment.cs
index 15ac762..62f1474 100644
--- a/src/ColorAdjustment/Adjustment.cs
+++ b/src/Clients/MainApp/FSpot.ColorAdjustment/Adjustment.cs
@@ -1,6 +1,6 @@
 /*
  * Adjustment.cs
- * 
+ *
  * Copyright 2006, 2007 Novell Inc.
  *
  * Author
@@ -61,7 +61,7 @@ namespace FSpot.ColorAdjustment {
 							   Input.Width,
 							   Input.Height);
 			Cms.Profile [] list = GenerateAdjustments ().ToArray ();
-			
+
 			if (Input.HasAlpha) {
 				Gdk.Pixbuf input_copy = (Gdk.Pixbuf)Input.Clone ();
 				Pixbuf alpha = PixbufUtils.Flatten (Input);
@@ -79,7 +79,7 @@ namespace FSpot.ColorAdjustment {
 									     PixbufUtils.PixbufCmsFormat (Input),
 									     PixbufUtils.PixbufCmsFormat (final),
 									     intent, 0x0000);
-				
+
 				PixbufUtils.ColorAdjust (Input, final, transform);
 			}
 
diff --git a/src/ColorAdjustment/AutoStretch.cs b/src/Clients/MainApp/FSpot.ColorAdjustment/AutoStretch.cs
similarity index 98%
rename from src/ColorAdjustment/AutoStretch.cs
rename to src/Clients/MainApp/FSpot.ColorAdjustment/AutoStretch.cs
index d4dcaab..1037dee 100644
--- a/src/ColorAdjustment/AutoStretch.cs
+++ b/src/Clients/MainApp/FSpot.ColorAdjustment/AutoStretch.cs
@@ -1,6 +1,6 @@
 /*
  * AutoStretch.cs
- * 
+ *
  * Author
  *   Larry Ewing <lewing novell com>
  *   Ruben Vermeersch <ruben savanne be>
@@ -30,7 +30,7 @@ namespace FSpot.ColorAdjustment {
 				int high, low;
 				hist.GetHighLow (channel, out high, out low);
 				Log.DebugFormat ("high = {0}, low = {1}", high, low);
-				tables [channel] = StretchChannel (255, low / 255.0, high / 255.0); 
+				tables [channel] = StretchChannel (255, low / 255.0, high / 255.0);
 			}
 			profiles.Add (new Cms.Profile (IccColorSpace.Rgb, tables));
 			return profiles;
@@ -41,7 +41,7 @@ namespace FSpot.ColorAdjustment {
 			ushort [] entries = new ushort [count];
 			for (int i = 0; i < entries.Length; i++) {
 				double val = i / (double)entries.Length;
-				
+
 				if (high != low) {
 					val = Math.Max ((val - low), 0) / (high - low);
 				} else {
diff --git a/src/ColorAdjustment/Desaturate.cs b/src/Clients/MainApp/FSpot.ColorAdjustment/Desaturate.cs
similarity index 99%
rename from src/ColorAdjustment/Desaturate.cs
rename to src/Clients/MainApp/FSpot.ColorAdjustment/Desaturate.cs
index 4ee5990..f91bd6c 100644
--- a/src/ColorAdjustment/Desaturate.cs
+++ b/src/Clients/MainApp/FSpot.ColorAdjustment/Desaturate.cs
@@ -1,6 +1,6 @@
 /*
  * Desaturate.cs
- * 
+ *
  * Copyright 2006, 2007 Novell Inc.
  *
  * Author
diff --git a/src/ColorAdjustment/FullColorAdjustment.cs b/src/Clients/MainApp/FSpot.ColorAdjustment/FullColorAdjustment.cs
similarity index 89%
rename from src/ColorAdjustment/FullColorAdjustment.cs
rename to src/Clients/MainApp/FSpot.ColorAdjustment/FullColorAdjustment.cs
index 049d2b7..d5c4bc8 100644
--- a/src/ColorAdjustment/FullColorAdjustment.cs
+++ b/src/Clients/MainApp/FSpot.ColorAdjustment/FullColorAdjustment.cs
@@ -1,6 +1,6 @@
 /*
  * FullColorAdjustment.cs
- * 
+ *
  * Copyright 2006, 2007 Novell Inc.
  *
  * Author
@@ -25,10 +25,10 @@ namespace FSpot.ColorAdjustment {
 		private Cms.ColorCIEXYZ src_wp;
 		private Cms.ColorCIEXYZ dest_wp;
 
-		public FullColorAdjustment (Pixbuf input, Cms.Profile input_profile, 
-				double exposure, double brightness, double contrast, 
-				double hue, double saturation, 
-				Cms.ColorCIEXYZ src_wp, Cms.ColorCIEXYZ dest_wp) 
+		public FullColorAdjustment (Pixbuf input, Cms.Profile input_profile,
+				double exposure, double brightness, double contrast,
+				double hue, double saturation,
+				Cms.ColorCIEXYZ src_wp, Cms.ColorCIEXYZ dest_wp)
 			: base (input, input_profile)
 		{
 			this.exposure = exposure;
diff --git a/src/ColorAdjustment/SepiaTone.cs b/src/Clients/MainApp/FSpot.ColorAdjustment/SepiaTone.cs
similarity index 99%
rename from src/ColorAdjustment/SepiaTone.cs
rename to src/Clients/MainApp/FSpot.ColorAdjustment/SepiaTone.cs
index 73996fd..b8a4086 100644
--- a/src/ColorAdjustment/SepiaTone.cs
+++ b/src/Clients/MainApp/FSpot.ColorAdjustment/SepiaTone.cs
@@ -1,6 +1,6 @@
 /*
  * SepiaTone.cs
- * 
+ *
  * Copyright 2006, 2007 Novell Inc.
  *
  * Author
diff --git a/src/Db.cs b/src/Clients/MainApp/FSpot.Database/Db.cs
similarity index 96%
rename from src/Db.cs
rename to src/Clients/MainApp/FSpot.Database/Db.cs
index 4779ad7..c7b28c0 100644
--- a/src/Db.cs
+++ b/src/Clients/MainApp/FSpot.Database/Db.cs
@@ -10,6 +10,7 @@ using Hyena;
 
 // A Store maps to a SQL table.  We have separate stores (i.e. SQL tables) for tags, photos and imports.
 
+namespace FSpot.Database {
 public class DbException : ApplicationException {
 	public DbException(string msg) : base(msg)
 	{
@@ -142,10 +143,10 @@ public class Db : IDisposable {
 
 	TagStore tag_store;
 	PhotoStore photo_store;
- 	RollStore roll_store;
+	RollStore roll_store;
 	ExportStore export_store;
- 	JobStore job_store;
- 	MetaStore meta_store;
+	JobStore job_store;
+	MetaStore meta_store;
 	bool empty;
 	string path;
 
@@ -168,7 +169,7 @@ public class Db : IDisposable {
 	public PhotoStore Photos {
 		get { return photo_store; }
 	}
-	
+
 	public MetaStore Meta {
 		get { return meta_store; }
 	}
@@ -200,7 +201,7 @@ public class Db : IDisposable {
 						     i++,
 						     Path.GetExtension (path));
 		}
-		
+
 		File.Move (path, backup_path);
 		Init (path, true);
 
@@ -219,7 +220,7 @@ public class Db : IDisposable {
 		database = new FSpotDatabaseConnection (path);
 
 		// Load or create the meta table
- 		meta_store = new MetaStore (Database, new_db);
+		meta_store = new MetaStore (Database, new_db);
 
 		// Update the database schema if necessary
 		FSpot.Database.Updater.Run (Database);
@@ -230,7 +231,7 @@ public class Db : IDisposable {
 		roll_store = new RollStore (Database, new_db);
 		export_store = new ExportStore (Database, new_db);
 		job_store = new JobStore (Database, new_db);
- 		photo_store = new PhotoStore (Database, new_db);
+		photo_store = new PhotoStore (Database, new_db);
 
 		Database.CommitTransaction ();
 
@@ -284,5 +285,4 @@ public class Db : IDisposable {
 		Database.RollbackTransaction ();
 	}
 }
-
-
+}
diff --git a/src/Tests/UpdaterTests.cs b/src/Clients/MainApp/FSpot.Database/Tests/UpdaterTests.cs
similarity index 99%
rename from src/Tests/UpdaterTests.cs
rename to src/Clients/MainApp/FSpot.Database/Tests/UpdaterTests.cs
index 3ea22a6..e7e5e9d 100644
--- a/src/Tests/UpdaterTests.cs
+++ b/src/Clients/MainApp/FSpot.Database/Tests/UpdaterTests.cs
@@ -3,9 +3,8 @@ using NUnit.Framework;
 using System;
 using Hyena;
 using FSpot;
-using FSpot.Database;
 
-namespace FSpot.Tests
+namespace FSpot.Database.Tests
 {
     [TestFixture]
     public class UpdaterTests
diff --git a/src/Updater.cs b/src/Clients/MainApp/FSpot.Database/Updater.cs
similarity index 93%
rename from src/Updater.cs
rename to src/Clients/MainApp/FSpot.Database/Updater.cs
index a14cb47..faa5faa 100644
--- a/src/Updater.cs
+++ b/src/Clients/MainApp/FSpot.Database/Updater.cs
@@ -30,7 +30,7 @@ namespace FSpot.Database {
 				return keys[keys.Count - 1] as Version;
 			}
 		}
-		
+
 		static Updater () {
 			// Update from version 0 to 1: Remove empty Other tags
 			AddUpdate (new Version ("1"), delegate () {
@@ -42,10 +42,10 @@ namespace FSpot.Database {
 				// Don't do anything if there are subtags
 				string tag_count = SelectSingleString (
 					String.Format ("SELECT COUNT(*) FROM tags WHERE category_id = {0}", other_id));
-				
+
 				if (tag_count == null || System.Int32.Parse (tag_count) != 0)
 					return;
-				
+
 				// Don't do anything if there are photos tagged with this
 				string photo_count = SelectSingleString (
 					String.Format ("SELECT COUNT(*) FROM photo_tags WHERE tag_id = {0}", other_id));
@@ -65,7 +65,7 @@ namespace FSpot.Database {
 				if (tag_count == null || System.Int32.Parse (tag_count) == 0)
 					return;
 
- 				int id = ExecuteScalar ("INSERT INTO tags (name, category_id, is_category, icon) VALUES ('Other', 0, 1, 'stock_icon:f-spot-other.png')");
+				int id = ExecuteScalar ("INSERT INTO tags (name, category_id, is_category, icon) VALUES ('Other', 0, 1, 'stock_icon:f-spot-other.png')");
 
 				Execute (String.Format (
 					"UPDATE tags SET category_id = {0} WHERE id IN "		+
@@ -75,7 +75,7 @@ namespace FSpot.Database {
 
 				Log.Debug ("Other tag restored.  Sorry about that!");
 			});
-			
+
 			// Update from version 2 to 3: ensure that Hidden is the only tag left which is a real tag (not category)
 			AddUpdate (new Version ("3"), delegate () {
 				Execute ("UPDATE tags SET is_category = 1 WHERE name != 'Hidden'");
@@ -91,7 +91,7 @@ namespace FSpot.Database {
 			AddUpdate (new Version (4, 0), delegate () {});
 
 
-			//Version 5.0, add a roll_id field to photos, rename table 'imports' to 'rolls' 
+			//Version 5.0, add a roll_id field to photos, rename table 'imports' to 'rolls'
 			//and fix bgo 324425.
 			AddUpdate (new Version (5, 0), delegate () {
 				Log.Debug ("Will add a roll_id field to photos!");
@@ -119,7 +119,7 @@ namespace FSpot.Database {
 
 				Log.Debug ("Cleaning weird descriptions, fixes bug #324425.");
 				Execute ("UPDATE photos SET description = \"\" WHERE description LIKE \"Invalid size of entry%\"");
-			});				
+			});
 
 
 			//Version 6.0, change tag icon f-spot-tag-other to emblem-generic
@@ -145,7 +145,7 @@ namespace FSpot.Database {
 					"SELECT id, time, 'file://' || directory_path || '/' || name, 		" +
 					"description, roll_id, default_version_id FROM {0}", tmp_photos));
 			}, true);
-			
+
 			// Update to version 8.0, store full version uri
 			AddUpdate (new Version (8,0),delegate () {
 				string tmp_versions = MoveTableToTemp ("photo_versions");
@@ -161,14 +161,14 @@ namespace FSpot.Database {
 						"SELECT photo_id, version_id, name, uri " +
 						"FROM {0}, photos " +
 						"WHERE photo_id = id ", tmp_versions));
-		
+
 				while (reader.Read ()) {
 					System.Uri photo_uri = new System.Uri (reader [3] as string);
 					string name_without_extension = System.IO.Path.GetFileNameWithoutExtension (photo_uri.AbsolutePath);
 					string extension = System.IO.Path.GetExtension (photo_uri.AbsolutePath);
 
-					string uri = photo_uri.Scheme + "://" + 
-						photo_uri.Host + 
+					string uri = photo_uri.Scheme + "://" +
+						photo_uri.Host +
 						System.IO.Path.GetDirectoryName (photo_uri.AbsolutePath) + "/" +
 						name_without_extension + " (" + (reader [2]).ToString () + ")" + extension;
 
@@ -182,7 +182,7 @@ namespace FSpot.Database {
 				}
 
 			}, true);
-			
+
 			// Update to version 9.0
 			AddUpdate (new Version (9,0),delegate () {
 				string tmp_versions = MoveTableToTemp ("photo_versions");
@@ -200,50 +200,50 @@ namespace FSpot.Database {
 					"FROM {0} ", tmp_versions));
 			});
 
- 			// Update to version 10.0, make id autoincrement
- 			AddUpdate (new Version (10,0),delegate () {
- 				string tmp_photos = MoveTableToTemp ("photos");
+			// Update to version 10.0, make id autoincrement
+			AddUpdate (new Version (10,0),delegate () {
+				string tmp_photos = MoveTableToTemp ("photos");
 				Execute (
- 					"CREATE TABLE photos (                                     " +
- 					"	id                 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
- 					"	time               INTEGER NOT NULL,	   	   " +
- 					"	uri		   STRING NOT NULL,		   " +
- 					"	description        TEXT NOT NULL,	           " +
- 					"	roll_id            INTEGER NOT NULL,		   " +
- 					"	default_version_id INTEGER NOT NULL		   " +
- 					")");
- 
+					"CREATE TABLE photos (                                     " +
+					"	id                 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
+					"	time               INTEGER NOT NULL,	   	   " +
+					"	uri		   STRING NOT NULL,		   " +
+					"	description        TEXT NOT NULL,	           " +
+					"	roll_id            INTEGER NOT NULL,		   " +
+					"	default_version_id INTEGER NOT NULL		   " +
+					")");
+
 				Execute (String.Format (
- 					"INSERT INTO photos (id, time, uri, description, roll_id, default_version_id) " +
- 					"SELECT id, time, uri, description, roll_id, default_version_id  " + 
- 					"FROM  {0} ", tmp_photos));
- 			}, false);
- 
+					"INSERT INTO photos (id, time, uri, description, roll_id, default_version_id) " +
+					"SELECT id, time, uri, description, roll_id, default_version_id  " +
+					"FROM  {0} ", tmp_photos));
+			}, false);
+
 			// Update to version 11.0, rating
 			AddUpdate (new Version (11,0),delegate () {
- 				string tmp_photos = MoveTableToTemp ("photos");
- 				Execute (
- 					"CREATE TABLE photos (                                     " +
- 					"	id                 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
- 					"	time               INTEGER NOT NULL,	   	   " +
- 					"	uri		   STRING NOT NULL,		   " +
- 					"	description        TEXT NOT NULL,	           " +
- 					"	roll_id            INTEGER NOT NULL,		   " +
- 					"	default_version_id INTEGER NOT NULL,		   " +
+				string tmp_photos = MoveTableToTemp ("photos");
+				Execute (
+					"CREATE TABLE photos (                                     " +
+					"	id                 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
+					"	time               INTEGER NOT NULL,	   	   " +
+					"	uri		   STRING NOT NULL,		   " +
+					"	description        TEXT NOT NULL,	           " +
+					"	roll_id            INTEGER NOT NULL,		   " +
+					"	default_version_id INTEGER NOT NULL,		   " +
 					"       rating             INTEGER NULL			   " +
- 					")");
- 
- 				Execute (String.Format (
- 					"INSERT INTO photos (id, time, uri, description, roll_id, default_version_id, rating) " +
- 					"SELECT id, time, uri, description, roll_id, default_version_id, null  " + 
- 					"FROM  {0} ", tmp_photos));
+					")");
+
+				Execute (String.Format (
+					"INSERT INTO photos (id, time, uri, description, roll_id, default_version_id, rating) " +
+					"SELECT id, time, uri, description, roll_id, default_version_id, null  " +
+					"FROM  {0} ", tmp_photos));
 			});
 
 			//Update to version 12.0, remove dead associations, bgo #507950, #488545
 			AddUpdate (new Version (12, 0), delegate () {
 				Execute ("DELETE FROM photo_tags WHERE tag_id NOT IN (SELECT id FROM tags)");
 			});
-			
+
 			// Update to version 13.0
 			AddUpdate (new Version (13,0), delegate () {
 				Execute ("UPDATE photos SET rating = 0 WHERE rating IS NULL");
@@ -285,7 +285,7 @@ namespace FSpot.Database {
 			// Update to version 16.0
 			 AddUpdate (new Version (16,0), delegate () {
 				 string temp_table = MoveTableToTemp ("photos");
-  
+
 				 Execute ("CREATE TABLE photos ( " +
 					  "	id                 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,   " +
 					  "	time               INTEGER NOT NULL,	   	   " +
@@ -297,12 +297,12 @@ namespace FSpot.Database {
 					  "	md5_sum		   TEXT NULL  			   " +
 					  ")"
 				 );
-  
-				 Execute (string.Format ("INSERT INTO photos (id, time, uri, description, roll_id, " + 
-							 "default_version_id, rating, md5_sum) " + 
+
+				 Execute (string.Format ("INSERT INTO photos (id, time, uri, description, roll_id, " +
+							 "default_version_id, rating, md5_sum) " +
 							 "SELECT id, time, uri, description, roll_id, " +
 							 "       default_version_id, rating, '' " +
-							 "FROM   {0} ", 
+							 "FROM   {0} ",
 							 temp_table
 							)
 				 );
@@ -319,9 +319,9 @@ namespace FSpot.Database {
 					  "	protected	BOOLEAN		" +
 					  ")");
 
-				 Execute (String.Format ("INSERT INTO photo_versions (photo_id, version_id, name, uri, md5_sum, protected) " + 
+				 Execute (String.Format ("INSERT INTO photo_versions (photo_id, version_id, name, uri, md5_sum, protected) " +
 							 "SELECT photo_id, version_id, name, uri, '', protected " +
-							 "FROM   {0} ", 
+							 "FROM   {0} ",
 							 temp_versions_table
 							)
 				 );
@@ -358,7 +358,7 @@ namespace FSpot.Database {
 			// Update to version 16.4
 			AddUpdate (new Version (16,4), delegate () { //fix the tables schema EOL
 				string temp_table = MoveTableToTemp ("exports");
-			 	Execute (
+				Execute (
 					"CREATE TABLE exports (\n" +
 					"	id			INTEGER PRIMARY KEY NOT NULL, \n" +
 					"	image_id		INTEGER NOT NULL, \n" +
@@ -367,7 +367,7 @@ namespace FSpot.Database {
 					"	export_token		TEXT NOT NULL\n" +
 					")");
 				Execute (String.Format (
-					"INSERT INTO exports (id, image_id, image_version_id, export_type, export_token) " + 
+					"INSERT INTO exports (id, image_id, image_version_id, export_type, export_token) " +
 					"SELECT id, image_id, image_version_id, export_type, export_token " +
 					"FROM {0}", temp_table));
 
@@ -398,7 +398,7 @@ namespace FSpot.Database {
 					"FROM {0}", temp_table));
 
 				temp_table = MoveTableToTemp ("photos");
-				Execute ( 
+				Execute (
 					"CREATE TABLE photos (\n" +
 					"	id			INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \n" +
 					"	time			INTEGER NOT NULL, \n" +
@@ -495,12 +495,12 @@ namespace FSpot.Database {
 				Execute ("UPDATE photos SET md5_sum = NULL WHERE md5_sum = ''");
 				Execute ("UPDATE photo_versions SET md5_sum = NULL WHERE md5_sum = ''");
 			});
-			
+
 			// Update to version 17.0, split uri and filename
 			AddUpdate (new Version (17,0),delegate () {
 				string tmp_photos = MoveTableToTemp ("photos");
 				string tmp_versions = MoveTableToTemp ("photo_versions");
-				
+
 				Execute (
 					"CREATE TABLE photos (\n" +
 					"	id			INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \n" +
@@ -513,7 +513,7 @@ namespace FSpot.Database {
 					"	rating			INTEGER NULL, \n" +
 					"	md5_sum			TEXT NULL\n" +
 					")");
-				
+
 				Execute (
 					"CREATE TABLE photo_versions (\n"+
 					"	photo_id	INTEGER, \n" +
@@ -525,14 +525,14 @@ namespace FSpot.Database {
 					"	protected	BOOLEAN, \n" +
 					"	UNIQUE (photo_id, version_id)\n" +
 					")");
-				
+
 				IDataReader reader = ExecuteReader (String.Format (
 					"SELECT id, time, uri, description, roll_id, default_version_id, rating, md5_sum " +
 					"FROM {0} ", tmp_photos));
-		
+
 				while (reader.Read ()) {
 					System.Uri photo_uri = new System.Uri (reader ["uri"] as string);
-					
+
 					string filename = photo_uri.GetFilename ();
 					Uri base_uri = photo_uri.GetDirectoryUri ();
 
@@ -551,21 +551,21 @@ namespace FSpot.Database {
 						Convert.ToUInt32 (reader ["rating"]),
 						String.IsNullOrEmpty (md5) ? null : md5));
 				}
-				
+
 				reader.Close ();
-				
+
 				reader = ExecuteReader (String.Format (
 						"SELECT photo_id, version_id, name, uri, md5_sum, protected " +
 						"FROM {0} ", tmp_versions));
-				
+
 				while (reader.Read ()) {
 					System.Uri photo_uri = new System.Uri (reader ["uri"] as string);
-					
+
 					string filename = photo_uri.GetFilename ();
 					Uri base_uri = photo_uri.GetDirectoryUri ();
 
 					string md5 = reader["md5_sum"] != null ? reader ["md5_sum"].ToString () : null;
-					
+
 					Execute (new HyenaSqliteCommand (
 						"INSERT INTO photo_versions (photo_id, version_id, name, base_uri, filename, protected, md5_sum) " +
 						"VALUES (?, ?, ?, ?, ?, ?, ?)",
@@ -577,18 +577,18 @@ namespace FSpot.Database {
 						Convert.ToBoolean (reader["protected"]),
 						String.IsNullOrEmpty (md5) ? null : md5));
 				}
-				
+
 				Execute ("CREATE INDEX idx_photos_roll_id ON photos(roll_id)");
 				Execute ("CREATE INDEX idx_photo_versions_id ON photo_versions(photo_id)");
-				
+
 
 			}, true);
 
 			// Update to version 17.1, Rename 'Import Tags' to 'Imported Tags'
-			AddUpdate (new Version (17,1),delegate () {	
+			AddUpdate (new Version (17,1),delegate () {
 				Execute ("UPDATE tags SET name = 'Imported Tags' WHERE name = 'Import Tags'");
 			});
-			
+
 			// Update to version 17.2, Make sure every photo has an Original version in photo_versions
 			AddUpdate (new Version(17,2),delegate () {
 				// Find photos that have no original version;
@@ -759,19 +759,19 @@ namespace FSpot.Database {
 				// Pass the exception on, this is fatal
 				throw e;
 			}
-			
+
 			if (dialog != null)
 				dialog.Destroy ();
-			
+
 			if (db_version == LatestVersion && !silent)
 				Log.InformationTimerPrint (timer, "Database updates completed successfully (in {0}).");
 		}
-		
+
 		private static void AddUpdate (Version version, UpdateCode code)
 		{
 			AddUpdate (version, code, false);
 		}
-		
+
 		private static void AddUpdate (Version version, UpdateCode code, bool is_slow)
 		{
 			updates[version] = new Update (version, code, is_slow);
@@ -794,7 +794,7 @@ namespace FSpot.Database {
 		{
 			return db.Execute (command);
 		}
-		
+
 		private static int ExecuteScalar (string statement)
 		{
 			return db.Execute(statement);
@@ -804,7 +804,7 @@ namespace FSpot.Database {
 		{
 			return db.Query (statement);
 		}
-		
+
 		private static bool TableExists (string table)
 		{
 			return db.TableExists (table);
@@ -824,10 +824,10 @@ namespace FSpot.Database {
 		private static string MoveTableToTemp (string table_name)
 		{
 			string temp_name = table_name + "_temp";
-			
+
 			// Get the table definition for the table we are copying
 			string sql = SelectSingleString (String.Format ("SELECT sql FROM sqlite_master WHERE tbl_name = '{0}' AND type = 'table' ORDER BY type DESC", table_name));
-			
+
 			// Drop temp table if already exists
 			Execute ("DROP TABLE IF EXISTS " + temp_name);
 
@@ -836,7 +836,7 @@ namespace FSpot.Database {
 
 			// Copy the data
 			ExecuteScalar (String.Format ("INSERT INTO {0} SELECT * FROM {1}", temp_name, table_name));
-				
+
 			// Delete the original table
 			Execute ("DROP TABLE " + table_name);
 
@@ -849,7 +849,7 @@ namespace FSpot.Database {
 			public Version Version;
 			private UpdateCode code;
 			public bool IsSlow = false;
-			
+
 			public Update (Version to_version, UpdateCode code, bool slow)
 			{
 				this.Version = to_version;
@@ -866,7 +866,7 @@ namespace FSpot.Database {
 			public void Execute (HyenaSqliteConnection db, Version db_version)
 			{
 				code ();
-				
+
 				if (!silent)
 					Log.DebugFormat ("Updated database from version {0} to {1}",
 							db_version.ToString (),
@@ -916,7 +916,7 @@ namespace FSpot.Database {
 			{
 				return Compare (this, version);
 			}
-	
+
 			public static int Compare (Version v1, Version v2)
 			{
 				if (v1.maj == v2.maj)
@@ -971,5 +971,5 @@ namespace FSpot.Database {
 				return !(v1 < v2);
 			}
 		}
-	} 
+	}
 }
diff --git a/src/Editors/AutoStretchEditor.cs b/src/Clients/MainApp/FSpot.Editors/AutoStretchEditor.cs
similarity index 100%
rename from src/Editors/AutoStretchEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/AutoStretchEditor.cs
diff --git a/src/Editors/ColorEditor.cs b/src/Clients/MainApp/FSpot.Editors/ColorEditor.cs
similarity index 100%
rename from src/Editors/ColorEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/ColorEditor.cs
diff --git a/src/Editors/CropEditor.cs b/src/Clients/MainApp/FSpot.Editors/CropEditor.cs
similarity index 100%
rename from src/Editors/CropEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/CropEditor.cs
diff --git a/src/Editors/DesaturateEditor.cs b/src/Clients/MainApp/FSpot.Editors/DesaturateEditor.cs
similarity index 100%
rename from src/Editors/DesaturateEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/DesaturateEditor.cs
diff --git a/src/Editors/Editor.cs b/src/Clients/MainApp/FSpot.Editors/Editor.cs
similarity index 100%
rename from src/Editors/Editor.cs
rename to src/Clients/MainApp/FSpot.Editors/Editor.cs
diff --git a/src/Editors/RedEyeEditor.cs b/src/Clients/MainApp/FSpot.Editors/RedEyeEditor.cs
similarity index 100%
rename from src/Editors/RedEyeEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/RedEyeEditor.cs
diff --git a/src/Editors/SepiaEditor.cs b/src/Clients/MainApp/FSpot.Editors/SepiaEditor.cs
similarity index 100%
rename from src/Editors/SepiaEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/SepiaEditor.cs
diff --git a/src/Editors/SoftFocusEditor.cs b/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
similarity index 99%
rename from src/Editors/SoftFocusEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
index 8f63796..592d06f 100644
--- a/src/Editors/SoftFocusEditor.cs
+++ b/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
@@ -59,11 +59,11 @@ namespace FSpot.Editors
 			using (ImageInfo info = new ImageInfo (input)) {
 				using (Widgets.SoftFocus soft = new Widgets.SoftFocus (info)) {
 					soft.Radius = radius;
-	
+
 					using (MemorySurface surface = new MemorySurface (Format.Argb32,
 										   input.Width,
 										   input.Height)) {
-	
+
 						using (Context ctx = new Context (surface)) {
 							soft.Apply (ctx, info.Bounds);
 						}
diff --git a/src/Editors/TiltEditor.cs b/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
similarity index 98%
rename from src/Editors/TiltEditor.cs
rename to src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
index 593e87e..a238e9c 100644
--- a/src/Editors/TiltEditor.cs
+++ b/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
@@ -6,7 +6,7 @@
  *	Stephane Delcroix <stephane delcroix org>
  *
  * Copyright (c) 2009 Stephane Delcroix
- * 
+ *
  * This is free software. See COPYING for details.
  */
 
@@ -60,7 +60,7 @@ namespace FSpot.Editors
 					using (Context ctx = new Context (surface)) {
 						ctx.Matrix = info.Fill (info.Bounds, angle);
 						using (SurfacePattern p = new SurfacePattern (info.Surface)) {
-							if (fast) 
+							if (fast)
 								p.Filter =  Filter.Fast;
 							ctx.Source = p;
 							ctx.Paint ();
diff --git a/src/Extensions/CommandMenuItemNode.cs b/src/Clients/MainApp/FSpot.Extensions/CommandMenuItemNode.cs
similarity index 100%
rename from src/Extensions/CommandMenuItemNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/CommandMenuItemNode.cs
diff --git a/src/Extensions/ComplexMenuItemNode.cs b/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
similarity index 99%
rename from src/Extensions/ComplexMenuItemNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
index 84ea3a5..86bfa5b 100644
--- a/src/Extensions/ComplexMenuItemNode.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
@@ -29,7 +29,7 @@ namespace FSpot.Extensions
 		{
 			ComplexMenuItem item = System.Activator.CreateInstance (Type.GetType (widget_type), parent) as ComplexMenuItem;
 			cmd = (ICommand) Addin.CreateInstance (command_type);
-			
+
 			if (item != null)
 				item.Changed += OnChanged;
 			return item;
diff --git a/src/Extensions/ExportMenuItemNode.cs b/src/Clients/MainApp/FSpot.Extensions/ExportMenuItemNode.cs
similarity index 100%
rename from src/Extensions/ExportMenuItemNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/ExportMenuItemNode.cs
diff --git a/src/Extensions/ICommand.cs b/src/Clients/MainApp/FSpot.Extensions/ICommand.cs
similarity index 100%
rename from src/Extensions/ICommand.cs
rename to src/Clients/MainApp/FSpot.Extensions/ICommand.cs
diff --git a/src/Extensions/IExporter.cs b/src/Clients/MainApp/FSpot.Extensions/IExporter.cs
similarity index 100%
rename from src/Extensions/IExporter.cs
rename to src/Clients/MainApp/FSpot.Extensions/IExporter.cs
diff --git a/src/Extensions/IMenuGenerator.cs b/src/Clients/MainApp/FSpot.Extensions/IMenuGenerator.cs
similarity index 100%
rename from src/Extensions/IMenuGenerator.cs
rename to src/Clients/MainApp/FSpot.Extensions/IMenuGenerator.cs
diff --git a/src/Extensions/IService.cs b/src/Clients/MainApp/FSpot.Extensions/IService.cs
similarity index 100%
rename from src/Extensions/IService.cs
rename to src/Clients/MainApp/FSpot.Extensions/IService.cs
diff --git a/src/Extensions/MenuNode.cs b/src/Clients/MainApp/FSpot.Extensions/MenuNode.cs
similarity index 97%
rename from src/Extensions/MenuNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/MenuNode.cs
index 1d13923..62d98a6 100644
--- a/src/Extensions/MenuNode.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/MenuNode.cs
@@ -31,8 +31,8 @@ namespace FSpot.Extensions
 			Gtk.Menu submenu = GetSubmenu (parent);
 
 			if (item.Submenu != null)
-				item.Submenu.Dispose ();	
-			
+				item.Submenu.Dispose ();
+
 			item.Submenu = submenu;
 			return item;
 		}
@@ -49,7 +49,7 @@ namespace FSpot.Extensions
 			foreach (MenuNode node in ChildNodes)
 				submenu.Insert (node.GetMenuItem (parent), -1);
 
-			return submenu;				
+			return submenu;
 		}
 	}
 
@@ -64,7 +64,7 @@ namespace FSpot.Extensions
 		public override Gtk.MenuItem GetMenuItem (object parent)
 		{
 			Gtk.MenuItem item = base.GetMenuItem (parent);
-			menu_generator = (IMenuGenerator) Addin.CreateInstance (command_type); 
+			menu_generator = (IMenuGenerator) Addin.CreateInstance (command_type);
 			item.Submenu = menu_generator.GetMenu ();
 			item.Activated += menu_generator.OnActivated;
 			return item;
diff --git a/src/Extensions/PhotoSelectionCondition.cs b/src/Clients/MainApp/FSpot.Extensions/PhotoSelectionCondition.cs
similarity index 98%
rename from src/Extensions/PhotoSelectionCondition.cs
rename to src/Clients/MainApp/FSpot.Extensions/PhotoSelectionCondition.cs
index 9649f78..d937e46 100644
--- a/src/Extensions/PhotoSelectionCondition.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/PhotoSelectionCondition.cs
@@ -12,10 +12,10 @@ using Mono.Addins;
 
 namespace FSpot.Extensions
 {
-	// Defines a selection condition, which determines the number of photos 
+	// Defines a selection condition, which determines the number of photos
 	// selected.
 	//
-	// There are two valid values for the "selection" attribute, which 
+	// There are two valid values for the "selection" attribute, which
 	// should be added to the Condition tag.
 	//   - single: One photo is selected
 	//   - multiple: Multiple photos are selected
diff --git a/src/Extensions/PopupCommands.cs b/src/Clients/MainApp/FSpot.Extensions/PopupCommands.cs
similarity index 98%
rename from src/Extensions/PopupCommands.cs
rename to src/Clients/MainApp/FSpot.Extensions/PopupCommands.cs
index 95f00d7..e4f1640 100644
--- a/src/Extensions/PopupCommands.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/PopupCommands.cs
@@ -12,14 +12,14 @@ using System;
 using GLib;
 using FSpot.Widgets;
 
-namespace FSpot.Extensions 
+namespace FSpot.Extensions
 {
 	public class Copy : ICommand
 	{
 		public void Run (object o, EventArgs e)
 		{
 			App.Instance.Organizer.HandleCopy (o, e);
-		}		
+		}
 	}
 
 	public class Rotate270 : ICommand
diff --git a/src/Extensions/ServiceNode.cs b/src/Clients/MainApp/FSpot.Extensions/ServiceNode.cs
similarity index 99%
rename from src/Extensions/ServiceNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/ServiceNode.cs
index 32e8952..6bc3abe 100644
--- a/src/Extensions/ServiceNode.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/ServiceNode.cs
@@ -14,7 +14,7 @@ using Mono.Addins;
 namespace FSpot.Extensions
 {
 	public class ServiceNode : ExtensionNode
-	{	
+	{
 		[NodeAttribute ("class", true)]
 		protected string class_name;
 
diff --git a/src/Extensions/SidebarPage.cs b/src/Clients/MainApp/FSpot.Extensions/SidebarPage.cs
similarity index 96%
rename from src/Extensions/SidebarPage.cs
rename to src/Clients/MainApp/FSpot.Extensions/SidebarPage.cs
index a8eecdb..cae8823 100644
--- a/src/Extensions/SidebarPage.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/SidebarPage.cs
@@ -29,7 +29,7 @@ namespace FSpot.Extensions
 		// Whether this page can be selected
 		private bool can_select;
 		public bool CanSelect {
-			protected set { 
+			protected set {
 				can_select = value;
 				if (CanSelectChanged != null)
 					CanSelectChanged (this, null);
@@ -55,8 +55,8 @@ namespace FSpot.Extensions
 		private Gtk.Widget sidebar;
 		public Gtk.Widget Sidebar {
 			get { return sidebar; }
-			set { 
-				sidebar = value; 
+			set {
+				sidebar = value;
 				AddedToSidebar ();
 			}
 		}
diff --git a/src/Extensions/SidebarPageNode.cs b/src/Clients/MainApp/FSpot.Extensions/SidebarPageNode.cs
similarity index 100%
rename from src/Extensions/SidebarPageNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/SidebarPageNode.cs
diff --git a/src/Extensions/TransitionNode.cs b/src/Clients/MainApp/FSpot.Extensions/TransitionNode.cs
similarity index 99%
rename from src/Extensions/TransitionNode.cs
rename to src/Clients/MainApp/FSpot.Extensions/TransitionNode.cs
index 1738125..2da9f5d 100644
--- a/src/Extensions/TransitionNode.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/TransitionNode.cs
@@ -18,7 +18,7 @@ using FSpot.Widgets;
 namespace FSpot.Extensions
 {
 	public class TransitionNode : ExtensionNode
-	{	
+	{
 		[NodeAttribute ("transition_type", true)]
 		protected string class_name;
 
diff --git a/src/Extensions/ViewModeCondition.cs b/src/Clients/MainApp/FSpot.Extensions/ViewModeCondition.cs
similarity index 96%
rename from src/Extensions/ViewModeCondition.cs
rename to src/Clients/MainApp/FSpot.Extensions/ViewModeCondition.cs
index acd18ae..a17fdea 100644
--- a/src/Extensions/ViewModeCondition.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/ViewModeCondition.cs
@@ -20,7 +20,7 @@ namespace FSpot.Extensions
 
 	// Defines a view mode condition, which determines which view mode is used.
 	//
-	// There are two valid values for the "mode" attribute, which 
+	// There are two valid values for the "mode" attribute, which
 	// should be added to the Condition tag.
 	//   - single: Single view mode.
 	//   - library: Full F-Spot mode.
diff --git a/src/Filters/ChmodFilter.cs b/src/Clients/MainApp/FSpot.Filters/ChmodFilter.cs
similarity index 94%
rename from src/Filters/ChmodFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/ChmodFilter.cs
index 622bb5b..2997a03 100644
--- a/src/Filters/ChmodFilter.cs
+++ b/src/Clients/MainApp/FSpot.Filters/ChmodFilter.cs
@@ -10,9 +10,9 @@
 using Mono.Unix.Native;
 
 namespace FSpot.Filters {
-	public class ChmodFilter : IFilter 
-	{	
-		
+	public class ChmodFilter : IFilter
+	{
+
 		FilePermissions mode;
 
 		public ChmodFilter () : this (FilePermissions.S_IRUSR |
diff --git a/src/Filters/FilterRequest.cs b/src/Clients/MainApp/FSpot.Filters/FilterRequest.cs
similarity index 97%
rename from src/Filters/FilterRequest.cs
rename to src/Clients/MainApp/FSpot.Filters/FilterRequest.cs
index c0ad7a7..c996037 100644
--- a/src/Filters/FilterRequest.cs
+++ b/src/Clients/MainApp/FSpot.Filters/FilterRequest.cs
@@ -42,10 +42,10 @@ namespace FSpot.Filters {
 
 		public SafeUri Current {
 			get { return current; }
-			set { 
+			set {
 				if (!value.Equals (source) && !temp_uris.Contains (value))
 					temp_uris.Add (value);
-				current = value; 
+				current = value;
 			}
 		}
 
@@ -66,12 +66,12 @@ namespace FSpot.Filters {
 			Close ();
 			System.GC.SuppressFinalize (this);
 		}
-		
+
 		public SafeUri TempUri ()
 		{
 			return TempUri (null);
 		}
-		
+
 		public SafeUri TempUri (string extension)
 		{
 			string imgtemp;
diff --git a/src/Filters/FilterSet.cs b/src/Clients/MainApp/FSpot.Filters/FilterSet.cs
similarity index 95%
rename from src/Filters/FilterSet.cs
rename to src/Clients/MainApp/FSpot.Filters/FilterSet.cs
index 124fb13..33af8df 100644
--- a/src/Filters/FilterSet.cs
+++ b/src/Clients/MainApp/FSpot.Filters/FilterSet.cs
@@ -1,10 +1,10 @@
-/* 
+/*
  * Filters/FilterSet.cs
  *
- * Authors: 
+ * Authors:
  *   Larry Ewing <lewing novell com>
  *   Stephane Delcroix <stephane delcroix org>
- * 
+ *
  * I don't like per file copyright notices.
  */
 
@@ -13,16 +13,16 @@ using System.Collections;
 namespace FSpot.Filters {
 	public class FilterSet : IFilter {
 		public ArrayList list;
-	
+
 		public FilterSet () {
 			list = new ArrayList ();
 		}
-		
+
 		public void Add (IFilter filter)
 		{
 			list.Add (filter);
 		}
-		
+
 		public bool Convert (FilterRequest req)
 		{
 			bool changed = false;
diff --git a/src/Filters/IFilter.cs b/src/Clients/MainApp/FSpot.Filters/IFilter.cs
similarity index 100%
rename from src/Filters/IFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/IFilter.cs
diff --git a/src/Filters/JpegFilter.cs b/src/Clients/MainApp/FSpot.Filters/JpegFilter.cs
similarity index 100%
rename from src/Filters/JpegFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/JpegFilter.cs
diff --git a/src/Filters/ResizeFilter.cs b/src/Clients/MainApp/FSpot.Filters/ResizeFilter.cs
similarity index 100%
rename from src/Filters/ResizeFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/ResizeFilter.cs
diff --git a/src/Filters/SharpFilter.cs b/src/Clients/MainApp/FSpot.Filters/SharpFilter.cs
similarity index 100%
rename from src/Filters/SharpFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/SharpFilter.cs
diff --git a/src/Filters/UniqueNameFilter.cs b/src/Clients/MainApp/FSpot.Filters/UniqueNameFilter.cs
similarity index 99%
rename from src/Filters/UniqueNameFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/UniqueNameFilter.cs
index 01261c1..bf0f50e 100644
--- a/src/Filters/UniqueNameFilter.cs
+++ b/src/Clients/MainApp/FSpot.Filters/UniqueNameFilter.cs
@@ -36,7 +36,7 @@ namespace FSpot.Filters {
 						System.IO.Path.GetExtension (filename));
 				dest = System.IO.Path.Combine (path, numbered_name);
 			}
-			
+
 			System.IO.File.Copy (request.Current.LocalPath, dest);
 			request.Current = new SafeUri (dest);
 			return true;
diff --git a/src/Filters/WhiteListFilter.cs b/src/Clients/MainApp/FSpot.Filters/WhiteListFilter.cs
similarity index 94%
rename from src/Filters/WhiteListFilter.cs
rename to src/Clients/MainApp/FSpot.Filters/WhiteListFilter.cs
index 968f1da..91e239e 100644
--- a/src/Filters/WhiteListFilter.cs
+++ b/src/Clients/MainApp/FSpot.Filters/WhiteListFilter.cs
@@ -9,8 +9,8 @@
  */
 
 namespace FSpot.Filters {
-	public class WhiteListFilter : IFilter 
-	{	
+	public class WhiteListFilter : IFilter
+	{
 		System.Collections.ArrayList valid_extensions;
 
 		public WhiteListFilter (string [] valid_extensions)
diff --git a/src/Imaging/Ciff.cs b/src/Clients/MainApp/FSpot.Imaging/Ciff.cs
similarity index 95%
rename from src/Imaging/Ciff.cs
rename to src/Clients/MainApp/FSpot.Imaging/Ciff.cs
index d60c7d3..7545e74 100644
--- a/src/Imaging/Ciff.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/Ciff.cs
@@ -17,7 +17,7 @@ namespace FSpot.Imaging.Ciff {
 		Directory1 = 0x2800,
 		Directory2 = 0x2800,
 	}
-	
+
 	public enum Mask {
 		Type = 0x3800,
 	}
@@ -33,7 +33,7 @@ namespace FSpot.Imaging.Ciff {
 			Tag = (Tag) BitConverter.ToUInt16 (data, pos, little);
 			Size = BitConverter.ToUInt32 (data, pos + 2, little);
 			Offset = BitConverter.ToUInt32 (data, pos + 6, little);
-		}	
+		}
 	}
 
 	class ImageDirectory {
@@ -41,7 +41,7 @@ namespace FSpot.Imaging.Ciff {
 		uint Count;
 		bool little;
 		uint start;
-		long DirPosition; 
+		long DirPosition;
 		System.IO.Stream stream;
 
 		public ImageDirectory (System.IO.Stream stream, uint start, long end, bool little)
@@ -51,7 +51,7 @@ namespace FSpot.Imaging.Ciff {
 			this.stream = stream;
 
 			entry_list = new System.Collections.ArrayList ();
-			
+
 			stream.Position = end - 4;
 			byte [] buf = new byte [10];
 			stream.Read (buf, 0, 4);
@@ -62,7 +62,7 @@ namespace FSpot.Imaging.Ciff {
 			stream.Read (buf, 0, 2);
 
 			Count = BitConverter.ToUInt16 (buf, 0, little);
-			
+
 			for (int i = 0; i < Count; i++)
 			{
 				stream.Read (buf, 0, 10);
@@ -70,7 +70,7 @@ namespace FSpot.Imaging.Ciff {
 				Entry entry = new Entry (buf, 0, little);
 				entry_list.Add (entry);
 			}
-		}			
+		}
 
 		public ImageDirectory ReadDirectory (Tag tag)
 		{
@@ -83,20 +83,20 @@ namespace FSpot.Imaging.Ciff {
 			}
 			return null;
 		}
-		
+
 		public byte [] ReadEntry (int pos)
 		{
 			Entry e = (Entry) entry_list [pos];
 
-			stream.Position = this.start + e.Offset;			
+			stream.Position = this.start + e.Offset;
 
 			byte [] data = new byte [e.Size];
 			stream.Read (data, 0, data.Length);
 
 			return data;
 		}
-		
-		public byte [] ReadEntry (Tag tag) 
+
+		public byte [] ReadEntry (Tag tag)
 		{
 			int pos = 0;
 			foreach (Entry e in entry_list) {
@@ -107,19 +107,19 @@ namespace FSpot.Imaging.Ciff {
 			return null;
 		}
 	}
-	
+
 	public class CiffFile : BaseImageFile {
 		ImageDirectory root;
 		bool little;
 		System.IO.Stream stream;
-		
+
 		ImageDirectory Root {
 			get {
 				if (root == null) {
 					stream = PixbufStream ();
 					root = Load (stream);
 				}
-				
+
 			        return root;
 			}
 		}
@@ -134,15 +134,15 @@ namespace FSpot.Imaging.Ciff {
 			stream.Read (header, 0, header.Length);
 
 			uint start;
-			
+
 			little = (header [0] == 'I' && header [1] == 'I');
-			
+
 			start = BitConverter.ToUInt32 (header, 2, little);
-			
+
 			// HEAP is the type CCDR is the subtype
-			if (System.Text.Encoding.ASCII.GetString (header, 6, 8) != "HEAPCCDR") 
+			if (System.Text.Encoding.ASCII.GetString (header, 6, 8) != "HEAPCCDR")
 				throw new ImageFormatException ("Invalid Ciff Header Block");
-			
+
 			long end = stream.Length;
 			return new ImageDirectory (stream, start, end, little);
 		}
@@ -150,10 +150,10 @@ namespace FSpot.Imaging.Ciff {
 		public override System.IO.Stream PixbufStream ()
 		{
 			byte [] data = GetEmbeddedJpeg ();
-			
+
 			if (data != null)
 				return new System.IO.MemoryStream (data);
-			else	
+			else
 				return DCRawFile.RawPixbufStream (Uri);
 		}
 
diff --git a/src/Imaging/DCRawFile.cs b/src/Clients/MainApp/FSpot.Imaging/DCRawFile.cs
similarity index 99%
rename from src/Imaging/DCRawFile.cs
rename to src/Clients/MainApp/FSpot.Imaging/DCRawFile.cs
index f9d68b4..26ea603 100644
--- a/src/Imaging/DCRawFile.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/DCRawFile.cs
@@ -20,7 +20,7 @@ namespace FSpot.Imaging {
 		{
 			string path = location.LocalPath;
 			string [] args = new string [] { dcraw_command, "-h", "-w", "-c", "-t", "0", path };
-			
+
 			InternalProcess proc = new InternalProcess (System.IO.Path.GetDirectoryName (path), args);
 			proc.StandardInput.Close ();
 			return proc.StandardOutput;
diff --git a/src/Imaging/IOChannel.cs b/src/Clients/MainApp/FSpot.Imaging/IOChannel.cs
similarity index 100%
rename from src/Imaging/IOChannel.cs
rename to src/Clients/MainApp/FSpot.Imaging/IOChannel.cs
diff --git a/src/Imaging/ImageFile.cs b/src/Clients/MainApp/FSpot.Imaging/ImageFile.cs
similarity index 93%
rename from src/Imaging/ImageFile.cs
rename to src/Clients/MainApp/FSpot.Imaging/ImageFile.cs
index fbdfd4b..6263b4d 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/ImageFile.cs
@@ -32,7 +32,7 @@ namespace FSpot.Imaging {
         {
             var base_type = typeof (BaseImageFile);
             var raw_type = typeof (DCRawFile);
-            var nef_type = typeof (FSpot.Imaging.Tiff.NefFile);
+            var nef_type = typeof (FSpot.Imaging.NefFile);
 
             name_table = new Dictionary<string, Type> ();
 
@@ -51,21 +51,21 @@ namespace FSpot.Imaging {
 
             // RAW files
             name_table ["image/arw"] = name_table ["image/x-sony-arw"] = name_table [".arw"] = nef_type;
-            name_table ["image/cr2"] = name_table ["image/x-canon-cr2"] = name_table [".cr2"] = typeof (FSpot.Imaging.Tiff.Cr2File);
-            name_table ["image/dng"] = name_table ["image/x-adobe-dng"] = name_table [".dng"] = typeof (FSpot.Imaging.Tiff.DngFile);
+            name_table ["image/cr2"] = name_table ["image/x-canon-cr2"] = name_table [".cr2"] = typeof (FSpot.Imaging.Cr2File);
+            name_table ["image/dng"] = name_table ["image/x-adobe-dng"] = name_table [".dng"] = typeof (FSpot.Imaging.DngFile);
             name_table ["image/nef"] = name_table ["image/x-nikon-nef"] = name_table [".nef"] = nef_type;
             name_table ["image/rw2"] = name_table ["image/x-raw"] = name_table [".rw2"] = raw_type;
             name_table ["image/pef"] = name_table ["image/x-pentax-pef"] = name_table [".pef"] = nef_type;
 
             // Other types (FIXME: Currently unsupported by Taglib#, this list should shrink).
-            name_table [".raw"] = typeof (FSpot.Imaging.Tiff.NefFile);
-            name_table [".kdc"] = typeof (FSpot.Imaging.Tiff.NefFile);
+            name_table [".raw"] = typeof (FSpot.Imaging.NefFile);
+            name_table [".kdc"] = typeof (FSpot.Imaging.NefFile);
             name_table [".rw2"] = typeof (FSpot.Imaging.DCRawFile);
-            name_table [".orf"] =  typeof (FSpot.Imaging.Tiff.NefFile);
-            name_table [".srf"] = typeof (FSpot.Imaging.Tiff.NefFile);
+            name_table [".orf"] =  typeof (FSpot.Imaging.NefFile);
+            name_table [".srf"] = typeof (FSpot.Imaging.NefFile);
             name_table [".crw"] = typeof (FSpot.Imaging.Ciff.CiffFile);
             name_table [".mrw"] = typeof (FSpot.Imaging.DCRawFile);
-            name_table [".raf"] = typeof (FSpot.Imaging.Raf.RafFile);
+            name_table [".raf"] = typeof (FSpot.Imaging.RafFile);
             name_table [".x3f"] = typeof (FSpot.Imaging.DCRawFile);
             name_table ["image/x-dcraw"] = name_table [".raw"];
             name_table ["image/x-ciff"]  = name_table [".crw"];
@@ -147,8 +147,8 @@ namespace FSpot.Imaging {
 				".dng",
 				".mrw",
 				".nef",
-				".orf", 
-				".pef", 
+				".orf",
+				".pef",
 				".raw",
 				".raf",
 				".rw2",
diff --git a/src/Imaging/InternalProcess.cs b/src/Clients/MainApp/FSpot.Imaging/InternalProcess.cs
similarity index 100%
rename from src/Imaging/InternalProcess.cs
rename to src/Clients/MainApp/FSpot.Imaging/InternalProcess.cs
diff --git a/src/Imaging/RafFile.cs b/src/Clients/MainApp/FSpot.Imaging/RafFile.cs
similarity index 97%
rename from src/Imaging/RafFile.cs
rename to src/Clients/MainApp/FSpot.Imaging/RafFile.cs
index ee6f315..4030f0e 100644
--- a/src/Imaging/RafFile.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/RafFile.cs
@@ -2,18 +2,18 @@ using FSpot.Utils;
 using Hyena;
 using TagLib.Image;
 
-namespace FSpot.Imaging.Raf {
+namespace FSpot.Imaging {
 	// This is reverse engineered from looking at the sample files I have
 	// from what I can tell the file is always BigEndian, although the embedded jpeg may not be
 	// and there is a start long offset at 0x54 (or possibly 0x56 if it is a short) that points to
 	// the start of the embedded jpeg and followed by a long length that gives the length of the jpeg
-	// data.   
+	// data.
 	//
 	// Following that there seem to be more offsets and lengths (probably for the raw data) that I haven't
 	// completely figured out yet.  More to follow.
 
 	// ALL the sample files I have begin with "FUJIFILMCCD-RAW "
-	
+
 	public class RafFile : BaseImageFile {
 
 		public RafFile (SafeUri uri) : base (uri)
@@ -23,7 +23,7 @@ namespace FSpot.Imaging.Raf {
 		public override System.IO.Stream PixbufStream ()
 		{
 			byte [] data = GetEmbeddedJpeg ();
-			
+
 			if (data != null)
 				return new System.IO.MemoryStream (data);
 			else
@@ -42,7 +42,7 @@ namespace FSpot.Imaging.Raf {
 				// FIXME implement wb parsing
 				//uint wb_offset = BitConverter.ToUInt32 (data, 8, false);
 				//uint wb_length = BitConverter.ToUInt32 (data, 12, false);
-				
+
 				// FIXME implement decoding
 				//uint raw_offset = BitConverter.ToUInt32 (data, 16, false);
 				//uint raw_length = BitConverter.ToUInt32 (data, 20, false);
diff --git a/src/Tests/ImageFileTests.cs b/src/Clients/MainApp/FSpot.Imaging/Tests/ImageFileTests.cs
similarity index 96%
rename from src/Tests/ImageFileTests.cs
rename to src/Clients/MainApp/FSpot.Imaging/Tests/ImageFileTests.cs
index 8a50959..d734449 100644
--- a/src/Tests/ImageFileTests.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/Tests/ImageFileTests.cs
@@ -2,9 +2,8 @@
 using NUnit.Framework;
 using System;
 using Hyena;
-using FSpot.Imaging;
 
-namespace FSpot.Tests
+namespace FSpot.Imaging.Tests
 {
     [TestFixture]
     public class ImageFileTests
diff --git a/src/Imaging/Tiff.cs b/src/Clients/MainApp/FSpot.Imaging/Tiff.cs
similarity index 99%
rename from src/Imaging/Tiff.cs
rename to src/Clients/MainApp/FSpot.Imaging/Tiff.cs
index ac3de7c..cf34525 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Clients/MainApp/FSpot.Imaging/Tiff.cs
@@ -10,7 +10,7 @@ using TagLib.IFD;
 using TagLib.IFD.Entries;
 using TagLib.IFD.Tags;
 
-namespace FSpot.Imaging.Tiff {
+namespace FSpot.Imaging {
 	/*
 		public Cms.Profile GetProfile ()
 		{
@@ -19,7 +19,7 @@ namespace FSpot.Imaging.Tiff {
 			Cms.GammaTable [] transfer = null;
 			int bits_per_sample = 8;
 			double gamma = 2.2;
-			
+
 			foreach (DirectoryEntry e in entries) {
 				switch (e.Id) {
 				case TagId.InterColorProfile:
@@ -77,7 +77,7 @@ namespace FSpot.Imaging.Tiff {
 				case TagId.ExifIfdPointer:
 					SubdirectoryEntry exif = (SubdirectoryEntry) e;
 					DirectoryEntry ee = exif.Directory [0].Lookup ((int)TagId.Gamma);
-					
+
 					if (ee == null)
 						break;
 
@@ -95,7 +95,7 @@ namespace FSpot.Imaging.Tiff {
 			// if we didn't get a white point or primaries, give up
 			if (whitepoint.Y != 1.0 || primaries.Red.Y != 1.0)
 				return null;
-				
+
 			return new Cms.Profile (whitepoint, primaries, transfer);
 		}
 	}*/
@@ -137,7 +137,7 @@ namespace FSpot.Imaging.Tiff {
 			}
 		}
 	}
-	
+
 	public class NefFile : BaseImageFile {
 		byte [] jpeg_data;
 
@@ -173,7 +173,7 @@ namespace FSpot.Imaging.Tiff {
 			}
 		}
 	}
-		
+
 
 	public class Cr2File : BaseImageFile {
 		uint offset;
@@ -208,4 +208,3 @@ namespace FSpot.Imaging.Tiff {
 	}
 
 }
-
diff --git a/src/Import/FileImportSource.cs b/src/Clients/MainApp/FSpot.Import/FileImportSource.cs
similarity index 100%
rename from src/Import/FileImportSource.cs
rename to src/Clients/MainApp/FSpot.Import/FileImportSource.cs
diff --git a/src/Import/ImportController.cs b/src/Clients/MainApp/FSpot.Import/ImportController.cs
similarity index 100%
rename from src/Import/ImportController.cs
rename to src/Clients/MainApp/FSpot.Import/ImportController.cs
diff --git a/src/Import/ImportSource.cs b/src/Clients/MainApp/FSpot.Import/ImportSource.cs
similarity index 100%
rename from src/Import/ImportSource.cs
rename to src/Clients/MainApp/FSpot.Import/ImportSource.cs
diff --git a/src/Import/MetadataImporter.cs b/src/Clients/MainApp/FSpot.Import/MetadataImporter.cs
similarity index 100%
rename from src/Import/MetadataImporter.cs
rename to src/Clients/MainApp/FSpot.Import/MetadataImporter.cs
diff --git a/src/Jobs/CalculateHashJob.cs b/src/Clients/MainApp/FSpot.Jobs/CalculateHashJob.cs
similarity index 89%
rename from src/Jobs/CalculateHashJob.cs
rename to src/Clients/MainApp/FSpot.Jobs/CalculateHashJob.cs
index 55f449c..442a907 100644
--- a/src/Jobs/CalculateHashJob.cs
+++ b/src/Clients/MainApp/FSpot.Jobs/CalculateHashJob.cs
@@ -14,19 +14,19 @@ using Hyena;
 namespace FSpot.Jobs {
 	public class CalculateHashJob : Job
 	{
-		public CalculateHashJob (uint id, string job_options, int run_at, JobPriority job_priority, bool persistent) 
+		public CalculateHashJob (uint id, string job_options, int run_at, JobPriority job_priority, bool persistent)
 			: this (id, job_options, DateTimeUtil.ToDateTime (run_at), job_priority, persistent)
 		{
 		}
 
-		public CalculateHashJob (uint id, string job_options, DateTime run_at, JobPriority job_priority, bool persistent) 
+		public CalculateHashJob (uint id, string job_options, DateTime run_at, JobPriority job_priority, bool persistent)
 			: base (id, job_options, job_priority, run_at, persistent)
 		{
 		}
 
 		public static CalculateHashJob Create (JobStore job_store, uint photo_id)
 		{
-			return (CalculateHashJob) job_store.CreatePersistent (typeof(FSpot.Jobs.CalculateHashJob), photo_id.ToString ()); 
+			return (CalculateHashJob) job_store.CreatePersistent (typeof(FSpot.Jobs.CalculateHashJob), photo_id.ToString ());
 		}
 
 		protected override bool Execute ()
@@ -46,6 +46,5 @@ namespace FSpot.Jobs {
 			}
 			return false;
 		}
-	} 
+	}
 }
-
diff --git a/src/Jobs/SyncMetadataJob.cs b/src/Clients/MainApp/FSpot.Jobs/SyncMetadataJob.cs
similarity index 100%
rename from src/Jobs/SyncMetadataJob.cs
rename to src/Clients/MainApp/FSpot.Jobs/SyncMetadataJob.cs
diff --git a/src/Loaders/AreaPreparedEventArgs.cs b/src/Clients/MainApp/FSpot.Loaders/AreaPreparedEventArgs.cs
similarity index 99%
rename from src/Loaders/AreaPreparedEventArgs.cs
rename to src/Clients/MainApp/FSpot.Loaders/AreaPreparedEventArgs.cs
index 82387d7..f8f6307 100644
--- a/src/Loaders/AreaPreparedEventArgs.cs
+++ b/src/Clients/MainApp/FSpot.Loaders/AreaPreparedEventArgs.cs
@@ -20,7 +20,7 @@ namespace FSpot.Loaders {
 		public bool ReducedResolution {
 			get { return reduced_resolution; }
 		}
-	
+
 		public AreaPreparedEventArgs (bool reduced_resolution) : base ()
 		{
 			this.reduced_resolution = reduced_resolution;
diff --git a/src/Loaders/AreaUpdatedEventArgs.cs b/src/Clients/MainApp/FSpot.Loaders/AreaUpdatedEventArgs.cs
similarity index 93%
rename from src/Loaders/AreaUpdatedEventArgs.cs
rename to src/Clients/MainApp/FSpot.Loaders/AreaUpdatedEventArgs.cs
index 7308edf..de4a138 100644
--- a/src/Loaders/AreaUpdatedEventArgs.cs
+++ b/src/Clients/MainApp/FSpot.Loaders/AreaUpdatedEventArgs.cs
@@ -16,7 +16,7 @@ namespace FSpot.Loaders {
 	public class AreaUpdatedEventArgs : EventArgs
 	{
 		Gdk.Rectangle area;
-		public Gdk.Rectangle Area { 
+		public Gdk.Rectangle Area {
 			get { return area; }
 		}
 
diff --git a/src/Loaders/GdkImageLoader.cs b/src/Clients/MainApp/FSpot.Loaders/GdkImageLoader.cs
similarity index 99%
rename from src/Loaders/GdkImageLoader.cs
rename to src/Clients/MainApp/FSpot.Loaders/GdkImageLoader.cs
index f904148..1249e3a 100644
--- a/src/Loaders/GdkImageLoader.cs
+++ b/src/Clients/MainApp/FSpot.Loaders/GdkImageLoader.cs
@@ -23,7 +23,7 @@ namespace FSpot.Loaders {
 	{
 #region public api
 		public GdkImageLoader () : base ()
-		{	
+		{
 		}
 
         ~GdkImageLoader ()
@@ -213,4 +213,4 @@ namespace FSpot.Loaders {
 		}
 #endregion
 	}
-}	       
+}
diff --git a/src/Loaders/IImageLoader.cs b/src/Clients/MainApp/FSpot.Loaders/IImageLoader.cs
similarity index 95%
rename from src/Loaders/IImageLoader.cs
rename to src/Clients/MainApp/FSpot.Loaders/IImageLoader.cs
index 19b2d73..d703d5c 100644
--- a/src/Loaders/IImageLoader.cs
+++ b/src/Clients/MainApp/FSpot.Loaders/IImageLoader.cs
@@ -17,7 +17,7 @@ using TagLib.Image;
 
 namespace FSpot.Loaders {
 	public interface IImageLoader : IDisposable {
-		bool Loading { get; }	
+		bool Loading { get; }
 
 		event EventHandler<AreaPreparedEventArgs> AreaPrepared;
 		event EventHandler<AreaUpdatedEventArgs> AreaUpdated;
diff --git a/src/Loaders/ImageLoader.cs b/src/Clients/MainApp/FSpot.Loaders/ImageLoader.cs
similarity index 100%
rename from src/Loaders/ImageLoader.cs
rename to src/Clients/MainApp/FSpot.Loaders/ImageLoader.cs
diff --git a/src/Query/HiddenTag.cs b/src/Clients/MainApp/FSpot.Query/HiddenTag.cs
similarity index 96%
rename from src/Query/HiddenTag.cs
rename to src/Clients/MainApp/FSpot.Query/HiddenTag.cs
index 7e9b441..f603734 100644
--- a/src/Query/HiddenTag.cs
+++ b/src/Clients/MainApp/FSpot.Query/HiddenTag.cs
@@ -1,6 +1,6 @@
 /*
  * HiddenTag.cs
- * 
+ *
  * Author(s):
  *	Mike Gemuende <mike gemuende de>
  *
@@ -17,17 +17,17 @@ using FSpot.Core;
 
 namespace FSpot.Query
 {
-	
+
 	public class HiddenTag : IQueryCondition
 	{
 		private static HiddenTag show_hidden_tag;
 		private static HiddenTag hide_hidden_tag;
-		
+
 		public static HiddenTag ShowHiddenTag {
 			get {
 				if (show_hidden_tag == null)
 					show_hidden_tag = new HiddenTag (true);
-				
+
 				return show_hidden_tag;
 			}
 		}
@@ -36,23 +36,23 @@ namespace FSpot.Query
 			get {
 				if (hide_hidden_tag == null)
 					hide_hidden_tag = new HiddenTag (false);
-				
+
 				return hide_hidden_tag;
 			}
 		}
-		
-		
+
+
 		bool show_hidden;
-		
+
 		private HiddenTag (bool show_hidden)
 		{
 			this.show_hidden = show_hidden;
 		}
-		
+
 		public string SqlClause ()
 		{
 			Tag hidden = App.Instance.Database.Tags.Hidden;
-			
+
 			if ( ! show_hidden && hidden != null)
 				return String.Format (" photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0}) ",
 				                      hidden.Id);
diff --git a/src/UI.Dialog/AboutDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/AboutDialog.cs
similarity index 94%
rename from src/UI.Dialog/AboutDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/AboutDialog.cs
index d1d91fd..441f61b 100644
--- a/src/UI.Dialog/AboutDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/AboutDialog.cs
@@ -19,10 +19,10 @@ namespace FSpot.UI.Dialog
 	public class AboutDialog : Gtk.AboutDialog
 	{
 		private static AboutDialog about = null;
-		
+
 		private AboutDialog () {
 			Artists = new string [] {
-				"Jakub Steiner",	
+				"Jakub Steiner",
 				"Matthew Paul Thomas",
 			};
 			Authors = new string [] {
@@ -100,7 +100,7 @@ namespace FSpot.UI.Dialog
 			Copyright = Catalog.GetString ("Copyright \x00a9 2003-2010 Novell Inc.");
 			Documenters = new string[] {
 				"Aaron Bockover",
-				"Alexandre Prokoudine",	
+				"Alexandre Prokoudine",
 				"Bengt Thuree",
 				"Gabriel Burt",
 				"Harold Schreckengost",
@@ -122,8 +122,8 @@ namespace FSpot.UI.Dialog
 			Logo = new Gdk.Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), "f-spot-128.png");
 			ProgramName = "F-Spot";
 			TranslatorCredits = Catalog.GetString ("translator-credits");
-                	if (System.String.Compare (TranslatorCredits, "translator-credits") == 0)
-                		TranslatorCredits = null;
+			if (System.String.Compare (TranslatorCredits, "translator-credits") == 0)
+				TranslatorCredits = null;
 			Version = FSpot.Core.Defines.VERSION;
 			Website = "http://f-spot.org";;
 			WebsiteLabel = Catalog.GetString ("F-Spot Website");
diff --git a/src/UI.Dialog/AdjustTimeDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/AdjustTimeDialog.cs
similarity index 98%
rename from src/UI.Dialog/AdjustTimeDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/AdjustTimeDialog.cs
index ba9f214..895bc82 100644
--- a/src/UI.Dialog/AdjustTimeDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/AdjustTimeDialog.cs
@@ -16,11 +16,12 @@ using Gtk;
 using System.Collections;
 using Mono.Unix;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Widgets;
 using Hyena;
 
 namespace FSpot.UI.Dialog {
-	public class AdjustTimeDialog : BuilderDialog 
+	public class AdjustTimeDialog : BuilderDialog
 	{
 		[GtkBeans.Builder.Object] ScrolledWindow view_scrolled;
 		[GtkBeans.Builder.Object] ScrolledWindow tray_scrolled;
@@ -39,7 +40,7 @@ namespace FSpot.UI.Dialog {
 		[GtkBeans.Builder.Object] Gtk.Frame action_frame;
 		[GtkBeans.Builder.Object] Gtk.Entry spacing_entry;
 		[GtkBeans.Builder.Object] Gtk.Label starting_label;
-		
+
 		IBrowsableCollection collection;
 		BrowsablePointer Item;
 		FSpot.Widgets.IconView tray;
@@ -84,7 +85,7 @@ namespace FSpot.UI.Dialog {
 
 			spacing_entry.Changed += HandleSpacingChanged;
 			spacing_entry.Sensitive = ! difference_check.Active;
-		      
+
 			difference_check.Toggled += HandleActionToggled;
 		}
 
@@ -122,10 +123,10 @@ namespace FSpot.UI.Dialog {
 
 			if (Item.IsValid) {
 				IBrowsableItem item = Item.Current;
-				
+
 				name_label.Text = System.Uri.UnescapeDataString(item.Name);
 				old_label.Text = (item.Time).ToString ();
-				
+
 				int i = collection.Count > 0 ? Item.Index + 1: 0;
 				// Note for translators: This indicates the current photo is photo {0} of {1} out of photos
 				count_label.Text = System.String.Format (Catalog.GetString ("{0} of {1}"), i, collection.Count);
@@ -156,7 +157,7 @@ namespace FSpot.UI.Dialog {
 				photos [i] = p;
 				Log.DebugFormat ("XXXXX old: {0} new: {1} span: {2}", time, p.Time, span);
 			}
-			
+
 			db.Photos.Commit (photos);
 		}
 
@@ -166,11 +167,11 @@ namespace FSpot.UI.Dialog {
 		        long ticks = (long) (double.Parse (spacing_entry.Text) * TimeSpan.TicksPerMinute);
 			TimeSpan span = new TimeSpan (ticks);
 			Photo [] photos = new Photo [collection.Count];
-			
+
 			for (int i = 0; i < collection.Count; i++) {
 				photos [i] = (Photo) collection [i];
 			}
-			
+
 			TimeSpan accum = new TimeSpan (0);
 			for (int j = Item.Index; j > 0; j--) {
 				date -= span;
@@ -180,7 +181,7 @@ namespace FSpot.UI.Dialog {
 				photos [i].Time = date + accum;
 				accum += span;
 			}
-			
+
 			db.Photos.Commit (photos);
 		}
 
@@ -195,7 +196,7 @@ namespace FSpot.UI.Dialog {
 				throw new ApplicationException ("invalid item selected");
 
 			Sensitive = false;
-			
+
 			if (difference_check.Active)
 				ShiftByDifference ();
 			else
diff --git a/src/UI.Dialog/BuilderDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/BuilderDialog.cs
similarity index 100%
rename from src/UI.Dialog/BuilderDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/BuilderDialog.cs
diff --git a/src/UI.Dialog/DateRangeDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/DateRangeDialog.cs
similarity index 97%
rename from src/UI.Dialog/DateRangeDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/DateRangeDialog.cs
index 25446e3..e511406 100644
--- a/src/UI.Dialog/DateRangeDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/DateRangeDialog.cs
@@ -67,7 +67,7 @@ namespace FSpot.UI.Dialog
 				rangestore.AppendValues (GetString(range));
 
 			period_combobox.Changed += HandlePeriodComboboxChanged;
-           	 	period_combobox.Active = System.Array.IndexOf(ranges, "last7days"); // Default to Last 7 days
+			period_combobox.Active = System.Array.IndexOf(ranges, "last7days"); // Default to Last 7 days
 
 			if (query_range != null) {
 				start_dateedit.DateTimeOffset = query_range.Start;
@@ -122,7 +122,7 @@ namespace FSpot.UI.Dialog
 				return Catalog.GetString("Customized Range");
 			default:
 				return rangename;
-			}	
+			}
 		}
 
 		public DateRange Range {
@@ -203,17 +203,17 @@ namespace FSpot.UI.Dialog
 			default:
 				clear = true;
 				break;
-			}	
+			}
 			if (!clear)
 				return new DateRange (startdate, enddate.Add (new System.TimeSpan(23,59,59)));
 			else
 				return null;
 		}
-	
+
 		void HandleDateEditChanged (object o, EventArgs args)
 		{
 			period_combobox.Changed -= HandlePeriodComboboxChanged;
-           	 	period_combobox.Active = System.Array.IndexOf (ranges, "customizedrange");
+			period_combobox.Active = System.Array.IndexOf (ranges, "customizedrange");
 			period_combobox.Changed += HandlePeriodComboboxChanged;
 		}
 
@@ -223,7 +223,7 @@ namespace FSpot.UI.Dialog
 			((Gtk.Entry) start_dateedit.Children [0] as Gtk.Entry).Changed -= HandleDateEditChanged;
 			end_dateedit.DateChanged -= HandleDateEditChanged;
 			((Gtk.Entry) end_dateedit.Children [0] as Gtk.Entry).Changed -= HandleDateEditChanged;
-	
+
 			ComboBox combo = o as ComboBox;
 			if (o == null)
 				return;
@@ -236,7 +236,7 @@ namespace FSpot.UI.Dialog
 				start_dateedit.DateTimeOffset = range.Start;
 				end_dateedit.DateTimeOffset = range.End;
 			}
-			
+
 			start_dateedit.DateChanged += HandleDateEditChanged;
 			((Gtk.Entry) start_dateedit.Children [0] as Gtk.Entry).Changed += HandleDateEditChanged;
 			end_dateedit.DateChanged += HandleDateEditChanged;
diff --git a/src/UI.Dialog/EditExceptionDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/EditExceptionDialog.cs
similarity index 96%
rename from src/UI.Dialog/EditExceptionDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/EditExceptionDialog.cs
index 4a250d8..cae04fc 100644
--- a/src/UI.Dialog/EditExceptionDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/EditExceptionDialog.cs
@@ -16,7 +16,7 @@ using FSpot.Core;
 
 namespace FSpot.UI.Dialog
 {
-	public class EditException : Exception 
+	public class EditException : Exception
 	{
 		IBrowsableItem item;
 
@@ -48,7 +48,7 @@ namespace FSpot.UI.Dialog
 		public EditExceptionDialog (Gtk.Window parent, Exception e, IBrowsableItem item) : this (parent, new EditException (item, e))
 		{
 		}
-	       
+
 		public EditExceptionDialog (Gtk.Window parent, Exception e) : this (parent, new Exception [] { e })
 		{
 		}
diff --git a/src/UI.Dialog/EditTagDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/EditTagDialog.cs
similarity index 99%
rename from src/UI.Dialog/EditTagDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/EditTagDialog.cs
index 10d2557..3068623 100644
--- a/src/UI.Dialog/EditTagDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/EditTagDialog.cs
@@ -16,6 +16,7 @@ using System.Collections;
 using Mono.Unix;
 using Gtk;
 using FSpot.Core;
+using FSpot.Database;
 
 namespace FSpot.UI.Dialog
 {
@@ -46,7 +47,7 @@ namespace FSpot.UI.Dialog
 				FSpot.ColorManagement.ApplyProfile (icon_image.Pixbuf, screen_profile);
 			}
 			PopulateCategoryOptionMenu  (t);
-			
+
 			tag_name_entry.GrabFocus ();
 
 			category_option_menu.Changed += HandleTagNameEntryChanged;
@@ -126,7 +127,7 @@ namespace FSpot.UI.Dialog
 				FSpot.ColorManagement.ApplyProfile(icon_image.Pixbuf, screen_profile);
 			} else
 				icon_image.Pixbuf = tag.Icon;
-			
+
 			dialog.Destroy ();
 		}
 
@@ -144,12 +145,12 @@ namespace FSpot.UI.Dialog
 			foreach (Category category in categories) {
 				if (t.Category == category)
 					history = i;
-				
+
 				i++;
-				
+
 				menu.Append (TagMenu.TagMenuItem.IndentedItem (category));
 			}
-			
+
 			category_option_menu.Sensitive = true;
 
 			menu.ShowAll ();
@@ -158,4 +159,3 @@ namespace FSpot.UI.Dialog
 		}
 	}
 }
-
diff --git a/src/UI.Dialog/EditTagIconDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/EditTagIconDialog.cs
similarity index 94%
rename from src/UI.Dialog/EditTagIconDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/EditTagIconDialog.cs
index dc8559e..402fdc4 100644
--- a/src/UI.Dialog/EditTagIconDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/EditTagIconDialog.cs
@@ -15,6 +15,7 @@ using System;
 using Mono.Unix;
 using Gtk;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Widgets;
 using FSpot.Utils;
 using FSpot.Imaging;
@@ -38,7 +39,7 @@ namespace FSpot.UI.Dialog
 		[GtkBeans.Builder.Object] Label from_photo_label;
 		[GtkBeans.Builder.Object] SpinButton photo_spin_button;
 		[GtkBeans.Builder.Object] HBox external_photo_chooser_hbox;
-		
+
 		public EditTagIconDialog (Db db, Tag t, Gtk.Window parent_window) : base ("EditTagIconDialog.ui", "edit_tag_icon_dialog")
 		{
 			TransientFor = parent_window;
@@ -46,17 +47,17 @@ namespace FSpot.UI.Dialog
 
 			preview_pixbuf = t.Icon;
 			Cms.Profile screen_profile;
-			if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) { 
+			if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
 				preview_image.Pixbuf = preview_pixbuf.Copy ();
 				ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile);
 			} else
 				preview_image.Pixbuf = preview_pixbuf;
 
 			query = new FSpot.PhotoQuery (db.Photos);
-			
+
 			if (db.Tags.Hidden != null)
 				query.Terms = FSpot.OrTerm.FromTags (new Tag [] {t});
-			else 
+			else
 				query.Terms = new FSpot.Literal (t);
 
 			image_view = new PhotoImageView (query) {CropHelpers = false};
@@ -82,7 +83,7 @@ namespace FSpot.UI.Dialog
 				photo_spin_button.Adjustment.Upper = (double) query.Count;
 				photo_spin_button.Adjustment.StepIncrement = 1.0;
 				photo_spin_button.ValueChanged += HandleSpinButtonChanged;
-				
+
 				image_view.Item.Index = 0;
 			} else {
 				from_photo_label.Markup = String.Format (Catalog.GetString (
@@ -90,15 +91,15 @@ namespace FSpot.UI.Dialog
 					" You can use one of your library photos as an icon for this tag.\n" +
 					" However, first you must have at least one photo associated\n" +
 					" with this tag. Please tag a photo as '{0}' and return here\n" +
-					" to use it as an icon."), t.Name); 
+					" to use it as an icon."), t.Name);
 				photo_scrolled_window.Visible = false;
 				photo_label.Visible = false;
 				photo_spin_button.Visible = false;
-			}			
+			}
 
 			icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));
 
-			icon_view = new Gtk.IconView (icon_store); 
+			icon_view = new Gtk.IconView (icon_store);
 			icon_view.PixbufColumn = 1;
 			icon_view.SelectionMode = SelectionMode.Single;
 			icon_view.SelectionChanged += HandleIconSelectionChanged;
@@ -124,7 +125,7 @@ namespace FSpot.UI.Dialog
 				icon_name = null;
 				preview_pixbuf = value;
 				Cms.Profile screen_profile;
-				if (value!= null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) { 
+				if (value!= null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
 					preview_image.Pixbuf = value.Copy ();
 					ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile);
 				} else
@@ -137,16 +138,16 @@ namespace FSpot.UI.Dialog
 		public string ThemeIconName {
 			get { return icon_name; }
 			set {
-				icon_name = value;	
+				icon_name = value;
 				PreviewPixbuf = GtkUtil.TryLoadIcon (FSpot.Core.Global.IconTheme, value, 48, (IconLookupFlags) 0);
 			}
-			
+
 		}
-		
+
 		void HandleSpinButtonChanged (object sender, EventArgs args)
 		{
 			int value = photo_spin_button.ValueAsInt - 1;
-			
+
 			image_view.Item.Index = value;
 		}
 
@@ -165,13 +166,13 @@ namespace FSpot.UI.Dialog
 				}
 			} catch (Exception) {
 				string caption = Catalog.GetString ("Unable to load image");
-				string message = String.Format (Catalog.GetString ("Unable to load \"{0}\" as icon for the tag"), 
+				string message = String.Format (Catalog.GetString ("Unable to load \"{0}\" as icon for the tag"),
 									external_photo_chooser.Uri.ToString ());
-				HigMessageDialog md = new HigMessageDialog (this, 
+				HigMessageDialog md = new HigMessageDialog (this,
 									    DialogFlags.DestroyWithParent,
 									    MessageType.Error,
 									    ButtonsType.Close,
-									    caption, 
+									    caption,
 									    message);
 				md.Run();
 				md.Destroy();
@@ -184,7 +185,7 @@ namespace FSpot.UI.Dialog
 			int y = image_view.Selection.Y;
 			int width = image_view.Selection.Width;
 			int height = image_view.Selection.Height;
-		       
+
 			if (image_view.Pixbuf != null) {
 				if (image_view.Selection != Gdk.Rectangle.Zero) {
 					using (var tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height)) {
@@ -203,7 +204,7 @@ namespace FSpot.UI.Dialog
 		public void HandlePhotoChanged (object sender, EventArgs e)
 		{
 			int item = image_view.Item.Index;
-			photo_label.Text = String.Format (Catalog.GetString ("Photo {0} of {1}"), 
+			photo_label.Text = String.Format (Catalog.GetString ("Photo {0} of {1}"),
 							  item + 1, query.Count);
 
 			photo_spin_button.Value = item + 1;
@@ -216,7 +217,7 @@ namespace FSpot.UI.Dialog
 				return;
 
 			TreeIter iter;
-			icon_store.GetIter (out iter, icon_view.SelectedItems [0]); 
+			icon_store.GetIter (out iter, icon_view.SelectedItems [0]);
 			ThemeIconName = (string) icon_store.GetValue (iter, 0);
 		}
 
diff --git a/src/UI.Dialog/GladeDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/GladeDialog.cs
similarity index 97%
rename from src/UI.Dialog/GladeDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/GladeDialog.cs
index c61d5c5..a185445 100644
--- a/src/UI.Dialog/GladeDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/GladeDialog.cs
@@ -11,14 +11,14 @@
 
 using System;
 
-namespace FSpot.UI.Dialog 
+namespace FSpot.UI.Dialog
 {
 	public class GladeDialog
 	{
 		protected string dialog_name;
 		protected Glade.XML xml;
 		private Gtk.Dialog dialog;
-		
+
 		protected GladeDialog ()
 		{
 		}
@@ -53,7 +53,7 @@ namespace FSpot.UI.Dialog
 			get {
 				if (dialog == null)
 					dialog = (Gtk.Dialog) xml.GetWidget (dialog_name);
-				
+
 				return dialog;
 			}
 		}
diff --git a/src/UI.Dialog/ImportDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
similarity index 100%
rename from src/UI.Dialog/ImportDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
diff --git a/src/UI.Dialog/ImportFailureDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/ImportFailureDialog.cs
similarity index 100%
rename from src/UI.Dialog/ImportFailureDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/ImportFailureDialog.cs
diff --git a/src/UI.Dialog/LastRollDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/LastRollDialog.cs
similarity index 96%
rename from src/UI.Dialog/LastRollDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/LastRollDialog.cs
index f5448d4..e775cc1 100644
--- a/src/UI.Dialog/LastRollDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/LastRollDialog.cs
@@ -19,7 +19,7 @@ namespace FSpot.UI.Dialog {
 	public class LastRolls : BuilderDialog {
 		FSpot.PhotoQuery query;
 		RollStore rollstore;
-		
+
 		Roll [] rolls;
 
 		[GtkBeans.Builder.Object] private ComboBox combo_filter; // at, after, or between
@@ -27,7 +27,7 @@ namespace FSpot.UI.Dialog {
 		[GtkBeans.Builder.Object] private ComboBox combo_roll_2;
 		[GtkBeans.Builder.Object] private Label    and_label; // and label between two comboboxes.
 		[GtkBeans.Builder.Object] private Label    photos_in_selected_rolls;
-		
+
 		public LastRolls (FSpot.PhotoQuery query, RollStore rollstore, Window parent) : base ("LastImportRollFilterDialog.ui", "last_import_rolls_filter")
 		{
 			this.query = query;
@@ -37,11 +37,11 @@ namespace FSpot.UI.Dialog {
             TransientFor = parent;
 
 			PopulateCombos ();
-			
+
 			combo_filter.Active = 0;
 			combo_roll_1.Active = 0;
 			combo_roll_2.Active = 0;
-			
+
 			DefaultResponse = ResponseType.Ok;
 			Response += HandleResponse;
 			Show ();
@@ -52,13 +52,13 @@ namespace FSpot.UI.Dialog {
 		{
 			if (args.ResponseId == ResponseType.Ok) {
 				Roll [] selected_rolls = SelectedRolls ();
-				
+
 				if (selected_rolls != null && selected_rolls.Length > 0 )
 					query.RollSet = new RollSet (selected_rolls);
 			}
 			Destroy ();
 		}
-		
+
 		void HandleComboFilterChanged (object o, EventArgs args)
 		{
 			combo_roll_2.Visible = (combo_filter.Active == 2);
@@ -77,11 +77,11 @@ namespace FSpot.UI.Dialog {
 			Roll [] selected_rolls = SelectedRolls ();
 			uint sum = 0;
 			if (selected_rolls != null)
-				foreach (Roll roll in selected_rolls) 
+				foreach (Roll roll in selected_rolls)
 					sum = sum + rollstore.PhotosInRoll (roll);
 			photos_in_selected_rolls.Text = sum.ToString();
 		}
-		
+
 		private void PopulateCombos ()
 		{
 			for (uint k = 0; k < rolls.Length; k++)
@@ -89,21 +89,21 @@ namespace FSpot.UI.Dialog {
 				uint numphotos = rollstore.PhotosInRoll (rolls [k]);
 				// Roll time is in UTC always
 				DateTime date = rolls [k].Time.ToLocalTime ();
-				
+
 				string header = String.Format ("{0} ({1})",
 					date.ToString("%dd %MMM, %HH:%mm"),
-					numphotos);		
-					
+					numphotos);
+
 				combo_roll_1.AppendText (header);
 				combo_roll_2.AppendText (header);
-			}					
+			}
 		}
-		
+
 		private Roll [] SelectedRolls ()
 		{
 			if ((combo_roll_1.Active < 0) || ((combo_filter.Active == 2) && (combo_roll_2.Active < 0)))
 				return null;
-				
+
 			System.Collections.ArrayList result = new System.Collections.ArrayList ();
 
 			switch (combo_filter.Active) {
diff --git a/src/UI.Dialog/PreferenceDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
similarity index 99%
rename from src/UI.Dialog/PreferenceDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
index 67cdfbc..f789947 100644
--- a/src/UI.Dialog/PreferenceDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/PreferenceDialog.cs
@@ -58,7 +58,7 @@ namespace FSpot.UI.Dialog {
 			if (FSpot.ColorManagement.XProfile != null)
 				sprofiles.AppendValues (Catalog.GetString ("System profile"), -1);
 			sprofiles.AppendValues (null, 0);
-			
+
 			//Pick the display profiles from the full list, avoid _x_profile_
 			var dprofs = from profile in FSpot.ColorManagement.Profiles
 				where (profile.Value.DeviceClass == Cms.IccProfileClass.Display && profile.Key != "_x_profile_")
@@ -85,7 +85,7 @@ namespace FSpot.UI.Dialog {
 				select profile;
 			foreach (var p in pprofs)
 				pprofiles.AppendValues (p.Key, 1);
-			
+
 			printprofile_combo.Model = pprofiles;
 			printprofile_combo.PackStart (profilecellrenderer, true);
 			printprofile_combo.RowSeparatorFunc = ProfileSeparatorFunc;
@@ -99,7 +99,7 @@ namespace FSpot.UI.Dialog {
 			string gtkrc = System.IO.Path.Combine ("gtk-2.0", "gtkrc");
 			string [] search = {System.IO.Path.Combine (FSpot.Core.Global.HomeDirectory, ".themes"), "/usr/share/themes"};
 			foreach (string path in search)
-				if (System.IO.Directory.Exists (path)) 
+				if (System.IO.Directory.Exists (path))
 					foreach (string dir in System.IO.Directory.GetDirectories (path))
 						if (File.Exists (System.IO.Path.Combine (dir, gtkrc)))
 							themes.AppendValues (System.IO.Path.GetFileName (dir), System.IO.Path.Combine (dir, gtkrc));
diff --git a/src/UI.Dialog/ProgressDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/ProgressDialog.cs
similarity index 98%
rename from src/UI.Dialog/ProgressDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/ProgressDialog.cs
index 4f64f61..7d8c5c5 100644
--- a/src/UI.Dialog/ProgressDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/ProgressDialog.cs
@@ -16,57 +16,57 @@ 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 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);
@@ -75,26 +75,26 @@ namespace FSpot.UI.Dialog {
 				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;
 		}
 	}
diff --git a/src/UI.Dialog/RatingFilterDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/RatingFilterDialog.cs
similarity index 99%
rename from src/UI.Dialog/RatingFilterDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/RatingFilterDialog.cs
index 2b588c2..1092063 100644
--- a/src/UI.Dialog/RatingFilterDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/RatingFilterDialog.cs
@@ -20,7 +20,7 @@ namespace FSpot.UI.Dialog
 		[GtkBeans.Builder.Object] Button ok_button;
 		[GtkBeans.Builder.Object] HBox minrating_hbox;
 		[GtkBeans.Builder.Object] HBox maxrating_hbox;
-		
+
 		private int minrating_value = 4;
 		private int maxrating_value = 5;
 		private Rating minrating;
@@ -31,7 +31,7 @@ namespace FSpot.UI.Dialog
 			TransientFor = parent_window;
 			DefaultResponse = ResponseType.Ok;
 			ok_button.GrabFocus ();
-			
+
 			if (query.RatingRange != null) {
 				minrating_value = (int) query.RatingRange.MinRating;
 				maxrating_value = (int) query.RatingRange.MaxRating;
@@ -46,10 +46,8 @@ namespace FSpot.UI.Dialog
 			if (response == ResponseType.Ok) {
 				query.RatingRange = new RatingRange ((uint) minrating.Value, (uint) maxrating.Value);
 			}
-			
+
 			Destroy ();
 		}
 	}
 }
-
-
diff --git a/src/UI.Dialog/RepairDbDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/RepairDbDialog.cs
similarity index 74%
rename from src/UI.Dialog/RepairDbDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/RepairDbDialog.cs
index 28cbab0..40c722a 100644
--- a/src/UI.Dialog/RepairDbDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/RepairDbDialog.cs
@@ -17,11 +17,11 @@ namespace FSpot.UI.Dialog
 {
 	public class RepairDbDialog : HigMessageDialog
 	{
-		public RepairDbDialog (System.Exception e, string backup_path, Window parent) : 
-				base (parent, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, 
-				Catalog.GetString ("Error loading database."), 
+		public RepairDbDialog (System.Exception e, string backup_path, Window parent) :
+				base (parent, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok,
+				Catalog.GetString ("Error loading database."),
 				String.Format (Catalog.GetString ("F-Spot encountered an error while loading the photo database. " +
-		                		"The old database has be moved to {0} and a new database has been created."), backup_path))
+						"The old database has be moved to {0} and a new database has been created."), backup_path))
 		{
 			Log.Exception (e);
 			Run ();
diff --git a/src/UI.Dialog/RepairDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/RepairDialog.cs
similarity index 98%
rename from src/UI.Dialog/RepairDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/RepairDialog.cs
index a84d89c..1911497 100644
--- a/src/UI.Dialog/RepairDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/RepairDialog.cs
@@ -20,7 +20,7 @@ namespace FSpot. UI.Dialog
 	public class RepairDialog : BuilderDialog
 	{
 		[GtkBeans.Builder.Object] ScrolledWindow view_scrolled;
-		
+
 		IBrowsableCollection source;
 		PhotoList missing;
 
@@ -28,11 +28,11 @@ namespace FSpot. UI.Dialog
 		{
 			source = collection;
 			missing = new PhotoList ();
-			
+
 			FindMissing ();
 			TrayView view = new TrayView (missing);
 			view_scrolled.Add (view);
-				
+
 			this.ShowAll ();
 		}
 
diff --git a/src/UI.Dialog/SelectionRatioDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/SelectionRatioDialog.cs
similarity index 98%
rename from src/UI.Dialog/SelectionRatioDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/SelectionRatioDialog.cs
index 21a72c0..254e68d 100644
--- a/src/UI.Dialog/SelectionRatioDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/SelectionRatioDialog.cs
@@ -32,7 +32,7 @@ namespace FSpot.UI.Dialog {
 				get { return ratio; }
 				set { ratio = value; }
 			}
-			
+
 			public SelectionConstraint (string label, double ratio)
 			{
 				this.label = label;
@@ -67,25 +67,25 @@ namespace FSpot.UI.Dialog {
 			LoadPreference (Preferences.CUSTOM_CROP_RATIOS);
 			Preferences.SettingChanged += OnPreferencesChanged;
 		}
-	
+
 		private void Populate ()
 		{
 			constraints_store = new ListStore (typeof (string), typeof (double));
 			content_treeview.Model = constraints_store;
 			XmlSerializer serializer = new XmlSerializer (typeof(SelectionConstraint));
 			string [] vals = Preferences.Get<string []> (Preferences.CUSTOM_CROP_RATIOS);
-			if (vals != null) 
+			if (vals != null)
 				foreach (string xml in vals) {
 					SelectionConstraint constraint = (SelectionConstraint)serializer.Deserialize (new StringReader (xml));
 					constraints_store.AppendValues (constraint.Label, constraint.XyRatio);
-				}	
+				}
 		}
 
 		private void OnPreferencesChanged (object sender, NotifyEventArgs args)
 		{
 			LoadPreference (args.Key);
 		}
-	
+
 		private void LoadPreference (String key)
 		{
 			switch (key) {
@@ -106,11 +106,11 @@ namespace FSpot.UI.Dialog {
 				prefs.Add (sw.ToString ());
 			}
 
-#if !GCONF_SHARP_2_18		
+#if !GCONF_SHARP_2_18
 			if (prefs.Count != 0)
 #endif
 				Preferences.Set (Preferences.CUSTOM_CROP_RATIOS, prefs.ToArray());
-#if !GCONF_SHARP_2_18		
+#if !GCONF_SHARP_2_18
 			else
 				Preferences.Set (Preferences.CUSTOM_CROP_RATIOS, -1);
 #endif
diff --git a/src/UI.Dialog/TagSelectionDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/TagSelectionDialog.cs
similarity index 97%
rename from src/UI.Dialog/TagSelectionDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/TagSelectionDialog.cs
index 823c417..6fbe318 100644
--- a/src/UI.Dialog/TagSelectionDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/TagSelectionDialog.cs
@@ -9,30 +9,28 @@ namespace FSpot.UI.Dialog {
 	public class TagSelectionDialog : BuilderDialog
 	{
 		[GtkBeans.Builder.Object] Gtk.ScrolledWindow tag_selection_scrolled;
-		
+
 		TagSelectionWidget tag_selection_widget;
-		
+
 		public TagSelectionDialog (TagStore tags) : base ("tag_selection_dialog.ui", "tag_selection_dialog")
 		{
 			tag_selection_widget = new TagSelectionWidget (tags);
 			tag_selection_scrolled.Add (tag_selection_widget);
 			tag_selection_widget.Show ();
 		}
-		
+
 		public Tag[] Run ()
 		{
 			int response = base.Run ();
 			if ((ResponseType) response == ResponseType.Ok)
 				return tag_selection_widget.TagHighlight;
-			
+
 			return null;
 		}
-		
+
 		public void Hide ()
 		{
 			base.Hide ();
 		}
 	}
 }
-
-
diff --git a/src/UI.Dialog/ThreadProgressDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/ThreadProgressDialog.cs
similarity index 98%
rename from src/UI.Dialog/ThreadProgressDialog.cs
rename to src/Clients/MainApp/FSpot.UI.Dialog/ThreadProgressDialog.cs
index 36b165f..50eb318 100644
--- a/src/UI.Dialog/ThreadProgressDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/ThreadProgressDialog.cs
@@ -43,14 +43,14 @@ namespace FSpot.UI.Dialog {
 			*/
 			this.Title = thread.Name;
 			this.thread = thread;
-			
+
 			HasSeparator = false;
 			BorderWidth = 6;
 			SetDefaultSize (300, -1);
-			
+
 			message_label = new Gtk.Label (String.Empty);
 			VBox.PackStart (message_label, true, true, 12);
-			
+
 			progress_bar = new Gtk.ProgressBar ();
 			VBox.PackStart (progress_bar, true, true, 6);
 
@@ -64,7 +64,7 @@ namespace FSpot.UI.Dialog {
 
 			button_label = Gtk.Stock.Cancel;
 			button = (Gtk.Button) AddButton (button_label, (int)Gtk.ResponseType.Cancel);
-			
+
 			delay = new Delay (new GLib.IdleHandler (HandleUpdate));
 
 			Response += HandleResponse;
@@ -84,7 +84,7 @@ namespace FSpot.UI.Dialog {
 
 		string button_label;
 		public string ButtonLabel {
-			get { return button_label; }			
+			get { return button_label; }
 			set {
 				lock (syncHandle) {
 					button_label = value;
@@ -92,7 +92,7 @@ namespace FSpot.UI.Dialog {
 				}
 			}
 		}
-		
+
 		string message;
 		public string Message {
 			get { return message; }
@@ -103,7 +103,7 @@ namespace FSpot.UI.Dialog {
 				}
 			}
 		}
-		
+
 		double fraction;
 		public double Fraction {
 			get { return Fraction; }
@@ -134,15 +134,15 @@ namespace FSpot.UI.Dialog {
 				this.message = message;
 				this.fraction = fraction;
 				delay.Start ();
-			}	
+			}
 		}
 
 		bool retry_skip;
 		bool RetrySkipVisible {
-			set { 
+			set {
 				retry_skip = value;
 				delay.Start ();
-			} 
+			}
 		}
 
 		public bool PerformRetrySkip ()
diff --git a/src/UI.Dialog/ui/AdjustTimeDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/AdjustTimeDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/AdjustTimeDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/AdjustTimeDialog.ui
diff --git a/src/UI.Dialog/ui/CreateTagDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/CreateTagDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/CreateTagDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/CreateTagDialog.ui
diff --git a/src/UI.Dialog/ui/DateRangeDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/DateRangeDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/DateRangeDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/DateRangeDialog.ui
diff --git a/src/UI.Dialog/ui/EditTagDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/EditTagDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagDialog.ui
diff --git a/src/UI.Dialog/ui/EditTagIconDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagIconDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/EditTagIconDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/EditTagIconDialog.ui
diff --git a/src/UI.Dialog/ui/LastImportRollFilterDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/LastImportRollFilterDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/LastImportRollFilterDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/LastImportRollFilterDialog.ui
diff --git a/src/UI.Dialog/ui/PreferenceDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/PreferenceDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/PreferenceDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/PreferenceDialog.ui
diff --git a/src/UI.Dialog/ui/RatingFilterDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/RatingFilterDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/RatingFilterDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/RatingFilterDialog.ui
diff --git a/src/UI.Dialog/ui/RepairDialog.ui b/src/Clients/MainApp/FSpot.UI.Dialog/ui/RepairDialog.ui
similarity index 100%
rename from src/UI.Dialog/ui/RepairDialog.ui
rename to src/Clients/MainApp/FSpot.UI.Dialog/ui/RepairDialog.ui
diff --git a/src/Util.cs b/src/Clients/MainApp/FSpot.Utils/Util.cs
similarity index 94%
rename from src/Util.cs
rename to src/Clients/MainApp/FSpot.Utils/Util.cs
index a7e456e..643f19c 100644
--- a/src/Util.cs
+++ b/src/Clients/MainApp/FSpot.Utils/Util.cs
@@ -33,24 +33,24 @@ namespace FSpot.Utils
 				Add (uri);
 			}
 		}
-		
+
 		public UriList () : base ()
 		{
 		}
-		
+
 		private void LoadFromStrings (string [] items) {
 			//string [] items = System.Text.RegularExpressions.Regex.Split ("\n", data);
-			
+
 			foreach (String i in items) {
 				if (!i.StartsWith ("#")) {
 					SafeUri uri;
 					String s = i;
-	
+
 					if (i.EndsWith ("\r")) {
 						s = i.Substring (0, i.Length - 1);
 						Log.DebugFormat ("uri = {0}", s);
 					}
-					
+
 					try {
 						uri = new SafeUri (s);
 					} catch {
@@ -65,7 +65,7 @@ namespace FSpot.Utils
 							}
 						} else
 							continue;
-#else					
+#else
 						continue;
 #endif
 					}
@@ -77,61 +77,61 @@ namespace FSpot.Utils
 		public void AddUnknown (string unknown)
 		{
 			SafeUri uri;
-			
+
 			if (File.Exists (unknown) || Directory.Exists (unknown))
 				uri = new SafeUri (unknown);
-			else 
+			else
 				uri = new SafeUri (unknown);
-			
+
 			Add (uri);
 		}
-	
-		public UriList (string data) 
+
+		public UriList (string data)
 		{
 			LoadFromStrings (data.Split ('\n'));
 		}
-		
+
 		public UriList (string [] uris)
 		{
 			LoadFromStrings (uris);
 		}
-		
-		/*public UriList (Gtk.SelectionData selection) 
+
+		/*public UriList (Gtk.SelectionData selection)
 		{
 			// FIXME this should check the atom etc.
 			LoadFromString (System.Text.Encoding.UTF8.GetString (selection.Data));
 		}*/
-	
+
 		/*public void Add (string path)
 		{
 			AddUnknown (path);
 		}*/
-	
+
 		public void Add (IBrowsableItem item)
 		{
 			Add (item.DefaultVersion.Uri);
 		}
-	
+
 		public override string ToString () {
 			StringBuilder list = new StringBuilder ();
-	
+
 			foreach (SafeUri uri in this) {
 				if (uri == null)
 					break;
-	
+
 				list.Append (uri.ToString () + Environment.NewLine);
 			}
-	
+
 			return list.ToString ();
 		}
-	
+
 		public string [] ToLocalPaths () {
 			int count = 0;
 			foreach (SafeUri uri in this) {
 				if (uri.IsFile)
 					count++;
 			}
-			
+
 			String [] paths = new String [count];
 			count = 0;
 			foreach (SafeUri uri in this) {
@@ -142,5 +142,3 @@ namespace FSpot.Utils
 		}
 	}
 }
-
-
diff --git a/src/Widgets/CellRendererTextProgress.cs b/src/Clients/MainApp/FSpot.Widgets/CellRendererTextProgress.cs
similarity index 96%
rename from src/Widgets/CellRendererTextProgress.cs
rename to src/Clients/MainApp/FSpot.Widgets/CellRendererTextProgress.cs
index ba66208..b2b1f86 100644
--- a/src/Widgets/CellRendererTextProgress.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/CellRendererTextProgress.cs
@@ -20,7 +20,7 @@ using FSpot.Utils;
 using Mono.Unix;
 
 namespace FSpot.Widgets
-{	
+{
 	/*
 	 * Because subclassing of CellRendererText does not to work, we
 	 * use a new cellrenderer, which renderes a simple text and a
@@ -30,11 +30,11 @@ namespace FSpot.Widgets
 	{
 		readonly int progress_width;
 		readonly int progress_height;
-		
+
 		static Gdk.Color green = new Gdk.Color (0xcc, 0x00, 0x00);
 		static Gdk.Color yellow = new Gdk.Color (0xed, 0xd4, 0x00);
 		static Gdk.Color red = new Gdk.Color (0x73, 0xd2, 0x16);
-		
+
 		public CellRendererTextProgress () : this (70, 8)
 		{
 		}
@@ -43,19 +43,19 @@ namespace FSpot.Widgets
 		{
 			this.progress_width = progress_width;
 			this.progress_height = progress_height;
-			
+
 			Xalign = 0.0f;
 			Yalign = 0.5f;
-			
+
 			Xpad = Ypad = 2;
 		}
-		
+
 		protected CellRendererTextProgress (IntPtr ptr) : base (ptr)
 		{
 		}
-		
+
 		int progress_value;
-		
+
 		[GLib.PropertyAttribute ("value")]
 		public int Value {
 			get { return progress_value; }
@@ -64,34 +64,34 @@ namespace FSpot.Widgets
 				progress_value = Math.Max (Math.Min (value, 100), 0);
 			}
 		}
-		
+
 		Pango.Layout text_layout;
 		string text;
-		
+
 		[GLib.PropertyAttribute ("text")]
 		public string Text {
 			get { return text; }
 			set {
 				if (text == value)
 					return;
-				
+
 				text = value;
-				text_layout = null;	
+				text_layout = null;
 			}
 		}
-		
+
 		bool use_markup;
 		public bool UseMarkup {
 			get { return use_markup; }
 			set {
 				if (use_markup == value)
 					return;
-				
+
 				use_markup = value;
 				text_layout = null;
 			}
 		}
-		
+
 		void UpdateLayout (Widget widget)
 		{
 			text_layout = new Pango.Layout (widget.PangoContext);
@@ -101,46 +101,46 @@ namespace FSpot.Widgets
 			else
 				text_layout.SetText (text);
 		}
-		
+
 		Gdk.Color GetValueColor ()
 		{
 			if (progress_value <= 33)
 				return green;
-			
+
 			if (progress_value <= 66)
 				return yellow;
-			
+
 			return red;
 		}
-		
+
 		public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
 		{
 			if (text_layout == null)
 				UpdateLayout (widget);
-			
+
 			int text_width, text_height;
-			
+
 			text_layout.GetPixelSize (out text_width, out text_height);
-			
+
 			width = (int) (2 * Xpad + Math.Max (progress_width, text_width));
 			height = (int) (3 * Ypad + progress_height + text_height);
-			
+
 			x_offset = Math.Max ((int) (Xalign * (cell_area.Width - width)), 0);
 			y_offset = Math.Max ((int) (Yalign * (cell_area.Height - height)), 0);
 		}
-		
+
 		protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags)
 		{
 			base.Render (window, widget, background_area, cell_area, expose_area, flags);
-			
+
 			if (text_layout == null)
 				UpdateLayout (widget);
 
 			int x, y, width, height, text_width, text_height;
-			
+
 			/* first render the text */
 			text_layout.GetPixelSize (out text_width, out text_height);
-			
+
 			x  = (int) (cell_area.X + Xpad + Math.Max ((int) (Xalign * (cell_area.Width - 2 * Xpad - text_width)), 0));
 			y  = (int) (cell_area.Y + Ypad);
 
@@ -153,35 +153,35 @@ namespace FSpot.Widgets
 			                   "cellrenderertextprogress",
 			                   x, y,
 			                   text_layout);
-			
+
 			y += (int) (text_height + Ypad);
 			x  = (int) (cell_area.X + Xpad + Math.Max ((int) (Xalign * (cell_area.Width - 2 * Xpad - progress_width)), 0));
-			
-			
+
+
 			/* second render the progress bar */
 			using (Cairo.Context cairo_context = Gdk.CairoHelper.Create (window)) {
-				
+
 				width = progress_width;
 				height = progress_height;
-				
+
 				cairo_context.Rectangle (x, y, width, height);
 				Gdk.CairoHelper.SetSourceColor (cairo_context, widget.Style.Dark (StateType.Normal));
 				cairo_context.Fill ();
-				
+
 				x += widget.Style.XThickness;
 				y += widget.Style.XThickness;
 				width -= 2* widget.Style.XThickness;
 				height -= 2 * widget.Style.Ythickness;
-				
+
 				cairo_context.Rectangle (x, y, width, height);
 				Gdk.CairoHelper.SetSourceColor (cairo_context, widget.Style.Light (StateType.Normal));
 				cairo_context.Fill ();
-				
+
 				/* scale the value and ensure, that at least one pixel is drawn, if the value is greater than zero */
 				int scaled_width =
 					(int) Math.Max (((progress_value * width) / 100.0),
 					                (progress_value == 0)? 0 : 1);
-				
+
 				cairo_context.Rectangle (x, y, scaled_width, height);
 				Gdk.CairoHelper.SetSourceColor (cairo_context, GetValueColor ());
 				cairo_context.Fill ();
diff --git a/src/Widgets/CompositeUtils.cs b/src/Clients/MainApp/FSpot.Widgets/CompositeUtils.cs
similarity index 98%
rename from src/Widgets/CompositeUtils.cs
rename to src/Clients/MainApp/FSpot.Widgets/CompositeUtils.cs
index b3740f7..a3c8b9e 100644
--- a/src/Widgets/CompositeUtils.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/CompositeUtils.cs
@@ -9,7 +9,7 @@ namespace FSpot.Widgets {
 	public class CompositeUtils {
 		[DllImport("libgdk-2.0-0.dll")]
 	        static extern bool gdk_screen_is_composited (IntPtr screen);
-		
+
 		[DllImport("libgdk-2.0-0.dll")]
 		static extern bool gdk_x11_screen_supports_net_wm_hint (IntPtr screen,
 									IntPtr property);
@@ -28,7 +28,7 @@ namespace FSpot.Widgets {
 
 		[DllImport("libgdk-2.0-0.dll")]
 		static extern void gdk_property_change(IntPtr window, IntPtr property, IntPtr type, int format, int mode, byte [] data, int nelements);
-		
+
 		public static Colormap GetRgbaColormap (Screen screen)
 		{
 			try {
@@ -62,7 +62,7 @@ namespace FSpot.Widgets {
 				Atom atom = Atom.Intern (name, false);
 				return gdk_x11_screen_supports_net_wm_hint (screen.Handle, atom.Handle);
 			} catch {
-				
+
 				return false;
 			}
 		}
@@ -135,7 +135,7 @@ namespace FSpot.Widgets {
 
 		public static void SetWinOpacity (Gtk.Window win, double opacity)
 		{
-			CompositeUtils.ChangeProperty (win.GdkWindow, 
+			CompositeUtils.ChangeProperty (win.GdkWindow,
 						       Atom.Intern ("_NET_WM_WINDOW_OPACITY", false),
 						       Atom.Intern ("CARDINAL", false),
 						       PropMode.Replace,
@@ -161,7 +161,7 @@ namespace FSpot.Widgets {
 					      out data)) {
 				return new Cms.Profile (data);
 			}
-			
+
 			return null;
 		}
 
diff --git a/src/Widgets/Dissolve.cs b/src/Clients/MainApp/FSpot.Widgets/Dissolve.cs
similarity index 90%
rename from src/Widgets/Dissolve.cs
rename to src/Clients/MainApp/FSpot.Widgets/Dissolve.cs
index 40e2f8e..1f1db2a 100644
--- a/src/Widgets/Dissolve.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Dissolve.cs
@@ -22,54 +22,54 @@ namespace FSpot.Widgets {
 		ImageInfo begin_buffer;
 		ImageInfo end_buffer;
 		int frames = 0;
-		
+
 		public Dissolve (ImageInfo begin, ImageInfo end)
 		{
 			this.begin = begin;
 			this.end = end;
 		}
-		
+
 		public int Frames {
 			get { return frames; }
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			if (begin_buffer == null) {
 				begin_buffer = new ImageInfo (begin, w); //.Allocation);
 			}
-			
+
 			if (end_buffer == null) {
 				end_buffer = new ImageInfo (end, w); //.Allocation);
 			}
-			
+
 			w.QueueDraw ();
 			w.GdkWindow.ProcessUpdates (false);
 
 			TimeSpan elapsed = DateTime.UtcNow - start;
-			double fraction = elapsed.Ticks / (double) duration.Ticks; 
-			
+			double fraction = elapsed.Ticks / (double) duration.Ticks;
+
 			return fraction < 1.0;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle allocation)
 		{
 			if (frames == 0)
 				start = DateTime.UtcNow;
-			
+
 			frames ++;
 			TimeSpan elapsed = DateTime.UtcNow - start;
-			double fraction = elapsed.Ticks / (double) duration.Ticks; 
+			double fraction = elapsed.Ticks / (double) duration.Ticks;
 			double opacity = Math.Sin (Math.Min (fraction, 1.0) * Math.PI * 0.5);
-			
+
 			ctx.Operator = Operator.Source;
-			
+
 			SurfacePattern p = new SurfacePattern (begin_buffer.Surface);
 			ctx.Matrix = begin_buffer.Fill (allocation);
 			p.Filter = Filter.Fast;
 			ctx.Source = p;
 			ctx.Paint ();
-			
+
 			ctx.Operator = Operator.Over;
 			ctx.Matrix = end_buffer.Fill (allocation);
 			SurfacePattern sur = new SurfacePattern (end_buffer.Surface);
@@ -80,13 +80,13 @@ namespace FSpot.Widgets {
 			ctx.Source = sur;
 			ctx.Mask (black);
 			//ctx.Paint ();
-			
+
 			ctx.Matrix = new Matrix ();
-			
+
 			ctx.MoveTo (allocation.Width / 2.0, allocation.Height / 2.0);
-			ctx.Source = new SolidPattern (1.0, 0, 0);	
+			ctx.Source = new SolidPattern (1.0, 0, 0);
 			#if debug
-			ctx.ShowText (String.Format ("{0} {1} {2} {3} {4} {5} {6} {7}", 
+			ctx.ShowText (String.Format ("{0} {1} {2} {3} {4} {5} {6} {7}",
 						     frames,
 						     sur.Status,
 						     p.Status,
@@ -96,14 +96,14 @@ namespace FSpot.Widgets {
 			p.Destroy ();
 			return fraction < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			if (begin_buffer != null) {
 				begin_buffer.Dispose ();
 				begin_buffer = null;
 			}
-			
+
 			if (end_buffer != null) {
 				end_buffer.Dispose ();
 				end_buffer = null;
@@ -111,5 +111,3 @@ namespace FSpot.Widgets {
 		}
 	}
 }
-
- 
diff --git a/src/Widgets/EditorPage.cs b/src/Clients/MainApp/FSpot.Widgets/EditorPage.cs
similarity index 98%
rename from src/Widgets/EditorPage.cs
rename to src/Clients/MainApp/FSpot.Widgets/EditorPage.cs
index eedebf0..0c0dabe 100644
--- a/src/Widgets/EditorPage.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/EditorPage.cs
@@ -156,7 +156,7 @@ namespace FSpot.Widgets {
 			buttons.Spacing = 5;
 			buttons.LayoutStyle = ButtonBoxStyle.Start;
 
-			foreach (Editor editor in editors) 
+			foreach (Editor editor in editors)
 				PackButton (editor);
 
 			buttons.Show ();
@@ -216,7 +216,7 @@ namespace FSpot.Widgets {
 				editor.Apply ();
 			} catch (Exception e) {
 				Log.DebugException (e);
-				string msg = Catalog.GetPluralString ("Error saving adjusted photo", "Error saving adjusted photos", 
+				string msg = Catalog.GetPluralString ("Error saving adjusted photo", "Error saving adjusted photos",
 									editor.State.Items.Length);
 				string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Note that you have to develop RAW files into JPEG before you can edit them."),
 							     e.Message);
diff --git a/src/Widgets/Filmstrip.cs b/src/Clients/MainApp/FSpot.Widgets/Filmstrip.cs
similarity index 93%
rename from src/Widgets/Filmstrip.cs
rename to src/Clients/MainApp/FSpot.Widgets/Filmstrip.cs
index c09a7b4..46d44ef 100644
--- a/src/Widgets/Filmstrip.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Filmstrip.cs
@@ -69,7 +69,7 @@ namespace FSpot.Widgets
 		int thumb_offset = 17;
 		public int ThumbOffset {
 			get { return thumb_offset; }
-			set { 
+			set {
 				if (value < 0)
 					throw new ArgumentException ("ThumbOffset is negative!");
 				thumb_offset = value;
@@ -79,7 +79,7 @@ namespace FSpot.Widgets
 		int thumb_size = 67;
 		public int ThumbSize {
 			get { return thumb_size; }
-			set { 
+			set {
 				if (value < 0)
 					throw new ArgumentException ("ThumbSize is negative!");
 				thumb_size = value;
@@ -100,13 +100,13 @@ namespace FSpot.Widgets
 					background_tile.Fill (0x00000000);
 				}
 
-				if (Orientation == Orientation.Horizontal && background_tile.Height < background_tile.Width) 
-					background_tile = background_tile.RotateSimple (PixbufRotation.Counterclockwise); 
-				else if (Orientation == Orientation.Vertical && background_tile.Width < background_tile.Height) 
-					background_tile = background_tile.RotateSimple (PixbufRotation.Clockwise); 
+				if (Orientation == Orientation.Horizontal && background_tile.Height < background_tile.Width)
+					background_tile = background_tile.RotateSimple (PixbufRotation.Counterclockwise);
+				else if (Orientation == Orientation.Vertical && background_tile.Width < background_tile.Height)
+					background_tile = background_tile.RotateSimple (PixbufRotation.Clockwise);
 				return background_tile;
 			}
-			set { 
+			set {
 				if (background_tile != value && background_tile != null)
 					background_tile.Dispose ();
 				background_tile = value;
@@ -117,7 +117,7 @@ namespace FSpot.Widgets
 		int x_offset = 2;
 		public int XOffset {
 			get { return x_offset; }
-			set { 
+			set {
 				if (value < 0)
 					throw new ArgumentException ("value is negative!");
 				x_offset = value;
@@ -127,7 +127,7 @@ namespace FSpot.Widgets
 		int y_offset = 2;
 		public int YOffset {
 			get { return y_offset; }
-			set { 
+			set {
 				if (value < 0)
 					throw new ArgumentException ("value is negative!");
 				y_offset = value;
@@ -169,8 +169,8 @@ namespace FSpot.Widgets
 
 		double position;
 		public double Position {
-			get { 
-				return position; 
+			get {
+				return position;
 			}
 			set {
 				if (value == position)
@@ -209,7 +209,7 @@ namespace FSpot.Widgets
 
 			animation = new DoubleAnimation (0, 0, TimeSpan.FromSeconds (1.5), SetPositionCore, new CubicEase (EasingMode.EaseOut));
 		}
-	
+
 		int min_length = 400;
 		int min_height = 200;
 		protected override void OnSizeRequested (ref Gtk.Requisition requisition)
@@ -258,13 +258,13 @@ namespace FSpot.Widgets
 					switch (Orientation) {
 					case Orientation.Horizontal:
 						for (int i = 0; i < length; i += BackgroundTile.Width) {
-							BackgroundTile.CopyArea (0, 0, BackgroundTile.Width, BackgroundTile.Height, 
+							BackgroundTile.CopyArea (0, 0, BackgroundTile.Width, BackgroundTile.Height,
 									background_pixbuf, i, 0);
 						}
 						break;
 					case Orientation.Vertical:
 						for (int i = 0; i < height; i += BackgroundTile.Height) {
-							BackgroundTile.CopyArea (0, 0, BackgroundTile.Width, BackgroundTile.Height, 
+							BackgroundTile.CopyArea (0, 0, BackgroundTile.Width, BackgroundTile.Height,
 									background_pixbuf, 0, i);
 						}
 						break;
@@ -295,7 +295,7 @@ namespace FSpot.Widgets
 				Orientation == Orientation.Vertical && (extendable && Allocation.Height >= BackgroundPixbuf.Height + (2 * y_offset) + BackgroundTile.Height) )
 				BackgroundPixbuf = null;
 
-			if ( Orientation == Orientation.Horizontal && (extendable && Allocation.Width < BackgroundPixbuf.Width + (2 * x_offset) ) || 
+			if ( Orientation == Orientation.Horizontal && (extendable && Allocation.Width < BackgroundPixbuf.Width + (2 * x_offset) ) ||
 				Orientation == Orientation.Vertical && ( extendable && Allocation.Height < BackgroundPixbuf.Height + (2 * y_offset) ))
 				BackgroundPixbuf = null;
 
@@ -306,8 +306,8 @@ namespace FSpot.Widgets
 			if (Allocation.Height > BackgroundPixbuf.Height + (2 * y_offset))
 				ypad = (int) (y_align * (Allocation.Height - (BackgroundPixbuf.Height + (2 * y_offset))));
 
-			GdkWindow.DrawPixbuf (Style.BackgroundGC (StateType.Normal), BackgroundPixbuf, 
-					0, 0, x_offset + xpad, y_offset + ypad, 
+			GdkWindow.DrawPixbuf (Style.BackgroundGC (StateType.Normal), BackgroundPixbuf,
+					0, 0, x_offset + xpad, y_offset + ypad,
 					BackgroundPixbuf.Width, BackgroundPixbuf.Height, Gdk.RgbDither.None, 0, 0);
 
 			//drawing the icons...
@@ -322,21 +322,21 @@ namespace FSpot.Widgets
 
 			Pixbuf current = GetPixbuf ((int) Math.Round (Position));
 			int ref_x = (int)(icon_pixbuf.Width / 2.0 - current.Width * (Position + 0.5f - Math.Round (Position))); //xpos of the reference icon
-			int ref_y = (int)(icon_pixbuf.Height / 2.0 - current.Height * (Position + 0.5f - Math.Round (Position))); 
+			int ref_y = (int)(icon_pixbuf.Height / 2.0 - current.Height * (Position + 0.5f - Math.Round (Position)));
 
 			int start_x = Orientation == Orientation.Horizontal ? ref_x : 0;
 			int start_y = Orientation == Orientation.Vertical ? ref_y : 0;
 			for (int i = (int) Math.Round (Position); i < selection.Collection.Count; i++) {
 				current = GetPixbuf (i, ActiveItem == i);
 				if (Orientation == Orientation.Horizontal) {
-					current.CopyArea (0, 0, Math.Min (current.Width, icon_pixbuf.Width - start_x) , current.Height, icon_pixbuf, start_x, start_y);	
-					start_indexes [start_x] = i; 
+					current.CopyArea (0, 0, Math.Min (current.Width, icon_pixbuf.Width - start_x) , current.Height, icon_pixbuf, start_x, start_y);
+					start_indexes [start_x] = i;
 					start_x += current.Width + spacing;
 					if (start_x > icon_pixbuf.Width)
 						break;
 				} else if (Orientation == Orientation.Vertical) {
-					current.CopyArea (0, 0, current.Width, Math.Min (current.Height, icon_pixbuf.Height - start_y), icon_pixbuf, start_x, start_y);	
-					start_indexes [start_y] = i; 
+					current.CopyArea (0, 0, current.Width, Math.Min (current.Height, icon_pixbuf.Height - start_y), icon_pixbuf, start_x, start_y);
+					start_indexes [start_y] = i;
 					start_y += current.Height + spacing;
 					if (start_y > icon_pixbuf.Height)
 						break;
@@ -351,19 +351,19 @@ namespace FSpot.Widgets
 				if (Orientation == Orientation.Horizontal) {
 					start_x -= (current.Width + spacing);
 					current.CopyArea (Math.Max (0, -start_x), 0, Math.Min (current.Width, current.Width + start_x), current.Height, icon_pixbuf, Math.Max (start_x, 0), 0);
-					start_indexes [Math.Max (0, start_x)] = i; 
+					start_indexes [Math.Max (0, start_x)] = i;
 					if (start_x < 0)
 						break;
 				} else if (Orientation == Orientation.Vertical) {
 					start_y -= (current.Height + spacing);
 					current.CopyArea (0, Math.Max (0, -start_y), current.Width, Math.Min (current.Height, current.Height + start_y), icon_pixbuf, 0, Math.Max (start_y, 0));
-					start_indexes [Math.Max (0, start_y)] = i; 
+					start_indexes [Math.Max (0, start_y)] = i;
 					if (start_y < 0)
 						break;
 				}
 			}
 			filmstrip_start_pos = Orientation == Orientation.Horizontal ? start_x : start_y;
-			
+
 			GdkWindow.DrawPixbuf (Style.BackgroundGC (StateType.Normal), icon_pixbuf,
 					0, 0, x_offset + xpad, y_offset + ypad + thumb_offset,
 					icon_pixbuf.Width, icon_pixbuf.Height, Gdk.RgbDither.None, 0, 0);
@@ -400,7 +400,7 @@ namespace FSpot.Widgets
 			case Gdk.Key.Right:
 				ActiveItem ++;
 				return true;
-				
+
 			case Gdk.Key.Page_Up:
 			case Gdk.Key.Up:
 			case Gdk.Key.Left:
@@ -450,14 +450,14 @@ namespace FSpot.Widgets
 			if (!thumb_cache.Contains (item.Uri)) {
 				return;
 			}
-			
+
 			//FIXME use QueueDrawArea
 			//FIXME only invalidate if displayed
 			QueueDraw ();
-			
+
 
 		}
-		
+
 		protected override bool OnPopupMenu ()
 		{
 			DrawOrientationMenu (null);
@@ -467,31 +467,31 @@ namespace FSpot.Widgets
 		private bool DrawOrientationMenu (Gdk.EventButton args)
 		{
 			Gtk.Menu placement_menu = new Gtk.Menu ();
-			GtkUtil.MakeCheckMenuItem (placement_menu, 
-							Mono.Unix.Catalog.GetString ("_Horizontal"), 
-							App.Instance.Organizer.HandleFilmstripHorizontal, 
+			GtkUtil.MakeCheckMenuItem (placement_menu,
+							Mono.Unix.Catalog.GetString ("_Horizontal"),
+							App.Instance.Organizer.HandleFilmstripHorizontal,
 							true, Orientation == Orientation.Horizontal, true);
-			GtkUtil.MakeCheckMenuItem (placement_menu, 
-							Mono.Unix.Catalog.GetString ("_Vertical"), 
-							App.Instance.Organizer.HandleFilmstripVertical, 
+			GtkUtil.MakeCheckMenuItem (placement_menu,
+							Mono.Unix.Catalog.GetString ("_Vertical"),
+							App.Instance.Organizer.HandleFilmstripVertical,
 							true, Orientation == Orientation.Vertical, true);
 
 			if (args != null)
 				placement_menu.Popup (null, null, null, args.Button, args.Time);
 			else
 				placement_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
-			
+
 			return true;
 		}
 
 		protected override bool OnButtonPressEvent (EventButton evnt)
 		{
 			if (evnt.Button == 3)
-				return DrawOrientationMenu (evnt); 
+				return DrawOrientationMenu (evnt);
 
 			if (evnt.Button != 1 || (
-				(Orientation == Orientation.Horizontal && (evnt.X > filmstrip_end_pos || evnt.X < filmstrip_start_pos)) || 
-				(Orientation == Orientation.Vertical && (evnt.Y > filmstrip_end_pos || evnt.Y < filmstrip_start_pos)) 
+				(Orientation == Orientation.Horizontal && (evnt.X > filmstrip_end_pos || evnt.X < filmstrip_start_pos)) ||
+				(Orientation == Orientation.Vertical && (evnt.Y > filmstrip_end_pos || evnt.Y < filmstrip_start_pos))
 				))
 				return false;
 			HasFocus = true;
@@ -502,13 +502,13 @@ namespace FSpot.Widgets
 			ActiveItem = (int)start_indexes [pos];
 			return true;
 		}
- 
- 		protected Pixbuf GetPixbuf (int i)
+
+		protected Pixbuf GetPixbuf (int i)
 		{
 			return GetPixbuf (i, false);
 		}
 
- 		protected virtual Pixbuf GetPixbuf (int i, bool highlighted)
+		protected virtual Pixbuf GetPixbuf (int i, bool highlighted)
 		{
 			Pixbuf current = null;
 			SafeUri uri = (selection.Collection [i]).DefaultVersion.Uri;
@@ -535,15 +535,15 @@ namespace FSpot.Widgets
 					thumb_cache.Add (uri, current);
                 }
 			}
-			
+
 			//FIXME: we might end up leaking a pixbuf here
 			Cms.Profile screen_profile;
-			if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) { 
+			if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
 				Pixbuf t = current.Copy ();
 				current = t;
 				FSpot.ColorManagement.ApplyProfile (current, screen_profile);
 			}
-			
+
 			// Add a four pixel white border around the thumbnail
 			Pixbuf whiteBorder = new Pixbuf (Gdk.Colorspace.Rgb, true, 8, current.Width, current.Height);
 			whiteBorder.Fill (0);
@@ -572,7 +572,7 @@ namespace FSpot.Widgets
 			Log.DebugFormat ("Finalizer called on {0}. Should be Disposed", GetType ());
 			Dispose (false);
 		}
-			
+
 		public override void Dispose ()
 		{
 			Dispose (true);
diff --git a/src/Widgets/FindBar.cs b/src/Clients/MainApp/FSpot.Widgets/FindBar.cs
similarity index 99%
rename from src/Widgets/FindBar.cs
rename to src/Clients/MainApp/FSpot.Widgets/FindBar.cs
index 7694953..691a1bb 100644
--- a/src/Widgets/FindBar.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FindBar.cs
@@ -4,7 +4,7 @@
  * Author(s)
  *  Gabriel Burt  <gabriel burt gmail com>
  *  Stephane Delcroix  <stephane delcroix org>
- * 
+ *
  * This is free software. See COPYING for details.
  */
 
diff --git a/src/Widgets/FolderTreeModel.cs b/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
similarity index 94%
rename from src/Widgets/FolderTreeModel.cs
rename to src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
index 70229f5..3be8593 100644
--- a/src/Widgets/FolderTreeModel.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
@@ -15,6 +15,7 @@ using Gtk;
 using GLib;
 
 using FSpot;
+using FSpot.Database;
 using FSpot.Core;
 using Hyena;
 
@@ -27,66 +28,66 @@ namespace FSpot.Widgets
 		protected FolderTreeModel (IntPtr raw) : base (raw) { }
 
 		Db database;
-		
-		const string query_string = 
+
+		const string query_string =
 			"SELECT base_uri, COUNT(*) AS count " +
-			"FROM photos " + 
+			"FROM photos " +
 			"GROUP BY base_uri " +
 			"ORDER BY base_uri ASC";
-		
-		
+
+
 		public FolderTreeModel ()
 			: base (typeof (string), typeof (int), typeof (SafeUri))
 		{
 			database = App.Instance.Database;
 			database.Photos.ItemsChanged += HandlePhotoItemsChanged;
-			
+
 			UpdateFolderTree ();
 		}
-		
+
 		void HandlePhotoItemsChanged (object sender, DbItemEventArgs<Photo> e)
 		{
 			UpdateFolderTree ();
 		}
-		
+
 		public string GetFolderNameByIter (TreeIter iter)
 		{
 			if ( ! IterIsValid (iter))
 				return null;
-			
+
 			return (string) GetValue (iter, 0);
 		}
-		
+
 		public int GetPhotoCountByIter (TreeIter iter)
 		{
 			if ( ! IterIsValid (iter))
 				return -1;
-			
+
 			return (int) GetValue (iter, 1);
 		}
-		
+
 		public SafeUri GetUriByIter (TreeIter iter)
 		{
 			if ( ! IterIsValid (iter))
 				return null;
-			
+
 			return (SafeUri) GetValue (iter, 2);
-		}	
-		
+		}
+
 		public SafeUri GetUriByPath (TreePath row)
 		{
 			TreeIter iter;
-			
+
 			GetIter (out iter, row);
-			
+
 			return GetUriByIter (iter);
 		}
-		
+
 		int count_all;
 		public int Count {
 			get { return count_all; }
 		}
-		
+
 		/*
 		 * UpdateFolderTree queries for directories in database and updates
 		 * a possibly existing folder-tree to the queried structure
@@ -94,24 +95,24 @@ namespace FSpot.Widgets
 		private void UpdateFolderTree ()
 		{
 			Clear ();
-			
+
 			count_all = 0;
-			
+
 			/* points at start of each iteration to the leaf of the last inserted uri */
 			TreeIter iter = TreeIter.Zero;
-			
+
 			/* stores the segments of the last inserted uri */
 			string[] last_segments = new string[] {};
-			
+
 			int last_count = 0;
-			
+
 			IDataReader reader = database.Database.Query (query_string);
-			
+
 			while (reader.Read ()) {
 				var base_uri = new SafeUri (reader["base_uri"].ToString (), true);
-				
+
 				int count = Convert.ToInt32 (reader["count"]);
-				
+
 				// FIXME: this is a workaround hack to stop things from crashing - https://bugzilla.gnome.org/show_bug.cgi?id=622318
 				int index = base_uri.ToString ().IndexOf ("://");
 				var hack = base_uri.ToString ().Substring (index + 3);
@@ -123,32 +124,32 @@ namespace FSpot.Widgets
 				 * scheme here.
 				 */
 				segments[0] = base_uri.Scheme;
-				
+
 				int i = 0;
-				
+
 				/* find first difference of last inserted an current uri */
 				while (i < last_segments.Length && i < segments.Length) {
 					if (segments[i] != last_segments[i])
 						break;
-					
+
 					i++;
 				}
-				
+
 				/* points to the parent node of the current iter */
 				TreeIter parent_iter = iter;
-				
+
 				/* step back to the level, where the difference occur */
 				for (int j = 0; j + i < last_segments.Length; j++) {
-					
+
 					iter = parent_iter;
-					
-					if (IterParent (out parent_iter, iter)) { 
+
+					if (IterParent (out parent_iter, iter)) {
 						last_count += (int)GetValue (parent_iter, 1);
 						SetValue (parent_iter, 1, last_count);
 					} else
 						count_all += (int)last_count;
 				}
-				
+
 				while (i < segments.Length) {
 					if (IterIsValid (parent_iter)) {
 						iter =
@@ -165,15 +166,15 @@ namespace FSpot.Widgets
 					}
 
 					parent_iter = iter;
-					
+
 					i++;
 				}
-				
+
 				last_count = count;
 				last_segments = segments;
-				
+
 			}
-			
+
 			if (IterIsValid (iter)) {
 				/* and at least, step back and update photo count */
 				while (IterParent (out iter, iter)) {
diff --git a/src/Widgets/FolderTreePage.cs b/src/Clients/MainApp/FSpot.Widgets/FolderTreePage.cs
similarity index 95%
rename from src/Widgets/FolderTreePage.cs
rename to src/Clients/MainApp/FSpot.Widgets/FolderTreePage.cs
index 6221794..5888208 100644
--- a/src/Widgets/FolderTreePage.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FolderTreePage.cs
@@ -17,8 +17,8 @@ namespace FSpot.Widgets
 	public class FolderTreePage : SidebarPage
 	{
 		readonly FolderTreeView folder_tree_widget;
-		
-		public FolderTreePage () 
+
+		public FolderTreePage ()
 			: base (new ScrolledWindow (), Catalog.GetString ("Folders"), "gtk-directory")
 		{
 			ScrolledWindow scrolled_window = SidebarWidget as ScrolledWindow;
diff --git a/src/Widgets/FolderTreeView.cs b/src/Clients/MainApp/FSpot.Widgets/FolderTreeView.cs
similarity index 95%
rename from src/Widgets/FolderTreeView.cs
rename to src/Clients/MainApp/FSpot.Widgets/FolderTreeView.cs
index ad0a1aa..a8f3543 100644
--- a/src/Widgets/FolderTreeView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FolderTreeView.cs
@@ -23,54 +23,54 @@ using Mono.Unix;
 namespace FSpot.Widgets
 {
 	public class FolderTreeView : SaneTreeView
-	{	
+	{
 		FolderTreeModel folder_tree_model;
 
 		protected FolderTreeView (IntPtr raw) : base (raw) {}
-	
+
 		public FolderTreeView () : this (new FolderTreeModel ())
 		{
 		}
 
 		public FolderTreeView (FolderTreeModel tree_model) : base (tree_model)
-		{		
+		{
 			folder_tree_model = tree_model;
-			
+
 			HeadersVisible = false;
-			
+
 			TreeViewColumn column = new TreeViewColumn ();
-			
+
 			CellRendererPixbuf pixbuf_renderer = new CellRendererPixbuf ();
 			column.PackStart (pixbuf_renderer, false);
 			column.SetCellDataFunc (pixbuf_renderer, PixbufDataFunc as TreeCellDataFunc);
-			
+
 			CellRendererTextProgress folder_renderer = new CellRendererTextProgress ();
 			column.PackStart (folder_renderer, true);
 			column.SetCellDataFunc (folder_renderer, FolderDataFunc as TreeCellDataFunc);
-			
+
 			AppendColumn (column);
-			
+
 			Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
 				    folder_tree_source_target_table, Gdk.DragAction.Copy | Gdk.DragAction.Move);
 		}
-		
+
 		public UriList SelectedUris {
 			get {
 				UriList list = new UriList ();
-				
+
 				TreePath[] selected_rows = Selection.GetSelectedRows ();
-				
+
 				foreach (TreePath row in selected_rows)
 					list.Add (new SafeUri (folder_tree_model.GetUriByPath (row)));
-				
+
 				return list;
 			}
 		}
-		
+
 		void PixbufDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
 		{
 			CellRendererPixbuf renderer = cell as CellRendererPixbuf;
-			
+
 			string stock;
 			var uri = folder_tree_model.GetUriByIter (iter);
 			if (uri == null)
@@ -79,13 +79,13 @@ namespace FSpot.Widgets
 			try {
 				FileInfo info =
 					file.QueryInfo ("standard::icon", FileQueryInfoFlags.None, null);
-				
+
 				ThemedIcon themed_icon = info.Icon as ThemedIcon;
 				if (themed_icon != null && themed_icon.Names.Length > 0)
 					stock = themed_icon.Names[0];
 				else
 					stock = "gtk-directory";
-				
+
 			} catch (Exception) {
 				stock = "gtk-directory";
 			}
@@ -99,21 +99,21 @@ namespace FSpot.Widgets
 				renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
 			}
 		}
-		
+
 		void FolderDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
 		{
 			CellRendererTextProgress renderer = cell as CellRendererTextProgress;
-			
+
 			int progress_value = 0;
 			int count = (tree_model as FolderTreeModel).Count;
-			
+
 			if (count != 0)
 				progress_value = (int) ((100.0 * folder_tree_model.GetPhotoCountByIter (iter)) / count);
-			
+
 			renderer.Value = progress_value;
-			
+
 			string text = folder_tree_model.GetFolderNameByIter (iter);
-			
+
 			TreeIter tmp;
 			if (tree_model.IterParent (out tmp, iter)) {
 				renderer.UseMarkup = false;
@@ -121,7 +121,7 @@ namespace FSpot.Widgets
 				renderer.CellBackground = null;
 			} else {
 				renderer.UseMarkup = true;
-				
+
 				/* since import do not use GIO at the moment, no other prefix than file:/// is
 				 * possible.
 				 */
@@ -129,38 +129,38 @@ namespace FSpot.Widgets
 					renderer.Text = String.Format ("<b>{0}</b>", Catalog.GetString ("Filesystem"));
 				else
 					renderer.Text = String.Format ("<b>{0}</b>", text);
-				
+
 				renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
 			}
 		}
-			
+
 		private static TargetEntry [] folder_tree_source_target_table =
 			new TargetEntry [] {
 				DragDropTargets.UriQueryEntry,
 				DragDropTargets.UriListEntry,
 				DragDropTargets.PlainTextEntry
 		};
-		
-		
+
+
 		protected override void OnDragDataGet (Gdk.DragContext context, Gtk.SelectionData selection_data, uint info, uint time_)
 		{
 			if (info == DragDropTargets.UriQueryEntry.Info
 			    || info == DragDropTargets.UriListEntry.Info
 			    || info == DragDropTargets.PlainTextEntry.Info) {
-				
+
 				selection_data.SetUriListData (SelectedUris, context.Targets[0]);
 				return;
 			}
 		}
-		
+
 		protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time_)
 		{
 			return true;
 		}
-		
+
 		protected override void OnRowActivated (Gtk.TreePath path, Gtk.TreeViewColumn column)
 		{
-			App.Instance.Organizer.SetFolderQuery (SelectedUris);	
+			App.Instance.Organizer.SetFolderQuery (SelectedUris);
 		}
 
 	}
diff --git a/src/Widgets/IEffect.cs b/src/Clients/MainApp/FSpot.Widgets/IEffect.cs
similarity index 98%
rename from src/Widgets/IEffect.cs
rename to src/Clients/MainApp/FSpot.Widgets/IEffect.cs
index 7d784a5..eb77db4 100644
--- a/src/Widgets/IEffect.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/IEffect.cs
@@ -1,6 +1,6 @@
 /*
  * IEffect.cs
- * 
+ *
  * Author
  *   Larry Ewing <lewing novell com>
  *
diff --git a/src/Widgets/ITransition.cs b/src/Clients/MainApp/FSpot.Widgets/ITransition.cs
similarity index 98%
rename from src/Widgets/ITransition.cs
rename to src/Clients/MainApp/FSpot.Widgets/ITransition.cs
index 91c6aaf..06cae77 100644
--- a/src/Widgets/ITransition.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/ITransition.cs
@@ -5,7 +5,7 @@
  *   Larry Ewing <lewing novell com>
  *
  * Larry had a little lamb
- * 
+ *
  */
 using System;
 
diff --git a/src/Widgets/IconView.cs b/src/Clients/MainApp/FSpot.Widgets/IconView.cs
similarity index 99%
rename from src/Widgets/IconView.cs
rename to src/Clients/MainApp/FSpot.Widgets/IconView.cs
index 8b1f0d5..13e4862 100644
--- a/src/Widgets/IconView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/IconView.cs
@@ -972,12 +972,12 @@ namespace FSpot.Widgets
 				rating = new FSpot.Widgets.RatingSmall ((int) photo.Rating, false);
 				rating.DisplayPixbuf.RenderToDrawable (BinWindow, Style.WhiteGC,
 						0, 0, region.X, region.Y, -1, -1, RgbDither.None, 0, 0);
-				
+
 			}
 			Gdk.Rectangle layout_bounds = Gdk.Rectangle.Zero;
 			if (DisplayDates) {
 				string date;
-				try { 
+				try {
 					if (cell_width > 200) {
 						date = photo.Time.ToString ();
 					} else {
@@ -1073,7 +1073,7 @@ namespace FSpot.Widgets
 									tag_bounds.Height,
 									InterpType.Bilinear);
 						}
-						
+
 						Cms.Profile screen_profile;
 						if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
 							FSpot.ColorManagement.ApplyProfile (scaled_icon, screen_profile);
diff --git a/src/Widgets/ImageInfo.cs b/src/Clients/MainApp/FSpot.Widgets/ImageInfo.cs
similarity index 96%
rename from src/Widgets/ImageInfo.cs
rename to src/Clients/MainApp/FSpot.Widgets/ImageInfo.cs
index 1944c22..1284324 100644
--- a/src/Widgets/ImageInfo.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/ImageInfo.cs
@@ -1,6 +1,6 @@
 /*
  * ImageInfo.cs
- * 
+ *
  * Author
  *   LarryEwing <lewing novell com
  *
@@ -18,7 +18,7 @@ namespace FSpot.Widgets {
 	public class ImageInfo : IDisposable {
 		public Surface Surface;
 		public Gdk.Rectangle Bounds;
-		
+
 		public ImageInfo (SafeUri uri)
 		{
 				using (var img = ImageFile.Create (uri)) {
@@ -27,23 +27,23 @@ namespace FSpot.Widgets {
 					pixbuf.Dispose ();
 				}
 		}
-		
+
 		public ImageInfo (Pixbuf pixbuf)
 		{
 			SetPixbuf (pixbuf);
 		}
-		
+
 		public ImageInfo (ImageInfo info, Widget w) : this (info, w, w.Allocation)
 		{
 		}
-		
+
 		public ImageInfo (ImageInfo info, Widget w, Gdk.Rectangle bounds)
 		{
 			Cairo.Surface similar = CairoUtils.CreateSurface (w.GdkWindow);
 			Bounds = bounds;
 			Surface = similar.CreateSimilar (Content.ColorAlpha, Bounds.Width, Bounds.Height);
 			Context ctx = new Context (Surface);
-			
+
 			ctx.Matrix = info.Fill (Bounds);
 			Pattern p = new SurfacePattern (info.Surface);
 			ctx.Source = p;
@@ -51,7 +51,7 @@ namespace FSpot.Widgets {
 			((IDisposable)ctx).Dispose ();
 			p.Destroy ();
 		}
-		
+
 		public ImageInfo (ImageInfo info, Gdk.Rectangle allocation)
 		{
 			#if false
@@ -64,12 +64,12 @@ namespace FSpot.Widgets {
 			Surface = info.Surface.CreateSimilar (Content.Color,
 							      allocation.Width,
 							      allocation.Height);
-			
+
 			Log.DebugFormat ("status = {1} pointer = {0}", Surface.Handle.ToString (), Surface.Status);
 			Context ctx = new Context (Surface);
 			#endif
 			Bounds = allocation;
-			
+
 			ctx.Matrix = info.Fill (allocation);
 			Pattern p = new SurfacePattern (info.Surface);
 			ctx.Source = p;
@@ -77,30 +77,30 @@ namespace FSpot.Widgets {
 			((IDisposable)ctx).Dispose ();
 			p.Destroy ();
 		}
-		
+
 		private void SetPixbuf (Pixbuf pixbuf)
 		{
 			Surface = MemorySurface.CreateSurface (pixbuf);
 			Bounds.Width = pixbuf.Width;
 			Bounds.Height = pixbuf.Height;
 		}
-		
-		public Matrix Fill (Gdk.Rectangle viewport) 
+
+		public Matrix Fill (Gdk.Rectangle viewport)
 		{
 			Matrix m = new Matrix ();
 			m.InitIdentity ();
-			
+
 			double scale = Math.Max (viewport.Width / (double) Bounds.Width,
 						 viewport.Height / (double) Bounds.Height);
-			
+
 			double x_offset = Math.Round (((viewport.Width  - Bounds.Width * scale) / 2.0));
 			double y_offset = Math.Round (((viewport.Height  - Bounds.Height * scale) / 2.0));
-			
+
 			m.Translate (x_offset, y_offset);
 			m.Scale (scale, scale);
 			return m;
 		}
-		
+
 		//
 		// this functions calculates the transformation needed to center and completely fill the
 		// viewport with the Surface at the given tilt
@@ -109,10 +109,10 @@ namespace FSpot.Widgets {
 		{
 			if (tilt == 0.0)
 				return Fill (viewport);
-			
+
 			Matrix m = new Matrix ();
 			m.InitIdentity ();
-			
+
 			double len;
 			double orig_len;
 			if (Bounds.Width > Bounds.Height) {
@@ -122,18 +122,18 @@ namespace FSpot.Widgets {
 				len = viewport.Width;
 				orig_len = Bounds.Width;
 			}
-			
+
 			double a = Math.Sqrt (viewport.Width * viewport.Width + viewport.Height * viewport.Height);
 			double alpha = Math.Acos (len / a);
 			double theta = alpha - Math.Abs (tilt);
-			
+
 			double slen = a * Math.Cos (theta);
-			
+
 			double scale = slen / orig_len;
-			
+
 			double x_offset = (viewport.Width  - Bounds.Width * scale) / 2.0;
 			double y_offset = (viewport.Height  - Bounds.Height * scale) / 2.0;
-			
+
 			m.Translate (x_offset, y_offset);
 			m.Scale (scale, scale);
 			m.Invert ();
@@ -143,23 +143,23 @@ namespace FSpot.Widgets {
 			m.Invert ();
 			return m;
 		}
-		
+
 		public Matrix Fit (Gdk.Rectangle viewport)
 		{
 			Matrix m = new Matrix ();
 			m.InitIdentity ();
-			
+
 			double scale = Math.Min (viewport.Width / (double) Bounds.Width,
 						 viewport.Height / (double) Bounds.Height);
-			
+
 			double x_offset = (viewport.Width  - Bounds.Width * scale) / 2.0;
 			double y_offset = (viewport.Height  - Bounds.Height * scale) / 2.0;
-			
+
 			m.Translate (x_offset, y_offset);
 			m.Scale (scale, scale);
 			return m;
 		}
-		
+
 		public void Dispose ()
 		{
 			((IDisposable)Surface).Dispose ();
diff --git a/src/Widgets/InfoBox.cs b/src/Clients/MainApp/FSpot.Widgets/InfoBox.cs
similarity index 97%
rename from src/Widgets/InfoBox.cs
rename to src/Clients/MainApp/FSpot.Widgets/InfoBox.cs
index 8f63ef7..28e4114 100644
--- a/src/Widgets/InfoBox.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/InfoBox.cs
@@ -32,7 +32,7 @@ namespace FSpot.Widgets
 {
 	public class InfoBox : VBox {
 		Delay update_delay;
-	
+
 		private IBrowsableItem [] photos = new IBrowsableItem [0];
 		public IBrowsableItem [] Photos {
 			set {
@@ -51,7 +51,7 @@ namespace FSpot.Widgets
 				}
 			}
 		}
-	
+
 		private bool show_tags = false;
 		public bool ShowTags {
 			get { return show_tags; }
@@ -63,7 +63,7 @@ namespace FSpot.Widgets
 				tag_view.Visible = show_tags;
 			}
 		}
-	
+
 		private bool show_rating = false;
 		public bool ShowRating {
 			get { return show_rating; }
@@ -79,7 +79,7 @@ namespace FSpot.Widgets
 
 		public delegate void VersionChangedHandler (InfoBox info_box, IBrowsableItemVersion version);
 		public event VersionChangedHandler VersionChanged;
-	
+
 		private Expander info_expander;
 		private Expander histogram_expander;
 
@@ -102,8 +102,8 @@ namespace FSpot.Widgets
 		}
 
 		private readonly InfoBoxContextSwitchStrategy ContextSwitchStrategy;
-	
-		// Widgetry.	
+
+		// Widgetry.
 		private Label name_label;
 		private Label name_value_label;
 
@@ -119,13 +119,13 @@ namespace FSpot.Widgets
 
 		private Label exposure_label;
 		private Label exposure_value_label;
-		
+
 		private Label focal_length_label;
 		private Label focal_length_value_label;
-		
+
 		private Label camera_label;
 		private Label camera_value_label;
-		
+
 		private Label file_size_label;
 		private Label file_size_value_label;
 
@@ -134,7 +134,7 @@ namespace FSpot.Widgets
 
 		private TagView tag_view;
 		private string default_exposure_string;
-		
+
 		private bool show_name;
 		private bool show_date;
 		private bool show_size;
@@ -146,8 +146,8 @@ namespace FSpot.Widgets
 		private void HandleRatingChanged (object o, EventArgs e)
 		{
 			App.Instance.Organizer.HandleRatingMenuSelected ((o as Widgets.Rating).Value);
-	 	}
-	
+		}
+
 		private Label CreateRightAlignedLabel (string text)
 		{
 			Label label = new Label ();
@@ -157,7 +157,7 @@ namespace FSpot.Widgets
 
 			return label;
 		}
-	
+
 		const int TABLE_XPADDING = 3;
 		const int TABLE_YPADDING = 3;
 		private Label AttachLabel (Table table, int row_num, Widget entry)
@@ -169,23 +169,23 @@ namespace FSpot.Widgets
 			label.Show ();
 
 			label.PopulatePopup += HandlePopulatePopup;
-			
+
 			table.Attach (label, 1, 2, (uint) row_num, (uint) row_num + 1,
 				      AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill,
 				      (uint) entry.Style.XThickness + TABLE_XPADDING, (uint) entry.Style.YThickness);
-	
+
 			return label;
 		}
-	
+
 		private void SetupWidgets ()
 		{
 
 			histogram_expander = new Expander (Catalog.GetString ("Histogram"));
-			histogram_expander.Activated += delegate (object sender, EventArgs e) { 
+			histogram_expander.Activated += delegate (object sender, EventArgs e) {
 				ContextSwitchStrategy.SetHistogramVisible (Context, histogram_expander.Expanded);
 				UpdateHistogram ();
 			};
-			histogram_expander.StyleSet += delegate (object sender, StyleSetArgs args) { 
+			histogram_expander.StyleSet += delegate (object sender, StyleSetArgs args) {
 				Gdk.Color c = this.Toplevel.Style.Backgrounds [(int)Gtk.StateType.Active];
 				histogram.RedColorHint = (byte) (c.Red / 0xff);
 				histogram.GreenColorHint = (byte) (c.Green / 0xff);
@@ -203,17 +203,17 @@ namespace FSpot.Widgets
 			info_expander.Activated += delegate (object sender, EventArgs e) {
 				ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
 			};
-			
+
 			Table info_table = new Table (10, 2, false);
 			info_table.BorderWidth = 0;
-	
+
 			string name_pre = "<b>";
 			string name_post = "</b>";
 
 			name_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Name") + name_post);
 			info_table.Attach (name_label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
 
-			version_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Version") + name_post); 
+			version_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Version") + name_post);
 			info_table.Attach (version_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
 
 			date_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Date") + name_post + Environment.NewLine);
@@ -225,16 +225,16 @@ namespace FSpot.Widgets
 			default_exposure_string = name_pre + Catalog.GetString ("Exposure") + name_post;
 			exposure_label = CreateRightAlignedLabel (default_exposure_string);
 			info_table.Attach (exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-			
+
 			focal_length_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Focal Length") + name_post);
 			info_table.Attach (focal_length_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-			
+
 			camera_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Camera") + name_post);
 			info_table.Attach (camera_label, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-			
+
 			file_size_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("File Size") + name_post);
 			info_table.Attach (file_size_label, 0, 1, 7, 8, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-			
+
 			rating_label = CreateRightAlignedLabel (name_pre + Catalog.GetString ("Rating") + name_post);
 			info_table.Attach (rating_label, 0, 1, 8, 9, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
 			rating_label.Visible = false;
@@ -245,13 +245,13 @@ namespace FSpot.Widgets
 			name_value_label.Selectable = true;
 			name_value_label.Xalign = 0;
 			name_value_label.PopulatePopup += HandlePopulatePopup;
-			
+
 			info_table.Attach (name_value_label, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 3, 0);
-			
+
 			date_value_label = AttachLabel (info_table, 2, name_value_label);
 			size_value_label = AttachLabel (info_table, 3, name_value_label);
 			exposure_value_label = AttachLabel (info_table, 4, name_value_label);
-			
+
 			version_list = new ListStore (typeof (IBrowsableItemVersion), typeof (string), typeof (bool));
 			version_combo = new ComboBox ();
 			CellRendererText version_name_cell = new CellRendererText ();
@@ -261,7 +261,7 @@ namespace FSpot.Widgets
 			version_combo.Model = version_list;
 			version_combo.Changed += OnVersionComboChanged;
 			info_table.Attach (version_combo, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-	
+
 			date_value_label.Text = Environment.NewLine;
 			exposure_value_label.Text = Environment.NewLine;
 			focal_length_value_label = AttachLabel (info_table, 5, name_value_label);
@@ -270,7 +270,7 @@ namespace FSpot.Widgets
 
 			Gtk.Alignment rating_align = new Gtk.Alignment( 0, 0, 0, 0);
 			info_table.Attach (rating_align, 1, 2, 8, 9, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING);
-			
+
 			rating_view = new RatingSmall ();
 			rating_view.Visible = false;
 			rating_view.Changed += HandleRatingChanged;
@@ -347,7 +347,7 @@ namespace FSpot.Widgets
 					return info;
 				}
 			}
-			
+
 			public string FocalLength {
 				get {
 					if (focal_length == null)
@@ -366,18 +366,18 @@ namespace FSpot.Widgets
 				}
 			}
 
-	
+
 			public string Dimensions {
 				get {
 					if (width != 0 && height != 0)
 						return String.Format ("{0}x{1}", width, height);
-					else 
+					else
 						return Catalog.GetString ("(Unknown)");
 				}
 			}
 		}
-			
-	
+
+
 		public bool Update ()
 		{
 			if (Photos == null || Photos.Length == 0) {
@@ -390,9 +390,9 @@ namespace FSpot.Widgets
 				UpdateMultiple ();
 			}
 			return false;
-		}	
-	
-		private void UpdateSingle () 
+		}
+
+		private void UpdateSingle ()
 		{
 			ImageInfo info;
 
@@ -404,9 +404,9 @@ namespace FSpot.Widgets
 			if (show_name) {
 				name_value_label.Text = photo.Name != null ? photo.Name : String.Empty;
 			}
-			name_label.Visible = show_name;	
+			name_label.Visible = show_name;
 			name_value_label.Visible = show_name;
-			
+
 			try {
 				using (var img = ImageFile.Create (photo.DefaultVersion.Uri))
 				{
@@ -414,7 +414,7 @@ namespace FSpot.Widgets
 				}
 			} catch (System.Exception e) {
 				Hyena.Log.Debug (e.StackTrace);
-				info = new ImageInfo (null);			
+				info = new ImageInfo (null);
 			}
 
 			if (show_exposure) {
@@ -442,12 +442,12 @@ namespace FSpot.Widgets
 			}
 			date_label.Visible = show_date;
 			date_value_label.Visible = show_date;
-			
+
 			if (show_focal_length)
 				focal_length_value_label.Text = info.FocalLength;
 			focal_length_label.Visible = show_focal_length;
 			focal_length_value_label.Visible = show_focal_length;
-			
+
 			if (show_camera)
 				camera_value_label.Text = info.CameraModel;
 			camera_label.Visible = show_camera;
@@ -457,7 +457,7 @@ namespace FSpot.Widgets
 			version_combo.Visible = true;
 			version_list.Clear ();
 			version_combo.Changed -= OnVersionComboChanged;
-			
+
 			int count = 0;
 			foreach (IBrowsableItemVersion version in photo.Versions) {
 				version_list.AppendValues (version, version.Name, true);
@@ -465,7 +465,7 @@ namespace FSpot.Widgets
 					version_combo.Active = count;
 				count++;
 			}
-			
+
 			if (count <= 1) {
 				version_combo.Sensitive = false;
 				version_combo.TooltipText = Catalog.GetString ("(No Edits)");
@@ -486,10 +486,10 @@ namespace FSpot.Widgets
 					Hyena.Log.DebugException (e);
 				}
 			}
-			
+
 			file_size_label.Visible = show_file_size;
-			file_size_value_label.Visible = show_file_size;			
-			
+			file_size_value_label.Visible = show_file_size;
+
 			if (show_tags)
 				tag_view.Current = photo;
 			rating_label.Visible = show_rating;
@@ -497,7 +497,7 @@ namespace FSpot.Widgets
 			if (show_rating) {
 				rating_view.Value = (int) photo.Rating;
 			}
-	
+
 			Show ();
 		}
 
@@ -529,16 +529,16 @@ namespace FSpot.Widgets
 			name_label.Visible = false;
 			name_value_label.Text = String.Format(Catalog.GetString("{0} Photos"), Photos.Length);
 			name_value_label.Visible = true;
-			
+
 			version_label.Visible = false;
 			version_combo.Visible = false;
 
 			exposure_label.Visible = false;
 			exposure_value_label.Visible = false;
-			
+
 			focal_length_label.Visible = false;
 			focal_length_value_label.Visible = false;
-			
+
 			camera_label.Visible = false;
 			camera_value_label.Visible = false;
 
@@ -547,7 +547,7 @@ namespace FSpot.Widgets
 				IBrowsableItem last = Photos [0];
 				if (first.Time.Date == last.Time.Date) {
 					//Note for translators: {0} is a date, {1} and {2} are times.
-					date_value_label.Text = String.Format(Catalog.GetString("On {0} between \n{1} and {2}"), 
+					date_value_label.Text = String.Format(Catalog.GetString("On {0} between \n{1} and {2}"),
 					                                      first.Time.ToShortDateString (),
 					                                      first.Time.ToShortTimeString (),
 					                                      last.Time.ToShortTimeString ());
@@ -563,7 +563,7 @@ namespace FSpot.Widgets
 			if (show_file_size) {
 				long file_size = 0;
 				foreach (IBrowsableItem photo in Photos) {
-					
+
 					try {
 						GFile file = FileFactory.NewForUri (photo.DefaultVersion.Uri);
 						GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
@@ -574,7 +574,7 @@ namespace FSpot.Widgets
 						break;
 					}
 				}
-				
+
 				if (file_size != -1)
 					file_size_value_label.Text = Format.SizeForDisplay (file_size);
 
@@ -582,7 +582,7 @@ namespace FSpot.Widgets
 					file_size_value_label.Text = Catalog.GetString("(At least one File not found)");
 			}
 			file_size_label.Visible = show_file_size;
-			file_size_value_label.Visible = show_file_size;	
+			file_size_value_label.Visible = show_file_size;
 
 			size_label.Visible = false;
 			size_value_label.Visible = false;
@@ -618,9 +618,9 @@ namespace FSpot.Widgets
 				if (hint == null)
 					using (var img = ImageFile.Create (photo.DefaultVersion.Uri))
 						hint = img.Load (256, 256);
-				
+
 				histogram_image.Pixbuf = histogram.Generate (hint, max);
-				
+
 				hint.Dispose ();
 			} catch (System.Exception e) {
 				Hyena.Log.Debug (e.StackTrace);
@@ -642,7 +642,7 @@ namespace FSpot.Widgets
 
 			bool histogram_visible = ContextSwitchStrategy.HistogramVisible (Context);
 			histogram_expander.Expanded = histogram_visible;
-			
+
 			show_name = ContextSwitchStrategy.InfoBoxNameVisible (Context);
 			show_date = ContextSwitchStrategy.InfoBoxDateVisible (Context);
 			show_size = ContextSwitchStrategy.InfoBoxSizeVisible (Context);
@@ -650,11 +650,11 @@ namespace FSpot.Widgets
 			show_focal_length = ContextSwitchStrategy.InfoBoxFocalLengthVisible (Context);
 			show_camera = ContextSwitchStrategy.InfoBoxCameraVisible (Context);
 			show_file_size = ContextSwitchStrategy.InfoBoxFileSizeVisible (Context);
-			
+
 			if (infobox_visible)
 				update_delay.Start ();
 		}
-	
+
 		public void HandleMainWindowViewModeChanged (object o, EventArgs args)
 		{
 			MainWindow.ModeType mode = App.Instance.Organizer.ViewMode;
@@ -663,106 +663,106 @@ namespace FSpot.Widgets
 			else if (mode == MainWindow.ModeType.PhotoView)
 				Context = ViewContext.Edit;
 		}
-		
+
 		void HandleButtonPressEvent (object sender, ButtonPressEventArgs args)
 		{
 			if (args.Event.Button == 3) {
 				Menu popup_menu = new Menu ();
-				
+
 				AddMenuItems (popup_menu);
-				
+
 				if (args.Event != null)
 					popup_menu.Popup (null, null, null, args.Event.Button, args.Event.Time);
 				else
 					popup_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
-			
+
 				args.RetVal = true;
 			}
 		}
-		
+
 		void HandlePopulatePopup (object sender, PopulatePopupArgs args)
-		{			
+		{
 			AddMenuItems (args.Menu);
-			
+
 			args.RetVal = true;
 		}
-		
+
 		private void AddMenuItems (Menu popup_menu) {
-			
+
 			if (popup_menu.Children.Length > 0) {
 				GtkUtil.MakeMenuSeparator (popup_menu);
 			}
-			
+
 			MenuItem item;
-			
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                                  Catalog.GetString ("Show Photo Name"),
 			                                  HandleMenuItemSelected,
 			                                  true,
 			                                  show_name,
 			                                  false);
-			
+
 			item.SetData ("cb", name_label.Handle);
-				
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show Date"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_date,
 			                           false);
-			
-			item.SetData ("cb", date_label.Handle);			
-			
+
+			item.SetData ("cb", date_label.Handle);
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show Size"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_size,
 			                           false);
-			
+
 			item.SetData ("cb", size_label.Handle);
-			
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show Exposure"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_exposure,
 			                           false);
-			
+
 			item.SetData ("cb", exposure_label.Handle);
-			
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show Focal Length"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_focal_length,
 			                           false);
-			
+
 			item.SetData ("cb", focal_length_label.Handle);
-			
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show Camera"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_camera,
 			                           false);
-			
+
 			item.SetData ("cb", camera_label.Handle);
-			
+
 			item = GtkUtil.MakeCheckMenuItem (popup_menu,
 			                           Catalog.GetString ("Show File Size"),
 			                           HandleMenuItemSelected,
 			                           true,
 			                           show_file_size,
 			                           false);
-			
+
 			item.SetData ("cb", file_size_label.Handle);
 		}
-		
+
 		private void HandleMenuItemSelected (object sender, EventArgs args)
 		{
 			IntPtr handle = (sender as CheckMenuItem).GetData ("cb");
-			
+
 			if (handle == name_label.Handle) {
 				show_name = (sender as CheckMenuItem).Active;
 				ContextSwitchStrategy.SetInfoBoxNameVisible (Context, show_name);
@@ -785,12 +785,12 @@ namespace FSpot.Widgets
 				show_file_size = (sender as CheckMenuItem).Active;
 				ContextSwitchStrategy.SetInfoBoxFileSizeVisible (Context, show_file_size);
 			}
-			
+
 			update_delay.Start ();
 		}
-	
+
 		// Constructor.
-	
+
 		public InfoBox () : base (false, 0)
 		{
 			ContextSwitchStrategy = new MRUInfoBoxContextSwitchStrategy ();
@@ -802,7 +802,7 @@ namespace FSpot.Widgets
 			update_delay.Start ();
 
 			histogram_delay = new Delay (DelayedUpdateHistogram);
-			
+
 			BorderWidth = 2;
 			Hide ();
 		}
@@ -840,7 +840,7 @@ namespace FSpot.Widgets
 		private string PrefKeyForContext (ViewContext context, string item) {
 			return String.Format ("{0}/{1}_visible/{2}", PREF_PREFIX, item, context);
 		}
-		
+
 		private string PrefKeyForContext (ViewContext context, string parent, string item) {
 			return String.Format ("{0}/{1}_visible/{2}/{3}", PREF_PREFIX, parent, item, context);
 		}
@@ -852,7 +852,7 @@ namespace FSpot.Widgets
 			else
 				return visible == "1";
 		}
-		
+
 		private bool VisibilityForContext (ViewContext context, string parent, string item, bool default_value) {
 			string visible = Preferences.Get<string> (PrefKeyForContext (context, parent, item));
 			if (visible == null)
@@ -864,7 +864,7 @@ namespace FSpot.Widgets
 		private void SetVisibilityForContext (ViewContext context, string item, bool visible) {
 			Preferences.Set (PrefKeyForContext (context, item), visible ? "1" : "0");
 		}
-		
+
 		private void SetVisibilityForContext (ViewContext context, string parent, string item, bool visible) {
 			Preferences.Set (PrefKeyForContext (context, parent, item), visible ? "1" : "0");
 		}
@@ -876,31 +876,31 @@ namespace FSpot.Widgets
 		public override bool HistogramVisible (ViewContext context) {
 			return VisibilityForContext (context, "histogram", true);
 		}
-		
+
 		public override bool InfoBoxNameVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "name", true);
 		}
-		
+
 		public override bool InfoBoxDateVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "date", true);
 		}
-		
+
 		public override bool InfoBoxSizeVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "size", true);
 		}
-		
+
 		public override bool InfoBoxExposureVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "exposure", true);
 		}
-		
+
 		public override bool InfoBoxFocalLengthVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "focal_length", false);
 		}
-		
+
 		public override bool InfoBoxCameraVisible (ViewContext context)  {
 			return VisibilityForContext (context, "infobox", "camera", false);
 		}
-		
+
 		public override bool InfoBoxFileSizeVisible (ViewContext context) {
 			return VisibilityForContext (context, "infobox", "file_size", false);
 		}
@@ -912,31 +912,31 @@ namespace FSpot.Widgets
 		public override void SetHistogramVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "histogram", visible);
 		}
-		
+
 		public override void SetInfoBoxNameVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "name", visible);
 		}
-		
+
 		public override void SetInfoBoxDateVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "date", visible);
 		}
-		
+
 		public override void SetInfoBoxSizeVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "size", visible);
 		}
-		
+
 		public override void SetInfoBoxExposureVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "exposure", visible);
 		}
-		
+
 		public override void SetInfoBoxFocalLengthVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "focal_length", visible);
 		}
-		
+
 		public override void SetInfoBoxCameraVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "camera", visible);
 		}
-		
+
 		public override void SetInfoBoxFileSizeVisible (ViewContext context, bool visible) {
 			SetVisibilityForContext (context, "infobox", "file_size", visible);
 		}
diff --git a/src/Loupe.cs b/src/Clients/MainApp/FSpot.Widgets/Loupe.cs
similarity index 96%
rename from src/Loupe.cs
rename to src/Clients/MainApp/FSpot.Widgets/Loupe.cs
index bc863eb..c760b28 100644
--- a/src/Loupe.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Loupe.cs
@@ -35,10 +35,10 @@ namespace FSpot.Widgets {
 		Gdk.Point hotspot;
 
 		public Loupe (PhotoImageView view) : base ("Loupe")
-		{ 
+		{
 			this.view = view;
 			Decorated = false;
-			
+
 			Gtk.Window win = (Gtk.Window) view.Toplevel;
 
 			win.GetPosition (out old_win_pos.X, out old_win_pos.Y);
@@ -59,14 +59,14 @@ namespace FSpot.Widgets {
 
 			x = args.Event.X - old_win_pos.X;
 			y = args.Event.Y - old_win_pos.Y;
-			
+
 			GetPosition (out loupe_x, out loupe_y);
 			Move (loupe_x + x, loupe_y + y);
 
 			old_win_pos.X = args.Event.X;
 			old_win_pos.Y = args.Event.Y;
 		}
-		
+
 		// FIXME
 		//screen "composited-changed"
 
@@ -124,7 +124,7 @@ namespace FSpot.Widgets {
 		protected override void OnRealized ()
 		{
 			use_shape_ext = ! (CompositeUtils.IsComposited (Screen) && CompositeUtils.SetRgbaColormap (this));
-			
+
 			base.OnRealized ();
 			ShapeWindow ();
 		}
@@ -135,9 +135,9 @@ namespace FSpot.Widgets {
 			region.Y = p.Y;
 			region.Width = 2 * radius;
 			region.Height = 2 * radius;
-			
+
 			if (view.Pixbuf != null) {
-				region.Offset (- Math.Min (region.X, Math.Max (region.Right - view.Pixbuf.Width, radius)), 
+				region.Offset (- Math.Min (region.X, Math.Max (region.Right - view.Pixbuf.Width, radius)),
 					       - Math.Min (region.Y, Math.Max (region.Bottom - view.Pixbuf.Height, radius)));
 
 				region.Intersect (new Gdk.Rectangle (0, 0, view.Pixbuf.Width, view.Pixbuf.Height));
@@ -149,12 +149,12 @@ namespace FSpot.Widgets {
 		{
 			if (source != null)
 				source.Dispose ();
-			
+
 			source = null;
 
 			if (view.Pixbuf == null)
 				return;
-			
+
 			int small = (int) (radius * view.Zoom);
 			if (small != inner) {
 				inner = small;
@@ -166,7 +166,7 @@ namespace FSpot.Widgets {
 						 region.Width, region.Height);
 			using (tmp)
 				source = FSpot.Utils.PixbufUtils.TransformOrientation (tmp, view.PixbufOrientation);
-			
+
 			//FIXME sometimes that ctor returns results with a null
 			//handle this case ourselves
 			if (source.Handle == IntPtr.Zero)
@@ -180,20 +180,20 @@ namespace FSpot.Widgets {
 		{
 			Gdk.Point coords;
 			coords = new Gdk.Point ((int) args.Event.X, (int) args.Event.Y);
-			
+
 			SetSamplePoint (view.WindowCoordsToImage (coords));
 		}
 
 		private void ShapeWindow ()
 		{
 			Layout ();
-			Gdk.Pixmap bitmap = new Gdk.Pixmap (GdkWindow, 
-							    Allocation.Width, 
+			Gdk.Pixmap bitmap = new Gdk.Pixmap (GdkWindow,
+							    Allocation.Width,
 							    Allocation.Height, 1);
-			
+
 			Context g = CairoHelper.Create (bitmap);
 			DrawShape (g, Allocation.Width, Allocation.Height);
-			
+
 			((IDisposable)g).Dispose ();
 
 			if (use_shape_ext)
@@ -210,33 +210,33 @@ namespace FSpot.Widgets {
 			}
 			bitmap.Dispose ();
 		}
-		
+
 		Gdk.Point Center;
 	        Requisition Bounds;
-		
+
 		public void Layout ()
 		{
 			double a = radius + border;
 			double b = inner + border;
 			double x_proj = (a + b - border) * Math.Cos (angle);
 			double y_proj = (a + b - border) * Math.Sin (angle);
-			
+
 			Center.X = (int) Math.Ceiling (Math.Max (-x_proj + b, a));
 			Center.Y = (int) Math.Ceiling (Math.Max (-y_proj + b, a));
 
 			Bounds.Width = (int) Math.Ceiling (Math.Max (Math.Abs (x_proj) + b, a) + b + a);
 			Bounds.Height = (int) Math.Ceiling (Math.Max (Math.Abs (y_proj) + b, a) + b + a);
-			
+
 			hotspot.X = (int) Math.Ceiling (Center.X + x_proj);
 			hotspot.Y = (int) Math.Ceiling (Center.Y + y_proj);
 		}
-	
+
 		private void DrawShape (Context g, int width, int height)
 		{
 			int inner_x = radius + border + inner;
 			int cx = Center.X;
 			int cy = Center.Y;
-		
+
 			g.Operator = Operator.Source;
 			g.Source = new SolidPattern (new Cairo.Color (0,0,0,0));
 			g.Rectangle (0, 0, width, height);
@@ -256,15 +256,15 @@ namespace FSpot.Widgets {
 			g.Source = new SolidPattern (new Cairo.Color (0, 0, 0, 1.0));
 			g.Operator = Operator.DestOut;
 			g.Arc (inner_x, 0, inner, 0, 2 * Math.PI);
-#if true			
+#if true
 			g.Fill ();
 #else
 			g.FillPreserve ();
 
 			g.Operator = Operator.Over;
 			RadialGradient rg = new RadialGradient (inner_x - (inner * 0.3), inner * 0.3 , inner * 0.1, inner_x, 0, inner);
-			rg.AddColorStop (0, new Cairo.Color (0.0, 0.2, .8, 0.5)); 
-			rg.AddColorStop (0.7, new Cairo.Color (0.0, 0.2, .8, 0.1)); 
+			rg.AddColorStop (0, new Cairo.Color (0.0, 0.2, .8, 0.5));
+			rg.AddColorStop (0.7, new Cairo.Color (0.0, 0.2, .8, 0.1));
 			rg.AddColorStop (1.0, new Cairo.Color (0.0, 0.0, 0.0, 0.0));
 			g.Source = rg;
 			g.Fill ();
@@ -292,14 +292,14 @@ namespace FSpot.Widgets {
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
 			Context g = CairoHelper.Create (GdkWindow);
-			
+
 			DrawShape (g, Allocation.Width, Allocation.Height);
 			//base.OnExposeEvent (args);
 			((IDisposable)g).Dispose ();
 			return false;
 
 		}
-		
+
 		bool dragging = false;
 		bool rotate = false;
 		Delay drag;
@@ -333,23 +333,23 @@ namespace FSpot.Widgets {
 				Gdk.Point initial = start_root;
 				Gdk.Point hot = start_hot;
 				Gdk.Point win = Gdk.Point.Zero;
-				
+
 				hot.X += win.X;
 				hot.Y += win.Y;
-				
+
 				initial.X -= hot.X;
 				initial.Y -= hot.Y;
 				Gdk.Point now = root_pos;
 				now.X -= hot.X;
 				now.Y -= hot.Y;
-				
+
 				Vector v1 = new Vector (initial);
 				Vector v2 = new Vector (now);
 
 				double angle = Vector.AngleBetween (v1, v2);
-				
+
 				Angle = start_angle + angle;
-				return false;	
+				return false;
 			}
 		}
 
@@ -358,19 +358,19 @@ namespace FSpot.Widgets {
 			Gdk.Point view_coords;
 			Gdk.Point top;
 			Gdk.Point current;
-			
+
 			GdkWindow.GetOrigin (out current.X, out current.Y);
-		
+
 			if (current == pos)
 				return false;
-			
+
 			Move (pos.X, pos.Y);
 
 			pos.Offset (hotspot.X, hotspot.Y);
 			Gtk.Window toplevel = (Gtk.Window) view.Toplevel;
 			toplevel.GdkWindow.GetOrigin (out top.X, out top.Y);
-			toplevel.TranslateCoordinates (view, 
-						       pos.X - top.X,  pos.Y - top.Y, 
+			toplevel.TranslateCoordinates (view,
+						       pos.X - top.X,  pos.Y - top.Y,
 						       out view_coords.X, out view_coords.Y);
 
 			SetSamplePoint (view.WindowCoordsToImage (view_coords));
@@ -444,7 +444,7 @@ namespace FSpot.Widgets {
 			closed_hand_cursor.Dispose ();
 			opened_hand_cursor = null;
 			closed_hand_cursor = null;
-			
+
 			base.OnDestroyed ();
 		}
 
@@ -454,8 +454,8 @@ namespace FSpot.Widgets {
 			//widget.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));
 			return widget;
 		}
-		
-		protected override void OnSizeRequested (ref Requisition requisition) 
+
+		protected override void OnSizeRequested (ref Requisition requisition)
 		{
 			Layout ();
 			requisition = Bounds;
@@ -464,11 +464,11 @@ namespace FSpot.Widgets {
 		protected virtual void BuildUI ()
 		{
 			SetFancyStyle (this);
-			
+
 			TransientFor = (Gtk.Window) view.Toplevel;
 			SkipPagerHint = true;
 			SkipTaskbarHint = true;
-			
+
 			//view.MotionNotifyEvent += HandleImageViewMotion;
 			view.Item.Changed += HandleItemChanged;
 			view.ZoomChanged += HandleViewZoomChanged;
@@ -509,4 +509,3 @@ namespace FSpot.Widgets {
 		}
 	}
 }
-
diff --git a/src/Widgets/MetadataDisplay.cs b/src/Clients/MainApp/FSpot.Widgets/MetadataDisplay.cs
similarity index 95%
rename from src/Widgets/MetadataDisplay.cs
rename to src/Clients/MainApp/FSpot.Widgets/MetadataDisplay.cs
index 5f53d8f..766585e 100644
--- a/src/Widgets/MetadataDisplay.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/MetadataDisplay.cs
@@ -22,8 +22,8 @@ using FSpot.Imaging;
 
 namespace FSpot.Widgets {
 	public class MetadataDisplayPage : SidebarPage {
-		public MetadataDisplayPage() : base(new MetadataDisplayWidget(), 
-											Catalog.GetString ("Metadata"), 
+		public MetadataDisplayPage() : base(new MetadataDisplayWidget(),
+											Catalog.GetString ("Metadata"),
 											"gtk-info") {
 			(SidebarWidget as MetadataDisplayWidget).Page = this;
 		}
@@ -38,60 +38,60 @@ namespace FSpot.Widgets {
 
 	public class MetadataDisplayWidget : ScrolledWindow {
 		Delay update_delay;
-		
+
 		/* 	This VBox only contains exif-data,
 			so it is seperated from other information */
 		VBox metadata_vbox;
-		
+
 		VBox main_vbox;
 		Label metadata_message;
 		State display;
-		
+
 		private MetadataDisplayPage page;
 		public MetadataDisplayPage Page {
 			set { page = value; }
 			get { return page; }
 		}
-		
+
 		// stores list of the expanded expanders
 		List<string> open_list;
-		
+
 		ListStore extended_metadata;
-		
+
 		bool up_to_date = false;
-		
+
 		enum State {
 			metadata,
 			message
 		};
-		
+
 		public MetadataDisplayWidget ()
 		{
 			main_vbox = new VBox ();
 			main_vbox.Spacing = 6;
-			
+
 			metadata_message = new Label (String.Empty);
 			metadata_message.UseMarkup = true;
 			metadata_message.LineWrap = true;
 			metadata_vbox = new VBox ();
 			metadata_vbox.Spacing = 6;
-			
+
 			main_vbox.PackStart (metadata_vbox, false, false, 0);
 			AddWithViewport (metadata_message);
 			((Viewport) Child).ShadowType = ShadowType.None;
 			BorderWidth = 3;
-			
+
 			display = State.message;
 			ExposeEvent += HandleExposeEvent;
-			
+
 			open_list = new List<string> ();
-			
+
 			// Create Expander and TreeView for
 			// extended metadata
 			TreeView tree_view = new TreeView ();
 			tree_view.HeadersVisible = false;
 			tree_view.RulesHint = true;
-						
+
 			TreeViewColumn col = new TreeViewColumn ();
 			col.Sizing = TreeViewColumnSizing.Autosize;
 			CellRenderer colr = new CellRendererText ();
@@ -100,28 +100,28 @@ namespace FSpot.Widgets {
 			col.AddAttribute (colr, "markup", 0);
 
 			tree_view.AppendColumn (col);
-			
+
 			extended_metadata = new ListStore (typeof(string));
 			tree_view.Model = extended_metadata;
-			
+
 			Expander expander = new Expander (String.Format("<span weight=\"bold\"><small>{0}</small></span>", Catalog.GetString ("Extended Metadata")));
 			expander.UseMarkup = true;
 			expander.Add (tree_view);
 			expander.Expanded = true;
-			
+
 			main_vbox.PackStart (expander, false, false, 6);
 			expander.ShowAll ();
-			
+
 			update_delay = new Delay (Update);
 			update_delay.Start ();
 		}
-		
+
 		private IBrowsableItem photo;
 		public IBrowsableItem Photo {
 			get { return photo; }
 			set {
 				photo = value;
-				
+
 				if (!Visible) {
 					up_to_date = false;
 				} else {
@@ -129,19 +129,19 @@ namespace FSpot.Widgets {
 				}
 			}
 		}
-		
+
 		private void HandleExposeEvent (object sender, ExposeEventArgs args)
 		{
 			if (!up_to_date) {
 				update_delay.Start ();
 			}
 		}
-		
+
 		internal void HandleSelectionChanged (IBrowsableCollection collection) {
             // Don't show metadata when multiple photos are selected.
 			Photo = (collection != null && collection.Count == 1) ? collection [0] : null;
 		}
-		
+
 		internal void HandleSelectionItemsChanged (IBrowsableCollection collection, BrowsableEventArgs args) {
 			if (!args.Changes.MetadataChanged)
 				return;
@@ -158,13 +158,13 @@ namespace FSpot.Widgets {
                 return (Page.Sidebar as Sidebar).IsActive (Page);
             }
         }
-		
+
 		private ListStore AddExpander (string name, int pos)
 		{
 			TreeView tree_view = new TreeView ();
 			tree_view.HeadersVisible = false;
 			tree_view.RulesHint = true;
-						
+
 			TreeViewColumn col = new TreeViewColumn ();
 			col.Sizing = TreeViewColumnSizing.Autosize;
 			CellRenderer colr = new CellRendererText ();
@@ -173,28 +173,28 @@ namespace FSpot.Widgets {
 			col.AddAttribute (colr, "markup", 0);
 
 			tree_view.AppendColumn (col);
-			
+
 			ListStore model = new ListStore (typeof(string));
 			tree_view.Model = model;
-			
+
 			Expander expander = new Expander (String.Format ("<span weight=\"bold\"><small>{0}</small></span>", name));
 			expander.UseMarkup = true;
 			expander.Add (tree_view);
 			expander.Expanded = true;
-			
+
 			metadata_vbox.PackStart (expander, false, false, 6);
 			metadata_vbox.ReorderChild (expander, pos);
-			
+
 			if (open_list.Contains (name))
 				expander.Expanded = true;
-			
+
 			expander.Activated += HandleExpanderActivated;
-			
+
 			expander.ShowAll ();
-			
+
 			return model;
 		}
-		
+
 		public void HandleExpanderActivated (object sender, EventArgs e)
 		{
 			Expander expander = (Expander) sender;
@@ -202,8 +202,8 @@ namespace FSpot.Widgets {
 				open_list.Add (expander.Label);
 			else
 				open_list.Remove (expander.Label);
-		}		
-		
+		}
+
 		private bool Update ()
 		{
 			bool empty = true;
@@ -216,25 +216,25 @@ namespace FSpot.Widgets {
             TreeIter iter;
 			ListStore model;
 			string name;
-			
+
 			up_to_date = true;
-			
+
 			int i = 0;
-			
+
 			// Write Exif-Data
 			if (exif_info != null) {
 				foreach (ExifContent content in exif_info.GetContents ()) {
 					ExifEntry [] entries = content.GetEntries ();
-					
+
 					i++;
-					
+
 					if (entries.Length < 1)
 						continue;
-					
+
 					empty = false;
-										
+
 					name = ExifUtil.GetIfdNameExtended ((Ifd)i - 1);
-					
+
 					if (index_of_expander >= metadata_vbox.Children.Length)
 						model = AddExpander (name, index_of_expander);
 					else {
@@ -242,37 +242,37 @@ namespace FSpot.Widgets {
 						if (expander.Label == name)
 							model = (ListStore)((TreeView)expander.Child).Model;
 						else {
-							model = AddExpander (name, index_of_expander);					
+							model = AddExpander (name, index_of_expander);
 						}
 					}
-					
+
 					model.GetIterFirst(out iter);
-				
+
 					foreach (ExifEntry entry in entries) {
 						string s;
-						
+
 						if (entry.Title != null)
 							s = String.Format ("{0}\n\t<small>{1}</small>", entry.Title, entry.Value);
 						else
 							s = String.Format ("Unknown Tag ID={0}\n\t<small>{1}</small>", entry.Tag.ToString (), entry.Value);
-												
+
 						if (model.IterIsValid(iter)) {
 							model.SetValue (iter, 0, s);
 							model.IterNext(ref iter);
 						} else
 							model.AppendValues (s);
 					}
-					
+
 					// remove rows, that are not used
 					while (model.IterIsValid(iter)) {
 						model.Remove (ref iter);
 					}
-					
+
 					index_of_expander++;
 				}
 			}
-			
-			
+
+
 			// Write Extended Metadata
 			if (photo != null) {
 				MetadataStore store = new MetadataStore ();
@@ -294,26 +294,26 @@ namespace FSpot.Widgets {
 						error = e;
 					}
 				}
-				
+
 				model = extended_metadata;
 				model.GetIterFirst(out iter);
-				
+
 				if (store.StatementCount > 0) {
 					empty = false;
 
-					
+
 					foreach (Statement stmt in store) {
 						// Skip anonymous subjects because they are
 						// probably part of a collection
 						if (stmt.Subject.Uri == null && store.SelectSubjects (null, stmt.Subject).Length > 0)
 							continue;
-						
+
 						string title;
 						string value;
 						string s;
 
 						Description.GetDescription (store, stmt, out title, out value);
-						
+
 						if (value == null)
 						{
 							MemoryStore substore = store.Select (new Statement ((Entity)stmt.Object, null, null, null)).Load();
@@ -336,7 +336,7 @@ namespace FSpot.Widgets {
 								model.AppendValues (s);
 						}
 					}
-					
+
 				} else {
 					// clear Extended Metadata
 					String s = String.Format ("<small>{0}</small>", Catalog.GetString ("No Extended Metadata Available"));
@@ -347,13 +347,13 @@ namespace FSpot.Widgets {
 					} else
 						model.AppendValues (s);
 				}
-				
+
 				// remove rows, that are not used
 				while (model.IterIsValid(iter)) {
 					model.Remove (ref iter);
 				}
 			}*/
-			
+
 			if (empty) {
 				string msg;
 				if (photo == null) {
@@ -367,9 +367,9 @@ namespace FSpot.Widgets {
 						msg = String.Format ("<i>{0}</i>", error);
 					}
 				}
-				
+
 				metadata_message.Markup = "<span weight=\"bold\">" + msg + "</span>";
-				
+
 				if (display == State.metadata) {
 					// Child is a Viewport, (AddWithViewport in ctor)
 					((Viewport)Child).Remove (main_vbox);
@@ -381,7 +381,7 @@ namespace FSpot.Widgets {
 				// remove Expanders, that are not used
 				while (index_of_expander < metadata_vbox.Children.Length)
 					metadata_vbox.Remove (metadata_vbox.Children[index_of_expander]);
-				
+
 				if (display == State.message) {
 					// Child is a Viewport, (AddWithViewport in ctor)
 					((Viewport)Child).Remove (metadata_message);
@@ -390,10 +390,10 @@ namespace FSpot.Widgets {
 					main_vbox.ShowAll ();
 				}
 			}
-			
-			return false;		
+
+			return false;
 		}
-		
+
         /*
 		private void WriteCollection (MemoryStore substore, StringBuilder collection)
 		{
@@ -405,19 +405,19 @@ namespace FSpot.Widgets {
 					MetadataStore.Namespaces.Normalize (stmt.Object.Uri, out prefix, out type);
 				}
 			}
-			
+
 			foreach (Statement sub in substore) {
 				if (sub.Object is SemWeb.Literal) {
 					string title;
 					string value = ((SemWeb.Literal)sub.Object).Value;
-					
+
 					Description.GetDescription (substore, sub, out title, out value);
 
-					if (type == null) 
+					if (type == null)
 						collection.AppendFormat ("\n\t<small>{0}: {1}</small>", title, value);
 					else
 						collection.AppendFormat ("\n\t<small>{0}</small>", value);
-					
+
 				} else {
 					if (type == null) {
 						MemoryStore substore2 = substore.Select (new Statement ((Entity)sub.Object, null, null, null)).Load();
diff --git a/src/Widgets/PanZoom.cs b/src/Clients/MainApp/FSpot.Widgets/PanZoom.cs
similarity index 92%
rename from src/Widgets/PanZoom.cs
rename to src/Clients/MainApp/FSpot.Widgets/PanZoom.cs
index cc7cf28..5327c4e 100644
--- a/src/Widgets/PanZoom.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/PanZoom.cs
@@ -13,7 +13,7 @@ using System;
 using Cairo;
 using Gtk;
 
-namespace FSpot.Widgets {		
+namespace FSpot.Widgets {
 	public class PanZoomOld : ITransition {
 		ImageInfo info;
 		TimeSpan duration = new TimeSpan (0, 0, 7);
@@ -24,38 +24,38 @@ namespace FSpot.Widgets {
 		DateTime start;
 		int frames = 0;
 		double zoom;
-		
+
 		public PanZoomOld (ImageInfo info)
 		{
 			this.info = info;
 		}
-		
+
 		public int Frames {
 			get { return frames; }
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			if (frames == 0) {
 				start = DateTime.UtcNow;
 				Gdk.Rectangle viewport = w.Allocation;
-				
+
 				zoom = Math.Max (viewport.Width / (double) info.Bounds.Width,
 						 viewport.Height / (double) info.Bounds.Height);
-				
-				zoom *= 1.2;		     
-				
+
+				zoom *= 1.2;
+
 				x_offset = (viewport.Width - info.Bounds.Width * zoom);
 				y_offset = (viewport.Height - info.Bounds.Height * zoom);
-				
+
 				pan_x = 0;
 				pan_y = 0;
 				w.QueueDraw ();
 			}
 			frames ++;
-			
+
 			double percent = Math.Min ((DateTime.UtcNow - start).Ticks / (double) duration.Ticks, 1.0);
-			
+
 			double x = x_offset * percent;
 			double y = y_offset * percent;
 
@@ -65,34 +65,34 @@ namespace FSpot.Widgets {
 				pan_y = y;
 				//w.GdkWindow.ProcessUpdates (false);
 			}
-			
+
 			return percent < 1.0;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle viewport)
 		{
 			double percent = Math.Min ((DateTime.UtcNow - start).Ticks / (double) duration.Ticks, 1.0);
-			
+
 			//Matrix m = info.Fill (allocation);
 			Matrix m = new Matrix ();
 			m.Translate (pan_x, pan_y);
 			m.Scale (zoom, zoom);
 			ctx.Matrix = m;
-			
+
 			SurfacePattern p = new SurfacePattern (info.Surface);
 			ctx.Source = p;
 			ctx.Paint ();
 			p.Destroy ();
-			
+
 			return percent < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			//info.Dispose ();
 		}
 	}
-	
+
 	public class PanZoom : ITransition {
 		ImageInfo info;
 		ImageInfo buffer;
@@ -102,38 +102,38 @@ namespace FSpot.Widgets {
 		DateTime start;
 		int frames = 0;
 		double zoom;
-		
+
 		public PanZoom (ImageInfo info)
 		{
 			this.info = info;
 		}
-		
+
 		public int Frames {
 			get { return frames; }
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			Gdk.Rectangle viewport = w.Allocation;
 			if (buffer == null) {
 				double scale = Math.Max (viewport.Width / (double) info.Bounds.Width,
 							 viewport.Height / (double) info.Bounds.Height);
-				
-				scale *= 1.2;		     
-				buffer = new ImageInfo (info, w, 
-							new Gdk.Rectangle (0, 0, 
-									   (int) (info.Bounds.Width * scale), 
+
+				scale *= 1.2;
+				buffer = new ImageInfo (info, w,
+							new Gdk.Rectangle (0, 0,
+									   (int) (info.Bounds.Width * scale),
 									   (int) (info.Bounds.Height * scale)));
 				start = DateTime.UtcNow;
 				//w.QueueDraw ();
 				zoom = 1.0;
 			}
-			
+
 			double percent = Math.Min ((DateTime.UtcNow - start).Ticks / (double) duration.Ticks, 1.0);
-			
+
 			int n_x = (int) Math.Floor ((buffer.Bounds.Width - viewport.Width) * percent);
 			int n_y = (int) Math.Floor ((buffer.Bounds.Height - viewport.Height) * percent);
-			
+
 			if (n_x != pan_x || n_y != pan_y) {
 				//w.GdkWindow.Scroll (- (n_x - pan_x), - (n_y - pan_y));
 				w.QueueDraw ();
@@ -142,17 +142,17 @@ namespace FSpot.Widgets {
 			}
 			pan_x = n_x;
 			pan_y = n_y;
-			
+
 			return percent < 1.0;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle viewport)
 		{
 			double percent = Math.Min ((DateTime.UtcNow - start).Ticks / (double) duration.Ticks, 1.0);
 			frames ++;
-			
+
 			//ctx.Matrix = m;
-			
+
 			SurfacePattern p = new SurfacePattern (buffer.Surface);
 			p.Filter = Filter.Fast;
 			Matrix m = new Matrix ();
@@ -163,10 +163,10 @@ namespace FSpot.Widgets {
 			ctx.Source = p;
 			ctx.Paint ();
 			p.Destroy ();
-			
+
 			return percent < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			buffer.Dispose ();
diff --git a/src/PhotoImageView.cs b/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs
similarity index 96%
rename from src/PhotoImageView.cs
rename to src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs
index baf2469..9c4e34f 100644
--- a/src/PhotoImageView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs
@@ -65,7 +65,7 @@ namespace FSpot.Widgets {
 		{
 			if (Item == null || !Item.IsValid)
 				return;
-			
+
 			HandlePhotoItemChanged (this, null);
 		}
 
@@ -74,7 +74,7 @@ namespace FSpot.Widgets {
 			get { return (Zoom - MIN_ZOOM) / (MAX_ZOOM - MIN_ZOOM); }
 			set { Zoom = (value * (MAX_ZOOM - MIN_ZOOM)) + MIN_ZOOM; }
 		}
-		
+
 		public event EventHandler PhotoChanged;
 #endregion
 
@@ -90,11 +90,11 @@ namespace FSpot.Widgets {
 				return base.OnKeyPressEvent (evnt);
 
 			bool handled = true;
-		
+
 			// Scroll if image is zoomed in (scrollbars are visible)
 			Gtk.ScrolledWindow scrolled_w = this.Parent as Gtk.ScrolledWindow;
 			bool scrolled = scrolled_w != null && !this.Fit;
-		
+
 			// Go to the next/previous photo when not zoomed (no scrollbars)
 			switch (evnt.Key) {
 			case Gdk.Key.Up:
@@ -169,7 +169,7 @@ namespace FSpot.Widgets {
 		}
 #endregion
 
-#region loader		
+#region loader
 		uint timer;
 		IImageLoader loader;
 		void Load (SafeUri uri)
@@ -257,7 +257,7 @@ namespace FSpot.Widgets {
 				prev.Dispose ();
 		}
 #endregion
-		
+
 		protected BrowsablePointer item;
 		protected Loupe loupe;
 		protected Loupe sharpener;
@@ -266,7 +266,7 @@ namespace FSpot.Widgets {
 		{
 			Reload ();
 		}
-		
+
 		bool progressive_display = true;
 		bool ShowProgress {
 			get { return progressive_display; }
@@ -276,10 +276,10 @@ namespace FSpot.Widgets {
 		{
 			// FIXME we should check the exception type and do something
 			// like offer the user a chance to locate the moved file and
-			// update the db entry, but for now just set the error pixbuf	
+			// update the db entry, but for now just set the error pixbuf
 			Pixbuf old = Pixbuf;
-			Pixbuf = new Pixbuf (PixbufUtils.ErrorPixbuf, 0, 0, 
-					     PixbufUtils.ErrorPixbuf.Width, 
+			Pixbuf = new Pixbuf (PixbufUtils.ErrorPixbuf, 0, 0,
+					     PixbufUtils.ErrorPixbuf.Width,
 					     PixbufUtils.ErrorPixbuf.Height);
 			if (old != null)
 				old.Dispose ();
@@ -288,10 +288,10 @@ namespace FSpot.Widgets {
 			ZoomFit (false);
 		}
 
-		void HandlePhotoItemChanged (object sender, BrowsablePointerChangedEventArgs args) 
+		void HandlePhotoItemChanged (object sender, BrowsablePointerChangedEventArgs args)
 		{
 			// If it is just the position that changed fall out
-			if (args != null && 
+			if (args != null &&
 			    args.PreviousItem != null &&
 			    Item.IsValid &&
 			    (args.PreviousIndex != item.Index) &&
@@ -308,13 +308,13 @@ namespace FSpot.Widgets {
 
 			// Same image, don't load it progressively
 			if (args != null &&
-			    args.PreviousItem != null && 
-			    Item.IsValid && 
+			    args.PreviousItem != null &&
+			    Item.IsValid &&
 			    Item.Current.DefaultVersion.Uri == args.PreviousItem.DefaultVersion.Uri)
 				progressive_display = false;
 
 			try {
-				if (Item.IsValid) 
+				if (Item.IsValid)
 					Load (Item.Current.DefaultVersion.Uri);
 				else
 					LoadErrorImage (null);
@@ -322,14 +322,14 @@ namespace FSpot.Widgets {
 				Log.DebugException (e);
 				LoadErrorImage (e);
 			}
-			
+
 			Selection = Gdk.Rectangle.Zero;
 
 			EventHandler eh = PhotoChanged;
 			if (eh != null)
 				eh (this, EventArgs.Empty);
 		}
-		
+
 
 		private void HandleLoupeDestroy (object sender, EventArgs args)
 		{
@@ -349,11 +349,11 @@ namespace FSpot.Widgets {
 				loupe.Destroyed += HandleLoupeDestroy;
 				loupe.Show ();
 			} else {
-				loupe.Destroy ();	
+				loupe.Destroy ();
 			}
-			
+
 		}
-		
+
 		public void ShowSharpener ()
 		{
 			if (sharpener == null) {
@@ -361,7 +361,7 @@ namespace FSpot.Widgets {
 				sharpener.Destroyed += HandleLoupeDestroy;
 			}
 
-			sharpener.Show ();	
+			sharpener.Show ();
 		}
 
 		void OnPreferencesChanged (object sender, NotifyEventArgs args)
@@ -381,14 +381,14 @@ namespace FSpot.Widgets {
 		protected override void ApplyColorTransform (Pixbuf pixbuf)
 		{
 			Cms.Profile screen_profile;
-			if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) 
+			if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
 				FSpot.ColorManagement.ApplyProfile (pixbuf, screen_profile);
 		}
 
 		bool crop_helpers = true;
 		public bool CropHelpers {
 			get { return crop_helpers; }
-			set { 
+			set {
 				if (crop_helpers == value)
 					return;
 				crop_helpers = value;
@@ -425,6 +425,6 @@ namespace FSpot.Widgets {
 			}
 			return true;
 		}
-	
+
 	}
 }
diff --git a/src/Widgets/PreviewPopup.cs b/src/Clients/MainApp/FSpot.Widgets/PreviewPopup.cs
similarity index 96%
rename from src/Widgets/PreviewPopup.cs
rename to src/Clients/MainApp/FSpot.Widgets/PreviewPopup.cs
index 165e223..2751783 100644
--- a/src/Widgets/PreviewPopup.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/PreviewPopup.cs
@@ -32,7 +32,7 @@ namespace FSpot {
 				show_histogram = value;
 			}
 		}
-					
+
 		private FSpot.Histogram hist;
 		private DisposableCache<string, Pixbuf> preview_cache = new DisposableCache<string, Pixbuf> (50);
 
@@ -56,15 +56,15 @@ namespace FSpot {
 				Gdk.Pixbuf image = hist.Generate (pixbuf);
 				double scalex = 0.5;
 				double scaley = 0.5;
-				
+
 				int width = (int)(image.Width * scalex);
 				int height = (int)(image.Height * scaley);
-				
-				image.Composite (pixbuf, 
+
+				image.Composite (pixbuf,
 						 pixbuf.Width - width - 10, pixbuf.Height - height - 10,
-						 width, height, 
+						 width, height,
 						 pixbuf.Width - width - 10, pixbuf.Height - height - 10,
-						 scalex, scaley, 
+						 scalex, scaley,
 						 Gdk.InterpType.Bilinear, 200);
 			}
 		}
@@ -105,7 +105,7 @@ namespace FSpot {
 		private void UpdateImage ()
 		{
 			IBrowsableItem item = view.Collection [Item];
-			
+
 			string orig_path = item.DefaultVersion.Uri.LocalPath;
 
 			Gdk.Pixbuf pixbuf = FSpot.Utils.PixbufUtils.ShallowCopy (preview_cache.Get (orig_path + show_histogram.ToString ()));
@@ -134,11 +134,11 @@ namespace FSpot {
 			if (item.Description != null && item.Description.Length > 0)
 				desc = item.Description + Environment.NewLine;
 
-			desc += item.Time.ToString () + "   " + item.Name;			
+			desc += item.Time.ToString () + "   " + item.Name;
 			label.Text = desc;
 		}
 
-	
+
 		private void UpdatePosition ()
 		{
 			int x, y;
@@ -156,7 +156,7 @@ namespace FSpot {
 			// calculate the cell center
 			x += bounds.X + (bounds.Width / 2);
 			y += bounds.Y + (bounds.Height / 2);
-			
+
 			// find the window's x location limiting it to the screen
 			x = Math.Max (0, x - requisition.Width / 2);
 			x = Math.Min (x, this.Screen.Width - requisition.Width);
@@ -168,14 +168,14 @@ namespace FSpot {
 				y += margin;
 			else
 				y = y - requisition.Height - margin;
-#else 
+#else
 			y = Math.Max (0, y - requisition.Height / 2);
 			y = Math.Min (y, this.Screen.Height - requisition.Height);
-#endif			
+#endif
 
 			this.Move (x, y);
 		}
-		
+
 		private void UpdateItem (int x, int y)
 		{
 			int item = view.CellAtPosition (x, y);
@@ -186,7 +186,7 @@ namespace FSpot {
 				this.Hide ();
 			}
 		}
-		
+
 	        private void UpdateItem ()
 		{
 			int x, y;
@@ -194,7 +194,7 @@ namespace FSpot {
 			x += (int) view.Hadjustment.Value;
 			y += (int) view.Vadjustment.Value;
 			UpdateItem (x, y);
-			
+
 		}
 
 		private void HandleIconViewMotion (object sender, Gtk.MotionNotifyEventArgs args)
@@ -234,7 +234,7 @@ namespace FSpot {
 				break;
 			}
 		}
-		
+
 		private void HandleButtonPress (object sender, Gtk.ButtonPressEventArgs args)
 		{
 			this.Hide ();
@@ -262,18 +262,18 @@ namespace FSpot {
 		}
 
 		public PreviewPopup (IconView view) : base (Gtk.WindowType.Toplevel)
-		{	
+		{
 			Gtk.VBox vbox = new Gtk.VBox ();
 			this.Add (vbox);
-			this.AddEvents ((int) (Gdk.EventMask.PointerMotionMask | 
-					       Gdk.EventMask.KeyReleaseMask | 
+			this.AddEvents ((int) (Gdk.EventMask.PointerMotionMask |
+					       Gdk.EventMask.KeyReleaseMask |
 					       Gdk.EventMask.ButtonPressMask));
 
 			this.Decorated = false;
 			this.SkipTaskbarHint = true;
 			this.SkipPagerHint = true;
 			this.SetPosition (Gtk.WindowPosition.None);
-			
+
 			this.KeyReleaseEvent += HandleKeyRelease;
 			this.ButtonPressEvent += HandleButtonPress;
 			this.Destroyed += HandleDestroyed;
diff --git a/src/Widgets/Push.cs b/src/Clients/MainApp/FSpot.Widgets/Push.cs
similarity index 94%
rename from src/Widgets/Push.cs
rename to src/Clients/MainApp/FSpot.Widgets/Push.cs
index 3420956..062fa7c 100644
--- a/src/Widgets/Push.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Push.cs
@@ -23,42 +23,42 @@ namespace FSpot.Widgets {
 		ImageInfo begin_buffer;
 		double fraction;
 		int frames;
-		
+
 		public int Frames {
 			get { return frames; }
 		}
-		
+
 		public Push (ImageInfo begin, ImageInfo end)
 		{
 			this.begin = begin;
 			this.end = end;
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			if (begin_buffer == null) {
 				begin_buffer = new ImageInfo (begin, w); //.Allocation);
 			}
-			
+
 			if (end_buffer == null) {
 				end_buffer = new ImageInfo (end, w); //.Allocation);
 				start = DateTime.UtcNow;
 			}
-			
+
 			w.QueueDraw ();
-			
+
 			TimeSpan elapsed = DateTime.UtcNow - start;
-			fraction = elapsed.Ticks / (double) duration.Ticks; 
-			
+			fraction = elapsed.Ticks / (double) duration.Ticks;
+
 			frames++;
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle allocation)
 		{
 			fraction = Math.Min (fraction, 1.0);
-			
+
 			ctx.Operator = Operator.Source;
 			Matrix em = end_buffer.Fill (allocation);
 			em.Translate (Math.Round (allocation.Width - allocation.Width * fraction), 0);
@@ -68,7 +68,7 @@ namespace FSpot.Widgets {
 			ctx.Source = sur;
 			ctx.Paint ();
 			sur.Destroy ();
-			
+
 			ctx.Operator = Operator.Over;
 			SurfacePattern p = new SurfacePattern (begin_buffer.Surface);
 			Matrix m = begin_buffer.Fill (allocation);
@@ -78,10 +78,10 @@ namespace FSpot.Widgets {
 			ctx.Source = p;
 			ctx.Paint ();
 			p.Destroy ();
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			end_buffer.Dispose ();
diff --git a/src/Widgets/QueryView.cs b/src/Clients/MainApp/FSpot.Widgets/QueryView.cs
similarity index 98%
rename from src/Widgets/QueryView.cs
rename to src/Clients/MainApp/FSpot.Widgets/QueryView.cs
index 84ab9b9..f3d4e2c 100644
--- a/src/Widgets/QueryView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/QueryView.cs
@@ -10,16 +10,16 @@ namespace FSpot.Widgets
 {
 	public class QueryView : IconView {
 		public QueryView (System.IntPtr raw) : base (raw) {}
-	
+
 		public QueryView (IBrowsableCollection query) : base (query) {}
-	
+
 		protected override bool OnPopupMenu ()
 		{
 			PhotoPopup popup = new PhotoPopup ();
 			popup.Activate ();
 			return true;
 		}
-	
+
 		protected override void ContextMenu (Gtk.ButtonPressEventArgs args, int cell_num)
 		{
 			PhotoPopup popup = new PhotoPopup ();
diff --git a/src/Widgets/RatingMenuItem.cs b/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
similarity index 98%
rename from src/Widgets/RatingMenuItem.cs
rename to src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
index 53d8f99..1fc8b3e 100644
--- a/src/Widgets/RatingMenuItem.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
@@ -39,7 +39,7 @@ namespace FSpot.Widgets
 		private bool pressing;
 		private bool can_activate = true;
 
-		protected RatingMenuItem (IntPtr raw) : base (raw) 
+		protected RatingMenuItem (IntPtr raw) : base (raw)
 		{
 		}
 
diff --git a/src/Widgets/Reveal.cs b/src/Clients/MainApp/FSpot.Widgets/Reveal.cs
similarity index 93%
rename from src/Widgets/Reveal.cs
rename to src/Clients/MainApp/FSpot.Widgets/Reveal.cs
index 8f61d30..c739f98 100644
--- a/src/Widgets/Reveal.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Reveal.cs
@@ -1,11 +1,11 @@
 /*
  * Reveal.cs
- * 
+ *
  * Copyright 2007 Novell Inc.
  *
  * Author
  *   Larry Ewing <lewing novell com>
- * 
+ *
  * See COPYING for license information.
  *
  */
@@ -23,7 +23,7 @@ namespace FSpot.Widgets {
 		ImageInfo begin_buffer;
 		double fraction;
 		int frames;
-		
+
 		public int Frames {
 			get { return frames; }
 		}
@@ -33,28 +33,28 @@ namespace FSpot.Widgets {
 			this.begin = begin;
 			this.end = end;
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			if (begin_buffer == null) {
 				begin_buffer = new ImageInfo (begin, w); //.Allocation);
 			}
-			
+
 			if (end_buffer == null) {
 				end_buffer = new ImageInfo (end, w); //.Allocation);
 				start = DateTime.UtcNow;
-			}		
-			
+			}
+
 			w.QueueDraw ();
-			
+
 			TimeSpan elapsed = DateTime.UtcNow - start;
-			fraction = elapsed.Ticks / (double) duration.Ticks; 
-			
+			fraction = elapsed.Ticks / (double) duration.Ticks;
+
 			frames++;
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle allocation)
 		{
 			ctx.Operator = Operator.Source;
@@ -63,7 +63,7 @@ namespace FSpot.Widgets {
 			ctx.Source = sur;
 			ctx.Paint ();
 			sur.Destroy ();
-			
+
 			ctx.Operator = Operator.Over;
 			SurfacePattern p = new SurfacePattern (begin_buffer.Surface);
 			Matrix m = begin_buffer.Fill (allocation);
@@ -73,10 +73,10 @@ namespace FSpot.Widgets {
 			ctx.Source = p;
 			ctx.Paint ();
 			p.Destroy ();
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			begin_buffer.Dispose ();
diff --git a/src/Widgets/ScalingIconView.cs b/src/Clients/MainApp/FSpot.Widgets/ScalingIconView.cs
similarity index 92%
rename from src/Widgets/ScalingIconView.cs
rename to src/Clients/MainApp/FSpot.Widgets/ScalingIconView.cs
index 856c268..2923f23 100644
--- a/src/Widgets/ScalingIconView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/ScalingIconView.cs
@@ -15,8 +15,8 @@ namespace FSpot.Widgets {
 		protected ScalingIconView (IntPtr raw) : base (raw) {}
 
 		public ScalingIconView () : base () { }
- 		public ScalingIconView (IBrowsableCollection collection) : base (collection) { }
-		
+		public ScalingIconView (IBrowsableCollection collection) : base (collection) { }
+
 		protected override void UpdateLayout ()
 		{
 			//Log.Debug ("in update layout {0}", Allocation.ToString ());
@@ -28,25 +28,25 @@ namespace FSpot.Widgets {
 				num_thumbnails = 0;
 
 			cells_per_row = System.Math.Max (num_thumbnails, 1);
-			
+
 			int num_rows = 1;
 			int num_cols = num_thumbnails;
 
 			int available_height = Allocation.Height - 2 * BORDER_SIZE;
 			if (DisplayTags)
 				available_height -= tag_icon_size + tag_icon_vspacing;
-			
+
 			if (DisplayDates && this.Style != null) {
-				Pango.FontMetrics metrics = this.PangoContext.GetMetrics (this.Style.FontDescription, 
+				Pango.FontMetrics metrics = this.PangoContext.GetMetrics (this.Style.FontDescription,
 											  Pango.Language.FromString ("en_US"));
 				available_height -= PangoPixels (metrics.Ascent + metrics.Descent);
 			}
-			
+
 			thumbnail_width = (int) (available_height / thumbnail_ratio);
 
 			cell_width = ThumbnailWidth + 2 * cell_border_width;
 			cell_height = ThumbnailHeight + 2 * cell_border_width;
-			
+
 			SetSize (System.Math.Max (((uint) (num_cols * cell_width + 2 * BORDER_SIZE)), (uint)Allocation.Width), (uint) (num_rows * cell_height + 2 * BORDER_SIZE));
 
 			Vadjustment.StepIncrement = cell_height;
@@ -55,7 +55,7 @@ namespace FSpot.Widgets {
 			Hadjustment.StepIncrement = cell_width;
 			Hadjustment.Change ();
 		}
-#if false		
+#if false
 		protected override void UpdateLayout ()
 		{
 			if (collection != null) {
diff --git a/src/Sharpener.cs b/src/Clients/MainApp/FSpot.Widgets/Sharpener.cs
similarity index 94%
rename from src/Sharpener.cs
rename to src/Clients/MainApp/FSpot.Widgets/Sharpener.cs
index e25e9eb..f0e89a9 100644
--- a/src/Sharpener.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Sharpener.cs
@@ -25,9 +25,9 @@ namespace FSpot.Widgets {
 		Gtk.SpinButton radius_spin = new Gtk.SpinButton (5.0, 50.0, .01);
 		Gtk.SpinButton threshold_spin = new Gtk.SpinButton (0.0, 50.0, .01);
 		Gtk.Dialog dialog;
-		
+
 		public Sharpener (PhotoImageView view) : base (view)
-		{	
+		{
 		}
 
 		protected override void UpdateSample ()
@@ -39,9 +39,9 @@ namespace FSpot.Widgets {
 
 			overlay = null;
 			if (source != null)
-				overlay = PixbufUtils.UnsharpMask (source, 
-								   radius_spin.Value, 
-								   amount_spin.Value, 
+				overlay = PixbufUtils.UnsharpMask (source,
+								   radius_spin.Value,
+								   amount_spin.Value,
 								   threshold_spin.Value);
 		}
 
@@ -49,21 +49,21 @@ namespace FSpot.Widgets {
 		{
 			UpdateSample ();
 		}
-		
+
 		private void HandleOkClicked (object sender, EventArgs args)
 		{
 			Photo photo = view.Item.Current as Photo;
 
 			if (photo == null)
 				return;
-			
+
 			try {
 				Gdk.Pixbuf orig = view.Pixbuf;
 				Gdk.Pixbuf final = PixbufUtils.UnsharpMask (orig,
 									    radius_spin.Value,
 									    amount_spin.Value,
 									    threshold_spin.Value);
-				
+
 				bool create_version = photo.DefaultVersion.IsProtected;
 
 				photo.SaveVersion (final, create_version);
@@ -73,16 +73,16 @@ namespace FSpot.Widgets {
 				string msg = Catalog.GetString ("Error saving sharpened photo");
 				string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to save photo {1}"),
 							     e.Message, photo.Name);
-				
-				HigMessageDialog md = new HigMessageDialog (this, DialogFlags.DestroyWithParent, 
+
+				HigMessageDialog md = new HigMessageDialog (this, DialogFlags.DestroyWithParent,
 									    Gtk.MessageType.Error,
-									    ButtonsType.Ok, 
+									    ButtonsType.Ok,
 									    msg,
 									    desc);
 				md.Run ();
 				md.Destroy ();
 			}
-			
+
 			Destroy ();
 		}
 
@@ -95,7 +95,7 @@ namespace FSpot.Widgets {
 		{
 			dialog.Destroy ();
 		}
-		
+
 		protected override void BuildUI ()
 		{
 			base.BuildUI ();
@@ -105,15 +105,15 @@ namespace FSpot.Widgets {
 						 DialogFlags.DestroyWithParent, new object [0]);
 			dialog.BorderWidth = 12;
 			dialog.VBox.Spacing = 6;
-			
+
 			Gtk.Table table = new Gtk.Table (3, 2, false);
 			table.ColumnSpacing = 6;
 			table.RowSpacing = 6;
-			
+
 			table.Attach (SetFancyStyle (new Gtk.Label (Catalog.GetString ("Amount:"))), 0, 1, 0, 1);
 			table.Attach (SetFancyStyle (new Gtk.Label (Catalog.GetString ("Radius:"))), 0, 1, 1, 2);
 			table.Attach (SetFancyStyle (new Gtk.Label (Catalog.GetString ("Threshold:"))), 0, 1, 2, 3);
-			
+
 			SetFancyStyle (amount_spin = new Gtk.SpinButton (0.00, 100.0, .01));
 			SetFancyStyle (radius_spin = new Gtk.SpinButton (1.0, 50.0, .01));
 			SetFancyStyle (threshold_spin = new Gtk.SpinButton (0.0, 50.0, .01));
@@ -128,21 +128,20 @@ namespace FSpot.Widgets {
 			table.Attach (amount_spin, 1, 2, 0, 1);
 			table.Attach (radius_spin, 1, 2, 1, 2);
 			table.Attach (threshold_spin, 1, 2, 2, 3);
-			
+
 			Gtk.Button cancel_button = new Gtk.Button (Gtk.Stock.Cancel);
 			cancel_button.Clicked += HandleCancelClicked;
 			dialog.AddActionWidget (cancel_button, Gtk.ResponseType.Cancel);
-			
+
 			Gtk.Button ok_button = new Gtk.Button (Gtk.Stock.Ok);
 			ok_button.Clicked += HandleOkClicked;
 			dialog.AddActionWidget (ok_button, Gtk.ResponseType.Cancel);
 
 			Destroyed += HandleLoupeDestroyed;
-			
+
 			table.ShowAll ();
 			dialog.VBox.PackStart (table);
 			dialog.ShowAll ();
 		}
 	}
 }
-
diff --git a/src/Widgets/Sidebar.cs b/src/Clients/MainApp/FSpot.Widgets/Sidebar.cs
similarity index 95%
rename from src/Widgets/Sidebar.cs
rename to src/Clients/MainApp/FSpot.Widgets/Sidebar.cs
index 0ce6f5e..ad46891 100644
--- a/src/Widgets/Sidebar.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Sidebar.cs
@@ -22,7 +22,7 @@ namespace FSpot.Widgets
 {
 
 	// Decides which sidebar page should be shown for each context. Implemented
-	// using the Strategy pattern, to make it swappable easily, in case the 
+	// using the Strategy pattern, to make it swappable easily, in case the
 	// default MRUSidebarContextSwitchStrategy is not sufficiently usable.
 	public interface ISidebarContextSwitchStrategy {
 		string PageForContext (ViewContext context);
@@ -41,7 +41,7 @@ namespace FSpot.Widgets
 
 		public string PageForContext (ViewContext context) {
 			string name = Preferences.Get<string> (PrefKeyForContext (context));
-			if (name == null) 
+			if (name == null)
 				name = DefaultForContext (context);
 			return name;
 		}
@@ -59,7 +59,7 @@ namespace FSpot.Widgets
 	}
 
 	public class Sidebar : VBox  {
-		
+
 		private HBox button_box;
 		public Notebook Notebook { get; private set; }
 		private MenuButton choose_button;
@@ -70,7 +70,7 @@ namespace FSpot.Widgets
 
 		public event EventHandler CloseRequested;
 
-        	// Selection change events, sidebar pages can subscribed to this.
+		// Selection change events, sidebar pages can subscribed to this.
 		public event IBrowsableCollectionChangedHandler SelectionChanged;
 		public event IBrowsableCollectionItemsChangedHandler SelectionItemsChanged;
 
@@ -102,26 +102,26 @@ namespace FSpot.Widgets
 
 			button_box = new HBox ();
 			PackStart (button_box, false, false, 0);
-			
+
 			Notebook = new Notebook ();
 			Notebook.ShowTabs = false;
 			Notebook.ShowBorder = false;
 			PackStart (Notebook, true, true, 0);
-			
+
 			Button button = new Button ();
 			button.Image = new Image ("gtk-close", IconSize.Button);
 			button.Relief = ReliefStyle.None;
 			button.Pressed += HandleCloseButtonPressed;
 			button_box.PackEnd (button, false, true, 0);
-			
+
 			choose_button = new MenuButton ();
 			choose_button.Relief = ReliefStyle.None;
-			
+
 			eventBox = new EventBox ();
 			eventBox.Add (choose_button);
-			
+
 			button_box.PackStart (eventBox, true, true, 0);
-			
+
 			choose_menu = new Menu ();
 			choose_button.Menu = choose_menu;
 
@@ -152,9 +152,9 @@ namespace FSpot.Widgets
 		{
 			AppendPage (new SidebarPage (widget, label, icon_name));
 		}
-		
+
         public void AppendPage (SidebarPage page)
-		{	
+		{
 			page.Sidebar = this;
 			page.CanSelectChanged += HandleCanSelectChanged;
 
@@ -163,8 +163,8 @@ namespace FSpot.Widgets
 
 			Notebook.AppendPage (page.SidebarWidget, new Label (label));
 			page.SidebarWidget.Show ();
-			
-			MenuItem item; 
+
+			MenuItem item;
 			if (icon_name == null)
 				item = new MenuItem (label);
 			else {
@@ -176,7 +176,7 @@ namespace FSpot.Widgets
 			item.Activated += HandleItemClicked;
 			choose_menu.Append (item);
 			item.Show ();
-			
+
 			if (Notebook.Children.Length == 1) {
 				choose_button.Label = label;
 				choose_button.Image.IconName = icon_name;
@@ -188,25 +188,25 @@ namespace FSpot.Widgets
 		public void HandleMainWindowViewModeChanged (object o, EventArgs args)
 		{
 			MainWindow.ModeType mode = App.Instance.Organizer.ViewMode;
-			if (mode == MainWindow.ModeType.IconView) 
+			if (mode == MainWindow.ModeType.IconView)
 				Context = ViewContext.Library;
 			else if (mode == MainWindow.ModeType.PhotoView)
 				Context = ViewContext.Edit;
 		}
-		
+
 		public void HandleItemClicked (object o, EventArgs args)
 		{
 			string name = ((o as MenuItem).Child as Label).Text;
 			SwitchTo (name);
 			ContextSwitchStrategy.SwitchedToPage (Context, name);
 		}
-		
+
 		public void HandleCloseButtonPressed (object sender, EventArgs args)
 		{
 			if (CloseRequested != null)
 				CloseRequested (this, args);
 		}
-		
+
 		public void SwitchTo (int n)
 		{
 			if (n >= Notebook.Children.Length) {
@@ -228,7 +228,7 @@ namespace FSpot.Widgets
 			if (menu_list.Contains (name))
 				SwitchTo (menu_list.IndexOf (name));
 		}
-		
+
 		public bool IsActive (SidebarPage page)
 		{
 			return (Notebook.GetNthPage (Notebook.CurrentPage) == page.SidebarWidget);
@@ -236,8 +236,8 @@ namespace FSpot.Widgets
 
 		public void HandleSelectionChanged (IBrowsableCollection collection) {
 			Selection = collection;
-        		// Proxy selection change to the subscribed sidebar pages.
-			if (SelectionChanged != null) 
+			// Proxy selection change to the subscribed sidebar pages.
+			if (SelectionChanged != null)
 				SelectionChanged (collection);
 		}
 
@@ -246,5 +246,5 @@ namespace FSpot.Widgets
 			if (SelectionItemsChanged != null)
 				SelectionItemsChanged (collection, args);
 		}
-	} 
+	}
 }
diff --git a/src/Widgets/SlideShow.cs b/src/Clients/MainApp/FSpot.Widgets/SlideShow.cs
similarity index 98%
rename from src/Widgets/SlideShow.cs
rename to src/Clients/MainApp/FSpot.Widgets/SlideShow.cs
index b8efce7..d551679 100644
--- a/src/Widgets/SlideShow.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/SlideShow.cs
@@ -74,7 +74,7 @@ namespace FSpot.Widgets
 		public void Start ()
 		{
 			running = true;
-			flip.Start ();	
+			flip.Start ();
 		}
 
 		public void Stop ()
@@ -111,7 +111,7 @@ namespace FSpot.Widgets
 				if (next != null) {
 					next = null;
 				}
-	
+
 				if (item == null || item.Current == null)
 					return;
 
@@ -121,12 +121,12 @@ namespace FSpot.Widgets
 							double scale = Math.Min ((double)Allocation.Width/(double)pb.Width, (double)Allocation.Height/(double)pb.Height);
 							int w = (int)(pb.Width * scale);
 							int h = (int)(pb.Height * scale);
-	
+
 							if (w > 0 && h > 0)
 								next = pb.ScaleSimple ((int)(pb.Width * scale), (int)(pb.Height * scale), InterpType.Bilinear);
 						}
 						Cms.Profile screen_profile;
-						if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) 
+						if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
 							FSpot.ColorManagement.ApplyProfile (next, screen_profile);
 						loadRetries = 0;
 					} catch (Exception) {
diff --git a/src/SoftFocus.cs b/src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs
similarity index 100%
rename from src/SoftFocus.cs
rename to src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs
diff --git a/src/Widgets/TagEntry.cs b/src/Clients/MainApp/FSpot.Widgets/TagEntry.cs
similarity index 96%
rename from src/Widgets/TagEntry.cs
rename to src/Clients/MainApp/FSpot.Widgets/TagEntry.cs
index 019fef9..3fffe1b 100644
--- a/src/Widgets/TagEntry.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/TagEntry.cs
@@ -46,29 +46,29 @@ namespace FSpot.Widgets {
 		public void UpdateFromSelection (IBrowsableItem [] sel)
 		{
 			Hashtable taghash = new Hashtable ();
-	
+
 			for (int i = 0; i < sel.Length; i++) {
 				foreach (Tag tag in sel [i].Tags) {
 					int count = 1;
-	
+
 					if (taghash.Contains (tag))
 						count = ((int) taghash [tag]) + 1;
-	
+
 					if (count <= i)
 						taghash.Remove (tag);
-					else 
+					else
 						taghash [tag] = count;
 				}
-				
+
 				if (taghash.Count == 0)
 					break;
 			}
-	
+
 			selected_photos_tagnames = new ArrayList ();
 			foreach (Tag tag in taghash.Keys)
 				if ((int) (taghash [tag]) == sel.Length)
 					selected_photos_tagnames.Add (tag.Name);
-	
+
 			Update ();
 		}
 
@@ -89,10 +89,10 @@ namespace FSpot.Widgets {
 			foreach (string tagname in selected_photos_tagnames) {
 				if (sb.Length > 0)
 					sb.Append (", ");
-	
+
 				sb.Append (tagname);
 			}
-	
+
 			Text = sb.ToString ();
 			ClearTagCompletions ();
 		}
@@ -100,21 +100,21 @@ namespace FSpot.Widgets {
 		private void AppendComma ()
 		{
 			if (Text.Length != 0 && !Text.Trim ().EndsWith (","))
-				AppendText (", ");	
+				AppendText (", ");
 		}
 
 		public string [] GetTypedTagNames ()
 		{
 			string [] tagnames = Text.Split (new char [] {','});
-	
+
 			ArrayList list = new ArrayList ();
 			for (int i = 0; i < tagnames.Length; i ++) {
 				string s = tagnames [i].Trim ();
-	
+
 				if (s.Length > 0)
 					list.Add (s);
 			}
-	
+
 			return (string []) (list.ToArray (typeof (string)));
 		}
 
@@ -131,19 +131,19 @@ namespace FSpot.Widgets {
 		private void HandleKeyPressEvent (object o, Gtk.KeyPressEventArgs args)
 		{
 			args.RetVal = false;
-			if (args.Event.Key == Gdk.Key.Escape) { 
+			if (args.Event.Key == Gdk.Key.Escape) {
 				args.RetVal = false;
-			} else if (args.Event.Key == Gdk.Key.comma) { 
+			} else if (args.Event.Key == Gdk.Key.comma) {
 				if (tag_completion_index != -1) {
 					// If we are completing a tag, then finish that
 					FinishTagCompletion ();
 					args.RetVal = true;
-				} else 
+				} else
 					// Otherwise do not handle this event here
 					args.RetVal = false;
-			} else if (args.Event.Key == Gdk.Key.Return) { 
+			} else if (args.Event.Key == Gdk.Key.Return) {
 				// If we are completing a tag, then finish that
-				if (tag_completion_index != -1) 
+				if (tag_completion_index != -1)
 					FinishTagCompletion ();
 				// And pass the event to Gtk.Entry in any case,
 				// which will call OnActivated
@@ -173,43 +173,43 @@ namespace FSpot.Widgets {
 		private void DoTagCompletion (bool forward)
 		{
 			string completion;
-			
+
 			if (tag_completion_index != -1) {
 				if (forward)
 					tag_completion_index = (tag_completion_index + 1) % tag_completions.Length;
 				else
 					tag_completion_index = (tag_completion_index + tag_completions.Length - 1) % tag_completions.Length;
 			} else {
-	
+
 				tag_completion_typed_position = Position;
-			    
+
 				string right_of_cursor = Text.Substring (tag_completion_typed_position);
 				if (right_of_cursor.Length > 1)
 					return;
-	
+
 				int last_comma = Text.LastIndexOf (',');
 				if (last_comma > tag_completion_typed_position)
 					return;
-	
+
 				tag_completion_typed_so_far = Text.Substring (last_comma + 1).TrimStart (new char [] {' '});
 				if (tag_completion_typed_so_far == null || tag_completion_typed_so_far.Length == 0)
 					return;
-	
+
 				tag_completions = tag_store.GetTagsByNameStart (tag_completion_typed_so_far);
 				if (tag_completions == null)
 					return;
-	
+
 				if (forward)
 					tag_completion_index = 0;
 				else
 					tag_completion_index = tag_completions.Length - 1;
 			}
-	
+
 			tag_ignore_changes = true;
 			completion = tag_completions [tag_completion_index].Name.Substring (tag_completion_typed_so_far.Length);
 			Text = Text.Substring (0, tag_completion_typed_position) + completion;
 			tag_ignore_changes = false;
-	
+
 			Position = Text.Length;
 			SelectRegion (tag_completion_typed_position, Text.Length);
 		}
@@ -229,14 +229,14 @@ namespace FSpot.Widgets {
 			InsertText (", ", ref pos);
 			Position = pos + 2;
 			ClearTagCompletions ();
-			
+
 		}
 
 		//Activated means the user pressed 'Enter'
 		protected override void OnActivated ()
 		{
 			string [] tagnames = GetTypedTagNames ();
-	
+
 			if (tagnames == null)
 				return;
 
@@ -293,5 +293,5 @@ namespace FSpot.Widgets {
 			AppendComma ();
 			return base.OnFocusInEvent (evnt);
 		}
-	}	
+	}
 }
diff --git a/src/Widgets/TagMenu.cs b/src/Clients/MainApp/FSpot.Widgets/TagMenu.cs
similarity index 96%
rename from src/Widgets/TagMenu.cs
rename to src/Clients/MainApp/FSpot.Widgets/TagMenu.cs
index 0690108..b99307e 100644
--- a/src/Widgets/TagMenu.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/TagMenu.cs
@@ -13,7 +13,7 @@ public class TagMenu : Menu {
 
 	public delegate void TagSelectedHandler (Tag t);
 	public event TagSelectedHandler TagSelected;
-	
+
 	private EventHandler new_tag_handler = null;
 	public EventHandler NewTagHandler {
 		get { return new_tag_handler; }
@@ -24,7 +24,7 @@ public class TagMenu : Menu {
 		public Tag Value;
 
 		public TagMenuItem (Tag t) : this (t, t.Name) { }
-		
+
 		public TagMenuItem (Tag t, string name) : base (name.Replace ("_", "__"))
 		{
 			Value = t;
@@ -40,12 +40,12 @@ public class TagMenu : Menu {
 		public static TagMenuItem IndentedItem (Tag t)
 		{
 			System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();
-			
-			for (Category parent = t.Category; 
+
+			for (Category parent = t.Category;
 			     parent != null && parent.Category != null;
 			     parent = parent.Category)
 				label_builder.Append ("  ");
-			
+
 			label_builder.Append (t.Name);
 			return new TagMenuItem (t, label_builder.ToString ());
 		}
@@ -53,7 +53,7 @@ public class TagMenu : Menu {
 		protected TagMenuItem (IntPtr raw) : base (raw) {}
 	}
 
-	public TagMenu (MenuItem item, TagStore store) 
+	public TagMenu (MenuItem item, TagStore store)
 	{
 		if (item != null) {
 			item.Submenu = this;
@@ -83,12 +83,12 @@ public class TagMenu : Menu {
 			}
 			i++;
 		}
-		
+
 		return -1;
 	}
 
 	public void Populate (bool flat)
-	{ 
+	{
 		if (flat)
 			PopulateFlat (tag_store.RootCategory, this);
 		else
@@ -114,7 +114,7 @@ public class TagMenu : Menu {
 			} else {
 				item.Activated += HandleActivate;
 			}
-		} 
+		}
 	}
 
 	public void Populate (Category cat, Gtk.Menu parent)
@@ -146,21 +146,21 @@ public class TagMenu : Menu {
 			} else {
 				item.Activated += HandleActivate;
 			}
-		} 
+		}
 	}
-	
+
 	private void HandlePopulate (object obj, EventArgs args)
 	{
 		this.Populate ();
 	}
-	
+
 	void HandleActivate (object obj, EventArgs args)
 	{
 		if (TagSelected != null) {
 			TagMenuItem t = obj as TagMenuItem;
 			if (t != null)
 				TagSelected (t.Value);
-			else 
+			else
 				Log.Debug ("TagMenu.HandleActivate: Item was not a TagMenuItem");
 		}
 	}
diff --git a/src/Widgets/TagView.cs b/src/Clients/MainApp/FSpot.Widgets/TagView.cs
similarity index 93%
rename from src/Widgets/TagView.cs
rename to src/Clients/MainApp/FSpot.Widgets/TagView.cs
index fe72844..557ac3b 100644
--- a/src/Widgets/TagView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/TagView.cs
@@ -19,10 +19,10 @@ public class TagView : EventBox {
 	private IBrowsableItem photo;
 	private Tag [] tags;
 	private static int TAG_ICON_VSPACING = 5;
-	
+
 	private bool HideTags {
-		get { 
-			return (FSpot.Preferences.Get<int> (FSpot.Preferences.TAG_ICON_SIZE) == (int) Tag.IconSize.Hidden); 
+		get {
+			return (FSpot.Preferences.Get<int> (FSpot.Preferences.TAG_ICON_SIZE) == (int) Tag.IconSize.Hidden);
 		}
 	}
 
@@ -34,7 +34,7 @@ public class TagView : EventBox {
 
 	protected TagView (IntPtr raw) : base (raw)
 	{
-		VisibleWindow = false;	
+		VisibleWindow = false;
 	}
 
 	public IBrowsableItem Current {
@@ -45,7 +45,7 @@ public class TagView : EventBox {
 				SetSizeRequest ((thumbnail_size + TAG_ICON_VSPACING) * photo.Tags.Length,
 						thumbnail_size);
 			} else {
-				SetSizeRequest (0, thumbnail_size);	
+				SetSizeRequest (0, thumbnail_size);
 			}
 			QueueResize ();
 			QueueDraw ();
@@ -59,7 +59,7 @@ public class TagView : EventBox {
 			this.QueueDraw ();
 		}
 	}
-	
+
 	protected override bool OnExposeEvent (Gdk.EventExpose args)
 	{
 		if (photo != null)
@@ -69,12 +69,12 @@ public class TagView : EventBox {
 			SetSizeRequest(0,thumbnail_size);
 			return base.OnExposeEvent (args);
 		}
-		
+
 		DrawTags();
-		
+
 		return base.OnExposeEvent (args);
 	}
-	
+
 	public void DrawTags()
 	{
 		if (tags == null)
@@ -85,12 +85,12 @@ public class TagView : EventBox {
 
 		int tag_x = Allocation.X;
 		int tag_y = Allocation.Y + (Allocation.Height - thumbnail_size)/2;
-		
+
 		string [] names = new string [tags.Length];
 		int i = 0;
 		foreach (Tag t in tags) {
 			names [i++] = t.Name;
-			
+
 			Pixbuf icon = t.Icon;
 
 			Category category = t.Category;
@@ -98,10 +98,10 @@ public class TagView : EventBox {
 				icon = category.Icon;
 				category = category.Category;
 			}
-			
+
 			if (icon == null)
 				continue;
-			
+
 			Pixbuf scaled_icon;
 			if (icon.Width == thumbnail_size) {
 				scaled_icon = icon;
@@ -109,7 +109,7 @@ public class TagView : EventBox {
 				scaled_icon = icon.ScaleSimple (thumbnail_size, thumbnail_size, InterpType.Bilinear);
 			}
 				Cms.Profile screen_profile;
-				if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) 
+				if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
 					FSpot.ColorManagement.ApplyProfile (scaled_icon, screen_profile);
 
 			scaled_icon.RenderToDrawable (GdkWindow, Style.WhiteGC,
diff --git a/src/Widgets/Tests/FindBarTests.cs b/src/Clients/MainApp/FSpot.Widgets/Tests/FindBarTests.cs
similarity index 100%
rename from src/Widgets/Tests/FindBarTests.cs
rename to src/Clients/MainApp/FSpot.Widgets/Tests/FindBarTests.cs
diff --git a/src/Widgets/TrayView.cs b/src/Clients/MainApp/FSpot.Widgets/TrayView.cs
similarity index 98%
rename from src/Widgets/TrayView.cs
rename to src/Clients/MainApp/FSpot.Widgets/TrayView.cs
index 66a32b1..87c299e 100644
--- a/src/Widgets/TrayView.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/TrayView.cs
@@ -15,7 +15,7 @@ namespace FSpot.Widgets
 {
 	public class TrayView : IconView {
 		public TrayView (System.IntPtr raw) : base (raw) {}
-	
+
 		public TrayView (IBrowsableCollection query) : base (query)
 		{
 			DisplayDates = false;
@@ -24,18 +24,18 @@ namespace FSpot.Widgets
 			tag_icon_vspacing = 0;
 			tag_icon_size = 0;
 		}
-		
+
 		protected override void UpdateLayout ()
 		{
 			//DisplayDates = false;
 			//DisplayTags = false;
-	
+
 			int total_rows;
 			int available_width = Allocation.Width - 2 * BORDER_SIZE;
 			cells_per_row = System.Math.Max (available_width / 256, 1);
 			int width = 0;
 			//int height = 0;
-			
+
 			do {
 				cell_width = System.Math.Min (256, available_width / cells_per_row);
 				width = cell_width - 2 * cell_border_width;
@@ -44,12 +44,12 @@ namespace FSpot.Widgets
 				cells_per_row ++;
 			} while (total_rows > Allocation.Height / cell_height);
 			cells_per_row --;
-	
-	
+
+
 			if (width != ThumbnailWidth) {
 				thumbnail_width = width;
 			}
-	
+
 			//base.UpdateLayout ();
 		}
 	}
diff --git a/src/Widgets/ViewContext.cs b/src/Clients/MainApp/FSpot.Widgets/ViewContext.cs
similarity index 100%
rename from src/Widgets/ViewContext.cs
rename to src/Clients/MainApp/FSpot.Widgets/ViewContext.cs
diff --git a/src/Widgets/Wipe.cs b/src/Clients/MainApp/FSpot.Widgets/Wipe.cs
similarity index 95%
rename from src/Widgets/Wipe.cs
rename to src/Clients/MainApp/FSpot.Widgets/Wipe.cs
index 0ef41c8..7ccfc06 100644
--- a/src/Widgets/Wipe.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/Wipe.cs
@@ -1,4 +1,4 @@
-/* 
+/*
  * Wipe.cs
  *
  * Copyright 2007 Novell Inc.
@@ -24,17 +24,17 @@ namespace FSpot.Widgets {
 		ImageInfo begin_buffer;
 		int frames;
 		double fraction;
-		
+
 		public int Frames {
 			get { return frames; }
 		}
-		
+
 		public Wipe (ImageInfo begin, ImageInfo end)
 		{
 			this.begin = begin;
 			this.end = end;
 		}
-		
+
 		public bool OnEvent (Widget w)
 		{
 			if (begin_buffer == null) {
@@ -45,27 +45,27 @@ namespace FSpot.Widgets {
 				end_buffer = new ImageInfo (end, w); //.Allocation);
 				start = DateTime.UtcNow;
 			}
-			
+
 			w.QueueDraw ();
-			
+
 			TimeSpan elapsed = DateTime.UtcNow - start;
-			fraction = elapsed.Ticks / (double) duration.Ticks; 
-			
+			fraction = elapsed.Ticks / (double) duration.Ticks;
+
 			frames++;
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		Pattern CreateMask (Gdk.Rectangle coverage, double fraction)
 		{
 			LinearGradient fade = new LinearGradient (0, 0,
 								  coverage.Width, 0);
 			fade.AddColorStop (Math.Max (fraction - .1, 0.0), new Cairo.Color (1.0, 1.0, 1.0, 1.0));
 			fade.AddColorStop (Math.Min (fraction + .1, 1.0), new Cairo.Color (0.0, 0.0, 0.0, 0.0));
-			
+
 			return fade;
 		}
-		
+
 		public bool OnExpose (Context ctx, Gdk.Rectangle allocation)
 		{
 			ctx.Operator = Operator.Source;
@@ -74,7 +74,7 @@ namespace FSpot.Widgets {
 			p.Filter = Filter.Fast;
 			ctx.Source = p;
 			ctx.Paint ();
-			
+
 			ctx.Operator = Operator.Over;
 			ctx.Matrix = end_buffer.Fill (allocation);
 			SurfacePattern sur = new SurfacePattern (end_buffer.Surface);
@@ -85,10 +85,10 @@ namespace FSpot.Widgets {
 			mask.Destroy ();
 			p.Destroy ();
 			sur.Destroy ();
-			
+
 			return fraction < 1.0;
 		}
-		
+
 		public void Dispose ()
 		{
 			begin_buffer.Dispose ();
diff --git a/src/FSpot.addin.xml b/src/Clients/MainApp/FSpot.addin.xml
similarity index 98%
rename from src/FSpot.addin.xml
rename to src/Clients/MainApp/FSpot.addin.xml
index 79b0e7b..2315d3d 100644
--- a/src/FSpot.addin.xml
+++ b/src/Clients/MainApp/FSpot.addin.xml
@@ -1,5 +1,5 @@
-<Addin namespace = "FSpot" 
-       id = "Core" 
+<Addin namespace = "FSpot"
+       id = "Core"
        version = "0.7.0.0"
        compatVersion = "0.7"
        isroot="true">
@@ -56,7 +56,7 @@
 		<MenuSeparator id = "Separator3" />
 		<MenuGenerator id = "RemoveTag" _label = "Rem_ove Tag" icon = "gtk-remove" generator_type = "FSpot.Extensions.RemoveTag" />
 		<ComplexMenuItem id = "Rate" widget_type = "FSpot.Widgets.RatingMenuItem"  command_type = "FSpot.Extensions.Rate"/>
-	</Extension>	
+	</Extension>
 
 	<Extension path = "/FSpot/Sidebar">
 <!-- FIXME: Disabled until ported		<SidebarPage sidebar_page_type = "FSpot.Widgets.MetadataDisplayPage" /> -->
diff --git a/src/Accelerometer.cs b/src/Clients/MainApp/FSpot/Accelerometer.cs
similarity index 99%
rename from src/Accelerometer.cs
rename to src/Clients/MainApp/FSpot/Accelerometer.cs
index f7148ea..5fbb959 100644
--- a/src/Accelerometer.cs
+++ b/src/Clients/MainApp/FSpot/Accelerometer.cs
@@ -38,7 +38,7 @@ namespace FSpot {
 		{
 			if (timer == 0 && available)
 				SetupAccelerometer ();
-				
+
 			if (current_orientation == Orient.TiltCounterclockwise)
 				return FSpot.Utils.PixbufUtils.Rotate90 (po);
 
@@ -47,7 +47,7 @@ namespace FSpot {
 
 			return po;
 		}
-		
+
 		static uint timer = 0;
 		static bool available = true;
 
@@ -116,7 +116,7 @@ namespace FSpot {
 
 					if (base_x == -1000)
 						base_x = x;
-					
+
 					if (base_y == -1000)
 						base_y = y;
 
diff --git a/src/App.cs b/src/Clients/MainApp/FSpot/App.cs
similarity index 99%
rename from src/App.cs
rename to src/Clients/MainApp/FSpot/App.cs
index 23f8ecd..6779caf 100644
--- a/src/App.cs
+++ b/src/Clients/MainApp/FSpot/App.cs
@@ -22,6 +22,7 @@ using Mono.Unix;
 using Hyena;
 
 using FSpot.Core;
+using FSpot.Database;
 
 namespace FSpot
 {
diff --git a/src/BitConverter.cs b/src/Clients/MainApp/FSpot/BitConverter.cs
similarity index 88%
rename from src/BitConverter.cs
rename to src/Clients/MainApp/FSpot/BitConverter.cs
index 00f34c5..4e55070 100644
--- a/src/BitConverter.cs
+++ b/src/Clients/MainApp/FSpot/BitConverter.cs
@@ -4,16 +4,16 @@ using System.Runtime.InteropServices;
 namespace FSpot {
 	//[Obsolete ("use Mono.DataConvert instead")]
 	public class BitConverter {
-		public static uint Swap (uint val, bool little) 
+		public static uint Swap (uint val, bool little)
 		{
 			return (little != System.BitConverter.IsLittleEndian) ?
 				((uint) ((((uint) (val) & (uint) 0x000000ffU) << 24) |
-					 (((uint) (val) & (uint) 0x0000ff00U) <<  8) | 
+					 (((uint) (val) & (uint) 0x0000ff00U) <<  8) |
 					 (((uint) (val) & (uint) 0x00ff0000U) >>  8) |
 					 (((uint) (val) & (uint) 0xff000000U) >> 24)))
 				: val;
 		}
-		
+
 		public static ushort Swap (ushort val, bool little)
 		{
 			return (little != System.BitConverter.IsLittleEndian) ?
@@ -25,27 +25,27 @@ namespace FSpot {
 		{
 			return ((ushort) ((ushort)(val >> 8) | (ushort)(val << 8)));
 		}
-		
+
 		public static ulong Swap (ulong val, bool little)
 		{
 		        return (little != System.BitConverter.IsLittleEndian) ?
-			((ulong) ((((ulong) (val) & (ulong) 0x00000000000000ffU) << 56) |     
-				  (((ulong) (val) & (ulong) 0x000000000000ff00U) << 40) |	
+			((ulong) ((((ulong) (val) & (ulong) 0x00000000000000ffU) << 56) |
+				  (((ulong) (val) & (ulong) 0x000000000000ff00U) << 40) |
 				  (((ulong) (val) & (ulong) 0x0000000000ff0000U) << 24) |
 				  (((ulong) (val) & (ulong) 0x00000000ff000000U) <<  8) |
-				  (((ulong) (val) & (ulong) 0x000000ff00000000U) >>  8) |	
+				  (((ulong) (val) & (ulong) 0x000000ff00000000U) >>  8) |
 				  (((ulong) (val) & (ulong) 0x0000ff0000000000U) >> 24) |
 				  (((ulong) (val) & (ulong) 0x00ff000000000000U) >> 40) |
 				  (((ulong) (val) & (ulong) 0xff00000000000000U) >> 56)))
 				: val;
 		}
-		
-		public static byte [] GetBytes (uint val, bool little) 
+
+		public static byte [] GetBytes (uint val, bool little)
 		{
 			val = Swap (val, little);
 			return System.BitConverter.GetBytes (val);
 		}
-		
+
 		public static byte [] GetBytes (ushort val, bool little)
 		{
 			val = Swap (val, little);
@@ -57,7 +57,7 @@ namespace FSpot {
 			val = Swap (val, little);
 			return System.BitConverter.GetBytes (val);
 		}
-		
+
 		public static ushort ToUInt16 (byte [] data, int position, bool little)
 		{
 			ushort val = System.BitConverter.ToUInt16 (data, position);
diff --git a/src/ColorManagement.cs b/src/Clients/MainApp/FSpot/ColorManagement.cs
similarity index 100%
rename from src/ColorManagement.cs
rename to src/Clients/MainApp/FSpot/ColorManagement.cs
diff --git a/src/ControlOverlay.cs b/src/Clients/MainApp/FSpot/ControlOverlay.cs
similarity index 96%
rename from src/ControlOverlay.cs
rename to src/Clients/MainApp/FSpot/ControlOverlay.cs
index 0647236..c344e06 100644
--- a/src/ControlOverlay.cs
+++ b/src/Clients/MainApp/FSpot/ControlOverlay.cs
@@ -23,20 +23,20 @@ namespace FSpot {
 		bool composited;
 		VisibilityType visibility;
 		int round = 12;
-		Delay hide; 
+		Delay hide;
 		Delay fade;
 		Delay dismiss;
 		bool auto_hide = true;
 		double x_align = 0.5;
 		double y_align = 1.0;
-		
+
 		public enum VisibilityType
 		{
 			None,
 			Partial,
 			Full
 		}
-		
+
 		public double XAlign {
 			get { return x_align; }
 			set {
@@ -52,8 +52,8 @@ namespace FSpot {
 				Relocate ();
 			}
 		}
-			      
-		
+
+
 		public bool AutoHide {
 			get { return auto_hide; }
 			set { auto_hide = value; }
@@ -90,14 +90,14 @@ namespace FSpot {
 			AllowGrow = true;
 			//AllowShrink = true;
 			KeepAbove = true;
-			
+
 			host_toplevel = (Gtk.Window) host.Toplevel;
-			
+
 			TransientFor = host_toplevel;
 
 			host_toplevel.ConfigureEvent += HandleHostConfigure;
 			host_toplevel.SizeAllocated += HandleHostSizeAllocated;
-			
+
 			AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
 			hide = new Delay (2000, HideControls);
 			fade = new Delay (40, FadeToTarget);
@@ -115,7 +115,7 @@ namespace FSpot {
 		{
 			int x, y;
 			Gdk.ModifierType type;
-			
+
 			if (!auto_hide)
 				return false;
 
@@ -159,7 +159,7 @@ namespace FSpot {
 				cr.Arc (round, Allocation.Height - round, round, Math.PI * 0.5, Math.PI);
 			cr.Arc (round, round, round, Math.PI, Math.PI * 1.5);
 			cr.ClosePath ();
-			cr.Fill ();			
+			cr.Fill ();
 		}
 
 		double target;
@@ -200,8 +200,8 @@ namespace FSpot {
 			if (composited)
 				return;
 
-			Gdk.Pixmap bitmap = new Gdk.Pixmap (GdkWindow, 
-							    Allocation.Width, 
+			Gdk.Pixmap bitmap = new Gdk.Pixmap (GdkWindow,
+							    Allocation.Width,
 							    Allocation.Height, 1);
 
 			Context cr = Gdk.CairoHelper.Create (bitmap);
@@ -219,7 +219,7 @@ namespace FSpot {
 			Context cr = Gdk.CairoHelper.Create (GdkWindow);
 
 			ShapeSurface (cr, new Cairo.Color (c.Red / (double) ushort.MaxValue,
-							   c.Blue / (double) ushort.MaxValue, 
+							   c.Blue / (double) ushort.MaxValue,
 							   c.Green / (double) ushort.MaxValue,
 							   0.8));
 
@@ -246,18 +246,18 @@ namespace FSpot {
 		{
 			Relocate ();
 		}
-		
+
 		private void HandleHostConfigure (object o, ConfigureEventArgs args)
 		{
 			Relocate ();
 		}
-		
+
 		private void Relocate ()
 		{
 			int x, y;
 			if (!IsRealized || !host_toplevel.IsRealized)
 				return;
-			
+
 			host.GdkWindow.GetOrigin (out x, out y);
 
 			int xOrigin = x;
@@ -265,13 +265,13 @@ namespace FSpot {
 
 			x += (int) (host.Allocation.Width * x_align);
 			y += (int) (host.Allocation.Height * y_align);
-			
+
 			x -= (int) (Allocation.Width * 0.5);
 			y -= (int) (Allocation.Height * 0.5);
 
 			x = Math.Max (0, Math.Min (x, xOrigin + host.Allocation.Width - Allocation.Width));
 			y = Math.Max (0, Math.Min (y, yOrigin + host.Allocation.Height - Allocation.Height));
-			
+
 			Move (x, y);
 		}
 
@@ -281,11 +281,11 @@ namespace FSpot {
 			AppPaintable = composited;
 
 			base.OnRealized ();
-			
+
 			ShapeWindow ();
 			Relocate ();
 		}
-		
+
 		public void Dismiss ()
 		{
 			Visibility = VisibilityType.None;
diff --git a/src/DragDropTargets.cs b/src/Clients/MainApp/FSpot/DragDropTargets.cs
similarity index 98%
rename from src/DragDropTargets.cs
rename to src/Clients/MainApp/FSpot/DragDropTargets.cs
index 433f099..a925961 100644
--- a/src/DragDropTargets.cs
+++ b/src/Clients/MainApp/FSpot/DragDropTargets.cs
@@ -11,7 +11,7 @@ using System;
 using Gtk;
 
 namespace FSpot
-{	
+{
 	public static class DragDropTargets
 	{
 		enum TargetType : uint {
@@ -28,24 +28,24 @@ namespace FSpot
 		[Obsolete ("better use gtk_target_list_add_text_targets")]
 		public static readonly TargetEntry PlainTextEntry =
 			new TargetEntry ("text/plain", 0, (uint)TargetType.PhotoList);
-		
+
 		public static readonly TargetEntry PhotoListEntry =
 			new TargetEntry ("application/x-fspot-photos", 0, (uint)TargetType.PhotoList);
-		
+
 		[Obsolete ("Use gtk_target_list_add_uri_target")]
 		public static readonly TargetEntry UriListEntry =
 			new TargetEntry ("text/uri-list", 0, (uint)TargetType.UriList);
-		
+
 		public static readonly TargetEntry TagListEntry =
 			new TargetEntry ("application/x-fspot-tags", 0, (uint)TargetType.TagList);
-		
+
 		/* FIXME: maybe we need just one fspot-query-item */
 		public static readonly TargetEntry UriQueryEntry =
 			new TargetEntry ("application/x-fspot-uri-query-item", 0, (uint)TargetType.UriQueryItem);
-		
+
 		public static readonly TargetEntry TagQueryEntry =
 			new TargetEntry ("application/x-fspot-tag-query-item", 0, (uint)TargetType.TagQueryItem);
-		
+
 		public static readonly TargetEntry RootWindowEntry =
 			new TargetEntry ("application/x-root-window-drop", 0, (uint)TargetType.RootWindow);
 
diff --git a/src/Fader.cs b/src/Clients/MainApp/FSpot/Fader.cs
similarity index 98%
rename from src/Fader.cs
rename to src/Clients/MainApp/FSpot/Fader.cs
index 6aeb22f..34cee13 100644
--- a/src/Fader.cs
+++ b/src/Clients/MainApp/FSpot/Fader.cs
@@ -27,20 +27,20 @@ namespace FSpot {
 			win.Unmapped += HandleUnmapped;
 			fadin = new DoubleAnimation (0.0, target, TimeSpan.FromMilliseconds(msec), delegate (double opacity) {
 				CompositeUtils.SetWinOpacity (win, opacity);
-			});	
+			});
 		}
-		
+
 		[GLib.ConnectBefore]
 		public void HandleMapped (object sender, EventArgs args)
 		{
 			composited = CompositeUtils.SupportsHint (win.Screen, "_NET_WM_WINDOW_OPACITY");
 			if (!composited)
 				return;
-			
+
 			CompositeUtils.SetWinOpacity (win, 0.0);
 			fadin.Start ();
 		}
-		
+
 		public void HandleUnmapped (object sender, EventArgs args)
 		{
 			fadin.Stop ();
diff --git a/src/FolderQueryWidget.cs b/src/Clients/MainApp/FSpot/FolderQueryWidget.cs
similarity index 96%
rename from src/FolderQueryWidget.cs
rename to src/Clients/MainApp/FSpot/FolderQueryWidget.cs
index b08f50f..356940c 100644
--- a/src/FolderQueryWidget.cs
+++ b/src/Clients/MainApp/FSpot/FolderQueryWidget.cs
@@ -26,89 +26,89 @@ namespace FSpot
 	{
 		PhotoQuery query;
 		FolderSet folder_set;
-		
+
 		public FolderQueryWidget (PhotoQuery query) : base ()
 		{
 			folder_set = new FolderSet ();
 			this.query = query;
-			
+
 			query.SetCondition (folder_set);
-			
+
 			Drag.DestSet (this, DestDefaults.All,
 			              folder_query_widget_source_table,
 			              Gdk.DragAction.Copy | Gdk.DragAction.Move);
 		}
-		
+
 		void UpdateGui ()
 		{
 			while (Children.Length != 0)
 				Remove (Children[0]);
-			
+
 			int length = folder_set.Folders.Count ();
-			
+
 			if (length == 0) {
 				Hide ();
 				return;
 			}
-			
+
 			if (length < 4) {
-				
+
 				foreach (var uri in folder_set.Folders) {
 					Image image = new Image ("gtk-directory", IconSize.Button);
 					image.TooltipText = uri.ToString ();
 					PackStart (image);
 				}
-				
+
 				TooltipText = String.Empty;
-				
+
 			} else {
-				
+
 				Label label = new Label (String.Format ("<i>{0}x</i>", length));
 				label.UseMarkup = true;
 				PackStart (label);
-				
+
 				Image image = new Image ("gtk-directory", IconSize.Button);
 				PackStart (image);
-				
+
 				StringBuilder builder = new StringBuilder ();
 				foreach (var uri in folder_set.Folders) {
 					if (builder.Length > 0)
 						builder.AppendLine ();
-					
+
 					builder.Append (uri.ToString ());
 				}
-				
+
 				TooltipText = builder.ToString ();
 			}
-			
+
 			ShowAll ();
 		}
-		
+
 		public void SetFolders (IEnumerable<SafeUri> uris)
 		{
 			folder_set.Folders = uris;
-			
+
 			UpdateGui ();
 		}
-		
+
 		public void Clear ()
 		{
 			folder_set.Folders = null;
 		}
-		
+
 		public bool Empty {
 			get { return folder_set.Folders == null || folder_set.Folders.Count () == 0; }
 		}
-		
+
 		private static TargetEntry [] folder_query_widget_source_table =
 			new TargetEntry [] {
 				DragDropTargets.UriQueryEntry
 		};
-		
+
 		protected override void OnDragDataReceived (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time_)
 		{
 			base.OnDragDataReceived (context, x, y, selection_data, info, time_);
-			
+
 			SetFolders (selection_data.GetUriListData ());
 			query.RequestReload ();
 		}
diff --git a/src/FullScreenView.cs b/src/Clients/MainApp/FSpot/FullScreenView.cs
similarity index 96%
rename from src/FullScreenView.cs
rename to src/Clients/MainApp/FSpot/FullScreenView.cs
index 12f4263..484c2ee 100644
--- a/src/FullScreenView.cs
+++ b/src/Clients/MainApp/FSpot/FullScreenView.cs
@@ -33,7 +33,7 @@ namespace FSpot {
 		const string HideToolbar = "HideToolbar";
 		const string SlideShow = "SlideShow";
 		const string Info = "Info";
-		
+
 		public FullScreenView (IBrowsableCollection collection, Gtk.Window parent) : base ("Full Screen Mode")
 		{
 			//going fullscreen on the same screen the parent window
@@ -53,12 +53,12 @@ namespace FSpot {
 			try {
 				//scroll = new Gtk.ScrolledWindow (null, null);
 				actions = new ActionGroup ("joe");
-				
+
 				actions.Add (new ActionEntry [] {
-					new ActionEntry (HideToolbar, Stock.Close, 
-							 Catalog.GetString ("Hide"), 
-							 null, 
-							 Catalog.GetString ("Hide toolbar"), 
+					new ActionEntry (HideToolbar, Stock.Close,
+							 Catalog.GetString ("Hide"),
+							 null,
+							 Catalog.GetString ("Hide toolbar"),
 							 HideToolbarAction)});
 
 				actions.Add (new ToggleActionEntry [] {
@@ -70,7 +70,7 @@ namespace FSpot {
 							       InfoAction,
 							       false)});
 
-				Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen, 
+				Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen,
 					Catalog.GetString ("Exit fullscreen"),
 					null,
 					null);
@@ -101,7 +101,7 @@ namespace FSpot {
 				view.Show ();
 				view.MotionNotifyEvent += HandleViewMotion;
 				view.PointerMode = PointerMode.Scroll;
-				
+
 				scroll.ScrolledWindow.Add (view);
 
 				Toolbar tbar = new Toolbar ();
@@ -161,18 +161,18 @@ namespace FSpot {
 				notebook.AppendPage (display, null);
 
 				tbar.ShowAll ();
-				
+
 				scroll.Show ();
 				this.Decorated = false;
 				this.Fullscreen ();
 				this.ButtonPressEvent += HandleButtonPressEvent;
-				
+
 				view.Item.Changed += HandleItemChanged;
 				view.GrabFocus ();
 
 				hide_cursor_delay = new Delay (3000, new GLib.IdleHandler (HideCursor));
 				hide_cursor_delay.Start ();
-				
+
 				controls = new ControlOverlay (this);
 				controls.Add (tbar);
 				controls.Dismiss ();
@@ -180,7 +180,7 @@ namespace FSpot {
 				notebook.CurrentPage = 0;
 			} catch (System.Exception e) {
 				Log.Exception (e);
-			}	
+			}
 		}
 
 		private Gdk.Cursor empty_cursor;
@@ -190,20 +190,20 @@ namespace FSpot {
 				return false;
 			}
 
-			if (empty_cursor == null) 
+			if (empty_cursor == null)
 				empty_cursor = GdkUtils.CreateEmptyCursor (GdkWindow.Display);
-			
+
 			this.GdkWindow.Cursor = empty_cursor;
 			view.GdkWindow.Cursor = empty_cursor;
 			return false;
 		}
-		
-		private void ShowCursor () 
+
+		private void ShowCursor ()
 		{
 			view.PointerMode = PointerMode.Scroll;
 			this.GdkWindow.Cursor = null;
 		}
-		
+
 		private void HandleItemChanged (object sender, BrowsablePointerChangedEventArgs args)
 		{
 			if (scroll.ControlBox.Visible)
@@ -233,7 +233,7 @@ namespace FSpot {
 			HideCursor ();
 			return ret;
 		}
-		
+
 		private void ExitAction (object sender, System.EventArgs args)
 		{
 			Quit ();
@@ -257,15 +257,15 @@ namespace FSpot {
 			if (sender is ToggleToolButton) {
 				(sender as ToggleToolButton).Active = ! (sender as ToggleToolButton).Active;
 				active = (sender as ToggleToolButton).Active;
-			} else 
+			} else
 				active = (sender as ToggleAction).Active;
 
 			if (info == null) {
 				info = new InfoOverlay (this, view.Item);
 			}
 
-			info.Visibility = active ? 
-				ControlOverlay.VisibilityType.Partial : 
+			info.Visibility = active ?
+				ControlOverlay.VisibilityType.Partial :
 				ControlOverlay.VisibilityType.None;
 		}
 
@@ -274,7 +274,7 @@ namespace FSpot {
 		{
 			ShowCursor ();
 			hide_cursor_delay.Restart ();
-			
+
 			int x, y;
 			Gdk.ModifierType type;
 			((Gtk.Widget)sender).GdkWindow.GetPointer (out x, out y, out type);
diff --git a/src/GroupAdaptor.cs b/src/Clients/MainApp/FSpot/GroupAdaptor.cs
similarity index 98%
rename from src/GroupAdaptor.cs
rename to src/Clients/MainApp/FSpot/GroupAdaptor.cs
index b5d1a6a..2d8fa17 100644
--- a/src/GroupAdaptor.cs
+++ b/src/Clients/MainApp/FSpot/GroupAdaptor.cs
@@ -5,7 +5,7 @@ namespace FSpot {
 	public interface ILimitable {
 		void SetLimits (int min, int max);
 	}
-	
+
 	public abstract class GroupAdaptor {
 		protected PhotoQuery query;
 		public PhotoQuery Query {
@@ -26,7 +26,7 @@ namespace FSpot {
 				}
 			}
 		}
-		
+
 		public abstract int Value (int item) ;
 		public abstract int Count ();
 		public abstract string TickLabel (int item);
@@ -60,7 +60,7 @@ namespace FSpot {
 			this.query = query;
 			this.query.Changed += HandleQueryChanged;
 
-			Reload (); 
+			Reload ();
 		}
 	}
 }
diff --git a/src/GroupSelector.cs b/src/Clients/MainApp/FSpot/GroupSelector.cs
similarity index 94%
rename from src/GroupSelector.cs
rename to src/Clients/MainApp/FSpot/GroupSelector.cs
index 612c7f2..b5196c6 100644
--- a/src/GroupSelector.cs
+++ b/src/Clients/MainApp/FSpot/GroupSelector.cs
@@ -36,7 +36,7 @@ namespace FSpot {
 		int min_filled;
 		int max_filled;
 		bool has_limits;
-		
+
 		protected FSpot.GroupAdaptor adaptor;
 		public FSpot.GroupAdaptor Adaptor {
 			set {
@@ -53,7 +53,7 @@ namespace FSpot {
 				    min_limit.SetPosition (0, false);
 				    max_limit.SetPosition (adaptor.Count () - 1, false);
 				}
-			
+
 				if (adaptor is TimeAdaptor) {
 					left.TooltipText = Catalog.GetString ("More dates");
 					right.TooltipText = Catalog.GetString ("More dates");
@@ -61,7 +61,7 @@ namespace FSpot {
 					left.TooltipText = Catalog.GetString ("More");
 					right.TooltipText = Catalog.GetString ("More");
 				}
-				
+
 				adaptor.Changed += HandleAdaptorChanged;
 			}
 			get {
@@ -88,7 +88,7 @@ namespace FSpot {
 		{
 			bool size_changed = box_counts.Length != adaptor.Count ();
 			int [] box_values = new int [adaptor.Count ()];
-			
+
 			if (tick_layouts != null) {
 				foreach (Pango.Layout l in tick_layouts) {
 					if (l != null)
@@ -96,7 +96,7 @@ namespace FSpot {
 				}
 			}
 			tick_layouts = new Pango.Layout [adaptor.Count ()];
-			
+
 			int i = 0;
 			while (i < adaptor.Count ()) {
 				box_values [i] = adaptor.Value (i);
@@ -106,27 +106,27 @@ namespace FSpot {
 				}
 				i++;
 			}
-			
+
 			if (glass.Position >= adaptor.Count())
 				glass.SetPosition (adaptor.Count() - 1);
-			
+
 			Counts = box_values;
-			
+
 			if (has_limits && size_changed) {
 				min_limit.SetPosition (0, false);
 				max_limit.SetPosition (adaptor.Count () - 1, false);
 			}
-			
+
 			for (i = min_limit.Position; i < box_counts.Length; i++)
 				if (box_counts [i] > 0)
 						break;
-			
+
 			SetPosition (i < box_counts.Length ? i : min_limit.Position);
 			ScrollTo (min_limit.Position);
 
 			this.QueueDraw ();
 		}
-		
+
 		private int [] Counts {
 			set {
 				bool min_found = false;
@@ -143,7 +143,7 @@ namespace FSpot {
 					int count = box_counts [i];
 					box_count_max = Math.Max (count, box_count_max);
 
-					if (count > 0) { 
+					if (count > 0) {
 						if (!min_found) {
 							min_filled = i;
 							min_found = true;
@@ -159,7 +159,7 @@ namespace FSpot {
 			Fixed,
 			Min
 		}
-			
+
 		private RangeType mode = RangeType.Min;
 		public RangeType Mode {
 			get {
@@ -178,14 +178,14 @@ namespace FSpot {
 				position = 0;
 			else if (position == max_filled)
 				position = box_counts.Length - 1;
-			
+
 			Gdk.Rectangle box = new Box (this, position).Bounds;
 
 			// Only scroll to position if we are not dragging
 			if (!glass.Dragging)
 			{
 				if (box.Right > background.Right)
-			        	Offset -= box.X + box.Width - (background.X + background.Width);
+					Offset -= box.X + box.Width - (background.X + background.Width);
 				else if (box.X < background.X)
 					Offset += background.X - box.X;
 			}
@@ -198,12 +198,12 @@ namespace FSpot {
 			}
 			set {
 				scroll_offset = value;
-				
+
 				int total_width = (int)(box_counts.Length * BoxWidth);
 
 				if (total_width + scroll_offset < background.Width)
 					scroll_offset = background.Width - total_width;
-				
+
 				if (total_width <= background.Width)
 					scroll_offset = 0;
 
@@ -213,13 +213,13 @@ namespace FSpot {
 					GdkWindow.InvalidateRect (Allocation, false);
 			}
 		}
-		
-		private void UpdateButtons () 
+
+		private void UpdateButtons ()
 		{
 			left.Sensitive = (scroll_offset < 0);
 			right.Sensitive = (box_counts.Length * BoxWidth > background.Width - scroll_offset);
 
-			if (!left.Sensitive && left_delay.IsPending) 
+			if (!left.Sensitive && left_delay.IsPending)
 				left_delay.Stop ();
 
 			if (!right.Sensitive && right_delay.IsPending)
@@ -232,18 +232,18 @@ namespace FSpot {
 			double position = (x / BoxWidth);
 			position = System.Math.Max (0, position);
 			position = System.Math.Min (position, box_counts.Length - 1);
-			
+
 			if (box_counts [(int)position] > 0) {
 				out_position = (int)position;
 			} else {
 				int upper = (int)position;
 				while (upper < box_counts.Length && box_counts [upper] == 0)
 					upper++;
-				
+
 				int lower = (int)position;
 				while (lower >= 0 && box_counts [lower] == 0)
 					lower--;
-				
+
 				if (lower == -1 && upper == box_counts.Length) {
 					out_position = (int)position;
 				} else if (lower == -1 && upper < box_counts.Length) {
@@ -262,7 +262,7 @@ namespace FSpot {
 		{
 			x -= BoxX (0);
 			position = (int) (x / BoxWidth);
-			if (position < 0) { 
+			if (position < 0) {
 				position = 0;
 				return false;
 			} else if (position >= box_counts.Length) {
@@ -272,7 +272,7 @@ namespace FSpot {
 			return true;
 		}
 
-		private bool BoxHit (double x, double y, out int position) 
+		private bool BoxHit (double x, double y, out int position)
 		{
 			if (BoxXHit (x, out position)) {
 				Box box = new Box (this, position);
@@ -294,7 +294,7 @@ namespace FSpot {
 		protected override bool OnButtonPressEvent (Gdk.EventButton args)
 		{
 			if (args.Button == 3)
-				return DrawOrderMenu (args); 
+				return DrawOrderMenu (args);
 
 			double x = args.X + action.X;
 			double y = args.Y + action.Y;
@@ -315,11 +315,11 @@ namespace FSpot {
 					return true;
 				}
 			}
-			
+
 			return base.OnButtonPressEvent (args);
 		}
-		
-		protected override bool OnButtonReleaseEvent (Gdk.EventButton args) 
+
+		protected override bool OnButtonReleaseEvent (Gdk.EventButton args)
 		{
 			double x = args.X + action.X;
 			double y = args.Y + action.Y;
@@ -334,13 +334,13 @@ namespace FSpot {
 			return base.OnButtonReleaseEvent (args);
 		}
 
-		public void UpdateLimits () 
+		public void UpdateLimits ()
 		{
 			if (adaptor != null && has_limits && min_limit != null && max_limit != null)
 				((ILimitable)adaptor).SetLimits (min_limit.Position, max_limit.Position);
 		}
 
-		protected override bool OnMotionNotifyEvent (Gdk.EventMotion args) 
+		protected override bool OnMotionNotifyEvent (Gdk.EventMotion args)
 		{
 			double x = args.X + action.X;
 			double y = args.Y + action.Y;
@@ -372,11 +372,11 @@ namespace FSpot {
 			GdkWindow = ParentWindow;
 
 			base.OnRealized ();
-			
+
 			WindowAttr attr = WindowAttr.Zero;
 			attr.WindowType = Gdk.WindowType.Child;
-			
-			
+
+
 
 			attr.X = action.X;
 			attr.Y = action.Y;
@@ -384,23 +384,23 @@ namespace FSpot {
 			attr.Height = action.Height;
 			attr.Wclass = WindowClass.InputOnly;
 			attr.EventMask = (int) Events;
-			attr.EventMask |= (int) (EventMask.ButtonPressMask | 
+			attr.EventMask |= (int) (EventMask.ButtonPressMask |
 						 EventMask.KeyPressMask |
 						 EventMask.KeyReleaseMask |
-						 EventMask.ButtonReleaseMask | 
+						 EventMask.ButtonReleaseMask |
 						 EventMask.PointerMotionMask);
-				
+
 			event_window = new Gdk.Window (GdkWindow, attr, (int) (WindowAttributesType.X | WindowAttributesType.Y));
 			event_window.UserData = this.Handle;
 		}
 
-		protected override void OnUnrealized () 
+		protected override void OnUnrealized ()
 		{
 			event_window.Dispose ();
 			event_window = null;
 			base.OnUnrealized ();
 		}
-		
+
 		private Double BoxWidth {
 			get {
 				switch (mode) {
@@ -416,7 +416,7 @@ namespace FSpot {
 			}
 		}
 
-		private int BoxX (int item) 
+		private int BoxX (int item)
 		{
 			 return scroll_offset + background.X + (int) Math.Round (BoxWidth * item);
 		}
@@ -424,7 +424,7 @@ namespace FSpot {
 		private struct Box {
 			Gdk.Rectangle bounds;
 			Gdk.Rectangle bar;
-			
+
 			public Box (GroupSelector selector, int item)
 			{
 				bounds.Height = selector.background.Height;
@@ -439,10 +439,10 @@ namespace FSpot {
 				bar = bounds;
 				bar.Height = (int) Math.Ceiling ((bounds.Height - selector.box_top_padding) * percent);
 				bar.Y += bounds.Height - bar.Height - 1;
-				
+
 				bar.Inflate (- selector.box_spacing, 0);
 			}
-			
+
 			public Gdk.Rectangle Bounds {
 				get {
 					return bounds;
@@ -457,19 +457,19 @@ namespace FSpot {
 
 		}
 
-		private void DrawBox (Rectangle area, int item) 
+		private void DrawBox (Rectangle area, int item)
 		{
 			Box box = new Box (this, item);
 			Rectangle bar = box.Bar;
-			
+
 			if (bar.Intersect (area, out area)) {
 				if (item < min_limit.Position || item > max_limit.Position) {
 #if false
 					bar.Height += 1;
 
 					//GdkWindow.DrawRectangle (Style.ForegroundGC (StateType.Normal), false, box);
-					Style.PaintShadow (this.Style, GdkWindow, State, ShadowType.In, area, 
-							   this, null, bar.X, bar.Y, 
+					Style.PaintShadow (this.Style, GdkWindow, State, ShadowType.In, area,
+							   this, null, bar.X, bar.Y,
 							   bar.Width, bar.Height);
 #else
 					GdkWindow.DrawRectangle (Style.BackgroundGC (StateType.Active), true, area);
@@ -479,7 +479,7 @@ namespace FSpot {
 				}
 			}
 		}
-		
+
 		public Rectangle TickBounds (int item)
 		{
 			Rectangle bounds = Rectangle.Zero;
@@ -487,14 +487,14 @@ namespace FSpot {
 			bounds.Y = legend.Y + 3;
 			bounds.Width = 1;
 			bounds.Height = 6;
-			
+
 			return bounds;
 		}
-		
+
 		public void DrawTick (Rectangle area, int item)
 		{
 			Rectangle tick = TickBounds (item);
-			Pango.Layout layout = null; 
+			Pango.Layout layout = null;
 
 			if (item < tick_layouts.Length) {
 				layout = tick_layouts [item];
@@ -502,9 +502,9 @@ namespace FSpot {
 				if (layout != null) {
 					int width, height;
 					layout.GetPixelSize (out width, out height);
-					
+
 					Style.PaintLayout (Style, GdkWindow, State, true, area, this,
-						   "GroupSelector:Tick", tick.X + 3, tick.Y + tick.Height, layout); 
+						   "GroupSelector:Tick", tick.X + 3, tick.Y + tick.Height, layout);
 				}
 			}
 
@@ -515,7 +515,7 @@ namespace FSpot {
 				GdkWindow.DrawRectangle (Style.ForegroundGC (State), true, area);
 			}
 		}
-		
+
 		protected override bool OnPopupMenu ()
 		{
 			DrawOrderMenu (null);
@@ -525,17 +525,17 @@ namespace FSpot {
 		private bool DrawOrderMenu (Gdk.EventButton args)
 		{
 			Gtk.Menu order_menu = new Gtk.Menu();
-			
+
 			order_menu.Append (App.Instance.Organizer.ReverseOrderAction.CreateMenuItem ());
 
-			GtkUtil.MakeMenuItem (order_menu, Catalog.GetString ("_Clear Date Range"), 
+			GtkUtil.MakeMenuItem (order_menu, Catalog.GetString ("_Clear Date Range"),
 						App.Instance.Organizer.HandleClearDateRange);
-			
+
 			if (args != null)
 				order_menu.Popup (null, null, null, args.Button, args.Time);
 			else
 				order_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
-			
+
 			return true;
 		}
 
@@ -547,19 +547,19 @@ namespace FSpot {
 			public bool GlassUpdating;
 			public Point DragStart;
 
-			public Manipulator (GroupSelector selector) 
+			public Manipulator (GroupSelector selector)
 			{
 				this.selector = selector;
-				timer = new Delay (50, new GLib.IdleHandler (DragTimeout)); 
+				timer = new Delay (50, new GLib.IdleHandler (DragTimeout));
 			}
-			
+
 			protected int drag_offset;
 			public int DragOffset {
 				set {
 					Rectangle then = Bounds ();
 					drag_offset = value;
 					Rectangle now = Bounds ();
-					
+
 					if (selector.Visible) {
 						selector.GdkWindow.InvalidateRect (then, false);
 						selector.GdkWindow.InvalidateRect (now, false);
@@ -573,7 +573,7 @@ namespace FSpot {
 				}
 			}
 
-			public virtual void StartDrag (double x, double y, uint time) 
+			public virtual void StartDrag (double x, double y, uint time)
 			{
 				State = StateType.Active;
 				//timer.Start ();
@@ -592,7 +592,7 @@ namespace FSpot {
 
 				return true;
 			}
-			
+
 			protected bool PositionValid (int position)
 			{
 				if (position < 0 || position > selector.box_counts.Length - 1)
@@ -607,7 +607,7 @@ namespace FSpot {
 				double drag_lower_limit = (selector.background.Left) - (bounds.Width/2);
 				double drag_upper_limit = (selector.background.Right) - (bounds.Width/2);
 				double calX = DragStart.X + (x - DragStart.X);
-				
+
 				if (calX >= drag_lower_limit && calX <= drag_upper_limit) {
 					if (selector.right_delay.IsPending)
 						selector.right_delay.Stop();
@@ -671,11 +671,11 @@ namespace FSpot {
 			{
 				if (! PositionValid (position))
 					return;
-				    
+
 				Rectangle then = Bounds ();
 				this.position = position;
 				Rectangle now = Bounds ();
-				
+
 				if (selector.Visible) {
 					then = now.Union (then);
 					selector.GdkWindow.InvalidateRect (then, false);
@@ -694,7 +694,7 @@ namespace FSpot {
 			}
 
 			public abstract void Draw (Rectangle area);
-			
+
 			public abstract void PositionChanged ();
 
 			public abstract Rectangle Bounds ();
@@ -704,13 +704,13 @@ namespace FSpot {
 				return Bounds ().Contains ((int)x, (int)y);
 			}
 		}
-		
+
 		private class Glass : Manipulator {
 			Gtk.Window popup_window;
 			Gtk.Label popup_label;
 			int drag_position;
 
-			public Glass (GroupSelector selector) : base (selector) 
+			public Glass (GroupSelector selector) : base (selector)
 			{
 				popup_window = new TipWindow ();
 				popup_label = new Gtk.Label (String.Empty);
@@ -724,7 +724,7 @@ namespace FSpot {
 					return selector.box_spacing * 2;
 				}
 			}
-			
+
 			private void UpdatePopupPosition ()
 			{
 				int x = 0, y = 0;
@@ -765,13 +765,13 @@ namespace FSpot {
 				UpdatePopupPosition ();
 				drag_position = this.Position;
 			}
-			
+
 			public override void UpdateDrag (double x, double y)
 			{
 				Rectangle box = Bounds ();
 				double middle = box.X + (box.Width / 2.0);
 				int current_position;
-				
+
 				base.UpdateDrag (x, y);
 				MaintainPosition();
 			}
@@ -805,14 +805,14 @@ namespace FSpot {
 				}
 				return box;
 			}
-			
-			public override Rectangle Bounds () 
+
+			public override Rectangle Bounds ()
 			{
 				Rectangle box = InnerBounds ();
 
 				box.Inflate  (border, border);
 				box.Height += handle_height;
-				
+
 				return box;
 			}
 
@@ -823,41 +823,41 @@ namespace FSpot {
 
 				Rectangle inner = InnerBounds ();
 				Rectangle bounds = Bounds ();
-				
+
 				if (! bounds.Intersect (area, out area))
 				    return;
-				    
+
 				int i = 0;
-				
+
 				Rectangle box = inner;
 				box.Width -= 1;
 				box.Height -= 1;
 				while (i < border) {
 					box.Inflate (1, 1);
-					
+
 					selector.Style.BackgroundGC (State).ClipRectangle = area;
-					selector.GdkWindow.DrawRectangle (selector.Style.BackgroundGC (State), 
+					selector.GdkWindow.DrawRectangle (selector.Style.BackgroundGC (State),
 									  false, box);
 					i++;
 				}
-				
-				
-				Style.PaintFlatBox (selector.Style, selector.GdkWindow, State, ShadowType.In, 
-						    area, selector, "glass", bounds.X, inner.Y + inner.Height + border, 
+
+
+				Style.PaintFlatBox (selector.Style, selector.GdkWindow, State, ShadowType.In,
+						    area, selector, "glass", bounds.X, inner.Y + inner.Height + border,
 						    bounds.Width, handle_height);
-				
-				Style.PaintHandle (selector.Style, selector.GdkWindow, State, ShadowType.In, 
-						   area, selector, "glass", bounds.X, inner.Y + inner.Height + border, 
+
+				Style.PaintHandle (selector.Style, selector.GdkWindow, State, ShadowType.In,
+						   area, selector, "glass", bounds.X, inner.Y + inner.Height + border,
 						   bounds.Width, handle_height, Orientation.Horizontal);
-				
-				Style.PaintShadow (selector.Style, selector.GdkWindow, State, ShadowType.Out, 
+
+				Style.PaintShadow (selector.Style, selector.GdkWindow, State, ShadowType.Out,
 						   area, selector, null, bounds.X, bounds.Y, bounds.Width, bounds.Height);
-				
-				Style.PaintShadow (selector.Style, selector.GdkWindow, State, ShadowType.In, 
+
+				Style.PaintShadow (selector.Style, selector.GdkWindow, State, ShadowType.In,
 						   area, selector, null, inner.X, inner.Y, inner.Width, inner.Height);
-				
+
 			}
-			
+
 			public override void PositionChanged ()
 			{
 				GlassUpdating = true;
@@ -866,7 +866,7 @@ namespace FSpot {
 				selector.ScrollTo (Position);
 				GlassUpdating = false;
 			}
-			
+
 
 		}
 
@@ -880,13 +880,13 @@ namespace FSpot {
 			}
 
 			private LimitType limit_type;
-			
-			public override Rectangle Bounds () 
+
+			public override Rectangle Bounds ()
 			{
 				int limit_offset = limit_type == LimitType.Max ? 1 : 0;
 
 				Rectangle bounds = new Rectangle (0, 0, width, selector.background.Height + handle_height);
-				
+
 				if (Dragging) {
 					bounds.X = DragStart.X + DragOffset;
 				} else {
@@ -896,7 +896,7 @@ namespace FSpot {
 				return bounds;
 			}
 
-			public override void Draw (Rectangle area) 
+			public override void Draw (Rectangle area)
 			{
 				Rectangle bounds = Bounds ();
 				Rectangle top = new Rectangle (bounds.X,
@@ -936,7 +936,7 @@ namespace FSpot {
 #endif
 			}
 
-			public Limit (GroupSelector selector, LimitType type) : base (selector) 
+			public Limit (GroupSelector selector, LimitType type) : base (selector)
 			{
 				limit_type = type;
 			}
@@ -946,7 +946,7 @@ namespace FSpot {
 				selector.UpdateLimits ();
 			}
 		}
-		
+
 		protected override void OnMapped ()
 		{
 			base.OnMapped ();
@@ -959,12 +959,12 @@ namespace FSpot {
 			base.OnUnmapped ();
 			if (event_window != null)
 				event_window.Hide ();
-			
+
 		}
-		
+
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
-			Rectangle area; 
+			Rectangle area;
 			//Console.WriteLine ("expose {0}", args.Area);
 			foreach (Rectangle sub in args.Region.GetRectangles ()) {
 				if (sub.Intersect (background, out area)) {
@@ -973,10 +973,10 @@ namespace FSpot {
 					int max_x = BoxX (max_limit.Position + 1);
 					active.X = min_x;
 					active.Width = max_x - min_x;
-					
+
 					if (active.Intersect (area, out active))
 						GdkWindow.DrawRectangle (Style.BaseGC (State), true, active);
-					
+
 					int i;
 					BoxXHit (area.X, out i);
 					int end;
@@ -984,35 +984,35 @@ namespace FSpot {
 					while (i <= end)
 						DrawBox (area, i++);
 				}
-				
-				Style.PaintShadow (this.Style, GdkWindow, State, ShadowType.In, area, 
-						   this, null, background.X, background.Y, 
+
+				Style.PaintShadow (this.Style, GdkWindow, State, ShadowType.In, area,
+						   this, null, background.X, background.Y,
 						   background.Width, background.Height);
-				
+
 				if (sub.Intersect (legend, out area)) {
 					int i = 0;
-					
+
 					while (i < box_counts.Length)
 						DrawTick (area, i++);
 				}
-				
+
 				if (has_limits) {
 					if (min_limit != null) {
 						min_limit.Draw (sub);
 					}
-					
+
 					if (max_limit != null) {
 						max_limit.Draw (sub);
 					}
 				}
-				
+
 				if (glass != null) {
 					glass.Draw (sub);
 				}
 			}
 			return base.OnExposeEvent (args);
 		}
-			
+
 		protected override void OnSizeRequested (ref Requisition requisition)
 		{
 			left.SizeRequest ();
@@ -1033,19 +1033,19 @@ namespace FSpot {
 		{
 			int max_height = 0;
 
-			Pango.FontMetrics metrics = this.PangoContext.GetMetrics (this.Style.FontDescription, 
+			Pango.FontMetrics metrics = this.PangoContext.GetMetrics (this.Style.FontDescription,
 										  Pango.Language.FromString ("en_US"));
 			max_height += PangoPixels (metrics.Ascent + metrics.Descent);
 
 			foreach (Pango.Layout l in tick_layouts) {
 				if (l != null) {
 					int width, height;
-					
+
 					l.GetPixelSize (out width, out height);
 					max_height = Math.Max (height, max_height);
 				}
 			}
-			
+
 			return (int) (max_height * 1.5);
 		}
 
@@ -1066,7 +1066,7 @@ namespace FSpot {
 			Offset += 10;
 			return true;
 		}
-		
+
 		private void HandleLeftPressed (object sender, System.EventArgs ars)
 		{
 			HandleScrollLeft ();
@@ -1090,27 +1090,27 @@ namespace FSpot {
 		{
 			base.OnSizeAllocated (alloc);
 			int legend_height = LegendHeight ();
-	
+
 			Gdk.Rectangle bar = new Rectangle (alloc.X + border, alloc.Y + border,
 							   alloc.Width - 2 *  border,
 							   alloc.Height - 2 * border - glass.handle_height);
-							   
-		
+
+
 			if (left.Allocation.Y != bar.Y || left.Allocation.X != bar.X) {
 				left.SetSizeRequest (-1, bar.Height);
 				this.Move (left, bar.X - Allocation.X, bar.Y - Allocation.Y);
 			}
-			
+
 			if (right.Allocation.Y != bar.Y || right.Allocation.X != bar.X + bar.Width - right.Allocation.Width) {
 				right.SetSizeRequest (-1, bar.Height);
-				this.Move (right,  bar.X - Allocation.X + bar.Width - right.Allocation.Width, 
+				this.Move (right,  bar.X - Allocation.X + bar.Width - right.Allocation.Width,
 					   bar.Y - Allocation.Y);
 			}
 
-			background = new Rectangle (bar.X + left.Allocation.Width, bar.Y, 
-						    bar.Width - left.Allocation.Width - right.Allocation.Width, 
+			background = new Rectangle (bar.X + left.Allocation.Width, bar.Y,
+						    bar.Width - left.Allocation.Width - right.Allocation.Width,
 						    bar.Height);
-			
+
 			legend = new Rectangle (background.X, background.Y,
 						background.Width, legend_height);
 
@@ -1118,7 +1118,7 @@ namespace FSpot {
 
 			if (event_window != null)
 				event_window.MoveResize (action.X, action.Y, action.Width, action.Height);
-			
+
 			this.Offset = this.Offset;
 
 			UpdateButtons ();
@@ -1141,7 +1141,7 @@ namespace FSpot {
 			}
 		}
 
-		public GroupSelector () : base () 
+		public GroupSelector () : base ()
 		{
 			SetFlag (WidgetFlags.NoWindow);
 
@@ -1167,14 +1167,14 @@ namespace FSpot {
 			right.ButtonReleaseEvent += HandleScrollReleaseEvent;
 			right_delay = new Delay (50, new GLib.IdleHandler (HandleScrollRight));
 			//right.Clicked += HandleScrollRight;
-            
+
 			this.Put (left, 0, 0);
 			this.Put (right, 100, 0);
 			left.Show ();
 			right.Show ();
 
 			CanFocus = true;
-			
+
 			Mode = RangeType.Min;
 			UpdateButtons ();
 		}
@@ -1183,12 +1183,12 @@ namespace FSpot {
 
 #if TEST_MAIN
 		private void HandleKeyPressEvent (object sender, KeyPressEventArgs args)
-		{		
+		{
 			switch (args.Event.Key) {
 			case Gdk.Key.Left:
 				if (glass.Position > 0)
 					this.glass.Position--;
-				else 
+				else
 					glass.Position = box_counts.Length - 1;
 
 				break;
@@ -1202,14 +1202,14 @@ namespace FSpot {
 			case Gdk.Key.Down:
 				if (Mode > 0)
 					Mode--;
-				else 
+				else
 					Mode = 2;
 
 				break;
 			case Gdk.Key.Up:
 				if (mode < 2)
 					Mode++;
-				else 
+				else
 					Mode = 0;
 				break;
 			case Gdk.Key.Home:
@@ -1222,7 +1222,7 @@ namespace FSpot {
 		}
 
 		public static int Main (string [] args) {
-			
+
 			Application.Init ();
 			Gtk.Window win = new Gtk.Window ("testing");
 
diff --git a/src/Histogram.cs b/src/Clients/MainApp/FSpot/Histogram.cs
similarity index 96%
rename from src/Histogram.cs
rename to src/Clients/MainApp/FSpot/Histogram.cs
index 66e4a2e..966eebc 100644
--- a/src/Histogram.cs
+++ b/src/Clients/MainApp/FSpot/Histogram.cs
@@ -1,4 +1,4 @@
-/* 
+/*
  * FSpot.Histogram.cs
  *
  * Author(s):
@@ -38,7 +38,7 @@ namespace FSpot {
 		{
 		        FillValues (src);
 		}
-		
+
 		public Histogram () {}
 
 		private void FillValues (Gdk.Pixbuf src)
@@ -47,7 +47,7 @@ namespace FSpot {
 
 			if (src.BitsPerSample != 8)
 				throw new System.Exception ("Invalid bits per sample");
-						
+
 			unsafe {
 				byte * srcb = (byte *)src.Pixels;
 				byte * pixels = srcb;
@@ -64,17 +64,17 @@ namespace FSpot {
 							v [*(srcb++) * 3 + 0]++;
 							v [*(srcb++) * 3 + 1]++;
 							v [*(srcb++) * 3 + 2]++;
-							
+
 							if (alpha)
 								srcb++;
-							
+
 						}
 						srcb =  ((byte *) pixels) + j * rowstride;
 					}
 				}
 			}
 		}
-		
+
 		private int ChannelSum (int channel)
 		{
 			int sum = 0;
@@ -91,10 +91,10 @@ namespace FSpot {
 			double current = 0.0;
 			double percentage;
 			double next_percentage;
-			
+
 			low = 0;
 			high = 0;
-			
+
 			for (int i = 0; i < values.GetLength (0) - 1; i++) {
 				current += values [i, channel];
 				percentage = current / total;
@@ -116,7 +116,7 @@ namespace FSpot {
 			}
 		}
 
-		private void Draw (Gdk.Pixbuf image) 
+		private void Draw (Gdk.Pixbuf image)
 		{
 			int max = 0;
 			for (int i = 0; i < values.GetLength (0); i++) {
@@ -130,15 +130,15 @@ namespace FSpot {
 				int r = 0;
 				int b = 0;
 				int g = 0;
-				
+
 				for (int i = 0; i < image.Width; i++) {
 					byte * pixels = (byte *)image.Pixels + i * 4;
-					
+
 					if (max > 0) {
 						r = values [i, 0] * height / max;
 						g = values [i, 1] * height / max;
 						b = values [i, 2] * height / max;
-					} else 
+					} else
 						r = g = b = 0;
 
 					int top = Math.Max (r, Math.Max (g, b));
@@ -161,7 +161,7 @@ namespace FSpot {
 
 				}
 			}
-		}	
+		}
 
 		public Gdk.Pixbuf Generate (Gdk.Pixbuf input, int max_width)
 		{
@@ -179,17 +179,17 @@ namespace FSpot {
 			Draw (pixbuf);
 			return pixbuf;
 		}
-						     
-		
+
+
 #if FSPOT_HISTOGRAM_MAIN
-		public static void Main (string [] args) 
+		public static void Main (string [] args)
 		{
 			Gtk.Application.Init ();
 			Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (args [0]);
 			Log.DebugFormat ("loaded {0}", args [0]);
 			Histogram hist = new Histogram ();
 			Log.DebugFormat ("loaded histgram", args [0]);
-			
+
 			Gtk.Window win = new Gtk.Window ("display");
 			Gtk.Image image = new Gtk.Image ();
 			Gdk.Pixbuf img = hist.Generate (pixbuf);
diff --git a/src/InfoOverlay.cs b/src/Clients/MainApp/FSpot/InfoOverlay.cs
similarity index 99%
rename from src/InfoOverlay.cs
rename to src/Clients/MainApp/FSpot/InfoOverlay.cs
index 5d018b4..e902085 100644
--- a/src/InfoOverlay.cs
+++ b/src/Clients/MainApp/FSpot/InfoOverlay.cs
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2007 Novell Inc.
  *
  * Author
@@ -14,7 +14,7 @@ using FSpot.Widgets;
 namespace FSpot {
 	public class InfoItem : InfoBox {
 		BrowsablePointer item;
-		
+
 		public InfoItem (BrowsablePointer item)
 		{
 			this.item = item;
@@ -25,7 +25,7 @@ namespace FSpot {
 			ShowRating = true;
 			Context = ViewContext.FullScreen;
 		}
-		
+
 		private void HandleItemChanged (object sender, BrowsablePointerChangedEventArgs args)
 		{
 			Photo = item.Current;
diff --git a/src/ItemAction.cs b/src/Clients/MainApp/FSpot/ItemAction.cs
similarity index 88%
rename from src/ItemAction.cs
rename to src/Clients/MainApp/FSpot/ItemAction.cs
index f2ab0ee..022faac 100644
--- a/src/ItemAction.cs
+++ b/src/Clients/MainApp/FSpot/ItemAction.cs
@@ -1,4 +1,4 @@
-/* 
+/*
  * ItemAction.cs
  *
  * Copyright 2007 Novell Inc.
@@ -32,7 +32,7 @@ namespace FSpot {
 			item.Changed += ItemChanged;
 		}
 
-	        protected virtual void ItemChanged (object sender, 
+	        protected virtual void ItemChanged (object sender,
 						    BrowsablePointerChangedEventArgs args)
 		{
 			Sensitive = item.IsValid;
@@ -42,13 +42,13 @@ namespace FSpot {
 
 	public class RotateAction : ItemAction {
 		protected RotateDirection direction;
-		
+
 		public RotateAction (BrowsablePointer pointer,
 				     RotateDirection direction,
 				     string name,
 				     string label,
 				     string tooltip,
-				     string stock_id) 
+				     string stock_id)
 			: base (pointer, name, label, tooltip, stock_id)
 		{
 			this.direction = direction;
@@ -58,9 +58,9 @@ namespace FSpot {
 		{
 			try {
 				RotateOperation op = new RotateOperation (item.Current, direction);
-				
+
 				while (op.Step ());
-				
+
 				item.Collection.MarkChanged (item.Index, FullInvalidate.Instance);
 			} catch (Exception e) {
 				Dialog d = new EditExceptionDialog (null, e, item.Current);
@@ -68,16 +68,16 @@ namespace FSpot {
 				d.Run ();
 				d.Destroy ();
 			}
-			   
+
 		}
 	}
 
 	public class RotateLeftAction : RotateAction {
-		public RotateLeftAction (BrowsablePointer p) 
+		public RotateLeftAction (BrowsablePointer p)
 			: base (p,
 				RotateDirection.Counterclockwise,
-				"RotateItemLeft", 
-				Catalog.GetString ("Rotate Left"), 
+				"RotateItemLeft",
+				Catalog.GetString ("Rotate Left"),
 				Catalog.GetString ("Rotate picture left"),
 				"object-rotate-left")
 		{
@@ -85,11 +85,11 @@ namespace FSpot {
 	}
 
 	public class RotateRightAction : RotateAction {
-		public RotateRightAction (BrowsablePointer p) 
+		public RotateRightAction (BrowsablePointer p)
 			: base (p,
 				RotateDirection.Clockwise,
-				"RotateItemRight", 
-				Catalog.GetString ("Rotate Right"), 
+				"RotateItemRight",
+				Catalog.GetString ("Rotate Right"),
 				Catalog.GetString ("Rotate picture right"),
 				"object-rotate-right")
 		{
@@ -110,7 +110,7 @@ namespace FSpot {
 		{
 			Sensitive = item.Index < item.Collection.Count -1;
 		}
-		
+
 		protected override void OnActivated ()
 		{
 			item.MoveNext ();
@@ -131,7 +131,7 @@ namespace FSpot {
 		{
 			Sensitive =  item.Index > 0;
 		}
-		
+
 		protected override void OnActivated ()
 		{
 			item.MovePrevious ();
diff --git a/src/MainWindow.cs b/src/Clients/MainApp/FSpot/MainWindow.cs
similarity index 95%
rename from src/MainWindow.cs
rename to src/Clients/MainApp/FSpot/MainWindow.cs
index c582b40..305e545 100644
--- a/src/MainWindow.cs
+++ b/src/Clients/MainApp/FSpot/MainWindow.cs
@@ -23,6 +23,7 @@ using Banshee.Kernel;
 
 using FSpot;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Extensions;
 using FSpot.Query;
 using FSpot.Widgets;
@@ -36,56 +37,56 @@ namespace FSpot
 	public class MainWindow
 	{
 		public Sidebar Sidebar { get; private set; }
-	
+
 		TagSelectionWidget tag_selection_widget;
 		[GtkBeans.Builder.Object] Gtk.Window main_window;
-		public Gtk.Window Window { 
+		public Gtk.Window Window {
 			get { return main_window; }
 		}
-	
+
 		[GtkBeans.Builder.Object] Gtk.HPaned main_hpaned;
 		[GtkBeans.Builder.Object] Gtk.VBox view_vbox;
-	
+
 		[GtkBeans.Builder.Object] Gtk.VBox toolbar_vbox;
-	
+
 		[GtkBeans.Builder.Object] Gtk.ScrolledWindow icon_view_scrolled;
 		[GtkBeans.Builder.Object] Box photo_box;
 		[GtkBeans.Builder.Object] Notebook view_notebook;
-		
+
 		Gtk.ScrolledWindow tag_selection_scrolled;
-	
+
 		[GtkBeans.Builder.Object] Label status_label;
-	
+
 		[GtkBeans.Builder.Object] Gtk.UIManager uimanager;
 		// Photo
 		[GtkBeans.Builder.Object] Gtk.Action create_version_menu_item;
 		[GtkBeans.Builder.Object] Gtk.Action delete_version_menu_item;
 		[GtkBeans.Builder.Object] Gtk.Action detach_version_menu_item;
 		[GtkBeans.Builder.Object] Gtk.Action rename_version_menu_item;
-		
+
 		[GtkBeans.Builder.Object] Gtk.Action tools;
 		[GtkBeans.Builder.Object] Gtk.Action export;
 		[GtkBeans.Builder.Object] Gtk.Action pagesetup_menu_item;
 		[GtkBeans.Builder.Object] Gtk.Action print;
 		[GtkBeans.Builder.Object] Gtk.Action send_mail;
-	
+
 		// Edit
 		[GtkBeans.Builder.Object] Gtk.Action copy;
 		[GtkBeans.Builder.Object] Gtk.Action select_none;
 		[GtkBeans.Builder.Object] Gtk.Action rotate_left;
 		[GtkBeans.Builder.Object] Gtk.Action rotate_right;
-	
+
 		[GtkBeans.Builder.Object] Gtk.Action sharpen;
 		[GtkBeans.Builder.Object] Gtk.Action adjust_time;
-	
+
 		[GtkBeans.Builder.Object] Gtk.Action update_thumbnail;
 		[GtkBeans.Builder.Object] Gtk.Action delete_from_drive;
 		[GtkBeans.Builder.Object] Gtk.Action remove_from_catalog;
 		[GtkBeans.Builder.Object] Gtk.Action set_as_background;
-	
+
 		[GtkBeans.Builder.Object] Gtk.Action attach_tag;
 		[GtkBeans.Builder.Object] Gtk.Action remove_tag;
-	
+
 		// View
 		[GtkBeans.Builder.Object] Gtk.ToggleAction display_toolbar;
 		[GtkBeans.Builder.Object] Gtk.ToggleAction display_sidebar;
@@ -94,112 +95,112 @@ namespace FSpot
 		[GtkBeans.Builder.Object] Gtk.ToggleAction display_dates_menu_item;
 		[GtkBeans.Builder.Object] Gtk.ToggleAction display_tags_menu_item;
 		[GtkBeans.Builder.Object] Gtk.ToggleAction display_ratings_menu_item;
-	
+
 		[GtkBeans.Builder.Object] Gtk.Action zoom_in;
 		[GtkBeans.Builder.Object] Gtk.Action zoom_out;
 		[GtkBeans.Builder.Object] Gtk.ToggleAction loupe_menu_item;
-	
+
 		[GtkBeans.Builder.Object] Gtk.RadioAction tag_icon_hidden;
 		[GtkBeans.Builder.Object] Gtk.RadioAction tag_icon_small;
 		[GtkBeans.Builder.Object] Gtk.RadioAction tag_icon_medium;
 		[GtkBeans.Builder.Object] Gtk.RadioAction tag_icon_large;
-	
+
 		[GtkBeans.Builder.Object] Gtk.ToggleAction reverse_order;
 		public Gtk.ToggleAction ReverseOrderAction {
 			get { return reverse_order; }
 		}
-	
+
 		// Find
 		[GtkBeans.Builder.Object] Gtk.Action clear_date_range;
 		[GtkBeans.Builder.Object] Gtk.Action clear_rating_filter;
-	
+
 		[GtkBeans.Builder.Object] Gtk.ToggleAction find_untagged;
-		
-		[GtkBeans.Builder.Object] Gtk.Action clear_roll_filter;	
-		
+
+		[GtkBeans.Builder.Object] Gtk.Action clear_roll_filter;
+
 		// Tags
 		[GtkBeans.Builder.Object] Gtk.Action edit_selected_tag;
 		[GtkBeans.Builder.Object] Gtk.Action delete_selected_tag;
-	
+
 		[GtkBeans.Builder.Object] Gtk.Action attach_tag_to_selection;
 		[GtkBeans.Builder.Object] Gtk.Action remove_tag_from_selection;
-		
+
 		// Other Widgets
 		[GtkBeans.Builder.Object] Scale zoom_scale;
-	
+
 		[GtkBeans.Builder.Object] VBox info_vbox;
-	
+
 		[GtkBeans.Builder.Object] Gtk.HBox tagbar;
 		[GtkBeans.Builder.Object] Gtk.VBox tag_entry_container;
 		[GtkBeans.Builder.Object] Gtk.VBox sidebar_vbox;
 		TagEntry tag_entry;
-	
+
 		Gtk.Toolbar toolbar;
-	
+
 		FindBar find_bar;
-	
+
 		PhotoVersionMenu versions_submenu;
-	
+
 		Gtk.ToggleToolButton browse_button;
 		Gtk.ToggleToolButton edit_button;
-	
+
 		QueryView icon_view;
 
 		PhotoView photo_view;
 		public PhotoView PhotoView {
 			get { return photo_view; }
 		}
-	
+
 		FSpot.FullScreenView fsview;
 		FSpot.PhotoQuery query;
 		FSpot.GroupSelector group_selector;
 		FSpot.QueryWidget query_widget;
-		
+
 		ToolButton rl_button;
 		ToolButton rr_button;
-	
+
 		Label count_label;
-	
+
 		Gtk.ToolButton display_next_button;
 		Gtk.ToolButton display_previous_button;
-		
+
 		bool write_metadata = false;
-	
+
 		Gdk.Cursor watch = new Gdk.Cursor (Gdk.CursorType.Watch);
-	
+
 		// Tag Icon Sizes
 		public int TagsIconSize {
 			get { return (int) Tag.TagIconSize; }
 			set { Tag.TagIconSize = (Tag.IconSize) value; }
 		}
-	
-		private static TargetEntry [] icon_source_target_table = 
+
+		private static TargetEntry [] icon_source_target_table =
 			new TargetEntry [] {
 				DragDropTargets.PhotoListEntry,
 				DragDropTargets.TagQueryEntry,
 				DragDropTargets.UriListEntry,
 				DragDropTargets.RootWindowEntry
 		};
-		
-		private static TargetEntry [] icon_dest_target_table = 
+
+		private static TargetEntry [] icon_dest_target_table =
 			new TargetEntry [] {
 				DragDropTargets.PhotoListEntry,
 				DragDropTargets.TagListEntry,
 				DragDropTargets.UriListEntry
 		};
-		
-		private static TargetEntry [] tag_target_table = 
+
+		private static TargetEntry [] tag_target_table =
 			new TargetEntry [] {
 				DragDropTargets.TagListEntry
 		};
-		
+
 		const int PHOTO_IDX_NONE = -1;
-	
+
 		public Db Database { get; private set; }
 		public ModeType ViewMode { get; private set; }
 		public MainSelection Selection { get; private set; }
 		public InfoBox InfoBox { get; private set; }
-	
+
 		//
 		// Constructor
 		//
@@ -214,7 +215,7 @@ namespace FSpot
 					Log.DebugException (e);
 				}
 			}
-		
+
 #if GSD_2_24
 			Log.Information ("Hack for gnome-settings-daemon engaged");
 			int max_age, max_size;
@@ -246,7 +247,7 @@ namespace FSpot
 
 #endif
 			Database = db;
-	
+
 			GtkBeans.Builder builder = new GtkBeans.Builder ("main_window.ui");
 			builder.Autoconnect (this);
 
@@ -258,37 +259,37 @@ namespace FSpot
 				colormap = ((Widget)main_window).Screen.RgbColormap;
 			}
 			Gtk.Widget.DefaultColormap = colormap;
-	
+
 			LoadPreference (Preferences.MAIN_WINDOW_WIDTH);
 			LoadPreference (Preferences.MAIN_WINDOW_X);
 			LoadPreference (Preferences.MAIN_WINDOW_MAXIMIZED);
 			main_window.ShowAll ();
-	
+
 			LoadPreference (Preferences.SIDEBAR_POSITION);
 			LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);
-	
+
 			pagesetup_menu_item.Activated += HandlePageSetupActivated;
-	
+
 			toolbar = new Gtk.Toolbar ();
 			toolbar_vbox.PackStart (toolbar);
-	
+
 			ToolButton import_button = GtkUtil.ToolButtonFromTheme ("gtk-add", Catalog.GetString ("Import"), true);
 			import_button.Clicked += (o, args) => StartImport (null);
 			import_button.TooltipText = Catalog.GetString ("Import new images");
 			toolbar.Insert (import_button, -1);
-		
+
 			toolbar.Insert (new SeparatorToolItem (), -1);
-	
+
 			rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), false);
 			rl_button.Clicked += HandleRotate270Command;
 			toolbar.Insert (rl_button, -1);
-	
+
 			rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), false);
 			rr_button.Clicked += HandleRotate90Command;
 			toolbar.Insert (rr_button, -1);
-	
+
 			toolbar.Insert (new SeparatorToolItem (), -1);
-	
+
 			browse_button = new ToggleToolButton ();
 			browse_button.Label = Catalog.GetString ("Browse");
 			browse_button.IconName = "mode-browse";
@@ -296,7 +297,7 @@ namespace FSpot
 			browse_button.Toggled += HandleToggleViewBrowse;
 			browse_button.TooltipText = Catalog.GetString ("Browse many photos simultaneously");
 			toolbar.Insert (browse_button, -1);
-	
+
 			edit_button = new ToggleToolButton ();
 			edit_button.Label = Catalog.GetString ("Edit Image");
 			edit_button.IconName = "mode-image-edit";
@@ -304,73 +305,73 @@ namespace FSpot
 			edit_button.Toggled += HandleToggleViewPhoto;
 			edit_button.TooltipText = Catalog.GetString ("View and edit a photo");
 			toolbar.Insert (edit_button, -1);
-	
+
 			toolbar.Insert (new SeparatorToolItem (), -1);
-	
+
 			ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), false);
 			fs_button.Clicked += HandleViewFullscreen;
 			fs_button.TooltipText = Catalog.GetString ("View photos fullscreen");
 			toolbar.Insert (fs_button, -1);
-	
+
 			ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), false);
 			ss_button.Clicked += HandleViewSlideShow;
 			ss_button.TooltipText = Catalog.GetString ("View photos in a slideshow");
 			toolbar.Insert (ss_button, -1);
-	
+
 			SeparatorToolItem white_space = new SeparatorToolItem ();
 			white_space.Draw = false;
 			white_space.Expand = true;
 			toolbar.Insert (white_space, -1);
-	
+
 			ToolItem label_item = new ToolItem ();
 			count_label = new Label (String.Empty);
 			label_item.Child = count_label;
 			toolbar.Insert (label_item, -1);
-	
+
 			display_previous_button = new ToolButton (Stock.GoBack);
 			toolbar.Insert (display_previous_button, -1);
 			display_previous_button.TooltipText = Catalog.GetString ("Previous photo");
 			display_previous_button.Clicked += new EventHandler (HandleDisplayPreviousButtonClicked);
-	
+
 			display_next_button = new ToolButton (Stock.GoForward);
 			toolbar.Insert (display_next_button, -1);
 			display_next_button.TooltipText = Catalog.GetString ("Next photo");
 			display_next_button.Clicked += new EventHandler (HandleDisplayNextButtonClicked);
-	
+
 			Sidebar = new Sidebar ();
 			ViewModeChanged += Sidebar.HandleMainWindowViewModeChanged;
 			sidebar_vbox.Add (Sidebar);
-	
+
 			tag_selection_scrolled = new Gtk.ScrolledWindow ();
 			tag_selection_scrolled.ShadowType = ShadowType.In;
-			
+
 			tag_selection_widget = new TagSelectionWidget (Database.Tags);
 			tag_selection_scrolled.Add (tag_selection_widget);
-	
+
 			Sidebar.AppendPage (tag_selection_scrolled, Catalog.GetString ("Tags"), "tag");
-	
+
 			AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged);
-	
+
 			Sidebar.Context = ViewContext.Library;
-	 		
+
 			Sidebar.CloseRequested += HideSidebar;
 			Sidebar.Show ();
-	
+
 			InfoBox = new InfoBox ();
 			ViewModeChanged += InfoBox.HandleMainWindowViewModeChanged;
 			InfoBox.VersionChanged += delegate (InfoBox box, IBrowsableItemVersion version) { UpdateForVersionChange (version);};
 			sidebar_vbox.PackEnd (InfoBox, false, false, 0);
-	
+
 			InfoBox.Context = ViewContext.Library;
-			
+
 			tag_selection_widget.Selection.Changed += HandleTagSelectionChanged;
 			tag_selection_widget.KeyPressEvent += HandleTagSelectionKeyPress;
 			tag_selection_widget.ButtonPressEvent += HandleTagSelectionButtonPressEvent;
 			tag_selection_widget.PopupMenu += HandleTagSelectionPopupMenu;
 			tag_selection_widget.RowActivated += HandleTagSelectionRowActivated;
-			
+
 			LoadPreference (Preferences.TAG_ICON_SIZE);
-			
+
 			try {
 				query = new FSpot.PhotoQuery (Database.Photos);
 			} catch (System.Exception e) {
@@ -378,37 +379,37 @@ namespace FSpot
 				new RepairDbDialog (e, Database.Repair (), main_window);
 				query = new FSpot.PhotoQuery (Database.Photos);
 			}
-	
+
 			UpdateStatusLabel ();
 			query.Changed += HandleQueryChanged;
-	
+
 			Database.Photos.ItemsChanged += HandleDbItemsChanged;
 			Database.Tags.ItemsChanged += HandleTagsChanged;
 			Database.Tags.ItemsAdded += HandleTagsChanged;
 			Database.Tags.ItemsRemoved += HandleTagsChanged;
-	
+
 			group_selector = new FSpot.GroupSelector ();
 			group_selector.Adaptor = new FSpot.TimeAdaptor (query, Preferences.Get<bool> (Preferences.GROUP_ADAPTOR_ORDER_ASC));
-	
+
 			group_selector.ShowAll ();
-			
+
 			if (zoom_scale != null) {
 				zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
 			}
-	
+
 			view_vbox.PackStart (group_selector, false, false, 0);
 			view_vbox.ReorderChild (group_selector, 0);
-	
+
 			find_bar = new FindBar (query, tag_selection_widget.Model);
 			view_vbox.PackStart (find_bar, false, false, 0);
 			view_vbox.ReorderChild (find_bar, 1);
 			main_window.KeyPressEvent += HandleKeyPressEvent;
-			
+
 			query_widget = new FSpot.QueryWidget (query, Database);
 			query_widget.Logic.Changed += HandleQueryLogicChanged;
 			view_vbox.PackStart (query_widget, false, false, 0);
 			view_vbox.ReorderChild (query_widget, 2);
-			
+
 			MenuItem findByTag = uimanager.GetWidget ("/ui/menubar1/find/find_by_tag") as MenuItem;
 			query_widget.Hidden += delegate (object sender, EventArgs args) {
 				((Gtk.Label)findByTag.Child).TextWithMnemonic = Catalog.GetString ("Show _Find Bar");
@@ -416,7 +417,7 @@ namespace FSpot
 			query_widget.Shown += delegate (object sender, EventArgs args) {
 				((Gtk.Label)findByTag.Child).TextWithMnemonic = Catalog.GetString ("Hide _Find Bar");
 			};
-	
+
 			icon_view = new QueryView (query);
 			icon_view.ZoomChanged += HandleZoomChanged;
 			LoadPreference (Preferences.ZOOM);
@@ -427,9 +428,9 @@ namespace FSpot
 			icon_view.DoubleClicked += HandleDoubleClicked;
 			icon_view.Vadjustment.ValueChanged += HandleIconViewScroll;
 			icon_view.GrabFocus ();
-	
+
 			new FSpot.PreviewPopup (icon_view);
-	
+
 			icon_view.DragBegin += HandleIconViewDragBegin;
 			icon_view.DragEnd += HandleIconViewDragEnd;
 			icon_view.DragDataGet += HandleIconViewDragDataGet;
@@ -437,33 +438,33 @@ namespace FSpot
 			icon_view.DragDrop += HandleIconViewDragDrop;
 			// StartDrag is fired by IconView
 			icon_view.StartDrag += HandleIconViewStartDrag;
-	
+
 			TagMenu tag_menu = new TagMenu (null, Database.Tags);
 			tag_menu.NewTagHandler += delegate { HandleCreateTagAndAttach (this, null); };
 			tag_menu.TagSelected += HandleAttachTagMenuSelected;
 			tag_menu.Populate();
 			(uimanager.GetWidget("/ui/menubar1/edit2/attach_tag") as MenuItem).Submenu = tag_menu;
-			
+
 			PhotoTagMenu pmenu = new PhotoTagMenu ();
 			pmenu.TagSelected += HandleRemoveTagMenuSelected;
 			(uimanager.GetWidget("/ui/menubar1/edit2/remove_tag") as MenuItem).Submenu = pmenu;
-			
-			Gtk.Drag.DestSet (icon_view, DestDefaults.All, icon_dest_target_table, 
-					  DragAction.Copy | DragAction.Move); 
-	
+
+			Gtk.Drag.DestSet (icon_view, DestDefaults.All, icon_dest_target_table,
+					  DragAction.Copy | DragAction.Move);
+
 			icon_view.DragDataReceived += HandleIconViewDragDataReceived;
 			icon_view.KeyPressEvent += HandleIconViewKeyPressEvent;
-	
+
 			photo_view = new PhotoView (query);
 			photo_box.Add (photo_view);
-	
+
 			photo_view.DoubleClicked += HandleDoubleClicked;
 			photo_view.KeyPressEvent += HandlePhotoViewKeyPressEvent;
 			photo_view.UpdateStarted += HandlePhotoViewUpdateStarted;
 			photo_view.UpdateFinished += HandlePhotoViewUpdateFinished;
-	
+
 			photo_view.View.ZoomChanged += HandleZoomChanged;
-	
+
 			// Tag typing: focus the tag entry if the user starts typing a tag
 			icon_view.KeyPressEvent += HandlePossibleTagTyping;
 			photo_view.KeyPressEvent += HandlePossibleTagTyping;
@@ -473,77 +474,77 @@ namespace FSpot
 			tag_entry.TagsRemoved += HandleTagEntryRemoveTags;
 			tag_entry.Activated += HandleTagEntryActivate;
 			tag_entry_container.Add (tag_entry);
-	
-			Gtk.Drag.DestSet (photo_view, DestDefaults.All, tag_target_table, 
-					  DragAction.Copy | DragAction.Move); 
-	
+
+			Gtk.Drag.DestSet (photo_view, DestDefaults.All, tag_target_table,
+					  DragAction.Copy | DragAction.Move);
+
 			photo_view.DragMotion += HandlePhotoViewDragMotion;
 			photo_view.DragDrop += HandlePhotoViewDragDrop;
 			photo_view.DragDataReceived += HandlePhotoViewDragDataReceived;
-	
+
 			view_notebook.SwitchPage += HandleViewNotebookSwitchPage;
 			group_selector.Adaptor.GlassSet += HandleAdaptorGlassSet;
 			group_selector.Adaptor.Changed += HandleAdaptorChanged;
 			LoadPreference (Preferences.GROUP_ADAPTOR_ORDER_ASC);
 			LoadPreference (Preferences.FILMSTRIP_ORIENTATION);
-	
+
 			Selection = new MainSelection (this);
 			Selection.Changed += HandleSelectionChanged;
 			Selection.ItemsChanged += HandleSelectionItemsChanged;
 			Selection.Changed += Sidebar.HandleSelectionChanged;
 			Selection.ItemsChanged += Sidebar.HandleSelectionItemsChanged;
-	
+
 			Mono.Addins.AddinManager.ExtensionChanged += PopulateExtendableMenus;
 			PopulateExtendableMenus (null, null);
-	
+
 			UpdateMenus ();
-	
+
 			main_window.ShowAll ();
-	
+
 			tagbar.Hide ();
 			find_bar.Hide ();
-	
+
 			UpdateFindByTagMenu ();
-	
+
 			LoadPreference (Preferences.SHOW_TOOLBAR);
 			LoadPreference (Preferences.SHOW_SIDEBAR);
 			LoadPreference (Preferences.SHOW_TIMELINE);
 			LoadPreference (Preferences.SHOW_FILMSTRIP);
-	
+
 			LoadPreference (Preferences.GNOME_MAILTO_ENABLED);
-			
+
 			Preferences.SettingChanged += OnPreferencesChanged;
-	
+
 			main_window.DeleteEvent += HandleDeleteEvent;
-	
+
 			// When the icon_view is loaded, set it's initial scroll position
 			icon_view.SizeAllocated += HandleIconViewReady;
-	
+
 			export.Activated += HandleExportActivated;
 			UpdateToolbar ();
-	
+
 			(uimanager.GetWidget("/ui/menubar1/file1/close1") as MenuItem).Hide ();
 
-	
+
 			Banshee.Kernel.Scheduler.Resume ();
 		}
-	
+
 		private void HandleDisplayNextButtonClicked (object sender, EventArgs args)
 		{
 			PhotoView.View.Item.MoveNext ();
 		}
-	
+
 		private void HandleDisplayPreviousButtonClicked (object sender, EventArgs args)
 		{
 			PhotoView.View.Item.MovePrevious ();
 		}
-	
+
 		private void OnSidebarExtensionChanged (object s, ExtensionNodeEventArgs args) {
 			// FIXME: No sidebar page removal yet!
 			if (args.Change == ExtensionChange.Add)
 				Sidebar.AppendPage ((args.ExtensionNode as SidebarPageNode).GetPage ());
 		}
-	
+
 		private Photo CurrentPhoto {
 			get {
 				int active = ActiveIndex ();
@@ -553,39 +554,39 @@ namespace FSpot
 					return null;
 			}
 		}
-	
+
 		// Index into the PhotoQuery.  If -1, no photo is selected or multiple photos are selected.
-		private int ActiveIndex () 
+		private int ActiveIndex ()
 		{
 			if (Selection.Count == 1)
 				return SelectedIds() [0];
 			else
 				return PHOTO_IDX_NONE;
 		}
-	
+
 		// Switching mode.
 		public enum ModeType {
 			IconView,
 			PhotoView
 		};
-	
+
 		public event EventHandler ViewModeChanged;
-	
+
 		public void SetViewMode (ModeType value)
 		{
 			if (ViewMode == value)
 				return;
-	
+
 			ViewMode = value;
 			switch (ViewMode) {
 			case ModeType.IconView:
 				if (view_notebook.CurrentPage != 0)
 					view_notebook.CurrentPage = 0;
-	
+
 				display_timeline.Sensitive = true;
 				display_filmstrip.Sensitive = false;
 				group_selector.Visible = display_timeline.Active;
-	
+
 				if (photo_view.View.Loupe != null)
 					loupe_menu_item.Active = false;
 				JumpTo (photo_view.Item.Index);
@@ -594,51 +595,51 @@ namespace FSpot
 			case ModeType.PhotoView:
 				if (view_notebook.CurrentPage != 1)
 					view_notebook.CurrentPage = 1;
-	
+
 				display_timeline.Sensitive = false;
 				display_filmstrip.Sensitive = true;
 				group_selector.Visible = false;
-				
+
 				JumpTo (icon_view.FocusCell);
 				zoom_scale.Value = photo_view.NormalizedZoom;
-	
+
 				photo_view.View.GrabFocus();
 				break;
 			}
 			Selection.MarkChanged ();
 			UpdateToolbar ();
-			if (ViewModeChanged != null) 
+			if (ViewModeChanged != null)
 				ViewModeChanged (this, null);
 		}
-		
+
 		void UpdateToolbar ()
 		{
 			if (browse_button != null) {
 				bool state = ViewMode == ModeType.IconView;
-				
+
 				if (browse_button.Active != state)
 					browse_button.Active = state;
 			}
-	
+
 			if (edit_button != null) {
 				bool state = ViewMode == ModeType.PhotoView;
-				
+
 				if (edit_button.Active != state)
 					edit_button.Active = state;
 			}
-	
+
 			if (ViewMode == ModeType.PhotoView) {
 				display_previous_button.Visible = true;
 				display_next_button.Visible = true;
 				count_label.Visible = true;
-	
+
 				bool valid = photo_view.View.Item.IsValid;
 				bool prev = valid && photo_view.View.Item.Index > 0;
 				bool next = valid && photo_view.View.Item.Index < query.Count - 1;
-	
+
 				display_previous_button.Sensitive = prev;
 				display_next_button.Sensitive = next;
-	
+
 				if (Query == null)
 					count_label.Text = String.Empty;
 				else
@@ -649,14 +650,14 @@ namespace FSpot
 				display_next_button.Visible = false;
 				count_label.Visible = false;
 			}
-	
+
 		}
-	
+
 		private void HandleExportActivated (object o, EventArgs e)
 		{
 			FSpot.Extensions.ExportMenuItemNode.SelectedImages = delegate () {return new PhotoList (SelectedPhotos ()); };
 		}
-	
+
 		private void HandleDbItemsChanged (object sender, DbItemEventArgs<Photo> args)
 		{
 			foreach (Photo p in args.Items) {
@@ -665,17 +666,17 @@ namespace FSpot
 				if (write_metadata)
 					FSpot.Jobs.SyncMetadataJob.Create (Database.Jobs, p);
 			}
-			
+
 			if (args is PhotoEventArgs && (args as PhotoEventArgs).Changes.TimeChanged)
 				query.RequestReload ();
 		}
-	
+
 		private void HandleTagsChanged (object sender, DbItemEventArgs<Tag> args)
 		{
 			icon_view.QueueDraw ();
-			UpdateTagEntryFromSelection ();	
+			UpdateTagEntryFromSelection ();
 		}
-	
+
 		void HandleViewNotebookSwitchPage (object sender, SwitchPageArgs args)
 		{
 			switch (view_notebook.CurrentPage) {
@@ -687,10 +688,10 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		private int [] SelectedIds () {
 			int [] ids = new int [0];
-	
+
 			if (fsview != null && fsview.View.Item.IsValid)
 				ids = new int [] { fsview.View.Item.Index };
 			else {
@@ -705,13 +706,13 @@ namespace FSpot
 					break;
 				}
 			}
-	
+
 			return ids;
 		}
-	
+
 		public class MainSelection : IBrowsableCollection {
 			MainWindow win;
-	
+
 			public MainSelection (MainWindow win)
 			{
 				this.win = win;
@@ -720,7 +721,7 @@ namespace FSpot
 				win.photo_view.PhotoChanged += HandlePhotoChanged;
 				win.query.ItemsChanged += HandleQueryItemsChanged;
 			}
-			
+
 			public int Count {
 				get {
 					switch (win.ViewMode) {
@@ -732,7 +733,7 @@ namespace FSpot
 					return 0;
 				}
 			}
-	
+
 			public int IndexOf (IBrowsableItem item)
 			{
 				switch (win.ViewMode) {
@@ -743,7 +744,7 @@ namespace FSpot
 				}
 				return -1;
 			}
-			
+
 			public bool Contains (IBrowsableItem item)
 			{
 				switch (win.ViewMode) {
@@ -754,18 +755,18 @@ namespace FSpot
 				}
 				return false;
 			}
-			
+
 			public void MarkChanged ()
 			{
 				if (Changed != null)
 					Changed (this);
 			}
-	
+
 			public void MarkChanged (int index, IBrowsableItemChanges changes)
 			{
 				throw new System.NotImplementedException ("I didn't think you'd find me");
 			}
-			
+
 			public IBrowsableItem this [int index] {
 				get {
 					switch (win.ViewMode) {
@@ -779,14 +780,14 @@ namespace FSpot
 					throw new ArgumentOutOfRangeException ();
 				}
 			}
-			 
+
 			public IBrowsableItem [] Items {
 				get {
 					switch (win.ViewMode) {
 					case ModeType.PhotoView:
 						if (win.photo_view.Item.IsValid)
 							return new IBrowsableItem [] {win.photo_view.Item.Current};
-	
+
 						break;
 					case ModeType.IconView:
 						return win.icon_view.Selection.Items;
@@ -794,15 +795,15 @@ namespace FSpot
 					return new IBrowsableItem [0];
 				}
 			}
-	
+
 			private void HandleQueryItemsChanged (IBrowsableCollection collection, BrowsableEventArgs args)
 			{
 				// FIXME for now we only listen to changes directly from the query
 				// when we are in PhotoView mode because we presume that we'll get
 				// proper notification from the icon view selection in icon view mode
-				if (win.ViewMode != ModeType.PhotoView || ItemsChanged == null) 
+				if (win.ViewMode != ModeType.PhotoView || ItemsChanged == null)
 					return;
-	
+
 				foreach (int item in args.Items) {
 					if (win.photo_view.Item.Index == item ) {
 						ItemsChanged (this, new BrowsableEventArgs (item, args.Changes));
@@ -810,41 +811,41 @@ namespace FSpot
 					}
 				}
 			}
-	
+
 			private void HandlePhotoChanged (PhotoView sender)
 			{
 				if (win.ViewMode == ModeType.PhotoView && Changed != null)
 					Changed (this);
 			}
-	
+
 			public void HandleSelectionChanged (IBrowsableCollection collection)
 			{
 				if (win.ViewMode == ModeType.IconView && Changed != null)
 					Changed (this);
-	
-	
+
+
 			}
-	
+
 			private void HandleSelectionItemsChanged (IBrowsableCollection collection,  BrowsableEventArgs args)
 			{
 				if (win.ViewMode == ModeType.IconView && ItemsChanged != null)
 					ItemsChanged (this, args);
 			}
-	
+
 			public event IBrowsableCollectionChangedHandler Changed;
 			public event IBrowsableCollectionItemsChangedHandler ItemsChanged;
 		}
-	
+
 		private void HandleSelectionChanged (IBrowsableCollection collection)
 		{
 			UpdateMenus ();
 			UpdateTagEntryFromSelection ();
 			UpdateStatusLabel ();
 			UpdateToolbar ();
-	
+
 			InfoBox.Photos = SelectedPhotos ();
 		}
-	
+
 		private void HandleSelectionItemsChanged (IBrowsableCollection collection, BrowsableEventArgs args)
 		{
 			UpdateMenus ();
@@ -852,55 +853,55 @@ namespace FSpot
 			photo_view.UpdateTagView ();
 			InfoBox.Photos = SelectedPhotos ();
 		}
-	
-	
+
+
 		//
 		// Selection Interface
 		//
-	
+
 		private Photo [] SelectedPhotos (int [] selected_ids)
 		{
 			Photo [] photo_list = new Photo [selected_ids.Length];
-		
+
 			int i = 0;
 			foreach (int num in selected_ids)
 				photo_list [i ++] = query [num] as Photo;
-			
+
 			return photo_list;
 		}
-	
-		public Photo [] SelectedPhotos () 
+
+		public Photo [] SelectedPhotos ()
 		{
 			return SelectedPhotos (SelectedIds ());
 		}
-	
+
 		public PhotoQuery Query {
 			get { return query; }
 		}
-	
+
 		//
 		// Commands
 		//
-	
+
 		private void RotateSelectedPictures (Gtk.Window parent, RotateDirection direction)
 		{
 			RotateCommand command = new RotateCommand (parent);
-			
+
 			int [] selected_ids = SelectedIds ();
 			if (command.Execute (direction, SelectedPhotos (selected_ids)))
 				query.MarkChanged (selected_ids, InvalidateData.Instance);
 		}
-	
+
 		//
 		// Tag Selection Drag Handlers
 		//
-		
+
 		public void AddTagExtended (int [] nums, Tag [] tags)
 		{
 			foreach (int num in nums)
 				(query[num] as Photo).AddTag (tags);
 			query.Commit (nums);
-	
+
 			foreach (Tag t in tags) {
 				if (t.Icon != null || t.IconWasCleared)
 					continue;
@@ -913,25 +914,25 @@ namespace FSpot
 				} catch {
 					icon = null;
 				}
-				
+
 				t.Icon = icon;
 				Database.Tags.Commit (t);
 			}
 		}
-		
+
 		public void SetFolderQuery (IEnumerable<SafeUri> uri_list)
 		{
 			ShowQueryWidget ();
 			query_widget.SetFolders (uri_list);
 		}
-		
+
 		public void RemoveTags (int [] nums, Tag [] tags)
 		{
 			foreach (int num in nums)
 				(query[num] as Photo).RemoveTag (tags);
 			query.Commit (nums);
 		}
-	
+
 		void HandleTagSelectionButtonPressEvent (object sender, ButtonPressEventArgs args)
 		{
 			if (args.Event.Button == 3) {
@@ -941,20 +942,20 @@ namespace FSpot
 				args.RetVal = true;
 			}
 		}
-	
+
 		void HandleTagSelectionPopupMenu (object sender, PopupMenuArgs args)
 		{
 			TagPopup popup = new TagPopup ();
 			popup.Activate (null, null, tag_selection_widget.TagHighlight);
 			args.RetVal = true;
 		}
-	
+
 		void HandleTagSelectionRowActivated (object sender, RowActivatedArgs args)
-	 	{
-	 		ShowQueryWidget ();
-	 		query_widget.Include (new Tag [] {tag_selection_widget.TagByPath (args.Path)});
+		{
+			ShowQueryWidget ();
+			query_widget.Include (new Tag [] {tag_selection_widget.TagByPath (args.Path)});
 		}
-	
+
 		void JumpTo (int index)
 		{
 			switch (ViewMode) {
@@ -967,17 +968,17 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		void HandleAdaptorGlassSet (FSpot.GroupAdaptor sender, int index)
 		{
 			JumpTo (index);
 		}
-	
+
 		void HandleAdaptorChanged (FSpot.GroupAdaptor sender)
 		{
 			UpdateGlass ();
 		}
-	
+
 		/*
 		 * Keep the glass temporal slider in sync with the user's scrolling in the icon_view
 		 */
@@ -986,20 +987,20 @@ namespace FSpot
 			// If people cant see the timeline don't update it.
 			if (! display_timeline.Active)
 				return;
-	
+
 			int cell_num = icon_view.TopLeftVisibleCell();
 			if (cell_num == -1 /*|| cell_num == lastTopLeftCell*/)
 				return;
-	
+
 			IBrowsableItem photo = icon_view.Collection [cell_num];
 	#if false
 			group_selector.Adaptor.GlassSet -= HandleAdaptorGlassSet;
 			group_selector.Adaptor.SetGlass (group_selector.Adaptor.IndexFromPhoto (photo));
 			group_selector.Adaptor.GlassSet = HandleAdaptorGlassSet;
 	#else
-			/* 
-			 * FIXME this is a lame hack to get around a delegate chain.  This should 
-			 * actually operate directly on the adaptor not on the selector but I don't have 
+			/*
+			 * FIXME this is a lame hack to get around a delegate chain.  This should
+			 * actually operate directly on the adaptor not on the selector but I don't have
 			 * time to fix it right now.
 			 */
 			if (!group_selector.GlassUpdating) {
@@ -1007,21 +1008,21 @@ namespace FSpot
 			}
 	#endif
 		}
-		
+
 		void HandleIconViewScroll (object sender, EventArgs args)
 		{
 			UpdateGlass ();
 		}
-	
+
 		void HandleIconViewReady (object sender, EventArgs args)
 		{
 			LoadPreference (Preferences.GLASS_POSITION);
-	
+
 			// We only want to set the position the first time
 			// the icon_view is ready (eg on startup)
 			icon_view.SizeAllocated -= HandleIconViewReady;
 		}
-	
+
 		//
 		// IconView Drag Handlers
 		//
@@ -1031,24 +1032,24 @@ namespace FSpot
 			Gtk.Drag.Begin (icon_view, new TargetList (icon_source_target_table),
 					DragAction.Copy | DragAction.Move, (int) args.Button, args.Event);
 		}
-	
+
 		public void HandleIconViewDragBegin (object sender, DragBeginArgs args)
 		{
 			Photo [] photos = SelectedPhotos ();
-			
+
 			if (photos.Length > 0) {
 				int len = Math.Min (photos.Length, 4);
 				int size = 48;
 				int border  = 2;
 				int csize = size/2 + len * size / 2 + 2 * border ;
-				
+
 				Pixbuf container = new Pixbuf (Gdk.Colorspace.Rgb, true, 8, csize, csize);
 				container.Fill (0x00000000);
-	
+
 				bool use_icon = false;;
 				while (len-- > 0) {
 					FSpot.PixbufCache.CacheEntry entry = icon_view.Cache.Lookup (photos [len].DefaultVersion.Uri);
-	
+
 					Pixbuf thumbnail = null;
 					if (entry != null) {
 						Cms.Profile screen_profile;
@@ -1058,18 +1059,18 @@ namespace FSpot
 						} else
 							thumbnail = entry.ShallowCopyPixbuf ();
 					}
-					
+
 					if (thumbnail != null) {
-						Pixbuf small = PixbufUtils.ScaleToMaxSize (thumbnail, size, size);				
-	
+						Pixbuf small = PixbufUtils.ScaleToMaxSize (thumbnail, size, size);
+
 						int x = border + len * (size/2) + (size - small.Width)/2;
 						int y = border + len * (size/2) + (size - small.Height)/2;
-						Pixbuf box = new Pixbuf (container, x - border, y - border, 
+						Pixbuf box = new Pixbuf (container, x - border, y - border,
 									 small.Width + 2 * border, small.Height + 2 * border);
-	
+
 						box.Fill (0x000000ff);
-						small.CopyArea (0, 0, small.Width, small.Height, container, x, y); 
-						
+						small.CopyArea (0, 0, small.Width, small.Height, container, x, y);
+
 						thumbnail.Dispose ();
 						small.Dispose ();
 						use_icon = true;
@@ -1083,37 +1084,37 @@ namespace FSpot
 
 		void HandleIconViewDragEnd (object sender, DragEndArgs args) {
 		}
-	
+
 		void HandleIconViewDragDataGet (object sender, DragDataGetArgs args)
-		{	
+		{
 			if (args.Info == DragDropTargets.UriListEntry.Info) {
 				args.SelectionData.SetUriListData (new UriList (SelectedPhotos ()), args.Context.Targets[0]);
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.PhotoListEntry.Info) {
 				args.SelectionData.SetPhotosData (SelectedPhotos (), args.Context.Targets[0]);
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.RootWindowEntry.Info) {
 				HandleSetAsBackgroundCommand (null, null);
 				return;
 			}
 		}
-	
+
 		void HandleIconViewDragDrop (object sender, DragDropArgs args)
 		{
 			args.RetVal = true;
 		}
-	
+
 		void HandleIconViewDragMotion (object sender, DragMotionArgs args)
 		{
 			Gdk.Drag.Status (args.Context, args.Context.SuggestedAction, args.Time);
 			args.RetVal = true;
 		}
-	
-		public void ImportUriList (UriList list, bool copy) 
+
+		public void ImportUriList (UriList list, bool copy)
 		{
 			// Drag'n drop import.
 			var controller = new ImportController (false);
@@ -1144,7 +1145,7 @@ namespace FSpot
 		{
 			StartImport (null);
 		}
-	
+
 		public void ImportFile (SafeUri uri)
 		{
 			StartImport (uri);
@@ -1163,57 +1164,57 @@ namespace FSpot
 			var import_window = new ImportDialog (controller, Window);
 			import_window.Show ();
 		}
-	
+
 		void HandleIconViewDragDataReceived (object sender, DragDataReceivedArgs args)
 		{
-		 	Widget source = Gtk.Drag.GetSourceWidget (args.Context);     
-			
+			Widget source = Gtk.Drag.GetSourceWidget (args.Context);
+
 			if (args.Info == DragDropTargets.TagListEntry.Info) {
 				//
 				// Translate the event args from viewport space to window space,
 				// drag events use the viewport.  Owen sends his regrets.
 				//
-				int item = icon_view.CellAtPosition (args.X + (int) icon_view.Hadjustment.Value, 
+				int item = icon_view.CellAtPosition (args.X + (int) icon_view.Hadjustment.Value,
 								     args.Y + (int) icon_view.Vadjustment.Value);
-	
+
 				//Console.WriteLine ("Drop cell = {0} ({1},{2})", item, args.X, args.Y);
 				if (item >= 0) {
 					if (icon_view.Selection.Contains (item))
 						AttachTags (tag_selection_widget.TagHighlight, SelectedIds());
-					else 
+					else
 						AttachTags (tag_selection_widget.TagHighlight, new int [] {item});
 				}
-				
+
 				Gtk.Drag.Finish (args.Context, true, false, args.Time);
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.UriListEntry.Info) {
-	
-				/* 
-				 * If the drop is coming from inside f-spot then we don't want to import 
+
+				/*
+				 * If the drop is coming from inside f-spot then we don't want to import
 				 */
 				if (source != null)
 					return;
-	
-				UriList list = args.SelectionData.GetUriListData (); 
+
+				UriList list = args.SelectionData.GetUriListData ();
 				ImportUriList (list, (args.Context.Action & Gdk.DragAction.Copy) != 0);
-				
+
 				Gtk.Drag.Finish (args.Context, true, false, args.Time);
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.PhotoListEntry.Info) {
-				int p_item = icon_view.CellAtPosition (args.X + (int) icon_view.Hadjustment.Value, 
+				int p_item = icon_view.CellAtPosition (args.X + (int) icon_view.Hadjustment.Value,
 								     args.Y + (int) icon_view.Vadjustment.Value);
-	
+
 				if (p_item >= 0) {
 					if (icon_view.Selection.Contains (p_item)) //We don't want to reparent ourselves!
 						return;
-					PhotoVersionCommands.Reparent cmd = new PhotoVersionCommands.Reparent ();				
+					PhotoVersionCommands.Reparent cmd = new PhotoVersionCommands.Reparent ();
 					Photo[] photos_to_reparent = SelectedPhotos ();
 					// Give feedback to user that something happened, and leave the parent selected after reparenting
-					icon_view.Selection.Add (p_item); 
+					icon_view.Selection.Add (p_item);
 					cmd.Execute (Database.Photos, photos_to_reparent, query.Photos [p_item], GetToplevel (null));
 					UpdateQuery ();
 				}
@@ -1221,17 +1222,17 @@ namespace FSpot
 				return;
 			}
 		}
-	
+
 		//
 		// IconView event handlers
-		// 
-	
+		//
+
 		void HandleDoubleClicked (object sender, BrowsableEventArgs args)
 		{
 			Widget widget = sender as Widget;
 			if (widget == null)
 				return;
-	
+
 			switch (ViewMode) {
 			case ModeType.IconView:
 				icon_view.FocusCell = args.Items[0];
@@ -1242,14 +1243,14 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		public void HandleCommonPhotoCommands (object sender, Gtk.KeyPressEventArgs args) {
 			bool alt = ModifierType.Mod1Mask == (args.Event.State & ModifierType.Mod1Mask);
 			bool shift = ModifierType.ShiftMask == (args.Event.State & ModifierType.ShiftMask);
-	
+
 			if (args.RetVal == null)
 				args.RetVal = false;
-			
+
 			switch (args.Event.Key) {
 			case Gdk.Key.Delete:
 				if (shift)
@@ -1292,13 +1293,13 @@ namespace FSpot
 			}
 			args.RetVal = true;
 		}
-	
+
 		void HandleIconViewKeyPressEvent (object sender, Gtk.KeyPressEventArgs args)
 		{
 			HandleCommonPhotoCommands (sender, args);
 			if ((bool)args.RetVal)
 				return;
-	
+
 			switch (args.Event.Key) {
 			case Gdk.Key.F:
 			case Gdk.Key.f:
@@ -1307,11 +1308,11 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		//
 		// FullScreenView event handlers.
 		//
-	
+
 		void HandleFullScreenViewKeyPressEvent (object sender, Gtk.KeyPressEventArgs args)
 		{
 			HandleCommonPhotoCommands (sender, args);
@@ -1319,17 +1320,17 @@ namespace FSpot
 				// this will hide any panels again that might have appeared above the fullscreen view
 				fsview.Present ();
 		}
-	
+
 		//
 		// PhotoView event handlers.
 		//
-	
+
 		void HandlePhotoViewKeyPressEvent (object sender, Gtk.KeyPressEventArgs args)
 		{
 			HandleCommonPhotoCommands (sender, args);
 			if ((bool)args.RetVal)
 				return;
-	
+
 			switch (args.Event.Key) {
 			case Gdk.Key.F:
 			case Gdk.Key.f:
@@ -1342,62 +1343,62 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		void HandlePhotoViewUpdateStarted (PhotoView sender)
 		{
 			main_window.GdkWindow.Cursor = watch;
 			// FIXME: use gdk_display_flush() when available
 			main_window.GdkWindow.Display.Sync ();
 		}
-	
+
 		void HandlePhotoViewUpdateFinished (PhotoView sender)
 		{
 			main_window.GdkWindow.Cursor = null;
 			// FIXME: use gdk_display_flush() when available
 			main_window.GdkWindow.Display.Sync ();
 		}
-	
+
 		//
 		// PhotoView drag handlers.
 		//
-	
+
 		void HandlePhotoViewDragDrop (object sender, DragDropArgs args)
 		{
 			//Widget source = Gtk.Drag.GetSourceWidget (args.Context);
-	
+
 			args.RetVal = true;
 		}
-	
+
 		void HandlePhotoViewDragMotion (object sender, DragMotionArgs args)
 		{
 			//Widget source = Gtk.Drag.GetSourceWidget (args.Context);
 			//Console.WriteLine ("Drag Motion {0}", source == null ? "null" : source.TypeName);
-	
+
 			Gdk.Drag.Status (args.Context, args.Context.SuggestedAction, args.Time);
 			args.RetVal = true;
 		}
-	
+
 		void HandlePhotoViewDragDataReceived (object sender, DragDataReceivedArgs args)
 		{
-		 	//Widget source = Gtk.Drag.GetSourceWidget (args.Context);     
+			//Widget source = Gtk.Drag.GetSourceWidget (args.Context);
 			//Console.WriteLine ("Drag received {0}", source == null ? "null" : source.TypeName);
-	
+
 			HandleAttachTagCommand (sender, null);
-			
+
 			Gtk.Drag.Finish (args.Context, true, false, args.Time);
-	
-	 		photo_view.View.GrabFocus();
-		}	
-	
+
+			photo_view.View.GrabFocus();
+		}
+
 		//
 		// RatingMenu commands
 		//
-		
-		public void HandleRatingMenuSelected (int r) 
+
+		public void HandleRatingMenuSelected (int r)
 		{
 			if (ViewMode == ModeType.PhotoView)
 				this.photo_view.UpdateRating(r);
-	
+
 			Photo p;
 			Database.BeginTransaction ();
 			int [] selected_photos = SelectedIds ();
@@ -1408,42 +1409,42 @@ namespace FSpot
 			query.Commit (selected_photos);
 			Database.CommitTransaction ();
 		}
-	
+
 		//
 		// TagMenu commands.
 		//
-	
+
 		public void HandleTagMenuActivate (object sender, EventArgs args)
 		{
-	
+
 			MenuItem parent = sender as MenuItem;
 			if (parent == null) // We have a Gtk.Action for UI menus, so the "Edit > Remove tag" item needs special treatment
 				parent = uimanager.GetWidget("/ui/menubar1/edit2/remove_tag") as MenuItem;
 			if (parent != null && parent.Submenu is PhotoTagMenu) {
 				PhotoTagMenu menu = (PhotoTagMenu) parent.Submenu;
-				menu.Populate (SelectedPhotos ()); 
+				menu.Populate (SelectedPhotos ());
 			}
 		}
-	
-		public void HandleAttachTagMenuSelected (Tag t) 
+
+		public void HandleAttachTagMenuSelected (Tag t)
 		{
 			Database.BeginTransaction ();
 			AddTagExtended (SelectedIds (), new Tag [] {t});
 			Database.CommitTransaction ();
 			query_widget.PhotoTagsChanged (new Tag[] {t});
 		}
-		
+
 		public void HandleRequireTag (object sender, EventArgs args)
-	 	{
+		{
 			ShowQueryWidget ();
 			query_widget.Require (tag_selection_widget.TagHighlight);
-	 	}
-	 
+		}
+
 		public void HandleUnRequireTag (object sender, EventArgs args)
 		{
 			query_widget.UnRequire (tag_selection_widget.TagHighlight);
-	 	}
-	
+		}
+
 		public void HandleRemoveTagMenuSelected (Tag t)
 		{
 			Database.BeginTransaction ();
@@ -1451,61 +1452,61 @@ namespace FSpot
 			Database.CommitTransaction ();
 			query_widget.PhotoTagsChanged (new Tag [] {t});
 		}
-	
+
 		//
 		// Main menu commands
 		//
-	
+
 		void HandlePageSetupActivated (object o, EventArgs e)
 		{
 			FSpot.Core.Global.PageSetup = Print.RunPageSetupDialog (this.Window, FSpot.Core.Global.PageSetup, null);
 		}
-		
+
 		void HandlePrintCommand (object sender, EventArgs e)
 		{
 			FSpot.PrintOperation print = new FSpot.PrintOperation (SelectedPhotos ());
 			print.Run (PrintOperationAction.PrintDialog, null);
 		}
-	
+
 		public void HandlePreferences (object sender, EventArgs args)
 		{
 			var pref = new PreferenceDialog (GetToplevel (sender));
 			pref.Run ();
 			pref.Destroy ();
 		}
-	
+
 		public void HandleManageExtensions (object sender, EventArgs args)
 		{
 			Mono.Addins.Gui.AddinManagerWindow.Run (main_window);
 		}
-	
+
 		void HandleSendMailCommand (object sender, EventArgs args)
 		{
 			//TestDisplay ();
 			new FSpot.SendEmail (new PhotoList (SelectedPhotos ()), Window);
 		}
-	
+
 		public static void HandleHelp (object sender, EventArgs args)
 		{
 			GtkBeans.Global.ShowUri (App.Instance.Organizer.Window.Screen, "ghelp:f-spot");
 		}
-	
+
 		public static void HandleAbout (object sender, EventArgs args)
 		{
 			FSpot.UI.Dialog.AboutDialog.ShowUp ();
 		}
-	
+
 		void HandleTagSizeChange (object sender, EventArgs args)
 		{
 			RadioAction choice = sender as RadioAction;
-		
+
 			//Get this callback twice. Once for the active going menuitem,
 			//once for the inactive leaving one. Ignore the inactive.
 			if (!choice.Active)
 				return;
-	
+
 			int old_size = TagsIconSize;
-			
+
 			if (choice == tag_icon_hidden) {
 				TagsIconSize = (int) Tag.IconSize.Hidden;
 			} else if (choice == tag_icon_small) {
@@ -1517,7 +1518,7 @@ namespace FSpot
 			} else {
 				return;
 			}
-			
+
 			if (old_size != TagsIconSize) {
 				tag_selection_widget.ColumnsAutosize();
 				if (photo_view != null)
@@ -1525,7 +1526,7 @@ namespace FSpot
 				Preferences.Set (Preferences.TAG_ICON_SIZE, TagsIconSize);
 			}
 		}
-	
+
 		public void HandleFilmstripHorizontal (object sender, EventArgs args)
 		{
 			if (photo_view.FilmstripOrientation == Orientation.Horizontal)
@@ -1533,7 +1534,7 @@ namespace FSpot
 			(sender as Gtk.CheckMenuItem).Active = false;
 			photo_view.PlaceFilmstrip (Orientation.Horizontal);
 		}
-	
+
 		public void HandleFilmstripVertical (object sender, EventArgs args)
 		{
 			if (photo_view.FilmstripOrientation == Orientation.Vertical)
@@ -1541,57 +1542,57 @@ namespace FSpot
 			(sender as Gtk.CheckMenuItem).Active = false;
 			photo_view.PlaceFilmstrip (Orientation.Vertical);
 		}
-	
+
 		public void HandleReverseOrder (object sender, EventArgs args)
 		{
 			ToggleAction item = sender as ToggleAction;
-	
+
 			if (group_selector.Adaptor.OrderAscending == item.Active)
 				return;
-			
+
 			group_selector.Adaptor.OrderAscending = item.Active;
 			query.TimeOrderAsc = item.Active;
-	
+
 			// FIXME this is blah...we need UIManager love here
 			if (item != reverse_order)
 				reverse_order.Active = item.Active;
-			
+
 			//update the selection in the timeline
 			if ( query.Range != null && group_selector.Adaptor is TimeAdaptor) {
 				group_selector.SetLimitsToDates(query.Range.Start, query.Range.End);
-				
+
 			}
-	
+
 		}
-	
-		// Called when the user clicks the X button	
+
+		// Called when the user clicks the X button
 		void HandleDeleteEvent (object sender, DeleteEventArgs args)
 		{
 			Close();
 			args.RetVal = true;
 		}
-	
+
 		void HandleCloseCommand (object sender, EventArgs args)
 		{
 			Close();
 		}
-		
+
 		public void Close ()
 		{
 			int x, y, width, height;
 			main_window.GetPosition (out x, out y);
 			main_window.GetSize (out width, out height);
-	
+
 			bool maximized = ((main_window.GdkWindow.State & Gdk.WindowState.Maximized) > 0);
 			Preferences.Set (Preferences.MAIN_WINDOW_MAXIMIZED, maximized);
-	
+
 			if (!maximized) {
 				Preferences.Set (Preferences.MAIN_WINDOW_X,		x);
 				Preferences.Set (Preferences.MAIN_WINDOW_Y,		y);
 				Preferences.Set (Preferences.MAIN_WINDOW_WIDTH,		width);
 				Preferences.Set (Preferences.MAIN_WINDOW_HEIGHT,	height);
 			}
-	
+
 			Preferences.Set (Preferences.SHOW_TOOLBAR,		toolbar.Visible);
 			Preferences.Set (Preferences.SHOW_SIDEBAR,		info_vbox.Visible);
 			Preferences.Set (Preferences.SHOW_TIMELINE,		display_timeline.Active);
@@ -1599,104 +1600,104 @@ namespace FSpot
 			Preferences.Set (Preferences.SHOW_TAGS,			icon_view.DisplayTags);
 			Preferences.Set (Preferences.SHOW_DATES,		icon_view.DisplayDates);
 			Preferences.Set (Preferences.SHOW_RATINGS,		icon_view.DisplayRatings);
-	
+
 			Preferences.Set (Preferences.GROUP_ADAPTOR_ORDER_ASC,   group_selector.Adaptor.OrderAscending);
 			Preferences.Set (Preferences.GLASS_POSITION,		group_selector.GlassPosition);
-			
+
 			Preferences.Set (Preferences.SIDEBAR_POSITION,		main_hpaned.Position);
 			Preferences.Set (Preferences.ZOOM,			icon_view.Zoom);
-	
+
 			tag_selection_widget.SaveExpandDefaults ();
-	
+
 			this.Window.Destroy ();
 		}
-		
+
 		void HandleCreateVersionCommand (object obj, EventArgs args)
 		{
 			PhotoVersionCommands.Create cmd = new PhotoVersionCommands.Create ();
 			cmd.Execute (Database.Photos, CurrentPhoto, GetToplevel (null));
 		}
-	
+
 		void HandleDeleteVersionCommand (object obj, EventArgs args)
 		{
 			PhotoVersionCommands.Delete cmd = new PhotoVersionCommands.Delete ();
 			cmd.Execute (Database.Photos, CurrentPhoto, GetToplevel (null));
 		}
-		
+
 		void HandleDetachVersionCommand (object obj, EventArgs args)
 		{
 			PhotoVersionCommands.Detach cmd = new PhotoVersionCommands.Detach ();
 			cmd.Execute (Database.Photos, CurrentPhoto, GetToplevel (null));
 			UpdateQuery ();
 		}
-	
+
 		void HandleRenameVersionCommand (object obj, EventArgs args)
 		{
 			PhotoVersionCommands.Rename cmd = new PhotoVersionCommands.Rename ();
 			cmd.Execute (Database.Photos, CurrentPhoto, main_window);
 		}
-		
+
 		public void HandleCreateTagAndAttach (object sender, EventArgs args)
 		{
 			Tag new_tag = CreateTag (sender, args);
-	
+
 			if (new_tag != null)
 				HandleAttachTagMenuSelected (new_tag);
 		}
-	
+
 		public void HandleCreateNewCategoryCommand (object sender, EventArgs args)
 		{
 			Tag new_tag = CreateTag (sender, args);
-			
+
 			if (new_tag != null) {
 				tag_selection_widget.ScrollTo (new_tag);
 				tag_selection_widget.TagHighlight = new Tag [] {new_tag};
 			}
 		}
-	
+
 		public Tag CreateTag (object sender, EventArgs args)
 		{
 			TagCommands.Create command = new TagCommands.Create (Database.Tags);
 			return command.Execute (TagCommands.TagType.Category, tag_selection_widget.TagHighlight);
 		}
-	
+
 		public void HandleAttachTagCommand (object obj, EventArgs args)
 		{
 			AttachTags (tag_selection_widget.TagHighlight, SelectedIds ());
 		}
-	
-		void AttachTags (Tag [] tags, int [] ids) 
+
+		void AttachTags (Tag [] tags, int [] ids)
 		{
 			Database.BeginTransaction ();
 			AddTagExtended (ids, tags);
 			Database.CommitTransaction ();
 			query_widget.PhotoTagsChanged (tags);
 		}
-	
+
 		public void HandleRemoveTagCommand (object obj, EventArgs args)
 		{
 			Tag [] tags = this.tag_selection_widget.TagHighlight;
-	
+
 			Database.BeginTransaction ();
 			RemoveTags (SelectedIds (), tags);
 			Database.CommitTransaction ();
 			query_widget.PhotoTagsChanged (tags);
 		}
-	
+
 		public void HandleEditSelectedTag (object sender, EventArgs ea)
 		{
 			Tag [] tags = this.tag_selection_widget.TagHighlight;
 			if (tags.Length != 1)
 				return;
-	
+
 			HandleEditSelectedTagWithTag (tags [0]);
 		}
-	
+
 		public void HandleEditSelectedTagWithTag (Tag tag)
 		{
 			if (tag == null)
 				return;
-			
+
 			EditTagDialog dialog = new EditTagDialog (Database, tag, main_window);
 			if ((ResponseType)dialog.Run () == ResponseType.Ok) {
 				bool name_changed = false;
@@ -1711,21 +1712,21 @@ namespace FSpot
 					Log.Exception (ex);
 				}
 			}
-	
+
 			dialog.Destroy ();
 		}
-	
+
 		public void HandleMergeTagsCommand (object obj, EventArgs args)
 		{
 			Tag [] tags = this.tag_selection_widget.TagHighlight;
 			if (tags.Length < 2)
 				return;
-			
+
 			// Translators, The singular case will never happen here.
 			string header = Catalog.GetPluralString ("Merge the selected tag",
 									    "Merge the {0} selected tags?", tags.Length);
 			header = String.Format (header, tags.Length);
-	
+
 			// If a tag with children tags is selected for merging, we
 			// should also merge its children..
 			List<Tag> all_tags = new List<Tag> (tags.Length);
@@ -1734,67 +1735,67 @@ namespace FSpot
 					all_tags.Add (tag);
 				else
 					continue;
-	
+
 				if (! (tag is Category))
 					continue;
-	
+
 				(tag as Category).AddDescendentsTo (all_tags);
 			}
-	
+
 			// debug..
 			tags = all_tags.ToArray ();
 			System.Array.Sort (tags, new TagRemoveComparer ());
-	
+
 			foreach (Tag tag in tags) {
 				Log.Debug ("tag: {0}", tag.Name);
 			}
-	
+
 			string msg = Catalog.GetString("This operation will merge the selected tags and any sub-tags into a single tag.");
-	
+
 			string ok_caption = Catalog.GetString ("_Merge Tags");
-			
-			if (ResponseType.Ok != HigMessageDialog.RunHigConfirmation(main_window, 
-										   DialogFlags.DestroyWithParent, 
-										   MessageType.Warning, 
-										   header, 
-										   msg, 
+
+			if (ResponseType.Ok != HigMessageDialog.RunHigConfirmation(main_window,
+										   DialogFlags.DestroyWithParent,
+										   MessageType.Warning,
+										   header,
+										   msg,
 										   ok_caption))
 				return;
-			
+
 			// The surviving tag is the last tag, as it is definitely not a child of any other the
 			// other tags.  removetags will contain the tags to be merged.
 			Tag survivor = tags[tags.Length - 1];
-			
+
 			Tag [] removetags = new Tag [tags.Length - 1];
 			Array.Copy (tags, 0, removetags, 0, tags.Length - 1);
-	
+
 			// Add the surviving tag to all the photos with the other tags
 			Photo [] photos = Database.Photos.Query (removetags);
 			foreach (Photo p in photos) {
 				p.AddTag (survivor);
 			}
-	
+
 			// Remove the defunct tags, which removes them from the photos, commits
 			// the photos, and removes the tags from the TagStore
 			Database.BeginTransaction ();
 			Database.Photos.Remove (removetags);
 			Database.CommitTransaction ();
-	
+
 			HandleEditSelectedTagWithTag (survivor);
 		}
-	
+
 		void HandleAdjustTime (object sender, EventArgs args)
 		{
 			PhotoList list = new PhotoList (Selection.Items);
 			list.Sort (new IBrowsableItemComparer.CompareDateName ());
 			(new AdjustTimeDialog (Database, list)).Run ();
 		}
-	
+
 		public void HideLoupe ()
 		{
 			loupe_menu_item.Active = false;
 		}
-	
+
 		void HandleLoupe (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -1802,10 +1803,10 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-			
+
 			photo_view.View.ShowHideLoupe ();
 		}
-	
+
 		void HandleSharpen (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -1813,10 +1814,10 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-			
+
 			photo_view.View.ShowSharpener ();
 		}
-	
+
 		void HandleDisplayToolbar (object sender, EventArgs args)
 		{
 			if (display_toolbar.Active)
@@ -1824,12 +1825,12 @@ namespace FSpot
 			else
 				toolbar.Hide ();
 		}
-	
+
 		void HandleDisplayTags (object sender, EventArgs args)
 		{
 			icon_view.DisplayTags = !icon_view.DisplayTags;
 		}
-		
+
 		void HandleDisplayDates (object sender, EventArgs args)
 		{
 			// Peg the icon_view's value to the MenuItem's active state,
@@ -1837,12 +1838,12 @@ namespace FSpot
 			// because of logic to hide dates when zoomed way out.
 			icon_view.DisplayDates = display_dates_menu_item.Active;
 		}
-	
+
 		void HandleDisplayRatings (object sender, EventArgs args)
 		{
 			icon_view.DisplayRatings = display_ratings_menu_item.Active;
 		}
-	
+
 		void HandleDisplayGroupSelector (object sender, EventArgs args)
 		{
 			if (group_selector.Visible)
@@ -1850,14 +1851,14 @@ namespace FSpot
 			else
 				group_selector.Show ();
 		}
-	
+
 		void HandleDisplayFilmstrip (object sender, EventArgs args)
 		{
 			photo_view.FilmStripVisibility = display_filmstrip.Active;
 			if (ViewMode == ModeType.PhotoView)
 				photo_view.QueueDraw ();
 		}
-	
+
 		void HandleDisplayInfoSidebar (object sender, EventArgs args)
 		{
 			if (info_vbox.Visible)
@@ -1865,13 +1866,13 @@ namespace FSpot
 			else
 				info_vbox.Show ();
 		}
-	
+
 		void HandleViewSlideShow (object sender, EventArgs args)
 		{
 			HandleViewFullscreen (sender, args);
 			fsview.PlayPause ();
 		}
-	
+
 		void HandleToggleViewBrowse (object sender, EventArgs args)
 		{
 			if (ViewMode == ModeType.IconView)
@@ -1879,7 +1880,7 @@ namespace FSpot
 			else if (browse_button.Active)
 				SetViewMode (ModeType.IconView);
 		}
-	
+
 		void HandleToggleViewPhoto (object sender, EventArgs args)
 		{
 			if (ViewMode == ModeType.PhotoView)
@@ -1887,17 +1888,17 @@ namespace FSpot
 			else if (edit_button.Active)
 				SetViewMode (ModeType.PhotoView);
 		}
-	
+
 		void HandleViewBrowse (object sender, EventArgs args)
 		{
 			SetViewMode (ModeType.IconView);
 		}
-	
+
 		void HandleViewPhoto (object sender, EventArgs args)
 		{
 			SetViewMode (ModeType.PhotoView);
 		}
-	
+
 		void HandleViewFullscreen (object sender, EventArgs args)
 		{
 			int active = (Selection.Count > 0 ? SelectedIds() [0] : 0);
@@ -1910,16 +1911,16 @@ namespace FSpot
 				// FIXME this needs to be another mode like PhotoView and IconView mode.
 				fsview.View.Item.Index = active;
 			}
-			
+
 			fsview.Show ();
 		}
-	
+
 		void HandleFullScreenViewDestroy (object sender, EventArgs args)
 		{
 			JumpTo (fsview.View.Item.Index);
 			fsview = null;
 		}
-		
+
 		void HandleZoomScaleValueChanged (object sender, System.EventArgs args)
 		{
 			switch (ViewMode) {
@@ -1934,22 +1935,22 @@ namespace FSpot
 				icon_view.ZoomChanged += HandleZoomChanged;
 				break;
 			}
-			
+
 			zoom_in.Sensitive = (zoom_scale.Value != 1.0);
 			zoom_out.Sensitive = (zoom_scale.Value != 0.0);
 		}
-		
+
 		void HandleQueryChanged (IBrowsableCollection sender)
 		{
 			if (find_untagged.Active != query.Untagged)
 				find_untagged.Active = query.Untagged;
-			
+
 			clear_date_range.Sensitive = (query.Range != null);
 			clear_rating_filter.Sensitive = (query.RatingRange != null);
 			update_status_label = true;
 			GLib.Idle.Add (UpdateStatusLabel);
 		}
-	
+
 		bool update_status_label;
 		private bool UpdateStatusLabel ()
 		{
@@ -1959,17 +1960,17 @@ namespace FSpot
 				status_label.Text = String.Format (Catalog.GetPluralString ("{0} Photo out of {1}", "{0} Photos out of {1}", query.Count), query.Count, total_photos);
 			else
 				status_label.Text = String.Format (Catalog.GetPluralString ("{0} Photo", "{0} Photos", query.Count), query.Count);
-		
+
 			if ((Selection != null) && (Selection.Count > 0))
 				status_label.Text += String.Format (Catalog.GetPluralString (" ({0} selected)", " ({0} selected)", Selection.Count), Selection.Count);
 			status_label.UseMarkup = true;
 			return update_status_label;
 		}
-		
+
 		void HandleZoomChanged (object sender, System.EventArgs args)
 		{
 			zoom_scale.ValueChanged -= HandleZoomScaleValueChanged;
-	
+
 			double zoom = .5;
 			switch (ViewMode) {
 			case ModeType.PhotoView:
@@ -1980,36 +1981,36 @@ namespace FSpot
 				zoom = icon_view.Zoom;
 				if (zoom == 0.0 || zoom == 100.0 || zoom != zoom_scale.Value)
 					zoom_scale.Value = zoom;
-	
+
 				break;
 			}
-			
+
 			zoom_in.Sensitive = (zoom != 1.0);
 			zoom_out.Sensitive = (zoom != 0.0);
-			
+
 			zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
 		}
-	
+
 		void HandleZoomOut (object sender, ButtonPressEventArgs args)
 		{
 			ZoomOut ();
 		}
-		
+
 		void HandleZoomOut (object sender, EventArgs args)
 		{
 			ZoomOut ();
 		}
-		
+
 		void HandleZoomIn (object sender, ButtonPressEventArgs args)
 		{
 			ZoomIn ();
 		}
-		
+
 		void HandleZoomIn (object sender, EventArgs args)
 		{
 			ZoomIn ();
 		}
-		
+
 		private void ZoomOut ()
 		{
 			switch (ViewMode) {
@@ -2021,7 +2022,7 @@ namespace FSpot
 				break;
 			}
 		}
-		
+
 		private void ZoomIn ()
 		{
 			switch (ViewMode) {
@@ -2032,49 +2033,49 @@ namespace FSpot
 				} catch {
 					photo_view.Zoom = old_zoom;
 				}
-				
+
 				break;
 			case ModeType.IconView:
 				icon_view.ZoomIn ();
 				break;
 			}
 		}
-	
+
 		public void DeleteException (Exception e, string fname)
 		{
 			string ok_caption = Catalog.GetString ("_Ok");
 			string error = Catalog.GetString ("Error Deleting Picture");
 			string msg;
-	
+
 			if (e is UnauthorizedAccessException)
 				msg = String.Format (
-					Catalog.GetString ("No permission to delete the file:{1}{0}"), 
+					Catalog.GetString ("No permission to delete the file:{1}{0}"),
 					fname, Environment.NewLine).Replace ("_", "__");
 			else
 				msg = String.Format (
 					Catalog.GetString ("An error of type {0} occurred while deleting the file:{2}{1}"),
 					e.GetType (), fname.Replace ("_", "__"), Environment.NewLine);
-			
+
 			HigMessageDialog.RunHigConfirmation (
 				main_window, DialogFlags.DestroyWithParent, MessageType.Error,
 				error, msg, ok_caption);
 		}
-	
+
 		public Gtk.Window GetToplevel (object sender)
 		{
 			Widget wsender = sender as Widget;
 			Gtk.Window toplevel = null;
-	
+
 			if (wsender != null && !(wsender is MenuItem))
 				toplevel = (Gtk.Window) wsender.Toplevel;
 			else if (fsview != null)
 				toplevel = fsview;
-			else 
+			else
 				toplevel = main_window;
-	
+
 			return toplevel;
 		}
-	
+
 		public void HandleDeleteCommand (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -2082,22 +2083,22 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-			
-	   		Photo[] photos = SelectedPhotos();
-	   		string header = Catalog.GetPluralString ("Delete the selected photo permanently?", 
-									    "Delete the {0} selected photos permanently?", 
+
+			Photo[] photos = SelectedPhotos();
+			string header = Catalog.GetPluralString ("Delete the selected photo permanently?",
+									    "Delete the {0} selected photos permanently?",
 									    photos.Length);
 			header = String.Format (header, photos.Length);
-			string msg = Catalog.GetPluralString ("This deletes all versions of the selected photo from your drive.", 
-									 "This deletes all versions of the selected photos from your drive.", 
+			string msg = Catalog.GetPluralString ("This deletes all versions of the selected photo from your drive.",
+									 "This deletes all versions of the selected photos from your drive.",
 									 photos.Length);
 			string ok_caption = Catalog.GetPluralString ("_Delete photo", "_Delete photos", photos.Length);
-			
-			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(GetToplevel (sender), 
-										   DialogFlags.DestroyWithParent, 
-										   MessageType.Warning, 
-										   header, msg, ok_caption)) {                              
-				
+
+			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(GetToplevel (sender),
+										   DialogFlags.DestroyWithParent,
+										   MessageType.Warning,
+										   header, msg, ok_caption)) {
+
 				uint timer = Log.DebugTimerStart ();
 				foreach (Photo photo in photos) {
 					foreach (uint id in photo.VersionIds) {
@@ -2109,12 +2110,12 @@ namespace FSpot
 					}
 				}
 				Database.Photos.Remove (photos);
-				
+
 				UpdateQuery ();
 				Log.DebugTimerPrint (timer, "HandleDeleteCommand took {0}");
 			}
 		}
-	
+
 		public void HandleRemoveCommand (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -2122,25 +2123,25 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-	
-	   		Photo[] photos = SelectedPhotos();
-			if (photos.Length == 0) 
+
+			Photo[] photos = SelectedPhotos();
+			if (photos.Length == 0)
 				return;
-	
-	   		string header = Catalog.GetPluralString ("Remove the selected photo from F-Spot?",
-									    "Remove the {0} selected photos from F-Spot?", 
+
+			string header = Catalog.GetPluralString ("Remove the selected photo from F-Spot?",
+									    "Remove the {0} selected photos from F-Spot?",
 									    photos.Length);
-	
+
 			header = String.Format (header, photos.Length);
 			string msg = Catalog.GetString("If you remove photos from the F-Spot catalog all tag information will be lost. The photos remain on your computer and can be imported into F-Spot again.");
 			string ok_caption = Catalog.GetString("_Remove from Catalog");
-			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(GetToplevel (sender), DialogFlags.DestroyWithParent, 
-										   MessageType.Warning, header, msg, ok_caption)) {                              
+			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(GetToplevel (sender), DialogFlags.DestroyWithParent,
+										   MessageType.Warning, header, msg, ok_caption)) {
 				Database.Photos.Remove (photos);
 				UpdateQuery ();
 			}
 		}
-	
+
 		void HandleSelectAllCommand (object sender, EventArgs args)
 		{
 			if (Window.Focus is Editable) {
@@ -2151,7 +2152,7 @@ namespace FSpot
 			icon_view.SelectAllCells ();
 			UpdateStatusLabel ();
 		}
-	
+
 		void HandleSelectNoneCommand (object sender, EventArgs args)
 		{
 			icon_view.Selection.Clear ();
@@ -2163,85 +2164,85 @@ namespace FSpot
 			icon_view.Selection.SelectionInvert ();
 			UpdateStatusLabel ();
 		}
-	
+
 		// This ConnectBefore is needed because otherwise the editability of the name
 		// column will steal returns, spaces, and clicks if the tag name is focused
 		[GLib.ConnectBefore]
 		public void HandleTagSelectionKeyPress (object sender, Gtk.KeyPressEventArgs args)
 		{
 			args.RetVal = true;
-	
+
 			switch (args.Event.Key) {
 			case Gdk.Key.Delete:
 				HandleDeleteSelectedTagCommand (sender, (EventArgs) args);
 				break;
-			
+
 			case Gdk.Key.space:
 			case Gdk.Key.Return:
 			case Gdk.Key.KP_Enter:
 				ShowQueryWidget ();
 				query_widget.Include (tag_selection_widget.TagHighlight);
 				break;
-	
+
 			case Gdk.Key.F2:
 				tag_selection_widget.EditSelectedTagName ();
 				break;
-			
+
 			default:
 				args.RetVal = false;
 				break;
 			}
 		}
-	
+
 		public void HandleDeleteSelectedTagCommand (object sender, EventArgs args)
 		{
 			Tag [] tags = this.tag_selection_widget.TagHighlight;
-	
+
 			System.Array.Sort (tags, new TagRemoveComparer ());
-		
+
 			//How many pictures are associated to these tags?
 			Db db = App.Instance.Database;
 			FSpot.PhotoQuery count_query = new FSpot.PhotoQuery(db.Photos);
 			count_query.Terms = FSpot.OrTerm.FromTags(tags);
 			int associated_photos = count_query.Count;
-	
+
 			string header;
 			if (tags.Length == 1)
 				header = String.Format (Catalog.GetString ("Delete tag \"{0}\"?"), tags [0].Name.Replace ("_", "__"));
 			else
 				header = String.Format (Catalog.GetString ("Delete the {0} selected tags?"), tags.Length);
-			
+
 			header = String.Format (header, tags.Length);
 			string msg = String.Empty;
 			if (associated_photos > 0) {
 				string photodesc = Catalog.GetPluralString ("photo", "photos", associated_photos);
-				msg = String.Format( 
+				msg = String.Format(
 					Catalog.GetPluralString("If you delete this tag, the association with {0} {1} will be lost.",
 								"If you delete these tags, the association with {0} {1} will be lost.",
 								tags.Length),
 					associated_photos, photodesc);
 			}
 			string ok_caption = Catalog.GetPluralString ("_Delete tag", "_Delete tags", tags.Length);
-			
-			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(main_window, 
-										   DialogFlags.DestroyWithParent, 
-										   MessageType.Warning, 
-										   header, 
-										   msg, 
-										   ok_caption)) {                              
-				try { 				
+
+			if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(main_window,
+										   DialogFlags.DestroyWithParent,
+										   MessageType.Warning,
+										   header,
+										   msg,
+										   ok_caption)) {
+				try {
 					db.Photos.Remove (tags);
 				} catch (InvalidTagOperationException e) {
 					Log.Debug ("this is something or another");
-	
+
 					// A Category is not empty. Can not delete it.
 					string error_msg = Catalog.GetString ("Tag is not empty");
-					string error_desc = String.Format (Catalog.GetString ("Can not delete tags that have tags within them.  " + 
+					string error_desc = String.Format (Catalog.GetString ("Can not delete tags that have tags within them.  " +
 													 "Please delete tags under \"{0}\" first"),
 									   e.Tag.Name.Replace ("_", "__"));
-					
-					HigMessageDialog md = new HigMessageDialog (main_window, DialogFlags.DestroyWithParent, 
-										    Gtk.MessageType.Error, ButtonsType.Ok, 
+
+					HigMessageDialog md = new HigMessageDialog (main_window, DialogFlags.DestroyWithParent,
+										    Gtk.MessageType.Error, ButtonsType.Ok,
 										    error_msg,
 										    error_desc);
 					md.Run ();
@@ -2249,16 +2250,16 @@ namespace FSpot
 				}
 			}
 		}
-	
+
 		void HandleUpdateThumbnailCommand (object sender, EventArgs args)
 		{
 			ThumbnailCommand command = new ThumbnailCommand (main_window);
-	
+
 			int [] selected_ids = SelectedIds ();
 			if (command.Execute (SelectedPhotos (selected_ids)))
 				query.MarkChanged (selected_ids, InvalidateData.Instance);
 		}
-	
+
 		public void HandleRotate90Command (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -2266,10 +2267,10 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-			
+
 			RotateSelectedPictures (GetToplevel (sender), RotateDirection.Clockwise);
 		}
-	
+
 		public void HandleRotate270Command (object sender, EventArgs args)
 		{
 			// Don't steal characters from any text entries
@@ -2277,10 +2278,10 @@ namespace FSpot
 				Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
 				return;
 			}
-	
+
 			RotateSelectedPictures (GetToplevel (sender), RotateDirection.Counterclockwise);
 		}
-	
+
 		public void HandleCopy (object sender, EventArgs args)
 		{
 			Clipboard primary = Clipboard.Get (Atom.Intern ("PRIMARY", false));
@@ -2305,78 +2306,78 @@ namespace FSpot
 						data.Text = String.Join (" ", paths.ToArray ());
 						data.SetUris (String.Join (" ", uris.ToArray ()));
 						data.Set (Atom.Intern ("x-special/gnome-copied-files", true), 8, System.Text.Encoding.UTF8.GetBytes ("copy\n" + String.Join ("\n", uris.ToArray ())));
-						
+
 					},
 					delegate {});
-	
+
 			var pt = new List<string> ();
 			foreach (Photo p in SelectedPhotos ()) {
 				pt.Add (System.IO.Path.GetFullPath (p.DefaultVersion.Uri.LocalPath));
 			}
-			
+
 			primary.Text = String.Join (" ", pt.ToArray ());
 		}
-	
+
 		void HandleSetAsBackgroundCommand (object sender, EventArgs args)
 		{
 			Photo current = CurrentPhoto;
-	
+
 			if (current == null)
 				return;
-	
+
 			Desktop.SetBackgroundImage (current.DefaultVersion.Uri.LocalPath);
 		}
-	
+
 		void HandleSetDateRange (object sender, EventArgs args) {
 			var date_range_dialog = new DateRangeDialog (query.Range, main_window);
 			if ((ResponseType)date_range_dialog.Run () == ResponseType.Ok)
 				query.Range = date_range_dialog.Range;
 			date_range_dialog.Destroy ();
-	
+
 			//update the TimeLine
-			if (group_selector.Adaptor is TimeAdaptor && query.Range != null) 
+			if (group_selector.Adaptor is TimeAdaptor && query.Range != null)
 				group_selector.SetLimitsToDates(query.Range.Start, query.Range.End);
 		}
-	
+
 		public void HandleClearDateRange (object sender, EventArgs args) {
 			if (group_selector.Adaptor is FSpot.TimeAdaptor) {
 				group_selector.ResetLimits();
 			}
 			query.Range = null;
 		}
-	
+
 		void HandleSelectLastRoll (object sender, EventArgs args) {
 			query.RollSet = new RollSet (Database.Rolls.GetRolls (1));
 		}
-	
+
 		void HandleSelectRolls (object sender, EventArgs args) {
 			new LastRolls (query, Database.Rolls, main_window);
 		}
-	
+
 		void HandleClearRollFilter (object sender, EventArgs args) {
 			query.RollSet = null;
 		}
-	
+
 		void HandleSetRatingFilter (object sender, EventArgs args) {
 			new RatingFilterDialog (query, main_window);
 		}
-	
+
 		public void HandleClearRatingFilter (object sender, EventArgs args) {
 			query.RatingRange = null;
 		}
-	
+
 		void HandleFindUntagged (object sender, EventArgs args) {
 			if (query.Untagged == find_untagged.Active)
 				return;
-	
+
 			query.Untagged = !query.Untagged;
 		}
-		
+
 		void OnPreferencesChanged (object sender, NotifyEventArgs args)
 		{
 			LoadPreference (args.Key);
 		}
-	
+
 		void LoadPreference (String key)
 		{
 			switch (key) {
@@ -2386,97 +2387,97 @@ namespace FSpot
 				else
 					main_window.Unmaximize ();
 				break;
-	
+
 			case Preferences.MAIN_WINDOW_X:
 			case Preferences.MAIN_WINDOW_Y:
 				main_window.Move(Preferences.Get<int> (Preferences.MAIN_WINDOW_X),
 						 Preferences.Get<int> (Preferences.MAIN_WINDOW_Y));
 				break;
-			
+
 			case Preferences.MAIN_WINDOW_WIDTH:
 			case Preferences.MAIN_WINDOW_HEIGHT:
 				if (Preferences.Get<int> (Preferences.MAIN_WINDOW_WIDTH) > 0 &&
 							  Preferences.Get<int> (Preferences.MAIN_WINDOW_HEIGHT) > 0)
 					main_window.Resize(Preferences.Get<int> (Preferences.MAIN_WINDOW_WIDTH),
 							   Preferences.Get<int> (Preferences.MAIN_WINDOW_HEIGHT));
-	
+
 				break;
-			
+
 			case Preferences.SHOW_TOOLBAR:
 				if (display_toolbar.Active != Preferences.Get<bool> (key))
 					display_toolbar.Active = Preferences.Get<bool> (key);
 				break;
-			
+
 			case Preferences.SHOW_SIDEBAR:
 				if (display_sidebar.Active != Preferences.Get<bool> (key))
 					display_sidebar.Active = Preferences.Get<bool> (key);
 				break;
-			
+
 			case Preferences.SHOW_TIMELINE:
 				if (display_timeline.Active != Preferences.Get<bool> (key))
 					display_timeline.Active = Preferences.Get<bool> (key);
 				break;
-			
+
 			case Preferences.SHOW_FILMSTRIP:
 				if (display_filmstrip.Active != Preferences.Get<bool> (key)) {
 					display_filmstrip.Active = Preferences.Get<bool> (key);
 				}
 				break;
-			
+
 			case Preferences.SHOW_TAGS:
 				if (display_tags_menu_item.Active != Preferences.Get<bool> (key))
 					display_tags_menu_item.Active = Preferences.Get<bool> (key);
 				break;
-			
+
 			case Preferences.SHOW_DATES:
 				if (display_dates_menu_item.Active != Preferences.Get<bool> (key))
 					display_dates_menu_item.Active = Preferences.Get<bool> (key);
 					//display_dates_menu_item.Toggle ();
 				break;
-			
+
 			case Preferences.SHOW_RATINGS:
 				if (display_ratings_menu_item.Active != Preferences.Get<bool> (key))
 					display_ratings_menu_item.Active = Preferences.Get<bool> (key);
 				break;
-	
+
 			case Preferences.GROUP_ADAPTOR_ORDER_ASC:
 				group_selector.Adaptor.OrderAscending = Preferences.Get<bool> (key);
 				reverse_order.Active = Preferences.Get<bool> (key);
 				query.TimeOrderAsc = group_selector.Adaptor.OrderAscending;
 				break;
-	
+
 			case Preferences.GLASS_POSITION:
 				if (query.Count > 0) {
 					// If the database has changed since this pref was saved, this could cause
 					// an exception to be thrown.
 					try {
 						IBrowsableItem photo = group_selector.Adaptor.PhotoFromIndex (Preferences.Get<int> (key));
-						
+
 						if (photo != null)
 							JumpTo (query.IndexOf (photo));
 					} catch (Exception) {}
 				}
-	
+
 				icon_view.GrabFocus ();
 				break;
 			case Preferences.SIDEBAR_POSITION:
 				if (main_hpaned.Position !=Preferences.Get<int> (key) )
 					main_hpaned.Position = Preferences.Get<int> (key);
 				break;
-	
+
 			case Preferences.TAG_ICON_SIZE:
 				int s = Preferences.Get<int> (key);
 				tag_icon_hidden.Active = (s == (int) Tag.IconSize.Hidden);
 				tag_icon_small.Active = (s == (int) Tag.IconSize.Small);
 				tag_icon_medium.Active = (s == (int) Tag.IconSize.Medium);
 				tag_icon_large.Active = (s == (int) Tag.IconSize.Large);
-	
+
 				break;
-	
+
 			case Preferences.ZOOM:
 				icon_view.Zoom = Preferences.Get<double> (key);
 				break;
-			
+
 			case Preferences.METADATA_EMBED_IN_IMAGE:
 				write_metadata =Preferences.Get<bool> (key) ;
 				break;
@@ -2485,9 +2486,9 @@ namespace FSpot
 				break;
 			}
 		}
-	
+
 		// Version Id updates.
-	
+
 		void UpdateForVersionChange (IBrowsableItemVersion version)
 		{
 			IBrowsableItemVersionable versionable = CurrentPhoto as IBrowsableItemVersionable;
@@ -2497,9 +2498,9 @@ namespace FSpot
 				query.Commit (ActiveIndex ());
 			}
 		}
-	
+
 		// Queries.
-	
+
 		public void UpdateQuery ()
 		{
 			main_window.GdkWindow.Cursor = watch;
@@ -2507,43 +2508,43 @@ namespace FSpot
 			query.RequestReload ();
 			main_window.GdkWindow.Cursor = null;
 		}
-	
+
 		void HandleTagSelectionChanged (object obj, EventArgs args)
 		{
 			UpdateMenus ();
 		}
-	
+
 		public bool TagIncluded (Tag tag)
 		{
 			return query_widget.TagIncluded (tag);
 		}
-		
+
 		public bool TagRequired (Tag tag)
 		{
 			return query_widget.TagRequired (tag);
 		}
-	
+
 		private void HandleQueryLogicChanged (object sender, EventArgs args)
 		{
 			HandleFindAddTagWith (null, null);
 		}
-		
+
 		public void HandleIncludeTag (object sender, EventArgs args)
 		{
 			ShowQueryWidget ();
 			query_widget.Include (tag_selection_widget.TagHighlight);
 		}
-		
+
 		public void HandleUnIncludeTag (object sender, EventArgs args)
 		{
 			query_widget.UnInclude (tag_selection_widget.TagHighlight);
-	 	}
-		
+		}
+
 		void HandleFindByTag (object sender, EventArgs args)
 		{
 			UpdateFindByTagMenu ();
 		}
-		
+
 		public void UpdateFindByTagMenu ()
 		{
 			if (query_widget.Visible) {
@@ -2552,45 +2553,45 @@ namespace FSpot
 				ShowQueryWidget ();
 			}
 		}
-		
+
 		void HandleFindAddTagWith (object sender, EventArgs args)
 		{
 			MenuItem find_add_tag_with = uimanager.GetWidget ("/ui/menubar1/find/find_add_tag_with") as MenuItem;
 			if (find_add_tag_with.Submenu != null)
 				find_add_tag_with.Submenu.Dispose ();
-			
+
 			Gtk.Menu submenu = FSpot.TermMenuItem.GetSubmenu (tag_selection_widget.TagHighlight);
 			find_add_tag_with.Sensitive = (submenu != null);
-			if (submenu != null) 
-				find_add_tag_with.Submenu = submenu;	
+			if (submenu != null)
+				find_add_tag_with.Submenu = submenu;
 		}
-		
+
 		public void HandleAddTagToTerm (object sender, EventArgs args)
 		{
 			MenuItem item = sender as MenuItem;
-			
+
 			int item_pos = 0;
 			foreach (MenuItem i in (item.Parent as Menu).Children) {
 				if (item == i) {
 					break;
 				}
-				
+
 				item_pos++;
 			}
 			// account for All and separator menu items
 			item_pos -= 2;
-			
+
 			FSpot.Term parent_term = (FSpot.Term) FSpot.LogicWidget.Root.SubTerms [item_pos];
-			
+
 			if (FSpot.LogicWidget.Box != null) {
 				FSpot.Literal after = parent_term.Last as FSpot.Literal;
 				FSpot.LogicWidget.Box.InsertTerm (tag_selection_widget.TagHighlight, parent_term, after);
 			}
 		}
-		
+
 		//
-		// Handle Main Menu 
-	
+		// Handle Main Menu
+
 		void UpdateMenus ()
 		{
 			int tags_selected = tag_selection_widget.Selection.CountSelectedRows ();
@@ -2598,22 +2599,22 @@ namespace FSpot
 			bool active_selection = Selection.Count > 0;
 			bool single_active = CurrentPhoto != null;
 			MenuItem version_menu_item = uimanager.GetWidget ("/ui/menubar1/file1/version_menu_item") as MenuItem;
-			
+
 			if (!single_active) {
 				version_menu_item.Sensitive = false;
 				version_menu_item.Submenu = new Menu ();
-	
+
 				create_version_menu_item.Sensitive = false;
 				delete_version_menu_item.Sensitive = false;
 				detach_version_menu_item.Sensitive = false;
 				rename_version_menu_item.Sensitive = false;
-	
+
 				sharpen.Sensitive = false;
 				loupe_menu_item.Sensitive = false;
 			} else {
 				version_menu_item.Sensitive = true;
 				create_version_menu_item.Sensitive = true;
-				
+
 				if (CurrentPhoto.DefaultVersionId == Photo.OriginalVersionId) {
 					delete_version_menu_item.Sensitive = false;
 					detach_version_menu_item.Sensitive = false;
@@ -2623,97 +2624,97 @@ namespace FSpot
 					detach_version_menu_item.Sensitive = true;
 					rename_version_menu_item.Sensitive = true;
 				}
-	
+
 				versions_submenu = new PhotoVersionMenu (CurrentPhoto);
 				versions_submenu.VersionChanged += delegate (PhotoVersionMenu menu) { UpdateForVersionChange (menu.Version);};
 				version_menu_item.Submenu = versions_submenu;
-	
+
 				sharpen.Sensitive = (ViewMode == ModeType.IconView ? false : true);
 				loupe_menu_item.Sensitive = (ViewMode == ModeType.IconView ? false : true);
 			}
-	
+
 			set_as_background.Sensitive = single_active;
 			adjust_time.Sensitive = active_selection;
-	
+
 			attach_tag.Sensitive = active_selection;
 			remove_tag.Sensitive = active_selection;
-	
+
 			rotate_left.Sensitive = active_selection;
 			rotate_right.Sensitive = active_selection;
 			update_thumbnail.Sensitive = active_selection;
 			delete_from_drive.Sensitive = active_selection;
-			
+
 			send_mail.Sensitive = active_selection;
 			print.Sensitive = active_selection;
 			select_none.Sensitive = active_selection;
 			copy.Sensitive = active_selection;
 			remove_from_catalog.Sensitive = active_selection;
-			
+
 			clear_rating_filter.Sensitive = (query.RatingRange != null);
-	
+
 			clear_roll_filter.Sensitive = (query.RollSet != null);
-			
+
 			delete_selected_tag.Sensitive = tag_sensitive;
 			edit_selected_tag.Sensitive = tag_sensitive;
-	
-	
+
+
 			attach_tag_to_selection.Sensitive = tag_sensitive && active_selection;
 			remove_tag_from_selection.Sensitive = tag_sensitive && active_selection;
-		
+
 			export.Sensitive = active_selection;
-	
+
 			MenuItem toolsmenu = uimanager.GetWidget ("/ui/menubar1/tools") as MenuItem;
 			try {
 				tools.Visible = (toolsmenu.Submenu as Menu).Children.Length > 0;
 			} catch {
 				tools.Visible = false;
 			}
-	
+
 			if (rl_button != null) {
 				if (Selection.Count == 0) {
 					rl_button.Sensitive = false;
 					rl_button.TooltipText = String.Empty;
 				} else {
 					rl_button.Sensitive = true;
-	
+
 					string msg = Catalog.GetPluralString ("Rotate selected photo left",
 									      "Rotate selected photos left", Selection.Count);
 					rl_button.TooltipText = String.Format (msg, Selection.Count);
 				}
 			}
-			
+
 			if (rr_button != null) {
 				if (Selection.Count == 0) {
 					rr_button.Sensitive = false;
 					rr_button.TooltipText = String.Empty;
 				} else {
 					rr_button.Sensitive = true;
-	
+
 					string msg = Catalog.GetPluralString ("Rotate selected photo right",
 									      "Rotate selected photos right", Selection.Count);
 					rr_button.TooltipText = String.Format (msg, Selection.Count);
 				}
 			}
-	
+
 			//if (last_tags_selected_count != tags_selected) {
 			MenuItem find_add_tag = uimanager.GetWidget ("/ui/menubar1/find/find_add_tag") as MenuItem;
 			MenuItem find_add_tag_with = uimanager.GetWidget ("/ui/menubar1/find/find_add_tag_with") as MenuItem;
-	
+
 			((Gtk.Label)find_add_tag.Child).TextWithMnemonic = String.Format (
 				Catalog.GetPluralString ("Find _Selected Tag", "Find _Selected Tags", tags_selected), tags_selected
 			);
-	
+
 			((Gtk.Label)find_add_tag_with.Child).TextWithMnemonic = String.Format (
 				Catalog.GetPluralString ("Find Selected Tag _With", "Find Selected Tags _With", tags_selected), tags_selected
 			);
-	
+
 			find_add_tag.Sensitive = tag_sensitive;
 			find_add_tag_with.Sensitive = tag_sensitive && find_add_tag_with.Submenu != null;
-	
+
 			//last_tags_selected_count = tags_selected;
 			//}
 		}
-	
+
 		void PopulateExtendableMenus (object o, EventArgs args)
 		{
 			MenuItem exportmenu = uimanager.GetWidget ("/ui/menubar1/file1/export") as MenuItem;
@@ -2723,52 +2724,52 @@ namespace FSpot
 					exportmenu.Submenu.Dispose ();
 				if (toolsmenu.Submenu != null)
 					toolsmenu.RemoveSubmenu ();
-	
+
 				exportmenu.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetSubmenu ();
 				exportmenu.Submenu.ShowAll ();
-	
+
 				toolsmenu.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Tools") as FSpot.Extensions.SubmenuNode).GetSubmenu ();
 				toolsmenu.Submenu.ShowAll ();
-	
+
 				tools.Visible = (toolsmenu.Submenu as Menu).Children.Length > 0;
 			} catch {
 				Log.Warning ("There's (maybe) something wrong with some of the installed extensions. You can try removing the directory addin-db-000 from ~/.config/f-spot/");
 				toolsmenu.Visible = false;
 			}
 		}
-	
+
 		public void HandleOpenWith (object sender, ApplicationActivatedEventArgs e)
 		{
 			GLib.AppInfo application = e.AppInfo;
 			Photo[] selected = SelectedPhotos ();
-	
+
 			if (selected == null || selected.Length < 1)
 				return;
-	
-			string header = Catalog.GetPluralString ("Create New Version?", "Create New Versions?", selected.Length); 
+
+			string header = Catalog.GetPluralString ("Create New Version?", "Create New Versions?", selected.Length);
 			string msg = String.Format (Catalog.GetPluralString (
 					"Before launching {1}, should F-Spot create a new version of the selected photo to preserve the original?",
 					"Before launching {1}, should F-Spot create new versions of the selected photos to preserve the originals?", selected.Length),
 					selected.Length, application.Name);
-	
+
 			// FIXME add cancel button? add help button?
-			HigMessageDialog hmd = new HigMessageDialog(GetToplevel (sender), DialogFlags.DestroyWithParent, 
+			HigMessageDialog hmd = new HigMessageDialog(GetToplevel (sender), DialogFlags.DestroyWithParent,
 								    MessageType.Question, Gtk.ButtonsType.None,
 								    header, msg);
-	
+
 			hmd.AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
 			//hmd.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
 			hmd.AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
-	
+
 			bool support_xcf = false;;
-			if (application.Id == "gimp.desktop") 
+			if (application.Id == "gimp.desktop")
 				foreach (Gdk.PixbufFormat format in Gdk.Pixbuf.Formats)
 					if (format.Name == "xcf")
 						support_xcf = true;
-	
+
 			//This allows creating a version with a .xcf extension.
 			//There's no need to convert the file to xcf file format, gimp will take care of this
-			if (support_xcf) {	
+			if (support_xcf) {
 				CheckButton cb = new CheckButton (Catalog.GetString ("XCF version"));
 				cb.Active = Preferences.Get<bool> (Preferences.EDIT_CREATE_XCF_VERSION);
 				hmd.VBox.Add (cb);
@@ -2777,26 +2778,26 @@ namespace FSpot
 				};
 				cb.Show ();
 			}
-	
+
 			Gtk.ResponseType response = Gtk.ResponseType.Cancel;
-	
+
 			try {
 				response = (Gtk.ResponseType) hmd.Run();
 			} finally {
 				hmd.Destroy ();
 			}
-			
+
 			bool create_xcf = false;
 			if (support_xcf)
 				create_xcf = Preferences.Get<bool> (Preferences.EDIT_CREATE_XCF_VERSION);
-	
+
 			Log.DebugFormat ("XCF ? {0}", create_xcf);
-	
+
 			if (response == Gtk.ResponseType.Cancel)
 				return;
-	
+
 			bool create_new_versions = (response == Gtk.ResponseType.Yes);
-	
+
 			ArrayList errors = new ArrayList ();
 			GLib.List uri_list = new GLib.List (typeof (string));
 			foreach (Photo photo in selected) {
@@ -2808,58 +2809,58 @@ namespace FSpot
 				} catch (Exception ex) {
 					errors.Add (new EditException (photo, ex));
 				}
-	
+
 				uri_list.Append (photo.DefaultVersion.Uri.ToString ());
 			}
-	
+
 			// FIXME need to clean up the error dialog here.
 			if (errors.Count > 0) {
 				Dialog md = new EditExceptionDialog (GetToplevel (sender), errors.ToArray (typeof (EditException)) as EditException []);
 				md.Run ();
 				md.Destroy ();
 			}
-	
+
 			if (create_new_versions)
 				Database.Photos.Commit (selected);
-	
+
 			try {
 				application.LaunchUris (uri_list, null);
 			} catch (System.Exception) {
 				Log.ErrorFormat ("Failed to lauch {0}", application.Name);
 			}
 		}
-	
+
 		public void GetWidgetPosition(Widget widget, out int x, out int y)
 		{
 			main_window.GdkWindow.GetOrigin(out x, out y);
-			
+
 			x += widget.Allocation.X;
 			y += widget.Allocation.Y;
 		}
-	
+
 		// Tag typing ...
-	
+
 		private void UpdateTagEntryFromSelection ()
 		{
 			if (!tagbar.Visible)
 				return;
 			tag_entry.UpdateFromSelection (SelectedPhotos ());
 		}
-	
+
 		public void HandlePossibleTagTyping (object sender, Gtk.KeyPressEventArgs args)
 		{
 			if (Selection.Count == 0 || tagbar.Visible && tag_entry.HasFocus)
 				return;
-	
+
 			if (args.Event.Key != Gdk.Key.t)
 				return;
-	
+
 			tagbar.Show ();
 			UpdateTagEntryFromSelection ();
 			tag_entry.GrabFocus ();
 			tag_entry.SelectRegion (-1, -1);
 		}
-	
+
 		// "Activate" means the user pressed the enter key
 		public void HandleTagEntryActivate (object sender, EventArgs args)
 		{
@@ -2870,13 +2871,13 @@ namespace FSpot
 			       photo_view.View.GrabFocus ();
 		       }
 		}
-	
+
 		private void HandleTagEntryTagsAttached (object o, string [] new_tags)
 		{
 			int [] selected_photos = SelectedIds ();
 			if (selected_photos == null || new_tags == null || new_tags.Length == 0)
 				return;
-	
+
 			Category default_category = null;
 			Tag [] selection = tag_selection_widget.TagHighlight;
 			if (selection.Length > 0) {
@@ -2899,57 +2900,57 @@ namespace FSpot
 			AddTagExtended (selected_photos, tags);
 			Database.CommitTransaction ();
 		}
-	
+
 		private void HandleTagEntryRemoveTags (object o, Tag [] remove_tags)
 		{
 			int [] selected_photos = SelectedIds ();
 			if (selected_photos == null || remove_tags == null || remove_tags.Length == 0)
 				return;
-	
+
 			Database.BeginTransaction ();
 			RemoveTags (selected_photos, remove_tags);
 			Database.CommitTransaction ();
 		}
-	
+
 		private void HideTagbar ()
 		{
 			if (! tagbar.Visible)
 				return;
-			
+
 			UpdateTagEntryFromSelection ();
-	
+
 			// Cancel any pending edits...
 			tagbar.Hide ();
-	
+
 			if (ViewMode == ModeType.IconView)
 				icon_view.GrabFocus ();
 			else {
 				photo_view.QueueDraw ();
 				photo_view.View.GrabFocus ();
 			}
-	
+
 			tag_entry.ClearTagCompletions ();
 		}
-	
+
 		public void HandleTagBarCloseButtonPressed (object sender, EventArgs args)
 		{
 			HideTagbar ();
 		}
-	
+
 		public void HandleTagEntryKeyPressEvent (object sender, Gtk.KeyPressEventArgs args)
 		{
 			args.RetVal = false;
-	
-			if (args.Event.Key == Gdk.Key.Escape) { 
+
+			if (args.Event.Key == Gdk.Key.Escape) {
 				HideTagbar ();
 				args.RetVal = true;
 			}
 		}
-	
+
 		public List<string> SelectedMimeTypes ()
 		{
 			List<string> contents = new List<string> ();
-	
+
 			foreach (Photo p in SelectedPhotos ()) {
 				string content;
 				try {
@@ -2957,48 +2958,48 @@ namespace FSpot
 				} catch (GLib.GException) {
 					content = null;
 				}
-	
+
 				if (! contents.Contains (content))
 					contents.Add (content);
 			}
-	
+
 			return contents;
 		}
-	
+
 		private void ShowQueryWidget ()
 		{
 			if (find_bar.Visible) {
 				find_bar.Entry.Text = String.Empty;
 				find_bar.Hide ();
 			}
-			
+
 			query_widget.ShowBar ();
 			return;
 		}
-	
+
 		public void HideSidebar (object o, EventArgs args) {
 			display_sidebar.Active = false;
 		}
-		
+
 		public void HandleKeyPressEvent (object sender, Gtk.KeyPressEventArgs args)
 		{
 			bool ctrl = ModifierType.ControlMask == (args.Event.State & ModifierType.ControlMask);
-	
+
 			if ((ctrl && args.Event.Key == Gdk.Key.F) || args.Event.Key == Gdk.Key.slash) {
 				if (!find_bar.Visible) {
 					if (query_widget.Visible) {
 						query_widget.Close ();
 					}
-					
+
 					find_bar.ShowAll();
 				}
-	
+
 				// Grab the focus even if it's already shown
 				find_bar.Entry.GrabFocus ();
 				args.RetVal = true;
 				return;
 			}
-			
+
 			args.RetVal = false;
 		}
 	}
diff --git a/src/MemorySurface.cs b/src/Clients/MainApp/FSpot/MemorySurface.cs
similarity index 97%
rename from src/MemorySurface.cs
rename to src/Clients/MainApp/FSpot/MemorySurface.cs
index 7c5ccea..3c06d8f 100644
--- a/src/MemorySurface.cs
+++ b/src/Clients/MainApp/FSpot/MemorySurface.cs
@@ -1,11 +1,11 @@
-/* 
+/*
  * MemorySurface.cs
  *
  * Copyright 2007 Novell Inc.
  *
  * Author
  * 	Larry Ewing <lewing novell com>
- *	Stephane Delcroix <stephane delcroix org>	
+ *	Stephane Delcroix <stephane delcroix org>
  *
  * See COPYING for license information.
  *
@@ -20,19 +20,19 @@ namespace FSpot {
 		{
 			[DllImport ("libfspot")]
 			public static extern IntPtr f_image_surface_create (Cairo.Format format, int width, int height);
-			
+
 			[DllImport ("libfspot")]
 			public static extern IntPtr f_image_surface_get_data (IntPtr surface);
-	
+
 			[DllImport ("libfspot")]
 			public static extern Cairo.Format f_image_surface_get_format (IntPtr surface);
-	
+
 			[DllImport ("libfspot")]
 			public static extern int f_image_surface_get_width (IntPtr surface);
-	
+
 			[DllImport ("libfspot")]
 			public static extern int f_image_surface_get_height (IntPtr surface);
-	
+
 			[DllImport("libfspot")]
 			public static extern IntPtr f_pixbuf_to_cairo_surface (IntPtr handle);
 
@@ -58,7 +58,7 @@ namespace FSpot {
 		public Cairo.Format Format {
 			get { return NativeMethods.f_image_surface_get_format (Handle); }
 		}
-		
+
 		public int Width {
 			get { return NativeMethods.f_image_surface_get_width (Handle); }
 		}
@@ -80,5 +80,3 @@ namespace FSpot {
 		}
 	}
 }
-
-
diff --git a/src/Photo.cs b/src/Clients/MainApp/FSpot/Photo.cs
similarity index 100%
rename from src/Photo.cs
rename to src/Clients/MainApp/FSpot/Photo.cs
diff --git a/src/PhotoEventArgs.cs b/src/Clients/MainApp/FSpot/PhotoEventArgs.cs
similarity index 100%
rename from src/PhotoEventArgs.cs
rename to src/Clients/MainApp/FSpot/PhotoEventArgs.cs
diff --git a/src/PhotoList.cs b/src/Clients/MainApp/FSpot/PhotoList.cs
similarity index 99%
rename from src/PhotoList.cs
rename to src/Clients/MainApp/FSpot/PhotoList.cs
index 2298230..7f104cc 100644
--- a/src/PhotoList.cs
+++ b/src/Clients/MainApp/FSpot/PhotoList.cs
@@ -39,7 +39,7 @@ namespace FSpot {
 		public int Capacity {
 			set { list.Capacity = value; }
 		}
-        
+
 		public void AddAll (List<IBrowsableItem> photos)
 		{
 			list = photos;
diff --git a/src/PhotoLoader.cs b/src/Clients/MainApp/FSpot/PhotoLoader.cs
similarity index 91%
rename from src/PhotoLoader.cs
rename to src/Clients/MainApp/FSpot/PhotoLoader.cs
index 524df06..96de303 100644
--- a/src/PhotoLoader.cs
+++ b/src/Clients/MainApp/FSpot/PhotoLoader.cs
@@ -20,7 +20,7 @@ namespace FSpot {
 			return Load (item);
 		}
 
-		static public Gdk.Pixbuf Load (IBrowsableItem item) 
+		static public Gdk.Pixbuf Load (IBrowsableItem item)
 		{
 			using (var img = ImageFile.Create (item.DefaultVersion.Uri)) {
 				Gdk.Pixbuf pixbuf = img.Load ();
@@ -28,7 +28,7 @@ namespace FSpot {
 			}
 		}
 
-		static public Gdk.Pixbuf LoadAtMaxSize (IBrowsableItem item, int width, int height) 
+		static public Gdk.Pixbuf LoadAtMaxSize (IBrowsableItem item, int width, int height)
 		{
 			using (var img = ImageFile.Create (item.DefaultVersion.Uri)) {
 				Gdk.Pixbuf pixbuf = img.Load (width, height);
diff --git a/src/PhotoPopup.cs b/src/Clients/MainApp/FSpot/PhotoPopup.cs
similarity index 91%
rename from src/PhotoPopup.cs
rename to src/Clients/MainApp/FSpot/PhotoPopup.cs
index 24bf735..1b49b9e 100644
--- a/src/PhotoPopup.cs
+++ b/src/Clients/MainApp/FSpot/PhotoPopup.cs
@@ -40,11 +40,11 @@ namespace FSpot
 			Activate (toplevel, null);
 		}
 
-		public void Activate (Widget toplevel, Gdk.EventButton eb) 
+		public void Activate (Widget toplevel, Gdk.EventButton eb)
 		{
 			if (eb != null)
 				Popup (null, null, null, eb.Button, eb.Time);
-			else 
+			else
 				Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
 		}
 
diff --git a/src/PhotoQuery.cs b/src/Clients/MainApp/FSpot/PhotoQuery.cs
similarity index 99%
rename from src/PhotoQuery.cs
rename to src/Clients/MainApp/FSpot/PhotoQuery.cs
index 10598d5..c9dfbf7 100644
--- a/src/PhotoQuery.cs
+++ b/src/Clients/MainApp/FSpot/PhotoQuery.cs
@@ -1,6 +1,6 @@
 /*
  * FSpot.PhotoQuery.cs
- * 
+ *
  * Author(s):
  *	Larry Ewing  <lewing novell com>
  * 	Stephane Delcroix  <stephane delcroix org>
@@ -70,7 +70,7 @@ namespace FSpot {
 		Dictionary<uint, int> reverse_lookup;
 
 		int count = -1;
-		
+
 		string temp_table = String.Format ("photoquery_temp_{0}", QueryCount);
 
 		// Constructor
@@ -95,7 +95,7 @@ namespace FSpot {
 				return count;
 			}
 		}
-		
+
 		public bool Contains (IBrowsableItem item) {
 			return IndexOf (item) >= 0;
 		}
@@ -103,7 +103,7 @@ namespace FSpot {
 		// IPhotoCollection Interface
 		public event IBrowsableCollectionChangedHandler Changed;
 		public event IBrowsableCollectionItemsChangedHandler ItemsChanged;
-		
+
 		public IBrowsableItem this [int index] {
 			get { return cache.Get (index); }
 		}
@@ -121,7 +121,7 @@ namespace FSpot {
 		public PhotoStore Store {
 			get { return store; }
 		}
-		
+
 		//Query Conditions
 		private Dictionary<Type, IQueryCondition> conditions;
 		private Dictionary<Type, IQueryCondition> Conditions {
@@ -165,7 +165,7 @@ namespace FSpot {
 				RequestReload ();
 			}
 		}
-	
+
 		public DateRange Range {
 			get { return GetCondition<DateRange> (); }
 			set {
@@ -173,19 +173,19 @@ namespace FSpot {
 					RequestReload ();
 			}
 		}
-		
+
 		private bool untagged = false;
 		public bool Untagged {
 			get { return untagged; }
 			set {
 				if (untagged != value) {
 					untagged = value;
-					
+
 					if (untagged) {
 						UnSetCondition<ConditionWrapper> ();
 						UnSetCondition<HiddenTag> ();
 					}
-					
+
 					RequestReload ();
 				}
 			}
@@ -206,7 +206,7 @@ namespace FSpot {
 					RequestReload ();
 			}
 		}
-		
+
 		public HiddenTag HiddenTag {
 			get { return GetCondition<HiddenTag> (); }
 			set {
@@ -214,20 +214,20 @@ namespace FSpot {
 					RequestReload ();
 			}
 		}
-		
+
 		public ConditionWrapper TagTerm {
 			get { return GetCondition<ConditionWrapper> (); }
 			set {
 				if (value == null && UnSetCondition<ConditionWrapper>()
 				    || value != null && SetCondition (value)) {
-					
+
 					if (value != null) {
 						untagged = false;
 						SetCondition (HiddenTag.ShowHiddenTag);
 					} else {
 						UnSetCondition<HiddenTag> ();
 					}
-					
+
 					RequestReload ();
 				}
 			}
@@ -253,7 +253,7 @@ namespace FSpot {
 		{
 			uint timer = Log.DebugTimerStart ();
 			IQueryCondition[] condition_array;
-			
+
 			int i = 0;
 			if (untagged) {
 				condition_array = new IQueryCondition[conditions.Count + 1];
@@ -265,12 +265,12 @@ namespace FSpot {
 				condition_array[1] = new ConditionWrapper (terms != null ? terms.SqlCondition () : null);
 				i = 2;
 			}
-			
+
 			foreach (IQueryCondition condition in Conditions.Values) {
 				condition_array[i] = condition;
 				i++;
 			}
-	
+
 			store.QueryToTemp (temp_table, condition_array);
 
 			count = -1;
@@ -279,10 +279,10 @@ namespace FSpot {
 
 			if (Changed != null)
 				Changed (this);
-			
+
 			Log.DebugTimerPrint (timer, "Reloading the query took {0}");
 		}
-		
+
 		public int IndexOf (IBrowsableItem photo)
 		{
 			if (photo == null || !(photo is Photo))
@@ -318,7 +318,7 @@ namespace FSpot {
 		{
 			if (Count == 0)
 				return -1;
-			
+
 			uint timer = Log.DebugTimerStart ();
 			int low = 0;
 			int high = Count - 1;
diff --git a/src/PhotoVersion.cs b/src/Clients/MainApp/FSpot/PhotoVersion.cs
similarity index 100%
rename from src/PhotoVersion.cs
rename to src/Clients/MainApp/FSpot/PhotoVersion.cs
diff --git a/src/PhotoView.cs b/src/Clients/MainApp/FSpot/PhotoView.cs
similarity index 97%
rename from src/PhotoView.cs
rename to src/Clients/MainApp/FSpot/PhotoView.cs
index e938d61..1c91377 100644
--- a/src/PhotoView.cs
+++ b/src/Clients/MainApp/FSpot/PhotoView.cs
@@ -27,73 +27,73 @@ using FSpot.UI.Dialog;
 namespace FSpot {
 	public class PhotoView : EventBox {
 		Delay commit_delay;
-	
+
 		private PhotoImageView photo_view;
 		private ScrolledWindow photo_view_scrolled;
 		private EventBox background;
-		
+
 		private Filmstrip filmstrip;
 		VBox inner_vbox;
 		HBox inner_hbox;
-	
+
 		private Widgets.TagView tag_view;
-		
+
 		private Entry description_entry;
 		private Widgets.Rating rating;
-	
+
 		// Public events.
-	
+
 		public delegate void PhotoChangedHandler (PhotoView me);
 		public event PhotoChangedHandler PhotoChanged;
-	
+
 		public delegate void UpdateStartedHandler (PhotoView view);
 		public event UpdateStartedHandler UpdateStarted;
-	
+
 		public delegate void UpdateFinishedHandler (PhotoView view);
 		public event UpdateFinishedHandler UpdateFinished;
 
 		public event EventHandler<BrowsableEventArgs> DoubleClicked;
-	
+
 		public Orientation FilmstripOrientation {
 			get { return filmstrip.Orientation; }
 		}
-	
+
 		public PhotoImageView View {
 			get { return photo_view; }
 		}
-	
+
 		public BrowsablePointer Item {
 			get { return photo_view.Item; }
 		}
-	
+
 		private IBrowsableCollection query;
 		public IBrowsableCollection Query {
 			get { return query; }
 			set { query = value; }
 		}
-	
+
 		public double Zoom {
 			get { return photo_view.Zoom; }
 			set { photo_view.Zoom = value; }
 		}
-		
+
 		public double NormalizedZoom {
 			get { return photo_view.NormalizedZoom; }
 			set { photo_view.NormalizedZoom = value; }
 		}
-	
+
 		public void Reload ()
 		{
 			photo_view.Reload ();
 		}
-	
+
 		private void UpdateDescriptionEntry ()
 		{
 			description_entry.Changed -= HandleDescriptionChanged;
 			if (Item.IsValid) {
 				if (description_entry.Sensitive == false)
 					description_entry.Sensitive = true;
-	
+
 				string desc = Item.Current.Description;
 				if (description_entry.Text != desc) {
 					description_entry.Text = desc == null ? String.Empty : desc;
@@ -102,10 +102,10 @@ namespace FSpot {
 				description_entry.Sensitive = false;
 				description_entry.Text = String.Empty;
 			}
-	
+
 			description_entry.Changed += HandleDescriptionChanged;
-		}    
-	
+		}
+
 		public void UpdateRating ()
 		{
 			if (Item.IsValid)
@@ -118,29 +118,29 @@ namespace FSpot {
 			rating.Value = r;
 			rating.Changed += HandleRatingChanged;
 		}
-	
+
 		private void Update ()
 		{
 			if (UpdateStarted != null)
 				UpdateStarted (this);
-	
+
 			UpdateDescriptionEntry ();
 			UpdateRating ();
 
 			if (UpdateFinished != null)
 				UpdateFinished (this);
 		}
-	
+
 		public void ZoomIn ()
 		{
 			photo_view.ZoomIn ();
 		}
-		
+
 		public void ZoomOut ()
 		{
 			photo_view.ZoomOut ();
 		}
-	
+
 		// Event handlers.
 		private void HandleButtonPressEvent (object sender, ButtonPressEventArgs args)
 		{
@@ -152,14 +152,14 @@ namespace FSpot {
 				popup.Activate (this.Toplevel, args.Event);
 			}
 		}
-	
+
 		protected override bool OnPopupMenu ()
 		{
 			PhotoPopup popup = new PhotoPopup ();
 			popup.Activate (this.Toplevel);
 			return true;
 		}
-	
+
 		int changed_photo;
 		private bool CommitPendingChanges ()
 		{
@@ -169,31 +169,31 @@ namespace FSpot {
 			}
 			return true;
 		}
-	
-		private void HandleDescriptionChanged (object sender, EventArgs args) 
+
+		private void HandleDescriptionChanged (object sender, EventArgs args)
 		{
 			if (!Item.IsValid)
 				return;
-			
+
 			((Photo)Item.Current).Description = description_entry.Text;
-			
+
 			if (commit_delay.IsPending)
 				if (changed_photo == Item.Index)
 					commit_delay.Stop ();
 				else
 					CommitPendingChanges ();
-			
+
 			changed_photo = Item.Index;
 			commit_delay.Start ();
 		}
-	
+
 		private void HandleRatingChanged (object o, EventArgs e)
 		{
 			if (!Item.IsValid)
 				return;
-	
+
 			((Photo)Item.Current).Rating = (uint)(o as Widgets.Rating).Value;
-	
+
 			if (commit_delay.IsPending)
 				if (changed_photo == Item.Index)
 					commit_delay.Stop();
@@ -201,33 +201,33 @@ namespace FSpot {
 					CommitPendingChanges ();
 			changed_photo = Item.Index;
 			commit_delay.Start ();
-	 	}
+		}
 
 		public void UpdateTagView ()
 		{
 			tag_view.DrawTags ();
 			tag_view.QueueDraw ();
 		}
-	
+
 		void HandlePhotoChanged (object sender, EventArgs e)
 		{
 			if (query is PhotoQuery) {
 				CommitPendingChanges ();
 			}
-			
+
 			tag_view.Current = Item.Current;
 			Update ();
-	
+
 			if (this.PhotoChanged != null)
 				PhotoChanged (this);
 		}
-	
+
 		private void HandleDestroy (object sender, System.EventArgs args)
 		{
 			CommitPendingChanges ();
 			Dispose ();
 		}
-	
+
 		private void OnPreferencesChanged (object sender, NotifyEventArgs args)
 		{
 			LoadPreference (args.Key);
@@ -262,7 +262,7 @@ namespace FSpot {
 						inner_hbox.Remove (filmstrip);
 						break;
 					}
-				inner_vbox.PackStart (filmstrip, false, false, 0); 
+				inner_vbox.PackStart (filmstrip, false, false, 0);
 				inner_vbox.ReorderChild (filmstrip, 0);
 				break;
 			case Orientation.Vertical:
@@ -277,47 +277,47 @@ namespace FSpot {
 			}
 			Preferences.Set (Preferences.FILMSTRIP_ORIENTATION, (int) pos);
 		}
-	
+
 		public bool FilmStripVisibility {
 			get { return filmstrip.Visible; }
 			set { filmstrip.Visible = value; }
 		}
-	
+
 		public PhotoView (IBrowsableCollection query)
 			: base ()
 		{
 			this.query = query;
-	
+
 			commit_delay = new Delay (1000, new GLib.IdleHandler (CommitPendingChanges));
 			this.Destroyed += HandleDestroy;
-	
+
 			Name = "ImageContainer";
 			Box vbox = new VBox (false, 6);
 			Add (vbox);
-	
+
 		        background = new EventBox ();
 			Frame frame = new Frame ();
 			background.Add (frame);
-	
+
 			frame.ShadowType = ShadowType.In;
 			vbox.PackStart (background, true, true, 0);
-			
+
 			inner_vbox = new VBox (false , 2);
 			inner_hbox = new HBox (false , 2);
-	
+
 			frame.Add (inner_hbox);
-			
+
 			BrowsablePointer bp = new BrowsablePointer (query, -1);
 			photo_view = new PhotoImageView (bp);
-	
+
 			filmstrip = new Filmstrip (bp);
 			filmstrip.ThumbOffset = 1;
 			filmstrip.Spacing = 4;
 			filmstrip.ThumbSize = 75;
 			PlaceFilmstrip ((Orientation) Preferences.Get <int> (Preferences.FILMSTRIP_ORIENTATION), true);
-	
+
 			photo_view.PhotoChanged += HandlePhotoChanged;
-	
+
 			photo_view_scrolled = new ScrolledWindow (null, null);
 
 			photo_view_scrolled.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
@@ -327,29 +327,29 @@ namespace FSpot {
 			photo_view.AddEvents ((int) EventMask.KeyPressMask);
 			inner_vbox.PackStart (photo_view_scrolled, true, true, 0);
 			inner_hbox.PackStart (inner_vbox, true, true, 0);
-			
+
 			HBox lower_hbox = new HBox (false, 2);
 			//inner_hbox.BorderWidth = 6;
-	
+
 			tag_view = new Widgets.TagView ();
 			lower_hbox.PackStart (tag_view, false, true, 0);
-	
+
 			Label comment = new Label (Catalog.GetString ("Description:"));
 			lower_hbox.PackStart (comment, false, false, 0);
 			description_entry = new Entry ();
 			lower_hbox.PackStart (description_entry, true, true, 0);
 			description_entry.Changed += HandleDescriptionChanged;
-	
+
 			rating = new Widgets.Rating();
 			lower_hbox.PackStart (rating, false, false, 0);
 			rating.Changed += HandleRatingChanged;
-	
+
 			SetColors ();
-			
+
 			inner_vbox.PackStart (lower_hbox, false, true, 0);
-	
+
 			vbox.ShowAll ();
-	
+
 			Realized += delegate (object o, EventArgs e) {SetColors ();};
 			Preferences.SettingChanged += OnPreferencesChanged;
 		}
@@ -357,7 +357,7 @@ namespace FSpot {
 		~PhotoView ()
 		{
 			Hyena.Log.DebugFormat ("Finalizer called on {0}. Should be Disposed", GetType ());
-			Dispose (false);	
+			Dispose (false);
 		}
 
 		public override void Dispose ()
@@ -366,14 +366,14 @@ namespace FSpot {
 			base.Dispose ();
 			System.GC.SuppressFinalize (this);
 		}
-	
+
 		bool is_disposed = false;
 		protected virtual void Dispose (bool disposing)
 		{
 			if (is_disposed)
 				return;
 			if (disposing) { //Free managed resources
-				filmstrip.Dispose ();	
+				filmstrip.Dispose ();
 			}
 
 			is_disposed = true;
@@ -396,7 +396,7 @@ namespace FSpot {
 			photo_view_scrolled.ModifyBg (Gtk.StateType.Normal, dark);
 			rating.ModifyBg (Gtk.StateType.Normal, dark);
 		}
-	
+
 		protected override void OnStyleSet (Style previous)
 		{
 			SetColors ();
diff --git a/src/PixbufCache.cs b/src/Clients/MainApp/FSpot/PixbufCache.cs
similarity index 97%
rename from src/PixbufCache.cs
rename to src/Clients/MainApp/FSpot/PixbufCache.cs
index 83a8d92..4943d44 100644
--- a/src/PixbufCache.cs
+++ b/src/Clients/MainApp/FSpot/PixbufCache.cs
@@ -26,18 +26,18 @@ namespace FSpot {
 
 		public delegate void PixbufLoadedHandler (PixbufCache cache, CacheEntry entry);
 		public event PixbufLoadedHandler OnPixbufLoaded;
-		
+
 		public PixbufCache ()
 		{
 			items = new Hashtable ();
 			items_mru = new ArrayList ();
-			
+
 			worker = new Thread (new ThreadStart (WorkerTask));
 			worker.Start ();
 
 			ThumbnailLoader.Default.OnPixbufLoaded += HandleThumbnailLoaded;
 		}
-		
+
 		public void HandleThumbnailLoaded (ImageLoaderThread loader, ImageLoaderThread.RequestItem result)
 		{
             Reload (result.Uri);
@@ -76,7 +76,7 @@ namespace FSpot {
 				entry.SetPixbufExtended (pixbuf, true);
 			}
 		}
-		
+
 		public void Reload (CacheEntry entry, object data, int width, int height)
 		{
 			lock (items) {
@@ -114,7 +114,7 @@ namespace FSpot {
 				//System.Console.WriteLine ("Hit major limit ({0}) out of {1}",
 				//			  total_size, max_size);
 				return null;
-			} 
+			}
 			while (i-- > 0) {
 				entry = (CacheEntry) items_mru [i];
 				lock (entry) {
@@ -123,13 +123,13 @@ namespace FSpot {
 						return entry;
 					}
 
-					//if the depth of the queue is so large that we've reached double our limit 
+					//if the depth of the queue is so large that we've reached double our limit
 					//break out of here and let the queue shrink.
 					if (entry.Pixbuf != null)
 						size += entry.Size;
 
 					if (size > max_size * 2) {
-						//System.Console.WriteLine ("Hit limit ({0},{1}) out of {2}", 
+						//System.Console.WriteLine ("Hit limit ({0},{1}) out of {2}",
 						//			  size, total_size,max_size);
 						return null;
 					}
@@ -137,7 +137,7 @@ namespace FSpot {
 			}
 			return null;
 		}
-		
+
 		private bool ShrinkIfNeeded ()
 		{
 			int num = 0;
@@ -147,14 +147,14 @@ namespace FSpot {
 				entry.Dispose ();
 			}
 			if (num > 0) {
-				//System.Console.WriteLine ("removing {0} out of {3}  ({1} > {2})", 
+				//System.Console.WriteLine ("removing {0} out of {3}  ({1} > {2})",
 				//			  num, total_size, max_size, items_mru.Count);
 				items_mru.RemoveRange (0, num);
 				return true;
 			}
 			return false;
 		}
-		
+
 		private void WorkerTask ()
 		{
 			CacheEntry current = null;
@@ -179,7 +179,7 @@ namespace FSpot {
 				}
 			}
 		}
-		
+
 		protected virtual void ProcessRequest (CacheEntry entry)
 		{
 			Gdk.Pixbuf loaded = null;
@@ -189,10 +189,10 @@ namespace FSpot {
 			} catch (GLib.GException){
 				if (loaded != null)
 					loaded.Dispose ();
-				return;		
+				return;
 			}
 		}
-		
+
 		private void QueueLast (CacheEntry entry)
 		{
 			ThreadAssist.ProxyToMain (() => {
@@ -200,7 +200,7 @@ namespace FSpot {
 					OnPixbufLoaded (this, entry);
 			});
 		}
-		
+
 		private void MoveForward (CacheEntry entry)
 		{
 #if true
@@ -217,10 +217,10 @@ namespace FSpot {
 			throw new System.Exception ("move forward failed");
 #else
 			items_mru.Remove (entry);
-			items_mru.Add (entry);	
+			items_mru.Add (entry);
 #endif
 		}
-		       
+
 
 		private CacheEntry ULookup (SafeUri uri)
 		{
@@ -263,7 +263,7 @@ namespace FSpot {
 			private object data;
 			private bool reload;
 			private PixbufCache cache;
-			
+
 			public CacheEntry (PixbufCache cache, SafeUri uri, object closure, int width, int height)
 			{
 				this.uri = uri;
@@ -306,11 +306,11 @@ namespace FSpot {
 					}
 				}
 			}
-			
+
 			public bool IsDisposed {
 				get { return uri == null; }
 			}
-			
+
 			public void SetPixbufExtended (Gdk.Pixbuf value, bool ignore_undead)
 			{
 				lock (this) {
@@ -320,7 +320,7 @@ namespace FSpot {
 						} else {
 							throw new System.Exception ("I don't want to be undead");
 						}
-					}							
+					}
 
 					Gdk.Pixbuf old = this.Pixbuf;
 					cache.total_size -= this.Size;
@@ -331,7 +331,7 @@ namespace FSpot {
 					}
 					cache.total_size += this.Size;
 					this.Reload = false;
-					
+
 					if (old != null)
 						old.Dispose ();
 				}
@@ -344,7 +344,7 @@ namespace FSpot {
 					}
 				}
 			}
-			
+
 			public Gdk.Pixbuf ShallowCopyPixbuf ()
 			{
 				lock (this) {
@@ -353,17 +353,17 @@ namespace FSpot {
 
 					if (pixbuf == null)
 						return null;
-					
+
 					return pixbuf.ShallowCopy ();
 				}
 			}
-			
+
 			~CacheEntry ()
 			{
 				if (!IsDisposed)
 					this.Dispose ();
 			}
-			
+
 			public void Dispose ()
 			{
 				lock (this) {
@@ -372,7 +372,7 @@ namespace FSpot {
 
 					if (this.pixbuf != null) {
 						this.pixbuf.Dispose ();
-						
+
 					}
 					this.pixbuf = null;
 					this.cache = null;
@@ -380,7 +380,7 @@ namespace FSpot {
 				}
 				System.GC.SuppressFinalize (this);
 			}
-			
+
 			public int Size {
 				get {
 					return width * height * 3;
diff --git a/src/Preferences.cs b/src/Clients/MainApp/FSpot/Preferences.cs
similarity index 98%
rename from src/Preferences.cs
rename to src/Clients/MainApp/FSpot/Preferences.cs
index 526e835..5996b5f 100644
--- a/src/Preferences.cs
+++ b/src/Clients/MainApp/FSpot/Preferences.cs
@@ -30,7 +30,7 @@ namespace FSpot
 		public const string IMPORT_INCLUDE_SUBFOLDERS = "/apps/f-spot/import/include_subfolders";
 		public const string IMPORT_CHECK_DUPLICATES = "/apps/f-spot/import/check_duplicates";
 		public const string IMPORT_REMOVE_ORIGINALS = "/apps/f-spot/import/remove_originals";
-		
+
 		public const string VIEWER_WIDTH = APP_FSPOT + "ui/viewer_width";
 		public const string VIEWER_HEIGHT = APP_FSPOT + "ui/viewer_height";
 		public const string VIEWER_MAXIMIZED = APP_FSPOT + "ui/viewer_maximized";
@@ -40,10 +40,10 @@ namespace FSpot
 		public const string VIEWER_TRANS_COLOR = APP_FSPOT + "viewer/trans_color";
 		public const string VIEWER_TRANSPARENCY = APP_FSPOT + "viewer/transparency";
 		public const string CUSTOM_CROP_RATIOS = APP_FSPOT + "viewer/custom_crop_ratios";
-		
+
 		public const string COLOR_MANAGEMENT_DISPLAY_PROFILE = APP_FSPOT + "ui/color_management_display_profile";
 		public const string COLOR_MANAGEMENT_OUTPUT_PROFILE = APP_FSPOT + "ui/color_management_output_profile";
-		
+
 		public const string SHOW_TOOLBAR = APP_FSPOT + "ui/show_toolbar";
 		public const string SHOW_SIDEBAR = APP_FSPOT + "ui/show_sidebar";
 		public const string SHOW_TIMELINE = APP_FSPOT + "ui/show_timeline";
@@ -55,10 +55,10 @@ namespace FSpot
 		public const string SHOW_RATINGS = APP_FSPOT + "ui/show_ratings";
 		public const string TAG_ICON_SIZE = APP_FSPOT + "ui/tag_icon_size";
 		public const string TAG_ICON_AUTOMATIC = APP_FSPOT + "ui/tag_icon_automatic";
-		
+
 		public const string GLASS_POSITION = APP_FSPOT + "ui/glass_position";
 		public const string GROUP_ADAPTOR_ORDER_ASC = APP_FSPOT + "ui/group_adaptor_sort_asc";
-		
+
 		public const string SIDEBAR_POSITION = APP_FSPOT + "ui/sidebar_size";
 		public const string ZOOM = APP_FSPOT + "ui/zoom";
 
@@ -115,7 +115,7 @@ namespace FSpot
 			case IMPORT_WINDOW_PANE_POSITION:
 			case FILMSTRIP_ORIENTATION:
 				return 0;
-					
+
 			case METADATA_EMBED_IN_IMAGE:
 			case METADATA_ALWAYS_USE_SIDECAR:
 			case MAIN_WINDOW_MAXIMIZED:
@@ -135,13 +135,13 @@ namespace FSpot
 			case SHOW_RATINGS:
 			case VIEWER_SHOW_FILENAMES:
 				return true;
-			
+
 			case TAG_ICON_SIZE:
 				return (int) Tag.IconSize.Medium;
 
 			case TAG_ICON_AUTOMATIC:
 				return true;
-		
+
 			case SIDEBAR_POSITION:
 				return 130;
 			case ZOOM:
@@ -180,7 +180,7 @@ namespace FSpot
 				return null;
 			}
 		}
-		
+
 		//return true if the key exists in the backend
 		public static bool TryGet<T> (string key, out T value)
 		{
@@ -197,7 +197,7 @@ namespace FSpot
 				} catch { //catching NoSuchKeyException
 					return false;
 				}
-				
+
 				cache.Add (key, value);
 				return true;
 			}
@@ -219,7 +219,7 @@ namespace FSpot
 		{
 			lock (cache) {
 				try {
-					cache [key] = value;				
+					cache [key] = value;
 					Backend.Set (key, value);
 				} catch (Exception e){
 					Log.Exception ("Unable to set this :"+key, e);
@@ -233,7 +233,7 @@ namespace FSpot
 		{
 			lock (cache) {
 				if (cache.ContainsKey (args.Key)) {
-					cache [args.Key] = args.Value;				
+					cache [args.Key] = args.Value;
 				}
 			}
 
diff --git a/src/PrintOperation.cs b/src/Clients/MainApp/FSpot/PrintOperation.cs
similarity index 97%
rename from src/PrintOperation.cs
rename to src/Clients/MainApp/FSpot/PrintOperation.cs
index a887f65..16bf54f 100644
--- a/src/PrintOperation.cs
+++ b/src/Clients/MainApp/FSpot/PrintOperation.cs
@@ -83,7 +83,7 @@ namespace FSpot
 		protected override void OnDrawPage (Gtk.PrintContext context, int page_nr)
 		{
 			base.OnDrawPage (context, page_nr);
-			Context cr = context.CairoContext;	
+			Context cr = context.CairoContext;
 
 			int ppx, ppy;
 			switch (photos_per_page) {
@@ -118,13 +118,13 @@ namespace FSpot
 						try {
 							pixbuf = img.Load ((int) mx, (int) my);
 							Cms.Profile printer_profile;
-							if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_OUTPUT_PROFILE), out printer_profile)) 
+							if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_OUTPUT_PROFILE), out printer_profile))
 								FSpot.ColorManagement.ApplyProfile (pixbuf, img.GetProfile (), printer_profile);
 						} catch (Exception e) {
 							Log.Exception ("Unable to load image " + selected_photos[p_index].DefaultVersion.Uri + "\n", e);
 							// If the image is not found load error pixbuf
-							pixbuf = new Gdk.Pixbuf (PixbufUtils.ErrorPixbuf, 0, 0, 
-										      PixbufUtils.ErrorPixbuf.Width, 
+							pixbuf = new Gdk.Pixbuf (PixbufUtils.ErrorPixbuf, 0, 0,
+										      PixbufUtils.ErrorPixbuf.Width,
 										      PixbufUtils.ErrorPixbuf.Height);
 						}
 						//Gdk.Pixbuf pixbuf = img.Load (100, 100);
@@ -208,7 +208,7 @@ namespace FSpot
 			Pango.CairoHelper.ShowLayout (context.CairoContext, layout);
 			cr.Restore ();
 		}
-	
+
 
 		private void DrawImage (Context cr, Gdk.Pixbuf pixbuf, double x, double y, double w, double h)
 		{
@@ -225,7 +225,7 @@ namespace FSpot
 			case CustomPrintWidget.FitMode.Scaled:
 				scalex = scaley = Math.Min (w/pixbuf.Width, h/pixbuf.Height);
 				break;
-			}	
+			}
 
 			double rectw = w / scalex;
 			double recth = h / scaley;
@@ -253,7 +253,7 @@ namespace FSpot
 
 		[DllImport("libfspot")]
 		static extern IntPtr f_pixbuf_from_cairo_surface (IntPtr handle);
-		
+
 		private static Gdk.Pixbuf CreatePixbuf (Surface s)
 		{
 			IntPtr result = f_pixbuf_from_cairo_surface (s.Handle);
diff --git a/src/ProgressItem.cs b/src/Clients/MainApp/FSpot/ProgressItem.cs
similarity index 99%
rename from src/ProgressItem.cs
rename to src/Clients/MainApp/FSpot/ProgressItem.cs
index aaafe71..12206ba 100644
--- a/src/ProgressItem.cs
+++ b/src/Clients/MainApp/FSpot/ProgressItem.cs
@@ -13,7 +13,7 @@ namespace FSpot {
 	public class ProgressItem {
 		public ProgressItem () {
 		}
-		
+
 		public delegate void ChangedHandler (ProgressItem item);
 		public event ChangedHandler Changed;
 
@@ -34,4 +34,3 @@ namespace FSpot {
 		}
 	}
 }
-
diff --git a/src/QueryWidget.cs b/src/Clients/MainApp/FSpot/QueryWidget.cs
similarity index 94%
rename from src/QueryWidget.cs
rename to src/Clients/MainApp/FSpot/QueryWidget.cs
index 3d7f83f..71fb1f0 100644
--- a/src/QueryWidget.cs
+++ b/src/Clients/MainApp/FSpot/QueryWidget.cs
@@ -16,6 +16,7 @@ using Mono.Unix;
 using Gtk;
 
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Utils;
 using FSpot.Query;
 using FSpot.Widgets;
@@ -28,7 +29,7 @@ namespace FSpot {
 		PhotoQuery query;
 		LogicWidget logic_widget;
 		FolderQueryWidget folder_query_widget;
-		
+
 		Gtk.HBox box;
 		Gtk.Label label;
 		Gtk.Label untagged;
@@ -76,33 +77,33 @@ namespace FSpot {
 			comma2_label.Visible = false;
 			box.PackStart (comma2_label, false, false, 0);
 
-			// Note for translators: 'Import roll' is no command, it means 'Roll that has been imported' 
-			rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));	
+			// Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
+			rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
 			rollfilter.Visible = false;
 			box.PackStart (rollfilter, false, false, 0);
 
 			folder_query_widget = new FolderQueryWidget (query);
 			folder_query_widget.Visible = false;
 			box.PackStart (folder_query_widget, false, false, 0);
-			
+
 			logic_widget = new LogicWidget (query, db.Tags);
 			logic_widget.Show ();
 			box.PackStart (logic_widget, true, true, 0);
 
 			warning_box = new Gtk.HBox ();
 			warning_box.PackStart (new Gtk.Label (System.String.Empty));
-			
+
 			Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
 			warning_image.Show ();
 			warning_box.PackStart (warning_image, false, false, 0);
-			
+
 			clear_button = new Gtk.Button ();
 			clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
 			clear_button.Clicked += HandleClearButtonClicked;
 			clear_button.Relief = Gtk.ReliefStyle.None;
 			clear_button.TooltipText = Catalog.GetString("Clear search");
 			box.PackEnd (clear_button, false, false, 0);
-			
+
 			refresh_button = new Gtk.Button ();
 			refresh_button.Add (new Gtk.Image ("gtk-refresh", Gtk.IconSize.Button));
 			refresh_button.Clicked += HandleRefreshButtonClicked;
@@ -117,20 +118,20 @@ namespace FSpot {
 			warning_box.Visible = false;
 
 			box.PackEnd (warning_box, false, false, 0);
-			
+
 			warning_box.Visible = false;
 		}
-		
+
 		public void HandleClearButtonClicked (object sender, System.EventArgs args)
 		{
 			Close ();
 		}
 
- 		public void HandleRefreshButtonClicked (object sender, System.EventArgs args)
- 		{
- 			query.RequestReload ();
- 		}
- 
+		public void HandleRefreshButtonClicked (object sender, System.EventArgs args)
+		{
+			query.RequestReload ();
+		}
+
 		public void Close ()
 		{
 			query.Untagged = false;
@@ -142,10 +143,10 @@ namespace FSpot {
 			query.RatingRange = null;
 			logic_widget.Clear = true;
 			logic_widget.UpdateQuery ();
-			
+
 			folder_query_widget.Clear ();
 			query.RequestReload ();
-			
+
 			HideBar ();
 		}
 
@@ -159,7 +160,7 @@ namespace FSpot {
 			Hide ();
 		}
 
-		public void HandleChanged (IBrowsableCollection collection) 
+		public void HandleChanged (IBrowsableCollection collection)
 		{
 			if (query.TagTerm == null)
 				logic_widget.Clear = true;
@@ -178,7 +179,7 @@ namespace FSpot {
 			warning_box.Visible = (query.Count < 1);
 			rollfilter.Visible = (query.RollSet != null);
 			comma1_label.Visible = (untagged.Visible && rated.Visible);
-			comma2_label.Visible = (!untagged.Visible && rated.Visible && rollfilter.Visible) || 
+			comma2_label.Visible = (!untagged.Visible && rated.Visible && rollfilter.Visible) ||
 					       (untagged.Visible && rollfilter.Visible);
 
 		}
@@ -192,32 +193,32 @@ namespace FSpot {
 		{
 			logic_widget.Include (tags);
 		}
-		
+
 		public void UnInclude (Tag [] tags)
 		{
 			logic_widget.UnInclude (tags);
 		}
-		
+
 		public void Require (Tag [] tags)
 		{
 			logic_widget.Require (tags);
 		}
-		
+
 		public void UnRequire (Tag [] tags)
 		{
 			logic_widget.UnRequire (tags);
 		}
-		
+
 		public bool TagIncluded (Tag tag)
 		{
 			return logic_widget.TagIncluded (tag);
 		}
-		
+
 		public bool TagRequired (Tag tag)
 		{
 			return logic_widget.TagRequired (tag);
 		}
-		
+
 		public void SetFolders (IEnumerable<SafeUri> uri_list)
 		{
 			folder_query_widget.SetFolders (uri_list);
diff --git a/src/RotateCommand.cs b/src/Clients/MainApp/FSpot/RotateCommand.cs
similarity index 95%
rename from src/RotateCommand.cs
rename to src/Clients/MainApp/FSpot/RotateCommand.cs
index 2643172..a6e5830 100644
--- a/src/RotateCommand.cs
+++ b/src/Clients/MainApp/FSpot/RotateCommand.cs
@@ -28,13 +28,13 @@ namespace FSpot {
 	public class RotateException : ApplicationException {
 		public string path;
 		public bool ReadOnly = false;
-		
+
 		public string Path {
 			get { return path; }
 		}
 
 		public RotateException (string msg, string path) : this (msg, path, false) {}
-		
+
 		public RotateException (string msg, string path, bool ro) : base (msg) {
 			this.path = path;
 			this.ReadOnly = ro;
@@ -80,15 +80,15 @@ namespace FSpot {
 		{
 			RotateOrientation (original_path, dir);
 		}
-		
+
 		public bool Step () {
 			string original_path;
 
 			if (done)
 				return false;
 
- 			original_path = item.DefaultVersion.Uri.LocalPath;
- 			done = true;
+			original_path = item.DefaultVersion.Uri.LocalPath;
+			done = true;
 
 			if ((File.GetAttributes(original_path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
 				throw new RotateException (Catalog.GetString ("Unable to rotate readonly file"), original_path, true);
@@ -106,7 +106,7 @@ namespace FSpot {
 		int index;
 		RotateOperation op;
 
-		public int Index { 
+		public int Index {
 			get { return index; }
 		}
 
@@ -120,15 +120,15 @@ namespace FSpot {
 			this.items = items;
 			index = 0;
 		}
-		
+
 		public bool Step ()
 		{
-			if (index >= items.Length)  
+			if (index >= items.Length)
 				return false;
 
-			if (op == null) 
+			if (op == null)
 				op = new RotateOperation (items [index], direction);
-			
+
 			if (op.Step ())
 				return true;
 			else {
@@ -152,19 +152,19 @@ public class RotateCommand {
 	public bool Execute (RotateDirection direction, IBrowsableItem [] items)
 	{
 		ProgressDialog progress_dialog = null;
-		
+
 		if (items.Length > 1)
 			progress_dialog = new ProgressDialog (Catalog.GetString ("Rotating photos"),
 							      ProgressDialog.CancelButtonType.Stop,
 							      items.Length, parent_window);
-		
+
 	        RotateMultiple op = new RotateMultiple (items, direction);
 		int readonly_count = 0;
 		bool done = false;
 		int index = 0;
 
 		while (!done) {
-			if (progress_dialog != null && op.Index != -1 && index < items.Length) 
+			if (progress_dialog != null && op.Index != -1 && index < items.Length)
 				if (progress_dialog.Update (String.Format (Catalog.GetString ("Rotating photo \"{0}\""), op.Items [op.Index].Name)))
 					break;
 
@@ -186,13 +186,13 @@ public class RotateCommand {
 			}
 			index ++;
 		}
-		
+
 		if (progress_dialog != null)
 			progress_dialog.Destroy ();
-		
+
 		if (readonly_count > 0)
 			RunReadonlyError (readonly_count);
-		
+
 		return true;
 	}
 
@@ -207,17 +207,17 @@ public class RotateCommand {
 
 		notice = String.Format (notice, readonly_count);
 		desc = String.Format (desc, readonly_count);
-		
-		HigMessageDialog md = new HigMessageDialog (parent_window, 
+
+		HigMessageDialog md = new HigMessageDialog (parent_window,
 							    DialogFlags.DestroyWithParent,
 							    MessageType.Error,
 							    ButtonsType.Close,
-							    notice, 
+							    notice,
 							    desc);
 		md.Run();
 		md.Destroy();
 	}
-	
+
 	// FIXME shouldn't need this method, should catch all exceptions explicitly
 	// so can present translated error messages.
 	private void RunGenericError (System.Exception e, string path)
diff --git a/src/SelectionDataExtensions.cs b/src/Clients/MainApp/FSpot/SelectionDataExtensions.cs
similarity index 97%
rename from src/SelectionDataExtensions.cs
rename to src/Clients/MainApp/FSpot/SelectionDataExtensions.cs
index d7e7e15..fe8f8dc 100644
--- a/src/SelectionDataExtensions.cs
+++ b/src/Clients/MainApp/FSpot/SelectionDataExtensions.cs
@@ -25,29 +25,29 @@ namespace FSpot
 		public static void SetPhotosData (this SelectionData selection_data, Photo [] photos, Atom target)
 		{
 			byte [] data = new byte [photos.Length * sizeof (uint)];
-			
+
 			int i = 0;
 			foreach (Photo photo in photos) {
 				byte [] bytes = System.BitConverter.GetBytes (photo.Id);
-				
+
 				foreach (byte b in bytes) {
 					data[i] = b;
 					i++;
 				}
 			}
-			
+
 			selection_data.Set (target, 8, data, data.Length);
 		}
-		
+
 		public static Photo [] GetPhotosData (this SelectionData selection_data)
 		{
 			int size = sizeof (uint);
 			int length = selection_data.Length / size;
-			
+
 			PhotoStore photo_store = App.Instance.Database.Photos;
 
 			Photo [] photos = new Photo [length];
-			
+
 			for (int i = 0; i < length; i ++) {
 				uint id = System.BitConverter.ToUInt32 (selection_data.Data, i * size);
 				photos[i] = photo_store.Get (id);
@@ -55,33 +55,33 @@ namespace FSpot
 
 			return photos;
 		}
-		
+
 		public static void SetTagsData (this SelectionData selection_data, Tag [] tags, Atom target)
 		{
 			byte [] data = new byte [tags.Length * sizeof (uint)];
-			
+
 			int i = 0;
 			foreach (Tag tag in tags) {
 				byte [] bytes = System.BitConverter.GetBytes (tag.Id);
-				
+
 				foreach (byte b in bytes) {
 					data[i] = b;
 					i++;
 				}
 			}
-			
+
 			selection_data.Set (target, 8, data, data.Length);
 		}
-		
+
 		public static Tag [] GetTagsData (this SelectionData selection_data)
 		{
 			int size = sizeof (uint);
 			int length = selection_data.Length / size;
-			
+
 			TagStore tag_store = App.Instance.Database.Tags;
 
 			Tag [] tags = new Tag [length];
-			
+
 			for (int i = 0; i < length; i ++) {
 				uint id = System.BitConverter.ToUInt32 (selection_data.Data, i * size);
 				tags[i] = tag_store.Get (id);
@@ -89,30 +89,30 @@ namespace FSpot
 
 			return tags;
 		}
-		
+
 		public static string GetStringData (this SelectionData selection_data)
 		{
 			if (selection_data.Length <= 0)
 				return String.Empty;
-			
+
 			try {
 				return Encoding.UTF8.GetString (selection_data.Data);
 			} catch (Exception) {
 				return String.Empty;
 			}
 		}
-		
+
 		public static void SetUriListData (this SelectionData selection_data, UriList uri_list, Atom target)
 		{
 			Byte [] data = Encoding.UTF8.GetBytes (uri_list.ToString ());
-			
+
 			selection_data.Set (target, 8, data, data.Length);
 		}
-		
+
 		public static UriList GetUriListData (this SelectionData selection_data)
 		{
 			string [] uris = GetStringData (selection_data).Split ('\n');
-			
+
 			return new UriList (uris);
 		}
 	}
diff --git a/src/SendEmail.cs b/src/Clients/MainApp/FSpot/SendEmail.cs
similarity index 95%
rename from src/SendEmail.cs
rename to src/Clients/MainApp/FSpot/SendEmail.cs
index 2d69c3e..1f67217 100644
--- a/src/SendEmail.cs
+++ b/src/Clients/MainApp/FSpot/SendEmail.cs
@@ -37,13 +37,13 @@ namespace FSpot
 
 		long Orig_Photo_Size 	= 0;
 		double scale_percentage = 0.3;
-		
+
 		// The different sizes we can shrink to foto to. See RadioButton above for labels.
 		static int[] sizes 		= { 0, 320, 	480, 	640, 	800, 	1024 };
-		
-		// Estimated size relative to original after shrinking down the photo. 
+
+		// Estimated size relative to original after shrinking down the photo.
 		double[] avg_scale_ref 	= { 0, 0.0186,	0.0348,	0.0532,	0.0826,	0.1234 };
-		
+
 		static int NoOfSizes	= sizes.Length;
 		double[] avg_scale	= new double [NoOfSizes];
 		string tmp_mail_dir;	// To temporary keep the resized images
@@ -79,12 +79,12 @@ namespace FSpot
 					default: break;
 				}
 
-			
+
 			tray_scrolled.Add (new TrayView (selection));
 
 			Modal = false;
 
-			// Calculate total original filesize 
+			// Calculate total original filesize
 			foreach (var photo in selection.Items) {
 				try {
 					Orig_Photo_Size += FileFactory.NewForUri (photo.DefaultVersion.Uri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
@@ -99,10 +99,10 @@ namespace FSpot
 			// Calculate approximate size shrinking, use first photo, and shrink to medium size as base.
 			var scalephoto = selection [0];
 			if (scalephoto != null && !force_original) {
-				
+
 				// Get first photos file size
 				long orig_size = FileFactory.NewForUri (scalephoto.DefaultVersion.Uri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
-				
+
 				FilterSet filters = new FilterSet ();
 				filters.Add (new ResizeFilter ((uint)(sizes [3])));
 				long new_size;
@@ -110,15 +110,15 @@ namespace FSpot
 					filters.Convert (request);
 					new_size = FileFactory.NewForUri (request.Current).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
 				}
-				
+
 				if (orig_size > 0) {
-				
+
 					// Get the factor (scale) between original and resized medium size.
 					scale_percentage = 1 - ( (float) (orig_size - new_size) / orig_size);
-					
+
 					// What is the relation between the estimated medium scale factor, and reality?
 					double scale_scale = scale_percentage / avg_scale_ref[3];
-					
+
 					//System.Console.WriteLine ("scale_percentage {0}, ref {1}, relative {2}",
 					//	scale_percentage, avg_scale_ref[3], scale_scale  );
 
@@ -134,7 +134,7 @@ namespace FSpot
 
 			NumberOfPictures.Text 	= selection.Count.ToString();
 			TotalOriginalSize.Text 	= GLib.Format.SizeForDisplay (Orig_Photo_Size);
-			
+
 			UpdateEstimatedSize();
 
 			ShowAll ();
@@ -158,12 +158,12 @@ namespace FSpot
 				size_number = 4;
 			if (x_large_size.Active)
 				size_number = 5;
-			
+
 			if (!force_original)
 				Preferences.Set (Preferences.EXPORT_EMAIL_SIZE, size_number);
 			return sizes [ size_number ];
 		}
-		
+
 		private int GetScaleIndex ()
 		{
 			int scale = GetScaleSize();
@@ -178,7 +178,7 @@ namespace FSpot
 				int new_size_index;
 				long new_approx_total_size;
 				string approxresult;
-				
+
 				new_size_index = GetScaleIndex();
 				if (new_size_index == 0)
 					new_approx_total_size = Orig_Photo_Size;
@@ -186,11 +186,11 @@ namespace FSpot
 					new_approx_total_size = System.Convert.ToInt64(Orig_Photo_Size * avg_scale [new_size_index]);
 
 				approxresult = GLib.Format.SizeForDisplay (new_approx_total_size);
-				ApproxNewSize.Text 	= approxresult;	
+				ApproxNewSize.Text 	= approxresult;
 
 		}
 
-		public void on_size_toggled (object o, EventArgs args) 
+		public void on_size_toggled (object o, EventArgs args)
 		{
 			UpdateEstimatedSize();
 		}
@@ -208,14 +208,14 @@ namespace FSpot
 				return;
 			}
 			ProgressDialog progress_dialog = null;
-		
+
 			progress_dialog = new ProgressDialog (Catalog.GetString ("Preparing email"),
 												ProgressDialog.CancelButtonType.Stop,
 												selection.Count,
 												parent_window);
-			
+
 			size = GetScaleSize(); // Which size should we scale to. 0 --> Original
-			
+
 			// evaluate mailto command and define attachment args for cli
 			System.Text.StringBuilder attach_arg = new System.Text.StringBuilder ();
 			switch (Preferences.Get<string> (Preferences.GNOME_MAILTO_COMMAND)) {
@@ -234,10 +234,10 @@ namespace FSpot
 			}
 
 			// Create a tmp directory.
-			tmp_mail_dir = System.IO.Path.GetTempFileName ();	// Create a tmp file	
+			tmp_mail_dir = System.IO.Path.GetTempFileName ();	// Create a tmp file
 			System.IO.File.Delete (tmp_mail_dir);			// Delete above tmp file
 			System.IO.Directory.CreateDirectory (tmp_mail_dir);	// Create a directory with above tmp name
-			
+
 			System.Text.StringBuilder mail_attach = new System.Text.StringBuilder ();
 
 			FilterSet filters = new FilterSet ();
@@ -252,9 +252,9 @@ namespace FSpot
 				if ( (photo != null) && (!UserCancelled) ) {
 
 					if (progress_dialog != null)
-						UserCancelled = progress_dialog.Update (String.Format 
+						UserCancelled = progress_dialog.Update (String.Format
 							(Catalog.GetString ("Exporting picture \"{0}\""), photo.Name));
-							
+
 					if (UserCancelled)
 						break;
 
@@ -268,11 +268,11 @@ namespace FSpot
 						mail_attach.Append(((i == 0 && attach_arg.ToString () == ",") ? "" : attach_arg.ToString()) + request.Current.ToString ());
 					} catch (Exception e) {
 						Hyena.Log.ErrorFormat ("Error preparing {0}: {1}", selection[i].Name, e.Message);
-						HigMessageDialog md = new HigMessageDialog (parent_window, 
+						HigMessageDialog md = new HigMessageDialog (parent_window,
 											    DialogFlags.DestroyWithParent,
 											    MessageType.Error,
 											    ButtonsType.Close,
-											    Catalog.GetString("Error processing image"), 
+											    Catalog.GetString("Error processing image"),
 											    String.Format(Catalog.GetString("An error occured while processing \"{0}\": {1}"), selection[i].Name, e.Message));
 						md.Run();
 						md.Destroy();
@@ -280,8 +280,8 @@ namespace FSpot
 					}
 				}
 			} // foreach
-			
-			if (progress_dialog != null) 
+
+			if (progress_dialog != null)
 				progress_dialog.Destroy (); // No need to keep this window
 
 			if (!UserCancelled) {
@@ -307,7 +307,7 @@ namespace FSpot
 				case "evolution %s": //evo doesn't urldecode the subject
 					GtkBeans.Global.ShowUri (Screen, "mailto:?subject="; + mail_subject + mail_attach);
 					break;
-				default: 
+				default:
 					GtkBeans.Global.ShowUri (Screen, "mailto:?subject="; + System.Web.HttpUtility.UrlEncode(mail_subject) + mail_attach);
 					break;
 				}
diff --git a/src/SingleView.cs b/src/Clients/MainApp/FSpot/SingleView.cs
similarity index 97%
rename from src/SingleView.cs
rename to src/Clients/MainApp/FSpot/SingleView.cs
index 4f7b304..7b65c25 100644
--- a/src/SingleView.cs
+++ b/src/Clients/MainApp/FSpot/SingleView.cs
@@ -25,7 +25,7 @@ namespace FSpot {
 		[GtkBeans.Builder.Object]  Gtk.CheckMenuItem side_pane_item;
 		[GtkBeans.Builder.Object]  Gtk.CheckMenuItem toolbar_item;
 		[GtkBeans.Builder.Object]  Gtk.CheckMenuItem filenames_item;
-		
+
 		[GtkBeans.Builder.Object]  Gtk.MenuItem zoom_in;
 		[GtkBeans.Builder.Object]  Gtk.MenuItem zoom_out;
 
@@ -45,7 +45,7 @@ namespace FSpot {
 		[GtkBeans.Builder.Object] private Gtk.Window single_view;
 
 		public Gtk.Window Window {
-			get { 
+			get {
 				return single_view;
 			}
 		}
@@ -53,25 +53,25 @@ namespace FSpot {
 		PhotoImageView image_view;
 		FSpot.Widgets.IconView directory_view;
 		private SafeUri uri;
-		
+
 		UriCollection collection;
-		
+
 		FullScreenView fsview;
 
 		public SingleView (SafeUri [] uris)
 		{
 			this.uri = uris [0];
 			Log.Debug ("uri: " + this.uri);
-			
+
 			GtkBeans.Builder builder = new GtkBeans.Builder ("single_view.ui");
 			builder.Autoconnect (this);
-		
+
 			LoadPreference (Preferences.VIEWER_WIDTH);
 			LoadPreference (Preferences.VIEWER_MAXIMIZED);
 
 			Gtk.Toolbar toolbar = new Gtk.Toolbar ();
 			toolbar_hbox.PackStart (toolbar);
-		
+
 			rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), true);
 			rl_button.Clicked += HandleRotate270Command;
 			rl_button.TooltipText = Catalog.GetString ("Rotate photo left");
@@ -100,12 +100,12 @@ namespace FSpot {
 				FSpot.DragDropTargets.UriListEntry,
 				FSpot.DragDropTargets.PlainTextEntry
 			};
-			
+
 			directory_view = new FSpot.Widgets.IconView (collection);
 			directory_view.Selection.Changed += HandleSelectionChanged;
 			directory_view.DragDataReceived += HandleDragDataReceived;
-			Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table, 
-					DragAction.Copy | DragAction.Move); 
+			Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table,
+					DragAction.Copy | DragAction.Move);
 			directory_view.DisplayTags = false;
 			directory_view.DisplayDates = false;
 			directory_view.DisplayRatings = false;
@@ -119,7 +119,7 @@ namespace FSpot {
 			sidebar.AppendPage (directory_scrolled, Catalog.GetString ("Folder"), "gtk-directory");
 
 			AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged);
- 		
+
 			sidebar.Context = ViewContext.Single;
 
 			sidebar.CloseRequested += HandleHideSidePane;
@@ -135,15 +135,15 @@ namespace FSpot {
 			image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
 			image_view.DragDataReceived += HandleDragDataReceived;
 			Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
-					DragAction.Copy | DragAction.Move); 
+					DragAction.Copy | DragAction.Move);
 			image_scrolled.Add (image_view);
-			
+
 			Window.ShowAll ();
 
 			zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
-		
+
 			LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
- 			LoadPreference (Preferences.VIEWER_INTERPOLATION);
+			LoadPreference (Preferences.VIEWER_INTERPOLATION);
 			LoadPreference (Preferences.VIEWER_TRANSPARENCY);
 			LoadPreference (Preferences.VIEWER_TRANS_COLOR);
 
@@ -153,7 +153,7 @@ namespace FSpot {
 
 			Preferences.SettingChanged += OnPreferencesChanged;
 			Window.DeleteEvent += HandleDeleteEvent;
-			
+
 			collection.Changed += HandleCollectionChanged;
 
 			// wrap the methods to fit to the delegate
@@ -164,11 +164,11 @@ namespace FSpot {
 					IBrowsableItem [] item = {pointer.Current};
 					sidebar.HandleSelectionChanged (new PhotoList (item));
 			};
-			
+
 			image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged;
 
 			UpdateStatusLabel ();
-			
+
 			if (collection.Count > 0)
 				directory_view.Selection.Add (0);
 
@@ -213,7 +213,7 @@ namespace FSpot {
 					side_pane_item.Active = value;
 			}
 		}
-		
+
 		public bool ShowToolbar {
 			get {
 				return toolbar_hbox.Visible;
@@ -227,33 +227,33 @@ namespace FSpot {
 
 		private SafeUri CurrentUri
 		{
-			get { 
-			 	return this.uri; 
+			get {
+				return this.uri;
 			}
 			set {
-			 	this.uri = value;
+				this.uri = value;
 				collection.Clear ();
 				collection.LoadItems (new SafeUri[] { this.uri });
 			}
 		}
 
-		void HandleRotate90Command (object sender, System.EventArgs args) 
+		void HandleRotate90Command (object sender, System.EventArgs args)
 		{
 			RotateCommand command = new RotateCommand (this.Window);
 			if (command.Execute (RotateDirection.Clockwise, new IBrowsableItem [] { image_view.Item.Current }))
 				collection.MarkChanged (image_view.Item.Index, FullInvalidate.Instance);
 		}
 
-		void HandleRotate270Command (object sender, System.EventArgs args) 
+		void HandleRotate270Command (object sender, System.EventArgs args)
 		{
 			RotateCommand command = new RotateCommand (this.Window);
 			if (command.Execute (RotateDirection.Counterclockwise, new IBrowsableItem [] { image_view.Item.Current }))
 				collection.MarkChanged (image_view.Item.Index, FullInvalidate.Instance);
-		}		
+		}
 
 		private void HandleSelectionChanged (IBrowsableCollection selection)
 		{
-			
+
 			if (selection.Count > 0) {
 				image_view.Item.Index = ((FSpot.Widgets.IconView.SelectionCollection)selection).Ids[0];
 
@@ -290,8 +290,8 @@ namespace FSpot {
 		{
 			ShowToolbar = toolbar_item.Active;
 		}
-		
-		private void HandleHideSidePane (object sender, System.EventArgs args) 
+
+		private void HandleHideSidePane (object sender, System.EventArgs args)
 		{
 			ShowSidebar = false;
 		}
@@ -306,10 +306,10 @@ namespace FSpot {
 			HandleViewFullscreen (sender, args);
 			fsview.PlayPause ();
 		}
-	
+
 		private void HandleViewFilenames (object sender, System.EventArgs args)
 		{
-			directory_view.DisplayFilenames = filenames_item.Active; 
+			directory_view.DisplayFilenames = filenames_item.Active;
 			UpdateStatusLabel ();
 		}
 
@@ -358,7 +358,7 @@ namespace FSpot {
 
 			if ((ResponseType) response == ResponseType.Ok)
 				CurrentUri = new SafeUri (chooser.Uri, true);
-			
+
 
 			chooser.Destroy ();
 		}
@@ -374,15 +374,15 @@ namespace FSpot {
 			fsview.View.Item.Index = image_view.Item.Index;
 			fsview.Show ();
 		}
-		
+
 		private void HandleFullScreenViewDestroy (object sender, System.EventArgs args)
 		{
 			directory_view.Selection.Clear ();
-			if (fsview.View.Item.IsValid) 
+			if (fsview.View.Item.IsValid)
 				directory_view.Selection.Add (fsview.View.Item.Index);
 			fsview = null;
 		}
-		
+
 		public void HandleZoomOut (object sender, System.EventArgs args)
 		{
 			image_view.ZoomOut ();
@@ -420,7 +420,7 @@ namespace FSpot {
 		private void HandleImageViewButtonPressEvent (object sender, ButtonPressEventArgs args)
 		{
 			if (args.Event.Type != EventType.ButtonPress || args.Event.Button != 3)
-			 	return;
+				return;
 
 			Gtk.Menu popup_menu = new Gtk.Menu ();
 			bool has_item = image_view.Item.Current != null;
@@ -440,22 +440,22 @@ namespace FSpot {
 			args.RetVal = true;
 		}
 
-		void HandleDragDataReceived (object sender, DragDataReceivedArgs args) 
+		void HandleDragDataReceived (object sender, DragDataReceivedArgs args)
 		{
 			if (args.Info == FSpot.DragDropTargets.UriListEntry.Info
 			    || args.Info == FSpot.DragDropTargets.PlainTextEntry.Info) {
-				
-				/* 
-				 * If the drop is coming from inside f-spot then we don't want to import 
+
+				/*
+				 * If the drop is coming from inside f-spot then we don't want to import
 				 */
 				if (Gtk.Drag.GetSourceWidget (args.Context) != null)
 					return;
-				
+
 				UriList list = args.SelectionData.GetUriListData ();
 				collection.LoadItems (list.ToArray());
-				
+
 				Gtk.Drag.Finish (args.Context, true, false, args.Time);
-				
+
 				return;
 			}
 		}
@@ -481,15 +481,15 @@ namespace FSpot {
 		{
 			int width, height;
 			Window.GetSize (out width, out height);
-		
+
 			bool maximized = ((Window.GdkWindow.State & Gdk.WindowState.Maximized) > 0);
 			Preferences.Set (Preferences.VIEWER_MAXIMIZED, maximized);
-		
+
 			if (!maximized) {
 				Preferences.Set (Preferences.VIEWER_WIDTH,	width);
 				Preferences.Set (Preferences.VIEWER_HEIGHT,	height);
 			}
-		
+
 			Preferences.Set (Preferences.VIEWER_SHOW_TOOLBAR,	toolbar_hbox.Visible);
 			Preferences.Set (Preferences.VIEWER_SHOW_FILENAMES, filenames_item.Active);
 		}
@@ -499,17 +499,17 @@ namespace FSpot {
 			FileChooserDialog file_selector =
 				new FileChooserDialog ("Open", this.Window,
 						       FileChooserAction.Open);
-			
+
 			file_selector.SetUri (uri.ToString ());
 			int response = file_selector.Run ();
-			
+
 			if ((Gtk.ResponseType) response == Gtk.ResponseType.Ok) {
 				var l = new List<SafeUri> ();
 				foreach (var s in file_selector.Uris)
 					l.Add (new SafeUri (s));
 				new FSpot.SingleView (l.ToArray ());
 			}
-			
+
 			file_selector.Destroy ();
 		}
 
@@ -541,7 +541,7 @@ namespace FSpot {
 
 				Window.ReshowWithInitialSize();
 				break;
-			
+
 			case Preferences.VIEWER_SHOW_TOOLBAR:
 				if (toolbar_item.Active != Preferences.Get<bool> (key))
 					toolbar_item.Active = Preferences.Get<bool> (key);
@@ -600,8 +600,8 @@ namespace FSpot {
 
 			void HandleTransparentColorSet (object sender, System.EventArgs args)
 			{
-				Preferences.Set (Preferences.VIEWER_TRANS_COLOR, 
-						"#" + 
+				Preferences.Set (Preferences.VIEWER_TRANS_COLOR,
+						"#" +
 						(color_button.Color.Red / 256 ).ToString("x").PadLeft (2, '0') +
 						(color_button.Color.Green / 256 ).ToString("x").PadLeft (2, '0') +
 						(color_button.Color.Blue / 256 ).ToString("x").PadLeft (2, '0'));
@@ -616,13 +616,13 @@ namespace FSpot {
 				else if (as_color_radio.Active)
 					Preferences.Set (Preferences.VIEWER_TRANSPARENCY, "COLOR");
 			}
-			
+
 			static PreferenceDialog prefs;
 			public static void Show ()
 			{
 				if (prefs == null)
 					prefs = new PreferenceDialog ();
-				
+
 				prefs.Present ();
 			}
 
@@ -643,7 +643,7 @@ namespace FSpot {
 
 			void LoadPreference (string key)
 			{
-		
+
 				switch (key) {
 				case Preferences.VIEWER_INTERPOLATION:
 					interpolation_check.Active = Preferences.Get<bool> (key);
diff --git a/src/TagQueryWidget.cs b/src/Clients/MainApp/FSpot/TagQueryWidget.cs
similarity index 99%
rename from src/TagQueryWidget.cs
rename to src/Clients/MainApp/FSpot/TagQueryWidget.cs
index eb23a1f..7261f96 100644
--- a/src/TagQueryWidget.cs
+++ b/src/Clients/MainApp/FSpot/TagQueryWidget.cs
@@ -425,13 +425,13 @@ namespace FSpot
 		private void HandleDragDataReceived (object o, DragDataReceivedArgs args)
 		{
 			args.RetVal = true;
-			
+
 			if (args.Info == DragDropTargets.TagListEntry.Info) {
 
 				InsertTerm (args.SelectionData.GetTagsData (), rootTerm, null);
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.TagQueryEntry.Info) {
 
 				// FIXME: use drag data
@@ -439,7 +439,7 @@ namespace FSpot
 
 				// Prevent them from being removed again
 				Literal.FocusedLiterals = null;
-				
+
 				return;
 			}
 		}
diff --git a/src/TagSelectionWidget.cs b/src/Clients/MainApp/FSpot/TagSelectionWidget.cs
similarity index 94%
rename from src/TagSelectionWidget.cs
rename to src/Clients/MainApp/FSpot/TagSelectionWidget.cs
index 181ec4b..7295a56 100644
--- a/src/TagSelectionWidget.cs
+++ b/src/Clients/MainApp/FSpot/TagSelectionWidget.cs
@@ -2,7 +2,7 @@
  * TagSelectionWidget.cs
  *
  * Author(s)
- * 
+ *
  * This is free software. See COPYING for details.
  */
 
@@ -22,6 +22,7 @@ using Mono.Unix;
 
 using FSpot;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Utils;
 using FSpot.Widgets;
 using FSpot.UI.Dialog;
@@ -30,91 +31,91 @@ using Hyena.Widgets;
 
 
 namespace FSpot {
-	
+
 	public class TagSelectionWidget : SaneTreeView {
-		
+
 		Db database;
 		TagStore tag_store;
-	
+
 		// FIXME this is a hack.
 		private static Pixbuf empty_pixbuf = new Pixbuf (Colorspace.Rgb, true, 8, 1, 1);
-	
+
 		// If these are changed, the base () call in the constructor must be updated.
 		private const int IdColumn = 0;
 		private const int NameColumn = 1;
-	
+
 		// Selection management.
-	
-		public Tag TagAtPosition (double x, double y) 
+
+		public Tag TagAtPosition (double x, double y)
 	    {
 	        return TagAtPosition((int) x, (int) y);
 	    }
-	
-		public Tag TagAtPosition (int x, int y) 
+
+		public Tag TagAtPosition (int x, int y)
 		{
 			TreePath path;
-	
+
 			// Work out which tag we're dropping onto
 			if (!this.GetPathAtPos (x, y, out path))
 				return null;
-	
+
 			return TagByPath (path);
 		}
-	
-		public Tag TagByPath (TreePath path) 
+
+		public Tag TagByPath (TreePath path)
 		{
 			TreeIter iter;
-	
+
 			if (!Model.GetIter (out iter, path))
 				return null;
-	
+
 			return TagByIter (iter);
 		}
-		
+
 		public Tag TagByIter (TreeIter iter)
 		{
 			GLib.Value val = new GLib.Value ();
-	 
+
 			Model.GetValue (iter, IdColumn, ref val);
 			uint tag_id = (uint) val;
-	 
+
 			return tag_store.Get (tag_id) as Tag;
 		}
-	
+
 		// Loading up the store.
-	
+
 		private void LoadCategory (Category category, TreeIter parent_iter)
 		{
 			IList<Tag> tags = category.Children;
-	
+
 			foreach (Tag t in tags) {
 				TreeIter iter = (Model as TreeStore).AppendValues (parent_iter, t.Id, t.Name);
 				if (t is Category)
 					LoadCategory (t as Category, iter);
 			}
 		}
-	
+
 		public void ScrollTo (Tag tag)
 		{
 			TreeIter iter;
 			if (! TreeIterForTag (tag, out iter))
 				return;
-	
+
 			TreePath path = Model.GetPath (iter);
-	
+
 			ScrollToCell (path, null, false, 0, 0);
 		}
-	
+
 		public Tag [] TagHighlight {
 			get {
 				TreeModel model;
 				TreeIter iter;
-	
+
 				TreePath [] rows = Selection.GetSelectedRows(out model);
-	
+
 				Tag [] tags = new Tag [rows.Length];
 				int i = 0;
-	
+
 				foreach (TreePath path in rows) {
 					GLib.Value value = new GLib.Value ();
 					Model.GetIter (out iter, path);
@@ -125,37 +126,37 @@ namespace FSpot {
 				}
 				return tags;
 			}
-	
+
 			set {
 				if (value == null)
 					return;
-	
+
 				Selection.UnselectAll ();
-	
+
 				TreeIter iter;
 				foreach (Tag tag in value)
 					if (TreeIterForTag (tag, out iter))
 						Selection.SelectIter (iter);
 			}
 		}
-	
+
 		public void Update ()
 		{
 			(Model as TreeStore).Clear ();
-	
+
 			// GRRR We have to special case the root because I can't pass null for a
 			// Gtk.TreeIter (since it's a struct, and not a class).
 			// FIXME: This should be fixed in GTK#...  It's gross.
-	
+
 			foreach (Tag t in tag_store.RootCategory.Children) {
 				TreeIter iter = (Model as TreeStore).AppendValues (t.Id, t.Name);
 				if (t is Category)
 					LoadCategory (t as Category, iter);
 			}
 		}
-	
+
 		// Data functions.
-	
+
 		private void SetBackground (CellRenderer renderer, Tag tag)
 		{
 			// FIXME this should be themable but Gtk# doesn't give me access to the proper
@@ -167,8 +168,8 @@ namespace FSpot {
 				renderer.CellBackground = ToHashColor (this.Style.LightColors [(int) Gtk.StateType.Normal]);
 			*/
 		}
-	
-		private void IconDataFunc (TreeViewColumn column, 
+
+		private void IconDataFunc (TreeViewColumn column,
 					   CellRenderer renderer,
 					   TreeModel model,
 					   TreeIter iter)
@@ -180,9 +181,9 @@ namespace FSpot {
 
 			if (tag == null)
 				return;
-	
+
 			SetBackground (renderer, tag);
-	
+
 			if (tag.SizedIcon != null) {
 				Cms.Profile screen_profile;
 				if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
@@ -195,7 +196,7 @@ namespace FSpot {
 			} else
 				(renderer as CellRendererPixbuf).Pixbuf = empty_pixbuf;
 		}
-	
+
 		private void NameDataFunc (TreeViewColumn column,
 					   CellRenderer renderer,
 					   TreeModel model,
@@ -204,75 +205,75 @@ namespace FSpot {
 			// FIXME not sure why it happens...
 			if (model == null)
 				return;
-	
+
 			GLib.Value value = new GLib.Value ();
 			Model.GetValue (iter, IdColumn, ref value);
 			uint tag_id = (uint) value;
-	
+
 			Tag tag = tag_store.Get (tag_id) as Tag;
 			if (tag == null)
 				return;
-	
+
 			SetBackground (renderer, tag);
-	
+
 			(renderer as CellRendererText).Text = tag.Name;
 		}
-	
-		private bool TreeIterForTag(Tag tag, out TreeIter iter) 
+
+		private bool TreeIterForTag(Tag tag, out TreeIter iter)
 		{
 			TreeIter root = TreeIter.Zero;
 			iter = TreeIter.Zero;
-	
+
 			bool valid = Model.GetIterFirst (out root);
-			
+
 			while (valid) {
 				if (TreeIterForTagRecurse (tag, root, out iter))
 					return true;
-	
+
 				valid = Model.IterNext (ref root);
 			}
 			return false;
 		}
-	
+
 		// Depth first traversal
-		private bool TreeIterForTagRecurse (Tag tag, TreeIter parent, out TreeIter iter) 
+		private bool TreeIterForTagRecurse (Tag tag, TreeIter parent, out TreeIter iter)
 		{
 			bool valid = Model.IterChildren (out iter, parent);
-	
+
 			while (valid) {
 				if (TreeIterForTagRecurse (tag, iter, out iter))
 					return true;
 				valid = Model.IterNext (ref iter);
 			}
-	
+
 			GLib.Value value = new GLib.Value ();
 			Model.GetValue (parent, IdColumn, ref value);
 			iter = parent;
-	
+
 			if (tag.Id == (uint) value)
 				return true;
-	
+
 			return false;
 		}
-		
+
 		// Copy a branch of the tree to a new parent
 		// (note, this doesn't work generically as it only copies the first value of each node)
-		private void CopyBranch (TreeIter src, TreeIter dest, bool is_root, bool is_parent) 
+		private void CopyBranch (TreeIter src, TreeIter dest, bool is_root, bool is_parent)
 		{
 			TreeIter copy, iter;
 			GLib.Value value = new GLib.Value ();
 			TreeStore store = Model as TreeStore;
 			bool valid;
-			
+
 			store.GetValue (src, IdColumn, ref value);
 			Tag tag = (Tag) tag_store.Get ((uint)value);
 			if (is_parent) {
 				// we need to figure out where to insert it in the correct order
 				copy = InsertInOrder(dest, is_root, tag);
-			} else { 
+			} else {
 				copy = store.AppendValues (dest, (uint)value, tag.Name);
 			}
-			
+
 			valid = Model.IterChildren (out iter, src);
 			while (valid) {
 				// child nodes are already ordered
@@ -280,88 +281,88 @@ namespace FSpot {
 				valid = Model.IterNext (ref iter);
 			}
 		}
-	
+
 		// insert tag into the correct place in the tree, with parent. return the new TagIter in iter.
-		private TreeIter InsertInOrder (TreeIter parent, bool is_root, Tag tag) 
+		private TreeIter InsertInOrder (TreeIter parent, bool is_root, Tag tag)
 		{
 			TreeStore store = Model as TreeStore;
 			TreeIter iter;
 			Tag compare;
 			bool valid;
-	
+
 			if (is_root)
 				valid = store.GetIterFirst (out iter);
 			else
 				valid = store.IterChildren (out iter, parent);
-	
+
 			while (valid) {
 				//I have no desire to figure out a more performant sort over this...
 				GLib.Value value = new GLib.Value ();
 				store.GetValue(iter, IdColumn, ref value);
 				compare = (Tag) tag_store.Get ((uint) value);
-	
+
 				if (compare.CompareTo (tag) > 0) {
 					iter = store.InsertNodeBefore (iter);
 					store.SetValue (iter, IdColumn, tag.Id);
 					store.SetValue (iter, NameColumn, tag.Name);
-					
+
 					if (!is_root)
 						ExpandRow (Model.GetPath (parent), false);
 					return iter;
 				}
 				valid = store.IterNext(ref iter);
 			}
-			
-			if (is_root) 
-				iter = store.AppendNode (); 
+
+			if (is_root)
+				iter = store.AppendNode ();
 			else {
-				iter = store.AppendNode (parent); 
+				iter = store.AppendNode (parent);
 				ExpandRow (Model.GetPath (parent), false);
 			}
-	
+
 			store.SetValue (iter, IdColumn, tag.Id);
 			store.SetValue (iter, NameColumn, tag.Name);
 			return iter;
 		}
-	
+
 		private void HandleTagsRemoved (object sender, DbItemEventArgs<Tag> args)
 		{
 			TreeIter iter;
-	
+
 			foreach (Tag tag in args.Items) {
-				if (TreeIterForTag (tag, out iter)) 
+				if (TreeIterForTag (tag, out iter))
 					(Model as TreeStore).Remove (ref iter);
 			}
 		}
-		
+
 		private void HandleTagsAdded (object sender, DbItemEventArgs<Tag> args)
 		{
 			TreeIter iter = TreeIter.Zero;
-			
+
 			foreach (Tag tag in args.Items) {
 				if (tag.Category != tag_store.RootCategory)
 					TreeIterForTag (tag.Category, out iter);
-	
+
 				InsertInOrder (iter,
 					       tag.Category.Name == tag_store.RootCategory.Name,
 					       tag);
 			}
 		}
-		
+
 		private void HandleTagsChanged (object sender, DbItemEventArgs<Tag> args)
 		{
 			TreeStore store = Model as TreeStore;
 			TreeIter iter, category_iter, parent_iter;
-	
+
 			foreach (Tag tag in args.Items) {
 				TreeIterForTag (tag, out iter);
-				
+
 				bool category_valid = TreeIterForTag(tag.Category, out category_iter);
 				bool parent_valid = Model.IterParent(out parent_iter, iter);
-				
+
 				if ((category_valid && (category_iter.Equals (parent_iter))) || (!category_valid && !parent_valid)) {
 					// if we haven't been reparented
-					TreePath path = store.GetPath (iter); 
+					TreePath path = store.GetPath (iter);
 					store.EmitRowChanged (path, iter);
 				} else {
 					// It is a bit tougher. We need to do an annoying clone of structs...
@@ -370,7 +371,7 @@ namespace FSpot {
 				}
 			}
 		}
-	
+
 		void ExpandDefaults ()
 		{
 			int [] tags = FSpot.Preferences.Get<int []> (FSpot.Preferences.EXPANDED_TAGS);
@@ -378,11 +379,11 @@ namespace FSpot {
 				ExpandAll ();
 				return;
 			}
-	
+
 			TreeIter [] iters = ModelIters ();
 			if (iters == null || iters.Length == 0 || tags.Length == 0)
 				return;
-	
+
 			foreach (TreeIter iter in iters)
 			{
 				GLib.Value v = new GLib.Value ();
@@ -393,7 +394,7 @@ namespace FSpot {
 				}
 			}
 		}
-	
+
 		// Returns a flattened array of TreeIter's from the Model
 		TreeIter [] ModelIters ()
 		{
@@ -402,41 +403,41 @@ namespace FSpot {
 			{
 				return ModelIters (root, true).ToArray (typeof (TreeIter)) as TreeIter [];
 			}
-	
+
 			return null;
 		}
-	
+
 		// Returns ArrayList containing the root TreeIter and all TreeIters at root's level and
 		// descended from it
 		ArrayList ModelIters (TreeIter root, bool first)
 		{
 			ArrayList model_iters = new ArrayList (Model.IterNChildren ());
-	
+
 			model_iters.Add (root);
-	
+
 			// Append any children
 			TreeIter child;
 			if (Model.IterChildren (out child, root))
 				model_iters.AddRange (ModelIters (child, true));
-			
+
 			// Append any siblings and their children
 			if (first) {
 				while (Model.IterNext (ref root)) {
 					model_iters.AddRange (ModelIters (root, false));
 				}
 			}
-	
+
 			return model_iters;
 		}
-	
+
 		public void SaveExpandDefaults ()
 		{
 			ArrayList expanded_tags = new ArrayList ();
-			
+
 			TreeIter [] iters = ModelIters ();
 			if (iters == null)
 				return;
-	
+
 			foreach (TreeIter iter in iters)
 			{
 				if (GetRowExpanded (Model.GetPath (iter))) {
@@ -445,90 +446,90 @@ namespace FSpot {
 					expanded_tags.Add ((int)(uint) v);
 				}
 			}
-	
+
 	#if GCONF_SHARP_2_18
 			FSpot.Preferences.Set (	FSpot.Preferences.EXPANDED_TAGS, (int []) expanded_tags.ToArray (typeof (int)));
 	#else
 			if (expanded_tags.Count == 0)
 				expanded_tags.Add (-1);
-	
+
 			FSpot.Preferences.Set (	FSpot.Preferences.EXPANDED_TAGS,
 							(int []) expanded_tags.ToArray (typeof (int)));
 	#endif
 		}
-	
+
 		public void EditSelectedTagName ()
 		{
 			TreePath [] rows = Selection.GetSelectedRows();
 			if (rows.Length != 1)
 				return;
-			
+
 			//SetCursor (rows[0], NameColumn, true);
 			text_render.Editable = true;
 			text_render.Edited += HandleTagNameEdited;
 			SetCursor (rows[0], complete_column, true);
 			text_render.Editable = false;
 		}
-	
+
 		public void HandleTagNameEdited (object sender, EditedArgs args)
 		{
 			args.RetVal = false;
-	
+
 			TreeIter iter;
-	
+
 			if (!Model.GetIterFromString (out iter, args.Path))
 				return;
-	
+
 			GLib.Value value = new GLib.Value ();
 			Model.GetValue (iter, IdColumn, ref value);
 			uint tag_id = (uint) value;
 			Tag tag = tag_store.Get (tag_id) as Tag;
-	
+
 			// Ignore if it hasn't changed
 			if (tag.Name == args.NewText)
 				return;
-	
+
 			// Check that the tag doesn't already exist
 			if (String.Compare (args.NewText, tag.Name, true) != 0 &&
 			    tag_store.GetTagByName (args.NewText) != null) {
 				HigMessageDialog md = new HigMessageDialog (App.Instance.Organizer.Window,
-					DialogFlags.DestroyWithParent, 
-					MessageType.Warning, ButtonsType.Ok, 
+					DialogFlags.DestroyWithParent,
+					MessageType.Warning, ButtonsType.Ok,
 					Catalog.GetString ("Error renaming tag"),
 					Catalog.GetString ("This name is already in use"));
-	
+
 				md.Run ();
 				md.Destroy ();
 				this.GrabFocus ();
 				return;
 			}
-	
+
 			tag.Name = args.NewText;
 			tag_store.Commit (tag, true);
-	
+
 			text_render.Edited -= HandleTagNameEdited;
-	
+
 			args.RetVal = true;
 			return;
 		}
-		
-		private static TargetEntry [] tag_source_target_table = 
+
+		private static TargetEntry [] tag_source_target_table =
 			new TargetEntry [] {
 				DragDropTargets.TagListEntry
 			};
-	
-		private static TargetEntry [] tag_dest_target_table = 
+
+		private static TargetEntry [] tag_dest_target_table =
 			new TargetEntry [] {
 				DragDropTargets.PhotoListEntry,
 				DragDropTargets.UriListEntry,
 				DragDropTargets.TagListEntry
 			};
-	
-		
+
+
 		CellRendererPixbuf pix_render;
 		TreeViewColumn complete_column;
 		CellRendererText text_render;
-	
+
 		protected TagSelectionWidget (IntPtr raw) : base (raw) { }
 
 		// Constructor.
@@ -536,44 +537,44 @@ namespace FSpot {
 			: base (new TreeStore (typeof(uint), typeof(string)))
 		{
 			database = App.Instance.Database;
-			
+
 			HeadersVisible = false;
-	
+
 			complete_column = new TreeViewColumn ();
-					
+
 			pix_render = new CellRendererPixbuf ();
 			complete_column.PackStart (pix_render, false);
 			complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));
 			//complete_column.AddAttribute (pix_render, "pixbuf", OpenIconColumn);
-	
-			//icon_column = AppendColumn ("icon", 
+
+			//icon_column = AppendColumn ("icon",
 			//, new TreeCellDataFunc (IconDataFunc));
 			//icon_column = AppendColumn ("icon", new CellRendererPixbuf (), new TreeCellDataFunc (IconDataFunc));
-	
+
 			text_render = new CellRendererText ();
 			complete_column.PackStart (text_render, true);
 			complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));
-	
+
 			AppendColumn (complete_column);
-	
+
 			this.tag_store = tag_store;
-	
+
 			Update ();
-	
+
 			ExpandDefaults ();
-	
+
 			tag_store.ItemsAdded += HandleTagsAdded;
 			tag_store.ItemsRemoved += HandleTagsRemoved;
 			tag_store.ItemsChanged += HandleTagsChanged;
-	
+
 			// TODO make the search find tags that are not currently expanded
 			EnableSearch = true;
 			SearchColumn = NameColumn;
-	
+
 			// Transparent white
 			empty_pixbuf.Fill(0xffffff00);
-			
-			
+
+
 			/* set up drag and drop */
 			DragDataGet += HandleDragDataGet;
 			DragDrop += HandleDragDrop;
@@ -586,46 +587,46 @@ namespace FSpot {
 
 			DragDataReceived += HandleDragDataReceived;
 			DragMotion += HandleDragMotion;
-			
+
 			Gtk.Drag.DestSet (this,
 			                  DestDefaults.All,
 			                  tag_dest_target_table,
-			                  DragAction.Copy | DragAction.Move); 
+			                  DragAction.Copy | DragAction.Move);
 		}
-	
+
 		void HandleDragBegin (object sender, DragBeginArgs args)
 		{
 			Tag [] tags = TagHighlight;
 			int len = tags.Length;
 			int size = 32;
 			int csize = size/2 + len * size / 2 + 2;
-			
+
 			Pixbuf container = new Pixbuf (Gdk.Colorspace.Rgb, true, 8, csize, csize);
 			container.Fill (0x00000000);
-			
+
 			bool use_icon = false;;
 			while (len-- > 0) {
 				Pixbuf thumbnail = tags[len].Icon;
-				
+
 				if (thumbnail != null) {
-					Pixbuf small = PixbufUtils.ScaleToMaxSize (thumbnail, size, size);				
-					
+					Pixbuf small = PixbufUtils.ScaleToMaxSize (thumbnail, size, size);
+
 					int x = len * (size/2) + (size - small.Width)/2;
 					int y = len * (size/2) + (size - small.Height)/2;
-	
+
 					small.Composite (container, x, y, small.Width, small.Height, x, y, 1.0, 1.0, Gdk.InterpType.Nearest, 0xff);
 					small.Dispose ();
-	
+
 					use_icon = true;
 				}
 			}
-			
+
 			if (use_icon)
 				Gtk.Drag.SetIconPixbuf (args.Context, container, 0, 0);
-			
+
 			container.Dispose ();
 		}
-		
+
 		void HandleDragDataGet (object sender, DragDataGetArgs args)
 		{
 			if (args.Info == DragDropTargets.TagListEntry.Info) {
@@ -633,21 +634,21 @@ namespace FSpot {
 				return;
 			}
 		}
-	
+
 		void HandleDragDrop (object sender, DragDropArgs args)
 		{
 			args.RetVal = true;
 		}
-	
+
 		public void HandleDragMotion (object o, DragMotionArgs args)
 		{
 			TreePath path;
 	        TreeViewDropPosition position = TreeViewDropPosition.IntoOrAfter;
 			GetPathAtPos (args.X, args.Y, out path);
-	
+
 	        if (path == null)
 	            return;
-	
+
 	        // Tags can be dropped before, after, or into another tag
 	        if (args.Context.Targets[0].Name == "application/x-fspot-tags") {
 	            Gdk.Rectangle rect = GetCellArea(path, Columns[0]);
@@ -658,75 +659,75 @@ namespace FSpot {
 	                position = TreeViewDropPosition.After;
 	            }
 	        }
-	
+
 			SetDragDestRow (path, position);
-	
+
 			// Scroll if within 20 pixels of the top or bottom of the tag list
 			if (args.Y < 20)
 				Vadjustment.Value -= 30;
 	        else if (((o as Gtk.Widget).Allocation.Height - args.Y) < 20)
 				Vadjustment.Value += 30;
 		}
-	
+
 		public void HandleDragDataReceived (object o, DragDataReceivedArgs args)
 		{
 	        TreePath path;
 	        TreeViewDropPosition position;
-			
+
 	        if ( ! GetDestRowAtPos ((int)args.X, (int)args.Y, out path, out position))
 	            return;
-	
+
 	        Tag tag = path == null ? null : TagByPath (path);
 			if (tag == null)
 				return;
-	
+
 			if (args.Info == DragDropTargets.PhotoListEntry.Info) {
 				database.BeginTransaction ();
-				
+
 				Photo[] photos = args.SelectionData.GetPhotosData ();
 
 				foreach (Photo photo in photos) {
 
 					if (photo == null)
 						continue;
-					
+
 					photo.AddTag (tag);
 					database.Photos.Commit (photo);
-					
+
 					// FIXME: AddTagExtendes from Mainwindow.cs does some tag-icon handling.
 					// this should be done here or completely located to the Tag-class.
 				}
 				database.CommitTransaction ();
-				
+
 				// FIXME: this needs to be done somewhere:
 				//query_widget.PhotoTagsChanged (new Tag[] {tag});
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.UriListEntry.Info) {
 				UriList list = args.SelectionData.GetUriListData ();
-				
+
 				database.BeginTransaction ();
 				List<Photo> photos = new List<Photo> ();
 				foreach (var photo_uri in list) {
 					Photo photo = database.Photos.GetByUri (photo_uri);
-					
+
 					// FIXME - at this point we should import the photo, and then continue
 					if (photo == null)
 						continue;
-					
+
 					// FIXME this should really follow the AddTagsExtended path too
 					photo.AddTag (new Tag[] {tag});
 					photos.Add (photo);
 				}
 				database.Photos.Commit (photos.ToArray ());
 				database.CommitTransaction ();
-				
+
 				// FIXME: this need to be done
 				//InvalidateViews (); // but it seems not to be needed. tags are updated through in IconView through PhotoChanged
 				return;
 			}
-	
+
 			if (args.Info == DragDropTargets.TagListEntry.Info) {
 				Category parent;
 	            if (position == TreeViewDropPosition.Before || position == TreeViewDropPosition.After) {
@@ -734,96 +735,96 @@ namespace FSpot {
 	            } else {
 	                parent = tag as Category;
 	            }
-	
+
 				if (parent == null || TagHighlight.Length < 1) {
 	                args.RetVal = false;
 					return;
 	            }
-	
+
 	            int moved_count = 0;
 	            Tag [] highlighted_tags = TagHighlight;
 				foreach (Tag child in TagHighlight) {
 	                // FIXME with this reparenting via dnd, you cannot move a tag to root.
 	                if (child != parent && child.Category != parent && !child.IsAncestorOf(parent)) {
 	                    child.Category = parent as Category;
-	
+
 	                    // Saving changes will automatically cause the TreeView to be updated
 	                    database.Tags.Commit (child);
 	                    moved_count++;
 	                }
 	            }
-	
+
 	            // Reselect the same tags
 	            TagHighlight = highlighted_tags;
-	
+
 	            args.RetVal = moved_count > 0;
 				return;
 			}
 		}
-		
-	
+
+
 	#if TEST_TAG_SELECTION_WIDGET
-	
+
 		class Test {
-	
+
 			private TagSelectionWidget selection_widget;
-	
+
 			private void OnSelectionChanged ()
 			{
 				Log.Debug ("Selection changed:");
-	
+
 				foreach (Tag t in selection_widget.TagSelection)
 					Log.DebugFormat ("\t{0}", t.Name);
 			}
-	
+
 			private Test ()
 			{
 				const string path = "/tmp/TagSelectionTest.db";
-	
+
 				try {
 					File.Delete (path);
 				} catch {}
-	
+
 				Db db = new Db (path, true);
-	
+
 				Category people_category = db.Tags.CreateCategory (null, "People");
 				db.Tags.CreateTag (people_category, "Anna");
 				db.Tags.CreateTag (people_category, "Ettore");
 				db.Tags.CreateTag (people_category, "Miggy");
 				db.Tags.CreateTag (people_category, "Nat");
-	
+
 				Category places_category = db.Tags.CreateCategory (null, "Places");
 				db.Tags.CreateTag (places_category, "Milan");
 				db.Tags.CreateTag (places_category, "Boston");
-	
+
 				Category exotic_category = db.Tags.CreateCategory (places_category, "Exotic");
 				db.Tags.CreateTag (exotic_category, "Bengalore");
 				db.Tags.CreateTag (exotic_category, "Manila");
 				db.Tags.CreateTag (exotic_category, "Tokyo");
-	
+
 				selection_widget = new TagSelectionWidget (db.Tags);
 				selection_widget.SelectionChanged += new SelectionChangedHandler (OnSelectionChanged);
-	
+
 				Window window = new Window (WindowType.Toplevel);
 				window.SetDefaultSize (400, 200);
 				ScrolledWindow scrolled = new ScrolledWindow (null, null);
 				scrolled.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
 				scrolled.Add (selection_widget);
 				window.Add (scrolled);
-	
+
 				window.ShowAll ();
 			}
-	
+
 			static private void Main (string [] args)
 			{
 				Program program = new Program ("TagSelectionWidgetTest", "0.0", Modules.UI, args);
-	
+
 				Test test = new Test ();
-	
+
 				program.Run ();
 			}
 		}
-	
+
 	#endif
 	}
 }
diff --git a/src/Term.cs b/src/Clients/MainApp/FSpot/Term.cs
similarity index 99%
rename from src/Term.cs
rename to src/Clients/MainApp/FSpot/Term.cs
index 9f53861..9414566 100644
--- a/src/Term.cs
+++ b/src/Clients/MainApp/FSpot/Term.cs
@@ -753,9 +753,9 @@ namespace FSpot {
 		void HandleDragDataGet (object sender, DragDataGetArgs args)
 		{
 			args.RetVal = true;
-			
+
 			if (args.Info == DragDropTargets.TagListEntry.Info || args.Info == DragDropTargets.TagQueryEntry.Info) {
-				
+
 				// FIXME: do really write data
 				Byte [] data = Encoding.UTF8.GetBytes (String.Empty);
 				Atom [] targets = args.Context.Targets;
@@ -764,7 +764,7 @@ namespace FSpot {
 
 				return;
 			}
-			
+
 			// Drop cancelled
 			args.RetVal = false;
 
@@ -802,15 +802,15 @@ namespace FSpot {
 		private void HandleDragDataReceived (object o, DragDataReceivedArgs args)
 		{
 			args.RetVal = true;
-			
+
 			if (args.Info == DragDropTargets.TagListEntry.Info) {
 
 				if (TagsAdded != null)
 					TagsAdded (args.SelectionData.GetTagsData (), Parent, this);
-				
+
 				return;
 			}
-			
+
 			if (args.Info == DragDropTargets.TagQueryEntry.Info) {
 
 				if (! focusedLiterals.Contains(this))
diff --git a/src/ThumbnailCache.cs b/src/Clients/MainApp/FSpot/ThumbnailCache.cs
similarity index 100%
rename from src/ThumbnailCache.cs
rename to src/Clients/MainApp/FSpot/ThumbnailCache.cs
diff --git a/src/ThumbnailGenerator.cs b/src/Clients/MainApp/FSpot/ThumbnailGenerator.cs
similarity index 100%
rename from src/ThumbnailGenerator.cs
rename to src/Clients/MainApp/FSpot/ThumbnailGenerator.cs
diff --git a/src/TimeAdaptor.cs b/src/Clients/MainApp/FSpot/TimeAdaptor.cs
similarity index 93%
rename from src/TimeAdaptor.cs
rename to src/Clients/MainApp/FSpot/TimeAdaptor.cs
index 667d338..5cedb38 100644
--- a/src/TimeAdaptor.cs
+++ b/src/Clients/MainApp/FSpot/TimeAdaptor.cs
@@ -28,7 +28,7 @@ namespace FSpot {
 				GlassSet (this, query.LookupItem (date));
 		}
 
-		public void SetLimits (int min, int max) 
+		public void SetLimits (int min, int max)
 		{
 			DateTime start = DateFromIndex (min);
 
@@ -37,7 +37,7 @@ namespace FSpot {
 			if (order_ascending)
 				end = end.AddMonths (1);
 			else
-			 	end = end.AddMonths(-1);
+				end = end.AddMonths(-1);
 
 			SetLimits (start, end);
 		}
@@ -60,10 +60,10 @@ namespace FSpot {
 		public override string TickLabel (int item)
 		{
 			DateTime start = DateFromIndex (item);
-			
+
 			if ((start.Month == 12 && !order_ascending) || (start.Month == 1 && order_ascending))
 				return start.Year.ToString ();
-			else 
+			else
 				return null;
 		}
 
@@ -75,11 +75,11 @@ namespace FSpot {
 				return years [endyear - item/12][11 - item % 12];
 		}
 
-		public DateTime DateFromIndex (int item) 
+		public DateTime DateFromIndex (int item)
 		{
 			item = Math.Max (item, 0);
 			item = Math.Min (years.Count * 12 - 1, item);
-			
+
 			if (order_ascending)
 				return DateFromIndexAscending (item);
 
@@ -98,16 +98,16 @@ namespace FSpot {
 		{
 			int year = endyear - item/12;
 			int month = 12 - (item % 12);
-			
+
 			return new DateTime (year, month, DateTime.DaysInMonth (year, month)).AddDays (1.0).AddMilliseconds (-.1);
 		}
-		
+
 		public override int IndexFromPhoto (IBrowsableItem photo)
 		{
 			if (order_ascending)
 			       return IndexFromDateAscending (photo.Time);
 
-			return IndexFromDateDescending (photo.Time);	
+			return IndexFromDateDescending (photo.Time);
 		}
 
 		public int IndexFromDate (DateTime date)
@@ -137,7 +137,7 @@ namespace FSpot {
 			int year = date.Year;
 			int min_year = startyear;
 			int max_year = endyear;
-		
+
 			if (year < min_year || year > max_year) {
 				Log.DebugFormat ("TimeAdaptor.IndexFromPhoto year out of range[{1},{2}]: {0}", year, min_year, max_year);
 				return 0;
@@ -147,16 +147,16 @@ namespace FSpot {
 		}
 
 		public override IBrowsableItem PhotoFromIndex (int item)
-	       	{
+		{
 			DateTime start = DateFromIndex (item);
 			return query [query.LookupItem (start)];
-		
+
 		}
 
 		public override event ChangedHandler Changed;
-		
+
 		uint timer;
-		protected override void Reload () 
+		protected override void Reload ()
 		{
 			timer = Log.DebugTimerStart ();
 			Thread reload = new Thread (new ThreadStart (DoReload));
@@ -172,25 +172,25 @@ namespace FSpot {
 			Dictionary <int, int[]> years_tmp = query.Store.PhotosPerMonth ();
 			int startyear_tmp = Int32.MaxValue;
 			int endyear_tmp = Int32.MinValue;
-			
+
 			foreach (int year in years_tmp.Keys) {
 				startyear_tmp = Math.Min (year, startyear_tmp);
 				endyear_tmp = Math.Max (year, endyear_tmp);
 			}
-			
+
 			ThreadAssist.ProxyToMain (() => {
 				years = years_tmp;
 				startyear = startyear_tmp;
 				endyear = endyear_tmp;
-				
+
 				if (Changed != null)
 					Changed (this);
 			});
-			
+
 			Log.DebugTimerPrint (timer, "TimeAdaptor REAL Reload took {0}");
 		}
 
-		public TimeAdaptor (PhotoQuery query, bool order_ascending) 
+		public TimeAdaptor (PhotoQuery query, bool order_ascending)
 			: base (query, order_ascending)
 		{ }
 	}
diff --git a/src/TipWindow.cs b/src/Clients/MainApp/FSpot/TipWindow.cs
similarity index 76%
rename from src/TipWindow.cs
rename to src/Clients/MainApp/FSpot/TipWindow.cs
index 565cf48..b952df6 100644
--- a/src/TipWindow.cs
+++ b/src/Clients/MainApp/FSpot/TipWindow.cs
@@ -3,7 +3,7 @@ using Gdk;
 
 namespace FSpot {
 	internal class TipWindow : Gtk.Window {
-		public TipWindow () : base (Gtk.WindowType.Popup) 
+		public TipWindow () : base (Gtk.WindowType.Popup)
 		{
 			Name = "gtk-tooltips";
 			AppPaintable = true;
@@ -13,9 +13,9 @@ namespace FSpot {
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
 			Gtk.Style.PaintFlatBox (Style, GdkWindow, State, ShadowType.Out,
-						args.Area, this, "tooltip", Allocation.X, Allocation.Y, 
+						args.Area, this, "tooltip", Allocation.X, Allocation.Y,
 						Allocation.Width, Allocation.Height);
-			
+
 			return base.OnExposeEvent (args);
 		}
 	}
diff --git a/src/UriCollection.cs b/src/Clients/MainApp/FSpot/UriCollection.cs
similarity index 99%
rename from src/UriCollection.cs
rename to src/Clients/MainApp/FSpot/UriCollection.cs
index 0428ed1..96556d5 100644
--- a/src/UriCollection.cs
+++ b/src/Clients/MainApp/FSpot/UriCollection.cs
@@ -122,7 +122,7 @@ namespace FSpot {
 							     500,
 							     null,
 							     InfoLoaded);
-										    
+
 			}
 
 			void InfoLoaded (GLib.Object o, GLib.AsyncResult res)
@@ -157,4 +157,3 @@ namespace FSpot {
 
 
 }
-
diff --git a/src/Vector.cs b/src/Clients/MainApp/FSpot/Vector.cs
similarity index 99%
rename from src/Vector.cs
rename to src/Clients/MainApp/FSpot/Vector.cs
index 565eee6..79a7da8 100644
--- a/src/Vector.cs
+++ b/src/Clients/MainApp/FSpot/Vector.cs
@@ -4,7 +4,7 @@ namespace FSpot {
 	public class Vector {
 		double X;
 		double Y;
-		
+
 		public Vector (Gdk.Point p)
 		{
 			X = p.X;
@@ -23,12 +23,12 @@ namespace FSpot {
 			X = X / len;
 			Y = Y / len;
 		}
-		
+
 		public double AngleBetween (Vector v)
 		{
 			return AngleBetween (this, v);
 		}
-		
+
 		public static double AngleBetween (Vector v1, Vector v2)
 		{
 			double val = Dot (v1, v2) / (v1.Length * v2.Length);
diff --git a/src/XScreenSaverSlide.cs b/src/Clients/MainApp/FSpot/XScreenSaverSlide.cs
similarity index 88%
rename from src/XScreenSaverSlide.cs
rename to src/Clients/MainApp/FSpot/XScreenSaverSlide.cs
index 0e26169..82f1980 100644
--- a/src/XScreenSaverSlide.cs
+++ b/src/Clients/MainApp/FSpot/XScreenSaverSlide.cs
@@ -14,28 +14,28 @@ namespace FSpot {
 		public XScreenSaverSlide () : base (String.Empty)
 		{
 		}
-	       
+
 		protected override void OnRealized ()
 		{
 			string env = Environment.GetEnvironmentVariable (ScreenSaverEnviroment);
-			
+
 			if (env != null) {
 				try {
 					env = env.ToLower ();
-					
+
 					if (env.StartsWith ("0x"))
 						env = env.Substring (2);
 
 					uint xid = UInt32.Parse (env, System.Globalization.NumberStyles.HexNumber);
-					
+
 					GdkWindow = Gdk.Window.ForeignNew (xid);
 					Style.Attach (GdkWindow);
-					GdkWindow.Events = EventMask.ExposureMask 
-						| EventMask.StructureMask 
-						| EventMask.EnterNotifyMask 
-						| EventMask.LeaveNotifyMask 
+					GdkWindow.Events = EventMask.ExposureMask
+						| EventMask.StructureMask
+						| EventMask.EnterNotifyMask
+						| EventMask.LeaveNotifyMask
 						| EventMask.FocusChangeMask;
-					
+
 					Style.SetBackground (GdkWindow, Gtk.StateType.Normal);
 					GdkWindow.SetDecorations ((Gdk.WMDecoration) 0);
 					GdkWindow.UserData = this.Handle;
@@ -58,4 +58,4 @@ namespace FSpot {
 			base.OnRealized ();
 		}
 	}
-}		
+}
diff --git a/src/main.cs b/src/Clients/MainApp/FSpot/main.cs
similarity index 99%
rename from src/main.cs
rename to src/Clients/MainApp/FSpot/main.cs
index cb46988..24b541c 100644
--- a/src/main.cs
+++ b/src/Clients/MainApp/FSpot/main.cs
@@ -155,7 +155,7 @@ namespace FSpot
 
 			GLib.GType.Init ();
 			Catalog.Init ("f-spot", Defines.LOCALE_DIR);
-			
+
 			FSpot.Core.Global.PhotoUri = new SafeUri (Preferences.Get<string> (Preferences.STORAGE_PATH));
 
 			ApplicationContext.CommandLine = new CommandLineParser (args, 0);
diff --git a/src/ImageLoaderThread.cs b/src/Clients/MainApp/ImageLoaderThread.cs
similarity index 97%
rename from src/ImageLoaderThread.cs
rename to src/Clients/MainApp/ImageLoaderThread.cs
index 4e30cd6..4d0bd82 100644
--- a/src/ImageLoaderThread.cs
+++ b/src/Clients/MainApp/ImageLoaderThread.cs
@@ -105,7 +105,7 @@ public class ImageLoaderThread {
 		requests_by_uri = new Dictionary<SafeUri, RequestItem> ();
 //		requests_by_path = Hashtable.Synchronized (new Hashtable ());
 		processed_requests = new Queue ();
-		
+
 		pending_notify = new ThreadNotify (new Gtk.ReadyEvent (HandleProcessedRequests));
 
         instances.Add (this);
@@ -130,8 +130,8 @@ public class ImageLoaderThread {
 	public void PopBlock ()
 	{
 		if (System.Threading.Interlocked.Decrement (ref block_count) == 0) {
-			lock (queue) { 
-				Monitor.Pulse (queue); 
+			lock (queue) {
+				Monitor.Pulse (queue);
 			}
 		}
 	}
@@ -140,8 +140,8 @@ public class ImageLoaderThread {
 	{
 		should_cancel = true;
 		if (worker_thread != null) {
-			lock (queue) { 
-				Monitor.Pulse (queue); 
+			lock (queue) {
+				Monitor.Pulse (queue);
 			}
 			worker_thread.Join ();
 		}
@@ -193,12 +193,12 @@ public class ImageLoaderThread {
 			}
 		} catch (GLib.GException e){
 			Log.Exception (e);
-			return;		
+			return;
 		}
-		
+
 		if (orig_image == null)
 			return;
-		
+
 		request.Result = orig_image;
 	}
 
@@ -247,38 +247,38 @@ public class ImageLoaderThread {
 				lock (processed_requests) {
 					if (current_request != null) {
 						processed_requests.Enqueue (current_request);
-						
+
 						if (! pending_notify_notified) {
 							pending_notify.WakeupMain ();
 							pending_notify_notified = true;
 						}
-						
+
 						current_request = null;
 					}
 				}
-	
+
 				lock (queue) {
-					
+
 					while ((queue.Count == 0 || block_count > 0) && !should_cancel)
 						Monitor.Wait (queue);
 
 					if (should_cancel)
 						return;
-					
+
 					int pos = queue.Count - 1;
-	
+
 					current_request = queue [pos] as RequestItem;
 					queue.RemoveAt (pos);
 					requests_by_uri.Remove (current_request.Uri);
 				}
-				
+
 				ProcessRequest (current_request);
 			}
 		} catch (ThreadAbortException) {
 			//Aborting
 		}
 	}
-	
+
 	protected virtual void EmitLoaded (Queue results)
 	{
 		if (OnPixbufLoaded != null) {
@@ -290,8 +290,8 @@ public class ImageLoaderThread {
 	private void HandleProcessedRequests ()
 	{
 		Queue results;
-		
-		
+
+
 		lock (processed_requests) {
 			/* Copy the queued items out of the shared queue so we hold the lock for
 			   as little time as possible.  */
diff --git a/src/JobStore.cs b/src/Clients/MainApp/JobStore.cs
similarity index 96%
rename from src/JobStore.cs
rename to src/Clients/MainApp/JobStore.cs
index 16deefe..755cc30 100644
--- a/src/JobStore.cs
+++ b/src/Clients/MainApp/JobStore.cs
@@ -14,6 +14,7 @@ using System.Data;
 using System;
 using Banshee.Kernel;
 using FSpot.Jobs;
+using FSpot.Database;
 using FSpot;
 using FSpot.Core;
 using Hyena;
@@ -87,7 +88,7 @@ public abstract class Job : DbItem, IJob
 }
 
 public class JobStore : DbStore<Job> {
-	
+
 	internal static void CreateTable (FSpotDatabaseConnection database)
 	{
 		if (database.TableExists ("jobs")) {
@@ -107,14 +108,14 @@ public class JobStore : DbStore<Job> {
 	private Job LoadItem (IDataReader reader)
 	{
 		return (Job) Activator.CreateInstance (
-				Type.GetType (reader ["job_type"].ToString ()), 
-				Convert.ToUInt32 (reader["id"]), 
-				reader["job_options"].ToString (), 
-				Convert.ToInt32 (reader["run_at"]), 
+				Type.GetType (reader ["job_type"].ToString ()),
+				Convert.ToUInt32 (reader["id"]),
+				reader["job_options"].ToString (),
+				Convert.ToInt32 (reader["run_at"]),
 				(JobPriority) Convert.ToInt32 (reader["job_priority"]),
 				true);
 	}
-	
+
 	private void LoadAllItems ()
 	{
 		IDataReader reader = Database.Query ("SELECT id, job_type, job_options, run_at, job_priority FROM jobs");
@@ -161,7 +162,7 @@ public class JobStore : DbStore<Job> {
 
 		return job;
 	}
-	
+
 	public override void Commit (Job item)
 	{
 		if (item.Persistent)
@@ -179,7 +180,7 @@ public class JobStore : DbStore<Job> {
 
 		EmitChanged (item);
 	}
-	
+
 	public override Job Get (uint id)
 	{
             // we never use this
diff --git a/src/Clients/MainApp/Makefile.am b/src/Clients/MainApp/Makefile.am
new file mode 100644
index 0000000..cd8f8f7
--- /dev/null
+++ b/src/Clients/MainApp/Makefile.am
@@ -0,0 +1,212 @@
+ASSEMBLY = f-spot
+TARGET = exe
+LINK = $(REF_FSPOT)
+ASSEMBLY_BUILD_FLAGS = -unsafe
+
+SOURCES = \
+	FSpot/App.cs \
+	FSpot/BitConverter.cs \
+	FSpot/PhotoList.cs \
+	FSpot.ColorAdjustment/Adjustment.cs \
+	FSpot.ColorAdjustment/AutoStretch.cs \
+	FSpot.ColorAdjustment/Desaturate.cs \
+	FSpot.ColorAdjustment/FullColorAdjustment.cs \
+	FSpot.ColorAdjustment/SepiaTone.cs \
+	FSpot/ColorManagement.cs \
+	FSpot/ControlOverlay.cs \
+	FSpot.Database/Db.cs \
+	DependentListStore.cs \
+	FSpot/DragDropTargets.cs \
+	FSpot.Editors/Editor.cs \
+	FSpot.Editors/AutoStretchEditor.cs \
+	FSpot.Editors/CropEditor.cs \
+	FSpot.Editors/ColorEditor.cs \
+	FSpot.Editors/DesaturateEditor.cs \
+	FSpot.Editors/RedEyeEditor.cs \
+	FSpot.Editors/SepiaEditor.cs \
+	FSpot.Editors/SoftFocusEditor.cs \
+	FSpot.Editors/TiltEditor.cs \
+	ExportStore.cs \
+	FSpot.Extensions/ExportMenuItemNode.cs \
+	FSpot.Extensions/IExporter.cs \
+	FSpot.Extensions/ICommand.cs \
+	FSpot.Extensions/IMenuGenerator.cs \
+	FSpot.Extensions/IService.cs \
+	FSpot.Extensions/MenuNode.cs \
+	FSpot.Extensions/CommandMenuItemNode.cs \
+	FSpot.Extensions/ComplexMenuItemNode.cs \
+	FSpot.Extensions/PhotoSelectionCondition.cs \
+	FSpot.Extensions/PopupCommands.cs \
+	FSpot.Extensions/ServiceNode.cs \
+	FSpot.Extensions/SidebarPage.cs \
+	FSpot.Extensions/SidebarPageNode.cs \
+	FSpot.Extensions/TransitionNode.cs \
+	FSpot.Extensions/ViewModeCondition.cs \
+	FSpot/Fader.cs \
+	FSpot.Filters/ChmodFilter.cs \
+	FSpot.Filters/FilterRequest.cs \
+	FSpot.Filters/FilterSet.cs \
+	FSpot.Filters/IFilter.cs \
+	FSpot.Filters/JpegFilter.cs \
+	FSpot.Filters/ResizeFilter.cs \
+	FSpot.Filters/SharpFilter.cs \
+	FSpot.Filters/UniqueNameFilter.cs \
+	FSpot.Filters/WhiteListFilter.cs \
+	FSpot/FolderQueryWidget.cs \
+	FSpot/FullScreenView.cs \
+	FSpot/GroupAdaptor.cs \
+	FSpot/GroupSelector.cs \
+	FSpot/Accelerometer.cs \
+	FSpot/Histogram.cs \
+	FSpot.Loaders/AreaPreparedEventArgs.cs \
+	FSpot.Loaders/AreaUpdatedEventArgs.cs \
+	FSpot.Loaders/ImageLoader.cs \
+	FSpot.Loaders/IImageLoader.cs \
+	FSpot.Loaders/GdkImageLoader.cs \
+	ImageLoaderThread.cs \
+	FSpot.Import/ImportController.cs \
+	FSpot.Import/ImportSource.cs \
+	FSpot.Import/FileImportSource.cs \
+	FSpot.Import/MetadataImporter.cs \
+	FSpot/InfoOverlay.cs \
+	FSpot/ItemAction.cs \
+	FSpot.Imaging/DCRawFile.cs \
+	FSpot.Imaging/Ciff.cs \
+	FSpot.Imaging/ImageFile.cs \
+	FSpot.Imaging/InternalProcess.cs \
+	FSpot.Imaging/IOChannel.cs \
+	FSpot.Imaging/RafFile.cs \
+	FSpot.Imaging/Tiff.cs \
+	JobStore.cs \
+	FSpot.Jobs/SyncMetadataJob.cs \
+	FSpot.Jobs/CalculateHashJob.cs \
+	FSpot.Widgets/Loupe.cs \
+	FSpot/MainWindow.cs \
+	FSpot/MemorySurface.cs \
+	MetaStore.cs \
+	FSpot/Photo.cs \
+	FSpot/PhotoEventArgs.cs \
+	FSpot.Widgets/PhotoImageView.cs \
+	FSpot/PhotoLoader.cs \
+	FSpot/PhotoPopup.cs \
+	FSpot/PhotoQuery.cs \
+	PhotoStore.cs \
+	PhotoTagMenu.cs \
+	PhotoVersionCommands.cs \
+	FSpot/PhotoVersion.cs \
+	PhotoVersionMenu.cs \
+	FSpot/PhotoView.cs \
+	PixbufUtils.cs \
+	FSpot/PixbufCache.cs \
+	FSpot/Preferences.cs  \
+	FSpot/PrintOperation.cs \
+	FSpot/ProgressItem.cs \
+	FSpot/RotateCommand.cs \
+	RollStore.cs \
+	FSpot/SelectionDataExtensions.cs \
+	FSpot/SendEmail.cs \
+	FSpot/XScreenSaverSlide.cs \
+	FSpot/SingleView.cs \
+	FSpot.Widgets/Sharpener.cs \
+	FSpot.Widgets/SoftFocus.cs \
+	TagCommands.cs \
+	TagPopup.cs \
+	FSpot/TagQueryWidget.cs \
+	FSpot/TagSelectionWidget.cs \
+	TagStore.cs \
+	FSpot/ThumbnailCache.cs \
+	FSpot/ThumbnailGenerator.cs \
+	FSpot/Term.cs \
+	FSpot/TimeAdaptor.cs \
+	FSpot/TipWindow.cs \
+	FSpot.UI.Dialog/AboutDialog.cs \
+	FSpot.UI.Dialog/AdjustTimeDialog.cs \
+	FSpot.UI.Dialog/BuilderDialog.cs \
+	FSpot.UI.Dialog/DateRangeDialog.cs \
+	FSpot.UI.Dialog/EditExceptionDialog.cs \
+	FSpot.UI.Dialog/EditTagDialog.cs \
+	FSpot.UI.Dialog/EditTagIconDialog.cs \
+	FSpot.UI.Dialog/GladeDialog.cs \
+	FSpot.UI.Dialog/ImportDialog.cs \
+	FSpot.UI.Dialog/ImportFailureDialog.cs \
+	FSpot.UI.Dialog/LastRollDialog.cs \
+	FSpot.UI.Dialog/PreferenceDialog.cs \
+	FSpot.UI.Dialog/ProgressDialog.cs \
+	FSpot.UI.Dialog/RatingFilterDialog.cs \
+	FSpot.UI.Dialog/RepairDbDialog.cs \
+	FSpot.UI.Dialog/RepairDialog.cs \
+	FSpot.UI.Dialog/SelectionRatioDialog.cs \
+	FSpot.UI.Dialog/TagSelectionDialog.cs \
+	FSpot.UI.Dialog/ThreadProgressDialog.cs \
+	FSpot.Database/Updater.cs \
+	FSpot/UriCollection.cs \
+	FSpot.Utils/Util.cs \
+	FSpot/Vector.cs \
+	ThumbnailCommand.cs \
+	FSpot/QueryWidget.cs \
+	FSpot.Query/HiddenTag.cs \
+	FSpot.Widgets/SlideShow.cs \
+	FSpot.Widgets/CompositeUtils.cs \
+	FSpot.Widgets/Dissolve.cs \
+	FSpot.Widgets/EditorPage.cs \
+	FSpot.Widgets/Filmstrip.cs \
+	FSpot.Widgets/FindBar.cs \
+	FSpot.Widgets/FolderTreePage.cs \
+	FSpot.Widgets/FolderTreeView.cs \
+	FSpot.Widgets/FolderTreeModel.cs \
+	FSpot.Widgets/CellRendererTextProgress.cs\
+	FSpot.Widgets/IEffect.cs \
+	FSpot.Widgets/ITransition.cs \
+	FSpot.Widgets/IconView.cs \
+	FSpot.Widgets/ImageInfo.cs \
+	FSpot.Widgets/InfoBox.cs \
+	FSpot.Widgets/MetadataDisplay.cs \
+	FSpot.Widgets/PanZoom.cs \
+	FSpot.Widgets/PreviewPopup.cs  \
+	FSpot.Widgets/Push.cs \
+	FSpot.Widgets/QueryView.cs \
+	FSpot.Widgets/RatingMenuItem.cs \
+	FSpot.Widgets/Reveal.cs \
+	FSpot.Widgets/ScalingIconView.cs \
+	FSpot.Widgets/Sidebar.cs \
+	FSpot.Widgets/TagEntry.cs \
+	FSpot.Widgets/TagMenu.cs \
+	FSpot.Widgets/TagView.cs \
+	FSpot.Widgets/Tests/FindBarTests.cs \
+	FSpot.Widgets/TrayView.cs \
+	FSpot.Widgets/ViewContext.cs \
+	FSpot.Widgets/Wipe.cs \
+	FSpot/main.cs \
+	FSpot.Imaging/Tests/ImageFileTests.cs \
+	FSpot.Database/Tests/UpdaterTests.cs
+
+
+RESOURCES = \
+	$(top_srcdir)/COPYING \
+	$(top_srcdir)/icons/f-spot-not.png \
+	$(top_srcdir)/icons/f-spot-128.png \
+	$(top_srcdir)/icons/flower.png \
+	f-spot.glade \
+	ui/import.ui \
+	ui/mail_dialog.ui \
+	ui/main_window.ui \
+	ui/single_view.ui \
+	ui/version_name_dialog.ui \
+	ui/viewer_preferences.ui \
+	ui/tag_selection_dialog.ui \
+	FSpot.UI.Dialog/ui/AdjustTimeDialog.ui \
+	FSpot.UI.Dialog/ui/DateRangeDialog.ui \
+	FSpot.UI.Dialog/ui/EditTagDialog.ui \
+	FSpot.UI.Dialog/ui/EditTagIconDialog.ui \
+	FSpot.UI.Dialog/ui/PreferenceDialog.ui \
+	FSpot.UI.Dialog/ui/RatingFilterDialog.ui \
+	FSpot.UI.Dialog/ui/CreateTagDialog.ui \
+	FSpot.UI.Dialog/ui/LastImportRollFilterDialog.ui \
+	FSpot.UI.Dialog/ui/RepairDialog.ui \
+	FSpot.addin.xml
+
+include $(top_srcdir)/build/build.mk
+
+bin_SCRIPTS = f-spot
+EXTRA_DIST += f-spot.exe.config
+module_SCRIPTS += f-spot.exe.config
diff --git a/src/MetaStore.cs b/src/Clients/MainApp/MetaStore.cs
similarity index 99%
rename from src/MetaStore.cs
rename to src/Clients/MainApp/MetaStore.cs
index c907b9a..ee6a725 100644
--- a/src/MetaStore.cs
+++ b/src/Clients/MainApp/MetaStore.cs
@@ -22,7 +22,7 @@ public class MetaItem : DbItem {
 		get { return data; }
 		set { data = value; }
 	}
-	
+
 	public int ValueAsInt {
 		get { return System.Int32.Parse (Value); }
 		set { Value = value.ToString (); }
@@ -43,11 +43,11 @@ public class MetaStore : DbStore<MetaItem> {
 	public MetaItem FSpotVersion {
 		get { return GetByName (version); }
 	}
-	
+
 	public MetaItem DatabaseVersion {
 		get { return GetByName (db_version); }
 	}
-	
+
 	public MetaItem HiddenTagId {
 		get { return GetByName (hidden); }
 	}
@@ -76,14 +76,14 @@ public class MetaStore : DbStore<MetaItem> {
 	{
 		Create (version, Defines.VERSION);
 		Create (db_version, (is_new) ? FSpot.Database.Updater.LatestVersion.ToString () : "0");
-		
+
 		// Get the hidden tag id, if it exists
 		try {
 			string id = Database.Query<string> ("SELECT id FROM tags WHERE name = 'Hidden'");
 			Create (hidden, id);
 		} catch (Exception) {}
 	}
-	
+
 	private void LoadAllItems ()
 	{
 		IDataReader reader = Database.Query("SELECT id, name, data FROM meta");
@@ -115,36 +115,36 @@ public class MetaStore : DbStore<MetaItem> {
 
 		uint id = (uint)Database.Execute(new HyenaSqliteCommand("INSERT INTO meta (name, data) VALUES (?, ?)",
 				name, (data == null) ? "NULL" : data ));
-		
+
 		//FIXME This smells bad. This line used to be *before* the
 		//Command.executeNonQuery. It smells of a bug, but there might
 		//have been a reason for this
 
 		MetaItem item = new MetaItem (id, name, data);
 
-		
+
 		AddToCache (item);
 		EmitAdded (item);
 
 		return item;
 	}
-	
+
 	public override void Commit (MetaItem item)
 	{
 		Database.Execute(new HyenaSqliteCommand("UPDATE meta SET data = ? WHERE name = ?", item.Value, item.Name));
-		
+
 		EmitChanged (item);
 	}
-	
+
 	public override MetaItem Get (uint id)
 	{
 		return LookupInCache (id);
 	}
-	
+
 	public override void Remove (MetaItem item)
 	{
 		RemoveFromCache (item);
-		
+
 		Database.Execute (new HyenaSqliteCommand ("DELETE FROM meta WHERE id = ?", item.Id));
 
 		EmitRemoved (item);
diff --git a/src/PhotoStore.cs b/src/Clients/MainApp/PhotoStore.cs
similarity index 98%
rename from src/PhotoStore.cs
rename to src/Clients/MainApp/PhotoStore.cs
index 64c9de2..fd1eb96 100644
--- a/src/PhotoStore.cs
+++ b/src/Clients/MainApp/PhotoStore.cs
@@ -5,7 +5,7 @@
  *	Ettore Perazzoli <ettore perazzoli org>
  *	Larry Ewing <lewing gnome org>
  *	Stephane Delcroix <stephane delcroix org>
- * 
+ *
  * This is free software. See COPYING for details.
  */
 
@@ -23,6 +23,7 @@ using System;
 
 using FSpot;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Jobs;
 using FSpot.Query;
 using FSpot.Utils;
@@ -63,7 +64,7 @@ public class PhotoStore : DbStore<Photo> {
 
 		if (! is_new)
 			return;
-		
+
 		Database.Execute (
 			"CREATE TABLE photos (\n" +
 			"	id			INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \n" +
@@ -139,7 +140,7 @@ public class PhotoStore : DbStore<Photo> {
 
 				if (reader["time"].ToString () == DateTimeUtil.FromDateTime (time.Value).ToString ()) {
 					Log.Debug ("Skipping duplicate", uri);
-					
+
 					// Schedule a hash calculation job on the existing file.
 					CalculateHashJob.Create (FSpot.App.Instance.Database.Jobs, Convert.ToUInt32 (reader["id"]));
 
@@ -215,7 +216,7 @@ public class PhotoStore : DbStore<Photo> {
 			var filename = reader ["filename"].ToString ();
 			string import_md5 = reader["import_md5"] != null ? reader ["import_md5"].ToString () : null;
 			bool is_protected = Convert.ToBoolean (reader["protected"]);
-			                              
+
 			photo.AddVersionUnsafely (version_id, base_uri, filename, import_md5, name, is_protected);
 		}
 		reader.Close();
@@ -231,20 +232,20 @@ public class PhotoStore : DbStore<Photo> {
 			photo.AddTagUnsafely (tag);
 		}
 		reader.Close();
-	}		
-	
+	}
+
 	private void GetAllVersions  (string ids) {
 		IDataReader reader = Database.Query ("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id IN " + ids);
-		
+
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["photo_id"]);
 			Photo photo = LookupInCache (id);
-				
+
 			if (photo == null) {
 				//Console.WriteLine ("Photo {0} not found", id);
 				continue;
 			}
-				
+
 			if (photo.Loaded) {
 				//Console.WriteLine ("Photo {0} already Loaded", photo);
 				continue;
@@ -257,7 +258,7 @@ public class PhotoStore : DbStore<Photo> {
 				var filename = reader ["filename"].ToString ();
 				string import_md5 = reader["import_md5"] != null ? reader ["import_md5"].ToString () : null;
 				bool is_protected = Convert.ToBoolean (reader["protected"]);
-				
+
 				photo.AddVersionUnsafely (version_id, base_uri, filename, import_md5, name, is_protected);
 			}
 
@@ -277,12 +278,12 @@ public class PhotoStore : DbStore<Photo> {
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["photo_id"]);
 			Photo photo = LookupInCache (id);
-				
+
 			if (photo == null) {
 				//Console.WriteLine ("Photo {0} not found", id);
 				continue;
 			}
-				
+
 			if (photo.Loaded) {
 				//Console.WriteLine ("Photo {0} already Loaded", photo.Id);
 				continue;
@@ -322,7 +323,7 @@ public class PhotoStore : DbStore<Photo> {
 
 		if (photo == null)
 			return null;
-		
+
 		GetTags (photo);
 		GetVersions (photo);
 
@@ -354,7 +355,7 @@ public class PhotoStore : DbStore<Photo> {
 			photo.DefaultVersionId = Convert.ToUInt32 (reader["default_version_id"]);
 			photo.Rating = Convert.ToUInt32 (reader ["rating"]);
 		}
-		
+
 		reader.Close();
 
 		if (photo == null)
@@ -366,7 +367,7 @@ public class PhotoStore : DbStore<Photo> {
 			return cached;
 
 		AddToCache (photo);
-	
+
 		GetTags (photo);
 		GetVersions (photo);
 
@@ -375,7 +376,7 @@ public class PhotoStore : DbStore<Photo> {
 
 	public void Remove (Tag []tags)
 	{
-		Photo [] photos = Query (tags, String.Empty, null, null);	
+		Photo [] photos = Query (tags, String.Empty, null, null);
 
 		foreach (Photo photo in photos)
 			photo.RemoveCategory (tags);
@@ -383,7 +384,7 @@ public class PhotoStore : DbStore<Photo> {
 
 		foreach (Tag tag in tags)
 			App.Instance.Database.Tags.Remove (tag);
-		
+
 	}
 
 	public void Remove (Photo []items)
@@ -656,7 +657,7 @@ public class PhotoStore : DbStore<Photo> {
 	public Photo [] Query (Tag [] tags) {
 		return Query (tags, null, null, null, null);
 	}
-	
+
 	private string BuildQuery (params IQueryCondition [] conditions)
 	{
 		StringBuilder query_builder = new StringBuilder ("SELECT * FROM photos ");
@@ -664,29 +665,29 @@ public class PhotoStore : DbStore<Photo> {
 		bool where_added = false;
 		bool hidden_contained = false;
 		foreach (IQueryCondition condition in conditions) {
-			
+
 			if (condition == null)
 				continue;
-			
+
 			if (condition is HiddenTag)
 				hidden_contained = true;
-			
+
 			if (condition is IOrderCondition)
 				continue;
-			
+
 			string sql_clause = condition.SqlClause ();
-			
+
 			if (sql_clause == null || sql_clause.Trim () == String.Empty)
 				continue;
 			query_builder.Append (where_added ? " AND " : " WHERE ");
 			query_builder.Append (sql_clause);
 			where_added = true;
 		}
-		
+
 		/* if a HiddenTag condition is not explicitly given, we add one */
 		if ( ! hidden_contained) {
 			string sql_clause = HiddenTag.HideHiddenTag.SqlClause ();
-			
+
 			if (sql_clause != null && sql_clause.Trim () != String.Empty) {
 				query_builder.Append (where_added ? " AND " : " WHERE ");
 				query_builder.Append (sql_clause);
@@ -697,19 +698,19 @@ public class PhotoStore : DbStore<Photo> {
 		foreach (IQueryCondition condition in conditions) {
 			if (condition == null)
 				continue;
-			
+
 			if (!(condition is IOrderCondition))
 				continue;
-			
+
 			string sql_clause = condition.SqlClause ();
-			
+
 			if (sql_clause == null || sql_clause.Trim () == String.Empty)
 				continue;
 			query_builder.Append (order_added ? " , " : "ORDER BY ");
 			query_builder.Append (sql_clause);
 			order_added = true;
 		}
-		
+
 		return query_builder.ToString ();
 	}
 
@@ -784,7 +785,7 @@ public class PhotoStore : DbStore<Photo> {
 		}
 
 		photo_ids = photo_ids + "-1)";
-	
+
 		if (need_load) {
 			GetAllTags (photo_ids);
 			GetAllVersions (photo_ids);
@@ -793,7 +794,7 @@ public class PhotoStore : DbStore<Photo> {
 		} else {
 			//Console.WriteLine ("Skipped Loading Data");
 		}
-	
+
 		foreach (Photo photo in new_photos)
 			photo.Changes = null;
 
@@ -822,7 +823,7 @@ public class PhotoStore : DbStore<Photo> {
 			 uri.GetBaseUri ().ToString (),
 			filename));
 		}
-		
+
 		/* query by directory */
 		return Query (new HyenaSqliteCommand (
 			"SELECT id, "			+
@@ -873,7 +874,7 @@ public class PhotoStore : DbStore<Photo> {
 		//				AND photos.id IN (select photo_id FROM photo_tags where tag_id IN (tag1, tag2..)
 		//				AND extra_condition_string
 		//                  GROUP BY photos.id
-		
+
 		StringBuilder query_builder = new StringBuilder ();
 		ArrayList where_clauses = new ArrayList ();
 		query_builder.Append ("SELECT id, " 			+
@@ -881,11 +882,11 @@ public class PhotoStore : DbStore<Photo> {
 					     "base_uri, "			+
 					     "filename, "			+
 					     "description, "		+
-				      	     "roll_id, "   		+
+					     "roll_id, "   		+
 					     "default_version_id, "	+
 					     "rating "			+
 				      "FROM photos ");
-		
+
 		if (range != null) {
 			where_clauses.Add (String.Format ("time >= {0} AND time <= {1}",
 							  DateTimeUtil.FromDateTime (range.Start),
@@ -899,13 +900,13 @@ public class PhotoStore : DbStore<Photo> {
 
 		if (importidrange != null) {
 			where_clauses.Add (importidrange.SqlClause ());
-		}		
-		
+		}
+
 		if (hide && App.Instance.Database.Tags.Hidden != null) {
-			where_clauses.Add (String.Format ("id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0})", 
+			where_clauses.Add (String.Format ("id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0})",
 							  App.Instance.Database.Tags.Hidden.Id));
 		}
-		
+
 		if (searchexpression != null) {
 			where_clauses.Add (searchexpression.SqlCondition ());
 		}
@@ -913,7 +914,7 @@ public class PhotoStore : DbStore<Photo> {
 		if (extra_condition != null && extra_condition.Trim () != String.Empty) {
 			where_clauses.Add (extra_condition);
 		}
-		
+
 		if (where_clauses.Count > 0) {
 			query_builder.Append (" WHERE ");
 			query_builder.Append (String.Join (" AND ", ((String []) where_clauses.ToArray (typeof(String)))));
diff --git a/src/PhotoTagMenu.cs b/src/Clients/MainApp/PhotoTagMenu.cs
similarity index 99%
rename from src/PhotoTagMenu.cs
rename to src/Clients/MainApp/PhotoTagMenu.cs
index b13e7d2..77d6fac 100644
--- a/src/PhotoTagMenu.cs
+++ b/src/Clients/MainApp/PhotoTagMenu.cs
@@ -38,7 +38,7 @@ public class PhotoTagMenu : Menu {
 
 	public PhotoTagMenu () : base () {
 	}
-	
+
 	protected PhotoTagMenu (IntPtr raw) : base (raw) {}
 
 	public void Populate (IBrowsableItem [] photos) {
@@ -56,7 +56,7 @@ public class PhotoTagMenu : Menu {
 		foreach (Widget w in this.Children) {
 			w.Destroy ();
 		}
-		
+
 		if (hash.Count == 0) {
 			/* Fixme this should really set parent menu
 			   items insensitve */
@@ -73,7 +73,7 @@ public class PhotoTagMenu : Menu {
 			item.ShowAll ();
 			item.Activated += HandleActivate;
 		}
-				
+
 	}
 
 	void HandleActivate (object obj, EventArgs args)
@@ -82,7 +82,7 @@ public class PhotoTagMenu : Menu {
 			TagMenu.TagMenuItem t = obj as TagMenu.TagMenuItem;
 			if (t != null)
 				TagSelected (t.Value);
-			else 
+			else
 				Log.Debug ("Item was not a TagMenuItem");
 		}
 	}
diff --git a/src/PhotoVersionCommands.cs b/src/Clients/MainApp/PhotoVersionCommands.cs
similarity index 96%
rename from src/PhotoVersionCommands.cs
rename to src/Clients/MainApp/PhotoVersionCommands.cs
index 137fce6..b30689e 100644
--- a/src/PhotoVersionCommands.cs
+++ b/src/Clients/MainApp/PhotoVersionCommands.cs
@@ -37,7 +37,7 @@ public class PhotoVersionCommands
 			}
 
 			already_in_use_label.Text = String.Empty;
-			
+
 			if (new_name.Length == 0)
 				ok_button.Sensitive = false;
 			else
@@ -126,7 +126,7 @@ public class PhotoVersionCommands
 			string msg = String.Format (Catalog.GetString ("Really delete version \"{0}\"?"), photo.DefaultVersion.Name);
 			string desc = Catalog.GetString ("This removes the version and deletes the corresponding file from disk.");
 			try {
-				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent, 
+				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent,
 									   MessageType.Warning, msg, desc, ok_caption)) {
 					photo.DeleteVersion (photo.DefaultVersionId);
 					store.Commit (photo);
@@ -165,7 +165,7 @@ public class PhotoVersionCommands
 	}
 
 	// Detaching a version (making it a separate photo).
-	
+
 	public class Detach {
 		public bool Execute (PhotoStore store, Photo photo, Gtk.Window parent_window)
 		{
@@ -173,7 +173,7 @@ public class PhotoVersionCommands
 			string msg = String.Format (Catalog.GetString ("Really detach version \"{0}\" from \"{1}\"?"), photo.DefaultVersion.Name, photo.Name.Replace("_", "__"));
 			string desc = Catalog.GetString ("This makes the version appear as a separate photo in the library. To undo, drag the new photo back to its parent.");
 			try {
-				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent, 
+				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent,
 									   MessageType.Warning, msg, desc, ok_caption)) {
 					Photo new_photo = store.CreateFrom (photo, photo.RollId);
 					new_photo.CopyAttributesFrom (photo);
@@ -189,18 +189,18 @@ public class PhotoVersionCommands
 	}
 
 	// Reparenting a photo as version of another one
-	
+
 	public class Reparent {
 		public bool Execute (PhotoStore store, Photo [] photos, Photo new_parent, Gtk.Window parent_window)
 		{
 			string ok_caption = Catalog.GetString ("Re_parent");
-			string msg = String.Format (Catalog.GetPluralString ("Really reparent \"{0}\" as version of \"{1}\"?", 
-			                                                     "Really reparent {2} photos as versions of \"{1}\"?", photos.Length), 
+			string msg = String.Format (Catalog.GetPluralString ("Really reparent \"{0}\" as version of \"{1}\"?",
+			                                                     "Really reparent {2} photos as versions of \"{1}\"?", photos.Length),
 			                            new_parent.Name.Replace ("_", "__"), photos[0].Name.Replace ("_", "__"), photos.Length);
 			string desc = Catalog.GetString ("This makes the photos appear as a single one in the library. The versions can be detached using the Photo menu.");
 
 			try {
-				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent, 
+				if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent,
 									   MessageType.Warning, msg, desc, ok_caption)) {
 					uint highest_rating = new_parent.Rating;
 					string new_description = new_parent.Description;
@@ -209,7 +209,7 @@ public class PhotoVersionCommands
 						if (string.IsNullOrEmpty(new_description))
 							new_description = photo.Description;
 						new_parent.AddTag (photo.Tags);
-						
+
 						foreach (uint version_id in photo.VersionIds) {
 							new_parent.DefaultVersionId = new_parent.CreateReparentedVersion (photo.GetVersion (version_id) as PhotoVersion);
 							store.Commit (new_parent);
@@ -233,12 +233,12 @@ public class PhotoVersionCommands
 			return false;
 		}
 	}
-	
+
 	private static void HandleException (string msg, Exception e, Gtk.Window parent_window) {
 		Log.DebugException (e);
 		msg = Catalog.GetString (msg);
 		string desc = String.Format (Catalog.GetString ("Received exception \"{0}\"."), e.Message);
-		HigMessageDialog md = new HigMessageDialog (parent_window, DialogFlags.DestroyWithParent, 
+		HigMessageDialog md = new HigMessageDialog (parent_window, DialogFlags.DestroyWithParent,
 							    Gtk.MessageType.Error, ButtonsType.Ok, msg, desc);
 		md.Run ();
 		md.Destroy ();
diff --git a/src/PhotoVersionMenu.cs b/src/Clients/MainApp/PhotoVersionMenu.cs
similarity index 100%
rename from src/PhotoVersionMenu.cs
rename to src/Clients/MainApp/PhotoVersionMenu.cs
diff --git a/src/PixbufUtils.cs b/src/Clients/MainApp/PixbufUtils.cs
similarity index 94%
rename from src/PixbufUtils.cs
rename to src/Clients/MainApp/PixbufUtils.cs
index 161d2f7..0e5732c 100644
--- a/src/PixbufUtils.cs
+++ b/src/Clients/MainApp/PixbufUtils.cs
@@ -42,9 +42,9 @@ public static class PixbufUtils {
 				  bool upscale_smaller,
 				  out int fit_width, out int fit_height)
 	{
-		return Fit (pixbuf.Width, pixbuf.Height, 
-			    dest_width, dest_height, 
-			    upscale_smaller, 
+		return Fit (pixbuf.Width, pixbuf.Height,
+			    dest_width, dest_height,
+			    upscale_smaller,
 			    out fit_width, out fit_height);
 	}
 
@@ -61,13 +61,13 @@ public static class PixbufUtils {
 
 		double scale = Math.Min (dest_width / (double)orig_width,
 					 dest_height / (double)orig_height);
-		
+
 		if (scale > 1.0 && !upscale_smaller)
 			scale = 1.0;
 
 		fit_width = (int) Math.Round (scale * orig_width);
 		fit_height = (int) Math.Round (scale * orig_height);
-		
+
 		return scale;
 	}
 
@@ -81,7 +81,7 @@ public static class PixbufUtils {
 		int max_height;
 		ImageOrientation orientation;
 
-		public AspectLoader (int max_width, int max_height) 
+		public AspectLoader (int max_width, int max_height)
 		{
 			this.max_height = max_height;
 			this.max_width = max_width;
@@ -118,18 +118,18 @@ public static class PixbufUtils {
 			byte [] data = new byte [8192];
 			while (((count = stream.Read (data, 0, data.Length)) > 0) && loader.Write (data, (ulong)count))
 				;
-			
+
 			loader.Close ();
 			Pixbuf orig = loader.Pixbuf;
 			Gdk.Pixbuf rotated = FSpot.Utils.PixbufUtils.TransformOrientation (orig, orientation);
-			
+
 			if (orig != rotated) {
 				orig.Dispose ();
 			}
 			loader.Dispose ();
 			return rotated;
 		}
-		
+
 		public Pixbuf LoadFromFile (string path)
 		{
 			try {
@@ -140,14 +140,14 @@ public static class PixbufUtils {
 			} catch (Exception) {
 				Log.ErrorFormat ("Error loading photo {0}", path);
 				return null;
-			} 
+			}
 		}
 	}
 
 	public static Pixbuf ScaleToMaxSize (Pixbuf pixbuf, int width, int height)
 	{
 		return ScaleToMaxSize (pixbuf, width, height, true);
-	}	
+	}
 
 	public static Pixbuf ScaleToMaxSize (Pixbuf pixbuf, int width, int height, bool upscale)
 	{
@@ -163,7 +163,7 @@ public static class PixbufUtils {
 
 		return result;
 	}
-		
+
 	static public void GetSize (string path, out int width, out int height)
 	{
 		using (Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (path)) {
@@ -186,11 +186,11 @@ public static class PixbufUtils {
 
 		while ((n = input.Read (buffer, 0, 8192)) != 0)
 			loader.Write (buffer, (ulong) n);
-		
+
 		loader.Close ();
-		
+
 		return loader.Pixbuf;
-		
+
 	}
 
 	public static Pixbuf TagIconFromPixbuf (Pixbuf source)
@@ -205,7 +205,7 @@ public static class PixbufUtils {
 
 		if (source.Width > source.Height)
 			source = tmp = new Pixbuf (source, (source.Width - source.Height) /2, 0, source.Height, source.Height);
-		else if (source.Width < source.Height) 
+		else if (source.Width < source.Height)
 			source = tmp = new Pixbuf (source, 0, (source.Height - source.Width) /2, source.Width, source.Width);
 
 		if (source.Width == source.Height)
@@ -215,7 +215,7 @@ public static class PixbufUtils {
 
 		if (tmp != null)
 			tmp.Dispose ();
-		
+
 		return icon;
 	}
 
@@ -236,9 +236,9 @@ public static class PixbufUtils {
 		pos.Y = (height - pos.Height) / 2;
 
 		Pixbuf scaled = new Pixbuf (Colorspace.Rgb, false, 8, width, height);
-		scaled.Fill (0x000000); 
+		scaled.Fill (0x000000);
 
-		orig.Composite (scaled, pos.X, pos.Y, 
+		orig.Composite (scaled, pos.X, pos.Y,
 				pos.Width, pos.Height,
 				pos.X, pos.Y, scale, scale,
 				Gdk.InterpType.Bilinear,
@@ -253,9 +253,9 @@ public static class PixbufUtils {
 			return null;
 
 		Pixbuf flattened = new Pixbuf (Colorspace.Rgb, false, 8, pixbuf.Width, pixbuf.Height);
-		pixbuf.CompositeColor (flattened, 0, 0, 
-				       pixbuf.Width, pixbuf.Height, 
-				       0, 0, 1, 1, 
+		pixbuf.CompositeColor (flattened, 0, 0,
+				       pixbuf.Width, pixbuf.Height,
+				       0, 0, 1, 1,
 				       InterpType.Bilinear,
 				       255, 0, 0, 2000, 0xffffff, 0xffffff);
 
@@ -268,19 +268,19 @@ public static class PixbufUtils {
 	public static Pixbuf UnsharpMask (Pixbuf src, double radius, double amount, double threshold)
 	{
 		IntPtr raw_ret = f_pixbuf_unsharp_mask (src.Handle, radius, amount, threshold);
- 		Gdk.Pixbuf ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret, true);
+		Gdk.Pixbuf ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret, true);
 		return ret;
 	}
-	
+
 	[DllImport ("libfspot")]
 	static extern IntPtr f_pixbuf_blur (IntPtr src, double radius);
 
 	public static Pixbuf Blur (Pixbuf src, double radius)
 	{
 		IntPtr raw_ret = f_pixbuf_blur (src.Handle, radius);
- 		Gdk.Pixbuf ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret, true);
+		Gdk.Pixbuf ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret, true);
 		return ret;
-	}	
+	}
 
 	public unsafe static Gdk.Pixbuf RemoveRedeye (Gdk.Pixbuf src, Gdk.Rectangle area)
 	{
@@ -332,9 +332,9 @@ public static class PixbufUtils {
 		return buf.HasAlpha ? Cms.Format.Rgba8Planar : Cms.Format.Rgb8;
 	}
 
-	public static unsafe void ColorAdjust (Pixbuf src, Pixbuf dest, 
+	public static unsafe void ColorAdjust (Pixbuf src, Pixbuf dest,
 					       double brightness, double contrast,
-					       double hue, double saturation, 
+					       double hue, double saturation,
 					       int src_color, int dest_color)
 	{
 		if (src.Width != dest.Width || src.Height != dest.Height)
@@ -342,14 +342,14 @@ public static class PixbufUtils {
 
 		Cms.Profile srgb = Cms.Profile.CreateStandardRgb ();
 
-		Cms.Profile bchsw = Cms.Profile.CreateAbstract (256, 
-								0.0, 
+		Cms.Profile bchsw = Cms.Profile.CreateAbstract (256,
+								0.0,
 								brightness, contrast,
-								hue, saturation, src_color, 
+								hue, saturation, src_color,
 								dest_color);
 
 		Cms.Profile [] list = new Cms.Profile [] { srgb, bchsw, srgb };
-		Cms.Transform trans = new Cms.Transform (list, 
+		Cms.Transform trans = new Cms.Transform (list,
 							 PixbufCmsFormat (src),
 							 PixbufCmsFormat (dest),
 							 Cms.Intent.Perceptual, 0x0100);
@@ -370,10 +370,10 @@ public static class PixbufUtils {
 
 		for (int row = 0; row < src.Height; row++) {
 			trans.Apply ((IntPtr) (srcpix + row * src.Rowstride),
-				     (IntPtr) (destpix + row * dest.Rowstride), 
+				     (IntPtr) (destpix + row * dest.Rowstride),
 				     (uint)width);
 		}
-		
+
 	}
 
 	public static unsafe bool IsGray (Gdk.Pixbuf pixbuf, int max_difference)
@@ -430,9 +430,9 @@ public static class PixbufUtils {
 	{
 		using (var img = ImageFile.Create (uri)) {
 			return img.Orientation;
-		}	
+		}
 	}
-	
+
 	[Obsolete ("Use GetOrientation (SafeUri) instead")]
 	public static ImageOrientation GetOrientation (string path)
 	{
diff --git a/src/RollStore.cs b/src/Clients/MainApp/RollStore.cs
similarity index 99%
rename from src/RollStore.cs
rename to src/Clients/MainApp/RollStore.cs
index c753033..4dce7a5 100644
--- a/src/RollStore.cs
+++ b/src/Clients/MainApp/RollStore.cs
@@ -15,6 +15,7 @@ using System.Data;
 using System;
 
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Utils;
 using FSpot;
 
@@ -86,7 +87,7 @@ public class RollStore : DbStore<Roll>
 		using (IDataReader reader = Database.Query (new HyenaSqliteCommand ("SELECT count(*) AS count FROM photos WHERE roll_id = ?", roll.Id))) {
 			if (reader.Read ())
 				number_of_photos = Convert.ToUInt32 (reader ["count"]);
-               
+
 			reader.Close ();
 		}
                 return number_of_photos;
diff --git a/src/TagCommands.cs b/src/Clients/MainApp/TagCommands.cs
similarity index 99%
rename from src/TagCommands.cs
rename to src/Clients/MainApp/TagCommands.cs
index 50dc73d..58fb173 100644
--- a/src/TagCommands.cs
+++ b/src/Clients/MainApp/TagCommands.cs
@@ -143,13 +143,13 @@ public class TagCommands {
 							category_option_menu.Active = i;
 							return;
 						}
-					}	
+					}
 				} else {
 					category_option_menu.Active = 0;
 				}
 			}
 		}
-		
+
 		public Tag Execute (TagType type, Tag [] selection)
 		{
 			Category default_category = null;
diff --git a/src/TagPopup.cs b/src/Clients/MainApp/TagPopup.cs
similarity index 97%
rename from src/TagPopup.cs
rename to src/Clients/MainApp/TagPopup.cs
index 7e4741a..79acd85 100644
--- a/src/TagPopup.cs
+++ b/src/Clients/MainApp/TagPopup.cs
@@ -33,12 +33,12 @@ public class TagPopup {
         FSpot.TermMenuItem.Create (tags, popup_menu);
 
 		GtkUtil.MakeMenuSeparator (popup_menu);
-		
+
 		GtkUtil.MakeMenuItem (popup_menu, Catalog.GetString ("Create New Tag..."), "tag-new",
 				      App.Instance.Organizer.HandleCreateNewCategoryCommand, true);
 
         GtkUtil.MakeMenuSeparator (popup_menu);
-		
+
 		GtkUtil.MakeMenuItem (popup_menu,
 			Catalog.GetString ("Edit Tag..."), "gtk-edit",
 			delegate { App.Instance.Organizer.HandleEditSelectedTagWithTag (tag); }, tag != null && tags_count == 1);
@@ -46,7 +46,7 @@ public class TagPopup {
 		GtkUtil.MakeMenuItem (popup_menu,
 			Catalog.GetPluralString ("Delete Tag", "Delete Tags", tags_count), "gtk-delete",
 			new EventHandler (App.Instance.Organizer.HandleDeleteSelectedTagCommand), tag != null);
-		
+
 		GtkUtil.MakeMenuSeparator (popup_menu);
 
 		GtkUtil.MakeMenuItem (popup_menu,
@@ -66,7 +66,7 @@ public class TagPopup {
 		}
 
 		if (eb != null)
- 			popup_menu.Popup (null, null, null, eb.Button, eb.Time);
+			popup_menu.Popup (null, null, null, eb.Button, eb.Time);
 		else
 			popup_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
 
diff --git a/src/TagStore.cs b/src/Clients/MainApp/TagStore.cs
similarity index 98%
rename from src/TagStore.cs
rename to src/Clients/MainApp/TagStore.cs
index 552e631..4fb50ad 100644
--- a/src/TagStore.cs
+++ b/src/Clients/MainApp/TagStore.cs
@@ -8,6 +8,7 @@ using System.Data;
 using System;
 using FSpot;
 using FSpot.Core;
+using FSpot.Database;
 using FSpot.Jobs;
 using FSpot.Query;
 using FSpot.Utils;
@@ -17,7 +18,7 @@ using Hyena.Data.Sqlite;
 
 public class InvalidTagOperationException : InvalidOperationException {
 	public Tag tag;
-	
+
 	public InvalidTagOperationException (Tag t, string message) : base (message)
 	{
 		tag = t;
@@ -34,14 +35,14 @@ public class InvalidTagOperationException : InvalidOperationException {
 // Sorts tags into an order that it will be safe to delete
 // them in (eg children first).
 public class TagRemoveComparer : IComparer {
-	public int Compare (object obj1, object obj2) 
+	public int Compare (object obj1, object obj2)
 	{
 		Tag t1 = obj1 as Tag;
 		Tag t2 = obj2 as Tag;
-		
+
 		return Compare (t1, t2);
 	}
-       
+
 	public int Compare (Tag t1, Tag t2)
 	{
 		if (t1.IsAncestorOf (t2))
@@ -112,7 +113,7 @@ public class TagStore : DbStore<Tag> {
 
 		if (l.Count == 0)
 			return null;
-		
+
 		l.Sort (delegate (Tag t1, Tag t2) {return t2.Popularity.CompareTo (t1.Popularity); });
 
 		return l.ToArray ();
@@ -278,7 +279,7 @@ public class TagStore : DbStore<Tag> {
 
 		AddToCache (tag);
 		EmitAdded (tag);
-		
+
 		return tag;
 	}
 
@@ -305,17 +306,17 @@ public class TagStore : DbStore<Tag> {
 		else
 			return LookupInCache (id);
 	}
-	
+
 	public override void Remove (Tag tag)
 	{
 		Category category = tag as Category;
-		if (category != null && 
-		    category.Children != null && 
+		if (category != null &&
+		    category.Children != null &&
 		    category.Children.Count > 0)
 			throw new InvalidTagOperationException (category, "Cannot remove category that contains children");
 
 		RemoveFromCache (tag);
-		
+
 		tag.Category = null;
 
 		Database.Execute (new HyenaSqliteCommand ("DELETE FROM tags WHERE id = ?", tag.Id));
@@ -340,7 +341,7 @@ public class TagStore : DbStore<Tag> {
 
 	public override void Commit (Tag tag)
 	{
-		Commit (tag, false);	
+		Commit (tag, false);
 	}
 
 	public void Commit (Tag tag, bool update_xmp)
@@ -377,7 +378,7 @@ public class TagStore : DbStore<Tag> {
 							  tag.SortPriority,
 							  GetIconString (tag),
 							  tag.Id));
-			
+
 			if (update_xmp && Preferences.Get<bool> (Preferences.METADATA_EMBED_IN_IMAGE)) {
 				Photo [] photos = App.Instance.Database.Photos.Query (new Tag [] { tag });
 				foreach (Photo p in photos)
diff --git a/src/ThumbnailCommand.cs b/src/Clients/MainApp/ThumbnailCommand.cs
similarity index 99%
rename from src/ThumbnailCommand.cs
rename to src/Clients/MainApp/ThumbnailCommand.cs
index 5846022..2351fd0 100644
--- a/src/ThumbnailCommand.cs
+++ b/src/Clients/MainApp/ThumbnailCommand.cs
@@ -6,7 +6,7 @@ using FSpot.Utils;
 using FSpot.UI.Dialog;
 
 public class ThumbnailCommand {
-	
+
 	private Gtk.Window parent_window;
 
 	public ThumbnailCommand (Gtk.Window parent_window)
@@ -33,7 +33,7 @@ public class ThumbnailCommand {
 			foreach (IBrowsableItemVersion version in photo.Versions) {
 				loader.Request (version.Uri, ThumbnailSize.Large, 10);
 			}
-			
+
 			count++;
 		}
 
diff --git a/src/f-spot.exe.config.in b/src/Clients/MainApp/f-spot.exe.config.in
similarity index 100%
rename from src/f-spot.exe.config.in
rename to src/Clients/MainApp/f-spot.exe.config.in
diff --git a/src/f-spot.glade b/src/Clients/MainApp/f-spot.glade
similarity index 100%
rename from src/f-spot.glade
rename to src/Clients/MainApp/f-spot.glade
diff --git a/src/f-spot.in b/src/Clients/MainApp/f-spot.in
similarity index 97%
rename from src/f-spot.in
rename to src/Clients/MainApp/f-spot.in
index 89d5308..ee10345 100644
--- a/src/f-spot.in
+++ b/src/Clients/MainApp/f-spot.in
@@ -2,14 +2,14 @@
 
 prefix= prefix@
 exec_prefix= exec_prefix@
-libdir= libdir@ 
+libdir= libdir@
 turtledir= TURTLEDIR@
 
 EXE_TO_RUN="$libdir/f-spot/f-spot.exe"
 
 if test "x$DBUS_SESSION_BUS_ADDRESS" == "x"; then
     echo "** No session dbus found. Starting one **"
-    DBUSLAUNCH="dbus-launch" 
+    DBUSLAUNCH="dbus-launch"
 else
     DBUSLAUNCH=""
 fi
@@ -29,7 +29,7 @@ basedir_set=false
 
 for arg in "$@"; do
     case "x$arg" in
-    	x--debug)
+	x--debug)
 	    FSPOT_DEBUG="$arg"
 	    ;;
 	x--mdb)
diff --git a/src/Clients/MainApp/tmp b/src/Clients/MainApp/tmp
new file mode 100644
index 0000000..652024c
--- /dev/null
+++ b/src/Clients/MainApp/tmp
@@ -0,0 +1,83 @@
+AssemblyInfo.cs
+AssemblyInfo.cs.in
+DependentListStore.cs
+ExportStore.cs
+f-spot*
+f-spot.exe.config
+f-spot.exe.config.in
+f-spot.in
+ImageLoaderThread.cs
+JobStore.cs
+Makefile
+Makefile.am
+Makefile.in
+MetaStore.cs
+PhotoStore.cs
+PhotoTagMenu.cs
+PhotoVersionCommands.cs
+PhotoVersionMenu.cs
+PixbufUtils.cs
+RollStore.cs
+TagCommands.cs
+TagPopup.cs
+TagStore.cs
+ThumbnailCommand.cs
+
+FSpot:
+Accelerometer.cs
+App.cs
+BitConverter.cs
+ColorManagement.cs
+ControlOverlay.cs
+DragDropTargets.cs
+Fader.cs
+FolderQueryWidget.cs
+FullScreenView.cs
+GroupAdaptor.cs
+GroupSelector.cs
+Histogram.cs
+InfoOverlay.cs
+ItemAction.cs
+main.cs
+MainWindow.cs
+MemorySurface.cs
+Photo.cs
+PhotoEventArgs.cs
+PhotoList.cs
+PhotoLoader.cs
+PhotoPopup.cs
+PhotoQuery.cs
+PhotoVersion.cs
+PhotoView.cs
+PixbufCache.cs
+Preferences.cs
+PrintOperation.cs
+ProgressItem.cs
+QueryWidget.cs
+RotateCommand.cs
+SelectionDataExtensions.cs
+SendEmail.cs
+SingleView.cs
+TagQueryWidget.cs
+TagSelectionWidget.cs
+Term.cs
+ThumbnailCache.cs
+ThumbnailGenerator.cs
+TimeAdaptor.cs
+TipWindow.cs
+UriCollection.cs
+Vector.cs
+XScreenSaverSlide.cs
+
+FSpot.Database:
+Db.cs
+Updater.cs
+
+FSpot.Utils:
+Util.cs
+
+FSpot.Widgets:
+Loupe.cs
+PhotoImageView.cs
+Sharpener.cs
+SoftFocus.cs
diff --git a/src/ui/import.ui b/src/Clients/MainApp/ui/import.ui
similarity index 100%
rename from src/ui/import.ui
rename to src/Clients/MainApp/ui/import.ui
diff --git a/src/ui/mail_dialog.ui b/src/Clients/MainApp/ui/mail_dialog.ui
similarity index 100%
rename from src/ui/mail_dialog.ui
rename to src/Clients/MainApp/ui/mail_dialog.ui
diff --git a/src/ui/main_window.ui b/src/Clients/MainApp/ui/main_window.ui
similarity index 100%
rename from src/ui/main_window.ui
rename to src/Clients/MainApp/ui/main_window.ui
diff --git a/src/ui/single_view.ui b/src/Clients/MainApp/ui/single_view.ui
similarity index 100%
rename from src/ui/single_view.ui
rename to src/Clients/MainApp/ui/single_view.ui
diff --git a/src/ui/tag_selection_dialog.ui b/src/Clients/MainApp/ui/tag_selection_dialog.ui
similarity index 100%
rename from src/ui/tag_selection_dialog.ui
rename to src/Clients/MainApp/ui/tag_selection_dialog.ui
diff --git a/src/ui/version_name_dialog.ui b/src/Clients/MainApp/ui/version_name_dialog.ui
similarity index 100%
rename from src/ui/version_name_dialog.ui
rename to src/Clients/MainApp/ui/version_name_dialog.ui
diff --git a/src/ui/viewer_preferences.ui b/src/Clients/MainApp/ui/viewer_preferences.ui
similarity index 100%
rename from src/ui/viewer_preferences.ui
rename to src/Clients/MainApp/ui/viewer_preferences.ui
diff --git a/src/Clients/Makefile.am b/src/Clients/Makefile.am
new file mode 100644
index 0000000..9b96dfa
--- /dev/null
+++ b/src/Clients/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = \
+	MainApp
diff --git a/src/Makefile.am b/src/Makefile.am
index 8dc5fa7..91acf65 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,222 +2,18 @@ SUBDIRS = \
 	Utils \
 	Core \
 	Query \
-	FSpot.Database \
 	JobScheduler \
 	Bling \
 	Platform \
-	Widgets
+	Widgets \
+	Clients
 
-ASSEMBLY = f-spot
-TARGET = exe
-LINK = $(REF_FSPOT)
-ASSEMBLY_BUILD_FLAGS = -unsafe
+EXTRA_DIST = AssemblyInfo.cs.in
 
-SOURCES = \
-	App.cs \
-	BitConverter.cs \
-	PhotoList.cs \
-	ColorAdjustment/Adjustment.cs \
-	ColorAdjustment/AutoStretch.cs \
-	ColorAdjustment/Desaturate.cs \
-	ColorAdjustment/FullColorAdjustment.cs \
-	ColorAdjustment/SepiaTone.cs \
-	ColorManagement.cs \
-	ControlOverlay.cs \
-	Db.cs \
-	DependentListStore.cs \
-	DragDropTargets.cs \
-	Editors/Editor.cs \
-	Editors/AutoStretchEditor.cs \
-	Editors/CropEditor.cs \
-	Editors/ColorEditor.cs \
-	Editors/DesaturateEditor.cs \
-	Editors/RedEyeEditor.cs \
-	Editors/SepiaEditor.cs \
-	Editors/SoftFocusEditor.cs \
-	Editors/TiltEditor.cs \
-	ExportStore.cs \
-	Extensions/ExportMenuItemNode.cs \
-	Extensions/IExporter.cs \
-	Extensions/ICommand.cs \
-	Extensions/IMenuGenerator.cs \
-	Extensions/IService.cs \
-	Extensions/MenuNode.cs \
-	Extensions/CommandMenuItemNode.cs \
-	Extensions/ComplexMenuItemNode.cs \
-	Extensions/PhotoSelectionCondition.cs \
-	Extensions/PopupCommands.cs \
-	Extensions/ServiceNode.cs \
-	Extensions/SidebarPage.cs \
-	Extensions/SidebarPageNode.cs \
-	Extensions/TransitionNode.cs \
-	Extensions/ViewModeCondition.cs \
-	Fader.cs \
-	Filters/ChmodFilter.cs \
-	Filters/FilterRequest.cs \
-	Filters/FilterSet.cs \
-	Filters/IFilter.cs \
-	Filters/JpegFilter.cs \
-	Filters/ResizeFilter.cs \
-	Filters/SharpFilter.cs \
-	Filters/UniqueNameFilter.cs \
-	Filters/WhiteListFilter.cs \
-	FolderQueryWidget.cs \
-	FullScreenView.cs \
-	GroupAdaptor.cs \
-	GroupSelector.cs \
-	Accelerometer.cs \
-	Histogram.cs \
-	Loaders/AreaPreparedEventArgs.cs \
-	Loaders/AreaUpdatedEventArgs.cs \
-	Loaders/ImageLoader.cs \
-	Loaders/IImageLoader.cs \
-	Loaders/GdkImageLoader.cs \
-	ImageLoaderThread.cs \
-	Import/ImportController.cs \
-	Import/ImportSource.cs \
-	Import/FileImportSource.cs \
-	Import/MetadataImporter.cs \
-	InfoOverlay.cs \
-	ItemAction.cs \
-	Imaging/DCRawFile.cs \
-	Imaging/Ciff.cs \
-	Imaging/ImageFile.cs \
-	Imaging/InternalProcess.cs \
-	Imaging/IOChannel.cs \
-	Imaging/RafFile.cs \
-	Imaging/Tiff.cs \
-	JobStore.cs \
-	Jobs/SyncMetadataJob.cs \
-	Jobs/CalculateHashJob.cs \
-	Loupe.cs \
-	MainWindow.cs \
-	MemorySurface.cs \
-	MetaStore.cs \
-	Photo.cs \
-	PhotoEventArgs.cs \
-	PhotoImageView.cs \
-	PhotoLoader.cs \
-	PhotoPopup.cs \
-	PhotoQuery.cs \
-	PhotoStore.cs \
-	PhotoTagMenu.cs \
-	PhotoVersionCommands.cs \
-	PhotoVersion.cs \
-	PhotoVersionMenu.cs \
-	PhotoView.cs \
-	PixbufUtils.cs \
-	PixbufCache.cs \
-	Preferences.cs  \
-	PrintOperation.cs \
-	ProgressItem.cs \
-	RotateCommand.cs \
-	RollStore.cs \
-	SelectionDataExtensions.cs \
-	SendEmail.cs \
-	XScreenSaverSlide.cs \
-	SingleView.cs \
-	Sharpener.cs \
-	SoftFocus.cs \
-	TagCommands.cs \
-	TagPopup.cs \
-	TagQueryWidget.cs \
-	TagSelectionWidget.cs \
-	TagStore.cs \
-	ThumbnailCache.cs \
-	ThumbnailGenerator.cs \
-	Term.cs \
-	TimeAdaptor.cs \
-	TipWindow.cs \
-	UI.Dialog/AboutDialog.cs \
-	UI.Dialog/AdjustTimeDialog.cs \
-	UI.Dialog/BuilderDialog.cs \
-	UI.Dialog/DateRangeDialog.cs \
-	UI.Dialog/EditExceptionDialog.cs \
-	UI.Dialog/EditTagDialog.cs \
-	UI.Dialog/EditTagIconDialog.cs \
-	UI.Dialog/GladeDialog.cs \
-	UI.Dialog/ImportDialog.cs \
-	UI.Dialog/ImportFailureDialog.cs \
-	UI.Dialog/LastRollDialog.cs \
-	UI.Dialog/PreferenceDialog.cs \
-	UI.Dialog/ProgressDialog.cs \
-	UI.Dialog/RatingFilterDialog.cs \
-	UI.Dialog/RepairDbDialog.cs \
-	UI.Dialog/RepairDialog.cs \
-	UI.Dialog/SelectionRatioDialog.cs \
-	UI.Dialog/TagSelectionDialog.cs \
-	UI.Dialog/ThreadProgressDialog.cs \
-	Updater.cs \
-	UriCollection.cs \
-	Util.cs \
-	Vector.cs \
-	ThumbnailCommand.cs \
-	QueryWidget.cs \
-	Query/HiddenTag.cs \
-	Widgets/SlideShow.cs \
-	Widgets/CompositeUtils.cs \
-	Widgets/Dissolve.cs \
-	Widgets/EditorPage.cs \
-	Widgets/Filmstrip.cs \
-	Widgets/FindBar.cs \
-	Widgets/FolderTreePage.cs \
-	Widgets/FolderTreeView.cs \
-	Widgets/FolderTreeModel.cs \
-	Widgets/CellRendererTextProgress.cs\
-	Widgets/IEffect.cs \
-	Widgets/ITransition.cs \
-	Widgets/IconView.cs \
-	Widgets/ImageInfo.cs \
-	Widgets/InfoBox.cs \
-	Widgets/MetadataDisplay.cs \
-	Widgets/PanZoom.cs \
-	Widgets/PreviewPopup.cs  \
-	Widgets/Push.cs \
-	Widgets/QueryView.cs \
-	Widgets/RatingMenuItem.cs \
-	Widgets/Reveal.cs \
-	Widgets/ScalingIconView.cs \
-	Widgets/Sidebar.cs \
-	Widgets/TagEntry.cs \
-	Widgets/TagMenu.cs \
-	Widgets/TagView.cs \
-	Widgets/Tests/FindBarTests.cs \
-	Widgets/TrayView.cs \
-	Widgets/ViewContext.cs \
-	Widgets/Wipe.cs \
-	main.cs \
-	Tests/ImageFileTests.cs \
-	Tests/UpdaterTests.cs
+run:
+	@pushd $(top_builddir); \
+	make run; \
+	popd;
 
-
-RESOURCES = \
-	../COPYING \
-	../icons/f-spot-not.png \
-	../icons/f-spot-128.png \
-	../icons/flower.png \
-	f-spot.glade \
-	ui/import.ui \
-	ui/mail_dialog.ui \
-	ui/main_window.ui \
-	ui/single_view.ui \
-	ui/version_name_dialog.ui \
-	ui/viewer_preferences.ui \
-	ui/tag_selection_dialog.ui \
-	UI.Dialog/ui/AdjustTimeDialog.ui \
-	UI.Dialog/ui/DateRangeDialog.ui \
-	UI.Dialog/ui/EditTagDialog.ui \
-	UI.Dialog/ui/EditTagIconDialog.ui \
-	UI.Dialog/ui/PreferenceDialog.ui \
-	UI.Dialog/ui/RatingFilterDialog.ui \
-	UI.Dialog/ui/CreateTagDialog.ui \
-	UI.Dialog/ui/LastImportRollFilterDialog.ui \
-	UI.Dialog/ui/RepairDialog.ui \
-	FSpot.addin.xml
-
-include $(top_srcdir)/build/build.mk
-
-bin_SCRIPTS = f-spot
-EXTRA_DIST += f-spot.exe.config
-module_SCRIPTS += f-spot.exe.config
+MAINTAINERCLEANFILES = Makefile.in
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]