[evolution-patches] [gal] #61936 Define views does not save changes and has focus problems



the tricky part is the gdk window hint change. if you try to make normal window transient for dialog window as we did, it doesn't work.
Index: e-table/ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/ChangeLog,v
retrieving revision 1.937
diff -u -p -r1.937 ChangeLog
--- e-table/ChangeLog	13 Jul 2004 10:31:22 -0000	1.937
+++ e-table/ChangeLog	2 Aug 2004 15:41:45 -0000
@@ -1,3 +1,16 @@
+2004-08-02  Radek Doulik  <rodo ximian com>
+
+	* e-table-config.c (e_table_config_construct): do not set
+	position, it's already done in .glade, call set_transient_for
+	always (passing NULL is valid as well)
+
+	* e-table-config.glade: * e-table-config-no-group.glade: center
+	window on parent, don't let it resize and most importan make it
+	dialog window so that set_transient_for works against define views
+	dialog
+
+	Fixes #61936
+
 2004-07-07  Radek Doulik  <rodo ximian com>
 
 	* e-table-sorted-variable.c (etsv_add): added
Index: e-table/e-table-config-no-group.glade
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-table-config-no-group.glade,v
retrieving revision 1.7
diff -u -p -r1.7 e-table-config-no-group.glade
--- e-table/e-table-config-no-group.glade	11 Jun 2004 15:51:44 -0000	1.7
+++ e-table/e-table-config-no-group.glade	2 Aug 2004 15:41:45 -0000
@@ -1855,14 +1855,14 @@
 <widget class="GtkDialog" id="e-table-config">
   <property name="title" translatable="yes">dialog1</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
   <property name="modal">True</property>
-  <property name="resizable">True</property>
+  <property name="resizable">False</property>
   <property name="destroy_with_parent">False</property>
   <property name="decorated">True</property>
   <property name="skip_taskbar_hint">False</property>
   <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
   <property name="has_separator">True</property>
 
Index: e-table/e-table-config.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-table-config.c,v
retrieving revision 1.65
diff -u -p -r1.65 e-table-config.c
--- e-table/e-table-config.c	22 Jun 2004 21:25:59 -0000	1.65
+++ e-table/e-table-config.c	2 Aug 2004 15:41:46 -0000
@@ -1156,16 +1156,8 @@ e_table_config_construct (ETableConfig  
 
 	setup_gui (config);
 
-	if (parent_window) {
-		gtk_window_set_transient_for (GTK_WINDOW (config->dialog_toplevel),
-					      parent_window);
-		/*
-		  center on parent doesn't seem to work for me, so let use GTK_WIN_POS_CENTER_ALWAYS - that is
-		  what glade used before as well, so it's not worse then it was
-		  gtk_window_set_position (GTK_WINDOW (config->dialog_toplevel), GTK_WIN_POS_CENTER_ON_PARENT);
-		*/
-		gtk_window_set_position (GTK_WINDOW (config->dialog_toplevel), GTK_WIN_POS_CENTER_ALWAYS);
-	}
+	gtk_window_set_transient_for (GTK_WINDOW (config->dialog_toplevel),
+				      parent_window);
 
 	config_sort_info_update   (config);
 	config_group_info_update  (config);
Index: e-table/e-table-config.glade
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-table-config.glade,v
retrieving revision 1.23
diff -u -p -r1.23 e-table-config.glade
--- e-table/e-table-config.glade	11 Jun 2004 15:51:44 -0000	1.23
+++ e-table/e-table-config.glade	2 Aug 2004 15:41:46 -0000
@@ -1855,14 +1855,14 @@
 <widget class="GtkDialog" id="e-table-config">
   <property name="title" translatable="yes">dialog1</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
   <property name="modal">True</property>
-  <property name="resizable">True</property>
+  <property name="resizable">False</property>
   <property name="destroy_with_parent">False</property>
   <property name="decorated">True</property>
   <property name="skip_taskbar_hint">False</property>
   <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
   <property name="has_separator">True</property>
 
Index: menus/ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/gal/menus/ChangeLog,v
retrieving revision 1.75
diff -u -p -r1.75 ChangeLog
--- menus/ChangeLog	23 Jul 2004 16:58:02 -0000	1.75
+++ menus/ChangeLog	2 Aug 2004 15:41:46 -0000
@@ -1,3 +1,9 @@
+2004-08-02  Radek Doulik  <rodo ximian com>
+
+	* gal-define-views-dialog.c: save collection on exit
+
+	Fixes #61936
+
 2004-07-23  Radek Doulik  <rodo ximian com>
 
 	* gal-define-views-dialog.c: watch for selection changes and set
Index: menus/gal-define-views-dialog.c
===================================================================
RCS file: /cvs/gnome/gal/gal/menus/gal-define-views-dialog.c,v
retrieving revision 1.28
diff -u -p -r1.28 gal-define-views-dialog.c
--- menus/gal-define-views-dialog.c	23 Jul 2004 16:58:02 -0000	1.28
+++ menus/gal-define-views-dialog.c	2 Aug 2004 15:41:46 -0000
@@ -154,7 +154,6 @@ gdvd_button_modify_callback(GtkWidget *w
 						       row);
 		gal_view_edit(view, GTK_WINDOW (dialog));
 	}
-
 }
 
 static void
@@ -225,6 +224,12 @@ etable_selection_change (ETable *etable,
 }
 
 static void
+dialog_response (GalDefineViewsDialog *dialog, int response_id, gpointer data)
+{
+	gal_view_collection_save (dialog->collection);
+}	
+
+static void
 gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
 {
 	GladeXML *gui;
@@ -272,6 +277,9 @@ gal_define_views_dialog_init (GalDefineV
 	}
 
 	gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
+
+	g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL);
+
 }
 
 static void


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