diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2013-03-06 14:52:10 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2013-03-06 14:52:10 +0000 |
commit | 46395b7ff2f6ea7bf20da6d7199a6502b74546b3 (patch) | |
tree | 5286dd302b5a982de64f1153898dd3621a584d5c /java | |
parent | 776c558c442ad3e6cb54a4266d970f3c734e59d1 (diff) | |
download | tigervnc-46395b7ff2f6ea7bf20da6d7199a6502b74546b3.tar.gz tigervnc-46395b7ff2f6ea7bf20da6d7199a6502b74546b3.zip |
Use JDialog for connection info dialog so that frame icon is set correctly.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5057 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java')
-rw-r--r-- | java/com/tigervnc/vncviewer/CConn.java | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java index 0a7526ee..b8cbbfef 100644 --- a/java/com/tigervnc/vncviewer/CConn.java +++ b/java/com/tigervnc/vncviewer/CConn.java @@ -735,20 +735,33 @@ public class CConn extends CConnection Window fullScreenWindow = Viewport.getFullScreenWindow(); if (fullScreenWindow != null) Viewport.setFullScreenWindow(null); - JOptionPane.showMessageDialog(viewport, - "Desktop name: "+cp.name()+"\n" - +"Host: "+sock.getPeerName()+":"+sock.getPeerPort()+"\n" - +"Size: "+cp.width+"x"+cp.height+"\n" - +"Pixel format: "+desktop.getPF().print()+"\n" - +"(server default "+serverPF.print()+")\n" - +"Requested encoding: "+Encodings.encodingName(currentEncoding)+"\n" - +"Last used encoding: "+Encodings.encodingName(lastServerEncoding)+"\n" - +"Line speed estimate: "+sock.inStream().kbitsPerSecond()+" kbit/s"+"\n" - +"Protocol version: "+cp.majorVersion+"."+cp.minorVersion+"\n" - +"Security method: "+Security.secTypeName(csecurity.getType()) - +" ["+csecurity.description()+"]", - "VNC connection info", - JOptionPane.PLAIN_MESSAGE); + String info = new String("Desktop name: %s%n"+ + "Host: %s:%d%n"+ + "Size: %dx%d%n"+ + "Pixel format: %s%n"+ + " (server default: %s)%n"+ + "Requested encoding: %s%n"+ + "Last used encoding: %s%n"+ + "Line speed estimate: %d kbit/s%n"+ + "Protocol version: %d.%d%n"+ + "Security method: %s [%s]%n"); + String msg = + String.format(info, cp.name(), + sock.getPeerName(), sock.getPeerPort(), + cp.width, cp.height, + desktop.getPF().print(), + serverPF.print(), + Encodings.encodingName(currentEncoding), + Encodings.encodingName(lastServerEncoding), + sock.inStream().kbitsPerSecond(), + cp.majorVersion, cp.minorVersion, + Security.secTypeName(csecurity.getType()), + csecurity.description()); + JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, + JOptionPane.DEFAULT_OPTION); + JDialog dlg = op.createDialog("VNC connection info"); + dlg.setIconImage(VncViewer.frameIcon); + dlg.setVisible(true); if (fullScreenWindow != null) Viewport.setFullScreenWindow(fullScreenWindow); } |