int get_display_pixel_density(void);
}
-extern int _qemu_argc;
-extern char **_qemu_argv;
-
#define TABLE_BORDER_SIZE 2
#define TAB_BORDER_SIZE 4
#define DIALOG_HORIZ_SPACE 20
(is_gpu_accel_enabled()) ?
QString(GENERIC_TEXT_ENABLED) : QString(GENERIC_TEXT_DISABLED));
- QStringList imagePathList = getImagePathList();
- for (int i = 0; i < imagePathList.size(); i++) {
- insertTableRow(vmInfoTable, QString(DETAILED_INFO_IMAGE_PATH) +
- " " + QString::number(i + 1), QString(imagePathList[i]),
- QString(imagePathList[i]));
+ QString drive_image_file(get_drive_image_file());
+ if (drive_image_file.isEmpty() == false) {
+ insertTableRow(vmInfoTable, QString(DETAILED_INFO_DRIVE_IMAGE_FILE),
+ drive_image_file, drive_image_file);
+ }
+
+ QString swap_image_file(get_swap_image_file());
+ if (swap_image_file.isEmpty() == false) {
+ insertTableRow(vmInfoTable, QString(DETAILED_INFO_SWAP_IMAGE_FILE),
+ swap_image_file, swap_image_file);
}
QString log_redirect_file(get_log_redirect_file());
- insertTableRow(vmInfoTable, QString(DETAILED_INFO_LOG_FILE),
- log_redirect_file, log_redirect_file);
+ if (log_redirect_file.isEmpty() == false) {
+ insertTableRow(vmInfoTable, QString(DETAILED_INFO_EMUL_LOG_FILE),
+ log_redirect_file, log_redirect_file);
+ }
QString kernel_log_redirect_file(get_kernel_log_redirect_file());
- insertTableRow(vmInfoTable, QString(DETAILED_INFO_KERNEL_LOG_FILE),
- kernel_log_redirect_file, kernel_log_redirect_file);
+ if (kernel_log_redirect_file.isEmpty() == false) {
+ insertTableRow(vmInfoTable, QString(DETAILED_INFO_KERNEL_LOG_FILE),
+ kernel_log_redirect_file, kernel_log_redirect_file);
+ }
#if 0
insertTableRow(vmInfoTable, DETAILED_INFO_TELNET_PORT,
void DetailedInfoDialog::insertTableRow(QTableWidget *table,
const QString& key, const QString& value, const QString& tooltip)
{
- int row = table->rowCount();
+ const int row = table->rowCount();
table->insertRow(row);
table->setItem(row, 0, new QTableWidgetItem(key));
- QTableWidgetItem* item = new QTableWidgetItem(value);
+ QTableWidgetItem *item = new QTableWidgetItem(value);
table->setItem(row, 1, item);
+
if (!tooltip.isNull() && !tooltip.isEmpty()) {
item->setToolTip(tooltip);
}
}
}
-QStringList DetailedInfoDialog::getImagePathList()
-{
- QStringList imagePathList;
- for (int i = 0; i <_qemu_argc; i++) {
- if (QString(_qemu_argv[i]).compare("-drive") == 0) {
- i += 1;
- QStringList splitString = QString(_qemu_argv[i]).split(",");
- QStringList splitString2 = splitString[0].split("=");
- QString drivePath = splitString2[splitString2.length() -1];
- imagePathList << drivePath;
- }
- }
- qDebug() << imagePathList;
- return imagePathList;
-}
-
void DetailedInfoDialog::slotCellOpen(int nRow, int nCol)
{
if (nCol <= 0 || nRow >= vmInfoTable->rowCount()) {
qDebug() << item->text() << "item was double clicked";
if (item->text().compare(DETAILED_INFO_HDS_PATH) == 0 ||
- item->text().compare(DETAILED_INFO_LOG_FILE) == 0 ||
+ item->text().compare(DETAILED_INFO_EMUL_LOG_FILE) == 0 ||
item->text().compare(DETAILED_INFO_KERNEL_LOG_FILE) == 0 ||
- item->text().startsWith(DETAILED_INFO_IMAGE_PATH) == true) {
+ item->text().compare(DETAILED_INFO_DRIVE_IMAGE_FILE) == 0 ||
+ item->text().compare(DETAILED_INFO_SWAP_IMAGE_FILE) == 0) {
/* get path item */
item = vmInfoTable->item(nRow, nCol);
} else {
qWarning() << "invalid path info:" << item->text();
}
-
- return;
}
DetailedInfoDialog::~DetailedInfoDialog()