Skip to content

Commit

Permalink
2004-07-26 Pierre-Luc Paour <gallery@paour.com> (1.4.1-b1)
Browse files Browse the repository at this point in the history
	* Fixed double-upload to old versions of Gallery.
	* Fixed not able to select root album in the new album dialog.
	* Stripping HTML tags in slideshow.
	* Hiding mouse pointer in slideshow.
  • Loading branch information
Pierre-Luc Paour committed Jul 30, 2004
1 parent 100a219 commit 99516f8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 18 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2004-07-29 Pierre-Luc Paour <gallery@paour.com> (1.4.1-b1)

* Fixed double-upload to old versions of Gallery.
* Fixed not able to select root album in the new album dialog.
* Stripping HTML tags in slideshow.
* Hiding mouse pointer in slideshow.

2004-07-20 Pierre-Luc Paour <gallery@paour.com> (1.4)

* Released.
Expand Down
7 changes: 3 additions & 4 deletions com/gallery/GalleryRemote/GalleryComm2.java
Expand Up @@ -729,7 +729,7 @@ private void list22() throws IOException, ModuleException {
form_data = fudgeFormParameters(form_data);

// load and validate the response
Properties p = requestResponse(form_data, su, this);
GalleryProperties p = requestResponse(form_data, su, this);
if (p.getProperty("status").equals(GR_STAT_SUCCESS)) {
ArrayList albums = new ArrayList();

Expand Down Expand Up @@ -868,9 +868,7 @@ private void list22() throws IOException, ModuleException {
depth++;
}

if ("no".equals(p.getProperty("can_create_root"))) {
rootAlbum.setCanCreateSubAlbum(false);
}
rootAlbum.setCanCreateSubAlbum(p.getBooleanProperty("can_create_root"));

Log.log(Log.LEVEL_TRACE, MODULE, "Ordered " + orderedAlbums.size() + " albums");

Expand Down Expand Up @@ -1340,6 +1338,7 @@ GalleryProperties requestResponse(NVPair form_data[], byte[] data, URL galUrl, b

// catch session expiration problems
if (!alreadyRetried && !g.cookieLogin && g.getUsername() != null && g.getUsername().length() != 0
&& p.getProperty("debug_user_already_logged_in") != null
&& ! "1".equals(p.getProperty("debug_user_already_logged_in"))) {
Log.log(Log.LEVEL_INFO, MODULE, "The session seems to have expired: trying to login and retry...");

Expand Down
5 changes: 0 additions & 5 deletions com/gallery/GalleryRemote/GalleryComm2_5.java
Expand Up @@ -78,9 +78,4 @@ public NVPair[] fudgeFormParameters(NVPair form_data[]) {
void handleCapabilities() {
// don't do anything and leave capabilities to the default value
}

GalleryProperties requestResponse(NVPair form_data[], byte[] data, URL galUrl, boolean checkResult, StatusUpdate su, GalleryTask task) throws GR2Exception, ModuleException, IOException {
// G2 doesn't return debug login info. This prevents GR from uploading each image to G2 twice.
return requestResponse(form_data, data, galUrl, checkResult, su, task, true);
}
}
12 changes: 8 additions & 4 deletions com/gallery/GalleryRemote/NewAlbumDialog.java
Expand Up @@ -26,6 +26,7 @@
import com.gallery.GalleryRemote.util.GRI18n;

import javax.swing.*;
import javax.swing.event.PopupMenuListener;
import javax.swing.border.BevelBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand Down Expand Up @@ -101,8 +102,6 @@ private void jbInit() {

jAlbum = new JComboBox(albums);
jAlbum.setRenderer(new AlbumListRenderer());
jAlbum.setFont(UIManager.getFont("Label.font"));
jAlbum.addItemListener(this);

if (defaultAlbum == null) {
jAlbum.setSelectedItem(gallery.getRoot());
Expand Down Expand Up @@ -156,6 +155,7 @@ private void jbInit() {

jOk.addActionListener(this);
jCancel.addActionListener(this);
jAlbum.addItemListener(this);

getRootPane().setDefaultButton(jOk);

Expand Down Expand Up @@ -199,7 +199,9 @@ public Album getParentAlbum() {
}

public void itemStateChanged(ItemEvent e) {
resetUIState();
if (e.getStateChange() == ItemEvent.SELECTED) {
resetUIState();
}
}

void resetUIState() {
Expand All @@ -220,7 +222,9 @@ public Component getListCellRendererComponent(JList list, Object value, int inde
isSelected, cellHasFocus);

if (((Album) value).getCanCreateSubAlbum()) {
setForeground(Color.BLACK);
if (! isSelected) {
setForeground(Color.BLACK);
}
} else {
setForeground(Color.GRAY);
}
Expand Down
49 changes: 46 additions & 3 deletions com/gallery/GalleryRemote/SlideshowFrame.java
Expand Up @@ -9,19 +9,23 @@

import javax.swing.*;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.awt.geom.Rectangle2D;
import java.awt.event.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

/**
* Created by IntelliJ IDEA.
* User: paour
* Date: Dec 9, 2003
*/
public class SlideshowFrame extends PreviewFrame implements Runnable, PreferenceNames, CancellableTransferListener {
public class SlideshowFrame extends PreviewFrame
implements Runnable, PreferenceNames, CancellableTransferListener, MouseMotionListener {
public static final String MODULE = "SlideFrame";

List pictures = null;
Expand Down Expand Up @@ -59,6 +63,10 @@ public class SlideshowFrame extends PreviewFrame implements Runnable, Preference
long dontShowUntil = 0;
Thread controllerThread = null;

public static Cursor transparentCursor = null;
public static Pattern stripper = Pattern.compile("<[^<>]*>");
public static Pattern spacer = Pattern.compile("[\r\n]");

public SlideshowFrame() {
setUndecorated(true);
setResizable(false);
Expand Down Expand Up @@ -119,6 +127,8 @@ public void hide() {
return;
}

showCursor();

GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
gd.setFullScreenWindow(null);
super.hide();
Expand Down Expand Up @@ -186,6 +196,8 @@ public void keyPressed(KeyEvent e) {
}
});

addMouseMotionListener(this);

PreviewFrame.ImageContentPane cp = new PreviewFrame.ImageContentPane();
setContentPane(cp);

Expand Down Expand Up @@ -383,7 +395,8 @@ public void pictureReady(ImageIcon image, Picture picture) {

if (picture != null) {
// todo: captions are not printed outline because they are HTML and that's a fucking mess
caption = picture.getCaption();
caption = stripTags(picture.getCaption());
Log.log(Log.LEVEL_TRACE, MODULE, caption);
updateProgress(picture, STATE_NONE);
extra = picture.getExtraFieldsString();
if (picture.isOnline()) {
Expand All @@ -393,7 +406,6 @@ public void pictureReady(ImageIcon image, Picture picture) {
}
}

//Log.log(Log.LEVEL_TRACE, MODULE, "TIMESTAMP");
pictureShownTime = System.currentTimeMillis();

super.pictureReady(image, picture);
Expand Down Expand Up @@ -447,6 +459,8 @@ private void updateProgress(Picture picture, int state) {
}

repaint();

hideCursor();
}

public boolean dataTransferred(int transferred, int overall, double kbPerSecond, Picture p) {
Expand Down Expand Up @@ -509,6 +523,35 @@ public void run() {
repaint();
}

public void hideCursor() {
if (transparentCursor == null) {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit().createImage(
new MemoryImageSource(16, 16, pixels, 0, 16));
transparentCursor =
Toolkit.getDefaultToolkit().createCustomCursor
(image, new Point(0, 0), "invisiblecursor");
}

setCursor(transparentCursor);
}

public static String stripTags(String text) {
Matcher m = stripper.matcher(text);
m = spacer.matcher(m.replaceAll(""));
return m.replaceAll(" ");
}

public void showCursor() {
setCursor(Cursor.getDefaultCursor());
}

public void mouseDragged(MouseEvent e) {}

public void mouseMoved(MouseEvent e) {
showCursor();
}

public class FeedbackGlassPane extends JComponent {
Color background = new Color(100, 100, 100, 150);
Color normal = new Color(180, 180, 180, 180);
Expand Down
1 change: 1 addition & 0 deletions com/gallery/GalleryRemote/model/Gallery.java
Expand Up @@ -862,6 +862,7 @@ public Album createRootAlbum() {

Album album = new Album(this);
album.setTitle(GRI18n.getString("Common", "rootAlbmTitle"));
album.setName("root.album");
setRoot(album);

return (Album) getRoot();
Expand Down
4 changes: 2 additions & 2 deletions defaults.properties
Expand Up @@ -230,6 +230,6 @@ updateUrlBeta=http://gallery.sourceforge.net/gallery_remote_version_check_beta.p
#
# --- Do not edit below this line ---
#
version=1.4
releaseDate=2004/07/20
version=1.4.1-b1
releaseDate=2004/07/29
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\n \n \nArtwork by Ross A. Reyman\n \n \nBundled software:\n \nImageMagick\nJSX\nJava look and feel Graphics Repository icons\njpegtran, Guido Vollbeding's version\nMetadataExtractor

0 comments on commit 99516f8

Please sign in to comment.