当前位置: 首页>>代码示例>>C++>>正文


C++ settings_get_bool函数代码示例

本文整理汇总了C++中settings_get_bool函数的典型用法代码示例。如果您正苦于以下问题:C++ settings_get_bool函数的具体用法?C++ settings_get_bool怎么用?C++ settings_get_bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了settings_get_bool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: g_return_val_if_fail

char *channel_get_nickmode(CHANNEL_REC *channel, const char *nick)
{
        NICK_REC *nickrec;
        char *emptystr;

	g_return_val_if_fail(nick != NULL, NULL);

	if (!settings_get_bool("show_nickmode"))
                return "";

        emptystr = settings_get_bool("show_nickmode_empty") ? " " : "";

	nickrec = channel == NULL ? NULL :
		nicklist_find(channel, nick);
	return nickrec == NULL ? emptystr :
		(nickrec->op ? "@" : (nickrec->voice ? "+" : emptystr));
}
开发者ID:svn2github,项目名称:irssi,代码行数:17,代码来源:fe-messages.c

示例2: create_windows

static void create_windows(void)
{
	WINDOW_REC *window;
	int have_status = settings_get_bool("use_status_window");

	window = window_find_name("(status)");
	if (have_status) {
		if (window == NULL) {
			window = window_create(NULL, TRUE);
			window_set_refnum(window, 1);
			window_set_name(window, "(status)");
			window_set_level(window, MSGLEVEL_ALL ^
					 (settings_get_bool("use_msgs_window") ?
					  MSGS_WINDOW_LEVELS : 0));
			window_set_immortal(window, TRUE);
		}
	} else {
		if (window != NULL) {
			window_set_name(window, NULL);
			window_set_level(window, 0);
			window_set_immortal(window, FALSE);
		}
	}

	window = window_find_name("(msgs)");
	if (settings_get_bool("use_msgs_window")) {
		if (window == NULL) {
			window = window_create(NULL, TRUE);
			window_set_refnum(window, have_status ? 2 : 1);
			window_set_name(window, "(msgs)");
			window_set_level(window, MSGS_WINDOW_LEVELS);
			window_set_immortal(window, TRUE);
		}
	} else {
		if (window != NULL) {
			window_set_name(window, NULL);
			window_set_level(window, 0);
			window_set_immortal(window, FALSE);
		}
	}

	if (windows == NULL) {
		/* we have to have at least one window.. */
                window = window_create(NULL, TRUE);
	}
}
开发者ID:rrebello,项目名称:irssi,代码行数:46,代码来源:fe-common-core.c

示例3: sig_server_connecting

static void
sig_server_connecting(XMPP_SERVER_REC *server)
{
	if (!IS_XMPP_SERVER(server))
		return;
	if (settings_get_bool("xmpp_status_window"))
		fe_xmpp_status_get_window(server);
}
开发者ID:markhibberd,项目名称:irssi-xmpp,代码行数:8,代码来源:fe-xmpp-status.c

示例4: read_settings

void
read_settings(void)
{
	GSList *tmp;
	XMPP_SERVER_REC *server;
	const char *str;
	
	for (tmp = servers; tmp != NULL; tmp = tmp->next) {
		if ((server = XMPP_SERVER(tmp->data)) == NULL)
			continue;
		/* update priority */
		if (server->priority != settings_get_int("xmpp_priority"))
			signal_emit("xmpp set presence", 4, server,
			    server->show, server->away_reason,
			    settings_get_int("xmpp_priority"));
		/* update nick */
		if (settings_get_bool("xmpp_set_nick_as_username")) {
			if (strcmp(server->nick, server->user) != 0) {
				g_free(server->nick);
				server->nick = g_strdup(server->user);
			}
		} else {
			if (strcmp(server->nick, server->jid) != 0) {
				g_free(server->nick);
				server->nick = g_strdup(server->jid);
			}
		}
	}
	/* check validity */
	str = settings_get_str("xmpp_proxy_type");
#if 0
	/* TODO print error message */
	if (settings_get_bool("xmpp_use_proxy")
	    && (str == NULL || g_ascii_strcasecmp(str, XMPP_PROXY_HTTP) != 0))
		;
	str = settings_get_str("xmpp_default_away_mode");
	if (str == NULL
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_AWAY]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_CHAT]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_DND]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_XA]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_ONLINE]) != 0)
		;
#endif
}
开发者ID:jahrome,项目名称:irssi-xmpp-android,代码行数:45,代码来源:xmpp-settings.c

示例5: event_text

static void event_text(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
	CHANNEL_REC *channel;
	GList *comp;
	char *line, *str, *ptr, comp_char;

	g_return_if_fail(data != NULL);
	if (item == NULL) return;

	line = settings_get_bool("expand_escapes") ?
		expand_escapes(data, server, item) : g_strdup(data);
	comp_char = *settings_get_str("completion_char");

	/* check for automatic nick completion */
        ptr = NULL;
	comp = NULL;
	channel = CHANNEL(item);

	if (channel != NULL && comp_char != '\0' &&
	    settings_get_bool("completion_auto")) {
		ptr = strchr(line, comp_char);
		if (ptr != NULL) {
			*ptr++ = '\0';
			if (nicklist_find(channel, line) == NULL) {
				comp = completion_channel_nicks(channel,
								line, NULL);
			}
		}
	}

	str = g_strdup_printf(ptr == NULL ? "%s %s" : "%s %s%c%s", item->name,
			      comp != NULL ? (char *) comp->data : line,
			      comp_char, ptr);
	signal_emit("command msg", 3, str, server, item);

	g_free(str);
	g_free(line);

	if (comp != NULL) {
		g_list_foreach(comp, (GFunc) g_free, NULL);
		g_list_free(comp);
	}

	signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:45,代码来源:chat-completion.c

示例6: sig_statusbar_activity_hilight

static void sig_statusbar_activity_hilight(WINDOW_REC *window, gpointer oldlevel)
{
    GList *tmp;
    int inspos;

    g_return_if_fail(window != NULL);

    if (settings_get_bool("actlist_moves"))
    {
	/* Move the window to the first in the activity list */
	if (g_list_find(activity_list, window) != NULL)
	    activity_list = g_list_remove(activity_list, window);
	if (window->new_data != 0)
	    activity_list = g_list_prepend(activity_list, window);
	statusbar_item_redraw(activity_item);
	return;
    }

    if (g_list_find(activity_list, window) != NULL)
    {
	/* already in activity list */
	if (window->new_data == 0)
	{
	    /* remove from activity list */
	    activity_list = g_list_remove(activity_list, window);
	    statusbar_item_redraw(activity_item);
	}
	else if (window->new_data != GPOINTER_TO_INT(oldlevel) ||
		 window->last_color != 0)
	{
		/* different level as last time (or maybe different
		   hilight color?), just redraw it. */
		statusbar_item_redraw(activity_item);
	}
        return;
    }

    if (window->new_data == 0)
	    return;

    /* add window to activity list .. */
    inspos = 0;
    for (tmp = activity_list; tmp != NULL; tmp = tmp->next, inspos++)
    {
        WINDOW_REC *rec = tmp->data;

	if (window->refnum < rec->refnum)
	{
	    activity_list = g_list_insert(activity_list, window, inspos);
	    break;
	}
    }
    if (tmp == NULL)
	activity_list = g_list_append(activity_list, window);

    statusbar_item_redraw(activity_item);
}
开发者ID:svn2github,项目名称:irssi,代码行数:57,代码来源:statusbar-items.c

示例7: gui_windows_reset_settings

void gui_windows_reset_settings(void)
{
	GSList *tmp;

	for (tmp = windows; tmp != NULL; tmp = tmp->next) {
		WINDOW_REC *rec = tmp->data;
                GUI_WINDOW_REC *gui = WINDOW_GUI(rec);

                textbuffer_view_set_default_indent(gui->view,
						   settings_get_int("indent"),
						   !settings_get_bool("indent_always"),
                                                   get_default_indent_func());

		textbuffer_view_set_scroll(gui->view,
					   gui->use_scroll ? gui->scroll :
					   settings_get_bool("scroll"));
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:18,代码来源:gui-windows.c

示例8: sig_message_own_nick

static void sig_message_own_nick(SERVER_REC *server, const char *newnick,
				 const char *oldnick, const char *address)
{
        if (!settings_get_bool("show_own_nickchange_once"))
		print_nick_change(server, newnick, oldnick, address, TRUE);
	else {
		printformat(server, NULL, MSGLEVEL_NICKS,
			    TXT_YOUR_NICK_CHANGED, oldnick, newnick, "");
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:fe-messages.c

示例9: sig_message_own_public

static void
sig_message_own_public(SERVER_REC *server, char *msg, char *target)
{
	WINDOW_REC *window;
	CHANNEL_REC *channel;
	char *nick, *nickmode, *freemsg = NULL, *recoded;
	gboolean print_channel;

	g_return_if_fail(server != NULL);
	g_return_if_fail(msg != NULL);
	g_return_if_fail(target != NULL);
	if (!IS_XMPP_SERVER(server))
		return;
	channel = channel_find(server, target);
	if (channel == NULL || channel->ownnick == NULL)
		return;
	nick = channel->ownnick->nick;
	nickmode = channel_get_nickmode(CHANNEL(channel), nick);
	window = (channel == NULL) ?
	    NULL : window_item_window((WI_ITEM_REC *)channel);
	print_channel = (window == NULL ||
	    window->active != (WI_ITEM_REC *) channel);
	if (!print_channel && settings_get_bool("print_active_channel") &&
	    window != NULL && g_slist_length(window->items) > 1)
		print_channel = TRUE;
	if (settings_get_bool("emphasis"))
		msg = freemsg = expand_emphasis((WI_ITEM_REC *)channel, msg);
	/* ugly from irssi: recode the sent message back for printing */
	recoded = recode_in(SERVER(server), msg, target);
	if (!print_channel)
		printformat_module(CORE_MODULE_NAME, server, target,
		    MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
		    TXT_OWN_MSG, nick, recoded, nickmode);
	else
		printformat_module(CORE_MODULE_NAME, server, target,
		    MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
		    TXT_OWN_MSG_CHANNEL, nick, target, recoded, nickmode);
	g_free(recoded);
	g_free(nickmode);
	g_free_not_null(freemsg);
	signal_stop();
	/* emit signal for chat-completion */
}
开发者ID:fschlich,项目名称:irssi-xmpp,代码行数:43,代码来源:fe-xmpp-messages.c

示例10: g_strdup

static char *channel_get_nickmode_rec(NICK_REC *nickrec)
{
        char *emptystr;
	char *nickmode;

	if (!settings_get_bool("show_nickmode"))
                return g_strdup("");

        emptystr = settings_get_bool("show_nickmode_empty") ? " " : "";

	if (nickrec == NULL || nickrec->prefixes[0] == '\0')
		nickmode = g_strdup(emptystr);
	else {
		nickmode = g_malloc(2);
		nickmode[0] = nickrec->prefixes[0];
		nickmode[1] = '\0';
	}
	return nickmode;
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:19,代码来源:fe-messages.c

示例11: read_settings

static void read_settings(void)
{
	if (daytag != -1) {
		g_source_remove(daytag);
		daytag = -1;
	}

	if (settings_get_bool("timestamps"))
		daytag = g_timeout_add(30000, (GSourceFunc) sig_check_daychange, NULL);
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:windows.c

示例12: event_motd

static void event_motd(IRC_SERVER_REC *server, const char *data,
                       const char *nick, const char *addr)
{
    /* don't ignore motd anymore after 3 seconds of connection time -
       we might have called /MOTD */
    if (settings_get_bool("skip_motd") && !server->motd_got)
        return;

    print_event_received(server, data, nick, FALSE);
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:fe-events-numeric.c

示例13: set_boolean

static void set_boolean(const char *key, const char *value)
{
	if (g_strcasecmp(value, "ON") == 0)
		settings_set_bool(key, TRUE);
	else if (g_strcasecmp(value, "OFF") == 0)
		settings_set_bool(key, FALSE);
	else if (g_strcasecmp(value, "TOGGLE") == 0)
		settings_set_bool(key, !settings_get_bool(key));
	else
		printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_NOT_TOGGLE);
}
开发者ID:svn2github,项目名称:irssi,代码行数:11,代码来源:fe-settings.c

示例14: read_settings

static void read_settings(void)
{
    int old_autolog = autolog_level;

    autolog_path = settings_get_str("autolog_path");
    autolog_level = !settings_get_bool("autolog") ? 0 :
                    level2bits(settings_get_str("autolog_level"));

    if (old_autolog && !autolog_level)
        autologs_close_all();
}
开发者ID:svn2github,项目名称:irssi,代码行数:11,代码来源:fe-log.c

示例15: fe_xmpp_status_init

void
fe_xmpp_status_init(void)
{
	signal_add("server connecting", (SIGNAL_FUNC)sig_server_connecting);
	signal_add("setup changed", (SIGNAL_FUNC)sig_setup_changed);

	settings_add_bool("xmpp_lookandfeel", "xmpp_status_window", FALSE);

	if (settings_get_bool("xmpp_status_window"))
		signal_add("xmpp presence changed", sig_presence_changed);
}
开发者ID:markhibberd,项目名称:irssi-xmpp,代码行数:11,代码来源:fe-xmpp-status.c


注:本文中的settings_get_bool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。