示例#1
0
void ICheckFinishPage::init()
{
	auto item = getItemHandle()->getItemInfo();

	if (item)
	{
		gcWString msg;

		if (item->isInstalled())
		{
			m_butTryAgain->Show(false);
			m_butCIP->Show(false);

			msg = gcWString(Managers::GetString(L"#IF_CHECK_FOUND"), item->getName());
		}
		else
		{
			m_butLaunch->Show(false);
			msg = gcWString(Managers::GetString(L"#IF_CHECK_NOTFOUND"), item->getName());
		}

		m_labInfo->SetLabel(msg);
		m_labInfo->Wrap(350);
		Layout();
	}
	else
	{
		gcException e(ERR_NULLHANDLE, "Null item for install check.");
		gcErrorBox(this, "#IF_CHECK_ERRTITLE", "#IF_CHECK_ERROR", e);
		GetParent()->Close();
	}
}
示例#2
0
void CDProcess::onError(gcException& e)
{
	gcErrorBox(this, Managers::GetString("#CRASH_TITLE"), Managers::GetString("#CRASH_ERROR"), e);

	GetParent()->Show(false);
	GetParent()->Close();
}
示例#3
0
void LoginForm::onLoginError(gcException &e)
{
	safe_delete(m_pLogThread);

	if (!m_bAutoLogin)
		gcErrorBox(this, "#LF_ERRTITLE", "#LF_ERROR", e);
	else
		Msg(gcString("Auto login failed: {0}\n", e));

	if (m_comboProvider)
		m_comboProvider->Enable();

	m_butTwitter->Enable();
	m_butSteam->Enable();
	m_butFacebook->Enable();
	m_butGoogle->Enable();

	m_tbPassword->Clear();

	m_tbUsername->Enable();
	m_tbPassword->Enable();
	m_butSignin->Enable();
	m_butCancel->Enable();

	m_cbRemPass->Enable();

	m_linkOffline->Enable();
	m_linkNewAccount->Enable();
	m_linkLostPassword->Enable();

	m_bAutoLogin = false;
}
示例#4
0
void ChangeDirForm::onError(gcException &e)
{
	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	gcErrorBox(GetParent(), "#CDF_GERRTITLE", "#CDF_GERROR", e);
}
void InstallDLToolPage::onError(gcException& e)
{
	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	gcErrorBox(GetParent(), "#IF_IERRTITLE", "#IF_IERROR", e);
}
示例#6
0
void InstallVIPage::onError(gcException& e)
{
	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	if (!getItemHandle()->shouldPauseOnError())
		gcErrorBox(GetParent(), "#IF_VERRTITLE", "#IF_VERROR", e);
}
示例#7
0
void UploadInfoPage::onError(gcException& e)
{
	gcErrorBox(GetParent(), "#UDF_ERRTITLE", "#UDF_ERROR", e);

	if (e.getErrId() == ERR_COMPLETED)
		GetUploadMng()->removeUpload(m_szKey.c_str(), true);

	GetParent()->Close();
}
void UninstallProgressPage::onError(gcException& e)
{
	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	gcErrorBox(GetParent(), "#UNF_ERRTITLE", "#UNF_ERROR", e);
	completeUninstall();
}
示例#9
0
void CreateProgPage::onError(gcException& e)
{
	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	gcErrorBox(this, "#CF_ERRTITLE", "#CF_ERROR", e);

	CreateMCFForm* temp = dynamic_cast<CreateMCFForm*>(GetParent());

	if (temp)
		temp->cancelPrompt();

	GetParent()->Close();
}
示例#10
0
void LoginForm::onLoginError(gcException &e)
{
	ASSERT_UITHREAD();
	safe_delete(m_pLogThread);

	if (!m_bAutoLogin)
		gcErrorBox(this, "#LF_ERRTITLE", "#LF_ERROR", e);
	else
		Msg(gcString("Auto login failed: {0}\n", e));

	if (m_comboProvider)
		m_comboProvider->Enable();

	m_butTwitter->Enable();
	m_butSteam->Enable();
	m_butFacebook->Enable();
	m_butGoogle->Enable();

	m_tbPassword->Clear();

	m_tbUsername->Enable();
	m_tbPassword->Enable();
	m_butSignin->Enable();
	m_butCancel->Enable();

	m_cbRemPass->Enable();
#ifdef WIN32
	m_cbProxyOff->Enable();
#endif

	m_cbBypassSSLRevocationCheck->Enable();
	m_linkOffline->Enable();
	m_linkNewAccount->Enable();
	m_linkLostPassword->Enable();

	//bad password
	if (e.getSecErrId() == 103)
	{
		m_tbPassword->SetFocus();
	}
	else
	{
		m_tbUsername->SetFocus();
		m_tbUsername->SelectAll();
	}

	m_bAutoLogin = false;
}
示例#11
0
void CDKProgress::onError(gcException& e)
{
	if (e.getErrId() == ERR_CDKEY && e.getSecErrId() == 117) //not required
	{
		if (m_bLaunch)
			g_pMainApp->handleInternalLink(getItemId(), ACTION_LAUNCH, FormatArgs("cdkey"));

		GetParent()->Close();
	}

	gcFrame* par = dynamic_cast<gcFrame*>(GetParent());
	if (par)
		par->setProgressState(gcFrame::P_ERROR);

	gcErrorBox(GetParent(), "#CDK_ERRTITLE", "#CDK_ERROR", e);
	GetParent()->Close();
}
示例#12
0
void LoginForm::showForcedLogoutPromt()
{
	gcException e(ERR_NOUSER, "Your login has expired, please re-login.");
	gcErrorBox(this, "#LF_ERRTITLE", "#LF_ERROR", e);
}
示例#13
0
void PasswordReminder::onError(gcException& e)
{
	gcErrorBox(this, "#PR_ERRTITLE", "#PR_ERROR", e);
	Close();
}
示例#14
0
bool InternalLink::processItemLink(bool &badLink, std::vector<gcString> &list, const char* link)
{
	if (list.size() < 3)
	{
		badLink = true;
		return true;
	}

	std::string key = list[1] + list[2];

	std::map<gcString, gcFrame*>::iterator it = m_mWaitingItemFromMap.find(key);

	if (it != m_mWaitingItemFromMap.end())
	{
		it->second->Raise();
		return false;
	}

	UI::Forms::ItemForm *form = new UI::Forms::ItemForm(m_pParent, list[0].c_str(), list[2].c_str());
	m_mWaitingItemFromMap[key] = form;

	form->Show();

	DesuraId id;

	try
	{
		id = GetWebCore()->nameToId(list[2].c_str(), list[1].c_str());
	}
	catch (gcException &e)
	{
		DesuraId idAsNum(list[2].c_str(), list[1].c_str());

		if (idAsNum.getItem() == 0)
		{
			Warning(gcString("Failed to resolve item name {0} for link {2}: {1}\n", list[2], e, link));
			gcErrorBox(form, Managers::GetString("#MF_ERRTITLE"), Managers::GetString("#MF_NAMERESOLVE"), e);

			m_mWaitingItemFromMap.erase(m_mWaitingItemFromMap.find(key));

			form->Show(false);
			form->Destroy();
			return false;
		}
		else
		{
			id = idAsNum;
		}
	}

	m_mWaitingItemFromMap.erase(m_mWaitingItemFromMap.find(key));

	bool destroyForm = false;
	std::vector<std::string> argList;

	if (id.isOk())
	{
		UI::Forms::ItemForm *formFind = findForm<UI::Forms::ItemForm>(id, m_vSubForms);

		if (!formFind)
		{
			form->setItemId(id);
			regForm(id, form);
		}
		else
		{
			formFind->SetPosition(form->GetPosition());
			form->Show(false);
			destroyForm = true;
		}

		if (list[0] == "install" || list[0] == "launch")
		{
			std::string branch;

			if (list.size() >= 4)
				branch = list[3];

			if (branch.size() > 0)
			{
				argList.push_back(std::string("global=") + branch);
				handleInternalLink(id, ACTION_INSTALL, argList);	
			}
			else
			{
				bool isInstall = (list[0] == "install");
				handleInternalLink(id, isInstall?ACTION_INSTALL:ACTION_LAUNCH, argList);	
			}
		}
		else if (list[0] == "uninstall" || list[0] == "remove")
		{
			handleInternalLink(id, ACTION_UNINSTALL);
		}
		else if (list[0] == "verify")
		{
			handleInternalLink(id, ACTION_VERIFY);
		}
		else if (list[0] == "upload")
		{
			destroyForm = true;
			handleInternalLink(id,  ACTION_UPLOAD);
		}
		else if (list[0] == "resumeupload" && list.size() >= 4)
		{
			destroyForm = true;
			argList.push_back(std::string("key=") + list[3]);
			handleInternalLink(id, ACTION_RESUPLOAD, argList);	//
		}
		else if (list[0] == "makemcf")
		{
			destroyForm = true;
			handleInternalLink(id, ACTION_CREATE);
		}
		else if (list[0] == "test" && list.size() >= 5)
		{
			argList.push_back(std::string("branch=") + list[3]);
			argList.push_back(std::string("build=") + list[4]);
			handleInternalLink(id, ACTION_TEST, argList);
		}
		else
		{
			badLink = true;
		}
	}
	else
	{
		badLink = true;
	}

	if (badLink || destroyForm)
	{
		closeForm(form->GetId());
		form->Show(false);
		form->Destroy();
	}

	return true;
}