void GeneralSettingsWidget::Creator::initAttachUin(QWidget* parent, std::map<std::string, Synchronizator> &/*collector*/) { auto scroll_area = new QScrollArea(parent); scroll_area->setWidgetResizable(true); Utils::grabTouchWidget(scroll_area->viewport(), true); auto scroll_area_content = new QWidget(scroll_area); scroll_area_content->setGeometry(QRect(0, 0, Utils::scale_value(800), Utils::scale_value(600))); Utils::grabTouchWidget(scroll_area_content); auto scroll_area_content_layout = new QVBoxLayout(scroll_area_content); scroll_area_content_layout->setSpacing(0); scroll_area_content_layout->setAlignment(Qt::AlignTop); scroll_area_content_layout->setContentsMargins(Utils::scale_value(16), 0, 0, Utils::scale_value(48)); scroll_area->setWidget(scroll_area_content); auto layout = new QHBoxLayout(parent); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); LoginPage* page = new LoginPage(scroll_area, false /* is_login */); page->switchLoginType(); GeneralCreator::addBackButton(scroll_area, layout, [page]() { page->prevPage(); page->switchLoginType(); emit Utils::InterConnector::instance().attachUinBack(); }); layout->addWidget(scroll_area); GeneralCreator::addHeader(scroll_area, scroll_area_content_layout, QT_TRANSLATE_NOOP("profile_page", "Connect to ICQ account")); scroll_area_content_layout->addWidget(page); connect(page, &LoginPage::attached, [page]() { if (!page->isVisible()) return; core::coll_helper helper(GetDispatcher()->create_collection(), true); GetDispatcher()->post_message_to_core("load_flags", helper.get()); emit Utils::InterConnector::instance().attachUinBack(); emit Utils::InterConnector::instance().profileSettingsUpdateInterface(); }); connect(&Utils::InterConnector::instance(), &Utils::InterConnector::updateFocus, page, &LoginPage::updateFocus); }
void GeneralSettingsWidget::Creator::initAttachPhone(QWidget* parent, std::map<std::string, Synchronizator> &/*collector*/) { auto scroll_area = new QScrollArea(parent); scroll_area->setWidgetResizable(true); Utils::grabTouchWidget(scroll_area->viewport(), true); auto scroll_area_content = new QWidget(scroll_area); scroll_area_content->setGeometry(QRect(0, 0, Utils::scale_value(800), Utils::scale_value(600))); Utils::grabTouchWidget(scroll_area_content); auto scroll_area_content_layout = new QVBoxLayout(scroll_area_content); scroll_area_content_layout->setSpacing(0); scroll_area_content_layout->setAlignment(Qt::AlignTop); scroll_area_content_layout->setContentsMargins(Utils::scale_value(16), 0, 0, Utils::scale_value(48)); scroll_area->setWidget(scroll_area_content); auto layout = new QHBoxLayout(parent); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); LoginPage* page = new LoginPage(nullptr, false /* is_login */); GeneralCreator::addBackButton(scroll_area, layout, [page]() { page->prevPage(); emit Utils::InterConnector::instance().attachPhoneBack(); }); layout->addWidget(scroll_area); GeneralCreator::addHeader(scroll_area, scroll_area_content_layout, QT_TRANSLATE_NOOP("sidebar", "Attach phone")); scroll_area->setStyleSheet(Utils::LoadStyle(":/main_window/login_page.qss", Utils::get_scale_coefficient(), true)); scroll_area_content_layout->addWidget(page); connect(page, &LoginPage::attached, [page]() { if (!page->isVisible()) return; emit Utils::InterConnector::instance().attachPhoneBack(); emit Utils::InterConnector::instance().profileSettingsUpdateInterface(); }); }
void Homepage::sltCj() { if(g_transaction && !g_transaction->networkIsNormal()) { YGMsgBox* box = Utility::msgBox(YGMsgBox::MsgType_Err, trUtf8("错误"), trUtf8("网络出现故障,请稍后再试."), this); box->show(); return; } if(!checkTerminalConfig()) { return; } if(g_appStatus & AppStatus_LockControlBoardErr) // 锁控板模块出错; { YGMsgBox* box = Utility::msgBox(YGMsgBox::MsgType_Err, trUtf8("错误"), trUtf8("锁控板模块出错,请联系管理员.问题解决后请重启"), this); box->show(); return; } if(!(g_transaction->terminalConfig().otherCmd&0x02) && (!(g_transaction->terminalConfig().otherCmd&0x04)) && g_transaction->openGateNum()) { DoorOperateDlg *page = new DoorOperateDlg(DoorOperateDlg::DoorOperateType_CloseAll, g_home); page->show(); Utility::pushPage(PageType_None, page); return; } LoginPage *login = new LoginPage(LoginPage::Courier_In ,g_home); login->show(); //Utility::pushPage(PageType_CourierLogIn, login); g_pageInfo.push(PageInfo(PageType_CourierLogIn, login)); }
void FetchPage::sltValidFetch() { LoginPage *login = new LoginPage(LoginPage::Receiver_Out ,g_home); login->show(); Utility::pushPage(PageType_ValidCodeFetchPage, login); }
void Utility::popPage() { int top0 = g_pageInfo.top().type; g_pageInfo.pop(); PageInfo info = g_pageInfo.top(); if(top0 == PageType_None) { if(info.type != PageType_None) { return; } else { g_timer = g_pageInfo.top().pWgt->timerLabel(); } } switch(info.type) { case PageType_CourierLogIn: { LoginPage *login = new LoginPage(LoginPage::Courier_In ,g_home); login->show(); g_pageInfo.top().pWgt = login; break; } case PageType_CourierPage: { CourierPage *courierPage = new CourierPage(g_home); courierPage->show(); g_pageInfo.top().pWgt = courierPage; break; } case PageType_CourierVerifyPage: { CourierVerifyPage *page = new CourierVerifyPage(g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_CourierInPage: { CourierInPage *page = new CourierInPage(false, g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_FastCourierInPage: { CourierInPage *page = new CourierInPage(true, g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_CabinetPage: { // CabinetPage *cabinetPage = new CabinetPage(g_transaction->courier().type, g_home); // cabinetPage->show(); // g_pageInfo.top().pWgt = cabinetPage; // 无需处理; break; } case PageType_CourierInDoorOperatePage: { // 无需处理; break; } case PageType_CourierRechargePayPage: { break; } case PageType_FetchPage: { FetchPage *fetch = new FetchPage(g_home); fetch->show(); g_pageInfo.top().pWgt = fetch; break; } case PageType_WechatQrcFetchPage: { WechatQrcFetchPage *page = new WechatQrcFetchPage(g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_AppQrcFetchPage: { AppQrCodeFetchPage *page = new AppQrCodeFetchPage(g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_ValidCodeFetchPage: { LoginPage *login = new LoginPage(LoginPage::Receiver_Out ,g_home); login->show(); g_pageInfo.top().pWgt = login; break; } case PageType_QueryPage: { QueryPage *query = new QueryPage(g_home); query->show(); g_pageInfo.top().pWgt = query; break; } case PageType_MailingPage: { MailPage *page = new MailPage(g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_ReceiverOutDoorOperatePage: { // DoorOperateDlg *page = new DoorOperateDlg(DoorOperateDlg::DoorOperateType_ReceiverOut, g_home); // page->show(); // g_pageInfo.top().pWgt = page; break; } case PageType_ChangePasswdPage: { ModifyPasswdPage *page = new ModifyPasswdPage(g_home); page->show(); g_pageInfo.top().pWgt = page; break; } case PageType_None: { info.pWgt->resetTimerLbl(); break; } case PageType_SignupPage: { SignupPage *signupPage = new SignupPage(g_home); signupPage->show(); g_pageInfo.top().pWgt = signupPage; break; } case PageType_Help: { HelpPage *helpPage = new HelpPage(g_home); helpPage->show(); g_pageInfo.top().pWgt = helpPage; } case PageType_Homepage: { break; } case PageType_LjHelp: { YGWidget * wgt =Utility::addImageWgt(QSize(GL_WIDTH, GL_HEIGHT), QPoint(0,0), g_appPath + "/data/pic/mailing/mailingpostinstruction.jpg", g_appPath + "/data/piceng/mailing/mailingpostinstruction.jpg", g_home); g_pageInfo.top().pWgt = wgt; break; } case PageType_JjHelp: { YGWidget * wgt = Utility::addImageWgt(QSize(GL_WIDTH, GL_HEIGHT), QPoint(0,0), g_appPath + "/data/pic/mailing/mailinginstruction.jpg", g_appPath + "/data/piceng/mailing/mailinginstruction.jpg", g_home); g_pageInfo.top().pWgt = wgt; break; } default: break; } }