/*
* File : SuccessfulConfiguration.java
* Created : 29.12.2005
* By : kahless
*
* GOIM - Gamers Own Instant Messenger
* Copyright (C) 2005 Herbert Poul (kahless@sphene.net / herbert.poul@gmail.com)
* http://goim.sphene.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package net.sphene.goim.rcp.ui.wizard;
import java.net.URL;
import net.sphene.goim.rcp.GOIMPlugin;
import net.sphene.goim.rcp.beans.GOIMAccount;
import net.sphene.goim.rcp.ui.vCardGUI;
import net.sphene.goim.rcp.xmpp.util.MUCUtils;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.muc.MultiUserChat;
public class SuccessfulConfiguration {
Shell shell;
private GOIMAccount activeAccount;
public SuccessfulConfiguration(GOIMAccount account) {
super();
this.activeAccount = account;
shell = new Shell(SWT.DIALOG_TRIM|SWT.RESIZE);
shell.setText("Successful Configuration");
GridLayout shellLayout = new GridLayout(1,true);
shellLayout.marginWidth = 20;
shellLayout.marginHeight = 20;
shell.setLayout(shellLayout);
Label headline = new Label(shell,SWT.WRAP);
headline.setText("Congratulations for Successfully Configuring " +
"GOIM!\n\n" +
"You should already be logged into your account and see " +
"the Stats Collector Bot (If you chose to add it).\n" +
"Currently it collects only basic statistics about time " +
"you are online and/or playing. Visit the GOIM Website " +
"and click on 'Stats Tracking' (link below).\n\n" +
"It would also be nice if you would join the community " +
"on the website and check out the Forums to discuss " +
"features, suggestions or bugs.\n\n");
headline.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
Link websiteLink = new Link(shell,SWT.NULL);
websiteLink.setText("Visit <A>GOIM Website: " + GOIMPlugin.goimSiteURL + "</A>");
websiteLink.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false));
Link mucLink = new Link(shell,SWT.NULL);
mucLink.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false));
mucLink.setText("You can also join our <A>Multi User Chatroom " +
GOIMPlugin.defaultGOIMroom + "</A>");
Link editVCard = new Link(shell,SWT.NULL);
editVCard.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,false));
editVCard.setText("You should also <A>edit your vCard</A>.\n" +
"The vCard stores your public information which can be " +
"retrieved by others.");
websiteLink.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {
try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(GOIMPlugin.goimSiteURL));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
});
mucLink.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {
String name = GOIMPlugin.defaultGOIMroom;
MUCUtils.joinMUCRoom(activeAccount, name, null);
}
});
editVCard.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event event) {
new vCardGUI(activeAccount);
}
});
}
public void open() {
shell.setSize(550,400);
shell.layout(true);
shell.open();
}
}