| 84 | |
| 85 | |
| 86 | void UBEmbedController::showEmbedDialog() |
| 87 | { |
| 88 | if (!mTrapDialog) |
| 89 | { |
| 90 | Qt::WindowFlags flag = Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint ; |
| 91 | flag &= ~ Qt::WindowContextHelpButtonHint; |
| 92 | flag &= ~ Qt::WindowMinimizeButtonHint; |
| 93 | |
| 94 | mTrapDialog = new QDialog(mParentWidget, flag); |
| 95 | mTrapFlashUi = new Ui::trapFlashDialog(); |
| 96 | mTrapFlashUi->setupUi(mTrapDialog); |
| 97 | mTrapFlashUi->widgetNameLineEdit->setMaxLength(240); |
| 98 | |
| 99 | int viewWidth = mParentWidget->width() / 2; |
| 100 | int viewHeight = mParentWidget->height() * 2. / 3.; |
| 101 | mTrapDialog->resize(viewWidth, viewHeight); |
| 102 | |
| 103 | QWebEngineProfile* profile = UBApplication::webController->webProfile(); |
| 104 | mTrapFlashUi->webView->setPage(new WebPage(profile, this)); |
| 105 | |
| 106 | connect(mTrapFlashUi->flashCombobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &UBEmbedController::selectFlash); |
| 107 | connect(mTrapFlashUi->widgetNameLineEdit, &QLineEdit::textChanged, this, &UBEmbedController::textChanged); |
| 108 | connect(mTrapFlashUi->createWidgetButton, &QPushButton::clicked, this, &UBEmbedController::createWidget); |
| 109 | connect(mTrapFlashUi->webView, &QWebEngineView::loadFinished, this, [this](){ |
| 110 | mTrapFlashUi->webView->update(); |
| 111 | }); |
| 112 | } |
| 113 | |
| 114 | mTrapDialog->show(); |
| 115 | } |
| 116 | |
| 117 | |
| 118 | void UBEmbedController::hideEmbedDialog() const |