Skip to content

Commit

Permalink
2006-06-07 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b17)
Browse files Browse the repository at this point in the history
	* Added the ability for the screensaver to get its config
	  data from a URL.
	* Tweaked SaverBeans to make the settings interface more
	  Windows-like.
  • Loading branch information
Pierre-Luc Paour committed Jun 7, 2006
1 parent 462b55d commit 0beb117
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 40 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2006-06-07 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b17)

* Added the ability for the screensaver to get its config
data from a URL.
* Tweaked SaverBeans to make the settings interface more
Windows-like.

2006-04-27 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b16)

* Added a ScreenSaver based on GR, using SaverBeans
Expand Down
49 changes: 27 additions & 22 deletions build.xml
Expand Up @@ -3,15 +3,21 @@
A part of the Gallery project
</description>
<!-- set global properties for this build -->
<property file="build.properties" />

<property name="src" location="."/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="img" location="img"/>
<property name="dist" location="dist"/>
<property name="install" location="gallery_remote_Build_Output/Web_Installers/InstData"/>
<property name="docbase" location="../gallery_docs"/>
<property name="docdist" location="${docbase}/dist/grpackage"/>
<property name="iafolder" location="G:\\Program Files\\InstallAnywhere 7.1 Enterprise"/>

<!-- define the following properties in build.properties:
iafolder: the folder where the InstallAnywhere executable is located
nsis.path: the folder where NSIS (the Nullsoft Installer System) is located
docbase: the Gallery docs CVS directory (obsolete)
debug.params: optional debug parameters for the screensaver debug -->

<target name="init">
<!-- Create the time stamp -->
Expand Down Expand Up @@ -223,7 +229,7 @@

<delete dir="Gallery Remote.app"/>

<loadproperties srcfile="defaults.properties"/>
<property file="defaults.properties"/>

<taskdef name="jarbundler"
classpath="${lib}/jarbundler.jar"
Expand Down Expand Up @@ -301,22 +307,22 @@ tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>

<!-- SaverBeans screensaver -->
<target name="sbproperties">
<property file="build.properties" />
<property file="${user.home}/build.properties" />
<property file="defaults.properties"/>

<property name="sbbuild" value="build/sb" />

<property name="screensaver" value="Gallery" />
<property name="screensavershort" value="gallery" />
<property name="screensaver" value="Gallery" />
<property name="screensaverez" value="Gallery" />
<property name="screensavershort" value="gallery" />
<property name="screensavershortfull" value="gallery_screensaver" />
<property name="screensaver.class"
value="com.gallery.GalleryRemote.GRScreenSaver" />

<!-- Values for the Windows installer -->
<property name="productName" value="Gallery Remote Screensaver" />
<property name="productVersion" value="0.2" />
<property name="productVersion" value="${version}" />
<property name="productPublisher" value="The Gallery project" />
<property name="productWebSite"
value="http://gallery.sf.net/" />
<property name="productWebSite" value="http://gallery.sf.net/" />
</target>

<target name="sbcheck-nsis" description="Check if NSIS is present">
Expand Down Expand Up @@ -381,7 +387,7 @@ tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
<include name="GalleryRemoteScreenSaver.jar" />
</fileset>
<fileset dir="${sbbuild}/win32">
<include name="${screensaver}.scr" />
<include name="*.scr" />
</fileset>
<fileset dir="${basedir}">
<include name="COPYING" />
Expand All @@ -394,8 +400,8 @@ tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
includes="${screensavershort}-win32/**" />

<!-- Create distribution for Unix: -->
<mkdir dir="${dist}/${screensavershort}-unix" />
<copy todir="${dist}/${screensavershort}-unix">
<mkdir dir="${dist}/${screensavershortfull}.${version}.Unix" />
<copy todir="${dist}/${screensavershortfull}.${version}.Unix">
<fileset dir="lib">
<include name="saverbeans-api.jar" />
</fileset>
Expand All @@ -413,8 +419,8 @@ tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
<include name="README.txt" />
</fileset-->
</copy>
<zip destfile="${dist}/${screensavershort}-unix.zip" basedir="${dist}"
includes="${screensavershort}-unix/**" />
<zip destfile="${dist}/${screensavershortfull}.${version}.Unix.zip" basedir="${dist}"
includes="${screensavershortfull}.${version}.Unix/**" />
</target>

<target name="sbwin32-installer" depends="sbinit,sbcheck-nsis,sbdist">
Expand All @@ -424,20 +430,19 @@ tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
productVersion="${productVersion}"
productPublisher="${productPublisher}"
productWebSite="${productWebSite}"
licenseFile="${basedir}/COPYING"
outputFilename="${screensavershort}-setup.exe"
licenseFile="${basedir}/LICENSE"
outputFilename="${screensavershortfull}.${version}.exe"
saverbeansSdkPath="lib"
outFile="${sbbuild}/win32-installer/${screensavershort}.nsi"
jarDir="${sbbuild}/jar"
outFile="${dist}/${screensavershort}.nsi"
jarDir="${basedir}"
scrDir="${sbbuild}/win32"
>
<fileset dir="${src}/conf" includes="*.xml" />
<fileset dir="${src}/sbconf" includes="*.xml" />
</makewin32installscript>
<!-- Launch makensis on script to create the installer -->
<exec executable="${nsis.path}/makensis.exe" failonerror="true">
<arg line="${sbbuild}/win32-installer/${screensavershort}.nsi" />
<arg line="${dist}/${screensavershort}.nsi" />
</exec>
<echo message="Screensaver Installer generated to: ${sbbuild}/win32-installer/${screensavershort}-setup.exe" />
</target>

<!--
Expand Down
42 changes: 29 additions & 13 deletions com/gallery/GalleryRemote/GalleryRemoteScreenSaver.java
Expand Up @@ -14,9 +14,8 @@
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.*;
import java.net.URL;

import org.jdesktop.jdic.screensaver.ScreensaverContext;
import org.jdesktop.jdic.screensaver.ScreensaverSettings;
Expand Down Expand Up @@ -92,33 +91,50 @@ protected void loadIcons() {}

public void startup() {
ScreensaverSettings settings = context.getSettings();
settings.loadSettings("Gallery");
//settings.loadSettings("Gallery");
Log.log(Log.LEVEL_TRACE, MODULE, "Screensaver settings: " + settings.getProperties().toString());

Properties p = settings.getProperties();

galleries = new DefaultComboBoxModel();

gallery = new Gallery(GalleryRemote._().getCore().getMainStatusUpdate());
String url = settings.getProperty("url");
String curl = settings.getProperty("curl");

if (curl != null) {
try {
p.load(new URL(curl).openStream());
} catch (IOException e) {
Log.log(Log.LEVEL_CRITICAL, MODULE, "Error trying to get configuration file: " + curl);
Log.logException(Log.LEVEL_CRITICAL, MODULE, e);
}

Log.log(Log.LEVEL_TRACE, MODULE, "Fetched settings: " + settings.getProperties().toString());
}

String url = p.getProperty("url");
if (url != null) {
gallery.setStUrlString(url);
if (settings.getProperty("username") == null) {
if (p.getProperty("username") == null || p.getProperty("username").trim().length() == 0) {
gallery.cookieLogin = true;
} else {
gallery.setUsername(settings.getProperty("username"));
gallery.setPassword(settings.getProperty("password"));
gallery.setUsername(p.getProperty("username"));
gallery.setPassword(p.getProperty("password"));
}
gallery.setType(Gallery.TYPE_STANDALONE);

properties.setBooleanProperty(SLIDESHOW_RECURSIVE, settings.getProperty("recursive") != null);
properties.setBooleanProperty(SLIDESHOW_LOWREZ, settings.getProperty("hires") == null);
properties.setBooleanProperty(SLIDESHOW_NOSTRETCH, settings.getProperty("stretch") == null);
delay = Integer.parseInt(settings.getProperty("delay")) * 1000;
properties.setBooleanProperty(SLIDESHOW_RECURSIVE, p.getProperty("recursive") != null);
properties.setBooleanProperty(SLIDESHOW_LOWREZ, p.getProperty("hires") == null);
properties.setBooleanProperty(SLIDESHOW_NOSTRETCH, p.getProperty("stretch") == null);
delay = Integer.parseInt(p.getProperty("delay")) * 1000;
String albums = p.getProperty("album");
String[] albumsA = albums.split(",");

galleries.addElement(gallery);
ImageUtils.deferredTasks();

album = new Album(gallery);
album.setName(settings.getProperty("album"));
album.setName(albumsA[new Random().nextInt(albumsA.length)]);
album.addListDataListener(this);

album.fetchAlbumImages(statusUpdate,
Expand Down
6 changes: 3 additions & 3 deletions defaults.properties
Expand Up @@ -308,6 +308,6 @@ updateUrlBeta=http://gallery.sourceforge.net/gallery_remote_version_check_beta.p
#
# --- Do not edit below this line ---
#
version=1.5.1-b16
releaseDate=2006/04/27
aboutText=Gallery Remote\n \n \nA part of the Gallery Open-Source Project\nhttp://gallery.sourceforge.net\n \n \nMaintained by:\n \nPierre-Luc Paour\n \n \nInitial version by Chris Smith\n \n \nContributors:\n \nTim Miller\nDolan Halbrook\nMarkus Cozowicz\nScott Gartner\nAmedeo Paglione\nChris Schwerdt\nSeth Ladd\n \n \nArtwork by Ross A. Reyman\n \n \nBundled software:\n \nImageMagick\nJava look and feel Graphics Repository icons\njpegtran, Guido Vollbeding's version\nMetadataExtractor
version=1.5.1-b17
releaseDate=2006/06/07
aboutText=Gallery Remote\n \n \nA part of the Gallery Open-Source Project\nhttp://gallery.sourceforge.net\n \n \nMaintained by:\n \nPierre-Luc Paour\n \n \nInitial version by Chris Smith\n \n \nContributors:\n \nTim Miller\nDolan Halbrook\nMarkus Cozowicz\nScott Gartner\nAmedeo Paglione\nChris Schwerdt\nSeth Ladd\n \n \nArtwork by Ross A. Reyman\n \n \nBundled software:\n \nImageMagick\nJava look and feel Graphics Repository icons\njpegtran, Guido Vollbeding's version\nMetadataExtractor\nSaverBeans
Binary file modified lib/saverbeans-api.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions sbconf/Gallery.xml
Expand Up @@ -50,15 +50,17 @@ USA
_high-label="Faster" low="60" high="1" default="10" />

<_description>
Display a slideshow of one of your Gallery albums.
Display a slideshow based on a Gallery web site.

Specify the URL to your Gallery as:

http://www.example.com/gallery

You don't have to enter a username and password if you only want to show publicly available pictures.

If the Gallery is a G2, provide as the name of the album the album ID.
If the album is on a Gallery 2 server, provide as the name of the album the album ID. You can provide
one album, a comma-separated list of albums, or no album at all (in which case the entire Gallery will
be used).
</_description>

</screensaver>
58 changes: 58 additions & 0 deletions sbconf/GalleryEz.xml
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (c) 2004-2005 Sun Microsystems, Inc. All rights reserved. Use is
subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
-->

<!--
- xscreensaver-style configuration file for Gallery screensaver.
-
- https://jdic.dev.java.net/documentation/incubator/screensaver/xscreensaver-config.txt
-->
<screensaver name="GalleryEz" _label="Gallery Slideshow Easy">

<command arg="-root"/>

<command arg="-jar GalleryRemoteScreenSaver.jar"/>

<command arg="-class com.gallery.GalleryRemote.GRScreenSaver"/>
<!--command arg="-Xms80m"/>
<command arg="-Xmx80m"/-->

<file id="jdkhome" _label="Java Home (blank=auto)" arg="-jdkhome %" />

<string id="url" _label="Configuration URL" arg="-curl %"/>

<boolean id="hires" _label="Download higher resolution pictures (slower)" arg-set="-hires" />
<boolean id="stretch" _label="Stretch small pictures to full screen" arg-set="-stretch" />

<number id="delay" type="slider" arg="-delay %" _label="Slideshow speed" _low-label="Slow"
_high-label="Faster" low="60" high="1" default="10" />

<_description>
Display a slideshow based on a Gallery web site (easy version).

This is the "easy" version of the Gallery Slideshow; the only parameter you need to configure
is the Configuration URL, which the person who asked you to download and install this screen saver
must have provided. If that's not the case, or you want to use a version where you can
pick the albums that should be displayed in the slideshow, you should use the non-EZ version of
the Gallery screensaver.
</_description>

</screensaver>

0 comments on commit 0beb117

Please sign in to comment.