Implement connection dialog based on unix vncviewer.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4412 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index d9277e5..8c145a8 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -49,6 +49,7 @@
 #include "i18n.h"
 #include "parameters.h"
 #include "CConn.h"
+#include "ServerDialog.h"
 #include "UserDialog.h"
 
 rfb::LogWriter vlog("main");
@@ -162,7 +163,7 @@
 
 int main(int argc, char** argv)
 {
-  char* vncServerName = 0;
+  const char* vncServerName = NULL;
   UserDialog dlg;
 
   const char englishAbout[] = N_("TigerVNC Viewer version %s\n"
@@ -247,6 +248,12 @@
   CSecurityTLS::msg = &dlg;
 #endif
 
+  if (vncServerName == NULL) {
+    vncServerName = ServerDialog::run();
+    if ((vncServerName == NULL) || (vncServerName[0] == '\0'))
+      return 1;
+  }
+
   CConn cc(vncServerName);
 
   while (!exitMainloop) {