This commit is contained in:
Jfreegman 2013-08-05 02:32:50 -04:00
parent 3bc7f15fe5
commit e479f338c1
2 changed files with 27 additions and 16 deletions

View File

@ -236,6 +236,7 @@ void print_help(ChatContext* self) {
wprintw(self->history, " /nick <nickname> : Set your nickname\n"); wprintw(self->history, " /nick <nickname> : Set your nickname\n");
wprintw(self->history, " /myid : Print your ID\n"); wprintw(self->history, " /myid : Print your ID\n");
wprintw(self->history, " /clear : Clear the screen\n"); wprintw(self->history, " /clear : Clear the screen\n");
wprintw(self->history, " /close : Closes the current chat window\n");
wprintw(self->history, " /quit or /exit : Exit program\n"); wprintw(self->history, " /quit or /exit : Exit program\n");
wprintw(self->history, " /help : Print this message again\n\n"); wprintw(self->history, " /help : Print this message again\n\n");
@ -264,5 +265,6 @@ ToxWindow new_chat(int friendnum) {
x->friendnum = friendnum; x->friendnum = friendnum;
ret.x = (void*) x; ret.x = (void*) x;
free(x);
return ret; return ret;
} }

View File

@ -337,28 +337,37 @@ void set_active_window(int ch) {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
int ch; int ch;
int i = 0;
int f_flag = 0;
char *filename = "data";
ToxWindow* a; ToxWindow* a;
init_term();
init_tox();
init_window_status();
init_windows();
char *filename = "data";
load_data(filename);
int i;
for(i = 0; i < argc; i++) { for(i = 0; i < argc; i++) {
if(argv[i][0] == '-' && argv[i][1] == 'f') { if (argv[i] == NULL){
break;
} else if(argv[i][0] == '-') {
if(argv[i][1] == 'f') {
if(argv[i + 1] != NULL) if(argv[i + 1] != NULL)
filename = argv[i + 1]; filename = argv[i + 1];
else { else {
f_flag = -1;
}
}
}
}
init_term();
init_tox();
load_data(filename);
init_windows();
if(f_flag == -1) {
attron(COLOR_PAIR(3) | A_BOLD); attron(COLOR_PAIR(3) | A_BOLD);
wprintw(prompt->window, "You passed '-f' without giving an argument!\n" wprintw(prompt->window, "You passed '-f' without giving an argument!\n"
"defaulting to 'data' for a keyfile...\n"); "defaulting to 'data' for a keyfile...\n");
attroff(COLOR_PAIR(3) | A_BOLD); attroff(COLOR_PAIR(3) | A_BOLD);
} }
}
}
while(true) { while(true) {
// Update tox. // Update tox.
do_tox(); do_tox();