Merge lp:~charlesk/indicator-datetime/lp-465689 into lp:indicator-datetime/14.04

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 300
Merged at revision: 282
Proposed branch: lp:~charlesk/indicator-datetime/lp-465689
Merge into: lp:indicator-datetime/14.04
Prerequisite: lp:~charlesk/indicator-datetime/cmakeify
Diff against target: 228 lines (+82/-15)
7 files modified
data/com.canonical.indicator.datetime.gschema.xml (+9/-0)
data/datetime-dialog.ui (+42/-3)
panel/datetime-prefs.c (+4/-1)
src/service.c (+3/-1)
src/settings-shared.h (+1/-0)
src/utils.c (+22/-10)
src/utils.h (+1/-0)
To merge this branch: bzr merge lp:~charlesk/indicator-datetime/lp-465689
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+193345@code.launchpad.net

Description of the change

As per the spec, let users show the year in indicator-datetime.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
300. By Charles Kerr

remove a debug tracer that accidentally got committed

Revision history for this message
Ted Gould (ted) wrote :

Land this quickly before someone converts this indicator to CMake!!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.indicator.datetime.gschema.xml'
--- data/com.canonical.indicator.datetime.gschema.xml 2012-07-13 15:52:55 +0000
+++ data/com.canonical.indicator.datetime.gschema.xml 2013-10-30 23:11:14 +0000
@@ -64,6 +64,15 @@
64 time-format value is set to custom.64 time-format value is set to custom.
65 </description>65 </description>
66 </key>66 </key>
67 <key name="show-year" type="b">
68 <default>false</default>
69 <summary>Show the year in the indicator</summary>
70 <description>
71 Puts the year in the panel along with the month and the date.
72 This setting will be ignored if either the time-format value is set to custom
73 or if show-date is set to false.
74 </description>
75 </key>
67 <key name="show-calendar" type="b">76 <key name="show-calendar" type="b">
68 <default>true</default>77 <default>true</default>
69 <summary>Show the monthly calendar in the indicator</summary>78 <summary>Show the monthly calendar in the indicator</summary>
7079
=== modified file 'data/datetime-dialog.ui'
--- data/datetime-dialog.ui 2013-03-01 22:44:38 +0000
+++ data/datetime-dialog.ui 2013-10-30 23:11:14 +0000
@@ -529,7 +529,7 @@
529 </packing>529 </packing>
530 </child>530 </child>
531 <child>531 <child>
532 <object class="GtkCheckButton" id="showDateTimeCheck">532 <object class="GtkCheckButton" id="showDateAndMonthCheck">
533 <property name="label" translatable="yes">_Date and month</property>533 <property name="label" translatable="yes">_Date and month</property>
534 <property name="visible">True</property>534 <property name="visible">True</property>
535 <property name="can_focus">True</property>535 <property name="can_focus">True</property>
@@ -546,6 +546,45 @@
546 </packing>546 </packing>
547 </child>547 </child>
548 <child>548 <child>
549 <object class="GtkAlignment" id="showYearAlignment">
550 <property name="visible">True</property>
551 <property name="can_focus">False</property>
552 <property name="xalign">0</property>
553 <property name="yalign">0</property>
554 <property name="yscale">0</property>
555 <property name="left_padding">24</property>
556 <child>
557 <object class="GtkVBox" id="showYearVbox">
558 <property name="visible">True</property>
559 <property name="can_focus">False</property>
560 <property name="spacing">6</property>
561 <child>
562 <object class="GtkCheckButton" id="showYearCheck">
563 <property name="label" translatable="yes">_Year</property>
564 <property name="visible">True</property>
565 <property name="can_focus">True</property>
566 <property name="receives_default">False</property>
567 <property name="use_action_appearance">False</property>
568 <property name="use_underline">True</property>
569 <property name="xalign">0</property>
570 <property name="draw_indicator">True</property>
571 </object>
572 <packing>
573 <property name="expand">True</property>
574 <property name="fill">True</property>
575 <property name="position">0</property>
576 </packing>
577 </child>
578 </object>
579 </child>
580 </object>
581 <packing>
582 <property name="expand">False</property>
583 <property name="fill">True</property>
584 <property name="position">3</property>
585 </packing>
586 </child>
587 <child>
549 <object class="GtkVBox" id="vbox5">588 <object class="GtkVBox" id="vbox5">
550 <property name="visible">True</property>589 <property name="visible">True</property>
551 <property name="can_focus">False</property>590 <property name="can_focus">False</property>
@@ -589,7 +628,7 @@
589 <packing>628 <packing>
590 <property name="expand">False</property>629 <property name="expand">False</property>
591 <property name="fill">True</property>630 <property name="fill">True</property>
592 <property name="position">3</property>631 <property name="position">4</property>
593 </packing>632 </packing>
594 </child>633 </child>
595 <child>634 <child>
@@ -606,7 +645,7 @@
606 <packing>645 <packing>
607 <property name="expand">False</property>646 <property name="expand">False</property>
608 <property name="fill">True</property>647 <property name="fill">True</property>
609 <property name="position">4</property>648 <property name="position">5</property>
610 </packing>649 </packing>
611 </child>650 </child>
612 </object>651 </object>
613652
=== modified file 'panel/datetime-prefs.c'
--- panel/datetime-prefs.c 2013-10-30 23:11:14 +0000
+++ panel/datetime-prefs.c 2013-10-30 23:11:14 +0000
@@ -699,7 +699,9 @@
699 "active", G_SETTINGS_BIND_DEFAULT);699 "active", G_SETTINGS_BIND_DEFAULT);
700 g_settings_bind (conf, SETTINGS_SHOW_DAY_S, WIG ("showWeekdayCheck"),700 g_settings_bind (conf, SETTINGS_SHOW_DAY_S, WIG ("showWeekdayCheck"),
701 "active", G_SETTINGS_BIND_DEFAULT);701 "active", G_SETTINGS_BIND_DEFAULT);
702 g_settings_bind (conf, SETTINGS_SHOW_DATE_S, WIG ("showDateTimeCheck"),702 g_settings_bind (conf, SETTINGS_SHOW_DATE_S, WIG ("showDateAndMonthCheck"),
703 "active", G_SETTINGS_BIND_DEFAULT);
704 g_settings_bind (conf, SETTINGS_SHOW_YEAR_S, WIG ("showYearCheck"),
703 "active", G_SETTINGS_BIND_DEFAULT);705 "active", G_SETTINGS_BIND_DEFAULT);
704 g_settings_bind (conf, SETTINGS_SHOW_SECONDS_S, WIG ("showSecondsCheck"),706 g_settings_bind (conf, SETTINGS_SHOW_SECONDS_S, WIG ("showSecondsCheck"),
705 "active", G_SETTINGS_BIND_DEFAULT);707 "active", G_SETTINGS_BIND_DEFAULT);
@@ -725,6 +727,7 @@
725 "active", G_SETTINGS_BIND_DEFAULT);727 "active", G_SETTINGS_BIND_DEFAULT);
726728
727 /* Set up sensitivities */729 /* Set up sensitivities */
730 add_widget_dependency (WIG ("showDateAndMonthCheck"), WIG ("showYearCheck"));
728 add_widget_dependency (WIG ("showCalendarCheck"), WIG ("calendarOptions"));731 add_widget_dependency (WIG ("showCalendarCheck"), WIG ("calendarOptions"));
729 add_widget_dependency (WIG ("showClockCheck"), WIG ("clockOptions"));732 add_widget_dependency (WIG ("showClockCheck"), WIG ("clockOptions"));
730 add_widget_dependency (WIG ("showLocationsCheck"), WIG ("locationsButton"));733 add_widget_dependency (WIG ("showLocationsCheck"), WIG ("locationsButton"));
731734
=== modified file 'src/service.c'
--- src/service.c 2013-10-30 23:11:14 +0000
+++ src/service.c 2013-10-30 23:11:14 +0000
@@ -666,7 +666,8 @@
666 {666 {
667 gboolean show_day = g_settings_get_boolean (s, SETTINGS_SHOW_DAY_S);667 gboolean show_day = g_settings_get_boolean (s, SETTINGS_SHOW_DAY_S);
668 gboolean show_date = g_settings_get_boolean (s, SETTINGS_SHOW_DATE_S);668 gboolean show_date = g_settings_get_boolean (s, SETTINGS_SHOW_DATE_S);
669 fmt = generate_full_format_string (show_day, show_date, s);669 gboolean show_year = show_date && g_settings_get_boolean (s, SETTINGS_SHOW_YEAR_S);
670 fmt = generate_full_format_string (show_day, show_date, show_year, s);
670 }671 }
671672
672 p->header_label_format_string = fmt;673 p->header_label_format_string = fmt;
@@ -2182,6 +2183,7 @@
2182 SETTINGS_SHOW_SECONDS_S,2183 SETTINGS_SHOW_SECONDS_S,
2183 SETTINGS_SHOW_DAY_S,2184 SETTINGS_SHOW_DAY_S,
2184 SETTINGS_SHOW_DATE_S,2185 SETTINGS_SHOW_DATE_S,
2186 SETTINGS_SHOW_YEAR_S,
2185 SETTINGS_CUSTOM_TIME_FORMAT_S2187 SETTINGS_CUSTOM_TIME_FORMAT_S
2186 };2188 };
2187 const char * const calendar_settings[] = {2189 const char * const calendar_settings[] = {
21882190
=== modified file 'src/settings-shared.h'
--- src/settings-shared.h 2013-09-07 12:07:51 +0000
+++ src/settings-shared.h 2013-10-30 23:11:14 +0000
@@ -37,6 +37,7 @@
37#define SETTINGS_SHOW_SECONDS_S "show-seconds"37#define SETTINGS_SHOW_SECONDS_S "show-seconds"
38#define SETTINGS_SHOW_DAY_S "show-day"38#define SETTINGS_SHOW_DAY_S "show-day"
39#define SETTINGS_SHOW_DATE_S "show-date"39#define SETTINGS_SHOW_DATE_S "show-date"
40#define SETTINGS_SHOW_YEAR_S "show-year"
40#define SETTINGS_CUSTOM_TIME_FORMAT_S "custom-time-format"41#define SETTINGS_CUSTOM_TIME_FORMAT_S "custom-time-format"
41#define SETTINGS_SHOW_CALENDAR_S "show-calendar"42#define SETTINGS_SHOW_CALENDAR_S "show-calendar"
42#define SETTINGS_SHOW_WEEK_NUMBERS_S "show-week-numbers"43#define SETTINGS_SHOW_WEEK_NUMBERS_S "show-week-numbers"
4344
=== modified file 'src/utils.c'
--- src/utils.c 2013-10-30 23:11:14 +0000
+++ src/utils.c 2013-10-30 23:11:14 +0000
@@ -329,19 +329,31 @@
329***/329***/
330330
331static const gchar *331static const gchar *
332get_full_date_format_string (gboolean show_day, gboolean show_date)332get_full_date_format_string (gboolean show_day, gboolean show_date, gboolean show_year)
333{333{
334 const gchar * fmt;334 const char * fmt;
335335
336 if (show_date && show_day)336 if (show_day && show_date && show_year)
337 /* TRANSLATORS: a strftime(3) format showing the date and weekday */337 /* TRANSLATORS: a strftime(3) format showing the weekday, date, and year */
338 fmt = T_("%a %b %e %Y");
339 else if (show_day && show_date)
340 /* TRANSLATORS: a strftime(3) format showing the weekday and date */
338 fmt = T_("%a %b %e");341 fmt = T_("%a %b %e");
342 else if (show_day && show_year)
343 /* TRANSLATORS: a strftime(3) format showing the weekday and year. */
344 fmt = T_("%a %Y");
345 else if (show_day)
346 /* TRANSLATORS: a strftime(3) format showing the weekday. */
347 fmt = T_("%a");
348 else if (show_date && show_year)
349 /* TRANSLATORS: a strftime(3) format showing the date and year */
350 fmt = T_("%b %e %Y");
339 else if (show_date)351 else if (show_date)
340 /* TRANSLATORS: a strftime(3) format showing the date */352 /* TRANSLATORS: a strftime(3) format showing the date */
341 fmt = T_("%b %e");353 fmt = T_("%b %e");
342 else if (show_day)354 else if (show_year)
343 /* TRANSLATORS: a strftime(3) format showing the weekday */355 /* TRANSLATORS: a strftime(3) format showing the year */
344 fmt = T_("%a");356 fmt = T_("%Y");
345 else357 else
346 fmt = NULL;358 fmt = NULL;
347359
@@ -400,9 +412,9 @@
400}412}
401413
402gchar *414gchar *
403generate_full_format_string (gboolean show_day, gboolean show_date, GSettings * settings)415generate_full_format_string (gboolean show_day, gboolean show_date, gboolean show_year, GSettings * settings)
404{416{
405 const gchar * date_fmt = get_full_date_format_string (show_day, show_date);417 const gchar * date_fmt = get_full_date_format_string (show_day, show_date, show_year);
406 const gchar * time_fmt = get_full_time_format_string (settings);418 const gchar * time_fmt = get_full_time_format_string (settings);
407 return join_date_and_time_format_strings (date_fmt, time_fmt);419 return join_date_and_time_format_strings (date_fmt, time_fmt);
408}420}
@@ -436,6 +448,6 @@
436 break;448 break;
437 }449 }
438450
439 return generate_full_format_string (show_day, show_date, settings);451 return generate_full_format_string (show_day, show_date, FALSE, settings);
440}452}
441453
442454
=== modified file 'src/utils.h'
--- src/utils.h 2013-10-03 21:16:24 +0000
+++ src/utils.h 2013-10-30 23:11:14 +0000
@@ -54,6 +54,7 @@
5454
55gchar * generate_full_format_string (gboolean show_day,55gchar * generate_full_format_string (gboolean show_day,
56 gboolean show_date,56 gboolean show_date,
57 gboolean show_year,
57 GSettings * settings);58 GSettings * settings);
5859
59gchar * generate_full_format_string_at_time (GDateTime * now,60gchar * generate_full_format_string_at_time (GDateTime * now,

Subscribers

People subscribed via source and target branches