New file |
| | |
| | | #include "permissondialog.h" |
| | | #include "ui_permissondialog.h" |
| | | |
| | | PermissonDialog::PermissonDialog(QWidget *parent,PmsClientSocket * client) : |
| | | QDialog(parent), |
| | | client(client), |
| | | ui(new Ui::PermissonDialog) |
| | | { |
| | | ui->setupUi(this); |
| | | |
| | | map<int,QRadioButton *> map1; |
| | | map1[0]=ui->radioButton; |
| | | map1[1]=ui->radioButton_2; |
| | | map1[2]=ui->radioButton_3; |
| | | |
| | | map<int,QRadioButton *> map2; |
| | | map2[0]=ui->radioButton_4; |
| | | map2[1]=ui->radioButton_5; |
| | | map2[2]=ui->radioButton_6; |
| | | |
| | | map<int,QRadioButton *> map3; |
| | | map3[0]=ui->radioButton_7; |
| | | map3[1]=ui->radioButton_8; |
| | | map3[2]=ui->radioButton_9; |
| | | |
| | | map<int,QRadioButton *> map4; |
| | | map4[0]=ui->radioButton_10; |
| | | map4[1]=ui->radioButton_11; |
| | | map4[2]=ui->radioButton_12; |
| | | |
| | | map<int,QRadioButton *> map5; |
| | | map5[0]=ui->radioButton_13; |
| | | map5[1]=ui->radioButton_14; |
| | | map5[2]=ui->radioButton_15; |
| | | |
| | | |
| | | btnList.push_back(map1); |
| | | btnList.push_back(map2); |
| | | btnList.push_back(map3); |
| | | btnList.push_back(map4); |
| | | btnList.push_back(map5); |
| | | |
| | | } |
| | | |
| | | PermissonDialog::~PermissonDialog() |
| | | { |
| | | delete ui; |
| | | } |
| | | |
| | | int PermissonDialog::findBoxCheck(map<int, QRadioButton *> map) |
| | | { |
| | | for(int i =0;i<map.size();i++){ |
| | | if(btnList[0][i]->isChecked()){ |
| | | return i; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void PermissonDialog::recvUserNo(PmsQueryResult res) |
| | | { |
| | | |
| | | // å¡«å
checkbox |
| | | btnList[0][res.getQueryHistory()]->setChecked(true); |
| | | btnList[1][res.getLoggerSearch()]->setChecked(true); |
| | | btnList[2][res.getMapMark()]->setChecked(true); |
| | | btnList[3][res.getDevManage()]->setChecked(true); |
| | | btnList[4][res.getProductPlan()]->setChecked(true); |
| | | |
| | | curRes = res; |
| | | |
| | | } |
| | | |
| | | |
| | | void PermissonDialog::on_buttonBox_accepted() |
| | | { |
| | | qDebug()<< "åéæ´æ°è¯·æ±"; |
| | | PmsPlusParma param; |
| | | |
| | | param.setQueryHistory(findBoxCheck(btnList[0])); |
| | | param.setLoggerSearch(findBoxCheck(btnList[1])); |
| | | param.setMapMark(findBoxCheck(btnList[2])); |
| | | param.setDevManage(findBoxCheck(btnList[3])); |
| | | param.setProductPlan(findBoxCheck(btnList[4])); |
| | | |
| | | param.setRoleId(curRes.getRoleId()); |
| | | client->updatePmsByParam(param); |
| | | |
| | | } |