1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Added win_save_newline

This commit is contained in:
James Booth 2014-07-20 23:57:31 +01:00
parent 490e252fb4
commit f4fa0bc2dd
4 changed files with 21 additions and 14 deletions

View File

@ -352,7 +352,7 @@ _cons_show_caps(const char * const contact, Resource *resource)
if (caps->category != NULL) {
win_save_print(console, '-', NULL, NO_DATE | NO_EOL, 0, "", caps->category);
}
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
if (caps->software != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "Software: %s", caps->software);
@ -361,7 +361,7 @@ _cons_show_caps(const char * const contact, Resource *resource)
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
}
if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
if (caps->os != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "OS: %s", caps->os);
@ -370,7 +370,7 @@ _cons_show_caps(const char * const contact, Resource *resource)
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
}
if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
if (caps->features != NULL) {
@ -469,7 +469,7 @@ _cons_show_room_list(GSList *rooms, const char * const conference_node)
if (room->name != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", room->name);
}
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
rooms = g_slist_next(rooms);
}
} else {
@ -519,7 +519,7 @@ _cons_show_bookmarks(const GList *list)
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (%d)", num);
}
}
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
list = g_list_next(list);
}
@ -824,7 +824,7 @@ _cons_show_account(ProfAccount *account)
if (caps->category != NULL) {
win_save_print(console, '-', NULL, NO_DATE | NO_EOL, 0, "", caps->category);
}
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
if (caps->software != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software);
@ -833,7 +833,7 @@ _cons_show_account(ProfAccount *account)
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
}
if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
if (caps->os != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os);
@ -842,7 +842,7 @@ _cons_show_account(ProfAccount *account)
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
}
if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_print(console, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(console);
}
}
}

View File

@ -1375,7 +1375,7 @@ _ui_duck_result(const char * const result)
gchar *ptr = g_utf8_offset_to_pointer(result, offset);
gunichar unichar = g_utf8_get_char(ptr);
if (unichar == '\n') {
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
win_save_print(window, '-', NULL, NO_EOL, 0, "", "");
} else {
gchar *string = g_ucs4_to_utf8(&unichar, 1, NULL, NULL, NULL);
@ -1388,7 +1388,7 @@ _ui_duck_result(const char * const result)
offset++;
}
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
}
}

View File

@ -219,7 +219,7 @@ win_show_info(ProfWin *window, PContact contact)
if (resource->status != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status);
}
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
if (resource->caps_str != NULL) {
Capabilities *caps = caps_get(resource->caps_str);
@ -242,7 +242,7 @@ win_show_info(ProfWin *window, PContact contact)
if (caps->category != NULL) {
win_save_print(window, '-', NULL, NO_DATE | NO_EOL, 0, "", caps->category);
}
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
}
if (caps->software != NULL) {
win_save_vprint(window, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software);
@ -251,7 +251,7 @@ win_show_info(ProfWin *window, PContact contact)
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
}
if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
}
if (caps->os != NULL) {
win_save_vprint(window, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os);
@ -260,7 +260,7 @@ win_show_info(ProfWin *window, PContact contact)
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
}
if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
win_save_newline(window);
}
}
}
@ -366,6 +366,12 @@ win_save_print(ProfWin *window, const char show_char, GTimeVal *tstamp,
g_free(date_fmt);
}
void
win_save_newline(ProfWin *window)
{
win_save_print(window, '-', NULL, NO_DATE, 0, "", "");
}
static void
_win_print(ProfWin *window, const char show_char, const char * const date_fmt,
int flags, int attrs, const char * const from, const char * const message)

View File

@ -79,6 +79,7 @@ void win_print_incoming_message(ProfWin *window, GTimeVal *tv_stamp,
void win_show_info(ProfWin *window, PContact contact);
void win_save_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, int attrs, const char * const from, const char * const message, ...);
void win_save_print(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, int attrs, const char * const from, const char * const message);
void win_save_newline(ProfWin *window);
void win_redraw(ProfWin *window);
#endif