diary r60 - in trunk: . data po src



Author: pwithnall
Date: Sun Jul  6 13:32:11 2008
New Revision: 60
URL: http://svn.gnome.org/viewvc/diary?rev=60&view=rev

Log:
2008-07-06  Philip Withnall  <philip tecnocode co uk>

	* data/diary.ui:
	* src/interface.c: (diary_create_interface),
	(diary_interface_embolden_label):
	* src/interface.h:
	* src/main-window.c: (mw_calendar_day_selected_cb):
	* src/printing.c: (print_entry), (create_custom_widget_cb): Remove
	markup from translatable strings. (Closes: #541709)
	* src/storage-manager.c: (diary_storage_manager_connect): Fix a typo
	in an error message. (Closes: #541716)
	* po/en_GB.po: Updated British English translation.



Modified:
   trunk/ChangeLog
   trunk/data/diary.ui
   trunk/po/ChangeLog
   trunk/po/en_GB.po
   trunk/src/interface.c
   trunk/src/interface.h
   trunk/src/main-window.c
   trunk/src/printing.c
   trunk/src/storage-manager.c

Modified: trunk/data/diary.ui
==============================================================================
--- trunk/data/diary.ui	(original)
+++ trunk/data/diary.ui	Sun Jul  6 13:32:11 2008
@@ -201,9 +201,8 @@
 						<child>
 							<object class="GtkVBox" id="vbox2">
 								<child>
-									<object class="GtkLabel" id="label1">
-										<property name="label" translatable="yes">&lt;b&gt;Calendar&lt;/b&gt;</property>
-										<property name="use-markup">True</property>
+									<object class="GtkLabel" id="dry_mw_calendar_label">
+										<property name="label" translatable="yes">Calendar</property>
 									</object>
 									<packing>
 										<property name="expand">False</property>
@@ -221,9 +220,8 @@
 									</packing>
 								</child>
 								<child>
-									<object class="GtkLabel" id="label2">
-										<property name="label" translatable="yes">&lt;b&gt;Attached Links&lt;/b&gt;</property>
-										<property name="use-markup">True</property>
+									<object class="GtkLabel" id="dry_mw_attached_links_label">
+										<property name="label" translatable="yes">Attached Links</property>
 									</object>
 									<packing>
 										<property name="expand">False</property>
@@ -446,9 +444,8 @@
 					</packing>
 				</child>
 				<child>
-					<object class="GtkLabel" id="label2">
-						<property name="label" translatable="yes">&lt;b&gt;Results&lt;/b&gt;</property>
-						<property name="use-markup">True</property>
+					<object class="GtkLabel" id="dry_sd_results_label">
+						<property name="label" translatable="yes">Results</property>
 					</object>
 					<packing>
 						<property name="expand">False</property>

Modified: trunk/src/interface.c
==============================================================================
--- trunk/src/interface.c	(original)
+++ trunk/src/interface.c	Sun Jul  6 13:32:11 2008
@@ -89,11 +89,26 @@
 	diary->sd_results_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (gtk_builder_get_object (builder, "dry_sd_results_tree_view")));
 	diary_search_dialog_setup (builder);
 
+	/* Embolden some labels */
+	diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_calendar_label")));
+	diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_mw_attached_links_label")));
+	diary_interface_embolden_label (GTK_LABEL (gtk_builder_get_object (builder, "dry_sd_results_label")));
+
 	g_object_unref (builder);
 
 	return diary->main_window;
 }
 
+void
+diary_interface_embolden_label (GtkLabel *label)
+{
+	gchar *markup;
+
+	markup = g_strdup_printf ("<b>%s</b>", gtk_label_get_label (label));
+	gtk_label_set_markup_with_mnemonic (label, markup);
+	g_free (markup);
+}
+
 /**
  * diary_interface_error:
  * @message: Error message

Modified: trunk/src/interface.h
==============================================================================
--- trunk/src/interface.h	(original)
+++ trunk/src/interface.h	Sun Jul  6 13:32:11 2008
@@ -25,6 +25,7 @@
 G_BEGIN_DECLS
 
 GtkWidget *diary_create_interface (void);
+void diary_interface_embolden_label (GtkLabel *label);
 void diary_interface_error (const gchar *message, GtkWidget *parent_window);
 void diary_calendar_month_changed_cb (GtkCalendar *calendar, gpointer user_data);
 

Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c	(original)
+++ trunk/src/main-window.c	Sun Jul  6 13:32:11 2008
@@ -345,8 +345,9 @@
 	g_date_set_dmy (&calendar_date, day, month, year);
 
 	/* Translators: This is a strftime()-format string for the date displayed at the top of the main window. */
-	g_date_strftime (calendar_string, sizeof (calendar_string), _("<b>%A, %e %B %Y</b>"), &calendar_date);
+	g_date_strftime (calendar_string, sizeof (calendar_string), _("%A, %e %B %Y"), &calendar_date);
 	gtk_label_set_markup (diary->date_label, calendar_string);
+	diary_interface_embolden_label (diary->date_label);
 
 	/* Update the entry */
 	entry_text = diary_storage_manager_get_entry (diary->storage_manager, year, month, day);

Modified: trunk/src/printing.c
==============================================================================
--- trunk/src/printing.c	(original)
+++ trunk/src/printing.c	Sun Jul  6 13:32:11 2008
@@ -44,7 +44,7 @@
 static gboolean
 print_entry (GtkPrintOperation *operation, GtkPrintContext *context, DiaryPrintOperation *diary_operation)
 {
-	gchar *entry, title[100];
+	gchar *entry, title[100], *title_markup;
 	PangoLayout *title_layout = NULL, *entry_layout;
 	PangoLayoutLine *entry_line;
 	PangoRectangle logical_extents;
@@ -63,8 +63,10 @@
 		pango_layout_set_width (title_layout, gtk_print_context_get_width (context) * PANGO_SCALE);
 
 		/* Translators: This is a strftime()-format string for the date displayed above each printed entry. */
-		g_date_strftime (title, sizeof (title), _("<b>%A, %e %B %Y</b>"), diary_operation->current_date);
-		pango_layout_set_markup (title_layout, title, -1);
+		g_date_strftime (title, sizeof (title), _("%A, %e %B %Y"), diary_operation->current_date);
+		title_markup = g_strdup_printf ("<b>%s</b>", title);
+		pango_layout_set_markup (title_layout, title_markup, -1);
+		g_free (title_markup);
 
 		title_y = diary_operation->y;
 		pango_layout_get_pixel_size (title_layout, NULL, &height);
@@ -77,9 +79,9 @@
 	pango_layout_set_ellipsize (entry_layout, PANGO_ELLIPSIZE_NONE);
 
 	if (entry == NULL)
-		pango_layout_set_markup (entry_layout, _("<i>No entry for this date.</i>"), -1);
-	else
-		pango_layout_set_text (entry_layout, entry, -1);
+		entry = g_strdup_printf ("<i>%s</i>", _("No entry for this date."));
+
+	pango_layout_set_text (entry_layout, entry, -1);
 
 	/* Check we're not orphaning things */
 	entry_line = pango_layout_get_line_readonly (entry_layout, MIN (pango_layout_get_line_count (entry_layout), diary_operation->current_line + MAX_ORPHANS) - 1);
@@ -198,7 +200,8 @@
 static GtkWidget *
 create_custom_widget_cb (GtkPrintOperation *operation, DiaryPrintOperation *diary_operation)
 {
-	GtkWidget *start_calendar, *end_calendar, *start_label, *end_label;
+	GtkWidget *start_calendar, *end_calendar;
+	GtkLabel *start_label, *end_label;
 	GtkTable *table;
 
 	start_calendar = gtk_calendar_new ();
@@ -206,16 +209,18 @@
 	end_calendar = gtk_calendar_new ();
 	g_signal_connect (end_calendar, "month-changed", G_CALLBACK (diary_calendar_month_changed_cb), NULL);
 
-	start_label = gtk_label_new (NULL);
-	gtk_label_set_markup (GTK_LABEL (start_label), _("<b>Start Date</b>"));
-	end_label = gtk_label_new (NULL);
-	gtk_label_set_markup (GTK_LABEL (end_label), _("<b>End Date</b>"));
+	start_label = GTK_LABEL (gtk_label_new (NULL));
+	gtk_label_set_markup (start_label, _("Start Date"));
+	diary_interface_embolden_label (start_label);
+	end_label = GTK_LABEL (gtk_label_new (NULL));
+	gtk_label_set_markup (end_label, _("End Date"));
+	diary_interface_embolden_label (end_label);
 
 	table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
 	gtk_table_attach (table, start_calendar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5);
 	gtk_table_attach (table, end_calendar, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 5);
-	gtk_table_attach (table, start_label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
-	gtk_table_attach (table, end_label, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
+	gtk_table_attach (table, GTK_WIDGET (start_label), 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
+	gtk_table_attach (table, GTK_WIDGET (end_label), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 5, 5);
 
 	diary_operation->start_calendar = GTK_CALENDAR (start_calendar);
 	diary_operation->end_calendar = GTK_CALENDAR (end_calendar);

Modified: trunk/src/storage-manager.c
==============================================================================
--- trunk/src/storage-manager.c	(original)
+++ trunk/src/storage-manager.c	Sun Jul  6 13:32:11 2008
@@ -422,7 +422,7 @@
 		/* If both files exist, throw an error. We can't be sure which is the corrupt one,
 		 * and attempting to go any further may jeopardise the good one. */
 		if (g_file_test (self->priv->plain_filename, G_FILE_TEST_IS_REGULAR) == TRUE) {
-			gchar *error_message = g_strdup_printf (_("Both an encrypted and plaintext version of the database exist as \"%s\" and \"%s\", and one is likely corrupt. Please delete the corrupt one (i.e. one which is 0KiB in size) before continuing. If neither file is 0Kib, the problem will most likely have been caused by Diary being unable to encrypt the database, so you should move the first file."),
+			gchar *error_message = g_strdup_printf (_("Both an encrypted and plaintext version of the database exist as \"%s\" and \"%s\", and one is likely corrupt. Please delete the corrupt one (i.e. one which is 0KiB in size) before continuing. If neither file is 0KiB, the problem will most likely have been caused by Diary being unable to encrypt the database, so you should move the first file."),
 							self->priv->filename, 
 							self->priv->plain_filename);
 			diary_interface_error (error_message, diary->main_window);



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