~nobuto/ubuntu/trusty/zenity/expandable-on-list-view

« back to all changes in this revision

Viewing changes to src/calendar.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-05-14 19:36:42 UTC
  • mfrom: (1.1.47)
  • Revision ID: package-import@ubuntu.com-20130514193642-sc79t888twgkwm64
Tags: 3.8.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
 
111
111
  gtk_main ();
112
112
}
113
 
 
114
 
static void
115
 
zenity_calendar_dialog_response (GtkWidget *widget, int response, gpointer data)
 
113
static void 
 
114
zenity_calendar_dialog_output (void)
116
115
{
117
 
  ZenityData *zen_data;
118
116
  guint day, month, year;
119
117
  gchar time_string[128];
120
118
  GDate *date = NULL;
 
119
  
 
120
  gtk_calendar_get_date (GTK_CALENDAR (calendar), &day, &month, &year);
 
121
  date = g_date_new_dmy (year, month + 1, day);
 
122
  g_date_strftime (time_string, 127, zen_cal_data->date_format, date);
 
123
  g_print ("%s\n", time_string);
 
124
 
 
125
  if (date != NULL)
 
126
    g_date_free (date);
 
127
}
 
128
 
 
129
static void
 
130
zenity_calendar_dialog_response (GtkWidget *widget, int response, gpointer data)
 
131
{
 
132
  ZenityData *zen_data;
121
133
 
122
134
  zen_data = data;
123
135
 
124
136
  switch (response) {
125
137
    case GTK_RESPONSE_OK:
126
 
      gtk_calendar_get_date (GTK_CALENDAR (calendar), &day, &month, &year);
127
 
      date = g_date_new_dmy (year, month + 1, day);
128
 
      g_date_strftime (time_string, 127, zen_cal_data->date_format, date);
129
 
      g_print ("%s\n", time_string);
130
 
    
131
 
      if (date != NULL)
132
 
        g_date_free (date);
133
 
      zenity_util_exit_code_with_data (ZENITY_OK, zen_data);   
 
138
      zenity_calendar_dialog_output ();
 
139
      zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);   
134
140
      break;
135
141
 
136
142
    case GTK_RESPONSE_CANCEL:
137
143
      zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
138
144
      break;
139
145
 
 
146
    case ZENITY_TIMEOUT:
 
147
      zenity_calendar_dialog_output ();
 
148
      zen_data->exit_code = zenity_util_return_exit_code (ZENITY_TIMEOUT);
 
149
      break;
 
150
 
140
151
    default:
141
152
      /* Esc dialog */
142
153
      zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);