lastOpenedFile = null;   setDirtyFlag(false);
	public void actionPerformed(ActionEvent e) {		String command = e.getActionCommand();		Log.log(Log.LEVEL_INFO, MODULE, "Command selected " + command);		//Log.log(Log.TRACE, MODULE, "        event " + e );		String MRUFileName = null;		if (command.startsWith("File.MRU.")) {			MRUFileName = command.substring("File.MRU.".length());			command = "File.Open";		}		if (command.equals("File.Quit")) {			thisWindowClosing(null);		} else if (command.equals("File.New")) {			int response = saveOnPermission();			if (JOptionPane.CANCEL_OPTION == response) {				return;			}			resetState();		} else if (command.equals("File.Open")) {			openState(MRUFileName);		} else if (command.equals("File.Save")) {			// Do Save As if the file is the default			if (lastOpenedFile == null) {				saveAsState();			} else {				saveState();			}		} else if (command.equals("File.SaveAs")) {			saveAsState();		} else if (command.equals("File.Close")) {			int response = saveOnPermission();			if (JOptionPane.CANCEL_OPTION == response) {				return;			}			resetState();		} else if (command.equals("Edit.Cut")) {			doCut();		} else if (command.equals("Edit.Copy")) {			doCopy();		} else if (command.equals("Edit.Paste")) {			doPaste();		} else if (command.equals("Options.Prefs")) {			showPreferencesDialog();		} else if (command.equals("Help.About")) {			showAboutBox();		} else if (command.equals("Fetch")) {			if (getCurrentGallery().hasComm() && getCurrentGallery().getComm(jStatusBar).isLoggedIn()) {				// we're currently logged in: log out				if (JOptionPane.showConfirmDialog(						(JFrame) this,						GRI18n.getString(MODULE, "logoutQuestion", new Object[] {getCurrentGallery().toString()}),						"Warning",						JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {					return;				}				getCurrentGallery().logOut();			} else {				// login may have failed and caused getComm to be null.				GalleryComm comm = getCurrentGallery().getComm(jStatusBar);				// may have tried to connect and failed				if (comm != null && !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("Sort")) {			sortPictures();		} else if (command.equals("NewGallery")) {			showPreferencesDialog(URLPanel.class.getName());		} else {			Log.log(Log.LEVEL_ERROR, MODULE, "Unhandled command " + command);		}	}