gtranslator r3863 - in trunk: . src
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3863 - in trunk: . src
- Date: Sun, 19 Oct 2008 19:52:13 +0000 (UTC)
Author: icq
Date: Sun Oct 19 19:52:13 2008
New Revision: 3863
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3863&view=rev
Log:
2008-10-19 Ignacio Casal Quinteiro <nacho resa gmail com>
* src/tab.c:
* src/actions-edit.c:
Now copy_to_translation is managed by GtranslatorTab.
(Fixes bug #556942).
Modified:
trunk/ChangeLog
trunk/src/actions-edit.c
trunk/src/tab.c
Modified: trunk/src/actions-edit.c
==============================================================================
--- trunk/src/actions-edit.c (original)
+++ trunk/src/actions-edit.c Sun Oct 19 19:52:13 2008
@@ -120,41 +120,11 @@
gtranslator_message_copy_to_translation(GtkAction *action,
GtranslatorWindow *window)
{
- const gchar *msgid;
GtranslatorTab *current;
- GtranslatorPo *po;
- GList *msg;
- gint page_index;
current = gtranslator_window_get_active_tab (window);
- po = gtranslator_tab_get_po (current);
- msg = gtranslator_po_get_current_message (po);
-
- msgid = gtranslator_msg_get_msgid (msg->data);
- if(msgid)
- {
- page_index = gtranslator_tab_get_active_trans_tab(current);
-
- if(page_index == 0)
- gtranslator_msg_set_msgstr(msg->data, msgid);
- else
- gtranslator_msg_set_msgstr_plural(msg->data, page_index, msgid);
- }
-
- /*
- * should we change the state of the message?
- * if we have then put the message as translated
- */
- if(gtranslator_msg_is_fuzzy(msg->data) && gtranslator_prefs_manager_get_unmark_fuzzy())
- gtranslator_msg_set_fuzzy(msg->data, FALSE);
-
- gtranslator_tab_message_go_to(current, msg, FALSE, GTR_TAB_MOVE_NONE);
-
- /*
- * Emit that message was changed.
- */
- g_signal_emit_by_name(current, "message_changed", msg->data);
+ gtranslator_tab_copy_to_translation (current);
}
/*
Modified: trunk/src/tab.c
==============================================================================
--- trunk/src/tab.c (original)
+++ trunk/src/tab.c Sun Oct 19 19:52:13 2008
@@ -1423,6 +1423,34 @@
}
/**
+ * gtranslator_tab_copy_to_translation:
+ * @tab: a #GtranslatorTab
+ *
+ * Copies the text from the original text box to the translation text box.
+ */
+void
+gtranslator_tab_copy_to_translation (GtranslatorTab *tab)
+{
+ GtkTextBuffer *msgstr, *msgid;
+ gint page_index;
+ const gchar *text;
+ GtkTextIter start, end;
+
+ g_return_if_fail (GTR_IS_TAB (tab));
+
+ page_index = gtranslator_tab_get_active_trans_tab (tab);
+
+ msgstr = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tab->priv->trans_msgstr[page_index]));
+ msgid = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tab->priv->text_msgid));
+
+ gtk_text_buffer_begin_user_action (msgstr);
+ gtk_text_buffer_get_bounds (msgid, &start, &end);
+ text = gtk_text_buffer_get_text (msgid, &start, &end, FALSE);
+ gtk_text_buffer_set_text (msgstr, text, -1);
+ gtk_text_buffer_end_user_action (msgstr);
+}
+
+/**
* gtranslator_tab_block_movement:
* @tab: a #GtranslatorTab
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]