示例#1
0
TVerdict CSampleStep1::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 * Demonstrates reading configuration parameters fom an ini file section
 */
	{
	INFO_PRINTF1(_L("In Test Step"));

  	TDriveName scriptDrive(ScriptDriveName());
  	INFO_PRINTF2(_L("The Drive where script file is executed from is %S"), &scriptDrive);

	TInt theInt;
	TPtrC val;
	_LIT(tem,"NewData");
	val.Set(tem);
	TBool theBool;
	TBuf<40> buf;
	TPtrC theString;
	TInt changeInt(83);
	TInt changeHex(183);
	TBool changeBool(ETrue);
	_LIT(sectName,"Section3");

	GetHexFromConfig(sectName,_L("TheHex"),changeInt);
	GetIntFromConfig(ConfigSection(),_L("TheInt"),theInt);
	GetBoolFromConfig(ConfigSection(),_L("TheBool"),theBool);
	GetStringFromConfig(ConfigSection(),_L("TheString"),theString);
	buf.Copy(theString);

	WriteBoolToConfig(sectName,_L("TheBool"),changeBool);
	WriteIntToConfig(ConfigSection(),_L("TheInt"),changeInt);
	WriteHexToConfig(sectName,_L("TheHex"),changeHex);

	// Demonstrate panic
	if(buf == _L("PanicMe"))
		{
		const TInt KSampleServerPanic = 1;
		User::Panic(_L("SampleServer"),KSampleServerPanic);
		}
		
	SetTestStepResult(EPass);
	return TestStepResult();
	}
示例#2
0
void MultiStepRangeBackgroundItem::contextMenuEvent(
  QGraphicsSceneContextMenuEvent *event)
{
  QMenu menu;

  PlacementData placementData = meta->LPub.multiStep.placement.value();

  QString name = "Move These Steps";
  QAction *placementAction = menu.addAction(name);
  placementAction->setWhatsThis(commonMenus.naturalLanguagePlacementWhatsThis(
    StepGroupType,placementData,name));

  QAction *perStepAction = menu.addAction(
    meta->LPub.multiStep.pli.perStep.value() ?
      "No Parts List per Step" :
      "Parts List per Step");

  QAction *allocAction;
  
  if (page->allocType() == Vertical) {
    allocAction = menu.addAction("Display as Rows");
    allocAction->setWhatsThis(
      "Display as Rows:\n"
      "  Change this whole set of steps from columns of steps\n"
      "  to rows of steps");
  } else {
    allocAction = menu.addAction("Display as Columns");
    allocAction->setWhatsThis(
      "Display as Columns:\n"
      "  Change this whole set of steps from rows of steps\n"
      "  to columns of steps");
  }

  QAction *marginAction = menu.addAction("Change Step Group Margins");

  marginAction->setWhatsThis("Change Step Group Margins:\n"
                             "  Margins are the empty space around this group of steps.\n"
                             "  You can change the margins if things are too close together,\n"
                             "  or too far apart. You can change the things in this group of\n"
                             "  steps by putting your mouse cursor over them, and clicking\n"
                             "  the menu button\n");

  QAction *selectedAction = menu.exec(event->screenPos());

  if (selectedAction == placementAction) {
    changePlacement(PageType,
                    relativeType,
                    "Step Group Placement",
                    page->topOfSteps(),
                    page->bottomOfSteps(),
                    &meta->LPub.multiStep.placement,
                    true,1,false);
  } else if (selectedAction == perStepAction) {
    changeBool(page->topOfSteps(),
               page->bottomOfSteps(),
              &meta->LPub.multiStep.pli.perStep,true,1,false,false);
  } else if (selectedAction == marginAction) {
    changeMargins("Step Group Margins",
                  page->topOfSteps(),
                  page->bottomOfSteps(),
                  margin);
  } else if (selectedAction == allocAction) {
    changeAlloc(page->topOfSteps(),
                page->bottomOfSteps(),
                page->allocMeta());
  }
}