Skip to content

Commit

Permalink
rename CefJsDialogType enum value
Browse files Browse the repository at this point in the history
  • Loading branch information
TrafalgarSX committed Aug 21, 2024
1 parent d0035fe commit 8cbd09a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/QCefView.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class QCEFVIEW_EXPORT QCefView : public QWidget
/// </summary>
enum CefJsDialogType
{
JSDIALOGTYPE_ALERT = 0,
JSDIALOGTYPE_CONFIRM,
JSDIALOGTYPE_PROMPT,
CefJsDialogTypeAlert = 0,
CefJsDialogTypeConfirm,
CefJsDialogTypePrompt
};
Q_ENUM(CefJsDialogType)

Expand Down
6 changes: 3 additions & 3 deletions src/QCefView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ QCefView::onJsDialog(const QString& originUrl,
suppressMessage = false;

QMessageBox::StandardButton button = QMessageBox::NoButton;
if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_ALERT) {
if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypeAlert) {
button = QMessageBox::warning(this, "Alert", messageText);
callbackResult.first = true;
callbackResult.second = "";
} else if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_CONFIRM) {
} else if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypeConfirm) {
button = QMessageBox::question(this, "Confirm", messageText, QMessageBox::Yes | QMessageBox::No);
callbackResult.first = button == QMessageBox::Yes;
callbackResult.second = "";
} else if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_PROMPT) {
} else if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypePrompt) {
bool ok = false;
QString text = QInputDialog::getText(this, "Prompt", messageText, QLineEdit::Normal, defaultPromptText, &ok);
if (ok) {
Expand Down

0 comments on commit 8cbd09a

Please sign in to comment.