~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to widgets/e-timezone-dialog/e-timezone-dialog.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-09-08 09:38:57 UTC
  • mfrom: (1.1.84 upstream)
  • Revision ID: package-import@ubuntu.com-20110908093857-6lfl04ke2ns3kx2o
Tags: 3.1.91-0ubuntu1
* New upstream release. (LP: #843769)
* debian/control: bump e-d-s Build-Depends to 3.1.91. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
struct _ETimezoneDialogPrivate {
58
58
        /* The selected timezone. May be NULL for a 'local time' (i.e. when
59
 
           the displayed name is ""). */
 
59
         * the displayed name is ""). */
60
60
        icaltimezone *zone;
61
61
 
62
62
        GtkBuilder *builder;
95
95
                                                 GdkEventButton *event,
96
96
                                                 gpointer        data);
97
97
 
98
 
static icaltimezone* get_zone_from_point        (ETimezoneDialog *etd,
 
98
static icaltimezone * get_zone_from_point       (ETimezoneDialog *etd,
99
99
                                                 EMapPoint      *point);
100
100
static void     set_map_timezone                (ETimezoneDialog *etd,
101
101
                                                 icaltimezone    *zone);
348
348
}
349
349
#endif
350
350
 
351
 
static icaltimezone*
 
351
static icaltimezone *
352
352
get_local_timezone (void)
353
353
{
354
354
        icaltimezone *zone;
411
411
}
412
412
 
413
413
static void
414
 
format_utc_offset                       (gint            utc_offset,
415
 
                                         gchar          *buffer)
 
414
format_utc_offset (gint utc_offset,
 
415
                   gchar *buffer)
416
416
{
417
417
  const gchar *sign = "+";
418
418
  gint hours, minutes, seconds;
503
503
}
504
504
 
505
505
static gboolean
506
 
on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data)
 
506
on_map_motion (GtkWidget *widget,
 
507
               GdkEventMotion *event,
 
508
               gpointer data)
507
509
{
508
510
        ETimezoneDialog *etd;
509
511
        ETimezoneDialogPrivate *priv;
510
512
        gdouble longitude, latitude;
511
513
        icaltimezone *new_zone;
512
 
        gchar *display=NULL;
 
514
        gchar *display = NULL;
513
515
 
514
516
        etd = E_TIMEZONE_DIALOG (data);
515
517
        priv = etd->priv;
539
541
}
540
542
 
541
543
static gboolean
542
 
on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data)
 
544
on_map_leave (GtkWidget *widget,
 
545
              GdkEventCrossing *event,
 
546
              gpointer data)
543
547
{
544
548
        ETimezoneDialog *etd;
545
549
        ETimezoneDialogPrivate *priv;
548
552
        priv = etd->priv;
549
553
 
550
554
        /* We only want to reset the hover point if this is a normal leave
551
 
           event. For some reason we are getting leave events when the
552
 
           button is pressed in the map, which causes problems. */
 
555
         * event. For some reason we are getting leave events when the
 
556
         * button is pressed in the map, which causes problems. */
553
557
        if (event->mode != GDK_CROSSING_NORMAL)
554
558
                return FALSE;
555
559
 
567
571
}
568
572
 
569
573
static gboolean
570
 
on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event,
571
 
                           gpointer data)
 
574
on_map_visibility_changed (GtkWidget *w,
 
575
                           GdkEventVisibility *event,
 
576
                           gpointer data)
572
577
{
573
578
        ETimezoneDialog *etd;
574
579
        ETimezoneDialogPrivate *priv;
578
583
 
579
584
        if (event->state != GDK_VISIBILITY_FULLY_OBSCURED) {
580
585
                /* Map is visible, at least partly, so make sure we flash the
581
 
                   selected point. */
 
586
                 * selected point. */
582
587
                if (!priv->timeout_id)
583
588
                        priv->timeout_id = g_timeout_add (100, on_map_timeout, etd);
584
589
        } else {
593
598
}
594
599
 
595
600
static gboolean
596
 
on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data)
 
601
on_map_button_pressed (GtkWidget *w,
 
602
                       GdkEventButton *event,
 
603
                       gpointer data)
597
604
{
598
605
        ETimezoneDialog *etd;
599
606
        ETimezoneDialogPrivate *priv;
627
634
}
628
635
 
629
636
/* Returns the translated timezone location of the given EMapPoint,
630
 
   e.g. "Europe/London". */
 
637
 * e.g. "Europe/London". */
631
638
static icaltimezone *
632
639
get_zone_from_point (ETimezoneDialog *etd,
633
 
                     EMapPoint *point)
 
640
                     EMapPoint *point)
634
641
{
635
642
        icalarray *zones;
636
643
        gdouble longitude, latitude;
695
702
 
696
703
void
697
704
e_timezone_dialog_set_timezone (ETimezoneDialog *etd,
698
 
                                icaltimezone    *zone)
 
705
                                icaltimezone *zone)
699
706
{
700
707
        ETimezoneDialogPrivate *priv;
701
708
        gchar *display = NULL;
722
729
}
723
730
 
724
731
GtkWidget *
725
 
e_timezone_dialog_get_toplevel  (ETimezoneDialog  *etd)
 
732
e_timezone_dialog_get_toplevel (ETimezoneDialog *etd)
726
733
{
727
734
        ETimezoneDialogPrivate *priv;
728
735
 
735
742
}
736
743
 
737
744
static void
738
 
set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone)
 
745
set_map_timezone (ETimezoneDialog *etd,
 
746
                  icaltimezone *zone)
739
747
{
740
748
        ETimezoneDialogPrivate *priv;
741
749
        EMapPoint *point;
761
769
}
762
770
 
763
771
static void
764
 
on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd)
 
772
on_combo_changed (GtkComboBox *combo_box,
 
773
                  ETimezoneDialog *etd)
765
774
{
766
775
        ETimezoneDialogPrivate *priv;
767
776
        const gchar *new_zone_name;
797
806
}
798
807
 
799
808
static void
800
 
timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name)
 
809
timezone_combo_get_active_text (GtkComboBox *combo,
 
810
                                const gchar **zone_name)
801
811
{
802
812
        GtkTreeModel *list_store;
803
813
        GtkTreeIter iter;
812
822
}
813
823
 
814
824
static gboolean
815
 
timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name)
 
825
timezone_combo_set_active_text (GtkComboBox *combo,
 
826
                                const gchar *zone_name)
816
827
{
817
828
        GtkTreeModel *list_store;
818
829
        GHashTable *index;
830
841
}
831
842
 
832
843
static void
833
 
map_destroy_cb (gpointer data, GObject *where_object_was)
 
844
map_destroy_cb (gpointer data,
 
845
                GObject *where_object_was)
834
846
{
835
847
 
836
848
        ETimezoneDialogPrivate *priv = data;