Skip to content

Commit

Permalink
Added ability for QuickConfig to handle gallery URLs (you need to use…
Browse files Browse the repository at this point in the history
… url.99, or any other set of parameters as long as the parameter ends in .99. This can be used to very easily add a Gallery URL to GR, especially useful for CMS.
  • Loading branch information
Pierre-Luc Paour committed Jun 26, 2003
1 parent 7675256 commit 50f37c8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions com/gallery/GalleryRemote/prefs/QuickConfigPanel.java
Expand Up @@ -88,15 +88,31 @@ public void actionPerformed(ActionEvent e) {
StringBuffer overridden = new StringBuffer("<ul>");
if (newProps != null) {
GalleryProperties props = GalleryRemote.getInstance().properties;
boolean newGallery = false;

Iterator it = newProps.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
String value = newProps.getProperty(key);

props.setProperty(key, value);
if (key.endsWith(".99")) {
if (!newGallery) {
// add Gallery access settings

overridden.append("<li>").append(key).append("</li>");
Gallery g = Gallery.readFromProperties(newProps, 99, mainFrame, false);
if (g != null) {
g.setPrefsIndex(mainFrame.galleries.getSize());
mainFrame.galleries.addElement(g);
newGallery = true;

overridden.append("<li>").append(g.toString()).append("</li>");
}
}
} else {
props.setProperty(key, value);

overridden.append("<li>").append(key).append("</li>");
}
}

overridden.append("</ul>");
Expand All @@ -107,7 +123,7 @@ public void actionPerformed(ActionEvent e) {
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, "Could not find configuration file.", "Error", JOptionPane.ERROR_MESSAGE);
Log.log(Log.CRITICAL, MODULE, "Fetching configuration failed");
Log.log(Log.ERROR, MODULE, "Fetching configuration failed");
Log.logException( Log.ERROR, MODULE, ex );
}
}
Expand Down

0 comments on commit 50f37c8

Please sign in to comment.