Mercurial > geeqie
comparison src/utilops.c @ 757:eb2e2dac712d
Tidy up: indentation fixes, typo fixes, ...
| author | zas_ |
|---|---|
| date | Sun, 25 May 2008 20:17:07 +0000 |
| parents | 573121c002c3 |
| children | a083017752fc |
comparison
equal
deleted
inserted
replaced
| 756:573121c002c3 | 757:eb2e2dac712d |
|---|---|
| 488 gchar *sidecars; | 488 gchar *sidecars; |
| 489 | 489 |
| 490 sidecars = file_data_sc_list_to_string(fd); | 490 sidecars = file_data_sc_list_to_string(fd); |
| 491 | 491 |
| 492 gtk_list_store_append(store, &iter); | 492 gtk_list_store_append(store, &iter); |
| 493 gtk_list_store_set(store, &iter, UTILITY_COLUMN_FD, fd, | 493 gtk_list_store_set(store, &iter, |
| 494 UTILITY_COLUMN_PATH, fd->path, | 494 UTILITY_COLUMN_FD, fd, |
| 495 UTILITY_COLUMN_NAME, fd->name, | 495 UTILITY_COLUMN_PATH, fd->path, |
| 496 UTILITY_COLUMN_SIDECARS, sidecars, | 496 UTILITY_COLUMN_NAME, fd->name, |
| 497 UTILITY_COLUMN_DEST_PATH, fd->change ? fd->change->dest : "error", | 497 UTILITY_COLUMN_SIDECARS, sidecars, |
| 498 UTILITY_COLUMN_DEST_NAME, fd->change ? filename_from_path(fd->change->dest) : "error", | 498 UTILITY_COLUMN_DEST_PATH, fd->change ? fd->change->dest : "error", |
| 499 -1); | 499 UTILITY_COLUMN_DEST_NAME, fd->change ? filename_from_path(fd->change->dest) : "error", |
| 500 -1); | |
| 500 g_free(sidecars); | 501 g_free(sidecars); |
| 501 | 502 |
| 502 list = list->next; | 503 list = list->next; |
| 503 } | 504 } |
| 504 | 505 |
| 541 ud->resume_data = resume_data; | 542 ud->resume_data = resume_data; |
| 542 | 543 |
| 543 gint ret = EDITOR_CB_CONTINUE; | 544 gint ret = EDITOR_CB_CONTINUE; |
| 544 if ((flags & EDITOR_ERROR_MASK) && !(flags & EDITOR_ERROR_SKIPPED)) | 545 if ((flags & EDITOR_ERROR_MASK) && !(flags & EDITOR_ERROR_SKIPPED)) |
| 545 { | 546 { |
| 546 GString *msg = g_string_new(editor_get_error_str(flags)); | 547 GString *msg = g_string_new(editor_get_error_str(flags)); |
| 547 GenericDialog *d; | 548 GenericDialog *d; |
| 549 g_string_append(msg, "\n"); | |
| 550 g_string_append(msg, ud->messages.fail); | |
| 551 g_string_append(msg, "\n"); | |
| 552 while (list) | |
| 553 { | |
| 554 FileData *fd = list->data; | |
| 555 | |
| 556 g_string_append(msg, fd->path); | |
| 548 g_string_append(msg, "\n"); | 557 g_string_append(msg, "\n"); |
| 549 g_string_append(msg, ud->messages.fail); | 558 list = list->next; |
| 550 g_string_append(msg, "\n"); | 559 } |
| 551 while (list) | 560 if (resume_data) |
| 552 { | 561 { |
| 553 FileData *fd = list->data; | 562 g_string_append(msg, _("\n Continue multiple file operation?")); |
| 554 | 563 d = file_util_gen_dlg(ud->messages.fail, GQ_WMCLASS, "dlg_confirm", |
| 555 g_string_append(msg, fd->path); | 564 NULL, TRUE, |
| 556 g_string_append(msg, "\n"); | 565 file_util_abort_cb, ud); |
| 557 list = list->next; | 566 |
| 558 } | 567 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, msg->str); |
| 559 if (resume_data) | 568 |
| 560 { | 569 generic_dialog_add_button(d, GTK_STOCK_GO_FORWARD, _("Co_ntinue"), |
| 561 g_string_append(msg, _("\n Continue multiple file operation?")); | 570 file_util_resume_cb, TRUE); |
| 562 d = file_util_gen_dlg(ud->messages.fail, GQ_WMCLASS, "dlg_confirm", | 571 gtk_widget_show(d->dialog); |
| 563 NULL, TRUE, | 572 ret = EDITOR_CB_SUSPEND; |
| 564 file_util_abort_cb, ud); | 573 } |
| 565 | 574 else |
| 566 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, msg->str); | 575 { |
| 567 | 576 file_util_warning_dialog(ud->messages.fail, msg->str, GTK_STOCK_DIALOG_ERROR, NULL); |
| 568 generic_dialog_add_button(d, GTK_STOCK_GO_FORWARD, _("Co_ntinue"), | 577 } |
| 569 file_util_resume_cb, TRUE); | 578 g_string_free(msg, TRUE); |
| 570 gtk_widget_show(d->dialog); | |
| 571 ret = EDITOR_CB_SUSPEND; | |
| 572 } | |
| 573 else | |
| 574 { | |
| 575 file_util_warning_dialog(ud->messages.fail, msg->str, GTK_STOCK_DIALOG_ERROR, NULL); | |
| 576 } | |
| 577 g_string_free(msg, TRUE); | |
| 578 } | 579 } |
| 579 | 580 |
| 580 | 581 |
| 581 while (list) /* be careful, file_util_perform_ci_internal can pass ud->flist as list */ | 582 while (list) /* be careful, file_util_perform_ci_internal can pass ud->flist as list */ |
| 582 { | 583 { |
| 615 gint ret; | 616 gint ret; |
| 616 | 617 |
| 617 /* take a single entry each time, this allows better control over the operation */ | 618 /* take a single entry each time, this allows better control over the operation */ |
| 618 GList *single_entry = g_list_append(NULL, ud->flist->data); | 619 GList *single_entry = g_list_append(NULL, ud->flist->data); |
| 619 gboolean last = !ud->flist->next; | 620 gboolean last = !ud->flist->next; |
| 621 gint status = EDITOR_ERROR_STATUS; | |
| 622 | |
| 623 if (file_data_sc_perform_ci(single_entry->data)) | |
| 624 status = 0; /* OK */ | |
| 620 | 625 |
| 621 if (file_data_sc_perform_ci(single_entry->data)) | 626 ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), status, single_entry, ud); |
| 622 { | |
| 623 ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), 0 /* OK */, single_entry, ud); | |
| 624 } | |
| 625 else | |
| 626 { | |
| 627 ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), EDITOR_ERROR_STATUS, single_entry, ud); | |
| 628 } | |
| 629 g_list_free(single_entry); | 627 g_list_free(single_entry); |
| 630 | 628 |
| 631 if (ret == EDITOR_CB_SUSPEND || last) return; | 629 if (ret == EDITOR_CB_SUSPEND || last) return; |
| 632 | 630 |
| 633 if (ret == EDITOR_CB_SKIP) | 631 if (ret == EDITOR_CB_SKIP) |
| 666 } | 664 } |
| 667 | 665 |
| 668 if (ud->external_command != -1 && options->editor[ud->external_command].command) | 666 if (ud->external_command != -1 && options->editor[ud->external_command].command) |
| 669 { | 667 { |
| 670 gint flags; | 668 gint flags; |
| 669 | |
| 671 ud->external = TRUE; | 670 ud->external = TRUE; |
| 672 if ((flags = start_editor_from_filelist_full(ud->external_command, ud->flist, file_util_perform_ci_cb, ud))) | 671 flags = start_editor_from_filelist_full(ud->external_command, ud->flist, file_util_perform_ci_cb, ud); |
| 672 | |
| 673 if (flags) | |
| 673 { | 674 { |
| 674 gchar *text = g_strdup_printf(_("%s\nUnable to start external command.\n"), editor_get_error_str(flags)); | 675 gchar *text = g_strdup_printf(_("%s\nUnable to start external command.\n"), editor_get_error_str(flags)); |
| 675 file_util_warning_dialog(ud->messages.fail, text, GTK_STOCK_DIALOG_ERROR, NULL); | 676 file_util_warning_dialog(ud->messages.fail, text, GTK_STOCK_DIALOG_ERROR, NULL); |
| 676 g_free(text); | 677 g_free(text); |
| 677 } | 678 } |
| 681 ud->external = FALSE; | 682 ud->external = FALSE; |
| 682 file_util_perform_ci_internal(ud); | 683 file_util_perform_ci_internal(ud); |
| 683 } | 684 } |
| 684 } | 685 } |
| 685 | 686 |
| 686 | 687 static void file_util_cancel_cb(GenericDialog *gd, gpointer data) |
| 687 | |
| 688 | |
| 689 static void file_util_cancel_cb(GenericDialog *gd, gpointer data) | |
| 690 { | 688 { |
| 691 UtilityData *ud = data; | 689 UtilityData *ud = data; |
| 692 | 690 |
| 693 generic_dialog_close(gd); | 691 generic_dialog_close(gd); |
| 694 | 692 |
| 696 | 694 |
| 697 ud->phase = UTILITY_PHASE_CANCEL; | 695 ud->phase = UTILITY_PHASE_CANCEL; |
| 698 file_util_dialog_run(ud); | 696 file_util_dialog_run(ud); |
| 699 } | 697 } |
| 700 | 698 |
| 701 static void file_util_ok_cb(GenericDialog *gd, gpointer data) | 699 static void file_util_ok_cb(GenericDialog *gd, gpointer data) |
| 702 { | 700 { |
| 703 UtilityData *ud = data; | 701 UtilityData *ud = data; |
| 704 | 702 |
| 705 generic_dialog_close(gd); | 703 generic_dialog_close(gd); |
| 706 | 704 |
| 707 ud->gd = NULL; | 705 ud->gd = NULL; |
| 708 | 706 |
| 709 file_util_dialog_run(ud); | 707 file_util_dialog_run(ud); |
| 710 } | 708 } |
| 711 | 709 |
| 712 static void file_util_fdlg_cancel_cb(FileDialog *fdlg, gpointer data) | 710 static void file_util_fdlg_cancel_cb(FileDialog *fdlg, gpointer data) |
| 713 { | 711 { |
| 714 UtilityData *ud = data; | 712 UtilityData *ud = data; |
| 715 | 713 |
| 716 file_dialog_close(fdlg); | 714 file_dialog_close(fdlg); |
| 717 | 715 |
| 719 | 717 |
| 720 ud->phase = UTILITY_PHASE_CANCEL; | 718 ud->phase = UTILITY_PHASE_CANCEL; |
| 721 file_util_dialog_run(ud); | 719 file_util_dialog_run(ud); |
| 722 } | 720 } |
| 723 | 721 |
| 724 static void file_util_fdlg_ok_cb(FileDialog *fdlg, gpointer data) | 722 static void file_util_fdlg_ok_cb(FileDialog *fdlg, gpointer data) |
| 725 { | 723 { |
| 726 UtilityData *ud = data; | 724 UtilityData *ud = data; |
| 727 | 725 |
| 728 file_dialog_close(fdlg); | 726 file_dialog_close(fdlg); |
| 729 | 727 |
| 927 static void file_util_rename_preview_order_cb(GtkTreeModel *treemodel, GtkTreePath *tpath, | 925 static void file_util_rename_preview_order_cb(GtkTreeModel *treemodel, GtkTreePath *tpath, |
| 928 GtkTreeIter *iter, gpointer data) | 926 GtkTreeIter *iter, gpointer data) |
| 929 { | 927 { |
| 930 UtilityData *ud = data; | 928 UtilityData *ud = data; |
| 931 | 929 |
| 932 if (ud->update_idle_id == -1) | 930 if (ud->update_idle_id != -1) return; |
| 933 { | 931 |
| 934 ud->update_idle_id = g_idle_add(file_util_rename_idle_cb, ud); | 932 ud->update_idle_id = g_idle_add(file_util_rename_idle_cb, ud); |
| 935 } | |
| 936 } | 933 } |
| 937 | 934 |
| 938 | 935 |
| 939 static gboolean file_util_preview_cb(GtkTreeSelection *selection, GtkTreeModel *store, | 936 static gboolean file_util_preview_cb(GtkTreeSelection *selection, GtkTreeModel *store, |
| 940 GtkTreePath *tpath, gboolean path_currently_selected, | 937 GtkTreePath *tpath, gboolean path_currently_selected, |
| 951 generic_dialog_image_set(ud->gd, fd); | 948 generic_dialog_image_set(ud->gd, fd); |
| 952 | 949 |
| 953 if (ud->type == UTILITY_TYPE_RENAME) | 950 if (ud->type == UTILITY_TYPE_RENAME) |
| 954 { | 951 { |
| 955 const gchar *name = filename_from_path(fd->change->dest); | 952 const gchar *name = filename_from_path(fd->change->dest); |
| 953 | |
| 956 gtk_widget_grab_focus(ud->rename_entry); | 954 gtk_widget_grab_focus(ud->rename_entry); |
| 957 gtk_label_set_text(GTK_LABEL(ud->rename_label), fd->name); | 955 gtk_label_set_text(GTK_LABEL(ud->rename_label), fd->name); |
| 958 g_signal_handlers_block_by_func(ud->rename_entry, G_CALLBACK(file_util_rename_preview_entry_cb), ud); | 956 g_signal_handlers_block_by_func(ud->rename_entry, G_CALLBACK(file_util_rename_preview_entry_cb), ud); |
| 959 gtk_entry_set_text(GTK_ENTRY(ud->rename_entry), name); | 957 gtk_entry_set_text(GTK_ENTRY(ud->rename_entry), name); |
| 960 gtk_editable_select_region(GTK_EDITABLE(ud->rename_entry), 0, filename_base_length(name)); | 958 gtk_editable_select_region(GTK_EDITABLE(ud->rename_entry), 0, filename_base_length(name)); |
| 982 | 980 |
| 983 static void file_util_dialog_init_simple_list(UtilityData *ud) | 981 static void file_util_dialog_init_simple_list(UtilityData *ud) |
| 984 { | 982 { |
| 985 GtkWidget *box; | 983 GtkWidget *box; |
| 986 GtkTreeSelection *selection; | 984 GtkTreeSelection *selection; |
| 985 | |
| 987 ud->gd = file_util_gen_dlg(ud->messages.title, GQ_WMCLASS, "dlg_confirm", | 986 ud->gd = file_util_gen_dlg(ud->messages.title, GQ_WMCLASS, "dlg_confirm", |
| 988 ud->parent, FALSE, file_util_cancel_cb, ud); | 987 ud->parent, FALSE, file_util_cancel_cb, ud); |
| 989 generic_dialog_add_button(ud->gd, GTK_STOCK_DELETE, NULL, file_util_ok_cb, TRUE); | 988 generic_dialog_add_button(ud->gd, GTK_STOCK_DELETE, NULL, file_util_ok_cb, TRUE); |
| 990 | 989 |
| 991 box = generic_dialog_add_message(ud->gd, GTK_STOCK_DIALOG_QUESTION, | 990 box = generic_dialog_add_message(ud->gd, GTK_STOCK_DIALOG_QUESTION, |
| 992 ud->messages.question, | 991 ud->messages.question, |
| 993 ud->messages.desc_flist); | 992 ud->messages.desc_flist); |
| 994 | 993 |
| 995 box = pref_group_new(box, TRUE, ud->messages.desc_flist, GTK_ORIENTATION_HORIZONTAL); | 994 box = pref_group_new(box, TRUE, ud->messages.desc_flist, GTK_ORIENTATION_HORIZONTAL); |
| 996 | 995 |
| 997 ud->listview = file_util_dialog_add_list(box, ud->flist, FALSE); | 996 ud->listview = file_util_dialog_add_list(box, ud->flist, FALSE); |
| 998 file_util_dialog_add_list_column(ud->listview, _("Sidecars"), UTILITY_COLUMN_SIDECARS); | 997 file_util_dialog_add_list_column(ud->listview, _("Sidecars"), UTILITY_COLUMN_SIDECARS); |
| 1024 { | 1023 { |
| 1025 stock_id = GTK_STOCK_OK; | 1024 stock_id = GTK_STOCK_OK; |
| 1026 } | 1025 } |
| 1027 | 1026 |
| 1028 fdlg = file_util_file_dlg(ud->messages.title, GQ_WMCLASS, "dlg_dest_folder", ud->parent, | 1027 fdlg = file_util_file_dlg(ud->messages.title, GQ_WMCLASS, "dlg_dest_folder", ud->parent, |
| 1029 file_util_fdlg_cancel_cb, ud); | 1028 file_util_fdlg_cancel_cb, ud); |
| 1030 | 1029 |
| 1031 ud->fdlg = fdlg; | 1030 ud->fdlg = fdlg; |
| 1032 | 1031 |
| 1033 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, ud->messages.question, NULL); | 1032 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, ud->messages.question, NULL); |
| 1034 | 1033 |
| 1074 GtkWidget *table; | 1073 GtkWidget *table; |
| 1075 GtkWidget *combo; | 1074 GtkWidget *combo; |
| 1076 GtkWidget *page; | 1075 GtkWidget *page; |
| 1077 | 1076 |
| 1078 ud->gd = file_util_gen_dlg(ud->messages.title, GQ_WMCLASS, "dlg_confirm", | 1077 ud->gd = file_util_gen_dlg(ud->messages.title, GQ_WMCLASS, "dlg_confirm", |
| 1079 ud->parent, FALSE, file_util_cancel_cb, ud); | 1078 ud->parent, FALSE, file_util_cancel_cb, ud); |
| 1080 | |
| 1081 | 1079 |
| 1082 box = generic_dialog_add_message(ud->gd, NULL, ud->messages.question, NULL); | 1080 box = generic_dialog_add_message(ud->gd, NULL, ud->messages.question, NULL); |
| 1083 generic_dialog_add_button(ud->gd, GTK_STOCK_OK, ud->messages.title, file_util_ok_cb, TRUE); | 1081 generic_dialog_add_button(ud->gd, GTK_STOCK_OK, ud->messages.title, file_util_ok_cb, TRUE); |
| 1084 | 1082 |
| 1085 box = pref_group_new(box, TRUE, ud->messages.desc_flist, GTK_ORIENTATION_HORIZONTAL); | 1083 box = pref_group_new(box, TRUE, ud->messages.desc_flist, GTK_ORIENTATION_HORIZONTAL); |
| 1222 ud->phase = UTILITY_PHASE_ENTERING; | 1220 ud->phase = UTILITY_PHASE_ENTERING; |
| 1223 break; | 1221 break; |
| 1224 case UTILITY_PHASE_ENTERING: | 1222 case UTILITY_PHASE_ENTERING: |
| 1225 /* FIXME use file_data_sc_check_ci_dest to detect problems and eventually go back to PHASE_START | 1223 /* FIXME use file_data_sc_check_ci_dest to detect problems and eventually go back to PHASE_START |
| 1226 or to PHASE_CANCEL */ | 1224 or to PHASE_CANCEL */ |
| 1227 | |
| 1228 | 1225 |
| 1229 ud->phase = UTILITY_PHASE_CHECKED; | 1226 ud->phase = UTILITY_PHASE_CHECKED; |
| 1230 case UTILITY_PHASE_CHECKED: | 1227 case UTILITY_PHASE_CHECKED: |
| 1231 file_util_perform_ci(ud); | 1228 file_util_perform_ci(ud); |
| 1232 break; | 1229 break; |
| 1233 | |
| 1234 case UTILITY_PHASE_CANCEL: | 1230 case UTILITY_PHASE_CANCEL: |
| 1235 case UTILITY_PHASE_DONE: | 1231 case UTILITY_PHASE_DONE: |
| 1236 file_data_sc_free_ci_list(ud->flist); | 1232 file_data_sc_free_ci_list(ud->flist); |
| 1237 file_data_sc_free_ci_list(ud->dlist); | 1233 file_data_sc_free_ci_list(ud->dlist); |
| 1238 if (ud->source_fd) file_data_sc_free_ci(ud->source_fd); | 1234 if (ud->source_fd) file_data_sc_free_ci(ud->source_fd); |
| 1246 | 1242 |
| 1247 static gint file_util_unlink(FileData *fd) | 1243 static gint file_util_unlink(FileData *fd) |
| 1248 { | 1244 { |
| 1249 } | 1245 } |
| 1250 | 1246 |
| 1247 static void file_util_warn_op_in_progress(const gchar *title) | |
| 1248 { | |
| 1249 file_util_warning_dialog(title, _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | |
| 1250 } | |
| 1251 | 1251 |
| 1252 static void file_util_delete_full(FileData *source_fd, GList *source_list, GtkWidget *parent, UtilityPhase phase) | 1252 static void file_util_delete_full(FileData *source_fd, GList *source_list, GtkWidget *parent, UtilityPhase phase) |
| 1253 { | 1253 { |
| 1254 UtilityData *ud; | 1254 UtilityData *ud; |
| 1255 GList *flist = filelist_copy(source_list); | 1255 GList *flist = filelist_copy(source_list); |
| 1257 if (source_fd) | 1257 if (source_fd) |
| 1258 flist = g_list_append(flist, file_data_ref(source_fd)); | 1258 flist = g_list_append(flist, file_data_ref(source_fd)); |
| 1259 | 1259 |
| 1260 if (!file_data_sc_add_ci_delete_list(flist)) | 1260 if (!file_data_sc_add_ci_delete_list(flist)) |
| 1261 { | 1261 { |
| 1262 file_util_warning_dialog(_("File deletion failed"), _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | 1262 file_util_warn_op_in_progress(_("File deletion failed")); |
| 1263 filelist_free(flist); | 1263 filelist_free(flist); |
| 1264 return; | 1264 return; |
| 1265 } | 1265 } |
| 1266 | 1266 |
| 1267 ud = file_util_data_new(UTILITY_TYPE_DELETE); | 1267 ud = file_util_data_new(UTILITY_TYPE_DELETE); |
| 1291 if (source_fd) | 1291 if (source_fd) |
| 1292 flist = g_list_append(flist, file_data_ref(source_fd)); | 1292 flist = g_list_append(flist, file_data_ref(source_fd)); |
| 1293 | 1293 |
| 1294 if (!file_data_sc_add_ci_move_list(flist, dest_path)) | 1294 if (!file_data_sc_add_ci_move_list(flist, dest_path)) |
| 1295 { | 1295 { |
| 1296 file_util_warning_dialog(_("Move failed"), _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | 1296 file_util_warn_op_in_progress(_("Move failed")); |
| 1297 filelist_free(flist); | 1297 filelist_free(flist); |
| 1298 return; | 1298 return; |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 ud = file_util_data_new(UTILITY_TYPE_MOVE); | 1301 ud = file_util_data_new(UTILITY_TYPE_MOVE); |
| 1326 if (source_fd) | 1326 if (source_fd) |
| 1327 flist = g_list_append(flist, file_data_ref(source_fd)); | 1327 flist = g_list_append(flist, file_data_ref(source_fd)); |
| 1328 | 1328 |
| 1329 if (!file_data_sc_add_ci_copy_list(flist, dest_path)) | 1329 if (!file_data_sc_add_ci_copy_list(flist, dest_path)) |
| 1330 { | 1330 { |
| 1331 file_util_warning_dialog(_("Copy failed"), _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | 1331 file_util_warn_op_in_progress(_("Copy failed")); |
| 1332 filelist_free(flist); | 1332 filelist_free(flist); |
| 1333 return; | 1333 return; |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 ud = file_util_data_new(UTILITY_TYPE_COPY); | 1336 ud = file_util_data_new(UTILITY_TYPE_COPY); |
| 1362 if (source_fd) | 1362 if (source_fd) |
| 1363 flist = g_list_append(flist, file_data_ref(source_fd)); | 1363 flist = g_list_append(flist, file_data_ref(source_fd)); |
| 1364 | 1364 |
| 1365 if (!file_data_sc_add_ci_rename_list(flist, dest_path)) | 1365 if (!file_data_sc_add_ci_rename_list(flist, dest_path)) |
| 1366 { | 1366 { |
| 1367 file_util_warning_dialog(_("Rename failed"), _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | 1367 file_util_warn_op_in_progress(_("Rename failed")); |
| 1368 filelist_free(flist); | 1368 filelist_free(flist); |
| 1369 return; | 1369 return; |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 ud = file_util_data_new(UTILITY_TYPE_RENAME); | 1372 ud = file_util_data_new(UTILITY_TYPE_RENAME); |
| 1396 if (source_fd) | 1396 if (source_fd) |
| 1397 flist = g_list_append(flist, file_data_ref(source_fd)); | 1397 flist = g_list_append(flist, file_data_ref(source_fd)); |
| 1398 | 1398 |
| 1399 if (!file_data_sc_add_ci_unspecified_list(flist, dest_path)) | 1399 if (!file_data_sc_add_ci_unspecified_list(flist, dest_path)) |
| 1400 { | 1400 { |
| 1401 file_util_warning_dialog(_("Can't run external editor"), _("Another operation in progress.\n"), GTK_STOCK_DIALOG_ERROR, NULL); | 1401 file_util_warn_op_in_progress(_("Can't run external editor")); |
| 1402 filelist_free(flist); | 1402 filelist_free(flist); |
| 1403 return; | 1403 return; |
| 1404 } | 1404 } |
| 1405 | 1405 |
| 1406 if (editor_is_filter(n)) | 1406 if (editor_is_filter(n)) |
| 1436 | 1436 |
| 1437 /* FIXME: */ | 1437 /* FIXME: */ |
| 1438 void file_util_create_dir(const gchar *path, GtkWidget *parent) | 1438 void file_util_create_dir(const gchar *path, GtkWidget *parent) |
| 1439 { | 1439 { |
| 1440 } | 1440 } |
| 1441 | |
| 1441 gint file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget *parent) | 1442 gint file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget *parent) |
| 1442 { | 1443 { |
| 1443 } | 1444 } |
| 1444 | 1445 |
| 1445 /* full-featured entru points | 1446 /* full-featured entry points |
| 1446 */ | 1447 */ |
| 1447 | 1448 |
| 1448 void file_util_delete(FileData *source_fd, GList *source_list, GtkWidget *parent) | 1449 void file_util_delete(FileData *source_fd, GList *source_list, GtkWidget *parent) |
| 1449 { | 1450 { |
| 1450 file_util_delete_full(source_fd, source_list, parent, UTILITY_PHASE_START); | 1451 file_util_delete_full(source_fd, source_list, parent, UTILITY_PHASE_START); |
| 1452 | 1453 |
| 1453 void file_util_copy(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent) | 1454 void file_util_copy(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent) |
| 1454 { | 1455 { |
| 1455 file_util_copy_full(source_fd, source_list, dest_path, parent, UTILITY_PHASE_START); | 1456 file_util_copy_full(source_fd, source_list, dest_path, parent, UTILITY_PHASE_START); |
| 1456 } | 1457 } |
| 1458 | |
| 1457 void file_util_move(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent) | 1459 void file_util_move(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent) |
| 1458 { | 1460 { |
| 1459 file_util_move_full(source_fd, source_list, dest_path, parent, UTILITY_PHASE_START); | 1461 file_util_move_full(source_fd, source_list, dest_path, parent, UTILITY_PHASE_START); |
| 1460 } | 1462 } |
| 1463 | |
| 1461 void file_util_rename(FileData *source_fd, GList *source_list, GtkWidget *parent) | 1464 void file_util_rename(FileData *source_fd, GList *source_list, GtkWidget *parent) |
| 1462 { | 1465 { |
| 1463 file_util_rename_full(source_fd, source_list, NULL, parent, UTILITY_PHASE_START); | 1466 file_util_rename_full(source_fd, source_list, NULL, parent, UTILITY_PHASE_START); |
| 1464 } | 1467 } |
| 1465 | 1468 |
| 1466 /* these avoid the location entry dialog unless there is an error, list must be files only and | 1469 /* these avoid the location entry dialog unless there is an error, list must be files only and |
| 1467 * dest_path must be a valid directory path | 1470 * dest_path must be a valid directory path |
| 1468 */ | 1471 */ |
| 1469 void file_util_move_simple(GList *list, const gchar *dest_path, GtkWidget *parent) | 1472 void file_util_move_simple(GList *list, const gchar *dest_path, GtkWidget *parent) |
| 1470 { | 1473 { |
| 1471 file_util_move_full(NULL, list, dest_path, parent, UTILITY_PHASE_ENTERING); | 1474 file_util_move_full(NULL, list, dest_path, parent, UTILITY_PHASE_ENTERING); |
| 1472 } | 1475 } |
| 1476 | |
| 1473 void file_util_copy_simple(GList *list, const gchar *dest_path, GtkWidget *parent) | 1477 void file_util_copy_simple(GList *list, const gchar *dest_path, GtkWidget *parent) |
| 1474 { | 1478 { |
| 1475 file_util_copy_full(NULL, list, dest_path, parent, UTILITY_PHASE_ENTERING); | 1479 file_util_copy_full(NULL, list, dest_path, parent, UTILITY_PHASE_ENTERING); |
| 1476 } | 1480 } |
| 1481 | |
| 1477 void file_util_rename_simple(FileData *fd, const gchar *dest_path, GtkWidget *parent) | 1482 void file_util_rename_simple(FileData *fd, const gchar *dest_path, GtkWidget *parent) |
| 1478 { | 1483 { |
| 1479 file_util_rename_full(fd, NULL, dest_path, parent, UTILITY_PHASE_ENTERING); | 1484 file_util_rename_full(fd, NULL, dest_path, parent, UTILITY_PHASE_ENTERING); |
| 1480 } | 1485 } |
| 1481 | 1486 |
| 1698 ud->dlist = NULL; | 1703 ud->dlist = NULL; |
| 1699 ud->flist = NULL; | 1704 ud->flist = NULL; |
| 1700 | 1705 |
| 1701 ud->gd = file_util_gen_dlg(_("Delete folder"), GQ_WMCLASS, "dlg_confirm", | 1706 ud->gd = file_util_gen_dlg(_("Delete folder"), GQ_WMCLASS, "dlg_confirm", |
| 1702 parent, TRUE, | 1707 parent, TRUE, |
| 1703 file_util_cancel_cb, ud); | 1708 file_util_cancel_cb, ud); |
| 1704 | 1709 |
| 1705 text = g_strdup_printf(_("This will delete the symbolic link:\n\n%s\n\n" | 1710 text = g_strdup_printf(_("This will delete the symbolic link:\n\n%s\n\n" |
| 1706 "The folder this link points to will not be deleted."), | 1711 "The folder this link points to will not be deleted."), |
| 1707 fd->path); | 1712 fd->path); |
| 1708 generic_dialog_add_message(ud->gd, GTK_STOCK_DIALOG_QUESTION, | 1713 generic_dialog_add_message(ud->gd, GTK_STOCK_DIALOG_QUESTION, |
| 1709 _("Delete symbolic link to folder?"), | 1714 _("Delete symbolic link to folder?"), |
| 1710 text); | 1715 text); |
| 1711 g_free(text); | 1716 g_free(text); |
| 1712 | 1717 |
