Commit 2a9b22c1532546b197747cacd0dfeeb982a57716
1 parent
7e2e63a7
Exists in
master
and in
5 other branches
Trabalhando na versao macosx
Showing
6 changed files
with
219 additions
and
19 deletions
Show diff stats
... | ... | @@ -0,0 +1,38 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
3 | +<plist version="1.0"> | |
4 | +<dict> | |
5 | + <key>CFBundleDevelopmentRegion</key> | |
6 | + <string>English</string> | |
7 | + <key>CFBundleExecutable</key> | |
8 | + <string>pw3270</string> | |
9 | + <key>CFBundleGetInfoString</key> | |
10 | + <string>pw3270 - 5.0-0</string> | |
11 | + <key>CFBundleIconFile</key> | |
12 | + <string>pw3270.icns</string> | |
13 | + <key>CFBundleIdentifier</key> | |
14 | + <string>pw3270</string> | |
15 | + <key>CFBundleInfoDictionaryVersion</key> | |
16 | + <string>6.0</string> | |
17 | + <key>CFBundleLongVersionString</key> | |
18 | + <string>pw3270-pw3270 © Banco do Brasil S.A.</string> | |
19 | + <key>CFBundleName</key> | |
20 | + <string>pw3270</string> | |
21 | + <key>CFBundlePackageType</key> | |
22 | + <string>APPL</string> | |
23 | + <key>CFBundleShortVersionString</key> | |
24 | + <string>5.0</string> | |
25 | + <key>CFBundleSignature</key> | |
26 | + <string>????</string> | |
27 | + <key>CFBundleVersion</key> | |
28 | + <string>5.0</string> | |
29 | + <key>CSResourcesFileMapped</key> | |
30 | + <true/> | |
31 | + <key>LSRequiresCarbon</key> | |
32 | + <true/> | |
33 | + <key>NSHumanReadableCopyright</key> | |
34 | + <string>Copyright (C) 2008 Banco do Brasil S.A., GNU General Public License.</string> | |
35 | + <key>LSMinimumSystemVersion</key> | |
36 | + <string>10.6</string> | |
37 | +</dict> | |
38 | +</plist> | ... | ... |
... | ... | @@ -0,0 +1,168 @@ |
1 | +#!/bin/sh | |
2 | + | |
3 | +if test "x$IGE_DEBUG_LAUNCHER" != x; then | |
4 | + set -x | |
5 | +fi | |
6 | + | |
7 | +if test "x$IGE_DEBUG_GDB" != x; then | |
8 | + EXEC="gdb --args" | |
9 | +else | |
10 | + EXEC=exec | |
11 | +fi | |
12 | + | |
13 | +name="`basename $0`" | |
14 | +tmp="`pwd`/$0" | |
15 | +tmp=`dirname "$tmp"` | |
16 | +tmp=`dirname "$tmp"` | |
17 | +bundle=`dirname "$tmp"` | |
18 | +bundle_contents="$bundle"/Contents | |
19 | +bundle_res="$bundle_contents"/Resources | |
20 | +bundle_lib="$bundle_res"/lib | |
21 | +bundle_bin="$bundle_res"/bin | |
22 | +bundle_data="$bundle_res"/share | |
23 | +bundle_etc="$bundle_res"/etc | |
24 | + | |
25 | +export DYLD_LIBRARY_PATH="$bundle_lib" | |
26 | +export XDG_CONFIG_DIRS="$bundle_etc"/xdg | |
27 | +export XDG_DATA_DIRS="$bundle_data" | |
28 | +export GTK_DATA_PREFIX="$bundle_res" | |
29 | +export GTK_EXE_PREFIX="$bundle_res" | |
30 | +export GTK_PATH="$bundle_res" | |
31 | + | |
32 | +export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" | |
33 | +export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" | |
34 | +export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders" | |
35 | +export PANGO_RC_FILE="$bundle_etc/pango/pangorc" | |
36 | + | |
37 | +APP=name | |
38 | +I18NDIR="$bundle_data/locale" | |
39 | +# Set the locale-related variables appropriately: | |
40 | +unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE | |
41 | + | |
42 | +# Has a language ordering been set? | |
43 | +# If so, set LC_MESSAGES and LANG accordingly; otherwise skip it. | |
44 | +# First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW. | |
45 | +APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' ` | |
46 | +if test "$APPLELANGUAGES"; then | |
47 | + # A language ordering exists. | |
48 | + # Test, item per item, to see whether there is an corresponding locale. | |
49 | + for L in $APPLELANGUAGES; do | |
50 | + #test for exact matches: | |
51 | + if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then | |
52 | + export LANG=$L | |
53 | + break | |
54 | + fi | |
55 | + #This is a special case, because often the original strings are in US | |
56 | + #English and there is no translation file. | |
57 | + if test "x$L" == "xen_US"; then | |
58 | + export LANG=$L | |
59 | + break | |
60 | + fi | |
61 | + #OK, now test for just the first two letters: | |
62 | + if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then | |
63 | + export LANG=${L:0:2} | |
64 | + break | |
65 | + fi | |
66 | + #Same thing, but checking for any english variant. | |
67 | + if test "x${L:0:2}" == "xen"; then | |
68 | + export LANG=$L | |
69 | + break | |
70 | + fi; | |
71 | + done | |
72 | +fi | |
73 | +unset APPLELANGUAGES L | |
74 | + | |
75 | +# If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists. | |
76 | +APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder` | |
77 | +if test -z ${LANG} -a -n $APPLECOLLATION; then | |
78 | + if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then | |
79 | + export LANG=${APPLECOLLATION:0:2} | |
80 | + fi | |
81 | +fi | |
82 | +if test ! -z $APPLECOLLATION; then | |
83 | + export LC_COLLATE=$APPLECOLLATION | |
84 | +fi | |
85 | +unset APPLECOLLATION | |
86 | + | |
87 | +# Continue by attempting to find the Locale preference. | |
88 | +APPLELOCALE=`defaults read .GlobalPreferences AppleLocale` | |
89 | + | |
90 | +if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then | |
91 | + if test -z $LANG; then | |
92 | + export LANG="${APPLELOCALE:0:5}" | |
93 | + fi | |
94 | + | |
95 | +elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then | |
96 | + export LANG="${APPLELOCALE:0:2}" | |
97 | +fi | |
98 | + | |
99 | +#Next we need to set LC_MESSAGES. If at all possilbe, we want a full | |
100 | +#5-character locale to avoid the "Locale not supported by C library" | |
101 | +#warning from Gtk -- even though Gtk will translate with a | |
102 | +#two-character code. | |
103 | +if test -n $LANG; then | |
104 | +#If the language code matches the applelocale, then that's the message | |
105 | +#locale; otherwise, if it's longer than two characters, then it's | |
106 | +#probably a good message locale and we'll go with it. | |
107 | + if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then | |
108 | + export LC_MESSAGES=$LANG | |
109 | +#Next try if the Applelocale is longer than 2 chars and the language | |
110 | +#bit matches $LANG | |
111 | + elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then | |
112 | + export LC_MESSAGES=${APPLELOCALE:0:5} | |
113 | +#Fail. Get a list of the locales in $PREFIX/share/locale that match | |
114 | +#our two letter language code and pick the first one, special casing | |
115 | +#english to set en_US | |
116 | + elif test $LANG == "en"; then | |
117 | + export LC_MESSAGES="en_US" | |
118 | + else | |
119 | + LOC=`find $PREFIX/share/locale -name $LANG???` | |
120 | + for L in $LOC; do | |
121 | + export LC_MESSAGES=$L | |
122 | + done | |
123 | + fi | |
124 | +else | |
125 | +#All efforts have failed, so default to US english | |
126 | + export LANG="en_US" | |
127 | + export LC_MESSAGES="en_US" | |
128 | +fi | |
129 | +CURRENCY=`echo $APPLELOCALE | sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'` | |
130 | +if test "x$CURRENCY" != "x"; then | |
131 | +#The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to. | |
132 | + if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then | |
133 | + if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then | |
134 | + export LC_MONETARY=$LC_MESSAGES | |
135 | + fi | |
136 | + fi | |
137 | + if test -z "$LC_MONETARY"; then | |
138 | + FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;` | |
139 | + if test -n "$FILES"; then | |
140 | + export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'` | |
141 | + fi | |
142 | + fi | |
143 | +fi | |
144 | +#No currency value means that the AppleLocale governs: | |
145 | +if test -z "$LC_MONETARY"; then | |
146 | + LC_MONETARY=${APPLELOCALE:0:5} | |
147 | +fi | |
148 | +#For Gtk, which only looks at LC_ALL: | |
149 | +export LC_ALL=$LC_MESSAGES | |
150 | + | |
151 | +unset APPLELOCALE FILES LOC | |
152 | + | |
153 | +if test -f "$bundle_lib/charset.alias"; then | |
154 | + export CHARSETALIASDIR="$bundle_lib" | |
155 | +fi | |
156 | + | |
157 | +# Extra arguments can be added in environment.sh. | |
158 | +EXTRA_ARGS= | |
159 | +if test -f "$bundle_res/environment.sh"; then | |
160 | + source "$bundle_res/environment.sh" | |
161 | +fi | |
162 | + | |
163 | +# Strip out the argument added by the OS. | |
164 | +if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then | |
165 | + shift 1 | |
166 | +fi | |
167 | + | |
168 | +$EXEC "$bundle_contents/MacOS/$name-bin" $* $EXTRA_ARGS | ... | ... |
No preview for this file type
po/pt_BR.po
... | ... | @@ -5,7 +5,7 @@ msgid "" |
5 | 5 | msgstr "" |
6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
7 | 7 | "Report-Msgid-Bugs-To: \n" |
8 | -"POT-Creation-Date: 2012-08-30 23:17-0300\n" | |
8 | +"POT-Creation-Date: 2012-08-31 04:17-0300\n" | |
9 | 9 | "PO-Revision-Date: 2012-08-27 09:01-0300\n" |
10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | 11 | "Language-Team: Português do Brasil <>\n" | ... | ... |
pw3270.xcodeproj/project.pbxproj
... | ... | @@ -257,9 +257,9 @@ |
257 | 257 | C272076B15D7FBF700CCCD22 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; }; |
258 | 258 | C272076C15D7FBF700CCCD22 /* Makefile.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Makefile.in; sourceTree = "<group>"; }; |
259 | 259 | C272076D15D7FBF700CCCD22 /* xml2pot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml2pot.c; sourceTree = "<group>"; }; |
260 | - C2C3E14515F0503B00B02C1C /* pw3270.bundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = pw3270.bundle; sourceTree = "<group>"; }; | |
261 | 260 | C2C3E14D15F0598900B02C1C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = "<group>"; }; |
262 | 261 | C2C3E14E15F0598900B02C1C /* launcher.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = launcher.sh; path = mac/launcher.sh; sourceTree = "<group>"; }; |
262 | + C2C3E15015F09BE200B02C1C /* pw3270.bundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = pw3270.bundle; sourceTree = "<group>"; }; | |
263 | 263 | C2C4DAD815D8282600E8C6A0 /* autogen.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = autogen.sh; sourceTree = "<group>"; }; |
264 | 264 | /* End PBXFileReference section */ |
265 | 265 | |
... | ... | @@ -679,9 +679,9 @@ |
679 | 679 | C2C3E14715F0547300B02C1C /* Bundle */ = { |
680 | 680 | isa = PBXGroup; |
681 | 681 | children = ( |
682 | + C2C3E15015F09BE200B02C1C /* pw3270.bundle */, | |
682 | 683 | C2C3E14D15F0598900B02C1C /* Info.plist */, |
683 | 684 | C2C3E14E15F0598900B02C1C /* launcher.sh */, |
684 | - C2C3E14515F0503B00B02C1C /* pw3270.bundle */, | |
685 | 685 | ); |
686 | 686 | name = Bundle; |
687 | 687 | sourceTree = "<group>"; | ... | ... |
src/pw3270/main.c
... | ... | @@ -36,16 +36,13 @@ |
36 | 36 | #include "v3270/accessible.h" |
37 | 37 | #include <stdlib.h> |
38 | 38 | |
39 | -#ifdef HAVE_GTKMAC | |
40 | - #include <gtkmacintegration/gtkosxapplication.h> | |
41 | -#endif // HAVE_GTKMAC | |
42 | - | |
43 | 39 | /*--[ Statics ]--------------------------------------------------------------------------------------*/ |
44 | 40 | |
45 | 41 | static GtkWidget *toplevel = NULL; |
46 | 42 | |
47 | 43 | #ifdef HAVE_GTKMAC |
48 | - static GtkOSXApplication * osxapp = NULL; | |
44 | + GtkOSXApplication * osxapp = NULL; | |
45 | + GtkMacBundle * macbundle = NULL; | |
49 | 46 | #endif // HAVE_GTKMAC |
50 | 47 | |
51 | 48 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
... | ... | @@ -153,17 +150,14 @@ int main(int argc, char *argv[]) |
153 | 150 | #elif defined(HAVE_GTKMAC) |
154 | 151 | { |
155 | 152 | osxapp = GTK_OSX_APPLICATION(g_object_new(GTK_TYPE_OSX_APPLICATION,NULL)); |
156 | - | |
157 | - | |
158 | - gchar * appdir = g_build_filename(DATAROOTDIR,PACKAGE_NAME,NULL); | |
159 | - gchar * locdir = g_build_filename(DATAROOTDIR,"locale",NULL); | |
160 | - | |
161 | - g_chdir(appdir); | |
162 | - bindtextdomain( PACKAGE_NAME, locdir); | |
163 | - | |
164 | - g_free(locdir); | |
165 | - g_free(appdir); | |
166 | - | |
153 | + | |
154 | + macbundle = gtk_mac_bundle_get_default(); | |
155 | + if(!macbundle) | |
156 | + macbundle = gtk_mac_bundle_new(); | |
157 | + | |
158 | + g_chdir(gtk_mac_bundle_get_datadir(macbundle)); | |
159 | + bindtextdomain(PACKAGE_NAME,gtk_mac_bundle_get_localedir(macbundle)); | |
160 | + | |
167 | 161 | } |
168 | 162 | #elif defined( DATAROOTDIR ) |
169 | 163 | { | ... | ... |