Esempio n. 1
0
ReadSiteconProto::ReadSiteconProto(const Descriptor& _desc, const QList<PortDescriptor*>& _ports, const QList<Attribute*>& _attrs ) 
: SiteconIOProto( _desc, _ports, _attrs ) {
    
    attrs << new Attribute(BaseAttributes::URL_IN_ATTRIBUTE(), BaseTypes::STRING_TYPE(), true);
    QMap<QString, PropertyDelegate*> delegateMap;
    delegateMap[BaseAttributes::URL_IN_ATTRIBUTE().getId()] = new URLDelegate(SiteconIO::getFileFilter(), SiteconIO::SITECON_ID, true, false, false);
    setEditor(new DelegateEditor(delegateMap));
    setIconPath(":sitecon/images/sitecon.png");
}
Esempio n. 2
0
void setImagePath(F_CMD_ARGS)
{
    extern char *PixmapPath, *IconPath;
    char *newPixmapPath = strdup(PixmapPath);
    char *newIconPath   = strdup(IconPath  );
    setPath( &newPixmapPath, action, 1 );
    setPath( &newIconPath,   action, 1 );
    setPixmapPath(eventp, w, tmp_win, context, newPixmapPath, Module);
    setIconPath  (eventp, w, tmp_win, context, newIconPath,   Module);
}
Esempio n. 3
0
WriteSiteconProto::WriteSiteconProto(const Descriptor& _desc, const QList<PortDescriptor*>& _ports, const QList<Attribute*>& _attrs ) 
: SiteconIOProto( _desc, _ports, _attrs ) {
    attrs << new Attribute(BaseAttributes::URL_OUT_ATTRIBUTE(), BaseTypes::STRING_TYPE(), true );
    attrs << new Attribute(BaseAttributes::FILE_MODE_ATTRIBUTE(), BaseTypes::NUM_TYPE(), false, SaveDoc_Roll);

    QMap<QString, PropertyDelegate*> delegateMap;
    delegateMap[BaseAttributes::URL_OUT_ATTRIBUTE().getId()] = new URLDelegate(SiteconIO::getFileFilter(), SiteconIO::SITECON_ID);
    delegateMap[BaseAttributes::FILE_MODE_ATTRIBUTE().getId()] = new FileModeDelegate(false);
    
    setEditor(new DelegateEditor(delegateMap));
    setIconPath(":sitecon/images/sitecon.png");
    setValidator(new ScreenedParamValidator(BaseAttributes::URL_OUT_ATTRIBUTE().getId(), ports.first()->getId(), BaseSlots::URL_SLOT().getId()));
    setPortValidator(SITECON_IN_PORT_ID, new ScreenedSlotValidator(BaseSlots::URL_SLOT().getId()));
}
void
KbfxPlasmaCanvasItem::setExec ( QString desktopfile )
{
	m_desktopFile = new KDesktopFile ( desktopfile );
	m_desktopFilePath = desktopfile;
	bool check = m_desktopFile->isAuthorizedDesktopFile ( desktopfile );

	setLabelText ( m_desktopFile->readName() );
	setComment ( m_desktopFile->readComment() );
	setIconPath ( m_desktopFile->readIcon() );

	if ( check == 0 )
	{
		m_restricted = true;
		m_error = "Adiministrator Blocked";
		delete m_desktopFile;
		return ;
	}
	delete m_desktopFile;
}
void
KbfxPlasmaCanvasItem::setSource ( KbfxDataSource src )
{


	m_source  = new KbfxDataSource();
	*m_source = src;
	if ( src.type() == KbfxDataSource::DESKTOP )
	{
		this->setExec ( src.desktopFile () );
	}
	else
	{
		setLabelText ( src.name() );
		setName ( src.name() );
		setComment ( src.comment() );
		setIconPath ( src.icon() );

	}

}