diff options
author | James Booth <boothj5@gmail.com> | 2014-07-20 23:57:31 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-07-20 23:57:31 +0100 |
commit | f4fa0bc2dd742083f00ef98051e98d892a906dd6 (patch) | |
tree | 44ae23477c65f1ca25b51c2a9e98681846ffe4be /src/ui | |
parent | 490e252fb401a0fb067022693ef709595648c569 (diff) | |
download | profani-tty-f4fa0bc2dd742083f00ef98051e98d892a906dd6.tar.gz |
Added win_save_newline
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.c | 16 | ||||
-rw-r--r-- | src/ui/core.c | 4 | ||||
-rw-r--r-- | src/ui/window.c | 14 | ||||
-rw-r--r-- | src/ui/window.h | 1 |
4 files changed, 21 insertions, 14 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index b80de834..bec7e1b7 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -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); } } } diff --git a/src/ui/core.c b/src/ui/core.c index 931fedd4..32dfaf11 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -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); } } diff --git a/src/ui/window.c b/src/ui/window.c index 1c3606b6..23a517af 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -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) diff --git a/src/ui/window.h b/src/ui/window.h index 55ce9ba6..d6dc9e6a 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -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 |