currentGallery.getComm(this);
getCurrentGallery().getComm(this);
	public void actionPerformed( ActionEvent e ) {		String command = e.getActionCommand();		Log.log(Log.INFO, MODULE, "Command selected " + command);		//Log.log(Log.TRACE, MODULE, "        event " + e );		if ( command.equals( "File.Quit" ) ) {			thisWindowClosing( null );		} else if ( command.equals( "File.Save" ) ) {			saveState();		} else if ( command.equals( "File.Open" ) ) {			openState();		} else if ( command.equals( "Options.Prefs" ) ) {			showPreferencesDialog();		} else if ( command.equals( "Help.About" ) ) {			showAboutBox();		} else if ( command.equals( "Fetch" ) ) {			if (currentGallery.hasComm() && currentGallery.getComm(this).isLoggedIn()) {				// we're currently logged in: log out				currentGallery.getComm(this).logOut();				if (mAlbum != null) {					mAlbum.clearPictures();				}				mAlbum = null;				album.setModel(new Gallery(this));				resetUIState();			} else {		    	// login may have failed and caused getComm to be null.				currentGallery.getComm(this);				// may have tried to connect and failed				if (!GalleryComm.wasAuthFailure()) {					fetchAlbums();				}			}		} else if ( command.equals( "NewAlbum" ) ) {			newAlbum();		} else if ( command.equals( "Browse" ) ) {			browseAddPictures();		} else if ( command.equals( "Upload" ) ) {			uploadPictures();		} else if ( command.equals( "NewGallery" ) ) {			Gallery g = new Gallery(this);			galleries.addElement( g );			g.setPrefsIndex(galleries.getIndexOf(g));			gallery.setSelectedItem( g );			updateGalleryParams();		} else if ( command.equals( "Url" ) ||			command.equals( "comboBoxEdited" ) ) {			//Log.log(Log.TRACE, MODULE, "modifiers: " + e.getModifiers());			//Log.log(Log.TRACE, MODULE, "paramString: " + e.paramString());			Object selectedGallery = gallery.getSelectedItem();			if (selectedGallery != null) {				Log.log(Log.TRACE, MODULE, "selected: " + selectedGallery.toString()					+ " (" + gallery.getSelectedIndex() + ")");				if (selectedGallery instanceof String) {					// text of a url edited					try {						currentGallery.setStUrlString((String) selectedGallery);					} catch ( MalformedURLException mue ) {						JOptionPane.showMessageDialog(this, "Malformed URL", "Error", JOptionPane.ERROR_MESSAGE);					}				} else {					// new url chosen in the popup					updateGalleryParams();				}			}		} else if ( command.equals( "Album" ) ) {			updatePicturesList( (Album) ( (JComboBox) e.getSource() ).getSelectedItem());		} else {			Log.log(Log.ERROR, MODULE, "Unhandled command " + command );		}	}