Commit 62238aa4267a14c53b928b9425eea3cfbcbad110
1 parent
f4cab8ad
Exists in
master
and in
5 other branches
Ajustes windows na funcao de charset
Showing
1 changed file
with
17 additions
and
1 deletions
Show diff stats
src/gtk/dialog.c
| @@ -332,14 +332,19 @@ | @@ -332,14 +332,19 @@ | ||
| 332 | } list[] = | 332 | } list[] = |
| 333 | { | 333 | { |
| 334 | // http://en.wikipedia.org/wiki/Character_encoding | 334 | // http://en.wikipedia.org/wiki/Character_encoding |
| 335 | - { "ISO-8859-1", N_( "Western Europe (ISO 8859-1)" ) }, | 335 | + { "ISO-8859-1", N_( "Western Europe (ISO 8859-1)" ) }, |
| 336 | + { "CP1252", N_( "Windows Western languages (CP1252)" ) }, | ||
| 336 | 337 | ||
| 337 | { NULL, NULL } | 338 | { NULL, NULL } |
| 338 | }; | 339 | }; |
| 339 | 340 | ||
| 340 | GtkWidget * label = gtk_label_new_with_mnemonic (_("C_haracter Coding:")); | 341 | GtkWidget * label = gtk_label_new_with_mnemonic (_("C_haracter Coding:")); |
| 341 | const gchar * charset = NULL; | 342 | const gchar * charset = NULL; |
| 343 | +#if GTK_CHECK_VERSION(2,24,0) | ||
| 342 | GtkWidget * menu = gtk_combo_box_text_new(); | 344 | GtkWidget * menu = gtk_combo_box_text_new(); |
| 345 | +#else | ||
| 346 | + GtkWidget * menu = gtk_combo_box_new(); | ||
| 347 | +#endif // GTK(2,24) | ||
| 343 | gchar * text; | 348 | gchar * text; |
| 344 | int f; | 349 | int f; |
| 345 | int p = 0; | 350 | int p = 0; |
| @@ -348,7 +353,12 @@ | @@ -348,7 +353,12 @@ | ||
| 348 | *encoding = g_strdup(charset); | 353 | *encoding = g_strdup(charset); |
| 349 | 354 | ||
| 350 | text = g_strdup_printf(_("Current (%s)"),charset); | 355 | text = g_strdup_printf(_("Current (%s)"),charset); |
| 356 | + | ||
| 357 | +#if GTK_CHECK_VERSION(2,24,0) | ||
| 351 | gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(menu),p,charset,text); | 358 | gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(menu),p,charset,text); |
| 359 | +#else | ||
| 360 | + | ||
| 361 | +#endif // GTK(2,24) | ||
| 352 | g_free(text); | 362 | g_free(text); |
| 353 | 363 | ||
| 354 | gtk_combo_box_set_active(GTK_COMBO_BOX(menu),p++); | 364 | gtk_combo_box_set_active(GTK_COMBO_BOX(menu),p++); |
| @@ -356,7 +366,13 @@ | @@ -356,7 +366,13 @@ | ||
| 356 | for(f=0;list[f].charset;f++) | 366 | for(f=0;list[f].charset;f++) |
| 357 | { | 367 | { |
| 358 | if(strcasecmp(charset,list[f].charset)) | 368 | if(strcasecmp(charset,list[f].charset)) |
| 369 | + { | ||
| 370 | +#if GTK_CHECK_VERSION(2,24,0) | ||
| 359 | gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(menu),p++,list[f].charset,gettext(list[f].text)); | 371 | gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(menu),p++,list[f].charset,gettext(list[f].text)); |
| 372 | +#else | ||
| 373 | + | ||
| 374 | +#endif // GTK(2,24) | ||
| 375 | + } | ||
| 360 | } | 376 | } |
| 361 | 377 | ||
| 362 | 378 |