Ejemplo n.º 1
0
void ViewerCallback(ViewerBasePtr pviewer)
{
    ++g_counter;
    // this is only true for the current qtcoinviewer implementation
    QMainWindow* wnd = dynamic_cast<QMainWindow*>(pviewer.get());
    if( (g_counter/60) & 1 ) {
        wnd->show();
    }
    else {
        wnd->hide();
    }
}
Ejemplo n.º 2
0
void OBSBasic::OnTaoBaoTokenOk()
{
	{// refresh cookie
		if (!m_hideWebview)
		{
			QMainWindow * hideSSO = new QMainWindow(this);
			m_hideWebview = new QWebEngineView(this);

			hideSSO->setCentralWidget(m_hideWebview);
			hideSSO->hide();

			base::GetUIMessageLoop()->PostDelayedTask(FROM_HERE, base::Lambda([=]() {
				std::wstring url = L"https://my.taobao.com/";
				PrgString destUrl;
				CLoginBiz::GetInstance()->TranslateUrl(url, destUrl);

				m_hideWebview->load(QString::fromStdWString(destUrl.GetString()));
			}), base::TimeDelta::FromSeconds(30));
		}
		else
		{
			// load sso hidden page 
			std::wstring url = L"https://my.taobao.com/";
			PrgString destUrl;
			CLoginBiz::GetInstance()->TranslateUrl(url, destUrl);

			m_hideWebview->load(QString::fromStdWString(destUrl.GetString()));
		}
	}

	// Init webview for first time
	if (!m_bBizWebviewInited)
	{
		InitBizWebview();

		m_bBizWebviewInited = true;
	}
}