コード例 #1
0
// Child windows functions
void MainWindow::createChildWindows()
{
	currentRecipient = ALL_FRIENDS_ID;

	// Creating drawing window
	drawingWindow = new DrawingWindow(this);

	connect(drawingWindow, SIGNAL(clipartWindowRequest()), this, SLOT(onShowClipart()));
	connect(drawingWindow, SIGNAL(messageSent()), this, SLOT(onMessageSent()));
	connect(drawingWindow, SIGNAL(replyChanged()), tvWidget, SLOT(replyChanged()));
	
	drawingWindow->updatePosition(this);

	historyWindow = new HistoryWindow(this);
	historyWindow->setTvWidget(tvWidget);

	connect(historyWindow, SIGNAL(beginOfPreview(const MessageKey &)), tvWidget, SLOT(showHistoryMessage(const MessageKey &)));
	connect(historyWindow, SIGNAL(endOfPreview()), tvWidget, SLOT(stopShowingHistory()));
	connect(historyWindow, SIGNAL(clicked(const MessageKey &)), tvWidget, SLOT(scrollToMessage(const MessageKey &)));
	connect(historyWindow, SIGNAL(deleteMessages(const QList<MessageKey> &)), tvWidget, SLOT(deleteMessages(const QList<MessageKey> &)));
	connect(historyWindow, SIGNAL(saveMessage()), tvWidget, SLOT(saveMessage()));
	connect(historyWindow, SIGNAL(copyMessage()), tvWidget, SLOT(copyMessage()));

	connect(tvWidget, SIGNAL(publishRequest(const MessageKey &)), historyWindow, SLOT(publishMessage(const MessageKey &)));

	historyWindow->updatePosition(this);

	contactList = new NewContactListWindow(this);
	contactList->updatePosition(this);
	contactList->initAutoUpdater(&autoUpdater);
	
	// Connect menu signals
	connect(contactList, SIGNAL(goOnline()), this, SLOT(relogon()));
	connect(contactList, SIGNAL(goOffline()), this, SLOT(offline()));
	connect(contactList, SIGNAL(goLogout()), this, SLOT(logout()));
	connect(contactList, SIGNAL(goExit()), this, SLOT(shutDown()));
	connect(contactList, SIGNAL(contactSelected(qint32)), this, SLOT(onContactSelected(qint32)));
	connect(contactList, SIGNAL(contactImageDrop(qint32, const QImage &)), this, SLOT(onContactImageDrop(qint32, const QImage &)));
	connect(contactList, SIGNAL(soundStateChanged(const bool)), this, SLOT(onSoundStateChanged(const bool)));
	connect(contactList, SIGNAL(unreadContacts(int)), contactListButton, SLOT(update(int)));
#ifdef Q_WS_MAC
    connect(contactList, SIGNAL(unreadContacts(int)), DockIconHandler::instance(), SLOT(unreadCountChanged(int)));
#endif
	connect(contactList, SIGNAL(historyCleared()), tvWidget, SLOT(reload()));

	connect(welcomeWidget, SIGNAL(showProfileDialog()), contactList, SLOT(onShowProfileDialog()));
	connect(welcomeWidget, SIGNAL(showFindFriendsDialog()), contactList, SLOT(onShowFindDialog()));
}
コード例 #2
0
void QQmlNetwork::setReply(const QString reply)
{
    if(m_reply == reply)
        return;
    m_reply = reply;
    emit replyChanged();
}
コード例 #3
0
void CreatePostLoader::handleReply(AbstractProcessor *processor)
{
    Q_D(CreatePostLoader);
    SimpleCreateObjectProcessor *postProcessor = qobject_cast<SimpleCreateObjectProcessor *>(processor);
    if (d->reply) {
        d->reply->deleteLater();
    }

    d->reply = postProcessor->object();
    d->reply->setParent(this);
    emit replyChanged();
}
コード例 #4
0
void FileDownloader::fileDownloaded(QNetworkReply *pReply) {

	if(m_reply->error() != QNetworkReply::NoError) {

		if(m_reply->error() != QNetworkReply::OperationCanceledError) {
			emit error(m_reply->errorString());
		} else {
			emit canceled();
		}

	} else {

		QVariant redirectTarget =
				m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);

		if(!redirectTarget.isNull()) {

			m_url = m_url.resolved(redirectTarget.toUrl());
			qWarning("Redirect to: %s", qPrintable(m_url.toString()));

			QObject::disconnect(m_reply, SIGNAL(downloadProgress(qint64,qint64)),
								this, SLOT(downloadProgress(qint64,qint64)));

			m_reply->deleteLater();
			m_request.setUrl(m_url);
			m_reply = m_WebCtrl.get(m_request);

			QObject::connect(m_reply, SIGNAL(downloadProgress(qint64,qint64)),
							 this, SLOT(downloadProgress(qint64,qint64)));

			emit replyChanged(m_reply);

		} else {
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
			m_rawHeaderPairs = m_reply->rawHeaderPairs();
#else
			m_rawHeaderPairs.clear();

			foreach(const QByteArray &rhk, m_reply->rawHeaderList()) {
				m_rawHeaderPairs.append(RAWHEADERPAIR(rhk, m_reply->rawHeader(rhk)));
			}
#endif

			m_DownloadedData = pReply->readAll();

			m_reply->deleteLater();

			emit downloaded(*this);
		}
	}
}
コード例 #5
0
int MoodBox::DrawingWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clipartWindowRequest(); break;
        case 1: messageSent(); break;
        case 2: replyChanged(); break;
        case 3: clear(); break;
        case 4: reset(); break;
        case 5: addImage((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 6: addReply((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 7: on_penToolButton_clicked(); break;
        case 8: on_simplebrushToolButton_clicked(); break;
        case 9: on_oilbrushToolButton_clicked(); break;
        case 10: on_sprayToolButton_clicked(); break;
        case 11: on_eraserToolButton_clicked(); break;
        case 12: on_textToolButton_clicked(); break;
        case 13: on_picturesToolButton_clicked(); break;
        case 14: on_sendButton_clicked(); break;
        case 15: onItemAdded((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 16: onItemRemoved((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 17: onSceneCleared(); break;
        case 18: onSaveScene(); break;
        case 19: onSceneColorChanged(); break;
        case 20: onUndoChanged(); break;
        case 21: onContactListChanged(); break;
        case 22: onContactAuthorizationChanged((*reinterpret_cast< qint32(*)>(_a[1]))); break;
        case 23: onUserOnlineChanged(); break;
        default: ;
        }
        _id -= 24;
    }
    return _id;
}