about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-10 00:28:39 +0000
committerJames Booth <boothj5@gmail.com>2012-02-10 00:28:39 +0000
commit4a2ff76059ac1952791f0dc0217e0940e4e47808 (patch)
tree8b7cdeeb1e5c2b8d4a0a265e59f028cc0dbeb592
parent2137ffa25a21b5de85c40578940f76b7dbd6307f (diff)
downloadprofani-tty-4a2ff76059ac1952791f0dc0217e0940e4e47808.tar.gz
Small formatting changes
-rw-r--r--Makefile2
-rw-r--r--input_bar.c14
-rw-r--r--input_win.c4
-rw-r--r--profanity.c2
-rw-r--r--windows.c4
-rw-r--r--windows.h4
6 files changed, 25 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index dfcef035..7366a54a 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ profanity: $(OBJS)
 log.o: log.h
 windows.o: windows.h util.h
 title_bar.o: windows.h
-input_bar.o: windows.h
+input_bar.o: windows.h util.h
 input_win.o: windows.h
 jabber.o: jabber.h log.h windows.h
 profanity.o: log.h windows.h jabber.h command.h
diff --git a/input_bar.c b/input_bar.c
index 3d44e69b..a774f4e8 100644
--- a/input_bar.c
+++ b/input_bar.c
@@ -1,5 +1,6 @@
 #include <ncurses.h>
 #include "windows.h"
+#include "util.h"
 
 static WINDOW *inp_bar;
 
@@ -30,7 +31,18 @@ void inp_bar_active(int win)
 
 void inp_bar_print_message(char *msg)
 {
-    mvwprintw(inp_bar, 0, 0, msg);
+    mvwprintw(inp_bar, 0, 9, msg);
     wrefresh(inp_bar);
 }
 
+void inp_bar_update_time(void)
+{
+    char bar_time[8];
+    char tstmp[80];
+    get_time(tstmp);
+    sprintf(bar_time, "[%s]", tstmp);
+
+    mvwprintw(inp_bar, 0, 1, bar_time);
+    wrefresh(inp_bar);
+    inp_put_back();
+}
diff --git a/input_win.c b/input_win.c
index 76ec2829..22154065 100644
--- a/input_win.c
+++ b/input_win.c
@@ -82,3 +82,7 @@ void inp_get_password(char *passwd)
     echo();
 }
 
+void inp_put_back(void)
+{
+    wrefresh(inp_win);
+}
diff --git a/profanity.c b/profanity.c
index 2002810d..d627747a 100644
--- a/profanity.c
+++ b/profanity.c
@@ -57,6 +57,8 @@ static void profanity_event_loop(int *ch, char *cmd, int *size)
 {
     usleep(1);
 
+    inp_bar_update_time();
+
     // handle incoming messages
     jabber_process_events();
 
diff --git a/windows.c b/windows.c
index 161319a4..60c4201a 100644
--- a/windows.c
+++ b/windows.c
@@ -86,7 +86,7 @@ void show_incomming_msg(char *from, char *message)
     char tstmp[80];
     get_time(tstmp);
 
-    sprintf(line, " [%s] %s: %s\n", tstmp, short_from, message);
+    sprintf(line, " [%s] <%s> %s\n", tstmp, short_from, message);
 
     // find the chat window for sender
     int i;
@@ -136,7 +136,7 @@ void show_outgoing_msg(char *from, char *to, char *message)
     char line[100];
     char tstmp[80];
     get_time(tstmp);
-    sprintf(line, " [%s] %s: %s\n", tstmp, from, message);
+    sprintf(line, " [%s] <%s> %s\n", tstmp, from, message);
 
     // find the chat window for recipient
     int i;
diff --git a/windows.h b/windows.h
index a9a20188..038004d7 100644
--- a/windows.h
+++ b/windows.h
@@ -14,16 +14,18 @@ void create_input_bar(void);
 void create_input_window(void);
 
 // input bar actions
+void inp_bar_print_message(char *msg);
 void inp_bar_inactive(int win);
 void inp_bar_active(int win);
+void inp_bar_update_time(void);
 
 // input window actions
 void inp_get_command_str(char *cmd);
 void inp_poll_char(int *ch, char command[], int *size);
 void inp_clear(void);
+void inp_put_back(void);
 void inp_non_block(void);
 void inp_get_password(char *passwd);
-void inp_bar_print_message(char *msg);
 
 void gui_init(void);
 void gui_close(void);