Esempio n. 1
0
bool VCWidget::loadXMLAppearance(const QDomElement* root)
{
    QDomNode node;
    QDomElement tag;

    Q_ASSERT(root != NULL);

    if (root->tagName() != KXMLQLCVCWidgetAppearance)
    {
        qWarning() << Q_FUNC_INFO << "Appearance node not found!";
        return false;
    }

    /* Children */
    node = root->firstChild();
    while (node.isNull() == false)
    {
        tag = node.toElement();
        if (tag.tagName() == KXMLQLCVCWidgetForegroundColor)
        {
            if (tag.text() != KXMLQLCVCWidgetColorDefault)
                setForegroundColor(QColor(tag.text().toUInt()));
            else if (hasCustomForegroundColor() == true)
                resetForegroundColor();
        }
        else if (tag.tagName() == KXMLQLCVCWidgetBackgroundColor)
        {
            if (tag.text() != KXMLQLCVCWidgetColorDefault)
                setBackgroundColor(QColor(tag.text().toUInt()));
        }
/*
        else if (tag.tagName() == KXMLQLCVCWidgetBackgroundImage)
        {
            if (tag.text() != KXMLQLCVCWidgetBackgroundImageNone)
                setBackgroundImage(m_doc->denormalizeComponentPath(tag.text()));
        }
*/
        else if (tag.tagName() == KXMLQLCVCWidgetFont)
        {
            if (tag.text() != KXMLQLCVCWidgetFontDefault)
            {
                QFont font;
                font.fromString(tag.text());
                setFont(font);
            }
        }
        else if (tag.tagName() == KXMLQLCVCFrameStyle)
        {
            /** LEGACY: no more supported/needed */
        }
        else
        {
            qWarning() << Q_FUNC_INFO << "Unknown appearance tag:" << tag.tagName();
        }

        node = node.nextSibling();
    }

    return true;
}
Esempio n. 2
0
void VCWidget::slotMenuCallback(int item)
{
	switch (item)
	{
	case KVCMenuEditCut:
		break;
	case KVCMenuEditCopy:
		break;
	case KVCMenuEditPaste:
		break;
	case KVCMenuEditDelete:
		scram();
		break;

	case KVCMenuEditRename:
		rename();
		break;

	case KVCMenuEditProperties:
		editProperties();
		break;

	case KVCMenuForegroundColor:
		chooseForegroundColor();
		break;

	case KVCMenuForegroundDefault:
		resetForegroundColor();
		break;

	case KVCMenuBackgroundColor:
		chooseBackgroundColor();
		break;
	
	case KVCMenuBackgroundImage:
		chooseBackgroundImage();
		break;
	
	case KVCMenuBackgroundDefault:
		resetBackgroundColor();
		break;

	case KVCMenuFont:
		chooseFont();
		break;

	case KVCMenuFontDefault:
		resetFont();
		break;

	case KVCMenuFrameSunken:
		setFrameStyle(KVCWidgetFrameStyleSunken);
		break;

	case KVCMenuFrameRaised:
		setFrameStyle(KVCWidgetFrameStyleRaised);
		break;

	case KVCMenuFrameNone:
		setFrameStyle(KVCWidgetFrameStyleNone);
		break;

	case KVCMenuStackingRaise:
		raise();
		break;

	case KVCMenuStackingLower:
		lower();
		break;

	default:
		break;
	}
}