gtranslator r3909 - in trunk: . data src/dialogs



Author: psanxiao
Date: Sat Jan  3 17:28:52 2009
New Revision: 3909
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3909&view=rev

Log:
	* data/gtranslator.schemas.in:
	Changed default value of use_profiles_values
	to FALSE.
	* src/dialogs/header-dialog.c:
	Now if there is not any profile defined,
	the toggled button taky_my_options is made
	unsensitive. (Fixes bug #565684).

Modified:
   trunk/ChangeLog
   trunk/data/gtranslator.schemas.in
   trunk/src/dialogs/header-dialog.c

Modified: trunk/data/gtranslator.schemas.in
==============================================================================
--- trunk/data/gtranslator.schemas.in	(original)
+++ trunk/data/gtranslator.schemas.in	Sat Jan  3 17:28:52 2009
@@ -65,7 +65,7 @@
       <applyto>/apps/gtranslator/preferences/files/use_profile_values</applyto>
       <owner>gtranslator</owner>
       <type>bool</type>
-      <default>TRUE</default>
+      <default>FALSE</default>
       <locale name="C">
 	<short>Use profile values for header</short>
 	<long>If true, overwrite the values in the PO header with those in the active profile.</long>

Modified: trunk/src/dialogs/header-dialog.c
==============================================================================
--- trunk/src/dialogs/header-dialog.c	(original)
+++ trunk/src/dialogs/header-dialog.c	Sat Jan  3 17:28:52 2009
@@ -26,6 +26,7 @@
 #include <gtk/gtk.h>
 #include <string.h>
 
+#include "application.h"
 #include "header-dialog.h"
 #include "utils.h"
 #include "prefs-manager.h"
@@ -80,15 +81,17 @@
 take_my_options_checkbutton_toggled(GtkToggleButton *button,
 				    GtranslatorHeaderDialog *dlg)
 {
-	g_return_if_fail(button == GTK_TOGGLE_BUTTON(dlg->priv->take_my_options));
-	
-	gtranslator_prefs_manager_set_use_profile_values(gtk_toggle_button_get_active(button));
-	
-	gtk_widget_set_sensitive(dlg->priv->translator, !gtk_toggle_button_get_active(button));
-	gtk_widget_set_sensitive(dlg->priv->tr_email, !gtk_toggle_button_get_active(button));
-	gtk_widget_set_sensitive(dlg->priv->language, !gtk_toggle_button_get_active(button));
-	gtk_widget_set_sensitive(dlg->priv->lg_email, !gtk_toggle_button_get_active(button));
-	gtk_widget_set_sensitive(dlg->priv->encoding, !gtk_toggle_button_get_active(button));
+  g_return_if_fail(button == GTK_TOGGLE_BUTTON(dlg->priv->take_my_options));
+
+  
+  gtranslator_prefs_manager_set_use_profile_values(gtk_toggle_button_get_active(button));
+  
+  gtk_widget_set_sensitive(dlg->priv->translator, !gtk_toggle_button_get_active(button));
+  gtk_widget_set_sensitive(dlg->priv->tr_email, !gtk_toggle_button_get_active(button));
+  gtk_widget_set_sensitive(dlg->priv->language, !gtk_toggle_button_get_active(button));
+  gtk_widget_set_sensitive(dlg->priv->lg_email, !gtk_toggle_button_get_active(button));
+  gtk_widget_set_sensitive(dlg->priv->encoding, !gtk_toggle_button_get_active(button));
+  
 }
 
 static void
@@ -298,9 +301,15 @@
 	
 	gtk_container_set_border_width (GTK_CONTAINER (dlg->priv->notebook), 5);
 	
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dlg->priv->take_my_options),
+	if (gtranslator_application_get_profiles (GTR_APP) == NULL)
+	  {
+	    gtk_widget_set_sensitive (dlg->priv->take_my_options, FALSE);
+	  }
+	else
+	  {
+	    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dlg->priv->take_my_options),
 				     gtranslator_prefs_manager_get_use_profile_values());
-
+	  }
 	gtk_text_view_set_editable (GTK_TEXT_VIEW (dlg->priv->prj_comment), TRUE);
 
 	gtk_widget_set_sensitive(dlg->priv->pot_date, FALSE);



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