Example #1
0
void HTMLLinkElement::parseAttribute(Attribute* attr)
{
    if (attr->name() == relAttr) {
        m_relAttribute = LinkRelAttribute(attr->value());
        process();
    } else if (attr->name() == hrefAttr) {
        String url = stripLeadingAndTrailingHTMLSpaces(attr->value());
        m_url = url.isEmpty() ? KURL() : document()->completeURL(url);
        process();
    } else if (attr->name() == typeAttr) {
        m_type = attr->value();
        process();
    } else if (attr->name() == sizesAttr) {
        setSizes(attr->value());
        process();
    } else if (attr->name() == mediaAttr) {
        m_media = attr->value().string().lower();
        process();
    } else if (attr->name() == disabledAttr)
        setDisabledState(!attr->isNull());
    else if (attr->name() == onbeforeloadAttr)
        setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
    else if (attr->name() == onloadAttr)
        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
    else if (attr->name() == onerrorAttr)
        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attr));
    else {
        if (attr->name() == titleAttr && m_sheet)
            m_sheet->setTitle(attr->value());
        HTMLElement::parseAttribute(attr);
    }
}
Example #2
0
void OpenNIC::tcpError(QAbstractSocket::SocketError socketError)
{
	if ( socketError != QAbstractSocket::RemoteHostClosedError )
	{
		setDisabledState();
		mBalloonStatus = tr( "Failed to connect to OpenNIC service. [" ) + QString::number((int)socketError) + "]";
		mTcpSocket.close();
		slowRefresh();
	}
}
Example #3
0
OpenNIC::OpenNIC(QWidget *parent)
: inherited(parent)
, mActionSettings(NULL)
, mActionAbout(NULL)
, mActionQuit(NULL)
, mTrayIcon(NULL)
, mTrayIconMenu(NULL)
, ui(new Ui::OpenNICSettings)
, mRefreshTimer(0)
, mPacketState(0)
, mPacketLength(0)
, mTcpListenPort(0)
, mInitialized(false)
, mBalloonIcon(QSystemTrayIcon::Information)
, mActiveState(false)
, mScoreRulesTextChanged(false)
{
	ui->setupUi(this);
	createActions();
	createTrayIcon();
	QObject::connect(this,SIGNAL(accepted()),this,SLOT(writeSettings()));
	mTcpSocket.close();
	mBalloonStatus = tr("Initializing...");
	mRefreshTimer = startTimer(DEFAULT_REFRESH);
	mLocalNet = new OpenNICNet(&mTcpSocket);
	QObject::connect(mLocalNet,SIGNAL(dataReady(OpenNICNet*)),this,SLOT(dataReady(OpenNICNet*)));
	QObject::connect(&mTcpSocket,SIGNAL(connected()),this,SLOT(tcpConnected()));
	QObject::connect(&mTcpSocket,SIGNAL(disconnected()),this,SLOT(tcpDisconnected()));
	QObject::connect(&mTcpSocket,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(tcpError(QAbstractSocket::SocketError)));
	QObject::connect(&mTcpSocket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(tcpStateChanged(QAbstractSocket::SocketState)));
	QObject::connect(&mTcpSocket,SIGNAL(hostFound()),this,SLOT(tcpHostFound()));
	QObject::connect(this,SIGNAL(accepted()),this,SLOT(update()));
	QObject::connect(ui->saveT1List,SIGNAL(clicked()),this,SLOT(updateT1List()));
	QObject::connect(ui->buttonBox,SIGNAL(clicked(QAbstractButton*)),this,SLOT(clicked(QAbstractButton*)));
	QObject::connect(ui->refreshNow,SIGNAL(clicked()),this,SLOT(updateDNS()));
	QObject::connect(ui->tabs,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
	QObject::connect(ui->saveDomains,SIGNAL(clicked()),this,SLOT(updateDomains()));
	QObject::connect(ui->resolverPoolTable,SIGNAL(cellClicked(int,int)),this,SLOT(cellClicked(int,int)));
	QObject::connect(ui->resolverPoolTable,SIGNAL(cellDoubleClicked(int,int)),this,SLOT(cellDoubleClicked(int,int)));
	QObject::connect(ui->scoreRuleEditor,SIGNAL(textChanged()),this,SLOT(scoreRuleEditorTextChanged()));
	setDisabledState();
}
Example #4
0
wyButton::wyButton(wyNode* normal, wyNode* selected, wyNode* disabled, wyNode* focused, wyTargetSelector* downSelector, wyTargetSelector* upSelector) :
		m_clickScale(1.f),
		m_originalScale(0.f),
		m_normalState(NULL),
		m_selectedState(NULL),
		m_disabledState(NULL),
		m_focusedState(NULL) {
	setNormalState(normal);
	setSelectedState(selected);
	setDisabledState(disabled);
	setFocusedState(focused);
	setDownSelector(downSelector);
	setUpSelector(upSelector);

	float width = 0;
	float height = 0;
	if (normal != NULL) {
		width = normal->getWidth();
		height = normal->getHeight();
	}

	if (selected != NULL) {
		width = MAX(selected->getWidth(), width);
		height = MAX(selected->getHeight(), height);
	}

	if (disabled != NULL) {
		width = MAX(disabled->getWidth(), width);
		height = MAX(disabled->getHeight(), height);
	}
	if (focused != NULL) {
		width = MAX(focused->getWidth(), width);
		height = MAX(focused->getHeight(), height);
	}
	setContentSize(width, height);
	setTouchEnabled(true);
}
Example #5
0
void HTMLLinkElement::parseMappedAttribute(Attribute* attr)
{
    if (attr->name() == relAttr) {
        tokenizeRelAttribute(attr->value(), m_relAttribute);
        process();
    } else if (attr->name() == hrefAttr) {
// CAPPFIX_WEB_IMG_SRC_NULL
#if 1
        String url = stripLeadingAndTrailingHTMLSpaces(attr->value());
        m_url = url.isEmpty() ? KURL() : document()->completeURL(url);
#else
        m_url = document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attr->value()));
#endif
        process();
    } else if (attr->name() == typeAttr) {
        m_type = attr->value();
        process();
    } else if (attr->name() == mediaAttr) {
        m_media = attr->value().string().lower();
        process();
    } else if (attr->name() == disabledAttr)
        setDisabledState(!attr->isNull());
    else if (attr->name() == onbeforeloadAttr)
        setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
#if ENABLE(LINK_PREFETCH)
    else if (attr->name() == onloadAttr)
        setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
    else if (attr->name() == onerrorAttr)
        setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attr));
#endif
    else {
        if (attr->name() == titleAttr && m_sheet)
            m_sheet->setTitle(attr->value());
        HTMLElement::parseMappedAttribute(attr);
    }
}
void HTMLLinkElement::parseMappedAttribute(Attribute* attr)
{
    if (attr->name() == relAttr) {
        tokenizeRelAttribute(attr->value(), m_relAttribute);
        process();
    } else if (attr->name() == hrefAttr) {
        m_url = document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attr->value()));
        process();
    } else if (attr->name() == typeAttr) {
        m_type = attr->value();
        process();
    } else if (attr->name() == mediaAttr) {
        m_media = attr->value().string().lower();
        process();
    } else if (attr->name() == disabledAttr)
        setDisabledState(!attr->isNull());
    else if (attr->name() == onbeforeloadAttr)
        setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
    else {
        if (attr->name() == titleAttr && m_sheet)
            m_sheet->setTitle(attr->value());
        HTMLElement::parseMappedAttribute(attr);
    }
}
void HTMLLinkElement::parseMappedAttribute(MappedAttribute *attr)
{
    if (attr->name() == relAttr) {
        tokenizeRelAttribute(attr->value(), m_isStyleSheet, m_alternate, m_isIcon, m_isDNSPrefetch);
        process();
    } else if (attr->name() == hrefAttr) {
        m_url = document()->completeURL(deprecatedParseURL(attr->value()));
        process();
    } else if (attr->name() == typeAttr) {
        m_type = attr->value();
        process();
    } else if (attr->name() == mediaAttr) {
        m_media = attr->value().string().lower();
        process();
    } else if (attr->name() == disabledAttr) {
        setDisabledState(!attr->isNull());
    } else if (attr->name() == onbeforeloadAttr)
        setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
    else {
        if (attr->name() == titleAttr && m_sheet)
            m_sheet->setTitle(attr->value());
        HTMLElement::parseMappedAttribute(attr);
    }
}