コード例 #1
0
void AntProjectPart::openProject(const QString &dirName, const QString &projectName)
{
  m_projectDirectory = dirName;
  m_projectName = projectName;

  QDomDocument &dom = *projectDom();
  // Set the default directory radio to "executable"
  /// \FIXME there is no kdevantproject so this will not work !
  if (DomUtil::readEntry(dom, "/kdevantproject/run/directoryradio") == "" ) {
    DomUtil::writeEntry(dom, "/kdevantproject/run/directoryradio", "executable");
  }

  /// @todo read alternative build file from properties
  m_antOptions.m_buildXML = "build.xml";

  parseBuildXML();

  fillMenu();

  QFile f(dirName + "/" + projectName.lower() + ".kdevelop" + ".filelist");
  if (f.open(IO_ReadOnly))
  {
    QTextStream stream(&f);
    while (!stream.atEnd())
    {
      QString s = stream.readLine();
      if (!s.startsWith("#"))
        m_sourceFiles << s;
    }
  }
  else
    populateProject();

  KDevProject::openProject( dirName, projectName );
}
コード例 #2
0
//!
//! Fills the given menu with actions and sub menus for the parameters in the
//! given parameter group.
//!
//! \param menu The menu to which the actions and sub menus will be added.
//! \param parameterGroup The parameter group to create the context menu for.
//!
void PinGraphicsItem::fillMenu ( QMenu *menu, ParameterGroup *parameterGroup )
{
    // iterate over the list of parameters in the group
    const AbstractParameter::List *parameterList = parameterGroup->getParameterList();
    for (int i = 0; i < parameterList->size(); ++i) {
        AbstractParameter *abstractParameter = parameterList->at(i);
        if (abstractParameter->isGroup()) {
            ParameterGroup *parameterGroup = dynamic_cast<ParameterGroup *>(abstractParameter);
            if (parameterGroup->contains(m_pinType)) {
                // create a sub menu for the parameter group and recursively
                // fill it with actions and sub menus (if applicable)
                QMenu *subMenu = new QMenu(parameterGroup->getName(), menu);
                fillMenu(subMenu, parameterGroup);
                menu->addMenu(subMenu);
            }
        } else {
            Parameter *parameter = dynamic_cast<Parameter *>(abstractParameter);
            if (parameter->getPinType() == m_pinType) {
                // create an action representing the parameter in the menu
                ParameterAction *parameterAction = new ParameterAction(parameter, menu);
                parameterAction->setEnabled(m_parameterTypeFilter == Parameter::T_Unknown || parameter->getType() == m_parameterTypeFilter);
                menu->addActions(QList<QAction *>() << parameterAction);
            }
        }
    }
}
コード例 #3
0
void DolphinRemoteEncoding::loadSettings()
{
    m_loaded = true;
    m_encodingDescriptions = KCharsets::charsets()->descriptiveEncodingNames();

    fillMenu();
}
コード例 #4
0
	void Plugin::hookGonnaFillMenu (IHookProxy_ptr)
	{
		if (!UnityDetected_)
			return;

		QTimer::singleShot (0,
				this,
				SLOT (fillMenu ()));
	}
コード例 #5
0
ファイル: pierre.cpp プロジェクト: Kalarel/leechcraft
	void Plugin::handleGotActions (const QList<QAction*>&, ActionsEmbedPlace aep)
	{
		if (aep != ActionsEmbedPlace::ToolsMenu)
			return;

		MenuBar_->clear ();
		QTimer::singleShot (0,
				this,
				SLOT (fillMenu ()));
	}
コード例 #6
0
TaskLMBMenu::TaskLMBMenu(const Task::List& tasks, QWidget *parent, const char *name)
  : QPopupMenu(parent, name),
    m_tasks(tasks),
    m_lastDragId(-1),
    m_attentionState(false)
{
    fillMenu();

    setAcceptDrops(true); // Always enabled to activate task during drag&drop.

    m_dragSwitchTimer = new QTimer(this, "DragSwitchTimer");
    connect(m_dragSwitchTimer, SIGNAL(timeout()), SLOT(dragSwitch()));
}
コード例 #7
0
void WindowSizeMenu::videoDialogChange(VideoDialog const &vd) {
	QSize const &oldSize = checkedSize();
	disconnect(group_, SIGNAL(triggered(QAction *)), this, SLOT(triggered()));
	menu_->clear();
	delete group_;
	group_ = new QActionGroup(menu_);

	fillMenu(vd.sourceSize(), vd.scalingMethod());
	setCheckedSize(oldSize);
	connect(group_, SIGNAL(triggered(QAction *)), this, SLOT(triggered()));

	QSize const &newSize = checkedSize();
	if (newSize != oldSize)
		mw_.setWindowSize(newSize);
}
コード例 #8
0
WindowSizeMenu::WindowSizeMenu(MainWindow &mw, VideoDialog const &vd)
: mw_(mw)
, menu_(new QMenu(tr("&Window Size"), &mw))
, group_(new QActionGroup(menu_))
, maxSize_(QApplication::desktop()->screen()->size())
{
	fillMenu(vd.sourceSize(), vd.scalingMethod());
	setCheckedSize(QSettings().value("video/windowSize", QSize()).toSize());
	connect(group_, SIGNAL(triggered(QAction *)), this, SLOT(triggered()));

	QSize const &size = checkedSize();
	mw_.setWindowSize(size);
	if (size.isEmpty())
		mw_.resize(QSettings().value("mainwindow/size", QSize(160, 144)).toSize());
}
コード例 #9
0
//!
//! Event handler that reacts to mouse release events.
//!
//! \param event The object containing details about the event.
//!
void PinGraphicsItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *event )
{
    if (event->button() == Qt::LeftButton)
        if (m_abstractParameter->isGroup()) {
            // create context menu for parameter selection
            QMenu menu;
            fillMenu(&menu, dynamic_cast<ParameterGroup *>(m_abstractParameter));

            // show the menu
            QAction *selectedAction = menu.exec(event->screenPos());
            // notify connected objects that the parameter represented by the
            // menu action has been clicked
            ParameterAction *parameterAction = dynamic_cast<ParameterAction *>(selectedAction);
            if (parameterAction)
                emit parameterClicked(this, parameterAction->getParameter());
        } else
            // notify connected objects that the parameter represented by the
            // pin has been clicked
            emit parameterClicked(this, dynamic_cast<Parameter *>(m_abstractParameter));
    else
        BaseRectItem::mouseReleaseEvent(event);
}
コード例 #10
0
ファイル: pierre.cpp プロジェクト: Kalarel/leechcraft
	void Plugin::hookGonnaFillMenu (IHookProxy_ptr)
	{
		QTimer::singleShot (0,
				this,
				SLOT (fillMenu ()));
	}
コード例 #11
0
ファイル: OHltConfig.cpp プロジェクト: CmsHI/CVS_SavedFMa
OHltConfig::OHltConfig(TString cfgfile,OHltMenu *omenu)
{


  // init
    /**** General Menu & Run conditions ****/
  nEntries = -1;
  nPrintStatusEvery = 10000;
  isRealData= false;
  menuTag = "";
  alcaCondition = "";
  versionTag = "";
  doPrintAll = true;
  doDeterministicPrescale = false;
  dsList = "";
  iLumi = 1.E31;
  bunchCrossingTime = 25.0E-09;
  maxFilledBunches = 3564;
  nFilledBunches = 156;
  cmsEnergy = 10.;
  liveTimeRun = 100.;
  nL1AcceptsRun = 100;
  lumiSectionLength = 93.;
  prescaleNormalization = 1;
  isL1Menu = false;
  doL1preloop = true;  
  doSelectBranches = false;
  selectBranchL1 = true;
  selectBranchHLT = true;
  selectBranchOpenHLT = true;
  selectBranchReco = true;
  selectBranchL1extra = true;
  selectBranchMC = true;

  
  try {
    /* Load the configuration.. */
    cout << "Loading "<<cfgfile;
    cfg.readFile(cfgfile);
    cout << " ... ok" << endl;

    // temporary vars
    const char* stmp; float ftmp; bool btmp; int itmp;

    /**** General Menu & Run conditions ****/
    cfg.lookupValue("run.nEntries",nEntries);
    cfg.lookupValue("run.nPrintStatusEvery",nPrintStatusEvery);
    cfg.lookupValue("run.isRealData",isRealData);
    omenu->SetIsRealData(isRealData);     
    cfg.lookupValue("run.menuTag",stmp); menuTag = TString(stmp);
    cfg.lookupValue("run.versionTag",stmp); versionTag = TString(stmp);
    cfg.lookupValue("run.alcaCondition",stmp); alcaCondition = TString(stmp);
    cfg.lookupValue("run.doPrintAll",doPrintAll);
    cfg.lookupValue("run.dsList",stmp); dsList= TString(stmp);
    cfg.lookupValue("run.doDeterministicPrescale",doDeterministicPrescale);
    cout << "General Menu & Run conditions...ok"<< endl;
    /**********************************/
  
    /**** Beam conditions ****/ 
    cfg.lookupValue("beam.iLumi",iLumi);    
    cfg.lookupValue("beam.bunchCrossingTime",bunchCrossingTime);
    cfg.lookupValue("beam.maxFilledBunches",maxFilledBunches);    
    cfg.lookupValue("beam.nFilledBunches",nFilledBunches);    
    cfg.lookupValue("beam.cmsEnergy",cmsEnergy);    
    cout << "Beam conditions...ok"<< endl;
    /**********************************/

    /**** Real data conditions ****/   
    cfg.lookupValue("data.liveTimeRun",liveTimeRun);
    cfg.lookupValue("data.nL1AcceptsRun",nL1AcceptsRun); 
    cfg.lookupValue("data.lumiSectionLength",lumiSectionLength);
    cfg.lookupValue("data.prescaleNormalization",prescaleNormalization);
    cout << "Real data conditions...ok"<< endl;
    /******************************/  
  
    /**** Samples & Processes ****/ 
    Setting &p = cfg.lookup("process.names");
    const int nproc = (const int)p.getLength();
    //cout << nproc << endl;
    Setting &isPS = cfg.lookup("process.isPhysicsSample");
    Setting &xs = cfg.lookup("process.sigmas");
    Setting &pa = cfg.lookup("process.paths");
    Setting &fn = cfg.lookup("process.fnames");
    Setting &muc = cfg.lookup("process.doMuonCuts");
    Setting &ec = cfg.lookup("process.doElecCuts");

    for (int i=0;i<nproc;i++) {
      stmp = p[i];
      pnames.push_back(TString(stmp));
      itmp = isPS[i];
      pisPhysicsSample.push_back(itmp);
      stmp = pa[i];
      ppaths.push_back(TString(stmp));
      stmp = fn[i];
      pfnames.push_back(TString(stmp));
      ftmp = xs[i];
      psigmas.push_back(ftmp);
      btmp = muc[i];
      pdomucuts.push_back(btmp);
      btmp = ec[i];
      pdoecuts.push_back(btmp);
    }
    cout << "Samples & Processes...ok"<< endl;

    for (int i=0;i<nproc;i++) { //RR

			printf("Name [%d]: %s\n",i,pnames.at(i).Data());
			printf("Path [%d]: %s\n",i,ppaths.at(i).Data());
			printf("File [%d]: %s\n",i,pfnames.at(i).Data());
		}
    /**********************************/

    /**** Branch Selections ****/ 
    // Only for experts:
    // Select certain branches to speed up code.
    // Modify only if you know what you do!
    cfg.lookupValue("branch.doSelectBranches",doSelectBranches);    
    cfg.lookupValue("branch.selectBranchL1",selectBranchL1);    
    cfg.lookupValue("branch.selectBranchHLT",selectBranchHLT);    
    cfg.lookupValue("branch.selectBranchOpenHLT",selectBranchOpenHLT);    
    cfg.lookupValue("branch.selectBranchL1extra",selectBranchL1extra);    
    cfg.lookupValue("branch.selectBranchReco",selectBranchReco);    
    cfg.lookupValue("branch.selectBranchMC",selectBranchMC);    
    cout << "Branch Selections...ok"<< endl;
    /**********************************/

    
print();
    fillMenu(omenu);   
    printMenu(omenu);   

    //cout << "Done!" << endl;
  }
  catch (...) {
    cout << endl << "Reading cfg file "<< cfgfile <<" failed. Exit!" << endl;
  }

  convert();  // Convert cross-sections to cm^2
  
}