// 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);
switch (flags & 0xf) {
case M_OKCANCEL:
- return fl_choice(buffer, NULL, fl_ok, fl_cancel) == 1;
+ return fl_choice("%s", NULL, fl_ok, fl_cancel, buffer) == 1;
case M_YESNO:
- return fl_choice(buffer, NULL, fl_yes, fl_no) == 1;
+ return fl_choice("%s", NULL, fl_yes, fl_no, buffer) == 1;
case M_OK:
default:
if (((flags & 0xf0) == M_ICONERROR) ||
((flags & 0xf0) == M_ICONWARNING))
- fl_alert(buffer);
+ fl_alert("%s", buffer);
else
- fl_message(buffer);
+ fl_message("%s", buffer);
return true;
}
using namespace rfb;
using namespace std;
-static char aboutText[1024];
+static const char aboutText[] = N_("TigerVNC Viewer %d-bit v%s (%s)\n"
+ "%s\n"
+ "Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)\n"
+ "See http://www.tigervnc.org for information on TigerVNC.");
extern const char* buildTime;
static bool exitMainloop = false;
void about_vncviewer()
{
fl_message_title(_("About TigerVNC Viewer"));
- fl_message(aboutText);
+ fl_message(gettext(aboutText), (int)sizeof(size_t)*8,
+ PACKAGE_VERSION, __BUILD__, buildTime);
}
static void about_callback(Fl_Widget *widget, void *data)
const char* vncServerName = NULL;
UserDialog dlg;
- const char englishAbout[] = N_("TigerVNC Viewer %d-bit v%s (%s)\n"
- "%s\n"
- "Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)\n"
- "See http://www.tigervnc.org for information on TigerVNC.");
-
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE_NAME, LOCALE_DIR);
textdomain(PACKAGE_NAME);
rfb::SecurityClient::setDefaults();
// Write about text to console, still using normal locale codeset
- snprintf(aboutText, sizeof(aboutText),
- gettext(englishAbout), (int)sizeof(size_t)*8, PACKAGE_VERSION,
- __BUILD__, buildTime);
- fprintf(stderr,"\n%s\n", aboutText);
+ fprintf(stderr,"\n");
+ fprintf(stderr, gettext(aboutText), (int)sizeof(size_t)*8,
+ PACKAGE_VERSION, __BUILD__, buildTime);
+ fprintf(stderr,"\n");
// Set gettext codeset to what our GUI toolkit uses. Since we are
// passing strings from strerror/gai_strerror to the GUI, these must
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
bind_textdomain_codeset("libc", "UTF-8");
- // Re-create the aboutText for the GUI, now using GUI codeset
- snprintf(aboutText, sizeof(aboutText),
- gettext(englishAbout), (int)sizeof(size_t)*8, PACKAGE_VERSION,
- __BUILD__, buildTime);
-
rfb::initStdIOLoggers();
rfb::LogWriter::setLogParams("*:stderr:30");
delete cc;
if (exitError != NULL)
- fl_alert(exitError);
+ fl_alert("%s", exitError);
return 0;
}