diff options
author | Michael Terry <mike@mterry.name> | 2011-03-29 11:17:52 -0400 |
---|---|---|
committer | Michael Terry <mike@mterry.name> | 2011-03-29 11:17:52 -0400 |
commit | 18ea5194b357dbd14dd724eb32013af8031a50be (patch) | |
tree | f0ef676ff72cb8fc9d2c239586cb4dcbad087afc /src/datetime-prefs.c | |
parent | b86cc25455f38c4162ecd1fe6add20373c789980 (diff) | |
download | ayatana-indicator-datetime-18ea5194b357dbd14dd724eb32013af8031a50be.tar.gz ayatana-indicator-datetime-18ea5194b357dbd14dd724eb32013af8031a50be.tar.bz2 ayatana-indicator-datetime-18ea5194b357dbd14dd724eb32013af8031a50be.zip |
treat locations dialog not as a modal dialog, but rather one that can be dismissed by interacting with the main dialog
Diffstat (limited to 'src/datetime-prefs.c')
-rw-r--r-- | src/datetime-prefs.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index fbc88f2..5a6fd91 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -53,6 +53,7 @@ GtkWidget * date_spin = NULL; guint save_time_id = 0; gboolean user_edited_time = FALSE; gboolean changing_time = FALSE; +GtkWidget * loc_dlg = NULL; /* Turns the boolean property into a string gsettings */ static GVariant * @@ -495,10 +496,25 @@ setup_time_spinners (GtkWidget * time, GtkWidget * date) } static void +hide_locations () +{ + if (loc_dlg != NULL) + gtk_widget_destroy (loc_dlg); +} + +static void show_locations (GtkWidget * button, GtkWidget * dlg) { - GtkWidget * locationsDlg = datetime_setup_locations_dialog (GTK_WINDOW (dlg), tzmap); - gtk_widget_show_all (locationsDlg); + if (loc_dlg == NULL) { + loc_dlg = datetime_setup_locations_dialog (tzmap); + gtk_window_set_transient_for (GTK_WINDOW (loc_dlg), GTK_WINDOW (dlg)); + g_signal_connect (loc_dlg, "destroy", G_CALLBACK (gtk_widget_destroyed), &loc_dlg); + g_signal_connect (dlg, "focus-in-event", G_CALLBACK (hide_locations), NULL); + gtk_widget_show_all (loc_dlg); + } + else { + gtk_window_present_with_time (GTK_WINDOW (loc_dlg), gtk_get_current_event_time ()); + } } static gboolean |