| 352 |
353 |
| 353 gtk_widget_queue_draw(drawing_area); |
354 gtk_widget_queue_draw(drawing_area); |
| 354 } |
355 } |
| 355 |
356 |
| 356 static void |
357 static void |
| 357 pidgin_whiteboard_clear_response(GtkDialog *self, gint response, gpointer data) |
358 pidgin_whiteboard_clear_response(G_GNUC_UNUSED AdwMessageDialog *self, |
| |
359 char *response, gpointer data) |
| 358 { |
360 { |
| 359 PidginWhiteboard *gtkwb = (PidginWhiteboard *)data; |
361 PidginWhiteboard *gtkwb = (PidginWhiteboard *)data; |
| 360 |
362 |
| 361 if(response == GTK_RESPONSE_YES) { |
363 if(!purple_strequal(response, "yes")) { |
| 362 pidgin_whiteboard_clear(gtkwb->wb); |
364 return; |
| 363 |
365 } |
| 364 /* Do protocol specific clearing procedures */ |
366 |
| 365 purple_whiteboard_send_clear(gtkwb->wb); |
367 pidgin_whiteboard_clear(gtkwb->wb); |
| 366 } |
368 |
| 367 |
369 /* Do protocol specific clearing procedures */ |
| 368 gtk_window_destroy(GTK_WINDOW(self)); |
370 purple_whiteboard_send_clear(gtkwb->wb); |
| 369 } |
371 } |
| 370 |
372 |
| 371 static void |
373 static void |
| 372 pidgin_whiteboard_button_clear_press(G_GNUC_UNUSED GtkWidget *widget, |
374 pidgin_whiteboard_button_clear_press(G_GNUC_UNUSED GtkWidget *widget, |
| 373 gpointer data) |
375 gpointer data) |
| 374 { |
376 { |
| 375 PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data); |
377 PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data); |
| |
378 AdwMessageDialog *dialog = NULL; |
| 376 |
379 |
| 377 /* Confirm whether the user really wants to clear */ |
380 /* Confirm whether the user really wants to clear */ |
| 378 GtkWidget *dialog = gtk_message_dialog_new( |
381 dialog = ADW_MESSAGE_DIALOG(adw_message_dialog_new( |
| 379 GTK_WINDOW(gtkwb), GTK_DIALOG_DESTROY_WITH_PARENT, |
382 GTK_WINDOW(gtkwb), |
| 380 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", |
383 _("Clear whiteboard?"), |
| 381 _("Do you really want to clear?")); |
384 _("Do you want to clear this whiteboard?"))); |
| |
385 |
| |
386 adw_message_dialog_add_responses(dialog, "no", _("_No"), "yes", _("_Yes"), |
| |
387 NULL); |
| |
388 adw_message_dialog_set_response_appearance(dialog, "yes", |
| |
389 ADW_RESPONSE_DESTRUCTIVE); |
| |
390 adw_message_dialog_set_default_response(dialog, "yes"); |
| |
391 adw_message_dialog_set_close_response(dialog, "no"); |
| 382 |
392 |
| 383 g_signal_connect(dialog, "response", |
393 g_signal_connect(dialog, "response", |
| 384 G_CALLBACK(pidgin_whiteboard_clear_response), gtkwb); |
394 G_CALLBACK(pidgin_whiteboard_clear_response), gtkwb); |
| 385 |
395 |
| 386 gtk_widget_show(dialog); |
396 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
| |
397 gtk_window_present_with_time(GTK_WINDOW(dialog), GDK_CURRENT_TIME); |
| 387 } |
398 } |
| 388 |
399 |
| 389 static void |
400 static void |
| 390 pidgin_whiteboard_save_response(GtkNativeDialog *self, gint response_id, |
401 pidgin_whiteboard_save_response(GtkNativeDialog *self, gint response_id, |
| 391 gpointer data) |
402 gpointer data) |