void SpellItem::update(uint16_t spellId, const Spell* spell, int duration, uint16_t casterId, const QString& casterName, uint16_t targetId, const QString& targetName) { setSpellId(spellId); setDuration(duration); if (spell) { setSpellName(spell->name()); if (spell->targetType() != 0x06) setTargetId(targetId); } else { setSpellName(spell_name(spellId)); setTargetId(targetId); } setCasterId(casterId); if (!casterName.isEmpty()) setCasterName(casterName); else setCasterName(QString("N/A")); if (!targetName.isEmpty()) setTargetName(targetName); else setTargetName(QString("N/A")); updateCastTime(); }
DMDatei::DMDatei (const IDMItem::Handle &h) : IDMItem (h) { if ( object () ) { setTypes (IDM::plainText); // sollte aus EA ermitteln addType ("Datei"); enableLink (); enableMove (); enableCopy (); setRMFs (rmfFrom (IDM::rmFile, IDM::rfText)); addRMF (IDM::rmDiscard, IDM::rfUnknown); addRMF (IDM::rmPrint, IDM::rfUnknown); Datei *d = (Datei *)object (); setSourceName (d->iconText ()); setContainerName (Struktur::aktiv ()->path ()); setTargetName (sourceName ()); } }
Template::Template(Target t) { // TODO Auto-generated ructor stub setTargetName(t.getTargetName()); setTargetSequence(t.getTargetSequence()); setTargetLength(t.getTargetLength()); }
void UserInterface::run() { while (true) { hIMutex.lock(); while (!hasInterrupt) hICondition.wait(&hIMutex); hIMutex.unlock(); if (isAborting) return; usingUI = true; printf("\n"); printf(" 0: Cancel\n"); printf(" 1: Activate\n"); printf(" 2: Deactivate\n"); printf(" 3: Set my name\n"); printf(" 4: Set follow name\n"); printf(" 5: Set target name\n"); printf(" 9: Exit\n"); int action = -1; while (action) { printf("Action: "); fflush(stdout); scanf("%d", &action); switch (action) { case 0: break; case 1: emit setActivated(true); action = 0; break; case 2: emit setActivated(false); action = 0; break; case 3: printf("Name: "); fflush(stdout); fgets(buffer, 10, stdin); emit setMyName(QString(buffer)); action = 0; break; case 4: printf("Name: "); fflush(stdout); fgets(buffer, 10, stdin); emit setFollowName(QString(buffer)); action = 0; break; case 5: printf("Name: "); fflush(stdout); fgets(buffer, 10, stdin); emit setTargetName(QString(buffer)); action = 0; break; case 9: return; default: printf("Error: Unknown action.\n"); } } usingUI = false; hasInterrupt = false; } }