gtranslator r3934 - in trunk: . plugins/source-code-view



Author: jwendell
Date: Sat Feb  7 13:00:52 2009
New Revision: 3934
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3934&view=rev

Log:
2009-02-07  Jonh Wendell <jwendell gnome org>

	* plugins/source-code-view/viewer.[c,glade]: Show the source filename
	in the viewer. Closes #570371.



Modified:
   trunk/ChangeLog
   trunk/plugins/source-code-view/viewer.c
   trunk/plugins/source-code-view/viewer.glade

Modified: trunk/plugins/source-code-view/viewer.c
==============================================================================
--- trunk/plugins/source-code-view/viewer.c	(original)
+++ trunk/plugins/source-code-view/viewer.c	Sat Feb  7 13:00:52 2009
@@ -44,6 +44,7 @@
 {
 	GtkWidget *main_box;
 	GtkWidget *view;
+	GtkWidget *filename_label;
 };		    
 
 static void
@@ -95,6 +96,7 @@
 		
 		"main_box", &dlg->priv->main_box,
 		"scrolledwindow", &sw,
+		"filename_label", &dlg->priv->filename_label,
 		NULL);
 	
 	if(!ret)
@@ -429,6 +431,7 @@
 	if (dlg == NULL)
 	{
 		GtkSourceBuffer *buffer;
+		gchar *label;
 		
 		dlg = g_object_new (GTR_TYPE_VIEWER, NULL);
 
@@ -436,6 +439,11 @@
 		
 		open_file (buffer, path);
 		jump_to_line (GTK_TEXT_VIEW (dlg->priv->view), line);
+
+		label = g_strdup_printf ("<b>%s</b>", g_path_get_basename (path));
+		gtk_label_set_markup (GTK_LABEL (dlg->priv->filename_label),
+				      label);
+		g_free (label);
 		
 		g_signal_connect (dlg,
 				  "destroy",

Modified: trunk/plugins/source-code-view/viewer.glade
==============================================================================
--- trunk/plugins/source-code-view/viewer.glade	(original)
+++ trunk/plugins/source-code-view/viewer.glade	Sat Feb  7 13:00:52 2009
@@ -19,10 +19,9 @@
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <property name="spacing">6</property>
             <child>
-              <widget class="GtkLabel" id="label1">
+              <widget class="GtkLabel" id="filename_label">
                 <property name="visible">True</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Source code&lt;/b&gt;</property>
                 <property name="use_markup">True</property>
               </widget>
               <packing>



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