Merge lp:~mterry/indicator-datetime/non-modal-locations into lp:indicator-datetime/0.3

Proposed by Michael Terry
Status: Merged
Merged at revision: 88
Proposed branch: lp:~mterry/indicator-datetime/non-modal-locations
Merge into: lp:indicator-datetime/0.3
Prerequisite: lp:~mterry/indicator-datetime/crash-fix-and-more
Diff against target: 86 lines (+20/-7)
4 files modified
data/datetime-dialog.ui (+0/-1)
src/datetime-prefs-locations.c (+1/-3)
src/datetime-prefs-locations.h (+1/-1)
src/datetime-prefs.c (+18/-2)
To merge this branch: bzr merge lp:~mterry/indicator-datetime/non-modal-locations
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+55357@code.launchpad.net
To post a comment you must log in.

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-29 15:19:47 +0000
3+++ data/datetime-dialog.ui 2011-03-29 15:19:47 +0000
4@@ -10,7 +10,6 @@
5 <object class="GtkWindow" id="locationsDialog">
6 <property name="can_focus">False</property>
7 <property name="title" translatable="yes">Locations</property>
8- <property name="modal">True</property>
9 <property name="default_width">300</property>
10 <property name="default_height">200</property>
11 <property name="destroy_with_parent">True</property>
12
13=== modified file 'src/datetime-prefs-locations.c'
14--- src/datetime-prefs-locations.c 2011-03-29 15:19:47 +0000
15+++ src/datetime-prefs-locations.c 2011-03-29 15:19:47 +0000
16@@ -309,7 +309,7 @@
17 }
18
19 GtkWidget *
20-datetime_setup_locations_dialog (GtkWindow * parent, CcTimezoneMap * map)
21+datetime_setup_locations_dialog (CcTimezoneMap * map)
22 {
23 GError * error = NULL;
24 GtkBuilder * builder = gtk_builder_new ();
25@@ -375,8 +375,6 @@
26 g_object_set_data (G_OBJECT (dlg), "time-id", GINT_TO_POINTER(time_id));
27 update_times (dlg);
28
29- gtk_window_set_transient_for (GTK_WINDOW (dlg), parent);
30-
31 #undef WIG
32
33 g_object_unref (conf);
34
35=== modified file 'src/datetime-prefs-locations.h'
36--- src/datetime-prefs-locations.h 2011-02-23 18:28:53 +0000
37+++ src/datetime-prefs-locations.h 2011-03-29 15:19:47 +0000
38@@ -28,7 +28,7 @@
39
40 G_BEGIN_DECLS
41
42-GtkWidget * datetime_setup_locations_dialog (GtkWindow * parent, CcTimezoneMap * map);
43+GtkWidget * datetime_setup_locations_dialog (CcTimezoneMap * map);
44
45 G_END_DECLS
46
47
48=== modified file 'src/datetime-prefs.c'
49--- src/datetime-prefs.c 2011-03-11 04:02:32 +0000
50+++ src/datetime-prefs.c 2011-03-29 15:19:47 +0000
51@@ -53,6 +53,7 @@
52 guint save_time_id = 0;
53 gboolean user_edited_time = FALSE;
54 gboolean changing_time = FALSE;
55+GtkWidget * loc_dlg = NULL;
56
57 /* Turns the boolean property into a string gsettings */
58 static GVariant *
59@@ -495,10 +496,25 @@
60 }
61
62 static void
63+hide_locations ()
64+{
65+ if (loc_dlg != NULL)
66+ gtk_widget_destroy (loc_dlg);
67+}
68+
69+static void
70 show_locations (GtkWidget * button, GtkWidget * dlg)
71 {
72- GtkWidget * locationsDlg = datetime_setup_locations_dialog (GTK_WINDOW (dlg), tzmap);
73- gtk_widget_show_all (locationsDlg);
74+ if (loc_dlg == NULL) {
75+ loc_dlg = datetime_setup_locations_dialog (tzmap);
76+ gtk_window_set_transient_for (GTK_WINDOW (loc_dlg), GTK_WINDOW (dlg));
77+ g_signal_connect (loc_dlg, "destroy", G_CALLBACK (gtk_widget_destroyed), &loc_dlg);
78+ g_signal_connect (dlg, "focus-in-event", G_CALLBACK (hide_locations), NULL);
79+ gtk_widget_show_all (loc_dlg);
80+ }
81+ else {
82+ gtk_window_present_with_time (GTK_WINDOW (loc_dlg), gtk_get_current_event_time ());
83+ }
84 }
85
86 static gboolean

Subscribers

People subscribed via source and target branches