diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-05-17 11:43:47 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-05-17 11:43:47 +0000 |
commit | 20ae1c872632d3e426b8f6fdfa0f8ac517551166 (patch) | |
tree | 7a51e0a76cb05de81d8f28ca62f68cfda60eee93 /vncviewer/UserDialog.cxx | |
parent | f4f309408d39b110ddf81e8815cea8da4cd0d40e (diff) | |
download | tigervnc-20ae1c872632d3e426b8f6fdfa0f8ac517551166.tar.gz tigervnc-20ae1c872632d3e426b8f6fdfa0f8ac517551166.zip |
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
Diffstat (limited to 'vncviewer/UserDialog.cxx')
-rw-r--r-- | vncviewer/UserDialog.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx index 992ea785..db722e7c 100644 --- a/vncviewer/UserDialog.cxx +++ b/vncviewer/UserDialog.cxx @@ -79,8 +79,27 @@ void UserDialog::getUserPasswd(char** user, char** password) 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; } |