VirtualBox

Changeset 80379 in vbox


Ignore:
Timestamp:
Aug 21, 2019 6:58:04 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132844
Message:

FE/Qt: bugref:9510: Removing some obsolete files

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r80357 r80379  
    736736        src/runtime/information/UIInformationRuntime.h \
    737737        src/runtime/information/UIInformationView.h \
    738         src/runtime/information/UIInformationWidget.h \
    739738        src/runtime/information/UIPerformanceMonitor.h \
    740739        src/runtime/information/UIVMInformationDialog.h \
     
    12041203        src/runtime/information/UIInformationRuntime.cpp \
    12051204        src/runtime/information/UIInformationView.cpp \
    1206         src/runtime/information/UIInformationWidget.cpp \
    12071205        src/runtime/information/UIPerformanceMonitor.cpp \
    12081206        src/runtime/information/UIVMInformationDialog.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp

    r80357 r80379  
    2323#include <QTableWidget>
    2424#include <QTextDocument>
     25#include <QVBoxLayout>
    2526
    2627/* GUI includes: */
     
    3334
    3435UIInformationConfiguration::UIInformationConfiguration(QWidget *pParent, const CMachine &machine, const CConsole &console)
    35     : UIInformationWidget(pParent, machine, console)
    36 
    37 {
     36    : QIWithRetranslateUI<QWidget>(pParent)
     37    , m_machine(machine)
     38    , m_console(console)
     39    , m_pMainLayout(0)
     40    , m_pTableWidget(0)
     41    , m_iColumCount(3)
     42    , m_iRowLeftMargin(0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin))
     43    , m_iRowTopMargin(0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin))
     44    , m_iRowRightMargin(0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin))
     45    , m_iRowBottomMargin(0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin))
     46{
     47    prepareObjects();
    3848    retranslateUi();
    3949    createTableItems();
     
    130140    m_pTableWidget->resizeColumnToContents(2);
    131141}
     142
     143
     144
     145void UIInformationConfiguration::prepareObjects()
     146{
     147    /* Create layout: */
     148    m_pMainLayout = new QVBoxLayout(this);
     149    if (!m_pMainLayout)
     150        return;
     151    m_pMainLayout->setSpacing(0);
     152
     153    m_pTableWidget = new QTableWidget;
     154    if (m_pTableWidget)
     155    {
     156        /* Configure the table by hiding the headers etc.: */
     157        m_pTableWidget->setColumnCount(m_iColumCount);
     158        m_pTableWidget->verticalHeader()->hide();
     159        m_pTableWidget->horizontalHeader()->hide();
     160        m_pTableWidget->setShowGrid(false);
     161        m_pTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
     162        m_pTableWidget->setFocusPolicy(Qt::NoFocus);
     163        m_pTableWidget->setSelectionMode(QAbstractItemView::NoSelection);
     164        m_pMainLayout->addWidget(m_pTableWidget);
     165    }
     166}
     167
     168
     169
     170void UIInformationConfiguration::insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics,
     171                                                QTextDocument &textDocument, int &iMaxColumn1Length)
     172{
     173    foreach (const UITextTableLine &line, table)
     174    {
     175        textDocument.setHtml(line.string2());
     176        insertInfoRow(line.string1(), textDocument.toPlainText(), fontMetrics, iMaxColumn1Length);
     177    }
     178}
     179
     180void UIInformationConfiguration::insertTitleRow(const QString &strTitle, const QIcon &icon, const QFontMetrics &fontMetrics)
     181{
     182    int iRow = m_pTableWidget->rowCount();
     183    m_pTableWidget->insertRow(iRow);
     184    QSize iconSize;
     185    icon.actualSize(iconSize);
     186    m_pTableWidget->setRowHeight(iRow,
     187                                 qMax(fontMetrics.height() + m_iRowTopMargin + m_iRowBottomMargin, iconSize.height()));
     188    m_pTableWidget->setItem(iRow, 0, new QTableWidgetItem(icon, ""));
     189    QTableWidgetItem *pTitleItem = new QTableWidgetItem(strTitle);
     190    QFont font = pTitleItem->font();
     191    font.setBold(true);
     192    pTitleItem->setFont(font);
     193    m_pTableWidget->setItem(iRow, 1, pTitleItem);
     194}
     195
     196void UIInformationConfiguration::insertInfoRow(const QString strText1, const QString &strText2,
     197                                               const QFontMetrics &fontMetrics, int &iMaxColumn1Length)
     198{
     199    int iRow = m_pTableWidget->rowCount();
     200    m_pTableWidget->insertRow(iRow);
     201    m_pTableWidget->setRowHeight(iRow, fontMetrics.height() + m_iRowTopMargin + m_iRowBottomMargin);
     202    iMaxColumn1Length = qMax(iMaxColumn1Length, fontMetrics.width(strText1));
     203    m_pTableWidget->setItem(iRow, 1, new QTableWidgetItem(strText1));
     204    m_pTableWidget->setItem(iRow, 2, new QTableWidgetItem(strText2));
     205}
     206
     207void UIInformationConfiguration::resetTable()
     208{
     209    if (m_pTableWidget)
     210    {
     211        m_pTableWidget->clear();
     212        m_pTableWidget->setRowCount(0);
     213        m_pTableWidget->setColumnCount(m_iColumCount);
     214    }
     215}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.h

    r80369 r80379  
    3232
    3333/* GUI includes: */
    34 #include "UIInformationWidget.h"
     34#include "QIWithRetranslateUI.h"
     35#include "UITextTable.h"
     36
    3537
    3638/* Forward declarations: */
     39class QTableWidget;
    3740class QTableWidgetItem;
    3841class QTextDocument;
     42class QVBoxLayout;
    3943
    40 
    41 class UIInformationConfiguration : public UIInformationWidget
     44class UIInformationConfiguration : public QIWithRetranslateUI<QWidget>
    4245{
    4346    Q_OBJECT;
     
    6164
    6265    void createTableItems();
     66    void prepareObjects();
     67    void insertTitleRow(const QString &strTitle, const QIcon &icon, const QFontMetrics &fontMetrics);
     68    void insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics,
     69                        QTextDocument &textDocument, int &iMaxColumn1Length);
     70    void insertInfoRow(const QString strText1, const QString &strText2,
     71                       const QFontMetrics &fontMetrics, int &iMaxColumn1Length);
     72    void resetTable();
     73
     74    CMachine m_machine;
     75    CConsole m_console;
     76    QVBoxLayout *m_pMainLayout;
     77    QTableWidget *m_pTableWidget;
     78    const int m_iColumCount;
     79    const int m_iRowLeftMargin;
     80    const int m_iRowTopMargin;
     81    const int m_iRowRightMargin;
     82    const int m_iRowBottomMargin;
     83
    6384
    6485   /** @name Cached translated string.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r80369 r80379  
    3535/* COM includes: */
    3636#include "CDisplay.h"
     37#include "CGuest.h"
    3738#include "CMachineDebugger.h"
    3839#include "CVRDEServerInfo.h"
    3940
    4041UIInformationRuntime::UIInformationRuntime(QWidget *pParent, const CMachine &machine, const CConsole &console)
    41     : UIInformationWidget(pParent,machine, console)
     42    : QIWithRetranslateUI<QWidget>(pParent)
     43    , m_machine(machine)
     44    , m_console(console)
    4245{
    4346    retranslateUi();
     
    5255void UIInformationRuntime::createTableItems()
    5356{
    54     if (!m_pTableWidget)
    55         return;
    56     QFontMetrics fontMetrics(m_pTableWidget->font());
    57     QTextDocument textDocument;
    58     int iMaxColumn1Length = 0;
    59 
    60     insertTitleRow(m_strRuntimeTitle, UIIconPool::iconSet(":/state_running_16px.png"), fontMetrics);
    61 
    62 
    63     insertInfoRows(runTimeAttributes(),
    64                    fontMetrics, textDocument, iMaxColumn1Length);
    65 
    66 
    67 
    68     m_pTableWidget->resizeColumnToContents(0);
    69     /* Resize the column 1 a bit larger than the max string if contains: */
    70     m_pTableWidget->setColumnWidth(1, 1.5 * iMaxColumn1Length);
    71     m_pTableWidget->resizeColumnToContents(2);
     57    // if (!m_pTableWidget)
     58    //     return;
     59    // QFontMetrics fontMetrics(m_pTableWidget->font());
     60    // QTextDocument textDocument;
     61    // int iMaxColumn1Length = 0;
     62
     63    // insertTitleRow(m_strRuntimeTitle, UIIconPool::iconSet(":/state_running_16px.png"), fontMetrics);
     64
     65
     66    // insertInfoRows(runTimeAttributes(),
     67    //                fontMetrics, textDocument, iMaxColumn1Length);
     68
     69
     70
     71    // m_pTableWidget->resizeColumnToContents(0);
     72    // /* Resize the column 1 a bit larger than the max string if contains: */
     73    // m_pTableWidget->setColumnWidth(1, 1.5 * iMaxColumn1Length);
     74    // m_pTableWidget->resizeColumnToContents(2);
    7275}
    7376
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r80369 r80379  
    3131
    3232/* GUI includes: */
    33 #include "UIInformationWidget.h"
     33#include "QIWithRetranslateUI.h"
     34#include "UITextTable.h"
    3435
    3536/* Forward declarations: */
     
    4041
    4142
    42 class UIInformationRuntime : public UIInformationWidget
     43class UIInformationRuntime : public QIWithRetranslateUI<QWidget>
    4344{
    4445    Q_OBJECT;
     
    5657    UITextTable runTimeAttributes();
    5758
     59    CMachine m_machine;
     60    CConsole m_console;
     61
    5862    /** @name Cached translated string.
    5963     * @{ */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette