int sel = picturesList.getSelectedIndex();
	void resetUIState() {		// if the list is empty or comm, disable upload		upload.setEnabled( mAlbum != null			&& mAlbum.sizePictures() > 0 			&& !mInProgress			&& album.getSelectedIndex() >= 0 );				// during comm, don't change Gallery or do any other comm		fetch.setEnabled( !mInProgress );		gallery.setEnabled( !mInProgress );		newGallery.setEnabled( !mInProgress );		username.setEnabled( !mInProgress );		password.setEnabled( !mInProgress );				// if the selected album is uploading, disable everything		boolean enabled = ! mInProgress && mAlbum != null && album.getModel().getSize() >= 1;		browse.setEnabled( enabled );		pictureInspector.setEnabled( enabled );		picturesList.setEnabled( enabled );		album.setEnabled( enabled );				if ( mAlbum == null) {			pictureInspector.setPictures( (Object[]) null );			setStatus( "Select a Gallery URL and click Fetch Albums..." );		} else if ( mAlbum.sizePictures() > 0 ) {			pictureInspector.setPictures( picturesList.getSelectedValues() );			int sel = picturesList.getSelectedIndex();			int selN = picturesList.getSelectedIndices().length;			if ( sel == -1 ) {				setStatus( mAlbum.sizePictures() + " pictures / "				+ NumberFormat.getInstance().format(					( (int) mAlbum.getPictureFileSize() / 1024 ) )				+ " K" );			} else {				setStatus( "Selected " + selN + ((selN == 1)?" picture / ":" pictures / ")				+ NumberFormat.getInstance().format(					( (int) mAlbum.getObjectFileSize( picturesList.getSelectedValues() ) / 1024 ) )				+ " K" );			}		} else {			pictureInspector.setPictures( (Object[]) null );			setStatus( "No selection" );		}	}