diff options
author | Damian Minkov <damencho@jitsi.org> | 2010-07-23 09:11:52 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2010-07-23 09:11:52 +0000 |
commit | 135ede588038b677f68d63868f814d15d676e9f4 (patch) | |
tree | 0f1def067ec93923882168425141b03bc129d1ec /src | |
parent | 4f6aaa3ee7f718dbdb18ba0b5fa5ff6af89ee588 (diff) | |
download | jitsi-135ede588038b677f68d63868f814d15d676e9f4.zip jitsi-135ede588038b677f68d63868f814d15d676e9f4.tar.gz jitsi-135ede588038b677f68d63868f814d15d676e9f4.tar.bz2 |
Rest of the work on issue#528, add default macosx bindings(Ctrl+w and Cmd+w).
Fix a font issue for proxy config reported by Lubomir Marinov.
Diffstat (limited to 'src')
7 files changed, 68 insertions, 13 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java index a30762c..ac7ced0 100644 --- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java @@ -13,7 +13,6 @@ import java.util.*; import java.util.List; import javax.swing.*; -import javax.swing.event.*; import javax.swing.tree.*; import net.java.sip.communicator.impl.gui.*; @@ -228,6 +227,12 @@ public class MainFrame this.addKeybindingAction("main-rename", new RenameAction()); + // Remove the default escape key mapping as its a special + // one for the main frame and the contactlist + getRootPane().getInputMap( + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + .remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); + TransparentPanel northPanel = new TransparentPanel(new BorderLayout(0, 0)); diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java index 2d7f01f..96a4659 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java @@ -165,16 +165,6 @@ public class ChatWindow this.addKeybindingAction( "chat-close", new CloseAction()); - // simple fix adding meta+w on macosx - if (OSUtils.IS_MAC) - { - this.getRootPane().getInputMap( - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( - KeyStroke.getKeyStroke( - KeyEvent.VK_W, InputEvent.META_DOWN_MASK), - "chat-close"); - } - this.addWindowListener(new ChatWindowAdapter()); int width = GuiActivator.getResources() diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java index f2ad890..68113b5 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java @@ -447,6 +447,9 @@ public class ChatRoomTableDialog { ChatRoomProviderWrapper provider = (ChatRoomProviderWrapper)value; + if(provider == null) + return this; + if (isSelected) { setBackground(list.getSelectionBackground()); diff --git a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java index 4554222..31031d0 100644 --- a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java +++ b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java @@ -199,6 +199,23 @@ public class AboutWindow this.setResizable(false);
setLocationRelativeTo(getParent());
+
+ this.getRootPane().getActionMap().put("close", new CloseAction());
+
+ InputMap imap = this.getRootPane().getInputMap(
+ JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+
+ imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close");
+
+ if(OSUtils.IS_MAC)
+ {
+ imap.put(
+ KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.META_DOWN_MASK),
+ "close");
+ imap.put(
+ KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK),
+ "close");
+ }
}
/**
@@ -326,4 +343,16 @@ public class AboutWindow * Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
+
+ /**
+ * The action invoked when user presses Escape key.
+ */
+ private class CloseAction extends UIAction
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ setVisible(false);
+ dispose();
+ }
+ }
}
diff --git a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java index 4473913..c14a223 100644 --- a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java +++ b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java @@ -151,6 +151,10 @@ public class GlobalProxyConfigForm table.setContentType("text/html"); table.setEditable(false); table.setOpaque(false); + + table.putClientProperty( + JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); + table.setText(Resources.getString( "plugin.globalproxy.PROTOCOL_SUPPORT")); centerPanel.add( @@ -159,7 +163,7 @@ public class GlobalProxyConfigForm add(centerPanel, BorderLayout.NORTH); } - + /** * Loading the values stored onto configuration form */ diff --git a/src/net/java/sip/communicator/util/swing/SIPCommDialog.java b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java index 771e692..0eb584c 100644 --- a/src/net/java/sip/communicator/util/swing/SIPCommDialog.java +++ b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java @@ -144,8 +144,19 @@ public abstract class SIPCommDialog JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); + + // put the defaults for macosx + if(OSUtils.IS_MAC) + { + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.META_DOWN_MASK), + "close"); + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK), + "close"); + } } - + /** * The action invoked when user presses Escape key. */ diff --git a/src/net/java/sip/communicator/util/swing/SIPCommFrame.java b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java index fc8949b..31c4e6c 100644 --- a/src/net/java/sip/communicator/util/swing/SIPCommFrame.java +++ b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java @@ -84,6 +84,19 @@ public abstract class SIPCommFrame imap = rootPane.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + + imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); + + // put the defaults for macosx + if(OSUtils.IS_MAC) + { + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.META_DOWN_MASK), + "close"); + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK), + "close"); + } } /** |