changeset 675:cca86176bf81

Fix redundant application name in window titles. It simplifies code.
author zas_
date Fri, 16 May 2008 14:59:45 +0000
parents 6b18c47a724c
children 3a4a7385997c
files src/cache_maint.c src/print.c src/utilops.c
diffstat 3 files changed, 13 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache_maint.c	Fri May 16 14:38:05 2008 +0000
+++ b/src/cache_maint.c	Fri May 16 14:59:45 2008 +0000
@@ -1158,7 +1158,6 @@
 	GtkWidget *table;
 	GtkSizeGroup *sizegroup;
 	gchar *buf;
-	gchar *title;
 
 	if (cache_manager)
 		{
@@ -1168,12 +1167,10 @@
 
 	cache_manager = g_new0(CacheManager, 1);
 
-	title = g_strdup_printf("%s - %s", _("Cache Maintenance"), GQ_APPNAME);
-	cache_manager->dialog = generic_dialog_new(title,
+	cache_manager->dialog = generic_dialog_new(_("Cache Maintenance"),
 						   GQ_WMCLASS, "cache_manager",
 						   NULL, FALSE,
 						   NULL, cache_manager);
-	g_free(title);
 	gd = cache_manager->dialog;
 
 	gd->cancel_cb = cache_manager_close_cb;
--- a/src/print.c	Fri May 16 14:38:05 2008 +0000
+++ b/src/print.c	Fri May 16 14:59:45 2008 +0000
@@ -2612,13 +2612,9 @@
 
 	gtk_widget_hide(pw->dialog->dialog);
 
-	{
-	gchar *title = g_strdup_printf("%s - %s", _("Print"), GQ_APPNAME);
-	pw->job_dialog = file_util_gen_dlg(title, GQ_WMCLASS, "print_job_dialog",
+	pw->job_dialog = file_util_gen_dlg(_("Print"), GQ_WMCLASS, "print_job_dialog",
 					   (GtkWidget *)gtk_window_get_transient_for(GTK_WINDOW(pw->dialog->dialog)), FALSE,
 					   print_job_cancel_cb, pw);
-	g_free(title);
-	}
 
 	msg = g_strdup_printf(_("Printing %d pages to %s."), print_layout_page_count(pw), print_output_name(pw->output));
 	generic_dialog_add_message(pw->job_dialog, NULL, msg, NULL);
@@ -3372,13 +3368,9 @@
 
 	pw->save_settings = print_pref_int(PRINT_PREF_SAVE, TRUE);
 
-	{
-	gchar *title = g_strdup_printf("%s - %s", _("Print"), GQ_APPNAME);
-	pw->dialog = file_util_gen_dlg(title, GQ_WMCLASS, "print_dialog",
+	pw->dialog = file_util_gen_dlg(_("Print"), GQ_WMCLASS, "print_dialog",
 				       parent, FALSE,
 				       print_window_cancel_cb, pw);
-	g_free(title);
-	}
 
 	geometry.min_width = 32;
 	geometry.min_height = 32;
--- a/src/utilops.c	Fri May 16 14:38:05 2008 +0000
+++ b/src/utilops.c	Fri May 16 14:59:45 2008 +0000
@@ -1173,7 +1173,7 @@
 
 	if (copy)
 		{
-		title = g_strdup_printf("%s -%s", _("Copy"), GQ_APPNAME);
+		title = _("Copy");
 		op_text = _("_Copy");
 		if (fd)
 			{
@@ -1187,7 +1187,7 @@
 		}
 	else
 		{
-		title = g_strdup_printf("%s -%s", _("Move"), GQ_APPNAME);
+		title = _("Move");
 		op_text = _("_Move");
 		if (fd)
 			{
@@ -1202,7 +1202,6 @@
 
 	fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_copymove", parent,
 				file_util_move_cancel_cb, NULL);
-	g_free(title);
 	generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, text, NULL);
 
 	if (fd)
@@ -1633,11 +1632,9 @@
 		GtkWidget *label;
 		ImageWindow *imd;
 		gchar *buf;
-		gchar *title = g_strdup_printf("%s -%s", _("Delete files"), GQ_APPNAME);
-
-		gd = file_util_gen_dlg(title, GQ_WMCLASS, "dlg_confirm", parent, TRUE,
+	
+		gd = file_util_gen_dlg(_("Delete files"), GQ_WMCLASS, "dlg_confirm", parent, TRUE,
 				       file_util_delete_multiple_cancel_cb, source_list);
-		g_free(title);
 
 		generic_dialog_add_message(gd, NULL, _("Delete multiple files"), NULL);
 
@@ -1730,11 +1727,9 @@
 		GenericDialog *gd;
 		GtkWidget *table;
 		gchar *base;
-		gchar *title = g_strdup_printf("%s -%s", _("Delete file"), GQ_APPNAME);
-
-		gd = file_util_gen_dlg(title, GQ_WMCLASS, "dlg_confirm", parent, TRUE,
+	
+		gd = file_util_gen_dlg(_("Delete file"), GQ_WMCLASS, "dlg_confirm", parent, TRUE,
 				       file_util_delete_cancel_cb, file_data_ref(fd));
-		g_free(title);
 
 		generic_dialog_add_message(gd, NULL, _("Delete file?"), NULL);
 
@@ -2415,14 +2410,11 @@
 	GtkWidget *combo;
 	GList *work;
 	const gchar *name;
-	gchar *title;
 
 	rd = g_new0(RenameDataMult, 1);
 
-	title = g_strdup_printf("%s -%s", _("Rename"), GQ_APPNAME);
-	rd->fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_rename", parent,
+	rd->fdlg = file_util_file_dlg( _("Rename"), GQ_WMCLASS, "dlg_rename", parent,
 				      file_util_rename_multiple_close_cb, rd);
-	g_free(title);
 	generic_dialog_add_message(GENERIC_DIALOG(rd->fdlg), NULL, _("Rename multiple files"), NULL);
 	file_dialog_add_button(rd->fdlg, GTK_STOCK_OK, _("_Rename"), file_util_rename_multiple_cb, TRUE);
 
@@ -2676,12 +2668,9 @@
 	FileDialog *fdlg;
 	GtkWidget *table;
 	const gchar *name;
-	gchar *title;
-
-	title = g_strdup_printf("%s -%s", _("Rename"), GQ_APPNAME);
-	fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_rename", parent,
+
+	fdlg = file_util_file_dlg(_("Rename"), GQ_WMCLASS, "dlg_rename", parent,
 				  file_util_rename_single_close_cb, NULL);
-	g_free(title);
 
 	generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, _("Rename file"), NULL);
 	generic_dialog_add_image(GENERIC_DIALOG(fdlg), NULL, source_fd, NULL, NULL, NULL, FALSE);
@@ -2799,14 +2788,11 @@
 {
 	FileDialog *fdlg;
 	gchar *text;
-	gchar *title;
 
 	if (!isdir(path)) return;
 
-	title = g_strdup_printf("%s -%s", _("New folder"), GQ_APPNAME);
-	fdlg = file_util_file_dlg(title, GQ_WMCLASS, "dlg_newdir", parent,
+	fdlg = file_util_file_dlg(_("New folder"), GQ_WMCLASS, "dlg_newdir", parent,
 				  file_util_create_dir_close_cb, NULL);
-	g_free(title);
 
 	text = g_strdup_printf(_("Create folder in:\n%s\nnamed:"), path);
 	generic_dialog_add_message(GENERIC_DIALOG(fdlg), NULL, NULL, text);