From: Pierre-Luc P. <pa...@us...> - 2004-01-11 16:43:49
|
Update of /cvsroot/gallery/gallery_remote/com/gallery/GalleryRemote/model In directory sc8-pr-cvs1:/tmp/cvs-serv9465/com/gallery/GalleryRemote/model Modified Files: Album.java Gallery.java Log Message: 2003-01-11 Pierre-Luc Paour <ga...@pa...> (1.3-b14) * Fixed adding album into root album: extra album would appear in the GR tree. * Reverted to previous version of ImageMagick from Windows: the version 1.2 shipped with caused many problems, because it's harder to use in pseudo-installed mode. * Added support to move an album into another album, catching up to protocol support that was added a while ago by Muti. * Slideshow is functional, added preference panel to set it up. It still needs to be refined, but is complete enough for initial feedback. Index: Album.java =================================================================== RCS file: /cvsroot/gallery/gallery_remote/com/gallery/GalleryRemote/model/Album.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- Album.java 27 Dec 2003 07:52:27 -0000 1.34 +++ Album.java 11 Jan 2004 16:43:16 -0000 1.35 @@ -128,6 +128,24 @@ } } + public void moveAlbumTo(StatusUpdate su, Album newParent) { + if (getGallery().getComm(su).hasCapability(GalleryCommCapabilities.CAPA_MOVE_ALBUM)) { + if (su == null) { + su = new StatusUpdateAdapter() { + }; + } + + try { + gallery.getComm(su).moveAlbum(su, this, newParent, false); + + gallery.fetchAlbums(su); + } catch (RuntimeException e) { + Log.log(Log.LEVEL_INFO, MODULE, "Server probably doesn't support move-album"); + Log.logException(Log.LEVEL_INFO, MODULE, e); + } + } + } + /** * Sets the server auto resize dimension. * Index: Gallery.java =================================================================== RCS file: /cvsroot/gallery/gallery_remote/com/gallery/GalleryRemote/model/Gallery.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Gallery.java 27 Dec 2003 07:52:27 -0000 1.40 +++ Gallery.java 11 Jan 2004 16:43:16 -0000 1.41 @@ -106,7 +106,8 @@ a.getTitle(), a.getCaption(), false); // refresh album list asynchronously - fetchAlbums(su); + fetchAlbums(su); + //getComm(su).fetchAlbums(su, false); return newAlbumName; } @@ -148,11 +149,12 @@ if (albumList.size() > 0) { selectedAlbum = (Album) this.albumList.get(0); } + if (oldList != null) { for (Iterator i = oldList.iterator(); i.hasNext();) { Album a = (Album) i.next(); - Log.log(Log.LEVEL_TRACE, MODULE, a.toString()); + //Log.log(Log.LEVEL_TRACE, MODULE, a.toString()); if (!a.getPicturesList().isEmpty()) { Log.log(Log.LEVEL_TRACE, MODULE, "Album " + a + " had pictures"); int j = albumList.indexOf(a); @@ -165,8 +167,22 @@ } } + refreshRootAlbums(); + notifyListeners(); } + + public void refreshRootAlbums() { + rootAlbums.clear(); + + for (Iterator it = albumList.iterator(); it.hasNext();) { + Album album = (Album) it.next(); + + if (album.getParentAlbum() == null) { + rootAlbums.add(album); + } + } + } /** * Adds an album to the gallery and selects the first one added. |