Exemplo n.º 1
0
void MainPage::init(){
    this->man = NULL;
    ToolUtil::initStyle(this);
    IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d), 10);
    IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068), 10);
    IconHelper::Instance()->SetIcon(ui->btnMenu, QChar(0xf0c9), 10);
//    IconHelper::Instance()->Set(ui->lab_Ico, QChar(0xf19c), 12);
    IconHelper::Instance()->SetBackground(ui->lab_Ico, "logo.png");

    main_menu = new MainMenu();
    icon_menu = new IconMenu();

    //信号量注册
    connect(ui->bt_quit,SIGNAL(clicked()),this,SLOT(userLogout()));

    /***********menu slot****************/
    connect(main_menu,SIGNAL(setting()),this,SLOT(menuSetting()));
    connect(main_menu,SIGNAL(aboutus()),this,SLOT(menuAboutus()));

    connect(icon_menu,SIGNAL(login()),this,SLOT(menuLogin()));
    connect(icon_menu,SIGNAL(logout()),this,SLOT(userLogout()));
    connect(icon_menu,SIGNAL(min()),this,SLOT(on_btnMenu_Min_clicked()));
    connect(icon_menu,SIGNAL(useradd()),this,SLOT(userAdd()));
    connect(icon_menu,SIGNAL(clo()),this,SLOT(close()));
    connect(icon_menu,SIGNAL(pwdchange()),this,SLOT(menuPwdChange()));

    /*********login************/
    this->showLoginDlg();
}
Exemplo n.º 2
0
void clientMessageHandle(int client_sock,string message){
	vector<string> choppedString;
	stringChopper(message,choppedString);
	if (choppedString[0].compare("LIN") == 0){
		userLogin(client_sock,choppedString);
	}
	else if (choppedString[0].compare("LOU") == 0){
		userLogout(client_sock,choppedString);
	}
	else if (choppedString[0].compare("REG") == 0){
		userRegister(client_sock,choppedString);
	} 
	else if (choppedString[0].compare("MSG") == 0){
		sendMessage(client_sock,choppedString);
	}
	else if (choppedString[0].compare("CGR") == 0){
		createGroup(client_sock,choppedString);
	} 
	else if (choppedString[0].compare("JGR") == 0){
		joinGroup(client_sock,choppedString);
	}
	else if (choppedString[0].compare("LGR") == 0){
		leaveGroup(client_sock,choppedString);
	}
	else{
		errorReply(client_sock,"000","Protocol error!");
	}
}
Exemplo n.º 3
0
void SessionController::logout()
{
    userLogout();
    redirect(url("session", "form"));
}