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

Proposed by Michael Terry
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 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

drop debugging line and update times when user selects a zone

85. By Michael Terry

make map look insensitive if it is

86. By Michael Terry

use background color for insensitive map

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/datetime-dialog.ui'
--- data/datetime-dialog.ui 2011-03-23 12:20:47 +0000
+++ data/datetime-dialog.ui 2011-03-29 16:16:13 +0000
@@ -7,11 +7,6 @@
7 <property name="step_increment">86400</property>7 <property name="step_increment">86400</property>
8 <property name="page_increment">864000</property>8 <property name="page_increment">864000</property>
9 </object>9 </object>
10 <object class="GtkAdjustment" id="timeAdjustment">
11 <property name="upper">1.8446744073709552e+19</property>
12 <property name="step_increment">60</property>
13 <property name="page_increment">3600</property>
14 </object>
15 <object class="GtkWindow" id="locationsDialog">10 <object class="GtkWindow" id="locationsDialog">
16 <property name="can_focus">False</property>11 <property name="can_focus">False</property>
17 <property name="title" translatable="yes">Locations</property>12 <property name="title" translatable="yes">Locations</property>
@@ -47,6 +42,17 @@
47 </packing>42 </packing>
48 </child>43 </child>
49 <child>44 <child>
45 <object class="GtkHSeparator" id="hseparator1">
46 <property name="visible">True</property>
47 <property name="can_focus">False</property>
48 </object>
49 <packing>
50 <property name="expand">False</property>
51 <property name="fill">True</property>
52 <property name="position">1</property>
53 </packing>
54 </child>
55 <child>
50 <object class="GtkHBox" id="hbox10">56 <object class="GtkHBox" id="hbox10">
51 <property name="visible">True</property>57 <property name="visible">True</property>
52 <property name="can_focus">False</property>58 <property name="can_focus">False</property>
@@ -55,7 +61,6 @@
55 <property name="visible">True</property>61 <property name="visible">True</property>
56 <property name="can_focus">True</property>62 <property name="can_focus">True</property>
57 <property name="receives_default">True</property>63 <property name="receives_default">True</property>
58 <property name="tooltip_text" translatable="yes">Add a Location…</property>
59 <property name="use_action_appearance">False</property>64 <property name="use_action_appearance">False</property>
60 <child>65 <child>
61 <object class="GtkImage" id="addImage">66 <object class="GtkImage" id="addImage">
@@ -76,7 +81,6 @@
76 <property name="visible">True</property>81 <property name="visible">True</property>
77 <property name="can_focus">True</property>82 <property name="can_focus">True</property>
78 <property name="receives_default">True</property>83 <property name="receives_default">True</property>
79 <property name="tooltip_text" translatable="yes">Remove This Location</property>
80 <property name="use_action_appearance">False</property>84 <property name="use_action_appearance">False</property>
81 <child>85 <child>
82 <object class="GtkImage" id="removeImage">86 <object class="GtkImage" id="removeImage">
@@ -96,7 +100,7 @@
96 <packing>100 <packing>
97 <property name="expand">False</property>101 <property name="expand">False</property>
98 <property name="fill">True</property>102 <property name="fill">True</property>
99 <property name="position">1</property>103 <property name="position">2</property>
100 </packing>104 </packing>
101 </child>105 </child>
102 </object>106 </object>
@@ -112,6 +116,11 @@
112 <column type="gchararray"/>116 <column type="gchararray"/>
113 </columns>117 </columns>
114 </object>118 </object>
119 <object class="GtkAdjustment" id="timeAdjustment">
120 <property name="upper">1.8446744073709552e+19</property>
121 <property name="step_increment">60</property>
122 <property name="page_increment">3600</property>
123 </object>
115 <object class="GtkWindow" id="timeDateDialog">124 <object class="GtkWindow" id="timeDateDialog">
116 <property name="can_focus">False</property>125 <property name="can_focus">False</property>
117 <property name="border_width">5</property>126 <property name="border_width">5</property>
118127
=== modified file 'libmap/cc-timezone-map.c'
--- libmap/cc-timezone-map.c 2011-02-23 21:31:18 +0000
+++ libmap/cc-timezone-map.c 2011-03-29 16:16:13 +0000
@@ -766,13 +766,23 @@
766 gchar *file;766 gchar *file;
767 GError *err = NULL;767 GError *err = NULL;
768 gdouble pointx, pointy;768 gdouble pointx, pointy;
769 gdouble alpha = 1.0;
770 GtkStyle *style;
769 char buf[16];771 char buf[16];
770772
771 gtk_widget_get_allocation (widget, &alloc);773 gtk_widget_get_allocation (widget, &alloc);
772774
775 style = gtk_widget_get_style (widget);
776
777 /* Check if insensitive */
778 if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
779 alpha = 0.5;
780
773 /* paint background */781 /* paint background */
782 gdk_cairo_set_source_color (cr, &style->bg[gtk_widget_get_state (widget)]);
783 cairo_paint (cr);
774 gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);784 gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);
775 cairo_paint (cr);785 cairo_paint_with_alpha (cr, alpha);
776786
777 /* paint watermark */787 /* paint watermark */
778 if (priv->watermark) {788 if (priv->watermark) {
@@ -813,7 +823,7 @@
813 alloc.height, GDK_INTERP_BILINEAR);823 alloc.height, GDK_INTERP_BILINEAR);
814 gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);824 gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);
815825
816 cairo_paint (cr);826 cairo_paint_with_alpha (cr, alpha);
817 g_object_unref (hilight);827 g_object_unref (hilight);
818 g_object_unref (orig_hilight);828 g_object_unref (orig_hilight);
819 }829 }
@@ -836,7 +846,7 @@
836 if (pin)846 if (pin)
837 {847 {
838 gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14);848 gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14);
839 cairo_paint (cr);849 cairo_paint_with_alpha (cr, alpha);
840 g_object_unref (pin);850 g_object_unref (pin);
841 }851 }
842852
843853
=== modified file 'src/datetime-prefs-locations.c'
--- src/datetime-prefs-locations.c 2011-03-23 20:24:28 +0000
+++ src/datetime-prefs-locations.c 2011-03-29 16:16:13 +0000
@@ -39,6 +39,8 @@
39#define COL_TIME 139#define COL_TIME 1
40#define COL_ZONE 240#define COL_ZONE 2
4141
42static gboolean update_times (TimezoneCompletion * completion);
43
42static void44static void
43handle_add (GtkWidget * button, GtkTreeView * tree)45handle_add (GtkWidget * button, GtkTreeView * tree)
44{46{
@@ -103,8 +105,6 @@
103 TIMEZONE_COMPLETION_NAME, &name,105 TIMEZONE_COMPLETION_NAME, &name,
104 -1);106 -1);
105107
106 g_debug("match selected: %s, %s", name, zone);
107
108 if (zone == NULL || zone[0] == 0) {108 if (zone == NULL || zone[0] == 0) {
109 const gchar * strlon, * strlat;109 const gchar * strlon, * strlat;
110 gdouble lon = 0.0, lat = 0.0;110 gdouble lon = 0.0, lat = 0.0;
@@ -132,6 +132,8 @@
132 gtk_list_store_set (store, store_iter, COL_NAME, name, COL_ZONE, zone, -1);132 gtk_list_store_set (store, store_iter, COL_NAME, name, COL_ZONE, zone, -1);
133 }133 }
134134
135 update_times (TIMEZONE_COMPLETION (widget));
136
135 return FALSE; // Do normal action too137 return FALSE; // Do normal action too
136}138}
137139
138140
=== modified file 'src/timezone-completion.c'
--- src/timezone-completion.c 2011-03-29 16:01:21 +0000
+++ src/timezone-completion.c 2011-03-29 16:16:13 +0000
@@ -230,6 +230,20 @@
230 json_reader_end_element (reader);230 json_reader_end_element (reader);
231 }231 }
232232
233 if (strlen (priv->request_text) < 4) {
234 gchar * lower_text = g_ascii_strdown (priv->request_text, -1);
235 if (g_strcmp0 (lower_text, "ut") == 0 ||
236 g_strcmp0 (lower_text, "utc") == 0) {
237 GtkTreeIter iter;
238 gtk_list_store_append (store, &iter);
239 gtk_list_store_set (store, &iter,
240 TIMEZONE_COMPLETION_ZONE, "UTC",
241 TIMEZONE_COMPLETION_NAME, "UTC",
242 -1);
243 }
244 g_free (lower_text);
245 }
246
233 save_and_use_model (completion, GTK_TREE_MODEL (store));247 save_and_use_model (completion, GTK_TREE_MODEL (store));
234 g_object_unref (G_OBJECT (reader));248 g_object_unref (G_OBJECT (reader));
235}249}
@@ -374,6 +388,13 @@
374 g_free (name);388 g_free (name);
375 }389 }
376390
391 GtkTreeIter iter;
392 gtk_list_store_append (store, &iter);
393 gtk_list_store_set (store, &iter,
394 TIMEZONE_COMPLETION_ZONE, "UTC",
395 TIMEZONE_COMPLETION_NAME, "UTC",
396 -1);
397
377 tz_db_free (db);398 tz_db_free (db);
378 return store;399 return store;
379}400}
@@ -391,7 +412,9 @@
391 -1);412 -1);
392413
393 gchar * user_name;414 gchar * user_name;
394 if (admin1 == NULL || admin1[0] == 0) {415 if (country == NULL || country[0] == 0) {
416 user_name = g_strdup (name);
417 } else if (admin1 == NULL || admin1[0] == 0) {
395 user_name = g_strdup_printf ("%s <small>(%s)</small>", name, country);418 user_name = g_strdup_printf ("%s <small>(%s)</small>", name, country);
396 } else {419 } else {
397 user_name = g_strdup_printf ("%s <small>(%s, %s)</small>", name, admin1, country);420 user_name = g_strdup_printf ("%s <small>(%s, %s)</small>", name, admin1, country);

Subscribers

People subscribed via source and target branches