Ejemplo n.º 1
0
 void CProfileRepoServerClb::OnRequest(Ipc::MsgID id, UInt8 const* pPayload, UInt32 payloadSize, UInt8* const pResponseBuffer, UInt32& bufferSize, Ipc::DirectionID)
 {
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
    const RepoRequest * req = reinterpret_cast<const RepoRequest*>(pPayload);
    switch (req->type)
    {
    case REQ_ADD_PROFILE_API:
       addProfileAPI(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_REMOVE_PROFILE_API:
       removeProfileAPI(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_ADD_PROFILE:
       addProfile(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_REMOVE_PROFILE:
       removeProfile(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_ADD_PROFILE_IMPLEMENTATION:
       addProfileImplementation(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_REMOVE_PROFILE_IMPLEMENTATION_PL:
       removeProfileImplementationPl(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_FIND_PROFILES:
       findProfiles(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_GET_MANIFEST:
       getManifest(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    case REQ_GET_PROFILE_LIST:
       getProfilesList(req,payloadSize,pResponseBuffer,bufferSize);
       break;
    }
 }
Ejemplo n.º 2
0
void ProfileOpenDlg::reload(const QString &choose)
{
	QStringList list = getProfilesList();

	cb_profile->clear();

	if(list.count() == 0) {
		gb_open->setEnabled(false);
		pb_open->setEnabled(false);
		pb_profiles->setFocus();
	}
	else {
		int x = 0;
		for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
			cb_profile->addItem(*it);
			if((choose.isEmpty() && x == 0) || (choose == *it)) {
				cb_profile->setCurrentIndex(x);
			}
			++x;
		}

		gb_open->setEnabled(true);
		pb_open->setEnabled(true);
		pb_open->setFocus();
	}
}
Ejemplo n.º 3
0
ProfileManageDlg::ProfileManageDlg(const QString &choose, QWidget *parent)
:QDialog(parent)
{
	setupUi(this);
	setModal(true);
	setWindowTitle(CAP(windowTitle()));

	// setup signals
	connect(pb_new, SIGNAL(clicked()), SLOT(slotProfileNew()));
	connect(pb_rename, SIGNAL(clicked()), SLOT(slotProfileRename()));
	connect(pb_delete, SIGNAL(clicked()), SLOT(slotProfileDelete()));
	connect(lbx_profiles, SIGNAL(currentRowChanged(int)), SLOT(updateSelection()));

	// load the listing
	QStringList list = getProfilesList();
	int x = 0;
	for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
		lbx_profiles->addItem(*it);
		if(*it == choose)
			lbx_profiles->setCurrentRow(x);
		++x;
	}

	updateSelection();
}
Ejemplo n.º 4
0
/**
 * \brief Picks one of running Psi instances and returns its profile name.
 */
QString ActiveProfiles::pickProfile() const
{
	QStringList profiles = getProfilesList();
	foreach (QString p, profiles) {
		if (isActive(p)) {
			return p;
		}
	}
	return "";
}