[Epiphany] Lame patch



This patch sets window icons matching the menu icons for the find, 
print, history, preferences, and about windows/dialogs. This is 
important because some window themes do display icons in the title bars. 
I would like to set the icon for the open and save dialogs, but i must 
admit, I was a little confused as to how to do that. In addition the new 
bookmark, personal data, and toolbars dialogs still need window/menu 
icons (maybe we can bother tigert or jimmac for some icons).

Also in the new bookmark dialog I s/add bookmark/new bookmark since it 
just seems to make more sense now that we no longer have a "add 
bookmark" menu item.

ok to commit?

dave
Index: embed/find-dialog.c
===================================================================
RCS file: /cvs/gnome/epiphany/embed/find-dialog.c,v
retrieving revision 1.2
diff -u -p -r1.2 find-dialog.c
--- embed/find-dialog.c	15 Feb 2003 09:27:09 -0000	1.2
+++ embed/find-dialog.c	24 Mar 2003 05:10:09 -0000
@@ -19,6 +19,7 @@
 #include "find-dialog.h"
 #include "ephy-prefs.h"
 #include "ephy-embed.h"
+#include <gtk/gtk.h>
 
 #define CONF_FIND_MATCH_CASE "/apps/epiphany/find/match_case"
 #define CONF_FIND_AUTOWRAP "/apps/epiphany/find/autowrap"
@@ -51,6 +52,7 @@ static GObjectClass *parent_class = NULL
 struct FindDialogPrivate
 {
 	EmbedFindInfo *properties;
+	GtkWidget *window;
 	gboolean can_go_prev;
 	gboolean can_go_next;
 	gboolean constructed;
@@ -64,6 +66,7 @@ enum
 
 enum
 {
+	WINDOW_PROP,
 	MATCH_CASE_PROP,
 	AUTOWRAP_PROP,
 	WORD_PROP,
@@ -74,6 +77,7 @@ enum
 static const
 EphyDialogProperty properties [] =
 {
+	{ WINDOW_PROP, "find_dialog", NULL, PT_NORMAL, NULL },
 	{ MATCH_CASE_PROP, "case_check", CONF_FIND_MATCH_CASE, PT_NORMAL, NULL },
 	{ AUTOWRAP_PROP, "wrap_check", CONF_FIND_AUTOWRAP, PT_NORMAL, NULL },
 	{ WORD_PROP, "find_entry", CONF_FIND_WORD, PT_NORMAL, NULL },
@@ -250,11 +254,13 @@ find_get_info (EphyDialog *dialog)
 static void
 impl_show (EphyDialog *dialog)
 {
+	GdkPixbuf *icon;
 	FindDialog *find_dialog = FIND_DIALOG(dialog);
 	ensure_constructed (find_dialog);
 
 	find_dialog->priv->can_go_prev = TRUE;
 	find_dialog->priv->can_go_next = TRUE;
+	find_dialog->priv->window = ephy_dialog_get_control (dialog, WINDOW_PROP);
 	find_get_info (dialog);
 	find_update_nav (dialog);
 
@@ -264,6 +270,13 @@ impl_show (EphyDialog *dialog)
 	 */
 	gtk_widget_grab_focus (ephy_dialog_get_control (dialog, WORD_PROP));
 
+	
+	icon = gtk_widget_render_icon (find_dialog->priv->window, 
+						      GTK_STOCK_FIND,
+						      GTK_ICON_SIZE_MENU,
+						      "find_dialog");
+	gtk_window_set_icon (find_dialog->priv->window, icon);
+	g_object_unref(icon);
 	EPHY_DIALOG_CLASS (parent_class)->show (dialog);
 }
 
Index: embed/print-dialog.c
===================================================================
RCS file: /cvs/gnome/epiphany/embed/print-dialog.c,v
retrieving revision 1.2
diff -u -p -r1.2 print-dialog.c
--- embed/print-dialog.c	14 Mar 2003 23:19:40 -0000	1.2
+++ embed/print-dialog.c	24 Mar 2003 05:10:11 -0000
@@ -19,6 +19,7 @@
 #include "print-dialog.h"
 #include "ephy-prefs.h"
 #include <gtk/gtkdialog.h>
+#include <gtk/gtkstock.h>
 
 #define CONF_PRINT_BOTTOM_MARGIN "/apps/epiphany/print/bottom_margin"
 #define CONF_PRINT_TOP_MARGIN "/apps/epiphany/print/top_margin"
@@ -57,10 +58,12 @@ static GObjectClass *parent_class = NULL
 struct PrintDialogPrivate
 {
 	gpointer dummy;
+	GtkWidget *window;
 };
 
 enum
 {
+	WINDOW_PROP,
 	PRINTON_PROP,
 	PRINTER_PROP,
 	FILE_PROP,
@@ -89,6 +92,7 @@ enum
 static const
 EphyDialogProperty properties [] =
 {
+	{ WINDOW_PROP, "print_dialog", NULL, PT_NORMAL, NULL },
 	{ PRINTON_PROP, "printer_radiobutton", CONF_PRINT_PRINTON, PT_NORMAL, NULL },
 	{ PRINTER_PROP, "printer_entry", CONF_PRINT_PRINTER, PT_NORMAL, NULL },
 	{ FILE_PROP, "file_entry", CONF_PRINT_FILE, PT_NORMAL, NULL },
@@ -164,6 +168,7 @@ print_dialog_class_init (PrintDialogClas
 static void
 print_dialog_init (PrintDialog *dialog)
 {
+	GdkPixbuf *icon;
 	dialog->priv = g_new0 (PrintDialogPrivate, 1);
 
 	dialog->only_collect_info = FALSE;
@@ -173,6 +178,15 @@ print_dialog_init (PrintDialog *dialog)
 	ephy_dialog_construct (EPHY_DIALOG(dialog),
 				 properties,
 				 "print.glade", "print_dialog");
+
+	dialog->priv->window = ephy_dialog_get_control(EPHY_DIALOG(dialog), WINDOW_PROP);
+	
+	icon = gtk_widget_render_icon (dialog->priv->window, 
+						      GTK_STOCK_PRINT,
+						      GTK_ICON_SIZE_MENU,
+						      "print_dialog");
+	gtk_window_set_icon (GTK_WINDOW(dialog->priv->window), icon);
+	g_object_unref(icon);
 }
 
 static void
Index: src/history-dialog.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/history-dialog.c,v
retrieving revision 1.5
diff -u -p -r1.5 history-dialog.c
--- src/history-dialog.c	20 Feb 2003 17:22:04 -0000	1.5
+++ src/history-dialog.c	24 Mar 2003 05:10:18 -0000
@@ -19,6 +19,7 @@
 #include "history-dialog.h"
 #include "ephy-shell.h"
 #include "ephy-embed-shell.h"
+#include "ephy-file-helpers.h"
 #include "ephy-string.h"
 #include "ephy-gui.h"
 #include "ephy-dnd.h"
@@ -69,6 +70,7 @@ static GObjectClass *parent_class = NULL
 
 struct HistoryDialogPrivate
 {
+	GtkWidget *window;
 	EphyHistory *gh;
 	EphyNode *root;
 	EphyNode *pages;
@@ -91,6 +93,7 @@ enum
 
 enum
 {
+	PROP_WINDOW,
 	PROP_TREEVIEW,
 	PROP_WORD,
 	PROP_TIME,
@@ -100,6 +103,7 @@ enum
 static const
 EphyDialogProperty properties [] =
 {
+	{ PROP_WINDOW, "history_dialog", NULL, PT_NORMAL, NULL },
 	{ PROP_TREEVIEW, "history_treeview", NULL, PT_NORMAL, NULL },
 	{ PROP_WORD, "history_entry", CONF_HISTORY_SEARCH_TEXT, PT_NORMAL, NULL },
 	{ PROP_TIME, "history_time_optionmenu", CONF_HISTORY_SEARCH_TIME, PT_NORMAL, NULL },
@@ -402,6 +406,8 @@ static void
 history_dialog_set_embedded (HistoryDialog *dialog,
 			     gboolean embedded)
 {
+	const char *icon_path;
+	
 	dialog->priv->embedded = embedded;
 
 	ephy_dialog_construct (EPHY_DIALOG (dialog),
@@ -410,11 +416,15 @@ history_dialog_set_embedded (HistoryDial
 			       embedded ?
 			       "history_dock_box" :
 			       "history_dialog");
+	dialog->priv->window = ephy_dialog_get_control(EPHY_DIALOG (dialog), PROP_WINDOW);
 	dialog->priv->go_button = ephy_dialog_get_control (EPHY_DIALOG (dialog), PROP_GO_BUTTON);
-
 	dialog->priv->treeview = GTK_TREE_VIEW (
 				 ephy_dialog_get_control (EPHY_DIALOG(dialog),
 							    PROP_TREEVIEW));
+	
+	icon_path =  ephy_file ("epiphany-history.png");
+	gtk_window_set_icon_from_file (GTK_WINDOW(dialog->priv->window), icon_path, NULL);
+
 	history_dialog_setup_view (dialog);
 	history_dialog_setup_filter (dialog);
 }
Index: src/prefs-dialog.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/prefs-dialog.c,v
retrieving revision 1.5
diff -u -p -r1.5 prefs-dialog.c
--- src/prefs-dialog.c	18 Mar 2003 19:13:23 -0000	1.5
+++ src/prefs-dialog.c	24 Mar 2003 05:10:19 -0000
@@ -301,6 +301,7 @@ prefs_build_notebook (PrefsDialog *pd)
 static void
 prefs_dialog_init (PrefsDialog *pd)
 {
+	GdkPixbuf *icon;
 	pd->priv = g_new0 (PrefsDialogPrivate, 1);
 
 	gtk_window_set_title (GTK_WINDOW(pd), _("Preferences"));
@@ -308,6 +309,13 @@ prefs_dialog_init (PrefsDialog *pd)
 
 	ephy_state_add_window (GTK_WIDGET(pd),
 			       "prefs_dialog", -1, -1);
+	
+	icon = gtk_widget_render_icon (GTK_WIDGET(pd),
+						      GTK_STOCK_PREFERENCES,
+						      GTK_ICON_SIZE_MENU,
+						      "prefs_dialog");
+	gtk_window_set_icon (GTK_WINDOW(pd), icon);
+	g_object_unref(icon);
 
 	prefs_build_notebook (pd);
 }
Index: src/window-commands.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/window-commands.c,v
retrieving revision 1.21
diff -u -p -r1.21 window-commands.c
--- src/window-commands.c	22 Mar 2003 23:59:03 -0000	1.21
+++ src/window-commands.c	24 Mar 2003 05:10:23 -0000
@@ -37,6 +37,7 @@
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <bonobo/bonobo-i18n.h>
 #include <libgnomeui/gnome-about.h>
+#include <libgnomeui/gnome-stock-icons.h>
 #include <libgnome/gnome-help.h>
 #include <gtk/gtkmessagedialog.h>
 #include <gtk/gtkeditable.h>
@@ -648,6 +649,7 @@ window_cmd_help_about (EggAction *action
 		       EphyWindow *window)
 {
 	static GtkWidget *about = NULL;
+	GdkPixbuf *icon;
 
 	static gchar *authors[] = {
 		"Marco Pesenti Gritti <mpeseng@tin.it>",
@@ -679,6 +681,14 @@ window_cmd_help_about (EggAction *action
 
 	gtk_window_set_transient_for (GTK_WINDOW (about),
 				      GTK_WINDOW (window));
+	
+	icon = gtk_widget_render_icon (about, 
+						      GNOME_STOCK_ABOUT,
+						      GTK_ICON_SIZE_MENU,
+						      NULL);
+	gtk_window_set_icon (GTK_WINDOW (about), icon);
+	g_object_unref(icon);
+
 	g_object_add_weak_pointer (G_OBJECT (about), (gpointer *)&about);
 	gtk_widget_show (about);
 }
Index: src/bookmarks/ephy-new-bookmark.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-new-bookmark.c,v
retrieving revision 1.9
diff -u -p -r1.9 ephy-new-bookmark.c
--- src/bookmarks/ephy-new-bookmark.c	22 Mar 2003 15:15:07 -0000	1.9
+++ src/bookmarks/ephy-new-bookmark.c	24 Mar 2003 05:10:25 -0000
@@ -229,7 +229,7 @@ static void
 ephy_new_bookmark_construct (EphyNewBookmark *editor)
 {
 	gtk_window_set_title (GTK_WINDOW (editor),
-			      _("Add bookmark"));
+			      _("New Bookmark"));
 
 	gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE);
 	gtk_container_set_border_width (GTK_CONTAINER (editor), 6);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]