Set title in Frame not StatusBar.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@4530 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2006-07-17 22:49:32 +00:00
committed by derek
parent 77930e84b5
commit eabef1b093
3 changed files with 24 additions and 13 deletions

View File

@ -13,7 +13,6 @@ package org.jivesoftware;
import org.jivesoftware.resource.Default;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.util.BrowserLauncher;
@ -77,6 +76,8 @@ public final class MainWindow extends JFrame implements ActionListener {
private static MainWindow singleton;
private static final Object LOCK = new Object();
private String title;
/**
* Returns the singleton instance of <CODE>MainWindow</CODE>,
* creating it if necessary.
@ -106,6 +107,8 @@ public final class MainWindow extends JFrame implements ActionListener {
* @param icon the icon used in the frame.
*/
private MainWindow(String title, ImageIcon icon) {
this.title = title;
// Initialize and dock the menus
configureMenu();
@ -116,7 +119,8 @@ public final class MainWindow extends JFrame implements ActionListener {
this.setJMenuBar(mainWindowBar);
this.getContentPane().add(topBar, BorderLayout.NORTH);
setTitle(title + " - " + StringUtils.parseName(SparkManager.getConnection().getUser()));
setTitle(title);
setIconImage(icon.getImage());
// Setup WindowListener to be the proxy to the actual window listener
@ -486,6 +490,17 @@ public final class MainWindow extends JFrame implements ActionListener {
}
}
public String getMainWindowTitle() {
return title;
}
public void setNickname(String nickname) {
String mainWindowTitle = getMainWindowTitle();
String newWindowTitle = mainWindowTitle + " - " + nickname;
setTitle(newWindowTitle);
}
/**
* Displays the About Box for Spark.
*/