当前位置: 首页>>代码示例>>C++>>正文


C++ StatusMessage::status方法代码示例

本文整理汇总了C++中StatusMessage::status方法的典型用法代码示例。如果您正苦于以下问题:C++ StatusMessage::status方法的具体用法?C++ StatusMessage::status怎么用?C++ StatusMessage::status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StatusMessage的用法示例。


在下文中一共展示了StatusMessage::status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: save

void MessageDAO::save(const StatusMessage &statusMsg)
{
    QSettings settings;
    settings.beginGroup(QSETTINGS_MESSAGE_GROUP);
    settings.setValue(STATUS_KEY, statusMsg.status());
    settings.setValue(MESSAGE_KEY, statusMsg.message());
    settings.setValue(CODE_KEY, statusMsg.code());
    settings.endGroup();
}
开发者ID:AnujAroshA,项目名称:Cascades-Samples,代码行数:9,代码来源:MessageDAO.cpp

示例2: onMessageReceived

void App::onMessageReceived(const StatusMessage &statusMsg)
{
	// remove message
	m_messageReader->remove();

	// Determine the appropriate action to take by checking the status of the message
	if(QString::compare(PUSH_COLLECTOR_LAUNCH_CONFIG, statusMsg.status()) == 0){

		Sheet* configSheet = Application::instance()->findChild<Sheet*>("configurationSheet");
		if (configSheet) {
			configSheet->open();
		}

		showDialog(tr("Push Collector"), tr("No configuration settings were found. Please fill them in."));

	} else if(QString::compare(PUSH_COLLECTOR_CREATE_SESSION_COMPLETE, statusMsg.status()) == 0){

		emit closeProgressDialog();

		if (statusMsg.code() == PushErrorCode::NoError) {
			if (m_configSaveAction){
				showDialog(tr("Configuration"),tr("Configuration was saved. Please register now."));
			}
		} else{
			if (m_configSaveAction) {
				showDialog(tr("Configuration"), tr("Configuration was saved, but was unable to create push session. (Error code: %0)").arg(statusMsg.code()));
			} else {
				// Typically in your own application you wouldn't want to display this error to your users
				showToast(tr("Error: unable to create push session. (Error code: %0)").arg(statusMsg.code()));
			}
		}

		m_configSaveAction = false;

	} else if(QString::compare(PUSH_COLLECTOR_CREATE_CHANNEL_COMPLETE, statusMsg.status()) == 0){
		emit closeProgressDialog();
		showDialog(tr("Register"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_REGISTER_WITH_PUSH_INITIATOR, statusMsg.status()) == 0){
		openProgressDialog(tr("Register"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_REGISTER_WITH_PUSH_INITIATOR_COMPLETE, statusMsg.status()) == 0){
		emit closeProgressDialog();
		showDialog(tr("Register"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_DESTROY_CHANNEL_COMPLETE, statusMsg.status()) == 0){
		emit closeProgressDialog();
		showDialog(tr("Unregister"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_DEREGISTER_WITH_PUSH_INITIATOR, statusMsg.status()) == 0){
		openProgressDialog(tr("Unregister"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_DEREGISTER_WITH_PUSH_INITIATOR_COMPLETE, statusMsg.status()) == 0){
		emit closeProgressDialog();
		showDialog(tr("Unregister"), statusMsg.message());

	} else if(QString::compare(PUSH_COLLECTOR_SIM_CHANGE, statusMsg.status()) == 0) {

	    SystemDialog simChangeDialog;
	    simChangeDialog.setTitle("Push Collector");
	    simChangeDialog.setBody("The SIM card was changed and, as a result, the current user has been unregistered. Would you like to re-register?");
	    simChangeDialog.confirmButton()->setLabel("Yes");
	    simChangeDialog.cancelButton()->setLabel("No");

	    if (simChangeDialog.exec() == SystemUiResult::ConfirmButtonSelection) {
	        createChannel();
	    }

	} else if(QString::compare(PUSH_COLLECTOR_REFRESH_MODEL, statusMsg.status()) == 0){
		loadModelData();

	} else if(QString::compare(PUSH_COLLECTOR_NO_PUSH_SERVICE_CONNECTION, statusMsg.status()) == 0){

		QString message;
	    if (m_configSaveAction) {
	    	message = tr("Configuration was saved, but lost connection to the Push Agent. Trying to reconnect...");
	    } else {
	    	message = tr("Lost connection to the Push Agent. Trying to reconnect...");
	    }
	    showToast(message);
	    m_configSaveAction = false;

	} else if(QString::compare(PUSH_COLLECTOR_SHOW_DIALOG, statusMsg.status()) == 0){
		emit closeProgressDialog();
		showDialog(tr("Push Collector"), statusMsg.message());

	} else {
		emit closeProgressDialog();
		showToast(statusMsg.message());
		m_configSaveAction = false;
	}
}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:92,代码来源:app.cpp


注:本文中的StatusMessage::status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。