comparison src/utilops.c @ 675:cca86176bf81

Fix redundant application name in window titles. It simplifies code.
author zas_
date Fri, 16 May 2008 14:59:45 +0000
parents fbebf5cf4a55
children e07895754e65
comparison
equal deleted inserted replaced
674:6b18c47a724c 675:cca86176bf81
1171 multiple = FALSE; 1171 multiple = FALSE;
1172 } 1172 }
1173 1173
1174 if (copy) 1174 if (copy)
1175 { 1175 {
1176 title = g_strdup_printf("%s -%s", _("Copy"), GQ_APPNAME); 1176 title = _("Copy");
1177 op_text = _("_Copy"); 1177 op_text = _("_Copy");
1178 if (fd) 1178 if (fd)
1179 { 1179 {
1180 text = _("Copy file"); 1180 text = _("Copy file");
1181 } 1181 }
1185 } 1185 }
1186 stock_id = GTK_STOCK_COPY; 1186 stock_id = GTK_STOCK_COPY;
1187 } 1187 }
1188 else 1188 else
1189 { 1189 {
1190 title = g_strdup_printf("%s -%s", _("Move"), GQ_APPNAME); 1190 title = _("Move");
1191 op_text = _("_Move"); 1191 op_text = _("_Move");
1192 if (fd) 1192 if (fd)
1193 { 1193 {
1194 text = _("Move file"); 1194 text = _("Move file");
1195 } 1195 }
1200 stock_id = GTK_STOCK_OK; 1200 stock_id = GTK_STOCK_OK;
1201 } 1201 }
1202 1202
1203 fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_copymove", parent, 1203 fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_copymove", parent,
1204 file_util_move_cancel_cb, NULL); 1204 file_util_move_cancel_cb, NULL);
1205 g_free(title);
1206 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, text, NULL); 1205 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, text, NULL);
1207 1206
1208 if (fd) 1207 if (fd)
1209 { 1208 {
1210 GtkWidget *box; 1209 GtkWidget *box;
1631 GtkWidget *hbox; 1630 GtkWidget *hbox;
1632 GtkWidget *button; 1631 GtkWidget *button;
1633 GtkWidget *label; 1632 GtkWidget *label;
1634 ImageWindow *imd; 1633 ImageWindow *imd;
1635 gchar *buf; 1634 gchar *buf;
1636 gchar *title = g_strdup_printf("%s -%s", _("Delete files"), GQ_APPNAME); 1635
1637 1636 gd = file_util_gen_dlg(_("Delete files"), GQ_WMCLASS, "dlg_confirm", parent, TRUE,
1638 gd = file_util_gen_dlg(title, GQ_WMCLASS, "dlg_confirm", parent, TRUE,
1639 file_util_delete_multiple_cancel_cb, source_list); 1637 file_util_delete_multiple_cancel_cb, source_list);
1640 g_free(title);
1641 1638
1642 generic_dialog_add_message(gd, NULL, _("Delete multiple files"), NULL); 1639 generic_dialog_add_message(gd, NULL, _("Delete multiple files"), NULL);
1643 1640
1644 generic_dialog_add_image(gd, NULL, NULL, NULL, NULL, NULL, TRUE); 1641 generic_dialog_add_image(gd, NULL, NULL, NULL, NULL, NULL, TRUE);
1645 imd = g_object_get_data(G_OBJECT(gd->dialog), "img_image"); 1642 imd = g_object_get_data(G_OBJECT(gd->dialog), "img_image");
1728 else 1725 else
1729 { 1726 {
1730 GenericDialog *gd; 1727 GenericDialog *gd;
1731 GtkWidget *table; 1728 GtkWidget *table;
1732 gchar *base; 1729 gchar *base;
1733 gchar *title = g_strdup_printf("%s -%s", _("Delete file"), GQ_APPNAME); 1730
1734 1731 gd = file_util_gen_dlg(_("Delete file"), GQ_WMCLASS, "dlg_confirm", parent, TRUE,
1735 gd = file_util_gen_dlg(title, GQ_WMCLASS, "dlg_confirm", parent, TRUE,
1736 file_util_delete_cancel_cb, file_data_ref(fd)); 1732 file_util_delete_cancel_cb, file_data_ref(fd));
1737 g_free(title);
1738 1733
1739 generic_dialog_add_message(gd, NULL, _("Delete file?"), NULL); 1734 generic_dialog_add_message(gd, NULL, _("Delete file?"), NULL);
1740 1735
1741 table = pref_table_new(gd->vbox, 2, 2, FALSE, FALSE); 1736 table = pref_table_new(gd->vbox, 2, 2, FALSE, FALSE);
1742 1737
2413 GtkWidget *box2; 2408 GtkWidget *box2;
2414 GtkWidget *table; 2409 GtkWidget *table;
2415 GtkWidget *combo; 2410 GtkWidget *combo;
2416 GList *work; 2411 GList *work;
2417 const gchar *name; 2412 const gchar *name;
2418 gchar *title;
2419 2413
2420 rd = g_new0(RenameDataMult, 1); 2414 rd = g_new0(RenameDataMult, 1);
2421 2415
2422 title = g_strdup_printf("%s -%s", _("Rename"), GQ_APPNAME); 2416 rd->fdlg = file_util_file_dlg( _("Rename"), GQ_WMCLASS, "dlg_rename", parent,
2423 rd->fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_rename", parent,
2424 file_util_rename_multiple_close_cb, rd); 2417 file_util_rename_multiple_close_cb, rd);
2425 g_free(title);
2426 generic_dialog_add_message(GENERIC_DIALOG(rd->fdlg), NULL, _("Rename multiple files"), NULL); 2418 generic_dialog_add_message(GENERIC_DIALOG(rd->fdlg), NULL, _("Rename multiple files"), NULL);
2427 file_dialog_add_button(rd->fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_multiple_cb, TRUE); 2419 file_dialog_add_button(rd->fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_multiple_cb, TRUE);
2428 2420
2429 rd->fdlg->source_fd = file_data_ref(source_list->data); 2421 rd->fdlg->source_fd = file_data_ref(source_list->data);
2430 rd->fdlg->dest_path = NULL; 2422 rd->fdlg->dest_path = NULL;
2674 static void file_util_rename_single_do(FileData *source_fd, GtkWidget *parent) 2666 static void file_util_rename_single_do(FileData *source_fd, GtkWidget *parent)
2675 { 2667 {
2676 FileDialog *fdlg; 2668 FileDialog *fdlg;
2677 GtkWidget *table; 2669 GtkWidget *table;
2678 const gchar *name; 2670 const gchar *name;
2679 gchar *title; 2671
2680 2672 fdlg = file_util_file_dlg(_("Rename"), GQ_WMCLASS, "dlg_rename", parent,
2681 title = g_strdup_printf("%s -%s", _("Rename"), GQ_APPNAME);
2682 fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_rename", parent,
2683 file_util_rename_single_close_cb, NULL); 2673 file_util_rename_single_close_cb, NULL);
2684 g_free(title);
2685 2674
2686 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, _("Rename file"), NULL); 2675 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, _("Rename file"), NULL);
2687 generic_dialog_add_image(GENERIC_DIALOG(fdlg), NULL, source_fd, NULL, NULL, NULL, FALSE); 2676 generic_dialog_add_image(GENERIC_DIALOG(fdlg), NULL, source_fd, NULL, NULL, NULL, FALSE);
2688 2677
2689 file_dialog_add_button(fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_single_cb, TRUE); 2678 file_dialog_add_button(fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_single_cb, TRUE);
2797 2786
2798 void file_util_create_dir(const gchar *path, GtkWidget *parent) 2787 void file_util_create_dir(const gchar *path, GtkWidget *parent)
2799 { 2788 {
2800 FileDialog *fdlg; 2789 FileDialog *fdlg;
2801 gchar *text; 2790 gchar *text;
2802 gchar *title;
2803 2791
2804 if (!isdir(path)) return; 2792 if (!isdir(path)) return;
2805 2793
2806 title = g_strdup_printf("%s -%s", _("New folder"), GQ_APPNAME); 2794 fdlg = file_util_file_dlg(_("New folder"), GQ_WMCLASS, "dlg_newdir", parent,
2807 fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_newdir", parent,
2808 file_util_create_dir_close_cb, NULL); 2795 file_util_create_dir_close_cb, NULL);
2809 g_free(title);
2810 2796
2811 text = g_strdup_printf(_("Create folder in:\n%s\nnamed:"), path); 2797 text = g_strdup_printf(_("Create folder in:\n%s\nnamed:"), path);
2812 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, NULL, text); 2798 generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, NULL, text);
2813 g_free(text); 2799 g_free(text);
2814 2800