{
infoDialog = NULL;
aboutDialog = NULL;
+ vmName = ((MainWindow *)parent)->uiInfo->vmName + " : "
+ + QString::number(get_device_serial_number());
createItems();
MainWindow *win = (MainWindow *)this->parent();
/* Detailed Info menu */
- QAction *action = addAction(win->uiInfo->vmName + " : "
- + QString::number(win->uiInfo->basePort));
+ QAction *action = addAction(vmName);
action->setIcon(QIcon(QPixmap(":/icons/detailed_info.png")));
connect(action, SIGNAL(triggered()), this, SLOT(slotDetailedInfo()));
if (is_sdbd_initialized == 0) {
QString msg = "SDB is not ready.\nPlease wait until the emulator is completely boot up.";
- QMessageBox *msgBox = new QMessageBox();
+ qDebug() << msg;
+
+ QMessageBox *msgBox = new QMessageBox(QMessageBox::Information,
+ "Emulator", msg, QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
- msgBox->setWindowTitle("Emulator");
- msgBox->setText(msg);
msgBox->setModal(false);
msgBox->show();
- qDebug() << msg;
+
return;
}
- MainWindow *win = (MainWindow *)this->parent();
- qint32 basePort = win->uiInfo->basePort;
- QString sdbPort = QString::number(basePort + 1);
- QString sdbSerial = "emulator-" + sdbPort;
+ QString sdbPort = QString::number(get_device_serial_number());
+ QString sdbSerialName = "emulator-" + sdbPort;
- QString vmName = win->uiInfo->vmName;
- QString sdbPath;
+ QString sdbPath = QCoreApplication::applicationDirPath();
#ifdef CONFIG_WIN32
- sdbPath = "..\\..\\ansicon.exe";
+ sdbPath += "\\..\\..\\ansicon.exe";
#else
- sdbPath = "../../sdb";
+ sdbPath += "/../../sdb";
#endif
- QFileInfo fileInfo(sdbPath);
- if (!fileInfo.exists()) {
- QString msg = "SDB file does not exist : " + fileInfo.absoluteFilePath();
- QMessageBox *msgBox = new QMessageBox();
+ QFileInfo sdbFileInfo(sdbPath);
+ if (sdbFileInfo.exists() == false) {
+ QString msg = "SDB file does not exist in the following path.\n"
+ + sdbFileInfo.absoluteFilePath();
+ qWarning() << msg;
+
+ QMessageBox *msgBox = new QMessageBox(QMessageBox::Warning,
+ "Emulator", msg, QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
- msgBox->setWindowTitle("Emulator");
- msgBox->setText(msg);
msgBox->setModal(false);
msgBox->show();
- qWarning() << msg;
+
return;
}
#ifdef CONFIG_WIN32
command = "cmd.exe";
- arguments << "/c start" << sdbPath << "-s" << sdbSerial << "shell";
+ arguments << "/c start" << sdbPath << "-s" << sdbSerialName << "shell";
#elif defined CONFIG_DARWIN
- QString binPath = get_bin_path();
- command = binPath + "/sdbscript";
- arguments << sdbSerial;
+ command = QCoreApplication::applicationDirPath() + "/sdbscript";
+ arguments << sdbSerialName;
#else
- QString title = "--title=" + vmName;
command = "/usr/bin/gnome-terminal";
- arguments << title << "-x" << sdbPath << "-s" << sdbSerial << "shell";
+ QString title = "--title=" + vmName;
+ arguments << title << "-x" << sdbPath << "-s" << sdbSerialName << "shell";
#endif
+ qDebug() << command << arguments;
+
try {
QProcess *terminal = new QProcess(this);
terminal->start(command, arguments);
} catch (QString error) {
- QString msg = "Fail to open Shell : " + error;
- QMessageBox *msgBox = new QMessageBox();
+ QString msg = "Failed to open Shell : " + error;
+ qDebug() << msg;
+
+ QMessageBox *msgBox = new QMessageBox(QMessageBox::Warning,
+ "Emulator", msg, QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
- msgBox->setWindowTitle("Emulator");
- msgBox->setText(msg);
msgBox->setModal(false);
msgBox->show();
- qDebug() << msg;
+
return;
}
}
{
qDebug("Control Panel");
- QString basePortOpt = "base.port=" + QString::number(get_emul_vm_base_port());
- QString vmNameOpt = "vmname=" + QString(get_emul_vm_name());
- QString ecpPath;
+ MainWindow *win = (MainWindow *)this->parent();
+ QString basePortOpt = "base.port=" + QString::number(win->uiInfo->basePort);
+ QString vmNameOpt = "vmname=" + win->uiInfo->vmName;
+
+ QString ecpPath = QCoreApplication::applicationDirPath();
#ifdef CONFIG_WIN32
- ecpPath = ".\\emulator-control-panel.jar";
+ ecpPath += "\\emulator-control-panel.jar";
#else
- ecpPath = "./emulator-control-panel.jar";
+ ecpPath += "/emulator-control-panel.jar";
#endif
- QFileInfo fileInfo(ecpPath);
- if (!fileInfo.exists()) {
- QString msg = "Control Panel file does not exist in the following path.\n" + fileInfo.absoluteFilePath();
- QMessageBox *msgBox = new QMessageBox();
+ QFileInfo ecpFileInfo(ecpPath);
+ if (!ecpFileInfo.exists()) {
+ QString msg = "Control Panel file does not exist in the following path.\n"
+ + ecpFileInfo.absoluteFilePath();
+ qWarning() << msg;
+
+ QMessageBox *msgBox = new QMessageBox(QMessageBox::Warning,
+ "Emulator", msg, QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
- msgBox->setWindowTitle("Error");
- msgBox->setText(msg);
msgBox->setModal(false);
msgBox->show();
- qWarning() << msg;
+
return;
}
QStringList arguments;
arguments << "-jar" << ecpPath << vmNameOpt << basePortOpt;
+ qDebug() << command << arguments;
+
try {
QProcess *terminal = new QProcess(this);
terminal->start(command, arguments);
} catch (QString error) {
- QString msg = "Fail to open control panel : " + error;
- QMessageBox *msgBox = new QMessageBox();
+ QString msg = "Failed to open Control Panel : " + error;
+ qDebug() << msg;
+
+ QMessageBox *msgBox = new QMessageBox(QMessageBox::Warning,
+ "Emulator", msg, QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
- msgBox->setWindowTitle("Fail");
- msgBox->setText(msg);
msgBox->setModal(false);
msgBox->show();
- qDebug() << msg;
+
return;
}
}