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


C++ SystemDialog类代码示例

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


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

示例1: foreach

void NetImageManager::onSslErrors(QNetworkReply * reply,
		const QList<QSslError> & errors) {

	foreach (QSslError e, errors)
        qDebug() << "SSL error: " << e;



    SystemDialog *dialog = new SystemDialog("OK");

     dialog->setTitle(tr("SSL errors received"));
     dialog->setBody(tr("We have received information about a security breach in the protocol. Press \"OK\" to terminate the application"));


     // Connect your functions to handle the predefined signals for the buttons.
     // The slot will check the SystemUiResult to see which button was clicked.

     bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));

     if (success) {
         // Signal was successfully connected.
         // Now show the dialog box in your UI

         dialog->show();
     } else {
         // Failed to connect to signal.
         dialog->deleteLater();
     }

}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:33,代码来源:netimagemanager.cpp

示例2: SystemDialog

void BugReportController::insertComment(const QString &body, int issueNumber) {
    // get the list of issues
    m_TmpBody = body;
    m_TmpLabel = issueNumber;

    if(body.isEmpty()) {
        bb::system::SystemToast *toast = new bb::system::SystemToast(this);

        toast->setBody(tr("A comment should not be empty."));
        toast->setPosition(bb::system::SystemUiPosition::MiddleCenter);
        toast->show();
        return;

    }

    using namespace bb::cascades;
    using namespace bb::system;

    SystemDialog *dialog = new SystemDialog("Yes", "No");

    dialog->setTitle(tr("Create a new comment"));
    dialog->setBody(tr("Do you want to submit this comment? Please make sure that the content of the message is anonymous."));

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onPromptFinishedCreateComment(bb::system::SystemUiResult::Type)));

    if (success) {
        dialog->show();
    } else {
        dialog->deleteLater();
    }
}
开发者ID:amonchakai,项目名称:Gh10,代码行数:34,代码来源:BugReportController.cpp

示例3: onPromptFinishedCreateComment

void BugReportController::onPromptFinishedCreateComment(bb::system::SystemUiResult::Type result) {

    using namespace bb::cascades;
    using namespace bb::system;

    if(result != bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
        prompt->deleteLater();
        return;
    }

    SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
    prompt->deleteLater();

    const QUrl url(GITHUB_URL + REPOSITORY + "/issues/" + QString::number(m_TmpLabel) + "/comments");


    QString label_str = m_Labels.key(m_TmpLabel);


    QByteArray datas;
    datas += QString("{").toAscii();
    datas += QString(QString("\"body\": \"") + m_TmpBody + "\"").toAscii();
    datas += QString("}").toAscii();

    QNetworkRequest request(url);
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
    request.setRawHeader("Authorization", (QString("token ") + GITHUB_ACCESS_TOKEN).toAscii());


    QNetworkReply* reply = m_NetworkAccessManager->post(request, datas);
    bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReplyInsertComment()));
    Q_ASSERT(ok);
    Q_UNUSED(ok);
}
开发者ID:amonchakai,项目名称:Gh10,代码行数:35,代码来源:BugReportController.cpp

示例4: QObject

RegistrationHandler::RegistrationHandler(const QUuid &uuid, QObject *parent)
    : QObject(parent)
    , m_context(uuid)
    , m_isAllowed(false)
    , m_progress(BbmRegistrationProgress::NotStarted)
    , m_temporaryError(false)
	, m_statusMessage(tr(""))

	// In the class provided by BlackBerry a message is displayed, but I think it is cleaner not to display anything here.
	// While connecting, an overlay toast will give feedback to the user.
	// If there is a problem, then the error message will also be displayed.
	//, m_statusMessage(tr("Please wait while the application connects to BBM."))

{
    QmlDocument* qml = QmlDocument::create("asset:///registration.qml")
                       .parent(this);
    qml->setContextProperty("_registrationHandler", this);
    AbstractPane *root = qml->createRootObject<AbstractPane>();
    Application::instance()->setScene(root);
    if (uuid.isNull()) {
        SystemDialog *uuidDialog = new SystemDialog("OK");
        uuidDialog->setTitle("UUID Error");
        uuidDialog->setBody("Invalid/Empty UUID, please set correctly in main.cpp");
        connect(uuidDialog, SIGNAL(finished(bb::system::SystemUiResult::Type)), this, SLOT(dialogFinished(bb::system::SystemUiResult::Type)));
        uuidDialog->show();
        return;
    }
    connect(&m_context,
            SIGNAL(registrationStateUpdated(
                   bb::platform::bbm::RegistrationState::Type)),
            this,
            SLOT(processRegistrationStatus(
                 bb::platform::bbm::RegistrationState::Type)));
}
开发者ID:KonradIT,项目名称:EasyGo,代码行数:34,代码来源:RegistrationHandler.cpp

示例5: qDebug

void DriveController::onPromptFinishedShareFile(bb::system::SystemUiResult::Type result) {
    using namespace bb::cascades;
    using namespace bb::system;

    qDebug() << "onPromptFinishedShareFile " << result;

    if(result == bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
        if(prompt != NULL) {

            QString url;
            m_Mutex.lockForRead();
            for(int i = 0 ; i < m_DriveItems.length() ; ++i)
                if(m_DriveItems.at(i)->getID() == m_SelectedItemForSharing) {
                    url = m_DriveItems.at(i)->getOpenLink();
                    break;
                }
            m_Mutex.unlock();

            m_Google->shareId(m_SelectedItemForSharing, url);

            prompt->deleteLater();
        }
    }
}
开发者ID:Jendorski,项目名称:Hg10,代码行数:25,代码来源:DriveController.cpp

示例6: QObject

RegistrationHandler::RegistrationHandler(const QUuid &uuid, QObject *parent)
    : QObject(parent)
    , m_context(uuid)
    , m_isAllowed(false)
    , m_progress(BbmRegistrationProgress::NotStarted)
    , m_temporaryError(false)
    , m_statusMessage(tr("Please wait while the application connects to BBM."))
{
    QmlDocument* qml = QmlDocument::create("asset:///registration.qml")
                       .parent(this);
    qml->setContextProperty("_registrationHandler", this);
    AbstractPane *root = qml->createRootObject<AbstractPane>();

    if (uuid.isNull()) {
    	SystemDialog *uuidDialog = new SystemDialog("OK");
    	uuidDialog->setTitle("UUID Error");
        uuidDialog->setBody("Invalid/Empty UUID, please set correctly in main.cpp");
        connect(uuidDialog, SIGNAL(finished(bb::system::SystemUiResult::Type)), this, SLOT(dialogFinished(bb::system::SystemUiResult::Type)));
        uuidDialog->show();
        return;
    }
    connect(&m_context,
            SIGNAL(registrationStateUpdated(
                   bb::platform::bbm::RegistrationState::Type)),
            this,
            SLOT(processRegistrationStatus(
                 bb::platform::bbm::RegistrationState::Type)));

    if (m_context.isAccessAllowed()){ // jika sudah teregister langsung ke main app
    	qDebug() << "access allowed";
    	finishRegistration();
    }else{ // jika belum, tampilkan halaman registrasi ini.
        Application::instance()->setScene(root);
    }
}
开发者ID:ferdirn,项目名称:Quran,代码行数:35,代码来源:RegistrationHandler.cpp

示例7: SystemDialog

void BalanceController::deleteRecord(int id) {
    using namespace bb::cascades;
    using namespace bb::system;

    SystemDialog *dialog = new SystemDialog("Yes", "No");

    dialog->setTitle(tr("Delete record"));
    dialog->setBody(tr("Are you sure you want to delete this record? "));

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onPromptFinishedDeleteRecord(bb::system::SystemUiResult::Type)));

    if (success) {
        m_tmp_id = id;
        // Signal was successfully connected.
        // Now show the dialog box in your UI.
        dialog->show();
    } else {
        // Failed to connect to signal.
        // This is not normal in most cases and can be a critical
        // situation for your app! Make sure you know exactly why
        // this has happened. Add some code to recover from the
        // lost connection below this line.
        dialog->deleteLater();
    }
}
开发者ID:amonchakai,项目名称:Workout,代码行数:28,代码来源:BalanceController.cpp

示例8: 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();
    }
}
开发者ID:BGmot,项目名称:Cascades-Samples,代码行数:11,代码来源:app.cpp

示例9: SystemDialog

// Alert Dialog Box Functions
void TripMaster::alert(const QString &message)
{
    SystemDialog *dialog; // SystemDialog uses the BB10 native dialog.
    dialog = new SystemDialog(tr("OK"), 0); // New dialog with on 'Ok' button, no 'Cancel' button
    dialog->setTitle(tr("Alert")); // set a title for the message
    dialog->setBody(message); // set the message itself
    dialog->setDismissAutomatically(true); // Hides the dialog when a button is pressed.

    // Setup slot to mark the dialog for deletion in the next event loop after the dialog has been accepted.
    connect(dialog, SIGNAL(finished(bb::system::SystemUiResult::Type)), dialog, SLOT(deleteLater()));
    dialog->show();
}
开发者ID:rajivenator,项目名称:TripMaster,代码行数:13,代码来源:TripMaster.cpp

示例10: 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);
    }

}
开发者ID:ProLove365,项目名称:Cascades-Samples,代码行数:14,代码来源:app.cpp

示例11: qWarning

void DriveController::openForSharing(const QString &id, const QString &type) {

    // ----------------------------------------------------------------------------------------------
    // get the dataModel of the listview if not already available
    using namespace bb::cascades;

    if(m_ListView == NULL) {
        qWarning() << "did not received the listview. quit.";
        return;
    }

    GroupDataModel* dataModel = dynamic_cast<GroupDataModel*>(m_ListView->dataModel());

    if(type == "application/vnd.google-apps.folder") {
        if(dataModel != NULL)
            dataModel->clear();

        m_Google->getFileList(id);
    } else {
        using namespace bb::cascades;
        using namespace bb::system;

        SystemDialog *dialog = new SystemDialog("Yes", "No");

        dialog->setTitle("Share");
        dialog->setBody("Do you want to share this document?");

        bool success = connect(dialog,
             SIGNAL(finished(bb::system::SystemUiResult::Type)),
             this,
             SLOT(onPromptFinishedShareFile(bb::system::SystemUiResult::Type)));

        if (success) {
            // Signal was successfully connected.
            // Now show the dialog box in your UI.
            m_SelectedItemForSharing = id;
            dialog->show();
        } else {
            // Failed to connect to signal.
            // This is not normal in most cases and can be a critical
            // situation for your app! Make sure you know exactly why
            // this has happened. Add some code to recover from the
            // lost connection below this line.
            dialog->deleteLater();
        }

    }

}
开发者ID:Jendorski,项目名称:Hg10,代码行数:49,代码来源:DriveController.cpp

示例12: 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()));
    }
}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:16,代码来源:app.cpp

示例13: QObject

//! [0]
RegistrationHandler::RegistrationHandler(const QUuid &uuid, QObject *parent)
    : QObject(parent)
    , m_context(uuid)
    , m_isAllowed(false)
    , m_progress(BbmRegistrationProgress::NotStarted)
    , m_temporaryError(false)
    , m_statusMessage(tr("Please wait while the application connects to BBM."))
{
    if (uuid.isNull()) {
        SystemDialog *uuidDialog = new SystemDialog("OK");
        uuidDialog->setTitle("UUID Error");
        uuidDialog->setBody("Invalid/Empty UUID, please set correctly in main.cpp");
        connect(uuidDialog, SIGNAL(finished(bb::system::SystemUiResult::Type)), this, SLOT(dialogFinished(bb::system::SystemUiResult::Type)));
        uuidDialog->show();
        return;
    }
    connect(&m_context,
            SIGNAL(registrationStateUpdated(bb::platform::bbm::RegistrationState::Type)),
            this,
            SLOT(processRegistrationStatus(bb::platform::bbm::RegistrationState::Type)));
    RegistrationHandler::registerApplication();
}
开发者ID:alinet,项目名称:pixlez,代码行数:23,代码来源:RegistrationHandler.cpp

示例14: 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();
    }
}
开发者ID:ProLove365,项目名称:Cascades-Samples,代码行数:18,代码来源:app.cpp

示例15: SystemDialog

// A public function to display a SystemDialog in your UI
void ApplicationUI::showDialog()
{

    // Set up the SystemDialog with a title and some body text.
    // Label the two standard buttons with specific text.
    // Add a custom button as well.

    SystemDialog *dialog = new SystemDialog("Save as",
                                            "Discard changes",
                                            "Cancel");

    dialog->setTitle("Save changes");

    dialog->setBody("Save your changes and close the document?");

    dialog->setEmoticonsEnabled(true);

    // Connect the finished() signal to the onDialogFinished() slot.
    // The slot will check the SystemUiResult to see which
    // button was tapped.

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));

    if (success) {
        // Signal was successfully connected.
        // Now show the dialog box in your UI.

        dialog->show();
    } else {
        // Failed to connect to signal.
        // This is not normal in most cases and can be a critical
        // situation for your app! Make sure you know exactly why
        // this has happened. Add some code to recover from the
        // lost connection below this line.
        dialog->deleteLater();
    }
}
开发者ID:icetingyu,项目名称:ButtonAlert_QML_CPP,代码行数:41,代码来源:applicationui.cpp


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