예제 #1
0
static void
history_prefs_check(PurplePlugin *plugin)
{
	if (!purple_prefs_get_bool("/purple/logging/log_ims") &&
	    !purple_prefs_get_bool("/purple/logging/log_chats"))
	{
		PurpleRequestFields *fields = purple_request_fields_new();
		PurpleRequestFieldGroup *group;
		PurpleRequestField *field;
		struct {
			const char *pref;
			const char *label;
		} prefs[] = {
			{"/purple/logging/log_ims", N_("Log IMs")},
			{"/purple/logging/log_chats", N_("Log chats")},
			{NULL, NULL}
		};
		int iter;
		GList *list = purple_log_logger_get_options();
		const char *system = purple_prefs_get_string("/purple/logging/format");

		group = purple_request_field_group_new(_("Logging"));

		field = purple_request_field_list_new("/purple/logging/format", _("Log format"));
		while (list) {
			const char *label = _(list->data);
			list = g_list_delete_link(list, list);
			purple_request_field_list_add_icon(field, label, NULL, list->data);
			if (system && strcmp(system, list->data) == 0)
				purple_request_field_list_add_selected(field, label);
			list = g_list_delete_link(list, list);
		}
		purple_request_field_group_add_field(group, field);

		for (iter = 0; prefs[iter].pref; iter++) {
			field = purple_request_field_bool_new(prefs[iter].pref, _(prefs[iter].label),
						purple_prefs_get_bool(prefs[iter].pref));
			purple_request_field_group_add_field(group, field);
		}

		purple_request_fields_add_group(fields, group);

		purple_request_fields(plugin, NULL, _("History Plugin Requires Logging"),
				      _("Logging can be enabled from Tools -> Preferences -> Logging.\n\n"
				      "Enabling logs for instant messages and/or chats will activate "
				      "history for the same conversation type(s)."),
				      fields,
				      _("OK"), G_CALLBACK(finch_request_save_in_prefs),
				      _("Cancel"), NULL,
				      NULL, NULL, NULL, plugin);
	}
}
예제 #2
0
파일: gntprefs.c 프로젝트: bf4/pidgin-mac
static GList *
get_log_options(void)
{
	return purple_log_logger_get_options();
}