Skip to content

Commit

Permalink
2008-07-31 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b39)
Browse files Browse the repository at this point in the history
	* Users can select Gallery URLs that GR should automatically
	  log into on startup (thanks Brian Egge).
	* Fixed minor issues with editing image properties and extra fields.
  • Loading branch information
Pierre-Luc Paour committed Aug 4, 2008
1 parent 5857bf5 commit f90fff8
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 13 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2008-07-31 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b39)

* Users can select Gallery URLs that GR should automatically
log into on startup (thanks Brian Egge).
* Fixed minor issues with editing image properties and extra fields.

2008-07-07 Pierre-Luc Paour <gallery@paour.com> (1.5.1-b38)

* No longer loading thumbnails in the slideshow applet.
Expand Down
30 changes: 28 additions & 2 deletions com/gallery/GalleryRemote/MainFrame.java
Expand Up @@ -295,6 +295,28 @@ private void setGalleries(DefaultComboBoxModel galleries) {

jGalleryCombo.setModel(galleries);
galleries.addListDataListener(this);

boolean foundAutoLoad = false;
for (int i = 0; i < galleries.getSize(); i++) {
Gallery g = (Gallery) galleries.getElementAt(i);

if (g.isAutoLoadOnStartup()) {
// load the Gallery
// login may have failed and caused getComm to be null.
GalleryComm comm = g.getComm(jStatusBar);

// may have tried to connect and failed
if (comm != null && !GalleryComm.wasAuthFailure()) {
fetchAlbums();
}

if (!foundAutoLoad) {
jGalleryCombo.setSelectedIndex(i);
foundAutoLoad = true;
}
}
}

selectedGalleryChanged();

// We've been initalized, we are now clean.
Expand Down Expand Up @@ -1053,8 +1075,12 @@ private void jbInit()
, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 2, 2, 2), 0, 0));
jInspectorDivider.add(jInspectorPanel, JSplitPane.RIGHT);
jInspectorDivider.add(jAlbumPictureDivider, JSplitPane.LEFT);
jInspectorPanel.add(new JScrollPane(jPictureInspector), CARD_PICTURE);
jInspectorPanel.add(new JScrollPane(jAlbumInspector), CARD_ALBUM);
JScrollPane pictureInspectorScroll = new JScrollPane(jPictureInspector);
pictureInspectorScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jInspectorPanel.add(pictureInspectorScroll, CARD_PICTURE);
JScrollPane albumInspectorScroll = new JScrollPane(jAlbumInspector);
albumInspectorScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jInspectorPanel.add(albumInspectorScroll, CARD_ALBUM);
jAlbumPictureDivider.add(jPictureScroll, JSplitPane.RIGHT);
jAlbumPictureDivider.add(jAlbumPanel, JSplitPane.LEFT);
jAlbumPanel.add(jAlbumScroll, BorderLayout.CENTER);
Expand Down
14 changes: 10 additions & 4 deletions com/gallery/GalleryRemote/PictureInspector.java
Expand Up @@ -49,7 +49,7 @@ public class PictureInspector extends JPanel

HashMap extraLabels = new HashMap();
HashMap extraTextAreas = new HashMap();
String currentExtraFields = null;
ArrayList currentExtraFields = null;

JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
Expand Down Expand Up @@ -113,6 +113,7 @@ private void jbInit() {
jSize.setFont(UIManager.getFont("Label.font"));
jSize.setBackground(UIManager.getColor("TextField.inactiveBackground"));
jCaption.setLineWrap(true);
jCaption.setWrapStyleWord(true);
jCaption.setEditable(false);
jCaption.setFont(UIManager.getFont("Label.font"));
jCaption.setBackground(UIManager.getColor("TextField.inactiveBackground"));
Expand Down Expand Up @@ -183,8 +184,8 @@ private void jbInit() {
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 2, 0));
add(jLabel2, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 2, 0));
add(jSpacer, new GridBagConstraints(0, 20, 2, 1, 1.0, 0.1
, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
add(jSpacer, new GridBagConstraints(0, 99, 2, 1, 1.0, 0.1
, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));

add(jIconAreaPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 0.0
, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
Expand Down Expand Up @@ -460,20 +461,23 @@ void addExtraFields(Picture p) {
JTextArea field = new JTextArea();
extraTextAreas.put(name, field);
field.setFont(UIManager.getFont("Label.font"));
field.setLineWrap(true);
field.setWrapStyleWord(true);
add(field, new GridBagConstraints(1, FIRST_ROW_EXTRA + i, 1, 1, 1.0, 1.0
, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 0, 0, 0), 0, 0));
field.getDocument().addDocumentListener(this);
setupKeyboardHandling(field);

i++;
}

currentExtraFields = newExtraFields;
}

Iterator it = newExtraFields.iterator();
while (it.hasNext()) {
String name = (String) it.next();
String value = p.getExtraField(name);

JTextArea field = (JTextArea) extraTextAreas.get(name);
if (value == null) {
field.setText("");
Expand All @@ -499,6 +503,8 @@ void removeExtraFields() {

extraLabels.clear();
extraTextAreas.clear();

currentExtraFields = null;
}

public void setEnabled(boolean enabled) {
Expand Down
21 changes: 21 additions & 0 deletions com/gallery/GalleryRemote/model/Gallery.java
Expand Up @@ -59,6 +59,7 @@ public class Gallery extends DefaultTreeModel implements Serializable, Preferenc
String alias;
String userAgent = "Gallery Remote " + GalleryRemote._().properties.getProperty("version");
int type = TYPE_STANDALONE;
boolean autoLoadOnStartup = false;

transient GalleryComm comm = null;

Expand Down Expand Up @@ -680,6 +681,7 @@ public static Gallery readFromProperties(GalleryProperties p, int prefsIndex, St
g.forceGalleryVersion = p.getIntProperty(FORCE_GALLERY_VERSION + prefsIndex, 0);
g.forceProtocolEncoding = p.getProperty(FORCE_PROTOCOL_ENCODING + prefsIndex);
g.resizeJpegQuality = p.getIntProperty(RESIZE_JPEG_QUALITY + prefsIndex, -1);
g.autoLoadOnStartup = p.getBooleanProperty(AUTO_LOAD_ON_STARTUP + prefsIndex, false);

g.setPrefsIndex(prefsIndex);

Expand Down Expand Up @@ -724,6 +726,9 @@ public void writeToProperties(PropertiesFile p) {
if (glGalleryUrlString != null) {
p.setProperty(GL_GALLERY_URL + prefsIndex, glGalleryUrlString);
}
if (autoLoadOnStartup) {
p.setBooleanProperty(AUTO_LOAD_ON_STARTUP + prefsIndex, autoLoadOnStartup);
}
}

public static void removeFromProperties(PropertiesFile p, int n) {
Expand All @@ -738,6 +743,10 @@ public static void removeFromProperties(PropertiesFile p, int n) {
p.setProperty(PHPN_LOGIN_URL + n, null);
p.setProperty(PHPN_GALLERY_URL + n, null);
p.setProperty(ALIAS + n, null);
p.setProperty(FORCE_GALLERY_VERSION + n, null);
p.setProperty(FORCE_PROTOCOL_ENCODING + n, null);
p.setProperty(RESIZE_JPEG_QUALITY + n, null);
p.setProperty(AUTO_LOAD_ON_STARTUP + n, null);
}

public void setPrefsIndex(int prefsIndex) {
Expand Down Expand Up @@ -954,6 +963,18 @@ public void setAuthToken(String authToken) {
this.authToken = authToken;
}

public boolean isAutoLoadOnStartup() {
return autoLoadOnStartup;
}

public void setAutoLoadOnStartup(boolean autoLoadOnStartup) {
this.autoLoadOnStartup = autoLoadOnStartup;

if (!blockWrites) {
GalleryRemote._().properties.setBooleanProperty(AUTO_LOAD_ON_STARTUP + prefsIndex, autoLoadOnStartup);
}
}

class TreeEnumeration implements Enumeration {
protected TreeNode root;
protected Enumeration children;
Expand Down
20 changes: 15 additions & 5 deletions com/gallery/GalleryRemote/prefs/GalleryEditorDialog.java
Expand Up @@ -60,6 +60,8 @@ public class GalleryEditorDialog extends JDialog implements ActionListener {

JPanel jStandalone = new JPanel();
JTextField jStandaloneUrl = new JTextField();

JCheckBox jAutoLogin = new JCheckBox();

JPanel jButtonPanel = new JPanel();
JButton jOk = new JButton();
Expand Down Expand Up @@ -139,27 +141,31 @@ private void jbInit() {
jGlHelpLabel.setPreferredSize(new Dimension(300, 80));
jGlHelpLabel.setText(GRI18n.getString(MODULE, "glHelp"));
jGlHelpLabel.setVerticalAlignment(SwingConstants.TOP);

jAutoLogin.setText(GRI18n.getString(MODULE, "autoLogin"));

this.getContentPane().add(jMainPanel, BorderLayout.CENTER);
jMainPanel.add(jStylePanel, new GridBagConstraints(0, 4, 4, 1, 1.0, 1.0
, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0));
jMainPanel.add(jUsernameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
jMainPanel.add(jAliasLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
jMainPanel.add(jPasswordLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
jMainPanel.add(jTypeLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
jMainPanel.add(jTypeLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
jMainPanel.add(jAlias, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
jMainPanel.add(jUsername, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 5), 0, 0));
jMainPanel.add(jPassword, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 5), 0, 0));
jMainPanel.add(jType, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0
jMainPanel.add(jAutoLogin, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 5), 0, 0));
jMainPanel.add(jType, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 5), 0, 0));
jMainPanel.add(jButtonPanel, new GridBagConstraints(0, 5, 2, 1, 0.0, 0.0
jMainPanel.add(jStylePanel, new GridBagConstraints(0, 5, 4, 1, 1.0, 1.0
, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0));
jMainPanel.add(jButtonPanel, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0
, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0));
jButtonPanel.add(jOk, null);
jButtonPanel.add(jCancel, null);
Expand Down Expand Up @@ -234,6 +240,8 @@ public void resetUIState() {

jGlGalleryUrl.setText(gallery.getGlGalleryUrlString());
jGlLoginUrl.setText(gallery.getGlLoginUrlString());

jAutoLogin.setSelected(gallery.isAutoLoadOnStartup());
}

public void readUIState() {
Expand All @@ -253,6 +261,8 @@ public void readUIState() {

gallery.setGlLoginUrlString(jGlLoginUrl.getText());
gallery.setGlGalleryUrlString(jGlGalleryUrl.getText());

gallery.setAutoLoadOnStartup(jAutoLogin.isSelected());
}

public void actionPerformed(ActionEvent e) {
Expand Down
1 change: 1 addition & 0 deletions com/gallery/GalleryRemote/prefs/PreferenceNames.java
Expand Up @@ -57,6 +57,7 @@ public interface PreferenceNames {
public static final String FORCE_GALLERY_VERSION = "forceGalleryVersion.";
public static final String FORCE_PROTOCOL_ENCODING = "forceProtocolEncoding.";
public static final String RESIZE_JPEG_QUALITY = "resizeJpegQuality.";
public static final String AUTO_LOAD_ON_STARTUP = "autoLoadOnStartup.";

// Proxy panel
public static final String USE_PROXY = "useProxy";
Expand Down
10 changes: 10 additions & 0 deletions com/gallery/GalleryRemote/prefs/URLPanel.java
Expand Up @@ -202,6 +202,10 @@ public void resetUIState() {
username = "&lt;Not set&gt;";
}
sb.append(GRI18n.getString(MODULE, "username")).append(username).append("<br>");

if (selectedGallery.isAutoLoadOnStartup()) {
sb.append(GRI18n.getString(MODULE, "autoLogin")).append("<br>");
}

sb.append("</HTML>");

Expand Down Expand Up @@ -235,6 +239,12 @@ public Component getListCellRendererComponent(
Gallery g = (Gallery) value;

setText(g.toString());

if (g.isAutoLoadOnStartup()) {
setFont(getFont().deriveFont(Font.BOLD));
} else {
setFont(getFont().deriveFont(Font.PLAIN));
}

return this;
}
Expand Down
2 changes: 2 additions & 0 deletions com/gallery/GalleryRemote/resources/GRResources.properties
Expand Up @@ -97,6 +97,7 @@ GEdiDlog.alias = Alias
GEdiDlog.aliasTip = <html>A short name to describe the Gallery.<br>It will be used in Gallery Remote to display a short \
name for the Gallery.<br>Leave empty to use the URL.</html>

GEdiDlog.autoLogin = Automatically log in to this Gallery on startup

#GeneralPa module
GeneralPa.icon = General
Expand Down Expand Up @@ -265,6 +266,7 @@ URLPa.phpnGllryURL = PHPNuke Gallery URL:
URLPa.glLoginURL = Geeklog login URL:
URLPa.glGllryURL = Geeklog Gallery URL:
URLPa.username = Username:
URLPa.autoLogin = Automatically log in to this Gallery on startup


#About module
Expand Down
4 changes: 2 additions & 2 deletions defaults.properties
Expand Up @@ -322,6 +322,6 @@ updateUrlBeta=http://gallery.sourceforge.net/gallery_remote_version_check_beta.p
#
# --- Do not edit below this line ---
#
version=1.5.1-b38
releaseDate=2008/07/07
version=1.5.1-b39
releaseDate=2008/07/31
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

0 comments on commit f90fff8

Please sign in to comment.