gtranslator r3627 - in trunk/src: . dialogs
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3627 - in trunk/src: . dialogs
- Date: Mon, 22 Sep 2008 09:39:45 +0000 (UTC)
Author: icq
Date: Mon Sep 22 09:39:45 2008
New Revision: 3627
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3627&view=rev
Log:
* prefs-manager.h:
Changed GPM_HEADER define.
* po.c:
(gtranslator_po_save_msg_in_header):
Now it gets the values from the current profile if the
button take_my_options in the header dialog is activated.
* dialogs/header-dialog.c:
Checking if the button take my options is activated and if so
makes the text entries non-sensitive.
Fill the header dialog with the values in the current profile.
Modified:
trunk/src/ChangeLog
trunk/src/dialogs/header-dialog.c
trunk/src/po.c
trunk/src/prefs-manager.h
Modified: trunk/src/dialogs/header-dialog.c
==============================================================================
--- trunk/src/dialogs/header-dialog.c (original)
+++ trunk/src/dialogs/header-dialog.c Mon Sep 22 09:39:45 2008
@@ -78,7 +78,7 @@
static void
take_my_options_checkbutton_toggled(GtkToggleButton *button,
- GtranslatorHeaderDialog *dlg)
+ GtranslatorHeaderDialog *dlg)
{
g_return_if_fail(button == GTK_TOGGLE_BUTTON(dlg->priv->take_my_options));
@@ -289,6 +289,15 @@
gtk_widget_set_sensitive(dlg->priv->po_date, FALSE);
gtk_widget_set_sensitive(dlg->priv->charset, FALSE);
+ if (gtk_toggle_button_get_active(dlg->priv->take_my_options)) {
+
+ gtk_widget_set_sensitive(dlg->priv->translator, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (dlg->priv->take_my_options)));
+ gtk_widget_set_sensitive(dlg->priv->tr_email, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (dlg->priv->take_my_options)));
+ gtk_widget_set_sensitive(dlg->priv->language, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (dlg->priv->take_my_options)));
+ gtk_widget_set_sensitive(dlg->priv->lg_email, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (dlg->priv->take_my_options)));
+ gtk_widget_set_sensitive(dlg->priv->encoding, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (dlg->priv->take_my_options)));
+ }
+
/*Connect signals*/
g_signal_connect(dlg->priv->take_my_options, "toggled",
G_CALLBACK(take_my_options_checkbutton_toggled),
Modified: trunk/src/po.c
==============================================================================
--- trunk/src/po.c (original)
+++ trunk/src/po.c Mon Sep 22 09:39:45 2008
@@ -24,10 +24,13 @@
#include <config.h>
#endif
+#include "application.h"
#include "file-dialogs.h"
#include "po.h"
#include "msg.h"
#include "gtranslator-enum-types.h"
+#include "prefs-manager.h"
+#include "profile.h"
#include "utils.h"
#include <string.h>
@@ -550,6 +553,10 @@
gchar *new_date;
gchar *aux;
+ gboolean take_my_options;
+
+ take_my_options = gtranslator_prefs_manager_get_take_my_options ();
+
/*
* Get header's fields
*/
@@ -572,6 +579,26 @@
msgstr = po_message_msgstr(message);
/*
+ * If button take_my_options is pulsed, then header's values
+ * should be taking from default profile
+ */
+
+ if (take_my_options) {
+
+ GtranslatorProfile *active_profile;
+
+ active_profile = gtranslator_application_get_active_profile (GTR_APP);
+
+ gtranslator_header_set_translator (header, gtranslator_profile_get_author_name (active_profile));
+ gtranslator_header_set_tr_email (header, gtranslator_profile_get_author_email (active_profile));
+ gtranslator_header_set_language (header, gtranslator_profile_get_language_name (active_profile));
+ gtranslator_header_set_charset (header, gtranslator_profile_get_charset (active_profile));
+ gtranslator_header_set_encoding (header, gtranslator_profile_get_encoding (active_profile));
+ gtranslator_header_set_lg_email (header, gtranslator_profile_get_group_email (active_profile));
+ gtranslator_header_set_plural_forms (header, gtranslator_profile_get_plurals (active_profile));
+ }
+
+ /*
* Update the po date
*/
current_date = gtranslator_utils_get_current_date ();
Modified: trunk/src/prefs-manager.h
==============================================================================
--- trunk/src/prefs-manager.h (original)
+++ trunk/src/prefs-manager.h Mon Sep 22 09:39:45 2008
@@ -31,6 +31,8 @@
#define GPM_PREFS_DIR GTR_BASE_KEY "/preferences"
+#define GPM_HEADER GTR_BASE_KEY "/header"
+
/* Files */
#define GPM_GENERAL_DIR GPM_PREFS_DIR "/files/general"
#define GPM_WARN_IF_FUZZY GPM_GENERAL_DIR "/warn_if_fuzzy"
@@ -55,7 +57,7 @@
#define GPM_SPELLCHECK GPM_CONTENTS_DIR "/spellcheck"
/* Edit Header */
-#define GPM_TAKE_MY_OPTIONS GPM_PREFS_DIR "/take_my_options"
+#define GPM_TAKE_MY_OPTIONS GPM_HEADER "/take_my_options"
/* PO header */
#define GPM_PERSONAL_INFORMATION_DIR GPM_PREFS_DIR "/po_header/personal_information"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]