static void sig_roster_show(XMPP_SERVER_REC *server) { GSList *gl, *ul; XMPP_ROSTER_GROUP_REC *group; XMPP_ROSTER_USER_REC *user; g_return_if_fail(IS_XMPP_SERVER(server)); show_begin_of_roster(server); for (gl = server->roster; gl != NULL; gl = gl->next) { group = gl->data; /* don't show groups with only offline users */ for (ul = group->users; ul != NULL && !user_is_shown(ul->data); ul = ul->next); if (ul == NULL) continue; show_group(server, group); for (ul = group->users; ul != NULL; ul = ul->next) { user = ul->data; if (user_is_shown(user)) show_user(server, user); } } printformat_module(MODULE_NAME, server, NULL, MSGLEVEL_CRAP, XMPPTXT_END_OF_ROSTER); }
//MODLOADER G_MODULE_EXPORT void plugin_call(GtkWidget *root) { g_print("------------------------------\n-> SIDE User Plugin loading...\n------------------------------\n"); //notify the user... p_buff = root; box = side_plugin_get_root_box(root); show_user(); }
static int show_stat(const char *path) { int ret; struct stat s; if (access(path, F_OK) < 0) { fprintf(stderr, "path not exists\n"); return -1; } ret = stat(path, &s); if (ret < 0) { perror("stat"); return -1; } show_inode(&s); show_mode(&s); show_user(&s); show_size(&s); show_time(&s); printf(" %s\n", path); return 0; }
GameSession::GameSession() { start = new StartWindow(); center_widget(start); connect(start, SIGNAL(send_user(QString)), this, SLOT(show_user(QString))); }
void debug_list_all_user(){ int i, connfd; char result[MAX_MSG_LEN]; //DEBUG printf("\t~DEBUG:CURRENT USERS:\n"); for (i = 0; i <= p.maxi; i++) { connfd = p.clientfd[i]; if(show_user(result,MAX_MSG_LEN, user_table[connfd])) printf("\t\tID=%d%s", connfd ,result); } }
bool handler__show(globals_t * vars, char **argv, unsigned argc) { USEPARAMS(); if (argv[1] == NULL) { show_error("expecting an argument.\n"); return false; } if (strcmp(argv[1], "copying") == 0) show_user(SM_COPYING); else if (strcmp(argv[1], "warranty") == 0) show_user(SM_WARRANTY); else if (strcmp(argv[1], "version") == 0) printversion(stderr); else { show_error("unrecognized show command `%s`\n", argv[1]); return false; } return true; }
static void user_changed (UmUserManager *um, UmUser *user, UmUserPanelPrivate *d) { GtkTreeView *tv; GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; UmUser *current; GdkPixbuf *pixbuf; char *text; gboolean is_autologin; tv = (GtkTreeView *)get_widget (d, "list-treeview"); model = gtk_tree_view_get_model (tv); selection = gtk_tree_view_get_selection (tv); gtk_tree_model_get_iter_first (model, &iter); do { gtk_tree_model_get (model, &iter, USER_COL, ¤t, -1); if (current == user) { pixbuf = um_user_render_icon (user, TRUE, 48); text = get_name_col_str (user); is_autologin = um_user_get_automatic_login (user); gtk_list_store_set (GTK_LIST_STORE (model), &iter, USER_COL, user, FACE_COL, pixbuf, NAME_COL, text, AUTOLOGIN_COL, is_autologin, -1); g_object_unref (pixbuf); g_free (text); g_object_unref (current); break; } if (current) g_object_unref (current); } while (gtk_tree_model_iter_next (model, &iter)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, USER_COL, ¤t, -1); if (current == user) { show_user (user, d); } if (current) g_object_unref (current); } }
static void selected_user_changed (GtkTreeSelection *selection, UmUserPanelPrivate *d) { GtkTreeModel *model; GtkTreeIter iter; UmUser *user; if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, USER_COL, &user, -1); show_user (user, d); on_permission_changed (d->permission, NULL, d); g_object_unref (user); } }
int show_channel(char* result, int max,channel* c){ int length = 0; length += snprintf(result + length, max - length, "\t\t[CHANNEL %s(%i)]\n",c->name,c->member->element); if(c->member->element > 0){ length += snprintf(result + length, max - length, "\t\t\tMember List:\n"); int_list *temp; char user_info[MAX_MSG_LEN]; for (temp = c->member->next;temp;temp = temp->next){ show_user(user_info, MAX_MSG_LEN ,user_table[temp->element]); length += snprintf(result + length, max - length, "\t\t\t%s\n",user_info); } } return length; }
static void selected_user_changed (GtkTreeSelection *selection, UmUserPanelPrivate *d) { GtkTreeModel *model; GtkTreeIter iter; UmUser *user; if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, USER_COL, &user, -1); show_user (user, d); if (d->permission != NULL) on_permission_changed (d->permission, NULL, d); gtk_widget_set_sensitive (get_widget (d, "main-user-vbox"), TRUE); g_object_unref (user); } else { gtk_widget_set_sensitive (get_widget (d, "main-user-vbox"), FALSE); } }
void check_clients() { int i, connfd; char buf[MAXLINE]; rio_t rio; for (i = 0; (i <= p.maxi) && (p.nready > 0); i++) { connfd = p.clientfd[i]; rio = p.clientrio[i]; if ((connfd > 0) && FD_ISSET(connfd, &p.ready_set)){ p.nready--; if (Rio_readlineb(&rio, buf, MAXLINE) > 0) { get_msg(buf,buf); request_check(i, buf); while( rio.rio_cnt > 0 ){ Rio_readlineb(&rio,buf,MAXLINE); get_msg(buf,buf); request_check(i,buf); } } else{/* EOF detected. User Exit */ //debug char buf[MAX_MSG_LEN]; show_user(buf,MAX_MSG_LEN,user_table[connfd]); printf("!!Exit%s\n", buf); /* do quit command for user at connfd[i] */ quit_command(i); } //debug debug_list_all_user(); debug_list_all_channel(); printf("===================================\n"); } } }
middle7::middle7(QWidget *parent) : QWidget(parent) { //窗口界面布局 QWidget *widget = new QWidget(this); QHBoxLayout *mainlayout= new QHBoxLayout; QVBoxLayout *vlayout1 = new QVBoxLayout; QHBoxLayout *hlayout = new QHBoxLayout; QLabel *label = new QLabel(widget); QImage img; img.load(":images/users.png"); QImage* imgScaled = new QImage; *imgScaled=img.scaled(140,140,Qt::KeepAspectRatio); label->setPixmap(QPixmap::fromImage(*imgScaled)); label->setStyleSheet("QLabel{margin-left:0;margin-top:20px}"); QLineEdit *tip = new QLineEdit("电脑用户:"); tip->setFixedSize(300,80); tip->setStyleSheet("QLineEdit{font-size : 20px;color:gray;background-color:rgb(255,0,0,0);margin-top:20px;margin-right:140px}"); tip->setFrame(false); tip->setReadOnly(true); hlayout->addWidget(label); hlayout->addWidget(tip); //listwidget存放用户 list = new QListWidget(widget); list->setFixedSize(360,360); list->setIconSize(QSize(48,48)); list->setStyleSheet("background-color:rgb(255,0,0,0);border:0px;margin-left:120px;maigin-bottom:40px;"); vlayout1->addLayout(hlayout); vlayout1->addWidget(list); vlayout1->addStretch(0); //定义button QVBoxLayout *vlayout = new QVBoxLayout; QPushButton *user_pushbutton = new QPushButton("刷新/显示"); user_pushbutton->setFixedSize(168,30); user_pushbutton->setStyleSheet("QPushButton{color:green;border: 1px solid green;border-radius:15px;margin-right:40px;}"); QPushButton *add_pushbutton = new QPushButton("添加用户..."); add_pushbutton->setFixedSize(168,30); add_pushbutton->setStyleSheet("QPushButton{color:blue;border: 1px solid blue;border-radius:15px;margin-right:40px;}"); del_pushbutton = new QPushButton("删除用户"); del_pushbutton->setStyleSheet("QPushButton{color:gray;border: 1px solid gray;border-radius:15px;margin-right:40px;}"); del_pushbutton->setFixedSize(168,30); del_pushbutton->setEnabled(false); QPushButton *passwd_pushbutton = new QPushButton("修改密码..."); passwd_pushbutton->setStyleSheet("QPushButton{color:blue;border: 1px solid blue;border-radius:15px;margin-right:40px;}"); passwd_pushbutton->setFixedSize(168,30); black_pushbutton = new QPushButton("加入黑名单"); black_pushbutton->setFixedSize(168,30); black_pushbutton->setStyleSheet("QPushButton{color:gray;border: 1px solid gray;border-radius:15px;margin-right:40px;}"); black_pushbutton->setEnabled(false); delb_pushbutton = new QPushButton("移出黑名单"); delb_pushbutton->setFixedSize(168,30); delb_pushbutton->setEnabled(false); delb_pushbutton->setStyleSheet("QPushButton{color:gray;border: 1px solid gray;border-radius:15px;margin-right:40px;}"); vlayout->addWidget(user_pushbutton); vlayout->addWidget(add_pushbutton); vlayout->addWidget(del_pushbutton); vlayout->addWidget(passwd_pushbutton); vlayout->addWidget(black_pushbutton); vlayout->addWidget(delb_pushbutton); vlayout->setContentsMargins(0,123,80,50); mainlayout->addLayout(vlayout1); mainlayout->addLayout(vlayout); this->setLayout(mainlayout); flag = 0; //添加槽函数,按钮点击触发事件 connect(list,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(blackFunc())); connect(user_pushbutton, SIGNAL(clicked()), this, SLOT(show_user())); connect(add_pushbutton, SIGNAL(clicked()), this, SLOT(add_user())); connect(del_pushbutton, SIGNAL(clicked()), this, SLOT(del_user())); connect(passwd_pushbutton, SIGNAL(clicked()), this, SLOT(passwd_change())); connect(black_pushbutton, SIGNAL(clicked()), this, SLOT(add_black())); connect(delb_pushbutton, SIGNAL(clicked()), this, SLOT(del_black())); //定时器刷新界面 timer = new QTimer(this); QWidget::connect( timer, SIGNAL( timeout() ), this, SLOT( timer_update_currentTabInfo() ) ); timer->start(1000); }
gboolean redraw_user(GtkWidget *widget, GdkEvent *event, gpointer user_data) { g_debug("captured destuction of the User item -> re-create"); show_user(); //draw it again!! return FALSE; }
int main() { unsigned int menu; int quantity; int i; user profile; user blank; user *profiles = NULL; setlocale(LC_ALL, "Portuguese"); system("cls || clear"); system("printf \'\\033[8;45;160t\'"); clean_temps(); sleep(2); system("cls || clear"); interface(); system("cls || clear"); clean_log(); clean_domain_csv(); do { menu_interface(); printf("Escolha uma opção do menu: "); scanf("%u", &menu); while (menu > 5 || menu <= 0) { printf("Opção não reconhecida!!\n"); sleep(2); system("cls || clear"); menu_interface(); printf("Escolha uma opção do menu: "); scanf("%u", &menu); } fflush_in(); switch (menu) { case 1: profile = read_new_user(); sleep(2); system("cls || clear"); printf("Informações do novo usuário: \n"); show_user(profile); make_domain_csv(profile); make_log(profile); fflush_in(); getchar(); system("cls || clear"); break; case 2: printf("Quantos usuários deseja cadastrar?: "); scanf("%d", &quantity); fflush_in(); profiles = malloc(quantity * sizeof(user)); for (i = 0; i < quantity; ++i) { blank = make_blank_user(blank); profiles[i] = blank; } for (i = 0; i < quantity; ++i) { profile = read_new_user(); sleep(2); system("cls || clear"); printf("Informações do novo usuário: \n"); show_user(profile); fflush_in(); profiles[i] = profile; make_domain_csv(profile); make_log(profile); sleep(2); system("cls || clear"); } printf("Listando usuários criados: \n"); for (i = 0; i < quantity; ++i) { show_user(profiles[i]); printf("\n"); } printf("Todos os arquivos dos usuários estão em doc/log.txt!!\n"); printf("Aperte ENTER para continuar a execução"); getchar(); system("cls || clear"); break; case 3: system("cls || clear"); show_register_users(); break; case 4: printf("Terminando a execução...\n"); printf("Obrigado por usar o sistema!!!\n\n"); break; default: printf("Opção não válida!\n"); break; } } while (menu != 4); return 0; }
bool handler__eof(globals_t * vars, char **argv, unsigned argc) { show_user("exit\n"); return handler__exit(vars, argv, argc); }