comparison src/utilops.c @ 196:f6e307c7bad6

rename GQview -> Geeqie over the code
author nadvornik
date Sun, 23 Mar 2008 20:38:54 +0000
parents 0d1bf3ac6cd8
children 73efc1ba150f
comparison
equal deleted inserted replaced
195:d85687d951aa 196:f6e307c7bad6
1 /* 1 /*
2 * GQview 2 * Geeqie
3 * (C) 2006 John Ellis 3 * (C) 2006 John Ellis
4 * 4 *
5 * Author: John Ellis 5 * Author: John Ellis
6 * 6 *
7 * This software is released under the GNU General Public License (GNU GPL). 7 * This software is released under the GNU General Public License (GNU GPL).
294 GenericDialog *file_util_warning_dialog(const gchar *heading, const gchar *message, 294 GenericDialog *file_util_warning_dialog(const gchar *heading, const gchar *message,
295 const gchar *icon_stock_id, GtkWidget *parent) 295 const gchar *icon_stock_id, GtkWidget *parent)
296 { 296 {
297 GenericDialog *gd; 297 GenericDialog *gd;
298 298
299 gd = file_util_gen_dlg(heading, "GQview", "warning", parent, TRUE, NULL, NULL); 299 gd = file_util_gen_dlg(heading, "Geeqie", "warning", parent, TRUE, NULL, NULL);
300 generic_dialog_add_message(gd, icon_stock_id, heading, message); 300 generic_dialog_add_message(gd, icon_stock_id, heading, message);
301 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, file_util_warning_dialog_ok_cb, TRUE); 301 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, file_util_warning_dialog_ok_cb, TRUE);
302 if (place_dialogs_under_mouse) 302 if (place_dialogs_under_mouse)
303 { 303 {
304 gtk_window_set_position(GTK_WINDOW(gd->dialog), GTK_WIN_POS_MOUSE); 304 gtk_window_set_position(GTK_WINDOW(gd->dialog), GTK_WIN_POS_MOUSE);
642 static GenericDialog *file_util_move_multiple_confirm_dialog(FileDataMult *fdm) 642 static GenericDialog *file_util_move_multiple_confirm_dialog(FileDataMult *fdm)
643 { 643 {
644 GenericDialog *gd; 644 GenericDialog *gd;
645 GtkWidget *hbox; 645 GtkWidget *hbox;
646 646
647 gd = file_util_gen_dlg(_("Overwrite file"), "GQview", "dlg_confirm", 647 gd = file_util_gen_dlg(_("Overwrite file"), "Geeqie", "dlg_confirm",
648 NULL, TRUE, 648 NULL, TRUE,
649 file_util_move_multiple_cancel_cb, fdm); 649 file_util_move_multiple_cancel_cb, fdm);
650 650
651 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, 651 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION,
652 _("Overwrite file?"), 652 _("Overwrite file?"),
724 { 724 {
725 title = _("Source to move matches destination"); 725 title = _("Source to move matches destination");
726 text = g_strdup_printf(_("Unable to move file:\n%s\nto itself."), fdm->dest); 726 text = g_strdup_printf(_("Unable to move file:\n%s\nto itself."), fdm->dest);
727 } 727 }
728 728
729 gd = file_util_gen_dlg(title, "GQview", "dlg_confirm", 729 gd = file_util_gen_dlg(title, "Geeqie", "dlg_confirm",
730 NULL, TRUE, 730 NULL, TRUE,
731 file_util_move_multiple_cancel_cb, fdm); 731 file_util_move_multiple_cancel_cb, fdm);
732 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_WARNING, title, text); 732 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_WARNING, title, text);
733 g_free(text); 733 g_free(text);
734 generic_dialog_add_button(gd, GTK_STOCK_GO_FORWARD, _("Co_ntinue"), 734 generic_dialog_add_button(gd, GTK_STOCK_GO_FORWARD, _("Co_ntinue"),
810 else 810 else
811 { 811 {
812 title = _("Error moving file"); 812 title = _("Error moving file");
813 text = g_strdup_printf(_("Unable to move file:\n%s\nto:\n%s\nduring multiple file move."), fdm->source_fd->path, fdm->dest); 813 text = g_strdup_printf(_("Unable to move file:\n%s\nto:\n%s\nduring multiple file move."), fdm->source_fd->path, fdm->dest);
814 } 814 }
815 gd = file_util_gen_dlg(title, "GQview", "dlg_confirm", 815 gd = file_util_gen_dlg(title, "Geeqie", "dlg_confirm",
816 NULL, TRUE, 816 NULL, TRUE,
817 file_util_move_multiple_cancel_cb, fdm); 817 file_util_move_multiple_cancel_cb, fdm);
818 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_WARNING, title, text); 818 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_WARNING, title, text);
819 g_free(text); 819 g_free(text);
820 820
972 else if (isfile(fds->dest) && !fds->confirmed) 972 else if (isfile(fds->dest) && !fds->confirmed)
973 { 973 {
974 GenericDialog *gd; 974 GenericDialog *gd;
975 GtkWidget *hbox; 975 GtkWidget *hbox;
976 976
977 gd = file_util_gen_dlg(_("Overwrite file"), "GQview", "dlg_confirm", 977 gd = file_util_gen_dlg(_("Overwrite file"), "Geeqie", "dlg_confirm",
978 NULL, TRUE, 978 NULL, TRUE,
979 file_util_move_single_cancel_cb, fds); 979 file_util_move_single_cancel_cb, fds);
980 980
981 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, 981 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION,
982 _("Overwrite file?"), 982 _("Overwrite file?"),
1168 multiple = FALSE; 1168 multiple = FALSE;
1169 } 1169 }
1170 1170
1171 if (copy) 1171 if (copy)
1172 { 1172 {
1173 title = _("Copy - GQview"); 1173 title = _("Copy - Geeqie");
1174 op_text = _("_Copy"); 1174 op_text = _("_Copy");
1175 if (fd) 1175 if (fd)
1176 { 1176 {
1177 text = _("Copy file"); 1177 text = _("Copy file");
1178 } 1178 }
1182 } 1182 }
1183 stock_id = GTK_STOCK_COPY; 1183 stock_id = GTK_STOCK_COPY;
1184 } 1184 }
1185 else 1185 else
1186 { 1186 {
1187 title = _("Move - GQview"); 1187 title = _("Move - Geeqie");
1188 op_text = _("_Move"); 1188 op_text = _("_Move");
1189 if (fd) 1189 if (fd)
1190 { 1190 {
1191 text = _("Move file"); 1191 text = _("Move file");
1192 } 1192 }
1195 text = _("Move multiple files"); 1195 text = _("Move multiple files");
1196 } 1196 }
1197 stock_id = GTK_STOCK_OK; 1197 stock_id = GTK_STOCK_OK;
1198 } 1198 }
1199 1199
1200 fdlg = file_util_file_dlg(title, "GQview", "dlg_copymove", parent, 1200 fdlg = file_util_file_dlg(title, "Geeqie", "dlg_copymove", parent,
1201 file_util_move_cancel_cb, NULL); 1201 file_util_move_cancel_cb, NULL);
1202 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, text, NULL); 1202 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, text, NULL);
1203 1203
1204 if (fd) 1204 if (fd)
1205 { 1205 {
1498 list = list->next; 1498 list = list->next;
1499 } 1499 }
1500 if (resume_data) 1500 if (resume_data)
1501 { 1501 {
1502 g_string_append(msg, _("\n Continue multiple delete operation?")); 1502 g_string_append(msg, _("\n Continue multiple delete operation?"));
1503 d = file_util_gen_dlg(_("Delete failed"), "GQview", "dlg_confirm", 1503 d = file_util_gen_dlg(_("Delete failed"), "Geeqie", "dlg_confirm",
1504 NULL, TRUE, 1504 NULL, TRUE,
1505 file_util_delete_ext_cancel_cb, resume_data); 1505 file_util_delete_ext_cancel_cb, resume_data);
1506 1506
1507 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, msg->str); 1507 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, msg->str);
1508 1508
1590 if (source_list) 1590 if (source_list)
1591 { 1591 {
1592 GenericDialog *d; 1592 GenericDialog *d;
1593 gchar *text; 1593 gchar *text;
1594 1594
1595 d = file_util_gen_dlg(_("Delete failed"), "GQview", "dlg_confirm", 1595 d = file_util_gen_dlg(_("Delete failed"), "Geeqie", "dlg_confirm",
1596 NULL, TRUE, 1596 NULL, TRUE,
1597 file_util_delete_multiple_cancel_cb, source_list); 1597 file_util_delete_multiple_cancel_cb, source_list);
1598 1598
1599 text = g_strdup_printf(_("Unable to delete file:\n %s\n Continue multiple delete operation?"), fd->path); 1599 text = g_strdup_printf(_("Unable to delete file:\n %s\n Continue multiple delete operation?"), fd->path);
1600 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, text); 1600 generic_dialog_add_message(d, GTK_STOCK_DIALOG_WARNING, NULL, text);
1734 GtkWidget *button; 1734 GtkWidget *button;
1735 GtkWidget *label; 1735 GtkWidget *label;
1736 ImageWindow *imd; 1736 ImageWindow *imd;
1737 gchar *buf; 1737 gchar *buf;
1738 1738
1739 gd = file_util_gen_dlg(_("Delete files - GQview"), 1739 gd = file_util_gen_dlg(_("Delete files - Geeqie"),
1740 "GQview", "dlg_confirm", parent, TRUE, 1740 "Geeqie", "dlg_confirm", parent, TRUE,
1741 file_util_delete_multiple_cancel_cb, source_list); 1741 file_util_delete_multiple_cancel_cb, source_list);
1742 1742
1743 generic_dialog_add_message(gd, NULL, _("Delete multiple files"), NULL); 1743 generic_dialog_add_message(gd, NULL, _("Delete multiple files"), NULL);
1744 1744
1745 generic_dialog_add_image(gd, NULL, NULL, NULL, NULL, NULL, TRUE); 1745 generic_dialog_add_image(gd, NULL, NULL, NULL, NULL, NULL, TRUE);
1830 { 1830 {
1831 GenericDialog *gd; 1831 GenericDialog *gd;
1832 GtkWidget *table; 1832 GtkWidget *table;
1833 gchar *base; 1833 gchar *base;
1834 1834
1835 gd = file_util_gen_dlg(_("Delete file - GQview"), "GQview", "dlg_confirm", 1835 gd = file_util_gen_dlg(_("Delete file - Geeqie"), "Geeqie", "dlg_confirm",
1836 parent, TRUE, 1836 parent, TRUE,
1837 file_util_delete_cancel_cb, file_data_ref(fd)); 1837 file_util_delete_cancel_cb, file_data_ref(fd));
1838 1838
1839 generic_dialog_add_message(gd, NULL, _("Delete file?"), NULL); 1839 generic_dialog_add_message(gd, NULL, _("Delete file?"), NULL);
1840 1840
1987 1987
1988 if (isfile(fdlg->dest_path) && !fdlg->type) 1988 if (isfile(fdlg->dest_path) && !fdlg->type)
1989 { 1989 {
1990 GenericDialog *gd; 1990 GenericDialog *gd;
1991 1991
1992 gd = file_util_gen_dlg(_("Overwrite file"), "GQview", "dlg_confirm", 1992 gd = file_util_gen_dlg(_("Overwrite file"), "Geeqie", "dlg_confirm",
1993 NULL, TRUE, 1993 NULL, TRUE,
1994 file_util_rename_multiple_cancel_cb, rd); 1994 file_util_rename_multiple_cancel_cb, rd);
1995 1995
1996 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, 1996 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION,
1997 _("Overwrite file?"), 1997 _("Overwrite file?"),
2516 GList *work; 2516 GList *work;
2517 const gchar *name; 2517 const gchar *name;
2518 2518
2519 rd = g_new0(RenameDataMult, 1); 2519 rd = g_new0(RenameDataMult, 1);
2520 2520
2521 rd->fdlg = file_util_file_dlg(_("Rename - GQview"), 2521 rd->fdlg = file_util_file_dlg(_("Rename - Geeqie"),
2522 "GQview", "dlg_rename", parent, 2522 "Geeqie", "dlg_rename", parent,
2523 file_util_rename_multiple_close_cb, rd); 2523 file_util_rename_multiple_close_cb, rd);
2524 generic_dialog_add_message(GENERIC_DIALOG(rd->fdlg), NULL, _("Rename multiple files"), NULL); 2524 generic_dialog_add_message(GENERIC_DIALOG(rd->fdlg), NULL, _("Rename multiple files"), NULL);
2525 file_dialog_add_button(rd->fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_multiple_cb, TRUE); 2525 file_dialog_add_button(rd->fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_multiple_cb, TRUE);
2526 2526
2527 rd->fdlg->source_fd = file_data_ref(source_list->data); 2527 rd->fdlg->source_fd = file_data_ref(source_list->data);
2705 { 2705 {
2706 if (isfile(fds->dest) && !fds->confirmed) 2706 if (isfile(fds->dest) && !fds->confirmed)
2707 { 2707 {
2708 GenericDialog *gd; 2708 GenericDialog *gd;
2709 2709
2710 gd = file_util_gen_dlg(_("Overwrite file"), "GQview", "dlg_confirm", 2710 gd = file_util_gen_dlg(_("Overwrite file"), "Geeqie", "dlg_confirm",
2711 NULL, TRUE, 2711 NULL, TRUE,
2712 file_util_rename_single_cancel_cb, fds); 2712 file_util_rename_single_cancel_cb, fds);
2713 2713
2714 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, 2714 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION,
2715 _("Overwrite file?"), 2715 _("Overwrite file?"),
2773 { 2773 {
2774 FileDialog *fdlg; 2774 FileDialog *fdlg;
2775 GtkWidget *table; 2775 GtkWidget *table;
2776 const gchar *name; 2776 const gchar *name;
2777 2777
2778 fdlg = file_util_file_dlg(_("Rename - GQview"), "GQview", "dlg_rename", parent, 2778 fdlg = file_util_file_dlg(_("Rename - Geeqie"), "Geeqie", "dlg_rename", parent,
2779 file_util_rename_single_close_cb, NULL); 2779 file_util_rename_single_close_cb, NULL);
2780 2780
2781 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, _("Rename file"), NULL); 2781 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, _("Rename file"), NULL);
2782 generic_dialog_add_image(GENERIC_DIALOG(fdlg), NULL, source_fd, NULL, NULL, NULL, FALSE); 2782 generic_dialog_add_image(GENERIC_DIALOG(fdlg), NULL, source_fd, NULL, NULL, NULL, FALSE);
2783 2783
2895 FileDialog *fdlg; 2895 FileDialog *fdlg;
2896 gchar *text; 2896 gchar *text;
2897 2897
2898 if (!isdir(path)) return; 2898 if (!isdir(path)) return;
2899 2899
2900 fdlg = file_util_file_dlg(_("New folder - GQview"), "GQview", "dlg_newdir", parent, 2900 fdlg = file_util_file_dlg(_("New folder - Geeqie"), "Geeqie", "dlg_newdir", parent,
2901 file_util_create_dir_close_cb, NULL); 2901 file_util_create_dir_close_cb, NULL);
2902 2902
2903 text = g_strdup_printf(_("Create folder in:\n%s\nnamed:"), path); 2903 text = g_strdup_printf(_("Create folder in:\n%s\nnamed:"), path);
2904 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, NULL, text); 2904 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, NULL, text);
2905 g_free(text); 2905 g_free(text);
3293 ud->type = UTILITY_TYPE_DELETE_LINK; 3293 ud->type = UTILITY_TYPE_DELETE_LINK;
3294 ud->source_fd = file_data_ref(fd); 3294 ud->source_fd = file_data_ref(fd);
3295 ud->dlist = NULL; 3295 ud->dlist = NULL;
3296 ud->flist = NULL; 3296 ud->flist = NULL;
3297 3297
3298 ud->gd = file_util_gen_dlg(_("Delete folder"), "GQview", "dlg_confirm", 3298 ud->gd = file_util_gen_dlg(_("Delete folder"), "Geeqie", "dlg_confirm",
3299 parent, TRUE, 3299 parent, TRUE,
3300 file_util_delete_dir_cancel_cb, ud); 3300 file_util_delete_dir_cancel_cb, ud);
3301 3301
3302 text = g_strdup_printf(_("This will delete the symbolic link:\n\n%s\n\n" 3302 text = g_strdup_printf(_("This will delete the symbolic link:\n\n%s\n\n"
3303 "The folder this link points to will not be deleted."), 3303 "The folder this link points to will not be deleted."),
3342 { 3342 {
3343 GenericDialog *gd; 3343 GenericDialog *gd;
3344 GtkWidget *box; 3344 GtkWidget *box;
3345 gchar *text; 3345 gchar *text;
3346 3346
3347 gd = file_util_gen_dlg(_("Folder contains subfolders"), "GQview", "dlg_warning", 3347 gd = file_util_gen_dlg(_("Folder contains subfolders"), "Geeqie", "dlg_warning",
3348 parent, TRUE, NULL, NULL); 3348 parent, TRUE, NULL, NULL);
3349 generic_dialog_add_button(gd, GTK_STOCK_CLOSE, NULL, NULL, TRUE); 3349 generic_dialog_add_button(gd, GTK_STOCK_CLOSE, NULL, NULL, TRUE);
3350 3350
3351 text = g_strdup_printf(_("Unable to delete the folder:\n\n%s\n\n" 3351 text = g_strdup_printf(_("Unable to delete the folder:\n\n%s\n\n"
3352 "This folder contains subfolders which must be moved before it can be deleted."), 3352 "This folder contains subfolders which must be moved before it can be deleted."),
3377 ud->dlist = dlist; 3377 ud->dlist = dlist;
3378 dlist = NULL; 3378 dlist = NULL;
3379 ud->flist = filelist_sort_path(flist); 3379 ud->flist = filelist_sort_path(flist);
3380 flist = NULL; 3380 flist = NULL;
3381 3381
3382 ud->gd = file_util_gen_dlg(_("Delete folder"), "GQview", "dlg_confirm", 3382 ud->gd = file_util_gen_dlg(_("Delete folder"), "Geeqie", "dlg_confirm",
3383 parent, TRUE, file_util_delete_dir_cancel_cb, ud); 3383 parent, TRUE, file_util_delete_dir_cancel_cb, ud);
3384 generic_dialog_add_button(ud->gd, GTK_STOCK_DELETE, NULL, file_util_delete_dir_ok_cb, TRUE); 3384 generic_dialog_add_button(ud->gd, GTK_STOCK_DELETE, NULL, file_util_delete_dir_ok_cb, TRUE);
3385 3385
3386 text = g_strdup_printf(_("This will delete the folder:\n\n%s\n\n" 3386 text = g_strdup_printf(_("This will delete the folder:\n\n%s\n\n"
3387 "The contents of this folder will also be deleted."), 3387 "The contents of this folder will also be deleted."),