Beispiel #1
0
void LocalRedirectServer::ReadyRead(QTcpSocket* socket, QByteArray buffer) {
  buffer.append(socket->readAll());
  if (socket->atEnd() || buffer.endsWith("\r\n\r\n")) {
    WriteTemplate(socket);
    socket->deleteLater();
    request_url_ = ParseUrlFromRequest(buffer);
    emit Finished();
  } else {
    NewClosure(socket, SIGNAL(readyRead()), this,
               SLOT(ReadyReady(QTcpSocket*, QByteArray)), socket, buffer);
  }
}
void
JXWMainDialog::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (sender == itsCreateButton && message.Is(JXButton::kPushed))
		{
		if (WriteTemplate())
			{
			JPrefObject::WritePrefs();
			(JXGetApplication())->Quit();
			}
		}
	else if (sender == itsQuitButton && message.Is(JXButton::kPushed))
		{
		(JXGetApplication())->Quit();
		}
	else if (sender == itsHelpButton && message.Is(JXButton::kPushed))
		{
		(JXGetHelpManager())->ShowSection(kJXWMainHelpName);
		}

	else if (sender == itsChooseProjDirButton && message.Is(JXButton::kPushed))
		{
		itsProjectDir->ChoosePath("");
		}
	else if (sender == itsChooseTmplDirButton && message.Is(JXButton::kPushed))
		{
		itsTemplateDir->ChoosePath("");
		}

	else if (sender == itsTmplDirHistory && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast(const JXMenu::ItemSelected*, &message);
		assert( selection != NULL );
		itsTemplateDir->SetText(
			itsTmplDirHistory->JXTextMenu::GetItemText(selection->GetIndex()));
		}

	else
		{