.
[sfinx.git] / patches / fluid.diff
blobc23b4fe8caaeb18718fca3a876f3c281d2a20fff
1 --- /usr/src/cvs/fltk-1.1/fluid/fluid.cxx 2007-02-26 09:51:08.000000000 +0200
2 +++ ./fltk-1.1/fluid/fluid.cxx 2007-08-27 19:04:30.000000000 +0300
3 @@ -643,7 +643,7 @@
4 const char* i18n_set = "";
5 char i18n_program[1024] = "";
7 -void write_cb(Fl_Widget *, void *) {
8 +void write_cb(Fl_Widget *, void *d) {
9 if (!filename) {
10 save_cb(0,0);
11 if (!filename) return;
12 @@ -675,12 +675,13 @@
13 if (!x) {
14 fl_message("Can't write %s: %s", cname, strerror(errno));
15 } else if (completion_button->value()) {
16 - fl_message("Wrote %s", cname);
17 + if (!d)
18 + fl_message("Wrote %s", cname);
23 -void write_strings_cb(Fl_Widget *, void *) {
24 +void write_strings_cb(Fl_Widget *, void *d) {
25 static const char *exts[] = { ".txt", ".po", ".msg" };
26 if (!filename) {
27 save_cb(0,0);
28 @@ -698,7 +699,8 @@
29 if (x) {
30 fl_message("Can't write %s: %s", sname, strerror(errno));
31 } else if (completion_button->value()) {
32 - fl_message("Wrote %s", sname);
33 + if (!d)
34 + fl_message("Wrote %s", sname);
38 @@ -1560,6 +1562,13 @@
40 #endif // WIN32 && !__CYGWIN__
42 +void save_write_exit_cb(Fl_Widget *w, void *v) {
43 + save_cb(w,v);
44 + write_cb(w,(void *)1);
45 + write_strings_cb(w, (void *)1);
46 + exit_cb(w,v);
49 ////////////////////////////////////////////////////////////////
51 extern Fl_Menu_Item New_Menu[];
52 @@ -1575,6 +1584,7 @@
53 #define SAVE_ITEM 4
54 {"&Save", FL_COMMAND+'s', save_cb, 0},
55 {"Save &As...", FL_COMMAND+FL_SHIFT+'s', save_cb, (void*)1},
56 + {"Sa&ve, Write code/strings, Exit", FL_F+12, save_write_exit_cb, 0},
57 {"Sa&ve A Copy...", 0, save_cb, (void*)2},
58 {"Save &Template...", 0, save_template_cb},
59 {"&Revert...", 0, revert_cb, 0, FL_MENU_DIVIDER},
60 @@ -2170,8 +2180,11 @@
62 #endif
64 +#include <locale.h>
66 int main(int argc,char **argv) {
67 int i = 1;
68 + setlocale(LC_ALL, "");
69 if (!Fl::args(argc,argv,i,arg) || i < argc-1) {
70 fprintf(stderr,"usage: %s <switches> name.fl\n"
71 " -c : write .cxx and .h and exit\n"