Lines 1139-1144
Link Here
|
1139 |
_window_update_current_location (FRWindow *window) |
1139 |
_window_update_current_location (FRWindow *window) |
1140 |
{ |
1140 |
{ |
1141 |
const char *current_dir = window_get_current_location (window); |
1141 |
const char *current_dir = window_get_current_location (window); |
|
|
1142 |
/* non-8bit path handling roughly borrowed from Dia; |
1143 |
* thanks an example/docs by Vitaly Lipatov (etersoft.ru) |
1144 |
*/ |
1145 |
char buffer[300]; |
1146 |
char *utf8current_dir = NULL; |
1147 |
|
1148 |
if (!g_utf8_validate(current_dir, -1, NULL)) { |
1149 |
utf8current_dir = g_filename_to_utf8(current_dir, -1, NULL, NULL, NULL); |
1150 |
if (utf8current_dir == NULL) { |
1151 |
g_warning(_("Some characters in the current path are neither UTF-8 nor your local encoding")); |
1152 |
} |
1153 |
} |
1154 |
if (utf8current_dir == NULL) |
1155 |
utf8current_dir = g_strdup(current_dir); |
1156 |
g_snprintf(buffer, 300, "%s", utf8current_dir); |
1142 |
|
1157 |
|
1143 |
if (window->list_mode == WINDOW_LIST_MODE_FLAT) { |
1158 |
if (window->list_mode == WINDOW_LIST_MODE_FLAT) { |
1144 |
gtk_widget_hide (window->location_bar); |
1159 |
gtk_widget_hide (window->location_bar); |
Lines 1147-1160
Link Here
|
1147 |
|
1162 |
|
1148 |
gtk_widget_show (window->location_bar); |
1163 |
gtk_widget_show (window->location_bar); |
1149 |
|
1164 |
|
1150 |
gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? current_dir: ""); |
1165 |
gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? utf8current_dir: ""); |
1151 |
gtk_widget_set_sensitive (window->home_button, window->archive_present); |
1166 |
gtk_widget_set_sensitive (window->home_button, window->archive_present); |
1152 |
gtk_widget_set_sensitive (window->up_button, window->archive_present && (current_dir != NULL) && (strcmp (current_dir, "/") != 0)); |
1167 |
gtk_widget_set_sensitive (window->up_button, window->archive_present && (utf8current_dir != NULL) && (strcmp (utf8current_dir, "/") != 0)); |
1153 |
gtk_widget_set_sensitive (window->back_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL)); |
1168 |
gtk_widget_set_sensitive (window->back_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL)); |
1154 |
gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL)); |
1169 |
gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL)); |
1155 |
gtk_widget_set_sensitive (window->location_entry, window->archive_present); |
1170 |
gtk_widget_set_sensitive (window->location_entry, window->archive_present); |
1156 |
gtk_widget_set_sensitive (window->location_label, window->archive_present); |
1171 |
gtk_widget_set_sensitive (window->location_label, window->archive_present); |
1157 |
|
1172 |
|
|
|
1173 |
g_free(utf8current_dir); |
1174 |
|
1158 |
#if 0 |
1175 |
#if 0 |
1159 |
_window_history_print (window); |
1176 |
_window_history_print (window); |
1160 |
#endif |
1177 |
#endif |
Lines 4368-4378
Link Here
|
4368 |
} else |
4385 |
} else |
4369 |
window->archive_filename = g_strdup (filename); |
4386 |
window->archive_filename = g_strdup (filename); |
4370 |
|
4387 |
|
|
|
4388 |
char buffer[300]; |
4389 |
char *locale_filename = NULL; |
4390 |
locale_filename = g_filename_from_utf8(window->archive_filename, -1, NULL, NULL, NULL); |
4391 |
if (locale_filename == NULL) { |
4392 |
g_warning(_("Some characters in the filename could not be converted from UTF-8 to locale encoding")); |
4393 |
locale_filename = g_strdup(window->archive_filename); |
4394 |
} |
4395 |
g_snprintf(buffer, 300, "%s", locale_filename); |
4396 |
|
4371 |
window->archive_present = FALSE; |
4397 |
window->archive_present = FALSE; |
4372 |
window->give_focus_to_the_list = TRUE; |
4398 |
window->give_focus_to_the_list = TRUE; |
4373 |
|
4399 |
|
4374 |
window_current_action_description_set (window, FR_BATCH_ACTION_OPEN, g_strdup (window->archive_filename), (GFreeFunc) g_free); |
4400 |
window_current_action_description_set (window, FR_BATCH_ACTION_OPEN, g_strdup (window->archive_filename), (GFreeFunc) g_free); |
4375 |
success = fr_archive_load (window->archive, window->archive_filename, window->password, &gerror); |
4401 |
// success = fr_archive_load (window->archive, window->archive_filename, window->password, &gerror); |
|
|
4402 |
success = fr_archive_load (window->archive, locale_filename, window->password, &gerror); |
4376 |
window->add_after_opening = FALSE; |
4403 |
window->add_after_opening = FALSE; |
4377 |
|
4404 |
|
4378 |
if (! success) { |
4405 |
if (! success) { |