本文整理汇总了C++中SystemDialog::confirmButton方法的典型用法代码示例。如果您正苦于以下问题:C++ SystemDialog::confirmButton方法的具体用法?C++ SystemDialog::confirmButton怎么用?C++ SystemDialog::confirmButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SystemDialog
的用法示例。
在下文中一共展示了SystemDialog::confirmButton方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteAllPushes
void App::deleteAllPushes()
{
SystemDialog deleteAllDialog;
deleteAllDialog.setTitle("Delete ALL");
deleteAllDialog.setBody("Delete All Items?");
deleteAllDialog.confirmButton()->setLabel("Delete");
if (deleteAllDialog.exec() == SystemUiResult::ConfirmButtonSelection) {
m_pushNotificationService.removeAllPushes();
}
}
示例2: deletePush
void App::deletePush(const QVariantMap &item)
{
SystemDialog deleteDialog;
deleteDialog.setTitle("Delete");
deleteDialog.setBody("Delete Item?");
deleteDialog.confirmButton()->setLabel("Delete");
if (deleteDialog.exec() == SystemUiResult::ConfirmButtonSelection) {
Push push(item);
m_pushNotificationService.removePush(push.seqNum());
m_model->remove(item);
}
}
示例3: deletePush
void App::deletePush(const QVariantMap &item)
{
SystemDialog deleteDialog;
deleteDialog.setTitle("Delete");
deleteDialog.setBody("Delete Item?");
deleteDialog.confirmButton()->setLabel("Delete");
if (deleteDialog.exec() == SystemUiResult::ConfirmButtonSelection) {
Push push(item);
m_pushHandler->remove(push.seqNum());
m_model->remove(item);
// The push has been deleted, so delete the notification
Notification::deleteFromInbox(NOTIFICATION_PREFIX + QString::number(push.seqNum()));
}
}
示例4: onSimChanged
void App::onSimChanged()
{
// Remove the currently registered user (if there is one)
// and unsubscribe the user from the Push Initiator since
// switching SIMs might indicate we are dealing with
// a different user
m_pushNotificationService.handleSimChange();
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();
}
}
示例5: 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;
}
}