1
0
Fork 0

Add win_print

This commit is contained in:
James Booth 2016-10-15 18:29:02 +01:00
parent 3612270e90
commit 8f1d3ab55c
15 changed files with 378 additions and 347 deletions

View File

@ -1479,9 +1479,9 @@ _cmd_help_cmd_list(const char *const tag)
cons_show("");
ProfWin *console = wins_get_console();
if (tag) {
win_printf_line(console, THEME_WHITE_BOLD, '-', "%s commands", tag);
win_println(console, THEME_WHITE_BOLD, '-', "%s commands", tag);
} else {
win_printf_line(console, THEME_WHITE_BOLD, '-', "All commands");
win_println(console, THEME_WHITE_BOLD, '-', "All commands");
}
GList *ordered_commands = NULL;
@ -3108,7 +3108,7 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
if (occupant) {
win_show_occupant(window, occupant);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "No such participant \"%s\" in room.", usr);
win_println(window, THEME_DEFAULT, '-', "No such participant \"%s\" in room.", usr);
}
} else {
ui_current_print_line("You must specify a nickname.");
@ -3124,7 +3124,7 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
if (pcontact) {
win_show_contact(window, pcontact);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "Error getting contact info.");
win_println(window, THEME_DEFAULT, '-', "Error getting contact info.");
}
}
break;
@ -3139,7 +3139,7 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
if (occupant) {
win_show_occupant(window, occupant);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "Error getting contact info.");
win_println(window, THEME_DEFAULT, '-', "Error getting contact info.");
}
jid_destroy(jid);
}
@ -3204,7 +3204,7 @@ cmd_info(ProfWin *window, const char *const command, gchar **args)
if (pcontact) {
win_show_info(window, pcontact);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "Error getting contact info.");
win_println(window, THEME_DEFAULT, '-', "Error getting contact info.");
}
}
break;
@ -3219,7 +3219,7 @@ cmd_info(ProfWin *window, const char *const command, gchar **args)
if (occupant) {
win_show_occupant_info(window, jid->barejid, occupant);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "Error getting contact info.");
win_println(window, THEME_DEFAULT, '-', "Error getting contact info.");
}
jid_destroy(jid);
}
@ -3372,7 +3372,7 @@ cmd_software(ProfWin *window, const char *const command, gchar **args)
iq_send_software_version(fulljid->str);
g_string_free(fulljid, TRUE);
} else {
win_printf_line(window, THEME_DEFAULT, '-', "Unknown resource for /software command.");
win_println(window, THEME_DEFAULT, '-', "Unknown resource for /software command.");
}
}
break;
@ -3881,7 +3881,7 @@ cmd_kick(ProfWin *window, const char *const command, gchar **args)
char *reason = args[1];
iq_room_kick_occupant(mucwin->roomjid, nick, reason);
} else {
win_printf_line(window, THEME_DEFAULT, '!', "Occupant does not exist: %s", nick);
win_println(window, THEME_DEFAULT, '!', "Occupant does not exist: %s", nick);
}
} else {
cons_bad_cmd_usage(command);
@ -3939,10 +3939,10 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
if (args[0] == NULL) {
char *subject = muc_subject(mucwin->roomjid);
if (subject) {
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
win_print(window, THEME_ROOMINFO, '!', "Room subject: ");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_DEFAULT, "", "%s", subject);
} else {
win_printf_line(window, THEME_ROOMINFO, '!', "Room has no subject");
win_println(window, THEME_ROOMINFO, '!', "Room has no subject");
}
return TRUE;
}
@ -3974,7 +3974,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
message_send_groupchat_subject(mucwin->roomjid, new_subject->str);
g_string_free(new_subject, TRUE);
} else {
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
win_print(window, THEME_ROOMINFO, '!', "Room does not have a subject, use /subject set <subject>");
}
} else {
cons_bad_cmd_usage(command);
@ -3991,7 +3991,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
message_send_groupchat_subject(mucwin->roomjid, new_subject->str);
g_string_free(new_subject, TRUE);
} else {
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
win_print(window, THEME_ROOMINFO, '!', "Room does not have a subject, use /subject set <subject>");
}
} else {
cons_bad_cmd_usage(command);
@ -4050,7 +4050,7 @@ cmd_affiliation(ProfWin *window, const char *const command, gchar **args)
iq_room_affiliation_list(mucwin->roomjid, "member");
iq_room_affiliation_list(mucwin->roomjid, "outcast");
} else if (g_strcmp0(affiliation, "none") == 0) {
win_printf_line(window, THEME_DEFAULT, '!', "Cannot list users with no affiliation.");
win_println(window, THEME_DEFAULT, '!', "Cannot list users with no affiliation.");
} else {
iq_room_affiliation_list(mucwin->roomjid, affiliation);
}
@ -4118,7 +4118,7 @@ cmd_role(ProfWin *window, const char *const command, gchar **args)
iq_room_role_list(mucwin->roomjid, "participant");
iq_room_role_list(mucwin->roomjid, "visitor");
} else if (g_strcmp0(role, "none") == 0) {
win_printf_line(window, THEME_DEFAULT, '!', "Cannot list users with no role.");
win_println(window, THEME_DEFAULT, '!', "Cannot list users with no role.");
} else {
iq_room_role_list(mucwin->roomjid, role);
}
@ -4180,12 +4180,12 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
if (g_strcmp0(args[0], "accept") == 0) {
gboolean requires_config = muc_requires_config(mucwin->roomjid);
if (!requires_config) {
win_printf_line(window, THEME_ROOMINFO, '!', "Current room does not require configuration.");
win_println(window, THEME_ROOMINFO, '!', "Current room does not require configuration.");
return TRUE;
} else {
iq_confirm_instant_room(mucwin->roomjid);
muc_set_requires_config(mucwin->roomjid, FALSE);
win_printf_line(window, THEME_ROOMINFO, '!', "Room unlocked.");
win_println(window, THEME_ROOMINFO, '!', "Room unlocked.");
return TRUE;
}
}
@ -4681,13 +4681,13 @@ cmd_tiny(ProfWin *window, const char *const command, gchar **args)
}
if (!tinyurl_valid(url)) {
win_printf_line(window, THEME_ERROR, '-', "/tiny, badly formed URL: %s", url);
win_println(window, THEME_ERROR, '-', "/tiny, badly formed URL: %s", url);
return TRUE;
}
char *tiny = tinyurl_get(url);
if (!tiny) {
win_printf_line(window, THEME_ERROR, '-', "Couldn't create tinyurl.");
win_println(window, THEME_ERROR, '-', "Couldn't create tinyurl.");
return TRUE;
}
@ -5137,50 +5137,50 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
if (!args[0]) {
ProfWin *current = wins_get_current();
if (current->type == WIN_MUC) {
win_printf_line(current, THEME_DEFAULT, '-', "");
win_println(current, THEME_DEFAULT, '-', "");
ProfMucWin *mucwin = (ProfMucWin *)current;
win_printf_line(window, THEME_DEFAULT, '!', "Notification settings for %s:", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Notification settings for %s:", mucwin->roomjid);
if (prefs_has_room_notify(mucwin->roomjid)) {
if (prefs_get_room_notify(mucwin->roomjid)) {
win_printf_line(window, THEME_DEFAULT, '!', " Message : ON");
win_println(window, THEME_DEFAULT, '!', " Message : ON");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Message : OFF");
win_println(window, THEME_DEFAULT, '!', " Message : OFF");
}
} else {
if (prefs_get_boolean(PREF_NOTIFY_ROOM)) {
win_printf_line(window, THEME_DEFAULT, '!', " Message : ON (global setting)");
win_println(window, THEME_DEFAULT, '!', " Message : ON (global setting)");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Message : OFF (global setting)");
win_println(window, THEME_DEFAULT, '!', " Message : OFF (global setting)");
}
}
if (prefs_has_room_notify_mention(mucwin->roomjid)) {
if (prefs_get_room_notify_mention(mucwin->roomjid)) {
win_printf_line(window, THEME_DEFAULT, '!', " Mention : ON");
win_println(window, THEME_DEFAULT, '!', " Mention : ON");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Mention : OFF");
win_println(window, THEME_DEFAULT, '!', " Mention : OFF");
}
} else {
if (prefs_get_boolean(PREF_NOTIFY_ROOM_MENTION)) {
win_printf_line(window, THEME_DEFAULT, '!', " Mention : ON (global setting)");
win_println(window, THEME_DEFAULT, '!', " Mention : ON (global setting)");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Mention : OFF (global setting)");
win_println(window, THEME_DEFAULT, '!', " Mention : OFF (global setting)");
}
}
if (prefs_has_room_notify_trigger(mucwin->roomjid)) {
if (prefs_get_room_notify_trigger(mucwin->roomjid)) {
win_printf_line(window, THEME_DEFAULT, '!', " Triggers : ON");
win_println(window, THEME_DEFAULT, '!', " Triggers : ON");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Triggers : OFF");
win_println(window, THEME_DEFAULT, '!', " Triggers : OFF");
}
} else {
if (prefs_get_boolean(PREF_NOTIFY_ROOM_TRIGGER)) {
win_printf_line(window, THEME_DEFAULT, '!', " Triggers : ON (global setting)");
win_println(window, THEME_DEFAULT, '!', " Triggers : ON (global setting)");
} else {
win_printf_line(window, THEME_DEFAULT, '!', " Triggers : OFF (global setting)");
win_println(window, THEME_DEFAULT, '!', " Triggers : OFF (global setting)");
}
}
win_printf_line(current, THEME_DEFAULT, '-', "");
win_println(current, THEME_DEFAULT, '-', "");
} else {
cons_show("");
cons_notify_setting();
@ -5394,7 +5394,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify(mucwin->roomjid, TRUE);
win_printf_line(window, THEME_DEFAULT, '!', "Notifications enabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Notifications enabled for %s", mucwin->roomjid);
}
}
} else if (g_strcmp0(args[0], "off") == 0) {
@ -5409,7 +5409,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify(mucwin->roomjid, FALSE);
win_printf_line(window, THEME_DEFAULT, '!', "Notifications disabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Notifications disabled for %s", mucwin->roomjid);
}
}
} else if (g_strcmp0(args[0], "mention") == 0) {
@ -5425,7 +5425,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify_mention(mucwin->roomjid, TRUE);
win_printf_line(window, THEME_DEFAULT, '!', "Mention notifications enabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Mention notifications enabled for %s", mucwin->roomjid);
}
} else if (g_strcmp0(args[1], "off") == 0) {
ProfWin *window = wins_get_current();
@ -5434,7 +5434,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify_mention(mucwin->roomjid, FALSE);
win_printf_line(window, THEME_DEFAULT, '!', "Mention notifications disabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Mention notifications disabled for %s", mucwin->roomjid);
}
} else {
cons_bad_cmd_usage(command);
@ -5453,7 +5453,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify_trigger(mucwin->roomjid, TRUE);
win_printf_line(window, THEME_DEFAULT, '!', "Custom trigger notifications enabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Custom trigger notifications enabled for %s", mucwin->roomjid);
}
} else if (g_strcmp0(args[1], "off") == 0) {
ProfWin *window = wins_get_current();
@ -5462,7 +5462,7 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
} else {
ProfMucWin *mucwin = (ProfMucWin*)window;
prefs_set_room_notify_trigger(mucwin->roomjid, FALSE);
win_printf_line(window, THEME_DEFAULT, '!', "Custom trigger notifications disabled for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Custom trigger notifications disabled for %s", mucwin->roomjid);
}
} else {
cons_bad_cmd_usage(command);
@ -5481,9 +5481,9 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
ProfMucWin *mucwin = (ProfMucWin*)window;
gboolean res = prefs_reset_room_notify(mucwin->roomjid);
if (res) {
win_printf_line(window, THEME_DEFAULT, '!', "Notification settings set to global defaults for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "Notification settings set to global defaults for %s", mucwin->roomjid);
} else {
win_printf_line(window, THEME_DEFAULT, '!', "No custom notification settings for %s", mucwin->roomjid);
win_println(window, THEME_DEFAULT, '!', "No custom notification settings for %s", mucwin->roomjid);
}
}
}

View File

@ -442,7 +442,7 @@ sv_ev_incoming_message(char *barejid, char *resource, char *message, char *pgp_m
#ifdef HAVE_LIBGPGME
if (pgp_message) {
if (chatwin->is_otr) {
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '-', "PGP encrypted message received whilst in OTR session.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, '-', "PGP encrypted message received whilst in OTR session.");
} else { // PROF_ENC_NONE, PROF_ENC_PGP
_sv_ev_incoming_pgp(chatwin, new_win, barejid, resource, message, pgp_message, timestamp);
}

View File

@ -352,14 +352,14 @@ otr_on_message_send(ProfChatWin *chatwin, const char *const message, gboolean re
free(id);
return TRUE;
} else {
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to encrypt and send message.");
win_println((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to encrypt and send message.");
return TRUE;
}
}
// show error if not secure and policy always
if (policy == PROF_OTRPOLICY_ALWAYS) {
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to send message. OTR policy set to: always");
win_println((ProfWin*)chatwin, THEME_ERROR, '-', "%s", "Failed to send message. OTR policy set to: always");
return TRUE;
}

View File

@ -85,7 +85,7 @@ api_cons_show_themed(const char *const group, const char *const key, const char
char *parsed = str_replace(message, "\r\n", "\n");
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *console = wins_get_console();
win_printf_line(console, themeitem, '-', "%s", parsed);
win_println(console, themeitem, '-', "%s", parsed);
free(parsed);
@ -368,7 +368,7 @@ api_win_show(const char *tag, const char *line)
}
ProfWin *window = (ProfWin*)pluginwin;
win_printf_line(window, THEME_DEFAULT, '!', "%s", line);
win_println(window, THEME_DEFAULT, '!', "%s", line);
return 1;
}
@ -393,7 +393,7 @@ api_win_show_themed(const char *tag, const char *const group, const char *const
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *window = (ProfWin*)pluginwin;
win_printf_line(window, themeitem, '!', "%s", line);
win_println(window, themeitem, '!', "%s", line);
return 1;
}

View File

@ -96,9 +96,9 @@ chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted)
ProfWin *window = (ProfWin*) chatwin;
if (trusted) {
win_printf_line(window, THEME_OTR_STARTED_TRUSTED, '!', "OTR session started (trusted).");
win_println(window, THEME_OTR_STARTED_TRUSTED, '!', "OTR session started (trusted).");
} else {
win_printf_line(window, THEME_OTR_STARTED_UNTRUSTED, '!', "OTR session started (untrusted).");
win_println(window, THEME_OTR_STARTED_UNTRUSTED, '!', "OTR session started (untrusted).");
}
if (wins_is_current(window)) {
@ -125,7 +125,7 @@ chatwin_otr_unsecured(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_printf_line(window, THEME_OTR_ENDED, '!', "OTR session ended.");
win_println(window, THEME_OTR_ENDED, '!', "OTR session ended.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -138,41 +138,41 @@ chatwin_otr_smp_event(ProfChatWin *chatwin, prof_otr_smp_event_t event, void *da
switch (event) {
case PROF_OTR_SMP_INIT:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
"%s wants to authenticate your identity, use '/otr secret <secret>'.", chatwin->barejid);
break;
case PROF_OTR_SMP_INIT_Q:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
"%s wants to authenticate your identity with the following question:", chatwin->barejid);
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', " %s", (char*)data);
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "use '/otr answer <answer>'.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', " %s", (char*)data);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "use '/otr answer <answer>'.");
break;
case PROF_OTR_SMP_SENDER_FAIL:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
"Authentication failed, the secret you entered does not match the secret entered by %s.",
chatwin->barejid);
break;
case PROF_OTR_SMP_RECEIVER_FAIL:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!',
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!',
"Authentication failed, the secret entered by %s does not match yours.", chatwin->barejid);
break;
case PROF_OTR_SMP_ABORT:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "SMP session aborted.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "SMP session aborted.");
break;
case PROF_OTR_SMP_SUCCESS:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authentication successful.");
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authentication successful.");
break;
case PROF_OTR_SMP_SUCCESS_Q:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s successfully authenticated you.", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s successfully authenticated you.", chatwin->barejid);
break;
case PROF_OTR_SMP_FAIL_Q:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s failed to authenticate you.", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "%s failed to authenticate you.", chatwin->barejid);
break;
case PROF_OTR_SMP_AUTH:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authenticating %s...", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Authenticating %s...", chatwin->barejid);
break;
case PROF_OTR_SMP_AUTH_WAIT:
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '!', "Awaiting authentication from %s...", chatwin->barejid);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "Awaiting authentication from %s...", chatwin->barejid);
break;
default:
break;
@ -188,7 +188,7 @@ chatwin_otr_trust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin;
win_printf_line(window, THEME_OTR_TRUSTED, '!', "OTR session trusted.");
win_println(window, THEME_OTR_TRUSTED, '!', "OTR session trusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -203,7 +203,7 @@ chatwin_otr_untrust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_printf_line(window, THEME_OTR_UNTRUSTED, '!', "OTR session untrusted.");
win_println(window, THEME_OTR_UNTRUSTED, '!', "OTR session untrusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -227,7 +227,7 @@ chatwin_recipient_gone(ProfChatWin *chatwin)
display_usr = chatwin->barejid;
}
win_printf_line((ProfWin*)chatwin, THEME_GONE, '!', "<- %s has left the conversation.", display_usr);
win_println((ProfWin*)chatwin, THEME_GONE, '!', "<- %s has left the conversation.", display_usr);
}
void
@ -405,7 +405,7 @@ _chatwin_history(ProfChatWin *chatwin, const char *const contact)
g_date_time_unref(timestamp);
// header
} else {
win_printf_line((ProfWin*)chatwin, THEME_DEFAULT, '-', "%s", curr->data);
win_println((ProfWin*)chatwin, THEME_DEFAULT, '-', "%s", curr->data);
}
curr = g_slist_next(curr);
}

View File

@ -67,7 +67,7 @@ void
cons_show_time(void)
{
ProfWin *console = wins_get_console();
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", "");
win_print(console, THEME_DEFAULT, '-', "");
}
void
@ -86,7 +86,7 @@ cons_debug(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_printf_line(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
win_println(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
@ -100,7 +100,7 @@ cons_show(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_printf_line(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
win_println(console, THEME_DEFAULT, '-', "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
@ -124,8 +124,8 @@ cons_show_help(const char *const cmd, CommandHelp *help)
ProfWin *console = wins_get_console();
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "%s", &cmd[1]);
win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", "");
win_println(console, THEME_WHITE_BOLD, '-', "%s", &cmd[1]);
win_print(console, THEME_WHITE_BOLD, '-', "");
int i;
for (i = 0; i < strlen(cmd) - 1 ; i++) {
win_printf(console, '-', 0, NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-");
@ -133,12 +133,12 @@ cons_show_help(const char *const cmd, CommandHelp *help)
win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", "");
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "Synopsis");
win_println(console, THEME_WHITE_BOLD, '-', "Synopsis");
ui_show_lines(console, help->synopsis);
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "Description");
win_printf_line(console, THEME_DEFAULT, '-', "%s", help->desc);
win_println(console, THEME_WHITE_BOLD, '-', "Description");
win_println(console, THEME_DEFAULT, '-', "%s", help->desc);
int maxlen = 0;
for (i = 0; help->args[i][0] != NULL; i++) {
@ -148,7 +148,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (i > 0) {
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "Arguments");
win_println(console, THEME_WHITE_BOLD, '-', "Arguments");
for (i = 0; help->args[i][0] != NULL; i++) {
win_printf(console, '-', maxlen + 3, NULL, 0, THEME_DEFAULT, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
}
@ -156,7 +156,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (g_strv_length((gchar**)help->examples) > 0) {
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "Arguments");
win_println(console, THEME_WHITE_BOLD, '-', "Arguments");
ui_show_lines(console, help->examples);
}
}
@ -181,7 +181,7 @@ cons_show_error(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_printf_line(console, THEME_ERROR, '-', "%s", fmt_msg->str);
win_println(console, THEME_ERROR, '-', "%s", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
@ -296,7 +296,7 @@ cons_show_typing(const char *const barejid)
display_usr = barejid;
}
win_printf_line(console, THEME_TYPING, '-', "!! %s is typing a message...", display_usr);
win_println(console, THEME_TYPING, '-', "!! %s is typing a message...", display_usr);
cons_alert();
}
@ -333,27 +333,27 @@ cons_show_incoming_room_message(const char *const nick, const char *const room,
if (g_strcmp0(muc_show, "all") == 0) {
if (mention) {
win_printf_line(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
} else if (triggers) {
char *triggers_str = _room_triggers_to_string(triggers);
win_printf_line(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
win_println(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
free(triggers_str);
} else {
win_printf_line(console, THEME_INCOMING, '-', "<< room message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, '-', "<< room message: %s in %s (win %d)", nick, room, ui_index);
}
cons_alert();
} else if (g_strcmp0(muc_show, "first") == 0) {
if (mention) {
win_printf_line(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_MENTION, '-', "<< room mention: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
} else if (triggers) {
char *triggers_str = _room_triggers_to_string(triggers);
win_printf_line(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
win_println(console, THEME_TRIGGER, '-', "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index);
free(triggers_str);
cons_alert();
} else if (unread == 0) {
win_printf_line(console, THEME_INCOMING, '-', "<< room message: %s (win %d)", room, ui_index);
win_println(console, THEME_INCOMING, '-', "<< room message: %s (win %d)", room, ui_index);
cons_alert();
}
}
@ -372,10 +372,10 @@ cons_show_incoming_message(const char *const short_from, const int win_index, in
char *chat_show = prefs_get_string(PREF_CONSOLE_CHAT);
if (g_strcmp0(chat_show, "all") == 0) {
win_printf_line(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
win_println(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
cons_alert();
} else if ((g_strcmp0(chat_show, "first") == 0) && unread == 0) {
win_printf_line(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
win_println(console, THEME_INCOMING, '-', "<< chat message: %s (win %d)", short_from, ui_index);
cons_alert();
}
@ -394,10 +394,10 @@ cons_show_incoming_private_message(const char *const nick, const char *const roo
char *priv_show = prefs_get_string(PREF_CONSOLE_PRIVATE);
if (g_strcmp0(priv_show, "all") == 0) {
win_printf_line(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
} else if ((g_strcmp0(priv_show, "first") == 0) && unread == 0) {
win_printf_line(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
win_println(console, THEME_INCOMING, '-', "<< private message: %s in %s (win %d)", nick, room, ui_index);
cons_alert();
}
@ -417,23 +417,23 @@ cons_about(void)
if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
win_printf_line(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
win_println(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
win_printf_line(console, THEME_DEFAULT, "Welcome to Profanity, version %sdev", PACKAGE_VERSION);
win_println(console, THEME_DEFAULT, "Welcome to Profanity, version %sdev", PACKAGE_VERSION);
#endif
} else {
win_printf_line(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %s", PACKAGE_VERSION);
win_println(console, THEME_DEFAULT, '-', "Welcome to Profanity, version %s", PACKAGE_VERSION);
}
}
win_printf_line(console, THEME_DEFAULT, '-', "Copyright (C) 2012 - 2016 James Booth <%s>.", PACKAGE_BUGREPORT);
win_printf_line(console, THEME_DEFAULT, '-', "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>");
win_printf_line(console, THEME_DEFAULT, '-', "");
win_printf_line(console, THEME_DEFAULT, '-', "This is free software; you are free to change and redistribute it.");
win_printf_line(console, THEME_DEFAULT, '-', "There is NO WARRANTY, to the extent permitted by law.");
win_printf_line(console, THEME_DEFAULT, '-', "");
win_printf_line(console, THEME_DEFAULT, '-', "Type '/help' to show complete help.");
win_printf_line(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "Copyright (C) 2012 - 2016 James Booth <%s>.", PACKAGE_BUGREPORT);
win_println(console, THEME_DEFAULT, '-', "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "This is free software; you are free to change and redistribute it.");
win_println(console, THEME_DEFAULT, '-', "There is NO WARRANTY, to the extent permitted by law.");
win_println(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "Type '/help' to show complete help.");
win_println(console, THEME_DEFAULT, '-', "");
if (prefs_get_boolean(PREF_VERCHECK)) {
cons_check_version(FALSE);
@ -455,13 +455,13 @@ cons_check_version(gboolean not_available_msg)
if (relase_valid) {
if (release_is_new(latest_release)) {
win_printf_line(console, THEME_DEFAULT, '-', "A new version of Profanity is available: %s", latest_release);
win_printf_line(console, THEME_DEFAULT, '-', "Check <http://www.profanity.im> for details.");
win_printf_line(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "A new version of Profanity is available: %s", latest_release);
win_println(console, THEME_DEFAULT, '-', "Check <http://www.profanity.im> for details.");
win_println(console, THEME_DEFAULT, '-', "");
} else {
if (not_available_msg) {
win_printf_line(console, THEME_DEFAULT, '-', "No new version available.");
win_printf_line(console, THEME_DEFAULT, '-', "");
win_println(console, THEME_DEFAULT, '-', "No new version available.");
win_println(console, THEME_DEFAULT, '-', "");
}
}
@ -475,7 +475,7 @@ void
cons_show_login_success(ProfAccount *account, gboolean secured)
{
ProfWin *console = wins_get_console();
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", "%s logged in successfully, ", account->jid);
win_print(console, THEME_DEFAULT, '-', "%s logged in successfully, ", account->jid);
resource_presence_t presence = accounts_get_login_presence(account->name);
const char *presence_str = string_from_resource_presence(presence);
@ -509,7 +509,7 @@ cons_show_wins(gboolean unread)
GSList *curr = window_strings;
while (curr) {
win_printf_line(console, THEME_DEFAULT, '-', "%s", curr->data);
win_println(console, THEME_DEFAULT, '-', "%s", curr->data);
curr = g_slist_next(curr);
}
g_slist_free_full(window_strings, free);
@ -554,13 +554,13 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
const char *resource_presence = string_from_resource_presence(presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid);
win_print(console, presence_colour, '-', "%s", fulljid);
win_printf(console, '-', 0, NULL, NO_DATE, THEME_DEFAULT, "", ":");
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", "Identity: ");
win_print(console, THEME_DEFAULT, '-', "Identity: ");
if (identity->name) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", "%s", identity->name);
if (identity->category || identity->type) {
@ -582,7 +582,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
if (caps->software_version) {
SoftwareVersion *software_version = caps->software_version;
if (software_version->software) {
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", "Software: %s", software_version->software);
win_print(console, THEME_DEFAULT, '-', "Software: %s", software_version->software);
}
if (software_version->software_version) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", %s", software_version->software_version);
@ -591,7 +591,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
win_newline(console);
}
if (software_version->os) {
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", "OS: %s", software_version->os);
win_print(console, THEME_DEFAULT, '-', "OS: %s", software_version->os);
}
if (software_version->os_version) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", %s", software_version->os_version);
@ -602,10 +602,10 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
}
if (caps->features) {
win_printf_line(console, THEME_DEFAULT, '-', "Features:");
win_println(console, THEME_DEFAULT, '-', "Features:");
GSList *feature = caps->features;
while (feature) {
win_printf_line(console, THEME_DEFAULT, '-', " %s", feature->data);
win_println(console, THEME_DEFAULT, '-', " %s", feature->data);
feature = g_slist_next(feature);
}
}
@ -667,7 +667,7 @@ cons_show_room_list(GSList *rooms, const char *const conference_node)
cons_show("Chat rooms at %s:", conference_node);
while (rooms) {
DiscoItem *room = rooms->data;
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", " %s", room->jid);
win_print(console, THEME_DEFAULT, '-', " %s", room->jid);
if (room->name) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", (%s)", room->name);
}
@ -701,7 +701,7 @@ cons_show_bookmarks(const GList *list)
if (muc_active(item->barejid)) {
presence_colour = THEME_ONLINE;
}
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s", item->barejid);
win_print(console, presence_colour, '-', " %s", item->barejid);
if (item->nick) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick);
}
@ -784,7 +784,7 @@ cons_show_disco_items(GSList *items, const char *const jid)
cons_show("Service discovery items for %s:", jid);
while (items) {
DiscoItem *item = items->data;
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", " %s", item->jid);
win_print(console, THEME_DEFAULT, '-', " %s", item->jid);
if (item->name) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", (%s)", item->name);
}
@ -863,7 +863,7 @@ cons_show_account_list(gchar **accounts)
(g_strcmp0(session_get_account_name(), accounts[i]) == 0)) {
resource_presence_t presence = accounts_get_last_presence(accounts[i]);
theme_item_t presence_colour = theme_main_presence_attrs(string_from_resource_presence(presence));
win_printf_line(console, presence_colour, '-', "%s", accounts[i]);
win_println(console, presence_colour, '-', "%s", accounts[i]);
} else {
cons_show(accounts[i]);
}
@ -982,7 +982,7 @@ cons_show_account(ProfAccount *account)
GList *curr = resources;
if (curr) {
win_printf_line(console, THEME_DEFAULT, '-', "Resources:");
win_println(console, THEME_DEFAULT, '-', "Resources:");
// sort in order of availability
while (curr) {
@ -1000,7 +1000,7 @@ cons_show_account(ProfAccount *account)
Resource *resource = curr->data;
const char *resource_presence = string_from_resource_presence(resource->presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence);
win_print(console, presence_colour, '-', " %s (%d), %s", resource->name, resource->priority, resource_presence);
if (resource->status) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status);
@ -1014,7 +1014,7 @@ cons_show_account(ProfAccount *account)
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", " Identity: ");
win_print(console, THEME_DEFAULT, '-', " Identity: ");
if (identity->name) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", "%s", identity->name);
if (identity->category || identity->type) {
@ -1036,7 +1036,7 @@ cons_show_account(ProfAccount *account)
if (caps->software_version) {
SoftwareVersion *software_version = caps->software_version;
if (software_version->software) {
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", " Software: %s", software_version->software);
win_print(console, THEME_DEFAULT, '-', " Software: %s", software_version->software);
}
if (software_version->software_version) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", %s", software_version->software_version);
@ -1045,7 +1045,7 @@ cons_show_account(ProfAccount *account)
win_newline(console);
}
if (software_version->os) {
win_printf(console, '-', 0, NULL, NO_EOL, THEME_DEFAULT, "", " OS: %s", software_version->os);
win_print(console, THEME_DEFAULT, '-', " OS: %s", software_version->os);
}
if (software_version->os_version) {
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, THEME_DEFAULT, "", ", %s", software_version->os_version);
@ -2078,7 +2078,7 @@ cons_navigation_help(void)
{
ProfWin *console = wins_get_console();
cons_show("");
win_printf_line(console, THEME_WHITE_BOLD, '-', "Navigation");
win_println(console, THEME_WHITE_BOLD, '-', "Navigation");
cons_show("Alt-1..Alt-0, F1..F10 : Choose window.");
cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window.");
cons_show("PAGEUP, PAGEDOWN : Page the main window.");
@ -2184,7 +2184,7 @@ _cons_theme_bar_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop);
win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", "%s", propstr->str);
win_print(console, THEME_TEXT, '-', "%s", propstr->str);
g_string_free(propstr, TRUE);
GString *valstr = g_string_new(" ");
@ -2203,7 +2203,7 @@ _cons_theme_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop);
win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", "%s", propstr->str);
win_print(console, THEME_TEXT, '-', "%s", propstr->str);
g_string_free(propstr, TRUE);
GString *valstr = g_string_new("");
@ -2325,22 +2325,31 @@ cons_theme_colours(void)
ProfWin *console = wins_get_console();
cons_show("Available colours:");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE, "", " white ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_GREEN, "", " green ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_RED, "", " red ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_YELLOW, "", " yellow ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLUE, "", " blue ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_CYAN, "", " cyan ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_MAGENTA, "", " magenta ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLACK, "", " black ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black");
win_print(console, THEME_WHITE, '-', " white ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white");
win_print(console, THEME_GREEN, '-', " green ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green");
win_print(console, THEME_RED, '-', " red ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red");
win_print(console, THEME_YELLOW, '-', " yellow ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow");
win_print(console, THEME_BLUE, '-', " blue ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue");
win_print(console, THEME_CYAN, '-', " cyan ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan");
win_print(console, THEME_MAGENTA, '-', " magenta ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta");
win_print(console, THEME_BLACK, '-', " black ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black");
cons_show("");
}
@ -2348,25 +2357,25 @@ static void
_cons_splash_logo(void)
{
ProfWin *console = wins_get_console();
win_printf_line(console, THEME_DEFAULT, '-', "Welcome to");
win_println(console, THEME_DEFAULT, '-', "Welcome to");
win_printf_line(console, THEME_SPLASH, '-', " ___ _ ");
win_printf_line(console, THEME_SPLASH, '-', " / __) (_)_ ");
win_printf_line(console, THEME_SPLASH, '-', " ____ ____ ___ | |__ ____ ____ _| |_ _ _ ");
win_printf_line(console, THEME_SPLASH, '-', "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |");
win_printf_line(console, THEME_SPLASH, '-', "| | | | | | |_| | | ( ( | | | | | | |_| |_| |");
win_printf_line(console, THEME_SPLASH, '-', "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |");
win_printf_line(console, THEME_SPLASH, '-', "|_| (____/ ");
win_printf_line(console, THEME_SPLASH, '-', "");
win_println(console, THEME_SPLASH, '-', " ___ _ ");
win_println(console, THEME_SPLASH, '-', " / __) (_)_ ");
win_println(console, THEME_SPLASH, '-', " ____ ____ ___ | |__ ____ ____ _| |_ _ _ ");
win_println(console, THEME_SPLASH, '-', "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |");
win_println(console, THEME_SPLASH, '-', "| | | | | | |_| | | ( ( | | | | | | |_| |_| |");
win_println(console, THEME_SPLASH, '-', "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |");
win_println(console, THEME_SPLASH, '-', "|_| (____/ ");
win_println(console, THEME_SPLASH, '-', "");
if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
win_printf_line(console, THEME_DEFAULT, '-', "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
win_println(console, THEME_DEFAULT, '-', "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
win_printf_line(console, THEME_DEFAULT, "Version %sdev", PACKAGE_VERSION);
win_println(console, THEME_DEFAULT, "Version %sdev", PACKAGE_VERSION);
#endif
} else {
win_printf_line(console, THEME_DEFAULT, '-', "Version %s", PACKAGE_VERSION);
win_println(console, THEME_DEFAULT, '-', "Version %s", PACKAGE_VERSION);
}
}
@ -2393,7 +2402,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
} else {
presence_colour = theme_main_presence_attrs("offline");
}
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", title->str);
win_print(console, presence_colour, '-', "%s", title->str);
g_string_free(title, TRUE);

View File

@ -413,19 +413,19 @@ ui_handle_recipient_error(const char *const recipient, const char *const err_msg
ProfChatWin *chatwin = wins_get_chat(recipient);
if (chatwin) {
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
win_println((ProfWin*)chatwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
return;
}
ProfMucWin *mucwin = wins_get_muc(recipient);
if (mucwin) {
win_printf_line((ProfWin*)mucwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
win_println((ProfWin*)mucwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
return;
}
ProfPrivateWin *privatewin = wins_get_private(recipient);
if (privatewin) {
win_printf_line((ProfWin*)privatewin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
win_println((ProfWin*)privatewin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
return;
}
}
@ -435,7 +435,7 @@ ui_handle_otr_error(const char *const barejid, const char *const message)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '!', "%s", message);
win_println((ProfWin*)chatwin, THEME_ERROR, '!', "%s", message);
} else {
cons_show_error("%s - %s", barejid, message);
}
@ -739,7 +739,7 @@ ui_current_print_line(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_printf_line(window, THEME_DEFAULT, '-', "%s", fmt_msg->str);
win_println(window, THEME_DEFAULT, '-', "%s", fmt_msg->str);
va_end(arg);
g_string_free(fmt_msg, TRUE);
}
@ -752,7 +752,7 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char *con
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_printf_line(current, attrs, show_char, "%s", fmt_msg->str);
win_println(current, attrs, show_char, "%s", fmt_msg->str);
va_end(arg);
g_string_free(fmt_msg, TRUE);
}
@ -777,7 +777,7 @@ ui_print_system_msg_from_recipient(const char *const barejid, const char *messag
}
}
win_printf_line(window, THEME_DEFAULT, '-', "*%s %s", barejid, message);
win_println(window, THEME_DEFAULT, '-', "*%s %s", barejid, message);
}
void
@ -789,7 +789,7 @@ ui_room_join(const char *const roomjid, gboolean focus)
}
char *nick = muc_nick(roomjid);
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "-> You have joined the room as %s", nick);
win_print(window, THEME_ROOMINFO, '!', "-> You have joined the room as %s", nick);
if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
char *role = muc_role_str(roomjid);
char *affiliation = muc_affiliation_str(roomjid);
@ -810,7 +810,7 @@ ui_room_join(const char *const roomjid, gboolean focus)
status_bar_active(num);
ProfWin *console = wins_get_console();
char *nick = muc_nick(roomjid);
win_printf_line(console, THEME_TYPING, '!', "-> Autojoined %s as %s (%d).", roomjid, nick, num);
win_println(console, THEME_TYPING, '!', "-> Autojoined %s as %s (%d).", roomjid, nick, num);
}
GList *privwins = wins_get_private_chats(roomjid);
@ -885,16 +885,16 @@ ui_room_destroyed(const char *const roomjid, const char *const reason, const cha
ProfWin *console = wins_get_console();
if (reason) {
win_printf_line(console, THEME_TYPING, '!', "<- Room destroyed: %s, reason: %s", roomjid, reason);
win_println(console, THEME_TYPING, '!', "<- Room destroyed: %s, reason: %s", roomjid, reason);
} else {
win_printf_line(console, THEME_TYPING, '!', "<- Room destroyed: %s", roomjid);
win_println(console, THEME_TYPING, '!', "<- Room destroyed: %s", roomjid);
}
if (new_jid) {
if (password) {
win_printf_line(console, THEME_TYPING, '!', "Replacement room: %s, password: %s", new_jid, password);
win_println(console, THEME_TYPING, '!', "Replacement room: %s, password: %s", new_jid, password);
} else {
win_printf_line(console, THEME_TYPING, '!', "Replacement room: %s", new_jid);
win_println(console, THEME_TYPING, '!', "Replacement room: %s", new_jid);
}
}
}
@ -931,7 +931,7 @@ ui_room_kicked(const char *const roomjid, const char *const actor, const char *c
}
ProfWin *console = wins_get_console();
win_printf_line(console, THEME_TYPING, '!', "<- %s", message->str);
win_println(console, THEME_TYPING, '!', "<- %s", message->str);
g_string_free(message, TRUE);
}
@ -967,7 +967,7 @@ ui_room_banned(const char *const roomjid, const char *const actor, const char *c
}
ProfWin *console = wins_get_console();
win_printf_line(console, THEME_TYPING, '!', "<- %s", message->str);
win_println(console, THEME_TYPING, '!', "<- %s", message->str);
g_string_free(message, TRUE);
}
@ -1012,16 +1012,16 @@ ui_ask_pgp_passphrase(const char *hint, int prev_fail)
{
ProfWin *current = wins_get_current();
win_printf_line(current, THEME_DEFAULT, '-', "");
win_println(current, THEME_DEFAULT, '-', "");
if (prev_fail) {
win_printf_line(current, THEME_DEFAULT, '!', "Incorrect passphrase");
win_println(current, THEME_DEFAULT, '!', "Incorrect passphrase");