Mercurial > mxe-octave
comparison src/msvc-zenity-1.patch @ 3178:a791ade9c790
add zenity module (and MSVC-specific patch)
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 25 Jul 2013 20:03:53 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3177:9e883aedbf4d | 3178:a791ade9c790 |
---|---|
1 diff -ur zenity-3.8.0-orig/src/main.c zenity-3.8.0/src/main.c | |
2 --- zenity-3.8.0-orig/src/main.c 2011-08-16 09:52:42 -0400 | |
3 +++ zenity-3.8.0/src/main.c 2013-07-25 19:58:10 -0400 | |
4 @@ -29,7 +29,9 @@ | |
5 #include <stdlib.h> | |
6 #include <glib.h> | |
7 #include <gtk/gtk.h> | |
8 +#ifndef _MSC_VER | |
9 #include <langinfo.h> | |
10 +#endif | |
11 #ifdef HAVE_LOCALE_H | |
12 #include <locale.h> | |
13 #endif | |
14 diff -ur zenity-3.8.0-orig/src/option.c zenity-3.8.0/src/option.c | |
15 --- zenity-3.8.0-orig/src/option.c 2013-03-13 21:46:04 -0400 | |
16 +++ zenity-3.8.0/src/option.c 2013-07-25 19:58:10 -0400 | |
17 @@ -1621,7 +1621,11 @@ | |
18 if (zenity_calendar_date_format) | |
19 results->calendar_data->date_format = zenity_calendar_date_format; | |
20 else | |
21 +#ifdef _MSC_VER | |
22 + results->calendar_data->date_format = "%Y-%m-%d"; | |
23 +#else | |
24 results->calendar_data->date_format = g_locale_to_utf8 (nl_langinfo (D_FMT), -1, NULL, NULL, NULL); | |
25 +#endif | |
26 | |
27 } else { | |
28 if (zenity_calendar_day > -1) | |
29 @@ -2009,7 +2013,11 @@ | |
30 if (zenity_forms_date_format) | |
31 results->forms_data->date_format = zenity_forms_date_format; | |
32 else | |
33 +#ifdef _MSC_VER | |
34 + results->forms_data->date_format = "%Y-%m-%d"; | |
35 +#else | |
36 results->forms_data->date_format = g_locale_to_utf8 (nl_langinfo (D_FMT), -1, NULL, NULL, NULL); | |
37 +#endif | |
38 } else { | |
39 if (zenity_forms_date_format) | |
40 zenity_option_error (zenity_option_get_name (forms_dialog_options, &zenity_forms_date_format), | |
41 diff -ur zenity-3.8.0-orig/src/option.h zenity-3.8.0/src/option.h | |
42 --- zenity-3.8.0-orig/src/option.h 2011-08-16 09:52:42 -0400 | |
43 +++ zenity-3.8.0/src/option.h 2013-07-25 19:58:10 -0400 | |
44 @@ -27,7 +27,9 @@ | |
45 | |
46 #include "zenity.h" | |
47 #include <glib.h> | |
48 +#ifndef _MSC_VER | |
49 #include <langinfo.h> | |
50 +#endif | |
51 #ifdef HAVE_LOCALE_H | |
52 #include <locale.h> | |
53 #endif | |
54 diff -ur zenity-3.8.0-orig/src/progress.c zenity-3.8.0/src/progress.c | |
55 --- zenity-3.8.0-orig/src/progress.c 2013-03-13 21:46:04 -0400 | |
56 +++ zenity-3.8.0/src/progress.c 2013-07-25 19:58:10 -0400 | |
57 @@ -327,9 +327,11 @@ | |
58 But we want to give people the option to choose this behavior. | |
59 -- Monday 27, March 2006 | |
60 */ | |
61 +#ifndef _MSC_VER | |
62 if (autokill) { | |
63 kill (getppid (), 1); | |
64 } | |
65 +#endif | |
66 zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL); | |
67 break; | |
68 | |
69 diff -ur zenity-3.8.0-orig/src/tree.c zenity-3.8.0/src/tree.c | |
70 --- zenity-3.8.0-orig/src/tree.c 2013-03-13 21:46:04 -0400 | |
71 +++ zenity-3.8.0/src/tree.c 2013-07-25 19:58:38 -0400 | |
72 @@ -643,6 +643,7 @@ | |
73 GObject *tree_view; | |
74 GtkTreeSelection *selection; | |
75 GtkTreeModel *model; | |
76 + GSList *tmp; | |
77 | |
78 tree_view = gtk_builder_get_object (builder, "zenity_tree_view"); | |
79 model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); | |
80 @@ -657,8 +658,6 @@ | |
81 GTK_TREE_VIEW (tree_view)); | |
82 } | |
83 | |
84 - GSList *tmp; | |
85 - | |
86 for (tmp = selected; tmp; tmp = tmp->next) { | |
87 if (tmp->next != NULL) { | |
88 g_print ("%s%s", (gchar *) tmp->data, separator); | |
89 diff -ur zenity-3.8.0-orig/src/util.c zenity-3.8.0/src/util.c | |
90 --- zenity-3.8.0-orig/src/util.c 2013-03-13 21:46:04 -0400 | |
91 +++ zenity-3.8.0/src/util.c 2013-07-25 19:58:10 -0400 | |
92 @@ -89,9 +89,20 @@ | |
93 } | |
94 | |
95 if (result == 0) | |
96 +#ifdef G_OS_WIN32 | |
97 + { | |
98 + gchar *root = g_win32_get_package_installation_directory_of_module (NULL); | |
99 + gchar *p = g_build_filename (root, "share/zenity/zenity.ui"); | |
100 + result = gtk_builder_add_objects_from_file (builder, p, | |
101 + objects, &error); | |
102 + g_free (p); | |
103 + g_free (root); | |
104 + } | |
105 +#else | |
106 result = gtk_builder_add_objects_from_file (builder, | |
107 ZENITY_UI_FILE_FULLPATH, | |
108 objects, &error); | |
109 +#endif | |
110 | |
111 g_strfreev (objects); | |
112 |