Пример #1
0
void InternalLink::setPauseItem(DesuraId id, bool state)
{
	UserCore::Item::ItemHandleI* itemHandle = GetUserCore()->getItemManager()->findItemHandle(id);

	if (itemHandle)
	  itemHandle->setPaused(state);
	else if (state == false)
		launchItem(id, Args()); //if we paused and restarted desura we wont have a valid install form
}
Пример #2
0
int testpluginPlugin::msg(int msgId, void* wParam, void* lParam)
{
    bool handled = false;
    switch (msgId)
    {
    case MSG_INIT:
        init();
        handled = true;
        break;
    case MSG_GET_LABELS:
        getLabels((InputList*) wParam);
        handled = true;
        break;
    case MSG_GET_ID:
        getID((uint*) wParam);
        handled = true;
        break;
    case MSG_GET_NAME:
        getName((QString*) wParam);
        handled = true;
        break;
    case MSG_GET_RESULTS:
        getResults((InputList*) wParam, (QList<CatItem>*) lParam);
        handled = true;
        break;
    case MSG_GET_CATALOG:
        getCatalog((QList<CatItem>*) wParam);
        handled = true;
        break;
    case MSG_EXTEND_CATALOG:
        extendCatalog((SearchInfo*) wParam, (QList<CatItem>*)lParam);
        handled = true;
        break;
    case MSG_LAUNCH_ITEM:
        handled = launchItem((InputList*) wParam, (QList<CatItem>*) lParam);
        break;
    case MSG_HAS_DIALOG:
        handled = true;
        break;
    case MSG_DO_DIALOG:
        doDialog((QWidget*) wParam, (QWidget**) lParam);
        break;
    case MSG_END_DIALOG:
        endDialog((bool) wParam);
        break;
    case MSG_PATH:
        setPath((QString *) wParam);
    default:
        break;
    }

    return handled;
}
Пример #3
0
void InternalLink::handleInternalLink(DesuraId id, uint8 action, const std::vector<std::string> &argsList)
{
	if (g_pMainApp->isOffline() && action != ACTION_LAUNCH)
		return;

	Args args(argsList);

	bool handled = true;

	switch (action)
	{
	case ACTION_UPLOAD		: uploadMCF( id );						break;
	case ACTION_CREATE		: createMCF( id );						break;
	case ACTION_RESUPLOAD	: resumeUploadMCF( id, args );			break;
#ifdef WIN32
	case ACTION_INSTALLEDW	: installedWizard();					break;
#endif
	case ACTION_SHOWSETTINGS: showSettings(args);					break;
	case ACTION_APPUPDATELOG: showUpdateLogApp( id.getItem() );		break;
	case ACTION_PAUSE		: setPauseItem( id , true );			break;
	case ACTION_UNPAUSE		: setPauseItem( id , false );			break;
	case ACTION_UNINSTALL	: uninstallMCF( id );					break;
	case ACTION_PROMPT		: showPrompt(id, args);					break;
	case ACTION_UPDATELOG	: showUpdateLog(id);					break;
	case ACTION_DISPCDKEY	: showCDKey(id, args);					break;

	default: 
		handled = false;
		break;
	}

	if (handled || checkForm(id))
		return;

	switch (action)
	{
	case ACTION_INSTALL		: installItem(id, args);				break;
	case ACTION_LAUNCH		: launchItem(id, args);					break;
	case ACTION_VERIFY		: verifyItem(id, args);					break;
	case ACTION_UPDATE		: updateItem(id, args);					break;
	case ACTION_TEST		: installTestMCF(id, args);				break;
	case ACTION_INSCHECK	: installCheck(id);						break;
	case ACTION_SHOWUPDATE	: showUpdateForm(id, args);				break;
	case ACTION_SWITCHBRANCH: switchBranch(id, args);				break;
	case ACTION_CLEANCOMPLEXMOD: cleanComplexMod(id);				break;

	default: 
		Warning(gcString("Unknown internal link {0} for item {1}\n.", (uint32)action, id.toInt64()));	
		break;
	}
}
Пример #4
0
int controlyPlugin::msg(int msgId, void* wParam, void* lParam)
{
	int handled = 0;
	switch (msgId)
	{		
		case MSG_INIT:
			init();
			handled = 1;
			break;
		case MSG_GET_ID:
			getID((uint*) wParam);
			handled = 1;
			break;
		case MSG_GET_NAME:
			getName((QString*) wParam);
			handled = 1;
			break;
		case MSG_GET_CATALOG:
			getCatalog((QList<CatItem>*) wParam);
			handled = 1;
			break;
		case MSG_GET_RESULTS:
			getResults((QList<InputData>*) wParam, (QList<CatItem>*) lParam);
			handled = 1;
			break;
		case MSG_LAUNCH_ITEM:
			handled = launchItem((QList<InputData>*) wParam, (CatItem*) lParam);
			break;

		case MSG_HAS_DIALOG:
			handled = true;
			break;
		case MSG_DO_DIALOG:
			doDialog((QWidget*) wParam, (QWidget**) lParam);
			break;
		case MSG_END_DIALOG:
			endDialog(wParam != 0);
			break;

		case MSG_PATH:
			setPath((QString *) wParam);
			break;

		default:
			break;
	}
		
	return handled;
}
Пример #5
0
int VerbyPlugin::msg(int msgId, void* wParam, void* lParam)
{
	bool handled = false;
	switch (msgId)
	{		
	case MSG_INIT:
		init();
		handled = true;
		break;
	case MSG_GET_ID:
		getID((uint*) wParam);
		handled = true;
		break;
	case MSG_GET_NAME:
		getName((QString*) wParam);
		handled = true;
		break;
	case MSG_GET_LABELS:
		getLabels((QList<InputData>*) wParam);
		handled = true;
		break;
	case MSG_GET_RESULTS:
		getResults((QList<InputData>*) wParam, (QList<CatItem>*) lParam);
		handled = true;
		break;
	case MSG_LAUNCH_ITEM:
		launchItem((QList<InputData>*) wParam, (CatItem*) lParam);
		handled = true;
		break;
	case MSG_HAS_DIALOG:
		handled = true;
		break;
	case MSG_DO_DIALOG:
		doDialog((QWidget*) wParam, (QWidget**) lParam);
		break;
	case MSG_END_DIALOG:
		endDialog(wParam != 0);
		break;

	default:
		break;
	}

	return handled;
}