Merge lp:~mterry/indicator-datetime/bevel+utc into lp:indicator-datetime/0.3

Proposed by Michael Terry on 2011-03-24
Status: Merged
Merged at revision: 85
Proposed branch: lp:~mterry/indicator-datetime/bevel+utc
Merge into: lp:indicator-datetime/0.3
Prerequisite: lp:~mterry/indicator-datetime/sort-names-and-cleanup
Diff against target: 198 lines (+58/-14)
4 files modified
data/datetime-dialog.ui (+17/-8)
libmap/cc-timezone-map.c (+13/-3)
src/datetime-prefs-locations.c (+4/-2)
src/timezone-completion.c (+24/-1)
To merge this branch: bzr merge lp:~mterry/indicator-datetime/bevel+utc
Reviewer Review Type Date Requested Status
Indicator Applet Developers 2011-03-24 Pending
Review via email: mp+54684@code.launchpad.net

Description of the change

Add a bevel and add UTC to completion results.

To post a comment you must log in.
84. By Michael Terry on 2011-03-24

drop debugging line and update times when user selects a zone

85. By Michael Terry on 2011-03-24

make map look insensitive if it is

86. By Michael Terry on 2011-03-29

use background color for insensitive map

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/datetime-dialog.ui'
2--- data/datetime-dialog.ui 2011-03-23 12:20:47 +0000
3+++ data/datetime-dialog.ui 2011-03-29 16:16:13 +0000
4@@ -7,11 +7,6 @@
5 <property name="step_increment">86400</property>
6 <property name="page_increment">864000</property>
7 </object>
8- <object class="GtkAdjustment" id="timeAdjustment">
9- <property name="upper">1.8446744073709552e+19</property>
10- <property name="step_increment">60</property>
11- <property name="page_increment">3600</property>
12- </object>
13 <object class="GtkWindow" id="locationsDialog">
14 <property name="can_focus">False</property>
15 <property name="title" translatable="yes">Locations</property>
16@@ -47,6 +42,17 @@
17 </packing>
18 </child>
19 <child>
20+ <object class="GtkHSeparator" id="hseparator1">
21+ <property name="visible">True</property>
22+ <property name="can_focus">False</property>
23+ </object>
24+ <packing>
25+ <property name="expand">False</property>
26+ <property name="fill">True</property>
27+ <property name="position">1</property>
28+ </packing>
29+ </child>
30+ <child>
31 <object class="GtkHBox" id="hbox10">
32 <property name="visible">True</property>
33 <property name="can_focus">False</property>
34@@ -55,7 +61,6 @@
35 <property name="visible">True</property>
36 <property name="can_focus">True</property>
37 <property name="receives_default">True</property>
38- <property name="tooltip_text" translatable="yes">Add a Location…</property>
39 <property name="use_action_appearance">False</property>
40 <child>
41 <object class="GtkImage" id="addImage">
42@@ -76,7 +81,6 @@
43 <property name="visible">True</property>
44 <property name="can_focus">True</property>
45 <property name="receives_default">True</property>
46- <property name="tooltip_text" translatable="yes">Remove This Location</property>
47 <property name="use_action_appearance">False</property>
48 <child>
49 <object class="GtkImage" id="removeImage">
50@@ -96,7 +100,7 @@
51 <packing>
52 <property name="expand">False</property>
53 <property name="fill">True</property>
54- <property name="position">1</property>
55+ <property name="position">2</property>
56 </packing>
57 </child>
58 </object>
59@@ -112,6 +116,11 @@
60 <column type="gchararray"/>
61 </columns>
62 </object>
63+ <object class="GtkAdjustment" id="timeAdjustment">
64+ <property name="upper">1.8446744073709552e+19</property>
65+ <property name="step_increment">60</property>
66+ <property name="page_increment">3600</property>
67+ </object>
68 <object class="GtkWindow" id="timeDateDialog">
69 <property name="can_focus">False</property>
70 <property name="border_width">5</property>
71
72=== modified file 'libmap/cc-timezone-map.c'
73--- libmap/cc-timezone-map.c 2011-02-23 21:31:18 +0000
74+++ libmap/cc-timezone-map.c 2011-03-29 16:16:13 +0000
75@@ -766,13 +766,23 @@
76 gchar *file;
77 GError *err = NULL;
78 gdouble pointx, pointy;
79+ gdouble alpha = 1.0;
80+ GtkStyle *style;
81 char buf[16];
82
83 gtk_widget_get_allocation (widget, &alloc);
84
85+ style = gtk_widget_get_style (widget);
86+
87+ /* Check if insensitive */
88+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
89+ alpha = 0.5;
90+
91 /* paint background */
92+ gdk_cairo_set_source_color (cr, &style->bg[gtk_widget_get_state (widget)]);
93+ cairo_paint (cr);
94 gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);
95- cairo_paint (cr);
96+ cairo_paint_with_alpha (cr, alpha);
97
98 /* paint watermark */
99 if (priv->watermark) {
100@@ -813,7 +823,7 @@
101 alloc.height, GDK_INTERP_BILINEAR);
102 gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);
103
104- cairo_paint (cr);
105+ cairo_paint_with_alpha (cr, alpha);
106 g_object_unref (hilight);
107 g_object_unref (orig_hilight);
108 }
109@@ -836,7 +846,7 @@
110 if (pin)
111 {
112 gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14);
113- cairo_paint (cr);
114+ cairo_paint_with_alpha (cr, alpha);
115 g_object_unref (pin);
116 }
117
118
119=== modified file 'src/datetime-prefs-locations.c'
120--- src/datetime-prefs-locations.c 2011-03-23 20:24:28 +0000
121+++ src/datetime-prefs-locations.c 2011-03-29 16:16:13 +0000
122@@ -39,6 +39,8 @@
123 #define COL_TIME 1
124 #define COL_ZONE 2
125
126+static gboolean update_times (TimezoneCompletion * completion);
127+
128 static void
129 handle_add (GtkWidget * button, GtkTreeView * tree)
130 {
131@@ -103,8 +105,6 @@
132 TIMEZONE_COMPLETION_NAME, &name,
133 -1);
134
135- g_debug("match selected: %s, %s", name, zone);
136-
137 if (zone == NULL || zone[0] == 0) {
138 const gchar * strlon, * strlat;
139 gdouble lon = 0.0, lat = 0.0;
140@@ -132,6 +132,8 @@
141 gtk_list_store_set (store, store_iter, COL_NAME, name, COL_ZONE, zone, -1);
142 }
143
144+ update_times (TIMEZONE_COMPLETION (widget));
145+
146 return FALSE; // Do normal action too
147 }
148
149
150=== modified file 'src/timezone-completion.c'
151--- src/timezone-completion.c 2011-03-29 16:01:21 +0000
152+++ src/timezone-completion.c 2011-03-29 16:16:13 +0000
153@@ -230,6 +230,20 @@
154 json_reader_end_element (reader);
155 }
156
157+ if (strlen (priv->request_text) < 4) {
158+ gchar * lower_text = g_ascii_strdown (priv->request_text, -1);
159+ if (g_strcmp0 (lower_text, "ut") == 0 ||
160+ g_strcmp0 (lower_text, "utc") == 0) {
161+ GtkTreeIter iter;
162+ gtk_list_store_append (store, &iter);
163+ gtk_list_store_set (store, &iter,
164+ TIMEZONE_COMPLETION_ZONE, "UTC",
165+ TIMEZONE_COMPLETION_NAME, "UTC",
166+ -1);
167+ }
168+ g_free (lower_text);
169+ }
170+
171 save_and_use_model (completion, GTK_TREE_MODEL (store));
172 g_object_unref (G_OBJECT (reader));
173 }
174@@ -374,6 +388,13 @@
175 g_free (name);
176 }
177
178+ GtkTreeIter iter;
179+ gtk_list_store_append (store, &iter);
180+ gtk_list_store_set (store, &iter,
181+ TIMEZONE_COMPLETION_ZONE, "UTC",
182+ TIMEZONE_COMPLETION_NAME, "UTC",
183+ -1);
184+
185 tz_db_free (db);
186 return store;
187 }
188@@ -391,7 +412,9 @@
189 -1);
190
191 gchar * user_name;
192- if (admin1 == NULL || admin1[0] == 0) {
193+ if (country == NULL || country[0] == 0) {
194+ user_name = g_strdup (name);
195+ } else if (admin1 == NULL || admin1[0] == 0) {
196 user_name = g_strdup_printf ("%s <small>(%s)</small>", name, country);
197 } else {
198 user_name = g_strdup_printf ("%s <small>(%s, %s)</small>", name, admin1, country);

Subscribers

People subscribed via source and target branches