if (is_sdbd_initialized == 0) {
QString msg = "SDB is not ready.\nPlease wait until the emulator is completely boot up.";
- QMessageBox msgBox;
- msgBox.setWindowTitle("Info");
- msgBox.setText(msg);
- msgBox.exec();
+ QMessageBox *msgBox = new QMessageBox();
+ msgBox->setAttribute(Qt::WA_DeleteOnClose);
+ msgBox->setWindowTitle("Info");
+ msgBox->setText(msg);
+ msgBox->setModal(false);
+ msgBox->show();
qDebug() << msg;
return;
}
QFileInfo fileInfo(sdbPath);
if (!fileInfo.exists()) {
QString msg = "SDB file does not exist : " + fileInfo.absoluteFilePath();
- QMessageBox msgBox;
- msgBox.setWindowTitle("Error");
- msgBox.setText(msg);
- msgBox.exec();
+ QMessageBox *msgBox = new QMessageBox();
+ msgBox->setAttribute(Qt::WA_DeleteOnClose);
+ msgBox->setWindowTitle("Error");
+ msgBox->setText(msg);
+ msgBox->setModal(false);
+ msgBox->show();
qWarning() << msg;
return;
}
terminal->start(command, arguments);
} catch (QString error) {
QString msg = "Fail to open Shell : " + error;
- QMessageBox msgBox;
- msgBox.setWindowTitle("Fail");
- msgBox.setText(msg);
- msgBox.exec();
+ QMessageBox *msgBox = new QMessageBox();
+ msgBox->setAttribute(Qt::WA_DeleteOnClose);
+ msgBox->setWindowTitle("Fail");
+ msgBox->setText(msg);
+ msgBox->setModal(false);
+ msgBox->show();
qDebug() << msg;
return;
}
QFileInfo fileInfo(ecpPath);
if (!fileInfo.exists()) {
QString msg = "Control Panel file does not exist in the following path.\n" + fileInfo.absoluteFilePath();
- QMessageBox msgBox;
- msgBox.setWindowTitle("Error");
- msgBox.setText(msg);
- msgBox.exec();
+ QMessageBox *msgBox = new QMessageBox();
+ msgBox->setAttribute(Qt::WA_DeleteOnClose);
+ msgBox->setWindowTitle("Error");
+ msgBox->setText(msg);
+ msgBox->setModal(false);
+ msgBox->show();
qWarning() << msg;
return;
}
terminal->start(command, arguments);
} catch (QString error) {
QString msg = "Fail to open control panel : " + error;
- QMessageBox msgBox;
- msgBox.setWindowTitle("Fail");
- msgBox.setText(msg);
- msgBox.exec();
+ QMessageBox *msgBox = new QMessageBox();
+ msgBox->setAttribute(Qt::WA_DeleteOnClose);
+ msgBox->setWindowTitle("Fail");
+ msgBox->setText(msg);
+ msgBox->setModal(false);
+ msgBox->show();
qDebug() << msg;
return;
}
qDebug("force close");
QMessageBox *msg = new QMessageBox();
- QMessageBox::StandardButton *reply = new QMessageBox::StandardButton();
- *reply = msg->question((QWidget *)this->parent(), "Emulator",
- "If you force stop an emulator, it may cause some problems.\n"
- "Are you sure you want to continue?",
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::Yes);
-
- if (*reply == QMessageBox::Yes) {
+ msg->setAttribute(Qt::WA_DeleteOnClose);
+ msg->setWindowTitle("Emulator");
+ msg->setText("If you force stop an emulator, it may cause some problems.\n"
+ "Are you sure you want to continue?");
+ msg->setStandardButtons(QMessageBox::Yes|QMessageBox::No);
+ msg->setDefaultButton(QMessageBox::Yes);
+ msg->setIcon(QMessageBox::Question);
+ msg->setModal(false);
+ msg->show();
+ connect(msg, SIGNAL(buttonClicked(QAbstractButton *)),
+ this, SLOT(slotForceCloseSelected(QAbstractButton *)));
+}
+
+void ContextMenu::slotForceCloseSelected(QAbstractButton *btn)
+{
+ if (btn->text().compare("&Yes") == 0) {
qDebug() << "exit!";
/* force close */
shutdown_qemu_gracefully();