ContactListWidget::ContactListWidget(QWidget *parent) : QListWidget(parent) { addcontactAct = new QAction(tr("&Add Contact..."), this); addcontactAct->setStatusTip(tr("add new contact")); connect(addcontactAct,SIGNAL(triggered()),this,SLOT(add_contact())); delcontactAct = new QAction(tr("&Delete Contact"),this); connect(delcontactAct,SIGNAL(triggered()),this,SLOT(del_contact())); startchatAct = new QAction(tr("Start &Chat"), this); connect(startchatAct, SIGNAL(triggered()), this, SLOT(start_chat())); viewcertAct = new QAction(tr("&View Certificate"), this); connect(viewcertAct, SIGNAL(triggered()), this, SLOT(view_cert())); showidAct = new QAction(tr("Show Pica Pica &ID"), this); connect(showidAct, SIGNAL(triggered()), this, SLOT(show_id())); sendfileAct = new QAction(tr("Send &File"), this); connect(sendfileAct, SIGNAL(triggered()), this, SLOT(send_file())); connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(start_chat())); setContactsStorage(new Contacts(config_dbname, Accounts::GetCurrentAccount().id)); }
void show_continue(is_continue* node) { printf("continue"); if (node->label) { printf(" "); show_id(node->label); } }
void show_break(is_break* node) { printf("break"); if (node->label) { printf(" "); show_id(node->label); } }
void show_class_def(is_class_def* node, int tablevel) { tab(tablevel); printf("class "); show_id(node->id); printf("\n"); tab(tablevel); printf("{\n"); show_class_stmt_list(node->body, tablevel+1); tab(tablevel); printf("}\n"); }
void show_var_def_left(is_var_def_left* node) { show_id(node->id); switch (node->type) { case t_var_def_left_empty: show_dims_empty_list(node->data.empty); break; case t_var_def_left_dims: show_dims(node->data.dims); break; } }
void show_func_def(is_func_def* node, int tablevel) { show_type_decl(node->type); printf(" "); show_id(node->id); show_func_def_args(node->args); printf("\n"); tab(tablevel); printf("{\n"); show_stmt_list(node->body, tablevel+1); tab(tablevel); printf("}\n"); }
void show_var(is_var* node) { switch (node->type) { case t_var_id: show_id(node->data.id); break; case t_var_new_op: show_new_op(node->data.new_op); break; case t_var_array: show_var(node->data.array.var); show_dims_sized(node->data.array.dims); break; case t_var_func_call: show_func_call(node->data.func_call.call); show_dims_sized(node->data.func_call.dims); break; } }
void show_loop_stmt(is_loop_stmt* node, int tablevel) { if (node->loop_label) { show_id(node->loop_label); printf(": "); } switch (node->type) { case t_loop_stmt_for: show_for(node->data.for_stmt, tablevel); break; case t_loop_stmt_while: show_while(node->data.while_stmt, tablevel); break; case t_loop_stmt_do_while: show_do_while(node->data.do_while_stmt, tablevel); break; } }
void show_func_def_arg(is_func_def_arg* node) { show_type_decl(node->type); printf(" "); show_id(node->id); }
void show_func_call(is_func_call* node) { show_id(node->id); show_func_call_arg_list(node->args); }