| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #include "formcommandarea.h"
- #include "ui_formcommandarea.h"
- #include "dialogselectsegment.h"
- #include "respgetservertime.h"
- #include "respencrypt.h"
- #include "sncdatabase.h"
- FormCommandArea::FormCommandArea(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::FormCommandArea)
- {
- ui->setupUi(this);
- //m_ssows = new WSSSO();
- m_state = NotLogin;
- initUI();
- }
- void FormCommandArea::setAccountInfo(QMap<QString, QString> info)
- {
- m_account = info;
- QString ssoHash = info.value("ssohash");
- if(!ssoHash.isEmpty())
- {
- m_state = LoginOk;
- }
- else
- {
- m_state = NotLogin;
- }
- }
- FormCommandArea::~FormCommandArea()
- {
- qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")\
- <<"FormCommandArea Destroyed.";
- delete ui;
- qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")\
- <<"FormCommandArea Destroyed.";
- }
- bool FormCommandArea::chkAccountState(AccountLoginState state)
- {
- bool ret = false;
- switch(state)
- {
- case NotLogin:
- QMessageBox::critical(this,"提示","您现在还没有登录系统,请登录后再操作!",QMessageBox::Ok);
- break;
- case NotBind:
- QMessageBox::critical(this,"提示","此项服务尚未开通,请开通后再操作!",QMessageBox::Ok);
- break;
- case LoginError:
- QMessageBox::critical(this,"提示","此项服务暂时无法连接,请稍候重试!",QMessageBox::Ok);
- break;
- default:
- ret = true;
- }
- return ret;
- }
- void FormCommandArea::initUI()
- {
- ui->pushButtonFree->setProperty("class","big-red-bg");
- //ui->pushButtonShkj->setProperty("class","big-yellow-bg");
- ui->pushButtonFree->setCursor(Qt::PointingHandCursor);
- //ui->pushButtonShkj->setCursor(Qt::PointingHandCursor);
- ui->widget->setProperty("class","blackborder");
- }
- void FormCommandArea::on_pushButtonFree_clicked()
- {
- // if(!chkAccountState(m_state))
- // return;
- DialogSelectSegment dialog;
- dialog.setAccountInfo(m_account);
- connect(&dialog,SIGNAL(zxshDownDataUpdated()),this,SIGNAL(zxshDownDataUpdated()));
- int rtCode = dialog.exec();
- disconnect(&dialog,SIGNAL(zxshDownDataUpdated()),this,SIGNAL(zxshDownDataUpdated()));
- if(rtCode == QDialog::Accepted)
- {
- if(!dialog.isReserve())
- ;//emit zxshDownDataUpdated();
- else
- emit zxshReserveDataUpdated();
- }
- }
- void FormCommandArea::onRowButtonClicked(QString type, QString data)
- {
- QStringList list = data.split("-");
- QString province,city;
- QMap<QString,QString> map;
- if(type=="HOTAREA" || type=="RESERVE")
- {
- province = list.at(0);
- city = list.at(1);
- }
- else if(type=="FREE")
- {
- qDebug()<<list;
- province = list.at(0);
- city = list.at(1);
- map.insert("updatedays",list.at(2));
- map.insert("isp",list.at(3));
- }
- DialogSelectSegment dialog;
- dialog.setAccountInfo(m_account);
- dialog.setCustomInfo(map);;
- dialog.setAreaInfo(province,city);
- connect(&dialog,SIGNAL(zxshDownDataUpdated()),this,SIGNAL(zxshDownDataUpdated()));
- connect(&dialog,SIGNAL(zxshReserveDataUpdated()),this,SIGNAL(zxshReserveDataUpdated()));
- dialog.exec();
- disconnect(&dialog,SIGNAL(zxshDownDataUpdated()),this,SIGNAL(zxshDownDataUpdated()));
- disconnect(&dialog,SIGNAL(zxshReserveDataUpdated()),this,SIGNAL(zxshReserveDataUpdated()));
- }
|