Update with Valtechs changes.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6930 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-02-02 18:54:37 +00:00
committed by derek
parent 6973eb7ba8
commit 49100ca0f6
4 changed files with 14 additions and 5 deletions

View File

@ -63,7 +63,7 @@ import javax.swing.JToolBar;
*
* @version 1.0, 03/12/14
*/
public final class MainWindow extends JFrame implements ActionListener {
public final class MainWindow extends ChatFrame implements ActionListener {
private final Set<MainWindowListener> listeners = new HashSet<MainWindowListener>();
private final JMenu connectMenu = new JMenu();

View File

@ -461,7 +461,9 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
* Close all chat rooms.
*/
public void closeAllChatRooms() {
if (MainWindow.getInstance().isDocked()) {
LocalPreferences pref = SettingsManager.getLocalPreferences();
if (MainWindow.getInstance().isDocked() || !pref.isAutoCloseChatRoomsEnabled()) {
return;
}
@ -1129,7 +1131,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
}
LocalPreferences pref = SettingsManager.getLocalPreferences();
if (pref.isDockingEnabled()) {
//chatFrame = MainWindow.getInstance();
chatFrame = MainWindow.getInstance();
}
else {
chatFrame = new ChatFrame();

View File

@ -43,7 +43,6 @@ public class ChatFrame extends JFrame implements WindowFocusListener {
getContentPane().setLayout(new BorderLayout());
getContentPane().add(SparkManager.getChatManager().getChatContainer(), BorderLayout.CENTER);
pack();
LayoutSettings settings = LayoutSettingsManager.getLayoutSettings();
if (settings.getChatFrameX() == 0 && settings.getChatFrameY() == 0) {

View File

@ -495,6 +495,14 @@ public class LocalPreferences {
return getBoolean("dockingEnabled", false);
}
public void setAutoCloseChatRoomsEnabled(boolean autoCloseChatRoomsEnabled){
setBoolean("autoCloseChatRoomsEnabled", autoCloseChatRoomsEnabled);
}
public boolean isAutoCloseChatRoomsEnabled(){
return getBoolean("autoCloseChatRoomsEnabled", true);
}
public void setTabsOnTop(boolean onTop){
setBoolean("tabsOnTop", onTop);
}