[gnome-control-center] region: Use locale aware date time formats for previewing
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Use locale aware date time formats for previewing
- Date: Thu, 25 May 2017 10:17:43 +0000 (UTC)
commit fb2989dca4b7383c06da6cb094e0a430d8b8f742
Author: Changwoo Ryu <cwryu debian org>
Date: Sun Apr 27 22:13:02 2014 +0900
region: Use locale aware date time formats for previewing
%x for date, %X for time, %c for date&time.
https://bugzilla.gnome.org/show_bug.cgi?id=687923
panels/region/cc-format-chooser.c | 15 ++++-------
panels/region/format-chooser.ui | 49 +++++++++++++++++-------------------
2 files changed, 29 insertions(+), 35 deletions(-)
---
diff --git a/panels/region/cc-format-chooser.c b/panels/region/cc-format-chooser.c
index 015ef53..4998de9 100644
--- a/panels/region/cc-format-chooser.c
+++ b/panels/region/cc-format-chooser.c
@@ -42,10 +42,9 @@ typedef struct {
GtkWidget *filter_entry;
GtkWidget *list;
GtkWidget *scrolledwindow;
- GtkWidget *full_date;
- GtkWidget *medium_date;
- GtkWidget *short_date;
+ GtkWidget *date;
GtkWidget *time;
+ GtkWidget *date_time;
GtkWidget *number;
GtkWidget *measurement;
GtkWidget *paper;
@@ -81,10 +80,9 @@ update_format_examples (GtkDialog *chooser)
setlocale (LC_TIME, priv->region);
dt = g_date_time_new_now_local ();
- display_date (priv->full_date, dt, "%A %e %B %Y");
- display_date (priv->medium_date, dt, "%e %b %Y");
- display_date (priv->short_date, dt, "%x");
+ display_date (priv->date, dt, "%x");
display_date (priv->time, dt, "%X");
+ display_date (priv->date_time, dt, "%c");
setlocale (LC_TIME, locale);
g_free (locale);
@@ -534,10 +532,9 @@ cc_format_chooser_new (GtkWidget *parent)
priv->no_results = g_object_ref_sink (no_results_widget_new ());
gtk_widget_show_all (priv->no_results);
- priv->full_date = WID ("full-date-format");
- priv->medium_date = WID ("medium-date-format");
- priv->short_date = WID ("short-date-format");
+ priv->date = WID ("date-format");
priv->time = WID ("time-format");
+ priv->date_time = WID ("date-time-format");
priv->number = WID ("number-format");
priv->measurement = WID ("measurement-format");
priv->paper = WID ("paper-format");
diff --git a/panels/region/format-chooser.ui b/panels/region/format-chooser.ui
index c500e32..363dc84 100644
--- a/panels/region/format-chooser.ui
+++ b/panels/region/format-chooser.ui
@@ -147,11 +147,11 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="full-date-format">
+ <object class="GtkLabel" id="date-format">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label">Wednesday, January 23</property>
+ <property name="label">23 January 2013</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -161,29 +161,32 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="medium-date-format">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">23 January 2013</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Times</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="short-date-format">
+ <object class="GtkLabel" id="time-format">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label">23/1/13</property>
+ <property name="label">11:31 AM</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -193,28 +196,28 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">Times</property>
+ <property name="label" translatable="yes">Dates & Times</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="time-format">
+ <object class="GtkLabel" id="date-time-format">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label">11:31 AM</property>
+ <property name="label">Sun Wed 2 11:31:00 KST 2013</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -231,7 +234,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -248,7 +251,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -265,7 +268,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -279,7 +282,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -293,7 +296,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -307,17 +310,11 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]