/* Destroy all response Callback: Callback for the destroy all dialog */ static void destroy_all_response_cb (GtkDialog *dialog, gint id, StickyNotesApplet *applet) { if (id == GTK_RESPONSE_OK) { while (g_list_length(stickynotes->notes) > 0) { StickyNote *note = g_list_nth_data(stickynotes->notes, 0); stickynote_free(note); stickynotes->notes = g_list_remove(stickynotes->notes, note); } } stickynotes_applet_update_tooltips(); stickynotes_save(); gtk_widget_destroy (GTK_WIDGET (dialog)); applet->destroy_all_dialog = NULL; }
/* Sticky Notes applet factory */ static gboolean stickynotes_applet_factory(PanelApplet *panel_applet, const gchar *iid, gpointer data) { if (!strcmp(iid, "StickyNotesApplet")) { if (!stickynotes) stickynotes_applet_init (panel_applet); panel_applet_set_flags (panel_applet, PANEL_APPLET_EXPAND_MINOR); /* Add applet to linked list of all applets */ stickynotes->applets = g_list_append (stickynotes->applets, stickynotes_applet_new(panel_applet)); stickynotes_applet_update_menus (); stickynotes_applet_update_tooltips (); return TRUE; } return FALSE; }