Make sure we can display all the possible dialog types the RFB core needs.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4423 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx
index 992ea78..db722e7 100644
--- a/vncviewer/UserDialog.cxx
+++ b/vncviewer/UserDialog.cxx
@@ -79,8 +79,27 @@
 
 bool UserDialog::showMsgBox(int flags, const char* title, const char* text)
 {
+  // FLTK doesn't give us a flexible choice of the icon, so we ignore those
+  // bits for now.
+
+  // FIXME: Filter out % from input text
+
   fl_message_title(title);
-  fl_message(text);
+
+  switch (flags & 0xf) {
+  case M_OKCANCEL:
+    return fl_choice(text, NULL, fl_ok, fl_cancel) == 1;
+  case M_YESNO:
+    return fl_choice(text, NULL, fl_yes, fl_no) == 1;
+  case M_OK:
+  default:
+    if (((flags & 0xf0) == M_ICONERROR) ||
+        ((flags & 0xf0) == M_ICONWARNING))
+      fl_alert(text);
+    else
+      fl_message(text);
+    return true;
+  }
 
   return false;
 }