VirtualBox

Changeset 85389 in vbox


Ignore:
Timestamp:
Jul 20, 2020 12:42:14 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9722: Cloud Console Manager: Initial implementation; A dialog which allows to configure external terminal applications and profiles.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 deleted
9 edited
5 copied

Legend:

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

    r85297 r85389  
    257257VBOX_GUI_INC_DIRS = \
    258258        ./src \
     259        ./src/cloud/consolemanager \
    259260        ./src/cloud/machinesettings \
    260261        ./src/cloud/profilemanager \
     
    568569#
    569570VirtualBox_QT_MOCHDRS = \
     571        src/cloud/consolemanager/UICloudConsoleDetailsWidget.h \
     572        src/cloud/consolemanager/UICloudConsoleManager.h \
    570573        src/cloud/machinesettings/UICloudMachineSettingsDialog.h \
    571574        src/cloud/machinesettings/UICloudMachineSettingsDialogPage.h \
     
    924927#
    925928VirtualBox_QT_MOCSRCS = \
     929        src/cloud/consolemanager/UICloudConsoleManager.cpp \
    926930        src/cloud/profilemanager/UICloudProfileManager.cpp \
    927931        src/hostnetwork/UIHostNetworkManager.cpp \
     
    10301034VirtualBox_SOURCES = \
    10311035        src/main.cpp \
     1036        src/cloud/consolemanager/UICloudConsoleDetailsWidget.cpp \
     1037        src/cloud/consolemanager/UICloudConsoleManager.cpp \
    10321038        src/cloud/machinesettings/UICloudMachineSettingsDialog.cpp \
    10331039        src/cloud/machinesettings/UICloudMachineSettingsDialogPage.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.cpp

    r85388 r85389  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UICloudProfileDetailsWidget class implementation.
     3 * VBox Qt GUI - UICloudConsoleDetailsWidget class implementation.
    44 */
    55
     
    1818/* Qt includes: */
    1919#include <QGridLayout>
    20 #include <QHeaderView>
    2120#include <QLabel>
    2221#include <QLineEdit>
    2322#include <QPushButton>
    24 #include <QTableWidget>
     23#include <QStackedLayout>
     24#include <QStyle>
    2525#include <QVBoxLayout>
    2626
    2727/* GUI includes: */
    2828#include "QIDialogButtonBox.h"
    29 #include "UICloudProfileDetailsWidget.h"
     29#include "UICloudConsoleDetailsWidget.h"
    3030
    3131/* Other VBox includes: */
     
    3333
    3434
    35 UICloudProfileDetailsWidget::UICloudProfileDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
     35UICloudConsoleDetailsWidget::UICloudConsoleDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    3636    : QIWithRetranslateUI<QWidget>(pParent)
    3737    , m_enmEmbedding(enmEmbedding)
    38     , m_pLabelName(0)
    39     , m_pEditorName(0)
    40     , m_pLabelTableWidget(0)
    41     , m_pTableWidget(0)
     38    , m_pStackedLayout(0)
     39    , m_pLabelApplicationName(0)
     40    , m_pEditorApplicationName(0)
     41    , m_pLabelApplicationPath(0)
     42    , m_pEditorApplicationPath(0)
     43    , m_pLabelProfileName(0)
     44    , m_pEditorProfileName(0)
     45    , m_pLabelProfileArgument(0)
     46    , m_pEditorProfileArgument(0)
    4247    , m_pButtonBox(0)
    4348{
     
    4550}
    4651
    47 void UICloudProfileDetailsWidget::setData(const UIDataCloudProfile &data)
    48 {
     52void UICloudConsoleDetailsWidget::setApplicationData(const UIDataCloudConsoleApplication &data)
     53{
     54    /* Clear all data first: */
     55    clearData();
     56
    4957    /* Cache old/new data: */
    50     m_oldData = data;
    51     m_newData = m_oldData;
     58    m_oldApplicationData = data;
     59    m_newApplicationData = m_oldApplicationData;
     60
     61    /* Switch to proper stack: */
     62    m_pStackedLayout->setCurrentIndex(0);
    5263
    5364    /* Load data: */
     
    5970}
    6071
    61 void UICloudProfileDetailsWidget::retranslateUi()
    62 {
    63     /// @todo add description tool-tips
    64 
    65     /* Translate name-editor label: */
    66     m_pLabelName->setText(tr("Name:"));
     72void UICloudConsoleDetailsWidget::setProfileData(const UIDataCloudConsoleProfile &data)
     73{
     74    /* Clear all data first: */
     75    clearData();
     76
     77    /* Cache old/new data: */
     78    m_oldProfileData = data;
     79    m_newProfileData = m_oldProfileData;
     80
     81    /* Switch to proper stack: */
     82    m_pStackedLayout->setCurrentIndex(1);
     83
     84    /* Load data: */
     85    loadData();
     86
     87    /* Translate linked widgets: */
     88    retranslateEditor();
     89    retranslateButtons();
     90}
     91
     92void UICloudConsoleDetailsWidget::clearData()
     93{
     94    /* Clear widgets: */
     95    m_pEditorApplicationName->setText(QString());
     96    m_pEditorApplicationPath->setText(QString());
     97    m_pEditorProfileName->setText(QString());
     98    m_pEditorProfileArgument->setText(QString());
     99
     100    /* Clear data: */
     101    m_oldApplicationData = UIDataCloudConsoleApplication();
     102    m_newApplicationData = m_oldApplicationData;
     103    m_oldProfileData = UIDataCloudConsoleProfile();
     104    m_newProfileData = m_oldProfileData;
     105}
     106
     107void UICloudConsoleDetailsWidget::retranslateUi()
     108{
     109    /* Translate name-editor labels: */
     110    m_pLabelApplicationName->setText(tr("Name:"));
     111    m_pLabelApplicationPath->setText(tr("Path:"));
     112    m_pLabelProfileName->setText(tr("Name:"));
     113    m_pLabelProfileArgument->setText(tr("Argument:"));
    67114    /* Translate name-editor: */
    68115    retranslateEditor();
    69116
    70     /* Translate table-widget label: */
    71     m_pLabelTableWidget->setText(tr("Properties:"));
    72     /* Translate table-widget: */
    73     m_pTableWidget->setToolTip(tr("Contains cloud profile settings"));
    74 
    75117    /* Translate buttons: */
    76118    retranslateButtons();
     
    78120    /* Retranslate validation: */
    79121    retranslateValidation();
    80 
    81     /* Update table tool-tips: */
    82     updateTableToolTips();
    83 }
    84 
    85 void UICloudProfileDetailsWidget::retranslateEditor()
     122}
     123
     124void UICloudConsoleDetailsWidget::retranslateEditor()
    86125{
    87126    /* Translate placeholders: */
    88     m_pEditorName->setPlaceholderText(  m_oldData.m_strName.isNull()
    89                                       ? tr("Enter a name for the new profile...")
    90                                       : tr("Enter a name for this profile..."));
    91 }
    92 
    93 void UICloudProfileDetailsWidget::retranslateButtons()
     127    m_pEditorApplicationName->setPlaceholderText(tr("Enter a name for this console application..."));
     128    m_pEditorApplicationPath->setPlaceholderText(tr("Enter a path for this console application..."));
     129    m_pEditorProfileName->setPlaceholderText(tr("Enter a name for this console profile..."));
     130    m_pEditorProfileArgument->setPlaceholderText(tr("Enter an argument for this console profile..."));
     131}
     132
     133void UICloudConsoleDetailsWidget::retranslateButtons()
    94134{
    95135    /* Translate button-box: */
     
    98138        /* Common: 'Reset' button: */
    99139        m_pButtonBox->button(QDialogButtonBox::Cancel)->setText(tr("Reset"));
    100         m_pButtonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Reset changes in current profile details"));
     140        m_pButtonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Reset changes in current console details"));
    101141        m_pButtonBox->button(QDialogButtonBox::Cancel)->setShortcut(Qt::Key_Escape);
    102142        m_pButtonBox->button(QDialogButtonBox::Cancel)->
    103143            setToolTip(tr("Reset Changes (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Cancel)->shortcut().toString()));
    104144
    105         if (m_oldData.m_strName.isNull())
    106         {
    107             /* Provider: 'Add' button: */
    108             m_pButtonBox->button(QDialogButtonBox::Ok)->setText(tr("Add"));
    109             m_pButtonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Add a new profile with following name"));
    110             m_pButtonBox->button(QDialogButtonBox::Ok)->setShortcut(QString("Ctrl+Return"));
    111             m_pButtonBox->button(QDialogButtonBox::Ok)->
    112                 setToolTip(tr("Add Profile (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Ok)->shortcut().toString()));
    113         }
    114         else
    115         {
    116             /* Profile: 'Apply' button: */
    117             m_pButtonBox->button(QDialogButtonBox::Ok)->setText(tr("Apply"));
    118             m_pButtonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Apply changes in current profile details"));
    119             m_pButtonBox->button(QDialogButtonBox::Ok)->setShortcut(QString("Ctrl+Return"));
    120             m_pButtonBox->button(QDialogButtonBox::Ok)->
    121                 setToolTip(tr("Apply Changes (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Ok)->shortcut().toString()));
    122         }
    123     }
    124 }
    125 
    126 void UICloudProfileDetailsWidget::sltNameChanged(const QString &strName)
     145        /* Common: 'Apply' button: */
     146        m_pButtonBox->button(QDialogButtonBox::Ok)->setText(tr("Apply"));
     147        m_pButtonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Apply changes in current console details"));
     148        m_pButtonBox->button(QDialogButtonBox::Ok)->setShortcut(QString("Ctrl+Return"));
     149        m_pButtonBox->button(QDialogButtonBox::Ok)->
     150            setToolTip(tr("Apply Changes (%1)").arg(m_pButtonBox->button(QDialogButtonBox::Ok)->shortcut().toString()));
     151    }
     152}
     153
     154void UICloudConsoleDetailsWidget::sltApplicationNameChanged(const QString &strName)
    127155{
    128156    /* Push changes back: */
    129     m_newData.m_strName = strName;
     157    m_newApplicationData.m_strName = strName;
    130158
    131159    /* Revalidate: */
    132     revalidate(m_pEditorName);
     160    revalidate(m_pEditorApplicationName);
    133161    /* Update button states: */
    134162    updateButtonStates();
    135163}
    136164
    137 void UICloudProfileDetailsWidget::sltTableChanged(QTableWidgetItem *pItem)
    138 {
    139     /* Make sure item is valid: */
    140     AssertPtrReturnVoid(pItem);
    141     const int iRow = pItem->row();
    142     AssertReturnVoid(iRow >= 0);
    143 
    144     /* Skip if one of items isn't yet created.
    145      * This can happen when 1st is already while 2nd isn't yet. */
    146     QTableWidgetItem *pItemK = m_pTableWidget->item(iRow, 0);
    147     QTableWidgetItem *pItemV = m_pTableWidget->item(iRow, 1);
    148     if (!pItemK || !pItemV)
    149         return;
    150 
     165void UICloudConsoleDetailsWidget::sltApplicationPathChanged(const QString &strPath)
     166{
    151167    /* Push changes back: */
    152     const QString strKey = pItemK->text();
    153     const QString strValue = pItemV->text();
    154     m_newData.m_data[strKey] = qMakePair(strValue, m_newData.m_data.value(strKey).second);
     168    m_newApplicationData.m_strPath = strPath;
    155169
    156170    /* Revalidate: */
    157     revalidate(m_pTableWidget);
     171    revalidate(m_pEditorApplicationPath);
    158172    /* Update button states: */
    159173    updateButtonStates();
    160174}
    161175
    162 void UICloudProfileDetailsWidget::sltHandleButtonBoxClick(QAbstractButton *pButton)
     176void UICloudConsoleDetailsWidget::sltProfileNameChanged(const QString &strName)
     177{
     178    /* Push changes back: */
     179    m_newProfileData.m_strName = strName;
     180
     181    /* Revalidate: */
     182    revalidate(m_pEditorProfileName);
     183    /* Update button states: */
     184    updateButtonStates();
     185}
     186
     187void UICloudConsoleDetailsWidget::sltProfileArgumentChanged(const QString &strArgument)
     188{
     189    /* Push changes back: */
     190    m_newProfileData.m_strArgument = strArgument;
     191
     192    /* Revalidate: */
     193    revalidate(m_pEditorProfileArgument);
     194    /* Update button states: */
     195    updateButtonStates();
     196}
     197
     198void UICloudConsoleDetailsWidget::sltHandleButtonBoxClick(QAbstractButton *pButton)
    163199{
    164200    /* Make sure button-box exists: */
     
    177213}
    178214
    179 void UICloudProfileDetailsWidget::prepare()
     215void UICloudConsoleDetailsWidget::prepare()
    180216{
    181217    /* Prepare widgets: */
     
    189225}
    190226
    191 void UICloudProfileDetailsWidget::prepareWidgets()
    192 {
    193     /* Create layout: */
    194     QGridLayout *pLayout = new QGridLayout(this);
    195     if (pLayout)
    196     {
    197         if (m_enmEmbedding == EmbedTo_Dialog)
     227void UICloudConsoleDetailsWidget::prepareWidgets()
     228{
     229    /* Create main layout: */
     230    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     231    if (pMainLayout)
     232    {
     233        pMainLayout->setContentsMargins(0, 0, 0, 0);
     234
     235        /* Create stacked layout: */
     236        m_pStackedLayout = new QStackedLayout;
     237        if (m_pStackedLayout)
    198238        {
    199             pLayout->setContentsMargins(0, 0, 0, 0);
     239            /* Create application widget: */
     240            QWidget *pWidgetApplication = new QWidget;
     241            if (pWidgetApplication)
     242            {
     243                /* Create application layout: */
     244                QGridLayout *pLayoutApplication = new QGridLayout(pWidgetApplication);
     245                if (pLayoutApplication)
     246                {
     247                    pLayoutApplication->setContentsMargins(0, 0, 0, 0);
     248                    pLayoutApplication->setRowStretch(2, 1);
     249
     250                    if (m_enmEmbedding == EmbedTo_Dialog)
     251                    {
     252                        pLayoutApplication->setContentsMargins(0, 0, 0, 0);
    200253#ifdef VBOX_WS_MAC
    201             pLayout->setSpacing(10);
     254                        pLayoutApplication->setSpacing(10);
    202255#else
    203             pLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     256                        pLayoutApplication->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
    204257#endif
    205         }
    206         else
    207         {
     258                    }
     259                    else
     260                    {
    208261#ifdef VBOX_WS_MAC
    209             pLayout->setContentsMargins(13, 0, 13, 13);
    210             pLayout->setSpacing(10);
     262                        pLayoutApplication->setContentsMargins(13, 0, 13, 13);
     263                        pLayoutApplication->setSpacing(10);
    211264#else
    212             const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) * 1.5;
    213             const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) * 1.5;
    214             const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) * 1.5;
    215             const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) * 1.5;
    216             pLayout->setContentsMargins(iL, iT, iR, iB);
     265                        const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) * 1.5;
     266                        const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) * 1.5;
     267                        const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) * 1.5;
     268                        const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) * 1.5;
     269                        pLayoutApplication->setContentsMargins(iL, iT, iR, iB);
    217270#endif
    218         }
    219 
    220         /* Create name editor: */
    221         m_pEditorName = new QLineEdit;
    222         if (m_pEditorName)
    223         {
    224             connect(m_pEditorName, &QLineEdit::textChanged, this, &UICloudProfileDetailsWidget::sltNameChanged);
     271                    }
     272
     273                    /* Create name editor: */
     274                    m_pEditorApplicationName = new QLineEdit(pWidgetApplication);
     275                    if (m_pEditorApplicationName)
     276                    {
     277                        connect(m_pEditorApplicationName, &QLineEdit::textChanged,
     278                                this, &UICloudConsoleDetailsWidget::sltApplicationNameChanged);
     279
     280                        /* Add into layout: */
     281                        pLayoutApplication->addWidget(m_pEditorApplicationName, 0, 1);
     282                    }
     283                    /* Create name label: */
     284                    m_pLabelApplicationName = new QLabel(pWidgetApplication);
     285                    if (m_pLabelApplicationName)
     286                    {
     287                        m_pLabelApplicationName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     288                        m_pLabelApplicationName->setBuddy(m_pEditorApplicationName);
     289
     290                        /* Add into layout: */
     291                        pLayoutApplication->addWidget(m_pLabelApplicationName, 0, 0);
     292                    }
     293
     294                    /* Create path editor: */
     295                    m_pEditorApplicationPath = new QLineEdit(pWidgetApplication);
     296                    if (m_pEditorApplicationPath)
     297                    {
     298                        connect(m_pEditorApplicationPath, &QLineEdit::textChanged,
     299                                this, &UICloudConsoleDetailsWidget::sltApplicationPathChanged);
     300
     301                        /* Add into layout: */
     302                        pLayoutApplication->addWidget(m_pEditorApplicationPath, 1, 1);
     303                    }
     304                    /* Create path label: */
     305                    m_pLabelApplicationPath = new QLabel(pWidgetApplication);
     306                    if (m_pLabelApplicationPath)
     307                    {
     308                        m_pLabelApplicationPath->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     309                        m_pLabelApplicationPath->setBuddy(m_pEditorApplicationPath);
     310
     311                        /* Add into layout: */
     312                        pLayoutApplication->addWidget(m_pLabelApplicationPath, 1, 0);
     313                    }
     314                }
     315
     316                /* Add into layout: */
     317                m_pStackedLayout->addWidget(pWidgetApplication);
     318            }
     319
     320            /* Create profile widget: */
     321            QWidget *pWidgetProfile = new QWidget;
     322            if (pWidgetProfile)
     323            {
     324                /* Create profile layout: */
     325                QGridLayout *pLayoutProfile = new QGridLayout(pWidgetProfile);
     326                if (pLayoutProfile)
     327                {
     328                    pLayoutProfile->setContentsMargins(0, 0, 0, 0);
     329                    pLayoutProfile->setRowStretch(2, 1);
     330
     331                    if (m_enmEmbedding == EmbedTo_Dialog)
     332                    {
     333                        pLayoutProfile->setContentsMargins(0, 0, 0, 0);
     334#ifdef VBOX_WS_MAC
     335                        pLayoutProfile->setSpacing(10);
     336#else
     337                        pLayoutProfile->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);
     338#endif
     339                    }
     340                    else
     341                    {
     342#ifdef VBOX_WS_MAC
     343                        pLayoutProfile->setContentsMargins(13, 0, 13, 13);
     344                        pLayoutProfile->setSpacing(10);
     345#else
     346                        const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) * 1.5;
     347                        const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin) * 1.5;
     348                        const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin) * 1.5;
     349                        const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) * 1.5;
     350                        pLayoutProfile->setContentsMargins(iL, iT, iR, iB);
     351#endif
     352                    }
     353
     354                    /* Create name editor: */
     355                    m_pEditorProfileName = new QLineEdit(pWidgetProfile);
     356                    if (m_pEditorProfileName)
     357                    {
     358                        connect(m_pEditorProfileName, &QLineEdit::textChanged,
     359                                this, &UICloudConsoleDetailsWidget::sltProfileNameChanged);
     360
     361                        /* Add into layout: */
     362                        pLayoutProfile->addWidget(m_pEditorProfileName, 0, 1);
     363                    }
     364                    /* Create name label: */
     365                    m_pLabelProfileName = new QLabel(pWidgetProfile);
     366                    if (m_pLabelProfileName)
     367                    {
     368                        m_pLabelProfileName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     369                        m_pLabelProfileName->setBuddy(m_pEditorProfileName);
     370
     371                        /* Add into layout: */
     372                        pLayoutProfile->addWidget(m_pLabelProfileName, 0, 0);
     373                    }
     374
     375                    /* Create argument editor: */
     376                    m_pEditorProfileArgument = new QLineEdit(pWidgetProfile);
     377                    if (m_pEditorProfileArgument)
     378                    {
     379                        connect(m_pEditorProfileArgument, &QLineEdit::textChanged,
     380                                this, &UICloudConsoleDetailsWidget::sltProfileArgumentChanged);
     381
     382                        /* Add into layout: */
     383                        pLayoutProfile->addWidget(m_pEditorProfileArgument, 1, 1);
     384                    }
     385                    /* Create name label: */
     386                    m_pLabelProfileArgument = new QLabel(pWidgetProfile);
     387                    if (m_pLabelProfileArgument)
     388                    {
     389                        m_pLabelProfileArgument->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     390                        m_pLabelProfileArgument->setBuddy(m_pEditorProfileArgument);
     391
     392                        /* Add into layout: */
     393                        pLayoutProfile->addWidget(m_pLabelProfileArgument, 1, 0);
     394                    }
     395                }
     396
     397                /* Add into layout: */
     398                m_pStackedLayout->addWidget(pWidgetProfile);
     399            }
    225400
    226401            /* Add into layout: */
    227             pLayout->addWidget(m_pEditorName, 0, 1);
    228         }
    229         /* Create name label: */
    230         m_pLabelName = new QLabel;
    231         if (m_pLabelName)
    232         {
    233             m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    234             m_pLabelName->setBuddy(m_pEditorName);
    235 
    236             /* Add into layout: */
    237             pLayout->addWidget(m_pLabelName, 0, 0);
    238         }
    239 
    240         /* Create tab-widget: */
    241         m_pTableWidget = new QTableWidget;
    242         if (m_pTableWidget)
    243         {
    244             m_pTableWidget->setAlternatingRowColors(true);
    245             m_pTableWidget->horizontalHeader()->setVisible(false);
    246             m_pTableWidget->verticalHeader()->setVisible(false);
    247             m_pTableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
    248             connect(m_pTableWidget, &QTableWidget::itemChanged, this, &UICloudProfileDetailsWidget::sltTableChanged);
    249 
    250             /* Add into layout: */
    251             pLayout->addWidget(m_pTableWidget, 1, 1);
    252         }
    253         /* Create tab-widget label: */
    254         m_pLabelTableWidget = new QLabel;
    255         if (m_pLabelTableWidget)
    256         {
    257             m_pLabelTableWidget->setAlignment(Qt::AlignRight | Qt::AlignTop);
    258             m_pLabelTableWidget->setBuddy(m_pTableWidget);
    259 
    260             /* Add into layout: */
    261             pLayout->addWidget(m_pLabelTableWidget, 1, 0);
     402            pMainLayout->addLayout(m_pStackedLayout);
    262403        }
    263404
     
    270411            {
    271412                m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
    272                 connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UICloudProfileDetailsWidget::sltHandleButtonBoxClick);
     413                connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UICloudConsoleDetailsWidget::sltHandleButtonBoxClick);
    273414
    274415                /* Add into layout: */
    275                 pLayout->addWidget(m_pButtonBox, 2, 0, 1, 2);
     416                pMainLayout->addWidget(m_pButtonBox);
    276417            }
    277418        }
     
    279420}
    280421
    281 void UICloudProfileDetailsWidget::loadData()
    282 {
    283     /* Clear table initially: */
    284     m_pTableWidget->clear();
    285 
    286     /* Fill name editor: */
    287     m_pEditorName->setText(m_oldData.m_strName);
    288 
    289     /* Configure table: */
    290     m_pTableWidget->setRowCount(m_oldData.m_data.keys().size());
    291     m_pTableWidget->setColumnCount(2);
    292 
    293     /* Push acquired keys/values to data fields: */
    294     for (int i = 0; i < m_pTableWidget->rowCount(); ++i)
    295     {
    296         /* Gather values: */
    297         const QString strKey = m_oldData.m_data.keys().at(i);
    298         const QString strValue = m_oldData.m_data.value(strKey).first;
    299         const QString strToolTip = m_oldData.m_data.value(strKey).second;
    300 
    301         /* Create key item: */
    302         QTableWidgetItem *pItemK = new QTableWidgetItem(strKey);
    303         if (pItemK)
    304         {
    305             /* Non-editable for sure, but non-selectable? */
    306             pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable);
    307             /* Use non-translated description as tool-tip: */
    308             pItemK->setData(Qt::UserRole, strToolTip);
    309 
    310             /* Insert into table: */
    311             m_pTableWidget->setItem(i, 0, pItemK);
    312         }
    313 
    314         /* Create value item: */
    315         QTableWidgetItem *pItemV = new QTableWidgetItem(strValue);
    316         if (pItemV)
    317         {
    318             /* Use the value as tool-tip, there can be quite long values: */
    319             pItemV->setToolTip(strValue);
    320 
    321             /* Insert into table: */
    322             m_pTableWidget->setItem(i, 1, pItemV);
    323         }
    324     }
    325 
    326     /* Update table tooltips: */
    327     updateTableToolTips();
    328     /* Adjust table contents: */
    329     adjustTableContents();
    330 }
    331 
    332 void UICloudProfileDetailsWidget::revalidate(QWidget *pWidget /* = 0 */)
    333 {
    334     /// @todo validate profile settings table!
     422void UICloudConsoleDetailsWidget::loadData()
     423{
     424    /* If application pane is selected: */
     425    if (m_pStackedLayout->currentIndex() == 0)
     426    {
     427        m_pEditorApplicationName->setText(m_oldApplicationData.m_strName);
     428        m_pEditorApplicationPath->setText(m_oldApplicationData.m_strPath);
     429    }
     430    /* If profile pane is selected: */
     431    else
     432    {
     433        m_pEditorProfileName->setText(m_oldProfileData.m_strName);
     434        m_pEditorProfileArgument->setText(m_oldProfileData.m_strArgument);
     435    }
     436}
     437
     438void UICloudConsoleDetailsWidget::revalidate(QWidget *pWidget /* = 0 */)
     439{
     440    /// @todo validate application/profile details!
    335441
    336442    /* Retranslate validation: */
     
    338444}
    339445
    340 void UICloudProfileDetailsWidget::retranslateValidation(QWidget *pWidget /* = 0 */)
     446void UICloudConsoleDetailsWidget::retranslateValidation(QWidget *pWidget /* = 0 */)
    341447{
    342448    Q_UNUSED(pWidget);
     
    345451}
    346452
    347 void UICloudProfileDetailsWidget::updateTableToolTips()
    348 {
    349     /* Iterate through all the key items: */
    350     for (int i = 0; i < m_pTableWidget->rowCount(); ++i)
    351     {
    352         /* Acquire current key item: */
    353         QTableWidgetItem *pItemK = m_pTableWidget->item(i, 0);
    354         if (pItemK)
    355         {
    356             const QString strToolTip = pItemK->data(Qt::UserRole).toString();
    357             pItemK->setToolTip(tr(strToolTip.toUtf8().constData()));
    358         }
    359     }
    360 }
    361 
    362 void UICloudProfileDetailsWidget::adjustTableContents()
    363 {
    364     /* Disable last column stretching temporary: */
    365     m_pTableWidget->horizontalHeader()->setStretchLastSection(false);
    366 
    367     /* Resize both columns to contents: */
    368     m_pTableWidget->resizeColumnsToContents();
    369     /* Then acquire full available width: */
    370     const int iFullWidth = m_pTableWidget->viewport()->width();
    371     /* First column should not be less than it's minimum size, last gets the rest: */
    372     const int iMinimumWidth0 = qMin(m_pTableWidget->horizontalHeader()->sectionSize(0), iFullWidth / 2);
    373     m_pTableWidget->horizontalHeader()->resizeSection(0, iMinimumWidth0);
    374 
    375     /* Enable last column stretching again: */
    376     m_pTableWidget->horizontalHeader()->setStretchLastSection(true);
    377 }
    378 
    379 void UICloudProfileDetailsWidget::updateButtonStates()
     453void UICloudConsoleDetailsWidget::updateButtonStates()
    380454{
    381455#if 0
     
    400474#endif
    401475
    402     /* Update 'Apply' / 'Reset' button states: */
    403     if (m_pButtonBox)
    404     {
    405         m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(m_oldData != m_newData);
    406         m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldData != m_newData);
    407     }
    408 
    409     /* Notify listeners as well: */
    410     emit sigDataChanged(m_oldData != m_newData);
    411 }
     476    /* If application pane is selected: */
     477    if (m_pStackedLayout->currentIndex() == 0)
     478    {
     479        /* Update 'Apply' / 'Reset' button states: */
     480        if (m_pButtonBox)
     481        {
     482            m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(m_oldApplicationData != m_newApplicationData);
     483            m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldApplicationData != m_newApplicationData);
     484        }
     485
     486        /* Notify listeners as well: */
     487        emit sigDataChanged(m_oldApplicationData != m_newApplicationData);
     488    }
     489    /* If profile pane is selected: */
     490    else
     491    {
     492        /* Update 'Apply' / 'Reset' button states: */
     493        if (m_pButtonBox)
     494        {
     495            m_pButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(m_oldProfileData != m_newProfileData);
     496            m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldProfileData != m_newProfileData);
     497        }
     498
     499        /* Notify listeners as well: */
     500        emit sigDataChanged(m_oldProfileData != m_newProfileData);
     501    }
     502}
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.h

    r85388 r85389  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UICloudProfileDetailsWidget class declaration.
     3 * VBox Qt GUI - UICloudConsoleDetailsWidget class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileDetailsWidget_h
    19 #define FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileDetailsWidget_h
     18#ifndef FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleDetailsWidget_h
     19#define FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleDetailsWidget_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    2424/* Qt includes: */
    2525#include <QMap>
    26 #include <QUuid>
    2726#include <QWidget>
    2827
     
    3534class QLabel;
    3635class QLineEdit;
    37 class QTableWidget;
    38 class QTableWidgetItem;
     36class QStackedLayout;
    3937class QIDialogButtonBox;
    4038
    4139
    42 /** Cloud Provider data structure. */
    43 struct UIDataCloudProvider
     40/** Cloud Console Application data structure. */
     41struct UIDataCloudConsoleApplication
    4442{
    4543    /** Constructs data. */
    46     UIDataCloudProvider()
     44    UIDataCloudConsoleApplication()
    4745        : m_fRestricted(false)
    4846    {}
    4947
    5048    /** Returns whether the @a other passed data is equal to this one. */
    51     bool equal(const UIDataCloudProvider &other) const
     49    bool equal(const UIDataCloudConsoleApplication &other) const
    5250    {
    5351        return true
    54                && (m_uId == other.m_uId)
    55                && (m_strShortName == other.m_strShortName)
     52               && (m_strId == other.m_strId)
    5653               && (m_strName == other.m_strName)
     54               && (m_strPath == other.m_strPath)
    5755               && (m_fRestricted == other.m_fRestricted)
    5856               ;
     
    6058
    6159    /** Returns whether the @a other passed data is equal to this one. */
    62     bool operator==(const UIDataCloudProvider &other) const { return equal(other); }
     60    bool operator==(const UIDataCloudConsoleApplication &other) const { return equal(other); }
    6361    /** Returns whether the @a other passed data is different from this one. */
    64     bool operator!=(const UIDataCloudProvider &other) const { return !equal(other); }
    65 
    66     /** Holds the provider ID. */
    67     QUuid    m_uId;
    68     /** Holds the provider short name. */
    69     QString  m_strShortName;
    70     /** Holds the provider name. */
     62    bool operator!=(const UIDataCloudConsoleApplication &other) const { return !equal(other); }
     63
     64    /** Holds the console application ID. */
     65    QString  m_strId;
     66    /** Holds the console application name. */
    7167    QString  m_strName;
    72     /** Holds whether provider is restricted. */
     68    /** Holds the console application path. */
     69    QString  m_strPath;
     70    /** Holds whether console application is restricted. */
    7371    bool     m_fRestricted;
    74 
    75     /** Holds the profile supported property descriptions. */
    76     QMap<QString, QString>  m_propertyDescriptions;
    7772};
    7873
    79 /** Cloud Profile data structure. */
    80 struct UIDataCloudProfile
     74/** Cloud Console Profile data structure. */
     75struct UIDataCloudConsoleProfile
    8176{
    8277    /** Constructs data. */
    83     UIDataCloudProfile()
     78    UIDataCloudConsoleProfile()
    8479        : m_fRestricted(false)
    8580    {}
    8681
    8782    /** Returns whether the @a other passed data is equal to this one. */
    88     bool equal(const UIDataCloudProfile &other) const
     83    bool equal(const UIDataCloudConsoleProfile &other) const
    8984    {
    9085        return true
    91                && (m_strProviderShortName == other.m_strProviderShortName)
     86               && (m_strApplicationId == other.m_strApplicationId)
     87               && (m_strId == other.m_strId)
    9288               && (m_strName == other.m_strName)
     89               && (m_strArgument == other.m_strArgument)
    9390               && (m_fRestricted == other.m_fRestricted)
    94                && (m_data == other.m_data)
    9591               ;
    9692    }
    9793
    9894    /** Returns whether the @a other passed data is equal to this one. */
    99     bool operator==(const UIDataCloudProfile &other) const { return equal(other); }
     95    bool operator==(const UIDataCloudConsoleProfile &other) const { return equal(other); }
    10096    /** Returns whether the @a other passed data is different from this one. */
    101     bool operator!=(const UIDataCloudProfile &other) const { return !equal(other); }
    102 
    103     /** Holds the provider short name. */
    104     QString  m_strProviderShortName;
    105     /** Holds the profile name. */
     97    bool operator!=(const UIDataCloudConsoleProfile &other) const { return !equal(other); }
     98
     99    /** Holds the console profile application ID. */
     100    QString  m_strApplicationId;
     101    /** Holds the console profile ID. */
     102    QString  m_strId;
     103    /** Holds the console profile name. */
    106104    QString  m_strName;
    107     /** Holds whether profile is restricted. */
     105    /** Holds the console profile argument. */
     106    QString  m_strArgument;
     107    /** Holds whether console profile is restricted. */
    108108    bool     m_fRestricted;
    109 
    110     /** Holds the profile data. */
    111     QMap<QString, QPair<QString, QString> >  m_data;
    112109};
    113110
    114111
    115 /** Cloud Profile details widget. */
    116 class UICloudProfileDetailsWidget : public QIWithRetranslateUI<QWidget>
     112/** Cloud Console details widget. */
     113class UICloudConsoleDetailsWidget : public QIWithRetranslateUI<QWidget>
    117114{
    118115    Q_OBJECT;
     
    130127public:
    131128
    132     /** Constructs cloud profile details widget passing @a pParent to the base-class.
     129    /** Constructs cloud console details widget passing @a pParent to the base-class.
    133130      * @param  enmEmbedding  Brings embedding type. */
    134     UICloudProfileDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent = 0);
    135 
    136     /** Returns the cloud profile data. */
    137     const UIDataCloudProfile &data() const { return m_newData; }
    138     /** Defines the cloud profile @a data. */
    139     void setData(const UIDataCloudProfile &data);
     131    UICloudConsoleDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent = 0);
     132
     133    /** Returns the cloud console application data. */
     134    const UIDataCloudConsoleApplication &applicationData() const { return m_newApplicationData; }
     135    /** Returns the cloud console profile data. */
     136    const UIDataCloudConsoleProfile &profileData() const { return m_newProfileData; }
     137    /** Defines the cloud console application @a data. */
     138    void setApplicationData(const UIDataCloudConsoleApplication &data);
     139    /** Defines the cloud console profile @a data. */
     140    void setProfileData(const UIDataCloudConsoleProfile &data);
     141    /** Clears all the console data. */
     142    void clearData();
    140143
    141144protected:
     
    152155    /** @name Change handling stuff.
    153156      * @{ */
    154         /** Handles name change. */
    155         void sltNameChanged(const QString &strName);
    156         /** Handles table change. */
    157         void sltTableChanged(QTableWidgetItem *pItem);
     157        /** Handles console application name change. */
     158        void sltApplicationNameChanged(const QString &strName);
     159        /** Handles console application path change. */
     160        void sltApplicationPathChanged(const QString &strPath);
     161        /** Handles console profile name change. */
     162        void sltProfileNameChanged(const QString &strName);
     163        /** Handles console profile argument change. */
     164        void sltProfileArgumentChanged(const QString &strArgument);
    158165
    159166        /** Handles button-box button click. */
     
    185192        void retranslateValidation(QWidget *pWidget = 0);
    186193
    187         /** Updates table tooltips. */
    188         void updateTableToolTips();
    189         /** Adjusts table contents. */
    190         void adjustTableContents();
    191 
    192194        /** Updates button states. */
    193195        void updateButtonStates();
     
    199201        const EmbedTo  m_enmEmbedding;
    200202
    201         /** Holds the old data copy. */
    202         UIDataCloudProfile  m_oldData;
    203         /** Holds the new data copy. */
    204         UIDataCloudProfile  m_newData;
     203        /** Holds the old console application data copy. */
     204        UIDataCloudConsoleApplication  m_oldApplicationData;
     205        /** Holds the new console application data copy. */
     206        UIDataCloudConsoleApplication  m_newApplicationData;
     207
     208        /** Holds the old console profile data copy. */
     209        UIDataCloudConsoleProfile  m_oldProfileData;
     210        /** Holds the new console profile data copy. */
     211        UIDataCloudConsoleProfile  m_newProfileData;
    205212    /** @} */
    206213
    207214    /** @name Widget variables.
    208215      * @{ */
    209         /** Holds the name label instance. */
    210         QLabel    *m_pLabelName;
    211         /** Holds the name editor instance. */
    212         QLineEdit *m_pEditorName;
    213 
    214         /** Holds the table-widget label instance. */
    215         QLabel       *m_pLabelTableWidget;
    216         /** Holds the table-widget instance. */
    217         QTableWidget *m_pTableWidget;
     216        /** Holds the stacked layout isntance. */
     217        QStackedLayout *m_pStackedLayout;
     218
     219        /** Holds the application name label instance. */
     220        QLabel    *m_pLabelApplicationName;
     221        /** Holds the application name editor instance. */
     222        QLineEdit *m_pEditorApplicationName;
     223        /** Holds the application path label instance. */
     224        QLabel    *m_pLabelApplicationPath;
     225        /** Holds the application path editor instance. */
     226        QLineEdit *m_pEditorApplicationPath;
     227
     228        /** Holds the profile name label instance. */
     229        QLabel    *m_pLabelProfileName;
     230        /** Holds the profile name editor instance. */
     231        QLineEdit *m_pEditorProfileName;
     232        /** Holds the profile argument label instance. */
     233        QLabel    *m_pLabelProfileArgument;
     234        /** Holds the profile argument editor instance. */
     235        QLineEdit *m_pEditorProfileArgument;
    218236
    219237        /** Holds the button-box instance. */
     
    223241
    224242
    225 #endif /* !FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileDetailsWidget_h */
     243#endif /* !FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleDetailsWidget_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.cpp

    r85388 r85389  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UICloudProfileManager class implementation.
     3 * VBox Qt GUI - UICloudConsoleManager class implementation.
    44 */
    55
     
    1717
    1818/* Qt includes: */
     19#include <QDialog>
     20#include <QGridLayout>
    1921#include <QHeaderView>
     22#include <QLabel>
     23#include <QLineEdit>
    2024#include <QPushButton>
     25#include <QUuid>
    2126#include <QVBoxLayout>
    2227
    2328/* GUI includes: */
    2429#include "QIDialogButtonBox.h"
    25 #include "QIInputDialog.h"
    2630#include "QITreeWidget.h"
    2731#include "UICommon.h"
    2832#include "UIActionPoolManager.h"
    29 #include "UICloudNetworkingStuff.h"
    3033#include "UIExtraDataManager.h"
    3134#include "UIIconPool.h"
    32 #include "UICloudProfileDetailsWidget.h"
    33 #include "UICloudProfileManager.h"
     35#include "UICloudConsoleDetailsWidget.h"
     36#include "UICloudConsoleManager.h"
    3437#include "UIMessageCenter.h"
    3538#include "UIToolBar.h"
    3639
    37 /* COM includes: */
    38 #include "CCloudProfile.h"
    39 #include "CCloudProvider.h"
    40 #include "CCloudProviderManager.h"
    41 
    4240
    4341/** Tree-widget item types. */
    44 enum CloudItemType
    45 {
    46     CloudItemType_Invalid  = 0,
    47     CloudItemType_Provider = 1,
    48     CloudItemType_Profile  = 2
     42enum CloudConsoleItemType
     43{
     44    CloudConsoleItemType_Invalid     = 0,
     45    CloudConsoleItemType_Application = 1,
     46    CloudConsoleItemType_Profile     = 2
    4947};
    50 Q_DECLARE_METATYPE(CloudItemType);
     48Q_DECLARE_METATYPE(CloudConsoleItemType);
    5149
    5250/** Tree-widget data types. */
     
    5452{
    5553    Data_ItemType   = Qt::UserRole + 1,
    56     Data_ProviderID = Qt::UserRole + 2,
     54    Data_ItemID    = Qt::UserRole + 2,
    5755    Data_Definition = Qt::UserRole + 3,
    5856};
     
    6260{
    6361    Column_Name,
    64     Column_ListVMs,
     62    Column_ListInMenu,
    6563    Column_Max
    6664};
    6765
    6866
    69 /** Cloud Profile Manager provider's tree-widget item. */
    70 class UIItemCloudProvider : public QITreeWidgetItem, public UIDataCloudProvider
     67/** Cloud Console Manager application's tree-widget item. */
     68class UIItemCloudConsoleApplication : public QITreeWidgetItem, public UIDataCloudConsoleApplication
    7169{
    7270    Q_OBJECT;
     
    7573
    7674    /** Constructs item. */
    77     UIItemCloudProvider();
     75    UIItemCloudConsoleApplication();
    7876
    7977    /** Updates item fields from base-class data. */
    8078    void updateFields();
    8179
     80    /** Returns item id. */
     81    QString id() const { return m_strId; }
    8282    /** Returns item name. */
    8383    QString name() const { return m_strName; }
     84    /** Returns item path. */
     85    QString path() const { return m_strPath; }
    8486};
    8587
    86 /** Cloud Profile Manager profile's tree-widget item. */
    87 class UIItemCloudProfile : public QITreeWidgetItem, public UIDataCloudProfile
     88/** Cloud Console Manager profile's tree-widget item. */
     89class UIItemCloudConsoleProfile : public QITreeWidgetItem, public UIDataCloudConsoleProfile
    8890{
    8991    Q_OBJECT;
     
    9294
    9395    /** Constructs item. */
    94     UIItemCloudProfile();
     96    UIItemCloudConsoleProfile();
    9597
    9698    /** Updates item fields from base-class data. */
    9799    void updateFields();
    98100
     101    /** Returns item application id. */
     102    QString applicationId() const { return m_strApplicationId; }
     103    /** Returns item id. */
     104    QString id() const { return m_strId; }
    99105    /** Returns item name. */
    100106    QString name() const { return m_strName; }
     107    /** Returns item argument. */
     108    QString argument() const { return m_strArgument; }
    101109};
    102110
     111/** QDialog extension used to acquire newly created console application parameters. */
     112class UIInputDialogCloudConsoleApplication : public QIWithRetranslateUI<QDialog>
     113{
     114    Q_OBJECT;
     115
     116public:
     117
     118    /** Constructs dialog passing @a pParent to the base-class. */
     119    UIInputDialogCloudConsoleApplication(QWidget *pParent);
     120
     121    /** Returns application name. */
     122    QString name() const;
     123    /** Returns application path. */
     124    QString path() const;
     125
     126protected:
     127
     128    /** Handles translation event. */
     129    virtual void retranslateUi() /* override */;
     130
     131private:
     132
     133    /** Prepares all. */
     134    void prepare();
     135
     136    /** Holds the name label instance. */
     137    QLabel    *m_pLabelName;
     138    /** Holds the name editor instance. */
     139    QLineEdit *m_pEditorName;
     140    /** Holds the path label instance. */
     141    QLabel    *m_pLabelPath;
     142    /** Holds the path editor instance. */
     143    QLineEdit *m_pEditorPath;
     144
     145    /** Holds the button-box instance. */
     146    QIDialogButtonBox *m_pButtonBox;
     147};
     148
     149/** QDialog extension used to acquire newly created console profile parameters. */
     150class UIInputDialogCloudConsoleProfile : public QIWithRetranslateUI<QDialog>
     151{
     152    Q_OBJECT;
     153
     154public:
     155
     156    /** Constructs dialog passing @a pParent to the base-class. */
     157    UIInputDialogCloudConsoleProfile(QWidget *pParent);
     158
     159    /** Returns profile name. */
     160    QString name() const;
     161    /** Returns profile argument. */
     162    QString argument() const;
     163
     164protected:
     165
     166    /** Handles translation event. */
     167    virtual void retranslateUi() /* override */;
     168
     169private:
     170
     171    /** Prepares all. */
     172    void prepare();
     173
     174    /** Holds the name label instance. */
     175    QLabel    *m_pLabelName;
     176    /** Holds the name editor instance. */
     177    QLineEdit *m_pEditorName;
     178    /** Holds the argument label instance. */
     179    QLabel    *m_pLabelArgument;
     180    /** Holds the argument editor instance. */
     181    QLineEdit *m_pEditorArgument;
     182
     183    /** Holds the button-box instance. */
     184    QIDialogButtonBox *m_pButtonBox;
     185};
     186
    103187
    104188/*********************************************************************************************************************************
    105 *   Class UIItemCloudProvider implementation.                                                                                    *
     189*   Class UIItemCloudConsoleApplication implementation.                                                                          *
    106190*********************************************************************************************************************************/
    107191
    108 UIItemCloudProvider::UIItemCloudProvider()
     192UIItemCloudConsoleApplication::UIItemCloudConsoleApplication()
    109193{
    110194    /* Assign icon: */
    111     setIcon(Column_Name, UIIconPool::iconSet(":/provider_oracle_16px.png"));
    112     /* Assign item type: */
    113     setData(Column_Name, Data_ItemType, QVariant::fromValue(CloudItemType_Provider));
    114 }
    115 
    116 void UIItemCloudProvider::updateFields()
     195    setIcon(Column_Name, UIIconPool::iconSet(":/cloud_console_application_16px.png")); /// @todo use proper icon
     196    /* Assign item data: */
     197    setData(Column_Name, Data_ItemType, QVariant::fromValue(CloudConsoleItemType_Application));
     198}
     199
     200void UIItemCloudConsoleApplication::updateFields()
    117201{
    118202    /* Update item fields: */
    119203    setText(Column_Name, m_strName);
    120     setData(Column_Name, Data_ProviderID, m_uId);
    121     setData(Column_Name, Data_Definition, QVariant::fromValue(QString("/%1").arg(m_strShortName)));
    122     setCheckState(Column_ListVMs, m_fRestricted ? Qt::Unchecked : Qt::Checked);
     204    setData(Column_Name, Data_ItemID, m_strId);
     205    setData(Column_Name, Data_Definition, QVariant::fromValue(QString("/%1").arg(m_strId)));
     206    setCheckState(Column_ListInMenu, m_fRestricted ? Qt::Unchecked : Qt::Checked);
    123207}
    124208
    125209
    126210/*********************************************************************************************************************************
    127 *   Class UIItemCloudProfile implementation.                                                                                     *
     211*   Class UIItemCloudConsoleProfile implementation.                                                                              *
    128212*********************************************************************************************************************************/
    129213
    130 UIItemCloudProfile::UIItemCloudProfile()
     214UIItemCloudConsoleProfile::UIItemCloudConsoleProfile()
    131215{
    132216    /* Assign icon: */
    133     setIcon(Column_Name, UIIconPool::iconSet(":/profile_16px.png"));
    134     /* Assign item type: */
    135     setData(Column_Name, Data_ItemType, QVariant::fromValue(CloudItemType_Profile));
    136 }
    137 
    138 void UIItemCloudProfile::updateFields()
     217    setIcon(Column_Name, UIIconPool::iconSet(":/cloud_console_profile_16px.png")); /// @todo use proper icon
     218    /* Assign item data: */
     219    setData(Column_Name, Data_ItemType, QVariant::fromValue(CloudConsoleItemType_Profile));
     220}
     221
     222void UIItemCloudConsoleProfile::updateFields()
    139223{
    140224    /* Update item fields: */
    141225    setText(Column_Name, m_strName);
    142     setData(Column_Name, Data_Definition, QVariant::fromValue(QString("/%1/%2").arg(m_strProviderShortName, m_strName)));
    143     setCheckState(Column_ListVMs, m_fRestricted ? Qt::Unchecked : Qt::Checked);
     226    setData(Column_Name, Data_ItemID, m_strId);
     227    setData(Column_Name, Data_Definition, QVariant::fromValue(QString("/%1/%2").arg(m_strApplicationId, m_strId)));
     228    setCheckState(Column_ListInMenu, m_fRestricted ? Qt::Unchecked : Qt::Checked);
    144229}
    145230
    146231
    147232/*********************************************************************************************************************************
    148 *   Class UICloudProfileManagerWidget implementation.                                                                            *
     233*   Class UIInputDialogCloudConsoleApplication implementation.                                                                   *
    149234*********************************************************************************************************************************/
    150235
    151 UICloudProfileManagerWidget::UICloudProfileManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
     236UIInputDialogCloudConsoleApplication::UIInputDialogCloudConsoleApplication(QWidget *pParent)
     237    : QIWithRetranslateUI<QDialog>(pParent)
     238    , m_pLabelName(0)
     239    , m_pEditorName(0)
     240    , m_pLabelPath(0)
     241    , m_pEditorPath(0)
     242    , m_pButtonBox(0)
     243{
     244    prepare();
     245}
     246
     247QString UIInputDialogCloudConsoleApplication::name() const
     248{
     249    return m_pEditorName->text();
     250}
     251
     252QString UIInputDialogCloudConsoleApplication::path() const
     253{
     254    return m_pEditorPath->text();
     255}
     256
     257void UIInputDialogCloudConsoleApplication::retranslateUi()
     258{
     259    setWindowTitle(tr("Add Application"));
     260    m_pLabelName->setText(tr("Name:"));
     261    m_pLabelPath->setText(tr("Path:"));
     262}
     263
     264void UIInputDialogCloudConsoleApplication::prepare()
     265{
     266    /* Configure self: */
     267    setWindowIcon(UIIconPool::iconSet(":/cloud_console_application_add_16px.png")); /// @todo use proper icon
     268
     269    /* Prepare main layout: */
     270    QGridLayout *pMainLayout = new QGridLayout(this);
     271    if (pMainLayout)
     272    {
     273        pMainLayout->setRowStretch(0, 0);
     274        pMainLayout->setRowStretch(1, 0);
     275        pMainLayout->setRowStretch(2, 1);
     276        pMainLayout->setRowStretch(3, 0);
     277
     278        /* Prepare name editor: */
     279        m_pEditorName = new QLineEdit(this);
     280        if (m_pEditorName)
     281        {
     282            pMainLayout->addWidget(m_pEditorName, 0, 1);
     283        }
     284        /* Prepare name editor label: */
     285        m_pLabelName = new QLabel(this);
     286        if (m_pLabelName)
     287        {
     288            m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     289            m_pLabelName->setBuddy(m_pEditorName);
     290            pMainLayout->addWidget(m_pLabelName, 0, 0);
     291        }
     292
     293        /* Prepare path editor: */
     294        m_pEditorPath = new QLineEdit(this);
     295        if (m_pEditorPath)
     296        {
     297            pMainLayout->addWidget(m_pEditorPath, 1, 1);
     298        }
     299        /* Prepare path editor label: */
     300        m_pLabelPath = new QLabel(this);
     301        if (m_pLabelPath)
     302        {
     303            m_pLabelPath->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     304            m_pLabelPath->setBuddy(m_pEditorPath);
     305            pMainLayout->addWidget(m_pLabelPath, 1, 0);
     306        }
     307
     308        /* Prepare button-box: */
     309        m_pButtonBox = new QIDialogButtonBox(this);
     310        if  (m_pButtonBox)
     311        {
     312            m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
     313            connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIInputDialogCloudConsoleApplication::reject);
     314            connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIInputDialogCloudConsoleApplication::accept);
     315            pMainLayout->addWidget(m_pButtonBox, 3, 0, 1, 2);
     316        }
     317    }
     318
     319    /* Apply language settings: */
     320    retranslateUi();
     321
     322    /* Resize to suitable size: */
     323    const int iMinimumHeightHint = minimumSizeHint().height();
     324    resize(iMinimumHeightHint * 3, iMinimumHeightHint);
     325}
     326
     327
     328/*********************************************************************************************************************************
     329*   Class UIInputDialogCloudConsoleProfile implementation.                                                                       *
     330*********************************************************************************************************************************/
     331
     332UIInputDialogCloudConsoleProfile::UIInputDialogCloudConsoleProfile(QWidget *pParent)
     333    : QIWithRetranslateUI<QDialog>(pParent)
     334    , m_pLabelName(0)
     335    , m_pEditorName(0)
     336    , m_pLabelArgument(0)
     337    , m_pEditorArgument(0)
     338    , m_pButtonBox(0)
     339{
     340    prepare();
     341}
     342
     343QString UIInputDialogCloudConsoleProfile::name() const
     344{
     345    return m_pEditorName->text();
     346}
     347
     348QString UIInputDialogCloudConsoleProfile::argument() const
     349{
     350    return m_pEditorArgument->text();
     351}
     352
     353void UIInputDialogCloudConsoleProfile::retranslateUi()
     354{
     355    setWindowTitle(tr("Add Profile"));
     356    m_pLabelName->setText(tr("Name:"));
     357    m_pLabelArgument->setText(tr("Argument:"));
     358}
     359
     360void UIInputDialogCloudConsoleProfile::prepare()
     361{
     362    /* Configure self: */
     363    setWindowIcon(UIIconPool::iconSet(":/cloud_console_profile_add_16px.png")); /// @todo use proper icon
     364
     365    /* Prepare main layout: */
     366    QGridLayout *pMainLayout = new QGridLayout(this);
     367    if (pMainLayout)
     368    {
     369        pMainLayout->setRowStretch(0, 0);
     370        pMainLayout->setRowStretch(1, 0);
     371        pMainLayout->setRowStretch(2, 1);
     372        pMainLayout->setRowStretch(3, 0);
     373
     374        /* Prepare name editor: */
     375        m_pEditorName = new QLineEdit(this);
     376        if (m_pEditorName)
     377        {
     378            pMainLayout->addWidget(m_pEditorName, 0, 1);
     379        }
     380        /* Prepare name editor label: */
     381        m_pLabelName = new QLabel(this);
     382        if (m_pLabelName)
     383        {
     384            m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     385            m_pLabelName->setBuddy(m_pEditorName);
     386            pMainLayout->addWidget(m_pLabelName, 0, 0);
     387        }
     388
     389        /* Prepare argument editor: */
     390        m_pEditorArgument = new QLineEdit(this);
     391        if (m_pEditorArgument)
     392        {
     393            pMainLayout->addWidget(m_pEditorArgument, 1, 1);
     394        }
     395        /* Prepare argument editor label: */
     396        m_pLabelArgument = new QLabel(this);
     397        if (m_pLabelArgument)
     398        {
     399            m_pLabelArgument->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     400            m_pLabelArgument->setBuddy(m_pEditorArgument);
     401            pMainLayout->addWidget(m_pLabelArgument, 1, 0);
     402        }
     403
     404        /* Prepare button-box: */
     405        m_pButtonBox = new QIDialogButtonBox(this);
     406        if  (m_pButtonBox)
     407        {
     408            m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
     409            connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIInputDialogCloudConsoleApplication::reject);
     410            connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIInputDialogCloudConsoleApplication::accept);
     411            pMainLayout->addWidget(m_pButtonBox, 3, 0, 1, 2);
     412        }
     413    }
     414
     415    /* Apply language settings: */
     416    retranslateUi();
     417
     418    /* Resize to suitable size: */
     419    const int iMinimumHeightHint = minimumSizeHint().height();
     420    resize(iMinimumHeightHint * 3, iMinimumHeightHint);
     421}
     422
     423
     424/*********************************************************************************************************************************
     425*   Class UICloudConsoleManagerWidget implementation.                                                                            *
     426*********************************************************************************************************************************/
     427
     428UICloudConsoleManagerWidget::UICloudConsoleManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    152429                                                         bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */)
    153430    : QIWithRetranslateUI<QWidget>(pParent)
     
    162439}
    163440
    164 QMenu *UICloudProfileManagerWidget::menu() const
    165 {
    166     return m_pActionPool->action(UIActionIndexST_M_CloudWindow)->menu();
    167 }
    168 
    169 void UICloudProfileManagerWidget::retranslateUi()
     441QMenu *UICloudConsoleManagerWidget::menu() const
     442{
     443    return m_pActionPool->action(UIActionIndexST_M_CloudConsoleWindow)->menu();
     444}
     445
     446void UICloudConsoleManagerWidget::retranslateUi()
    170447{
    171448    /* Adjust toolbar: */
     
    182459    /* Translate tree-widget: */
    183460    m_pTreeWidget->setHeaderLabels(   QStringList()
    184                                    << tr("Source")
    185                                    << tr("List VMs"));
    186 }
    187 
    188 void UICloudProfileManagerWidget::sltResetCloudProfileDetailsChanges()
     461                                   << tr("Application")
     462                                   << tr("List in Menu"));
     463}
     464
     465void UICloudConsoleManagerWidget::sltResetCloudConsoleDetailsChanges()
    189466{
    190467    /* Just push the current-item data there again: */
     
    192469}
    193470
    194 void UICloudProfileManagerWidget::sltApplyCloudProfileDetailsChanges()
    195 {
    196     /* It can be that there is provider item, not profile item currently selected.
    197      * In such case we are not applying parameters, we are creating new one profile. */
     471void UICloudConsoleManagerWidget::sltApplyCloudConsoleDetailsChanges()
     472{
     473    /* Check current-item type: */
    198474    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->currentItem());
    199     UIItemCloudProvider *pMaybeProviderItem = qobject_cast<UIItemCloudProvider*>(pItem);
    200     if (pMaybeProviderItem)
    201         return sltAddCloudProfile();
    202 
    203     /* Get profile item: */
    204     UIItemCloudProfile *pProfileItem = qobject_cast<UIItemCloudProfile*>(pItem);
    205     AssertMsgReturnVoid(pProfileItem, ("Current item must not be null!\n"));
    206 
    207     /* Get item data: */
    208     UIDataCloudProfile oldData = *pProfileItem;
    209     UIDataCloudProfile newData = m_pDetailsWidget->data();
    210 
    211     /* Get VirtualBox for further activities: */
    212     const CVirtualBox comVBox = uiCommon().virtualBox();
    213 
    214     /* Get CloudProviderManager for further activities: */
    215     CCloudProviderManager comCloudProviderManager = comVBox.GetCloudProviderManager();
    216     /* Show error message if necessary: */
    217     if (!comVBox.isOk())
    218         msgCenter().cannotAcquireCloudProviderManager(comVBox, this);
    219     else
    220     {
    221         /* Get provider item: */
    222         UIItemCloudProvider *pProviderItem = qobject_cast<UIItemCloudProvider*>(pProfileItem->parentItem());
    223         /* Acquire provider ID: */
    224         const QUuid uId = pProviderItem->data(Column_Name, Data_ProviderID).toUuid();
    225 
    226         /* Look for corresponding provider: */
    227         CCloudProvider comCloudProvider = comCloudProviderManager.GetProviderById(uId);
    228         /* Show error message if necessary: */
    229         if (!comCloudProviderManager.isOk())
    230             msgCenter().cannotFindCloudProvider(comCloudProviderManager, uId, this);
    231         else
    232         {
    233             /* Look for corresponding profile: */
    234             CCloudProfile comCloudProfile = comCloudProvider.GetProfileByName(oldData.m_strName);
    235             /* Show error message if necessary: */
    236             if (!comCloudProvider.isOk())
    237                 msgCenter().cannotFindCloudProfile(comCloudProvider, oldData.m_strName, this);
    238             else
    239             {
    240                 /* Set profile name, if necessary: */
    241                 if (newData.m_strName != oldData.m_strName)
    242                     comCloudProfile.SetName(newData.m_strName);
    243                 /* Show error message if necessary: */
    244                 if (!comCloudProfile.isOk())
    245                     msgCenter().cannotAssignCloudProfileParameter(comCloudProfile, this);
    246                 else
    247                 {
    248                     /* Iterate through old/new data: */
    249                     foreach (const QString &strKey, oldData.m_data.keys())
    250                     {
    251                         /* Get values: */
    252                         const QString strOldValue = oldData.m_data.value(strKey).first;
    253                         const QString strNewValue = newData.m_data.value(strKey).first;
    254                         if (strNewValue != strOldValue)
    255                         {
    256                             /* Apply property: */
    257                             comCloudProfile.SetProperty(strKey, strNewValue);
    258                             /* Show error message if necessary: */
    259                             if (!comCloudProfile.isOk())
    260                             {
    261                                 msgCenter().cannotAssignCloudProfileParameter(comCloudProfile, this);
    262                                 break;
    263                             }
    264                         }
    265                     }
    266                 }
    267 
    268                 /* If profile is Ok finally: */
    269                 if (comCloudProfile.isOk())
    270                 {
    271                     /* Update profile in the tree: */
    272                     UIDataCloudProfile data;
    273                     loadCloudProfile(comCloudProfile, *pProviderItem, data);
    274                     updateItemForCloudProfile(data, true, pProfileItem);
    275 
    276                     /* Make sure current-item fetched: */
    277                     sltHandleCurrentItemChange();
    278 
    279                     /* Save profile changes: */
    280                     comCloudProvider.SaveProfiles();
    281                     /* Show error message if necessary: */
    282                     if (!comCloudProvider.isOk())
    283                         msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
    284                 }
    285             }
    286         }
    287     }
    288 
    289     /* Notify listeners: */
    290     emit sigChange();
    291 }
    292 
    293 void UICloudProfileManagerWidget::sltAddCloudProfile()
    294 {
    295     /* Get provider item: */
     475    AssertMsgReturnVoid(pItem, ("Current item must not be null!\n"));
     476    switch (pItem->data(Column_Name, Data_ItemType).value<CloudConsoleItemType>())
     477    {
     478        case CloudConsoleItemType_Application:
     479        {
     480            /* Save application changes: */
     481            UIItemCloudConsoleApplication *pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem);
     482            AssertPtrReturnVoid(pItemApplication);
     483            const UIDataCloudConsoleApplication oldData = *pItemApplication;
     484            const UIDataCloudConsoleApplication newData = m_pDetailsWidget->applicationData();
     485            /* Save application settings if changed: */
     486            if (newData != oldData)
     487                gEDataManager->setCloudConsoleManagerApplication(newData.m_strId,
     488                                                                 QString("%1,%2").arg(newData.m_strName, newData.m_strPath));
     489            break;
     490        }
     491        case CloudConsoleItemType_Profile:
     492        {
     493            /* Save profile changes: */
     494            UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pItem);
     495            AssertPtrReturnVoid(pItemProfile);
     496            const UIDataCloudConsoleProfile oldData = *pItemProfile;
     497            const UIDataCloudConsoleProfile newData = m_pDetailsWidget->profileData();
     498            /* Save profile settings if changed: */
     499            if (newData != oldData)
     500                gEDataManager->setCloudConsoleManagerProfile(newData.m_strApplicationId,
     501                                                             newData.m_strId,
     502                                                             QString("%1,%2").arg(newData.m_strName, newData.m_strArgument));
     503            break;
     504        }
     505        case CloudConsoleItemType_Invalid:
     506            break;
     507    }
     508}
     509
     510void UICloudConsoleManagerWidget::sltAddCloudConsoleApplication()
     511{
     512    /* Acquire application attributes: */
     513    QString strId;
     514    QString strApplicationName;
     515    QString strApplicationPath;
     516    bool fCancelled = true;
     517    QPointer<UIInputDialogCloudConsoleApplication> pDialog = new UIInputDialogCloudConsoleApplication(this);
     518    if (pDialog)
     519    {
     520        if (pDialog->exec() == QDialog::Accepted)
     521        {
     522            strId = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
     523            strApplicationName = pDialog->name();
     524            strApplicationPath = pDialog->path();
     525            fCancelled = false;
     526        }
     527        delete pDialog;
     528    }
     529    if (fCancelled)
     530        return;
     531
     532    /* Update current-item definition: */
     533    m_strDefinition = QString("/%1").arg(strId);
     534    /* Compose extra-data superset: */
     535    const QString strValue = QString("%1,%2").arg(strApplicationName, strApplicationPath);
     536
     537    /* Save new console application to extra-data: */
     538    gEDataManager->setCloudConsoleManagerApplication(strId, strValue);
     539}
     540
     541void UICloudConsoleManagerWidget::sltRemoveCloudConsoleApplication()
     542{
     543    /* Get console application item: */
    296544    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->currentItem());
    297     UIItemCloudProvider *pProviderItem = qobject_cast<UIItemCloudProvider*>(pItem);
    298     AssertMsgReturnVoid(pProviderItem, ("Current item must not be null!\n"));
    299 
    300     /* Acquire profile name if not proposed by details widget: */
    301     QString strProfileName = m_pDetailsWidget->data().m_strName;
    302     if (strProfileName.isEmpty())
    303     {
    304         bool fCancelled = true;
    305         QISafePointerInputDialog pDialog = new QIInputDialog(this);
    306         if (pDialog)
    307         {
    308             pDialog->setWindowIcon(UIIconPool::iconSet(":/cloud_profile_add_16px.png"));
    309             pDialog->setWindowTitle(UICloudProfileManager::tr("Add Profile"));
    310             if (pDialog->exec() == QDialog::Accepted)
    311             {
    312                 strProfileName = pDialog->textValue();
    313                 fCancelled = false;
    314             }
    315             delete pDialog;
    316         }
    317         if (fCancelled)
    318             return;
    319     }
    320 
    321     /* Get VirtualBox for further activities: */
    322     const CVirtualBox comVBox = uiCommon().virtualBox();
    323 
    324     /* Get CloudProviderManager for further activities: */
    325     CCloudProviderManager comCloudProviderManager = comVBox.GetCloudProviderManager();
    326     /* Show error message if necessary: */
    327     if (!comVBox.isOk())
    328         msgCenter().cannotAcquireCloudProviderManager(comVBox, this);
    329     else
    330     {
    331         /* Acquire provider ID: */
    332         const QUuid uId = pProviderItem->data(Column_Name, Data_ProviderID).toUuid();
    333 
    334         /* Look for corresponding provider: */
    335         CCloudProvider comCloudProvider = comCloudProviderManager.GetProviderById(uId);
    336         /* Show error message if necessary: */
    337         if (!comCloudProviderManager.isOk())
    338             msgCenter().cannotFindCloudProvider(comCloudProviderManager, uId, this);
    339         else
    340         {
    341             /* Create new profile: */
    342             const QVector<QString> keys = pProviderItem->m_propertyDescriptions.keys().toVector();
    343             const QVector<QString> values(keys.size());
    344             comCloudProvider.CreateProfile(strProfileName, keys, values);
    345 
    346             /* Show error message if necessary: */
    347             if (!comCloudProvider.isOk())
    348                 msgCenter().cannotCreateCloudProfle(comCloudProvider, this);
    349             else
    350             {
    351                 /* Look for corresponding profile: */
    352                 CCloudProfile comCloudProfile = comCloudProvider.GetProfileByName(strProfileName);
    353                 /* Show error message if necessary: */
    354                 if (!comCloudProvider.isOk())
    355                     msgCenter().cannotFindCloudProfile(comCloudProvider, strProfileName, this);
    356                 else
    357                 {
    358                     /* Add profile to the tree: */
    359                     UIDataCloudProfile data;
    360                     loadCloudProfile(comCloudProfile, *pProviderItem, data);
    361                     createItemForCloudProfile(pProviderItem, data, true);
    362 
    363                     /* Save profile changes: */
    364                     comCloudProvider.SaveProfiles();
    365                     /* Show error message if necessary: */
    366                     if (!comCloudProvider.isOk())
    367                         msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
    368                 }
    369             }
    370         }
    371     }
    372 
    373     /* Notify listeners: */
    374     emit sigChange();
    375 }
    376 
    377 void UICloudProfileManagerWidget::sltImportCloudProfiles()
    378 {
    379     /* Get provider item: */
     545    UIItemCloudConsoleApplication *pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem);
     546    AssertMsgReturnVoid(pItemApplication, ("Application item must not be null!\n"));
     547    const QString strApplicationId = pItemApplication->id();
     548
     549    /* Confirm cloud console application removal: */
     550    if (!msgCenter().confirmCloudConsoleApplicationRemoval(pItemApplication->name(), this))
     551        return;
     552
     553    /* Enumerate all the application profiles: */
     554    for (int i = 0; i < pItemApplication->childCount(); ++i)
     555    {
     556        /* Get console profile item: */
     557        QITreeWidgetItem *pItem = pItemApplication->childItem(i);
     558        UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pItem);
     559        AssertMsgReturnVoid(pItemProfile, ("Profile item must not be null!\n"));
     560
     561        /* Delete profile from extra-data: */
     562        gEDataManager->setCloudConsoleManagerProfile(strApplicationId, pItemProfile->id(), QString());
     563    }
     564
     565    /* Delete application from extra-data: */
     566    gEDataManager->setCloudConsoleManagerApplication(strApplicationId, QString());
     567}
     568
     569void UICloudConsoleManagerWidget::sltAddCloudConsoleProfile()
     570{
     571    /* Check current-item type: */
    380572    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->currentItem());
    381     UIItemCloudProvider *pProviderItem = qobject_cast<UIItemCloudProvider*>(pItem);
    382     AssertMsgReturnVoid(pProviderItem, ("Current item must not be null!\n"));
    383 
    384     /* If there are profiles exist => confirm cloud profile import. */
    385     if (   pProviderItem->childCount() != 0
    386         && !msgCenter().confirmCloudProfilesImport(this))
     573    AssertMsgReturnVoid(pItem, ("Current item must not be null!\n"));
     574    UIItemCloudConsoleApplication *pItemApplication = 0;
     575    switch (pItem->data(Column_Name, Data_ItemType).value<CloudConsoleItemType>())
     576    {
     577        case CloudConsoleItemType_Application:
     578            pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem);
     579            break;
     580        case CloudConsoleItemType_Profile:
     581            pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem->parentItem());
     582            break;
     583        case CloudConsoleItemType_Invalid:
     584            break;
     585    }
     586    AssertMsgReturnVoid(pItemApplication, ("Application item must not be null!\n"));
     587    const QString strApplicationId = pItemApplication->id();
     588
     589    /* Acquire profile attributes: */
     590    QString strId;
     591    QString strProfileName;
     592    QString strProfileArgument;
     593    bool fCancelled = true;
     594    QPointer<UIInputDialogCloudConsoleProfile> pDialog = new UIInputDialogCloudConsoleProfile(this);
     595    if (pDialog)
     596    {
     597        if (pDialog->exec() == QDialog::Accepted)
     598        {
     599            strId = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
     600            strProfileName = pDialog->name();
     601            strProfileArgument = pDialog->argument();
     602            fCancelled = false;
     603        }
     604        delete pDialog;
     605    }
     606    if (fCancelled)
    387607        return;
    388608
    389     /* Get VirtualBox for further activities: */
    390     const CVirtualBox comVBox = uiCommon().virtualBox();
    391 
    392     /* Get CloudProviderManager for further activities: */
    393     CCloudProviderManager comCloudProviderManager = comVBox.GetCloudProviderManager();
    394     /* Show error message if necessary: */
    395     if (!comVBox.isOk())
    396         msgCenter().cannotAcquireCloudProviderManager(comVBox, this);
    397     else
    398     {
    399         /* Acquire provider ID: */
    400         const QUuid uId = pProviderItem->data(Column_Name, Data_ProviderID).toUuid();
    401 
    402         /* Look for corresponding provider: */
    403         CCloudProvider comCloudProvider = comCloudProviderManager.GetProviderById(uId);
    404         /* Show error message if necessary: */
    405         if (!comCloudProviderManager.isOk())
    406             msgCenter().cannotFindCloudProvider(comCloudProviderManager, uId, this);
    407         else
    408         {
    409             /* Import profiles: */
    410             comCloudProvider.ImportProfiles();
    411 
    412             /* Show error message if necessary: */
    413             if (!comCloudProvider.isOk())
    414                 msgCenter().cannotImportCloudProfiles(comCloudProvider, this);
    415             else
    416                 loadCloudStuff();
    417         }
    418     }
    419 
    420     /* Notify listeners: */
    421     emit sigChange();
    422 }
    423 
    424 void UICloudProfileManagerWidget::sltRemoveCloudProfile()
    425 {
    426     /* Get profile item: */
     609    /* Update current-item definition: */
     610    m_strDefinition = QString("/%1/%2").arg(strApplicationId, strId);
     611    /* Compose extra-data superset: */
     612    const QString strValue = QString("%1,%2").arg(strProfileName, strProfileArgument);
     613
     614    /* Save new console profile to extra-data: */
     615    gEDataManager->setCloudConsoleManagerProfile(strApplicationId, strId, strValue);
     616}
     617
     618void UICloudConsoleManagerWidget::sltRemoveCloudConsoleProfile()
     619{
     620    /* Get console profile item: */
    427621    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->currentItem());
    428     UIItemCloudProfile *pProfileItem = qobject_cast<UIItemCloudProfile*>(pItem);
    429     AssertMsgReturnVoid(pProfileItem, ("Current item must not be null!\n"));
    430 
    431     /* Get profile name: */
    432     const QString strProfileName(pProfileItem->name());
    433 
    434     /* Confirm cloud profile removal: */
    435     if (!msgCenter().confirmCloudProfileRemoval(strProfileName, this))
     622    UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pItem);
     623    AssertMsgReturnVoid(pItemProfile, ("Profile item must not be null!\n"));
     624
     625    /* Confirm cloud console profile removal: */
     626    if (!msgCenter().confirmCloudConsoleProfileRemoval(pItemProfile->name(), this))
    436627        return;
    437628
    438     /* Get VirtualBox for further activities: */
    439     const CVirtualBox comVBox = uiCommon().virtualBox();
    440 
    441     /* Get CloudProviderManager for further activities: */
    442     CCloudProviderManager comCloudProviderManager = comVBox.GetCloudProviderManager();
    443     /* Show error message if necessary: */
    444     if (!comVBox.isOk())
    445         msgCenter().cannotAcquireCloudProviderManager(comVBox, this);
    446     else
    447     {
    448         /* Get provider item: */
    449         UIItemCloudProvider *pProviderItem = qobject_cast<UIItemCloudProvider*>(pProfileItem->parentItem());
    450         /* Acquire provider ID: */
    451         const QUuid uId = pProviderItem->data(Column_Name, Data_ProviderID).toUuid();
    452 
    453         /* Look for corresponding provider: */
    454         CCloudProvider comCloudProvider = comCloudProviderManager.GetProviderById(uId);
    455         /* Show error message if necessary: */
    456         if (!comCloudProviderManager.isOk())
    457             msgCenter().cannotFindCloudProvider(comCloudProviderManager, uId, this);
    458         else
    459         {
    460             /* Look for corresponding profile: */
    461             CCloudProfile comCloudProfile = comCloudProvider.GetProfileByName(strProfileName);
    462             /* Show error message if necessary: */
    463             if (!comCloudProvider.isOk())
    464                 msgCenter().cannotFindCloudProfile(comCloudProvider, strProfileName, this);
    465             else
    466             {
    467                 /* Remove current profile: */
    468                 comCloudProfile.Remove();
    469                 /// @todo how do we check that?
    470 
    471                 /* Remove interface from the tree: */
    472                 delete pProfileItem;
    473 
    474                 /* Save profile changes: */
    475                 comCloudProvider.SaveProfiles();
    476                 /* Show error message if necessary: */
    477                 if (!comCloudProvider.isOk())
    478                     msgCenter().cannotSaveCloudProfiles(comCloudProvider, this);
    479             }
    480         }
    481     }
    482 
    483     /* Notify listeners: */
    484     emit sigChange();
    485 }
    486 
    487 void UICloudProfileManagerWidget::sltToggleCloudProfileDetailsVisibility(bool fVisible)
     629    /* Delete profile from extra-data: */
     630    gEDataManager->setCloudConsoleManagerProfile(pItemProfile->applicationId(), pItemProfile->id(), QString());
     631}
     632
     633void UICloudConsoleManagerWidget::sltToggleCloudConsoleDetailsVisibility(bool fVisible)
    488634{
    489635    /* Save the setting: */
    490     gEDataManager->setCloudProfileManagerDetailsExpanded(fVisible);
     636    gEDataManager->setCloudConsoleManagerDetailsExpanded(fVisible);
    491637    /* Show/hide details area and Apply button: */
    492638    m_pDetailsWidget->setVisible(fVisible);
    493639    /* Notify external lsiteners: */
    494     emit sigCloudProfileDetailsVisibilityChanged(fVisible);
    495 }
    496 
    497 void UICloudProfileManagerWidget::sltShowCloudProfileTryPage()
    498 {
    499     uiCommon().openURL("https://myservices.us.oraclecloud.com/mycloud/signup");
    500 }
    501 
    502 void UICloudProfileManagerWidget::sltShowCloudProfileHelp()
    503 {
    504     uiCommon().openURL("https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm");
    505 }
    506 
    507 void UICloudProfileManagerWidget::sltPerformTableAdjustment()
     640    emit sigCloudConsoleDetailsVisibilityChanged(fVisible);
     641}
     642
     643void UICloudConsoleManagerWidget::sltPerformTableAdjustment()
    508644{
    509645    AssertPtrReturnVoid(m_pTreeWidget);
     
    513649}
    514650
    515 void UICloudProfileManagerWidget::sltHandleCurrentItemChange()
     651void UICloudConsoleManagerWidget::sltHandleCurrentItemChange()
    516652{
    517653    /* Check current-item type: */
    518654    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->currentItem());
    519     UIItemCloudProvider *pItemProvider = qobject_cast<UIItemCloudProvider*>(pItem);
    520     UIItemCloudProfile *pItemProfile = qobject_cast<UIItemCloudProfile*>(pItem);
     655    UIItemCloudConsoleApplication *pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem);
     656    UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pItem);
    521657
    522658    /* Update actions availability: */
    523     m_pActionPool->action(UIActionIndexST_M_Cloud_S_Add)->setEnabled(!pItem || pItemProvider);
    524     m_pActionPool->action(UIActionIndexST_M_Cloud_S_Import)->setEnabled(!pItem || pItemProvider);
    525     m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove)->setEnabled(pItemProfile);
    526     m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details)->setEnabled(pItemProfile || pItemProvider);
    527 
    528     /* If there is an item => update details data: */
    529     if (pItemProfile)
    530         m_pDetailsWidget->setData(*pItemProfile);
    531     /* Otherwise => clear details data: */
     659    m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd)->setEnabled(!pItem || pItemApplication);
     660    m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove)->setEnabled(pItemApplication);
     661    m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileAdd)->setEnabled(pItemApplication || pItemProfile);
     662    m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileRemove)->setEnabled(pItemProfile);
     663    m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details)->setEnabled(pItemApplication || pItemProfile);
     664
     665    /* Update current-item definition: */
     666    if (pItem)
     667        m_strDefinition = pItem->data(Column_Name, Data_Definition).toString();
     668
     669    /* Update details data: */
     670    if (pItemApplication)
     671        m_pDetailsWidget->setApplicationData(*pItemApplication);
     672    else if (pItemProfile)
     673        m_pDetailsWidget->setProfileData(*pItemProfile);
    532674    else
    533         m_pDetailsWidget->setData(UIDataCloudProfile());
     675        m_pDetailsWidget->clearData();
    534676
    535677    /* Update details area visibility: */
    536     sltToggleCloudProfileDetailsVisibility(pItem && m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details)->isChecked());
    537 }
    538 
    539 void UICloudProfileManagerWidget::sltHandleContextMenuRequest(const QPoint &position)
    540 {
    541     /* Check clicked-item type: */
     678    sltToggleCloudConsoleDetailsVisibility(pItem && m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details)->isChecked());
     679}
     680
     681void UICloudConsoleManagerWidget::sltHandleContextMenuRequest(const QPoint &position)
     682{
     683    /* Check item type: */
    542684    QITreeWidgetItem *pItem = QITreeWidgetItem::toItem(m_pTreeWidget->itemAt(position));
    543     UIItemCloudProvider *pItemProvider = qobject_cast<UIItemCloudProvider*>(pItem);
    544     UIItemCloudProfile *pItemProfile = qobject_cast<UIItemCloudProfile*>(pItem);
     685    UIItemCloudConsoleApplication *pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pItem);
     686    UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pItem);
    545687
    546688    /* Compose temporary context-menu: */
    547689    QMenu menu;
    548     if (pItemProfile)
    549     {
    550         menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove));
    551         menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
    552     }
    553     else if (pItemProvider)
    554     {
    555         menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Add));
    556         menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Import));
    557         menu.addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
    558     }
     690    if (pItemApplication)
     691    {
     692        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove));
     693        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileAdd));
     694        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details));
     695    }
     696    else if (pItemProfile)
     697    {
     698        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileRemove));
     699        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details));
     700    }
     701    else
     702        menu.addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd));
    559703
    560704    /* And show it: */
     
    562706}
    563707
    564 void UICloudProfileManagerWidget::sltHandleItemChange(QTreeWidgetItem *pItem)
     708void UICloudConsoleManagerWidget::sltHandleItemChange(QTreeWidgetItem *pItem)
    565709{
    566710    /* Check item type: */
    567711    QITreeWidgetItem *pChangedItem = QITreeWidgetItem::toItem(pItem);
    568     UIItemCloudProvider *pProviderItem = qobject_cast<UIItemCloudProvider*>(pChangedItem);
    569     UIItemCloudProfile *pProfileItem = qobject_cast<UIItemCloudProfile*>(pChangedItem);
    570 
    571     /* Check whether item is of provider or profile type, then check whether it changed: */
     712    UIItemCloudConsoleApplication *pItemApplication = qobject_cast<UIItemCloudConsoleApplication*>(pChangedItem);
     713    UIItemCloudConsoleProfile *pItemProfile = qobject_cast<UIItemCloudConsoleProfile*>(pChangedItem);
     714
     715    /* Check whether item is of application or profile type, then check whether it changed: */
    572716    bool fChanged = false;
    573     if (pProviderItem)
    574     {
    575         const UIDataCloudProvider oldData = *pProviderItem;
    576         if (   (oldData.m_fRestricted && pProviderItem->checkState(Column_ListVMs) == Qt::Checked)
    577             || (!oldData.m_fRestricted && pProviderItem->checkState(Column_ListVMs) == Qt::Unchecked))
     717    if (pItemApplication)
     718    {
     719        const UIDataCloudConsoleApplication oldData = *pItemApplication;
     720        if (   (oldData.m_fRestricted && pItemApplication->checkState(Column_ListInMenu) == Qt::Checked)
     721            || (!oldData.m_fRestricted && pItemApplication->checkState(Column_ListInMenu) == Qt::Unchecked))
    578722            fChanged = true;
    579723    }
    580     else if (pProfileItem)
    581     {
    582         const UIDataCloudProfile oldData = *pProfileItem;
    583         if (   (oldData.m_fRestricted && pProfileItem->checkState(Column_ListVMs) == Qt::Checked)
    584             || (!oldData.m_fRestricted && pProfileItem->checkState(Column_ListVMs) == Qt::Unchecked))
     724    else if (pItemProfile)
     725    {
     726        const UIDataCloudConsoleProfile oldData = *pItemProfile;
     727        if (   (oldData.m_fRestricted && pItemProfile->checkState(Column_ListInMenu) == Qt::Checked)
     728            || (!oldData.m_fRestricted && pItemProfile->checkState(Column_ListInMenu) == Qt::Unchecked))
    585729            fChanged = true;
    586730    }
    587731
    588     /* Gather Cloud Profile Manager restrictions and save them to extra-data: */
     732    /* Gather Cloud Console Manager restrictions and save them to extra-data: */
    589733    if (fChanged)
    590         gEDataManager->setCloudProfileManagerRestrictions(gatherCloudProfileManagerRestrictions(m_pTreeWidget->invisibleRootItem()));
    591 }
    592 
    593 void UICloudProfileManagerWidget::prepare()
     734        gEDataManager->setCloudConsoleManagerRestrictions(gatherCloudConsoleManagerRestrictions(m_pTreeWidget->invisibleRootItem()));
     735}
     736
     737void UICloudConsoleManagerWidget::prepare()
    594738{
    595739    /* Prepare actions: */
     
    604748    retranslateUi();
    605749
    606     /* Load cloud stuff: */
    607     loadCloudStuff();
    608 }
    609 
    610 void UICloudProfileManagerWidget::prepareActions()
     750    /* Load cloud console stuff: */
     751    loadCloudConsoleStuff();
     752}
     753
     754void UICloudConsoleManagerWidget::prepareActions()
    611755{
    612756    /* First of all, add actions which has smaller shortcut scope: */
    613     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Add));
    614     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Import));
    615     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove));
    616     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
    617     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_TryPage));
    618     addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Help));
    619 }
    620 
    621 void UICloudProfileManagerWidget::prepareWidgets()
     757    addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd));
     758    addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove));
     759    addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileAdd));
     760    addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileRemove));
     761    addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details));
     762}
     763
     764void UICloudConsoleManagerWidget::prepareWidgets()
    622765{
    623766    /* Create main-layout: */
     
    645788}
    646789
    647 void UICloudProfileManagerWidget::prepareToolBar()
     790void UICloudConsoleManagerWidget::prepareToolBar()
    648791{
    649792    /* Create toolbar: */
     
    657800
    658801        /* Add toolbar actions: */
    659         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Add));
    660         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Import));
     802        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd));
     803        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove));
    661804        m_pToolBar->addSeparator();
    662         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove));
    663         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details));
     805        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileAdd));
     806        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileRemove));
    664807        m_pToolBar->addSeparator();
    665         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_TryPage));
    666         m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Help));
     808        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details));
    667809
    668810#ifdef VBOX_WS_MAC
     
    680822}
    681823
    682 void UICloudProfileManagerWidget::prepareTreeWidget()
     824void UICloudConsoleManagerWidget::prepareTreeWidget()
    683825{
    684826    /* Create tree-widget: */
     
    702844}
    703845
    704 void UICloudProfileManagerWidget::prepareDetailsWidget()
     846void UICloudConsoleManagerWidget::prepareDetailsWidget()
    705847{
    706848    /* Create details-widget: */
    707     m_pDetailsWidget = new UICloudProfileDetailsWidget(m_enmEmbedding);
     849    m_pDetailsWidget = new UICloudConsoleDetailsWidget(m_enmEmbedding);
    708850    if (m_pDetailsWidget)
    709851    {
     
    717859}
    718860
    719 void UICloudProfileManagerWidget::prepareConnections()
     861void UICloudConsoleManagerWidget::prepareConnections()
    720862{
    721863    /* Action connections: */
    722     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Add), &QAction::triggered,
    723             this, &UICloudProfileManagerWidget::sltAddCloudProfile);
    724     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Import), &QAction::triggered,
    725             this, &UICloudProfileManagerWidget::sltImportCloudProfiles);
    726     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Remove), &QAction::triggered,
    727             this, &UICloudProfileManagerWidget::sltRemoveCloudProfile);
    728     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details), &QAction::toggled,
    729             this, &UICloudProfileManagerWidget::sltToggleCloudProfileDetailsVisibility);
    730     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_TryPage), &QAction::triggered,
    731             this, &UICloudProfileManagerWidget::sltShowCloudProfileTryPage);
    732     connect(m_pActionPool->action(UIActionIndexST_M_Cloud_S_Help), &QAction::triggered,
    733             this, &UICloudProfileManagerWidget::sltShowCloudProfileHelp);
     864    connect(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd), &QAction::triggered,
     865            this, &UICloudConsoleManagerWidget::sltAddCloudConsoleApplication);
     866    connect(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove), &QAction::triggered,
     867            this, &UICloudConsoleManagerWidget::sltRemoveCloudConsoleApplication);
     868    connect(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileAdd), &QAction::triggered,
     869            this, &UICloudConsoleManagerWidget::sltAddCloudConsoleProfile);
     870    connect(m_pActionPool->action(UIActionIndexST_M_CloudConsole_S_ProfileRemove), &QAction::triggered,
     871            this, &UICloudConsoleManagerWidget::sltRemoveCloudConsoleProfile);
     872    connect(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details), &QAction::toggled,
     873            this, &UICloudConsoleManagerWidget::sltToggleCloudConsoleDetailsVisibility);
    734874
    735875    /* Tree-widget connections: */
    736876    connect(m_pTreeWidget, &QITreeWidget::resized,
    737             this, &UICloudProfileManagerWidget::sltPerformTableAdjustment, Qt::QueuedConnection);
     877            this, &UICloudConsoleManagerWidget::sltPerformTableAdjustment, Qt::QueuedConnection);
    738878    connect(m_pTreeWidget->header(), &QHeaderView::sectionResized,
    739             this, &UICloudProfileManagerWidget::sltPerformTableAdjustment, Qt::QueuedConnection);
     879            this, &UICloudConsoleManagerWidget::sltPerformTableAdjustment, Qt::QueuedConnection);
    740880    connect(m_pTreeWidget, &QITreeWidget::currentItemChanged,
    741             this, &UICloudProfileManagerWidget::sltHandleCurrentItemChange);
     881            this, &UICloudConsoleManagerWidget::sltHandleCurrentItemChange);
    742882    connect(m_pTreeWidget, &QITreeWidget::customContextMenuRequested,
    743             this, &UICloudProfileManagerWidget::sltHandleContextMenuRequest);
     883            this, &UICloudConsoleManagerWidget::sltHandleContextMenuRequest);
    744884    connect(m_pTreeWidget, &QITreeWidget::itemDoubleClicked,
    745             m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details), &QAction::setChecked);
     885            m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details), &QAction::setChecked);
    746886    connect(m_pTreeWidget, &QITreeWidget::itemChanged,
    747             this, &UICloudProfileManagerWidget::sltHandleItemChange);
     887            this, &UICloudConsoleManagerWidget::sltHandleItemChange);
    748888
    749889    /* Details-widget connections: */
    750     connect(m_pDetailsWidget, &UICloudProfileDetailsWidget::sigDataChanged,
    751             this, &UICloudProfileManagerWidget::sigCloudProfileDetailsDataChanged);
    752     connect(m_pDetailsWidget, &UICloudProfileDetailsWidget::sigDataChangeRejected,
    753             this, &UICloudProfileManagerWidget::sltResetCloudProfileDetailsChanges);
    754     connect(m_pDetailsWidget, &UICloudProfileDetailsWidget::sigDataChangeAccepted,
    755             this, &UICloudProfileManagerWidget::sltApplyCloudProfileDetailsChanges);
     890    connect(m_pDetailsWidget, &UICloudConsoleDetailsWidget::sigDataChanged,
     891            this, &UICloudConsoleManagerWidget::sigCloudConsoleDetailsDataChanged);
     892    connect(m_pDetailsWidget, &UICloudConsoleDetailsWidget::sigDataChangeRejected,
     893            this, &UICloudConsoleManagerWidget::sltResetCloudConsoleDetailsChanges);
     894    connect(m_pDetailsWidget, &UICloudConsoleDetailsWidget::sigDataChangeAccepted,
     895            this, &UICloudConsoleManagerWidget::sltApplyCloudConsoleDetailsChanges);
    756896
    757897    /* Extra-data connections: */
    758     connect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange,
    759             this, &UICloudProfileManagerWidget::sltLoadCloudStuff);
    760 }
    761 
    762 void UICloudProfileManagerWidget::loadSettings()
     898    connect(gEDataManager, &UIExtraDataManager::sigCloudConsoleManagerDataChange,
     899            this, &UICloudConsoleManagerWidget::sltLoadCloudConsoleStuff);
     900    connect(gEDataManager, &UIExtraDataManager::sigCloudConsoleManagerRestrictionChange,
     901            this, &UICloudConsoleManagerWidget::sltLoadCloudConsoleStuff);
     902}
     903
     904void UICloudConsoleManagerWidget::loadSettings()
    763905{
    764906    /* Details action/widget: */
    765     m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details)->setChecked(gEDataManager->cloudProfileManagerDetailsExpanded());
    766     sltToggleCloudProfileDetailsVisibility(m_pActionPool->action(UIActionIndexST_M_Cloud_T_Details)->isChecked());
    767 }
    768 
    769 void UICloudProfileManagerWidget::loadCloudStuff()
     907    m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details)->setChecked(gEDataManager->cloudConsoleManagerDetailsExpanded());
     908    sltToggleCloudConsoleDetailsVisibility(m_pActionPool->action(UIActionIndexST_M_CloudConsole_T_Details)->isChecked());
     909}
     910
     911void UICloudConsoleManagerWidget::loadCloudConsoleStuff()
    770912{
    771913    /* Clear tree first of all: */
    772914    m_pTreeWidget->clear();
    773915
    774     /* Acquire cloud profile manager restrictions: */
    775     const QStringList restrictions = gEDataManager->cloudProfileManagerRestrictions();
    776 
    777     /* Iterate through existing providers: */
    778     foreach (const CCloudProvider &comCloudProvider, listCloudProviders())
     916    /* Acquire cloud console manager restrictions: */
     917    const QStringList restrictions = gEDataManager->cloudConsoleManagerRestrictions();
     918
     919    /* Iterate through existing console applications: */
     920    foreach (const QString &strApplicationId, gEDataManager->cloudConsoleManagerApplications())
    779921    {
    780922        /* Skip if we have nothing to populate: */
    781         if (comCloudProvider.isNull())
     923        if (strApplicationId.isEmpty())
    782924            continue;
    783925
    784         /* Load provider data: */
    785         UIDataCloudProvider providerData;
    786         loadCloudProvider(comCloudProvider, providerData);
    787         const QString strProviderPath = QString("/%1").arg(providerData.m_strShortName);
    788         providerData.m_fRestricted = restrictions.contains(strProviderPath);
    789         createItemForCloudProvider(providerData, false);
    790 
    791         /* Make sure provider item is properly inserted: */
    792         UIItemCloudProvider *pItem = searchItem(providerData.m_uId);
    793 
    794         /* Iterate through provider's profiles: */
    795         foreach (const CCloudProfile &comCloudProfile, listCloudProfiles(comCloudProvider))
     926        /* Compose extra-data superset: */
     927        const QString strApplicationValue = gEDataManager->cloudConsoleManagerApplication(strApplicationId);
     928        const QString strApplicationSuperset = QString("%1,%2").arg(strApplicationId, strApplicationValue);
     929
     930        /* Load console application data: */
     931        UIDataCloudConsoleApplication applicationData;
     932        loadCloudConsoleApplication(strApplicationSuperset, applicationData);
     933        const QString strApplicationDefinition = QString("/%1").arg(applicationData.m_strId);
     934        applicationData.m_fRestricted = restrictions.contains(strApplicationDefinition);
     935        createItemForCloudConsoleApplication(applicationData, false);
     936
     937        /* Make sure console applications item is properly inserted: */
     938        UIItemCloudConsoleApplication *pItem = searchApplicationItem(applicationData.m_strId);
     939
     940        /* Iterate through applications's profiles: */
     941        foreach (const QString &strProfileId, gEDataManager->cloudConsoleManagerProfiles(strApplicationId))
    796942        {
    797943            /* Skip if we have nothing to populate: */
    798             if (comCloudProfile.isNull())
     944            if (strProfileId.isEmpty())
    799945                continue;
    800946
    801             /* Load profile data: */
    802             UIDataCloudProfile profileData;
    803             loadCloudProfile(comCloudProfile, providerData, profileData);
    804             const QString strProfilePath = QString("/%1/%2").arg(providerData.m_strShortName).arg(profileData.m_strName);
    805             profileData.m_fRestricted = restrictions.contains(strProfilePath);
    806             createItemForCloudProfile(pItem, profileData, false);
    807         }
    808 
    809         /* Expand provider item finally: */
     947            /* Compose extra-data superset: */
     948            const QString strProfileValue = gEDataManager->cloudConsoleManagerProfile(strApplicationId, strProfileId);
     949            const QString strProfileSuperset = QString("%1,%2").arg(strProfileId, strProfileValue);
     950
     951            /* Load console profile data: */
     952            UIDataCloudConsoleProfile profileData;
     953            loadCloudConsoleProfile(strProfileSuperset, applicationData, profileData);
     954            const QString strProfileDefinition = QString("/%1/%2").arg(applicationData.m_strId).arg(profileData.m_strId);
     955            profileData.m_fRestricted = restrictions.contains(strProfileDefinition);
     956            createItemForCloudConsoleProfile(pItem, profileData, false);
     957        }
     958
     959        /* Expand console application item finally: */
    810960        pItem->setExpanded(true);
    811961    }
    812962
    813     /* Choose the 1st item as current initially: */
    814     m_pTreeWidget->setCurrentItem(m_pTreeWidget->topLevelItem(0));
     963    /* Choose previous current-item if possible: */
     964    if (!m_strDefinition.isEmpty())
     965        m_pTreeWidget->setCurrentItem(searchItemByDefinition(m_strDefinition));
     966    /* Choose the 1st item as current if nothing chosen: */
     967    if (!m_pTreeWidget->currentItem())
     968        m_pTreeWidget->setCurrentItem(m_pTreeWidget->childItem(0));
     969    /* Make sure current-item is fetched: */
    815970    sltHandleCurrentItemChange();
    816971}
    817972
    818 void UICloudProfileManagerWidget::loadCloudProvider(const CCloudProvider &comProvider,
    819                                                     UIDataCloudProvider &providerData)
    820 {
    821     /* Gather provider settings: */
    822     if (comProvider.isOk())
    823         providerData.m_uId = comProvider.GetId();
    824     if (comProvider.isOk())
    825         providerData.m_strShortName = comProvider.GetShortName();
    826     if (comProvider.isOk())
    827         providerData.m_strName = comProvider.GetName();
    828     foreach (const QString &strSupportedPropertyName, comProvider.GetSupportedPropertyNames())
    829         providerData.m_propertyDescriptions[strSupportedPropertyName] = comProvider.GetPropertyDescription(strSupportedPropertyName);
    830 
    831     /* Show error message if necessary: */
    832     if (!comProvider.isOk())
    833         msgCenter().cannotAcquireCloudProviderParameter(comProvider, this);
    834 }
    835 
    836 void UICloudProfileManagerWidget::loadCloudProfile(const CCloudProfile &comProfile,
    837                                                    const UIDataCloudProvider &providerData,
    838                                                    UIDataCloudProfile &profileData)
    839 {
    840     /* Gather provider settings: */
    841     profileData.m_strProviderShortName = providerData.m_strShortName;
     973void UICloudConsoleManagerWidget::loadCloudConsoleApplication(const QString &strSuperset,
     974                                                              UIDataCloudConsoleApplication &applicationData)
     975{
     976    /* Parse superset: */
     977    const QStringList values = strSuperset.split(',');
     978
     979    /* Gather application settings: */
     980    applicationData.m_strId = values.value(0);
     981    applicationData.m_strName = values.value(1);
     982    applicationData.m_strPath = values.value(2);
     983}
     984
     985void UICloudConsoleManagerWidget::loadCloudConsoleProfile(const QString &strSuperset,
     986                                                          const UIDataCloudConsoleApplication &applicationData,
     987                                                          UIDataCloudConsoleProfile &profileData)
     988{
     989    /* Gather application settings: */
     990    profileData.m_strApplicationId = applicationData.m_strId;
     991
     992    /* Parse superset: */
     993    const QStringList values = strSuperset.split(',');
    842994
    843995    /* Gather profile settings: */
    844     if (comProfile.isOk())
    845         profileData.m_strName = comProfile.GetName();
    846 
    847     if (comProfile.isOk())
    848     {
    849         /* Acquire properties: */
    850         QVector<QString> keys;
    851         QVector<QString> values;
    852         QVector<QString> descriptions;
    853         values = comProfile.GetProperties(QString(), keys);
    854 
    855         /* Sync sizes: */
    856         values.resize(keys.size());
    857         descriptions.resize(keys.size());
    858 
    859         if (comProfile.isOk())
    860         {
    861             /* Enumerate all the keys: */
    862             for (int i = 0; i < keys.size(); ++i)
    863                 profileData.m_data[keys.at(i)] = qMakePair(values.at(i), providerData.m_propertyDescriptions.value(keys.at(i)));
    864         }
    865     }
    866 
    867     /* Show error message if necessary: */
    868     if (!comProfile.isOk())
    869         msgCenter().cannotAcquireCloudProfileParameter(comProfile, this);
    870 }
    871 
    872 UIItemCloudProvider *UICloudProfileManagerWidget::searchItem(const QUuid &uId) const
     996    profileData.m_strId = values.value(0);
     997    profileData.m_strName = values.value(1);
     998    profileData.m_strArgument = values.value(2);
     999}
     1000
     1001UIItemCloudConsoleApplication *UICloudConsoleManagerWidget::searchApplicationItem(const QString &strApplicationId) const
    8731002{
    8741003    /* Iterate through tree-widget children: */
    8751004    for (int i = 0; i < m_pTreeWidget->childCount(); ++i)
    876         if (m_pTreeWidget->childItem(i)->data(Column_Name, Data_ProviderID).toUuid() == uId)
    877             return qobject_cast<UIItemCloudProvider*>(m_pTreeWidget->childItem(i));
     1005        if (m_pTreeWidget->childItem(i)->data(Column_Name, Data_ItemID).toString() == strApplicationId)
     1006            return qobject_cast<UIItemCloudConsoleApplication*>(m_pTreeWidget->childItem(i));
    8781007    /* Null by default: */
    8791008    return 0;
    8801009}
    8811010
    882 void UICloudProfileManagerWidget::createItemForCloudProvider(const UIDataCloudProvider &providerData,
    883                                                              bool fChooseItem)
    884 {
    885     /* Create new provider item: */
    886     UIItemCloudProvider *pItem = new UIItemCloudProvider;
     1011UIItemCloudConsoleProfile *UICloudConsoleManagerWidget::searchProfileItem(const QString &strApplicationId,
     1012                                                                          const QString &strProfileId) const
     1013{
     1014    /* Search for application item first: */
     1015    UIItemCloudConsoleApplication *pItemApplication = searchApplicationItem(strApplicationId);
     1016    /* Iterate through application children: */
     1017    for (int i = 0; i < pItemApplication->childCount(); ++i)
     1018        if (pItemApplication->childItem(i)->data(Column_Name, Data_ItemID).toString() == strProfileId)
     1019            return qobject_cast<UIItemCloudConsoleProfile*>(pItemApplication->childItem(i));
     1020    /* Null by default: */
     1021    return 0;
     1022}
     1023
     1024QITreeWidgetItem *UICloudConsoleManagerWidget::searchItemByDefinition(const QString &strDefinition) const
     1025{
     1026    /* Parse definition: */
     1027    const QStringList parts = strDefinition.split('/', QString::SkipEmptyParts);
     1028    /* Depending on parts amount: */
     1029    switch (parts.size())
     1030    {
     1031        case 1: return searchApplicationItem(parts.at(0));
     1032        case 2: return searchProfileItem(parts.at(0), parts.at(1));
     1033        default: break;
     1034    }
     1035    /* Null by default: */
     1036    return 0;
     1037}
     1038
     1039void UICloudConsoleManagerWidget::createItemForCloudConsoleApplication(const UIDataCloudConsoleApplication &applicationData,
     1040                                                                       bool fChooseItem)
     1041{
     1042    /* Create new console application item: */
     1043    UIItemCloudConsoleApplication *pItem = new UIItemCloudConsoleApplication;
    8871044    if (pItem)
    8881045    {
    8891046        /* Configure item: */
    890         pItem->UIDataCloudProvider::operator=(providerData);
     1047        pItem->UIDataCloudConsoleApplication::operator=(applicationData);
    8911048        pItem->updateFields();
    8921049        /* Add item to the tree: */
     
    8981055}
    8991056
    900 void UICloudProfileManagerWidget::createItemForCloudProfile(QTreeWidgetItem *pParent,
    901                                                             const UIDataCloudProfile &profileData,
    902                                                             bool fChooseItem)
    903 {
    904     /* Create new profile item: */
    905     UIItemCloudProfile *pItem = new UIItemCloudProfile;
     1057void UICloudConsoleManagerWidget::createItemForCloudConsoleProfile(QTreeWidgetItem *pParent,
     1058                                                                   const UIDataCloudConsoleProfile &profileData,
     1059                                                                   bool fChooseItem)
     1060{
     1061    /* Create new console profile item: */
     1062    UIItemCloudConsoleProfile *pItem = new UIItemCloudConsoleProfile;
    9061063    if (pItem)
    9071064    {
    9081065        /* Configure item: */
    909         pItem->UIDataCloudProfile::operator=(profileData);
     1066        pItem->UIDataCloudConsoleProfile::operator=(profileData);
    9101067        pItem->updateFields();
    9111068        /* Add item to the parent: */
     
    9171074}
    9181075
    919 void UICloudProfileManagerWidget::updateItemForCloudProfile(const UIDataCloudProfile &profileData, bool fChooseItem, UIItemCloudProfile *pItem)
    920 {
    921     /* Update passed item: */
    922     if (pItem)
    923     {
    924         /* Configure item: */
    925         pItem->UIDataCloudProfile::operator=(profileData);
    926         pItem->updateFields();
    927         /* And choose it as current if necessary: */
    928         if (fChooseItem)
    929             m_pTreeWidget->setCurrentItem(pItem);
    930     }
    931 }
    932 
    933 QStringList UICloudProfileManagerWidget::gatherCloudProfileManagerRestrictions(QTreeWidgetItem *pParentItem)
     1076QStringList UICloudConsoleManagerWidget::gatherCloudConsoleManagerRestrictions(QTreeWidgetItem *pParentItem)
    9341077{
    9351078    /* Prepare result: */
     
    9401083    QITreeWidgetItem *pChangedItem = QITreeWidgetItem::toItem(pParentItem);
    9411084    if (   pChangedItem
    942         && pChangedItem->checkState(Column_ListVMs) == Qt::Unchecked)
     1085        && pChangedItem->checkState(Column_ListInMenu) == Qt::Unchecked)
    9431086        result << pChangedItem->data(Column_Name, Data_Definition).toString();
    9441087
    9451088    /* Iterate through children recursively: */
    9461089    for (int i = 0; i < pParentItem->childCount(); ++i)
    947         result << gatherCloudProfileManagerRestrictions(pParentItem->child(i));
     1090        result << gatherCloudConsoleManagerRestrictions(pParentItem->child(i));
    9481091
    9491092    /* Return result: */
     
    9531096
    9541097/*********************************************************************************************************************************
    955 *   Class UICloudProfileManagerFactory implementation.                                                                           *
     1098*   Class UICloudConsoleManagerFactory implementation.                                                                           *
    9561099*********************************************************************************************************************************/
    9571100
    958 UICloudProfileManagerFactory::UICloudProfileManagerFactory(UIActionPool *pActionPool /* = 0 */)
     1101UICloudConsoleManagerFactory::UICloudConsoleManagerFactory(UIActionPool *pActionPool /* = 0 */)
    9591102    : m_pActionPool(pActionPool)
    9601103{
    9611104}
    9621105
    963 void UICloudProfileManagerFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
    964 {
    965     pDialog = new UICloudProfileManager(pCenterWidget, m_pActionPool);
     1106void UICloudConsoleManagerFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
     1107{
     1108    pDialog = new UICloudConsoleManager(pCenterWidget, m_pActionPool);
    9661109}
    9671110
    9681111
    9691112/*********************************************************************************************************************************
    970 *   Class UICloudProfileManager implementation.                                                                                  *
     1113*   Class UICloudConsoleManager implementation.                                                                                  *
    9711114*********************************************************************************************************************************/
    9721115
    973 UICloudProfileManager::UICloudProfileManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
     1116UICloudConsoleManager::UICloudConsoleManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
    9741117    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
    9751118    , m_pActionPool(pActionPool)
     
    9771120}
    9781121
    979 void UICloudProfileManager::sltHandleButtonBoxClick(QAbstractButton *pButton)
     1122void UICloudConsoleManager::sltHandleButtonBoxClick(QAbstractButton *pButton)
    9801123{
    9811124    /* Disable buttons first of all: */
     
    9911134}
    9921135
    993 void UICloudProfileManager::retranslateUi()
     1136void UICloudConsoleManager::retranslateUi()
    9941137{
    9951138    /* Translate window title: */
    996     setWindowTitle(tr("Cloud Profile Manager"));
     1139    setWindowTitle(tr("Cloud Console Manager"));
    9971140
    9981141    /* Translate buttons: */
     
    10001143    button(ButtonType_Apply)->setText(tr("Apply"));
    10011144    button(ButtonType_Close)->setText(tr("Close"));
    1002     button(ButtonType_Reset)->setStatusTip(tr("Reset changes in current cloud profile details"));
    1003     button(ButtonType_Apply)->setStatusTip(tr("Apply changes in current cloud profile details"));
     1145    button(ButtonType_Reset)->setStatusTip(tr("Reset changes in current cloud console details"));
     1146    button(ButtonType_Apply)->setStatusTip(tr("Apply changes in current cloud console details"));
    10041147    button(ButtonType_Close)->setStatusTip(tr("Close dialog without saving"));
    10051148    button(ButtonType_Reset)->setShortcut(QString("Ctrl+Backspace"));
     
    10111154}
    10121155
    1013 void UICloudProfileManager::configure()
     1156void UICloudConsoleManager::configure()
    10141157{
    10151158    /* Apply window icons: */
    1016     setWindowIcon(UIIconPool::iconSetFull(":/cloud_profile_manager_32px.png", ":/cloud_profile_manager_16px.png"));
    1017 }
    1018 
    1019 void UICloudProfileManager::configureCentralWidget()
     1159    setWindowIcon(UIIconPool::iconSetFull(":/cloud_console_manager_32px.png", ":/cloud_console_manager_16px.png")); /// @todo use proper icon
     1160}
     1161
     1162void UICloudConsoleManager::configureCentralWidget()
    10201163{
    10211164    /* Create widget: */
    1022     UICloudProfileManagerWidget *pWidget = new UICloudProfileManagerWidget(EmbedTo_Dialog, m_pActionPool, true, this);
     1165    UICloudConsoleManagerWidget *pWidget = new UICloudConsoleManagerWidget(EmbedTo_Dialog, m_pActionPool, true, this);
    10231166    if (pWidget)
    10241167    {
     
    10291172        setWidgetToolbar(pWidget->toolbar());
    10301173#endif
    1031         connect(pWidget, &UICloudProfileManagerWidget::sigChange,
    1032                 this, &UICloudProfileManager::sigChange);
    1033         connect(this, &UICloudProfileManager::sigDataChangeRejected,
    1034                 pWidget, &UICloudProfileManagerWidget::sltResetCloudProfileDetailsChanges);
    1035         connect(this, &UICloudProfileManager::sigDataChangeAccepted,
    1036                 pWidget, &UICloudProfileManagerWidget::sltApplyCloudProfileDetailsChanges);
     1174        connect(this, &UICloudConsoleManager::sigDataChangeRejected,
     1175                pWidget, &UICloudConsoleManagerWidget::sltResetCloudConsoleDetailsChanges);
     1176        connect(this, &UICloudConsoleManager::sigDataChangeAccepted,
     1177                pWidget, &UICloudConsoleManagerWidget::sltApplyCloudConsoleDetailsChanges);
    10371178
    10381179        /* Add into layout: */
     
    10411182}
    10421183
    1043 void UICloudProfileManager::configureButtonBox()
     1184void UICloudConsoleManager::configureButtonBox()
    10441185{
    10451186    /* Configure button-box: */
    1046     connect(widget(), &UICloudProfileManagerWidget::sigCloudProfileDetailsVisibilityChanged,
     1187    connect(widget(), &UICloudConsoleManagerWidget::sigCloudConsoleDetailsVisibilityChanged,
    10471188            button(ButtonType_Apply), &QPushButton::setVisible);
    1048     connect(widget(), &UICloudProfileManagerWidget::sigCloudProfileDetailsVisibilityChanged,
     1189    connect(widget(), &UICloudConsoleManagerWidget::sigCloudConsoleDetailsVisibilityChanged,
    10491190            button(ButtonType_Reset), &QPushButton::setVisible);
    1050     connect(widget(), &UICloudProfileManagerWidget::sigCloudProfileDetailsDataChanged,
     1191    connect(widget(), &UICloudConsoleManagerWidget::sigCloudConsoleDetailsDataChanged,
    10511192            button(ButtonType_Apply), &QPushButton::setEnabled);
    1052     connect(widget(), &UICloudProfileManagerWidget::sigCloudProfileDetailsDataChanged,
     1193    connect(widget(), &UICloudConsoleManagerWidget::sigCloudConsoleDetailsDataChanged,
    10531194            button(ButtonType_Reset), &QPushButton::setEnabled);
    10541195    connect(buttonBox(), &QIDialogButtonBox::clicked,
    1055             this, &UICloudProfileManager::sltHandleButtonBoxClick);
     1196            this, &UICloudConsoleManager::sltHandleButtonBoxClick);
    10561197    // WORKAROUND:
    10571198    // Since we connected signals later than extra-data loaded
    10581199    // for signals above, we should handle that stuff here again:
    1059     button(ButtonType_Apply)->setVisible(gEDataManager->cloudProfileManagerDetailsExpanded());
    1060     button(ButtonType_Reset)->setVisible(gEDataManager->cloudProfileManagerDetailsExpanded());
    1061 }
    1062 
    1063 void UICloudProfileManager::finalize()
     1200    button(ButtonType_Apply)->setVisible(gEDataManager->cloudConsoleManagerDetailsExpanded());
     1201    button(ButtonType_Reset)->setVisible(gEDataManager->cloudConsoleManagerDetailsExpanded());
     1202}
     1203
     1204void UICloudConsoleManager::finalize()
    10641205{
    10651206    /* Apply language settings: */
     
    10671208}
    10681209
    1069 UICloudProfileManagerWidget *UICloudProfileManager::widget()
    1070 {
    1071     return qobject_cast<UICloudProfileManagerWidget*>(QIManagerDialog::widget());
    1072 }
    1073 
    1074 
    1075 #include "UICloudProfileManager.moc"
     1210UICloudConsoleManagerWidget *UICloudConsoleManager::widget()
     1211{
     1212    return qobject_cast<UICloudConsoleManagerWidget*>(QIManagerDialog::widget());
     1213}
     1214
     1215
     1216#include "UICloudConsoleManager.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.h

    r85388 r85389  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UICloudProfileManager class declaration.
     3 * VBox Qt GUI - UICloudConsoleManager class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileManager_h
    19 #define FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileManager_h
     18#ifndef FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleManager_h
     19#define FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleManager_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3030class QTreeWidgetItem;
    3131class QITreeWidget;
     32class QITreeWidgetItem;
    3233class UIActionPool;
    33 class UICloudProfileDetailsWidget;
    34 class UIItemCloudProfile;
    35 class UIItemCloudProvider;
     34class UICloudConsoleDetailsWidget;
     35class UIItemCloudConsoleApplication;
     36class UIItemCloudConsoleProfile;
    3637class UIToolBar;
    37 struct UIDataCloudProfile;
    38 struct UIDataCloudProvider;
    39 class CCloudProfile;
    40 class CCloudProvider;
    41 
    42 
    43 /** QWidget extension providing GUI with the pane to control cloud profile related functionality. */
    44 class UICloudProfileManagerWidget : public QIWithRetranslateUI<QWidget>
     38struct UIDataCloudConsoleApplication;
     39struct UIDataCloudConsoleProfile;
     40
     41
     42/** QWidget extension providing GUI with the pane to control cloud console related functionality. */
     43class UICloudConsoleManagerWidget : public QIWithRetranslateUI<QWidget>
    4544{
    4645    Q_OBJECT;
     
    4847signals:
    4948
    50     /** Notifies listeners about dialog change. */
    51     void sigChange();
    52 
    53     /** Notifies listeners about cloud profile details-widget @a fVisible. */
    54     void sigCloudProfileDetailsVisibilityChanged(bool fVisible);
    55     /** Notifies listeners about cloud profile details data @a fDiffers. */
    56     void sigCloudProfileDetailsDataChanged(bool fDiffers);
     49    /** Notifies listeners about cloud console details-widget @a fVisible. */
     50    void sigCloudConsoleDetailsVisibilityChanged(bool fVisible);
     51    /** Notifies listeners about cloud console details data @a fDiffers. */
     52    void sigCloudConsoleDetailsDataChanged(bool fDiffers);
    5753
    5854public:
    5955
    60     /** Constructs Cloud Profile Manager widget.
     56    /** Constructs Cloud Console Manager widget.
    6157      * @param  enmEmbedding  Brings the type of widget embedding.
    6258      * @param  pActionPool   Brings the action-pool reference.
    6359      * @param  fShowToolbar  Brings whether we should create/show toolbar. */
    64     UICloudProfileManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
     60    UICloudConsoleManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    6561                                bool fShowToolbar = true, QWidget *pParent = 0);
    6662
     
    8581    /** @name Details-widget stuff.
    8682      * @{ */
    87         /** Handles command to reset cloud profile details changes. */
    88         void sltResetCloudProfileDetailsChanges();
    89         /** Handles command to apply cloud profile details changes. */
    90         void sltApplyCloudProfileDetailsChanges();
     83        /** Handles command to reset cloud console details changes. */
     84        void sltResetCloudConsoleDetailsChanges();
     85        /** Handles command to apply cloud console details changes. */
     86        void sltApplyCloudConsoleDetailsChanges();
    9187    /** @} */
    9288
     
    9591    /** @name Menu/action stuff.
    9692      * @{ */
    97         /** Handles command to add cloud profile. */
    98         void sltAddCloudProfile();
    99         /** Handles command to import cloud profiles. */
    100         void sltImportCloudProfiles();
    101         /** Handles command to remove cloud profile. */
    102         void sltRemoveCloudProfile();
    103         /** Handles command to make cloud profile details @a fVisible. */
    104         void sltToggleCloudProfileDetailsVisibility(bool fVisible);
    105         /** Handles command to show cloud profile try page. */
    106         void sltShowCloudProfileTryPage();
    107         /** Handles command to show cloud profile help. */
    108         void sltShowCloudProfileHelp();
     93        /** Handles command to add cloud console application. */
     94        void sltAddCloudConsoleApplication();
     95        /** Handles command to remove cloud console application. */
     96        void sltRemoveCloudConsoleApplication();
     97        /** Handles command to add cloud console profile. */
     98        void sltAddCloudConsoleProfile();
     99        /** Handles command to remove cloud console profile. */
     100        void sltRemoveCloudConsoleProfile();
     101        /** Handles command to make cloud console details @a fVisible. */
     102        void sltToggleCloudConsoleDetailsVisibility(bool fVisible);
    109103    /** @} */
    110104
    111105    /** @name Tree-widget stuff.
    112106      * @{ */
    113         /** Handles request to load cloud stuff. */
    114         void sltLoadCloudStuff() { loadCloudStuff(); }
     107        /** Handles request to load cloud console stuff. */
     108        void sltLoadCloudConsoleStuff() { loadCloudConsoleStuff(); }
    115109        /** Adjusts tree-widget according content. */
    116110        void sltPerformTableAdjustment();
     
    147141    /** @name Loading stuff.
    148142      * @{ */
    149         /** Loads cloud stuff. */
    150         void loadCloudStuff();
    151         /** Loads cloud @a comProvider data to passed @a providerData container. */
    152         void loadCloudProvider(const CCloudProvider &comProvider,
    153                                UIDataCloudProvider &providerData);
    154         /** Loads cloud @a comProfile data to passed @a profileData container, using @a providerData as hint. */
    155         void loadCloudProfile(const CCloudProfile &comProfile,
    156                               const UIDataCloudProvider &providerData,
    157                               UIDataCloudProfile &profileData);
     143        /** Loads cloud console stuff. */
     144        void loadCloudConsoleStuff();
     145        /** Loads cloud console @a strSuperset data to passed @a applicationData container. */
     146        void loadCloudConsoleApplication(const QString &strSuperset,
     147                                         UIDataCloudConsoleApplication &applicationData);
     148        /** Loads cloud console @a strSuperset data to passed @a profileData container, using @a applicationData as hint. */
     149        void loadCloudConsoleProfile(const QString &strSuperset,
     150                                     const UIDataCloudConsoleApplication &applicationData,
     151                                     UIDataCloudConsoleProfile &profileData);
    158152    /** @} */
    159153
    160154    /** @name Tree-widget stuff.
    161155      * @{ */
    162         /** Seearches a provider item with specified @a uId. */
    163         UIItemCloudProvider *searchItem(const QUuid &uId) const;
     156        /** Searches an application item with specified @a strApplicationId. */
     157        UIItemCloudConsoleApplication *searchApplicationItem(const QString &strApplicationId) const;
     158        /** Searches a profile child of application item with specified @a strApplicationId and @a strProfileId. */
     159        UIItemCloudConsoleProfile *searchProfileItem(const QString &strApplicationId,
     160                                                     const QString &strProfileId) const;
     161        /** Searches an item with specified @a strDefinition. */
     162        QITreeWidgetItem *searchItemByDefinition(const QString &strDefinition) const;
    164163
    165164        /** Creates a new tree-widget item
    166           * on the basis of passed @a providerData, @a fChooseItem if requested. */
    167         void createItemForCloudProvider(const UIDataCloudProvider &providerData, bool fChooseItem);
     165          * on the basis of passed @a applicationData, @a fChooseItem if requested. */
     166        void createItemForCloudConsoleApplication(const UIDataCloudConsoleApplication &applicationData,
     167                                                  bool fChooseItem);
    168168
    169169        /** Creates a new tree-widget item as a child of certain @a pParent,
    170170          * on the basis of passed @a profileData, @a fChooseItem if requested. */
    171         void createItemForCloudProfile(QTreeWidgetItem *pParent, const UIDataCloudProfile &profileData, bool fChooseItem);
    172         /** Updates the passed tree-widget item on the basis of passed @a profileData, @a fChooseItem if requested. */
    173         void updateItemForCloudProfile(const UIDataCloudProfile &profileData, bool fChooseItem, UIItemCloudProfile *pItem);
    174 
    175         /* Gathers a list of Cloud Profile Manager restrictions starting from @a pParentItem. */
    176         QStringList gatherCloudProfileManagerRestrictions(QTreeWidgetItem *pParentItem);
     171        void createItemForCloudConsoleProfile(QTreeWidgetItem *pParent,
     172                                              const UIDataCloudConsoleProfile &profileData,
     173                                              bool fChooseItem);
     174
     175        /* Gathers a list of Cloud Console Manager restrictions starting from @a pParentItem. */
     176        QStringList gatherCloudConsoleManagerRestrictions(QTreeWidgetItem *pParentItem);
    177177    /** @} */
    178178
     
    185185        /** Holds whether we should create/show toolbar. */
    186186        const bool    m_fShowToolbar;
     187        /** Holds current item definition. */
     188        QString       m_strDefinition;
    187189    /** @} */
    188190
     
    198200        QITreeWidget                *m_pTreeWidget;
    199201        /** Holds the details-widget instance. */
    200         UICloudProfileDetailsWidget *m_pDetailsWidget;
     202        UICloudConsoleDetailsWidget *m_pDetailsWidget;
    201203    /** @} */
    202204};
    203205
    204206
    205 /** QIManagerDialogFactory extension used as a factory for Cloud Profile Manager dialog. */
    206 class UICloudProfileManagerFactory : public QIManagerDialogFactory
     207/** QIManagerDialogFactory extension used as a factory for Cloud Console Manager dialog. */
     208class UICloudConsoleManagerFactory : public QIManagerDialogFactory
    207209{
    208210public:
    209211
    210     /** Constructs Cloud Profile Manager factory acquiring additional arguments.
     212    /** Constructs Cloud Console Manager actory acquiring additional arguments.
    211213      * @param  pActionPool  Brings the action-pool reference. */
    212     UICloudProfileManagerFactory(UIActionPool *pActionPool = 0);
     214    UICloudConsoleManagerFactory(UIActionPool *pActionPool = 0);
    213215
    214216protected:
     
    223225
    224226
    225 /** QIManagerDialog extension providing GUI with the dialog to control cloud profile related functionality. */
    226 class UICloudProfileManager : public QIWithRetranslateUI<QIManagerDialog>
     227/** QIManagerDialog extension providing GUI with the dialog to control cloud console related functionality. */
     228class UICloudConsoleManager : public QIWithRetranslateUI<QIManagerDialog>
    227229{
    228230    Q_OBJECT;
     
    245247private:
    246248
    247     /** Constructs Cloud Profile Manager dialog.
     249    /** Constructs Cloud Console Manager dialog.
    248250      * @param  pCenterWidget  Brings the widget reference to center according to.
    249251      * @param  pActionPool    Brings the action-pool reference. */
    250     UICloudProfileManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
     252    UICloudConsoleManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
    251253
    252254    /** @name Event-handling stuff.
     
    271273      * @{ */
    272274        /** Returns the widget. */
    273         virtual UICloudProfileManagerWidget *widget() /* override */;
     275        virtual UICloudConsoleManagerWidget *widget() /* override */;
    274276    /** @} */
    275277
     
    281283
    282284    /** Allow factory access to private/protected members: */
    283     friend class UICloudProfileManagerFactory;
     285    friend class UICloudConsoleManagerFactory;
    284286};
    285287
    286 #endif /* !FEQT_INCLUDED_SRC_cloud_profilemanager_UICloudProfileManager_h */
     288#endif /* !FEQT_INCLUDED_SRC_cloud_consolemanager_UICloudConsoleManager_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r85035 r85389  
    113113const char *UIExtraDataDefs::GUI_CloudProfileManager_Restrictions = "GUI/CloudProfileManager/Restrictions";
    114114const char *UIExtraDataDefs::GUI_CloudProfileManager_Details_Expanded = "GUI/CloudProfileManager/Details/Expanded";
     115
     116/* Cloud Console Manager: */
     117const char *UIExtraDataDefs::GUI_CloudConsoleManager_Application = "GUI/CloudConsoleManager/Application";
     118const char *UIExtraDataDefs::GUI_CloudConsoleManager_Restrictions = "GUI/CloudConsoleManager/Restrictions";
     119const char *UIExtraDataDefs::GUI_CloudConsoleManager_Details_Expanded = "GUI/CloudConsoleManager/Details/Expanded";
    115120
    116121#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r85035 r85389  
    220220        /** Holds whether Cloud Profile Manager details expanded. */
    221221        SHARED_LIBRARY_STUFF extern const char *GUI_CloudProfileManager_Details_Expanded;
     222    /** @} */
     223
     224    /** @name Cloud Console Manager
     225      * @{ */
     226        /** Holds Cloud Console Manager applications/profiles. */
     227        SHARED_LIBRARY_STUFF extern const char *GUI_CloudConsoleManager_Application;
     228        /** Holds Cloud Console Manager restrictions. */
     229        SHARED_LIBRARY_STUFF extern const char *GUI_CloudConsoleManager_Restrictions;
     230        /** Holds whether Cloud Console Manager details expanded. */
     231        SHARED_LIBRARY_STUFF extern const char *GUI_CloudConsoleManager_Details_Expanded;
    222232    /** @} */
    223233
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r85035 r85389  
    578578    /** @name Actions
    579579      * @{ */
    580         /** */
     580        /** Updates action availability. */
    581581        void updateActionsAvailability();
    582582    /** @} */
     
    19311931           << GUI_CloudProfileManager_Restrictions
    19321932           << GUI_CloudProfileManager_Details_Expanded
     1933           << GUI_CloudConsoleManager_Restrictions
     1934           << GUI_CloudConsoleManager_Details_Expanded
    19331935           << GUI_HideDescriptionForWizards
    19341936           << GUI_HideFromManager << GUI_HideDetails
     
    29972999}
    29983000
     3001QStringList UIExtraDataManager::cloudConsoleManagerApplications()
     3002{
     3003    /* Gather a list of keys matching required expression: */
     3004    QStringList result;
     3005    QRegExp re(QString("^%1/([^/]+)$").arg(GUI_CloudConsoleManager_Application));
     3006    foreach (const QString &strKey, m_data.value(GlobalID).keys())
     3007        if (re.indexIn(strKey) != -1)
     3008            result << re.cap(1);
     3009    return result;
     3010}
     3011
     3012QStringList UIExtraDataManager::cloudConsoleManagerProfiles(const QString &strId)
     3013{
     3014    /* Gather a list of keys matching required expression: */
     3015    QStringList result;
     3016    QRegExp re(QString("^%1/%2/([^/]+)$").arg(GUI_CloudConsoleManager_Application, strId));
     3017    foreach (const QString &strKey, m_data.value(GlobalID).keys())
     3018        if (re.indexIn(strKey) != -1)
     3019            result << re.cap(1);
     3020    return result;
     3021}
     3022
     3023QString UIExtraDataManager::cloudConsoleManagerApplication(const QString &strId)
     3024{
     3025    return extraDataString(QString("%1/%2").arg(GUI_CloudConsoleManager_Application, strId));
     3026}
     3027
     3028void UIExtraDataManager::setCloudConsoleManagerApplication(const QString &strId, const QString &strDefinition)
     3029{
     3030    setExtraDataString(QString("%1/%2").arg(GUI_CloudConsoleManager_Application, strId), strDefinition);
     3031}
     3032
     3033QString UIExtraDataManager::cloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId)
     3034{
     3035    return extraDataString(QString("%1/%2/%3").arg(GUI_CloudConsoleManager_Application, strApplicationId, strProfileId));
     3036}
     3037
     3038void UIExtraDataManager::setCloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId, const QString &strDefinition)
     3039{
     3040    setExtraDataString(QString("%1/%2/%3").arg(GUI_CloudConsoleManager_Application, strApplicationId, strProfileId), strDefinition);
     3041}
     3042
     3043QStringList UIExtraDataManager::cloudConsoleManagerRestrictions()
     3044{
     3045    return extraDataStringList(GUI_CloudConsoleManager_Restrictions);
     3046}
     3047
     3048void UIExtraDataManager::setCloudConsoleManagerRestrictions(const QStringList &restrictions)
     3049{
     3050    return setExtraDataStringList(GUI_CloudConsoleManager_Restrictions, restrictions);
     3051}
     3052
     3053bool UIExtraDataManager::cloudConsoleManagerDetailsExpanded()
     3054{
     3055    /* 'False' unless feature allowed: */
     3056    return isFeatureAllowed(GUI_CloudConsoleManager_Details_Expanded);
     3057}
     3058
     3059void UIExtraDataManager::setCloudConsoleManagerDetailsExpanded(bool fExpanded)
     3060{
     3061    /* 'True' if feature allowed, null-string otherwise: */
     3062    return setExtraDataString(GUI_CloudConsoleManager_Details_Expanded, toFeatureAllowed(fExpanded));
     3063}
     3064
    29993065WizardMode UIExtraDataManager::modeForWizardType(WizardType type)
    30003066{
     
    45824648            else if (strKey == GUI_CloudProfileManager_Restrictions)
    45834649                emit sigCloudProfileManagerRestrictionChange();
     4650            /* Cloud Console Manager data changed: */
     4651            else if (strKey.startsWith(QString(GUI_CloudConsoleManager_Application) + '/'))
     4652                emit sigCloudConsoleManagerDataChange();
     4653            /* Cloud Console Manager restrictions changed: */
     4654            else if (strKey == GUI_CloudConsoleManager_Restrictions)
     4655                emit sigCloudConsoleManagerRestrictionChange();
    45844656            /* Details categories: */
    45854657            else if (strKey == GUI_Details_Elements)
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r85035 r85389  
    7878    /** Notifies about Cloud Profile Manager restriction change. */
    7979    void sigCloudProfileManagerRestrictionChange();
     80
     81    /** Notifies about Cloud Console Manager data change. */
     82    void sigCloudConsoleManagerDataChange();
     83    /** Notifies about Cloud Console Manager restriction change. */
     84    void sigCloudConsoleManagerRestrictionChange();
    8085
    8186    /** Notifies about VirtualBox Manager / Details pane categories change. */
     
    417422        /** Defines whether Cloud Profile Manager details @a fExpanded. */
    418423        void setCloudProfileManagerDetailsExpanded(bool fExpanded);
     424    /** @} */
     425
     426    /** @name Cloud Console Manager
     427      * @{ */
     428        /** Returns registered Cloud Console Manager applications. */
     429        QStringList cloudConsoleManagerApplications();
     430        /** Returns registered Cloud Console Manager profiles for application with @a strId. */
     431        QStringList cloudConsoleManagerProfiles(const QString &strId);
     432
     433        /** Returns definition for Cloud Console Manager application with @a strId. */
     434        QString cloudConsoleManagerApplication(const QString &strId);
     435        /** Defines @a strDefinition for Cloud Console Manager application with @a strId. */
     436        void setCloudConsoleManagerApplication(const QString &strId, const QString &strDefinition);
     437
     438        /** Returns definition for Cloud Console Manager profile with @a strProfileId for application with @a strApplicationId. */
     439        QString cloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId);
     440        /** Returns @a strDefinition for Cloud Console Manager profile with @a strProfileId for application with @a strApplicationId. */
     441        void setCloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId, const QString &strDefinition);
     442
     443        /** Returns Cloud Console Manager restrictions. */
     444        QStringList cloudConsoleManagerRestrictions();
     445        /** Defines Cloud Console Manager @a restrictions. */
     446        void setCloudConsoleManagerRestrictions(const QStringList &restrictions);
     447
     448        /** Returns whether Cloud Console Manager details expanded. */
     449        bool cloudConsoleManagerDetailsExpanded();
     450        /** Defines whether Cloud Console Manager details @a fExpanded. */
     451        void setCloudConsoleManagerDetailsExpanded(bool fExpanded);
    419452    /** @} */
    420453
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r85362 r85389  
    29822982    }
    29832983};
     2984
     2985
     2986/** Menu action extension, used as 'Cloud Console' menu class. */
     2987class UIActionMenuSelectorCloudConsole : public UIActionMenu
     2988{
     2989    Q_OBJECT;
     2990
     2991public:
     2992
     2993    /** Constructs action passing @a pParent to the base-class. */
     2994    UIActionMenuSelectorCloudConsole(UIActionPool *pParent)
     2995        : UIActionMenu(pParent)
     2996    {}
     2997
     2998protected:
     2999
     3000    /** Returns shortcut extra-data ID. */
     3001    virtual QString shortcutExtraDataID() const /* override */
     3002    {
     3003        return QString("CloudConsoleMenu");
     3004    }
     3005
     3006    /** Handles translation event. */
     3007    virtual void retranslateUi() /* override */
     3008    {
     3009        setName(QApplication::translate("UIActionPool", "&Console"));
     3010    }
     3011};
     3012
     3013/** Simple action extension, used as 'Perform Console Application Add' action class. */
     3014class UIActionMenuSelectorCloudConsolePerformApplicationAdd : public UIActionSimple
     3015{
     3016    Q_OBJECT;
     3017
     3018public:
     3019
     3020    /** Constructs action passing @a pParent to the base-class. */
     3021    UIActionMenuSelectorCloudConsolePerformApplicationAdd(UIActionPool *pParent)
     3022        : UIActionSimple(pParent,
     3023                         ":/cloud_console_application_add_32px.png",          ":/cloud_console_application_add_16px.png",
     3024                         ":/cloud_console_application_add_disabled_32px.png", ":/cloud_console_application_add_disabled_16px.png") /// @todo use proper icons
     3025    {
     3026        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     3027    }
     3028
     3029protected:
     3030
     3031    /** Returns shortcut extra-data ID. */
     3032    virtual QString shortcutExtraDataID() const /* override */
     3033    {
     3034        return QString("AddCloudConsoleApplication");
     3035    }
     3036
     3037    /** Handles translation event. */
     3038    virtual void retranslateUi() /* override */
     3039    {
     3040        setName(QApplication::translate("UIActionPool", "&Add Application..."));
     3041        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
     3042        setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console application"));
     3043        setToolTip(  QApplication::translate("UIActionPool", "Add Cloud Console Application")
     3044                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     3045    }
     3046};
     3047
     3048/** Simple action extension, used as 'Perform Console Application Remove' action class. */
     3049class UIActionMenuSelectorCloudConsolePerformApplicationRemove : public UIActionSimple
     3050{
     3051    Q_OBJECT;
     3052
     3053public:
     3054
     3055    /** Constructs action passing @a pParent to the base-class. */
     3056    UIActionMenuSelectorCloudConsolePerformApplicationRemove(UIActionPool *pParent)
     3057        : UIActionSimple(pParent,
     3058                         ":/cloud_console_application_remove_32px.png",          ":/cloud_console_application_remove_16px.png",
     3059                         ":/cloud_console_application_remove_disabled_32px.png", ":/cloud_console_application_remove_disabled_16px.png") /// @todo use proper icons
     3060    {
     3061        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     3062    }
     3063
     3064protected:
     3065
     3066    /** Returns shortcut extra-data ID. */
     3067    virtual QString shortcutExtraDataID() const /* override */
     3068    {
     3069        return QString("RemoveCloudConsoleApplication");
     3070    }
     3071
     3072    /** Handles translation event. */
     3073    virtual void retranslateUi() /* override */
     3074    {
     3075        setName(QApplication::translate("UIActionPool", "&Remove Application..."));
     3076        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
     3077        setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console application"));
     3078        setToolTip(  QApplication::translate("UIActionPool", "Remove Cloud Console Application")
     3079                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     3080    }
     3081};
     3082
     3083/** Simple action extension, used as 'Perform Console Profile Add' action class. */
     3084class UIActionMenuSelectorCloudConsolePerformProfileAdd : public UIActionSimple
     3085{
     3086    Q_OBJECT;
     3087
     3088public:
     3089
     3090    /** Constructs action passing @a pParent to the base-class. */
     3091    UIActionMenuSelectorCloudConsolePerformProfileAdd(UIActionPool *pParent)
     3092        : UIActionSimple(pParent,
     3093                         ":/cloud_console_profile_add_32px.png",          ":/cloud_console_profile_add_16px.png",
     3094                         ":/cloud_console_profile_add_disabled_32px.png", ":/cloud_console_profile_add_disabled_16px.png") /// @todo use proper icons
     3095    {
     3096        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     3097    }
     3098
     3099protected:
     3100
     3101    /** Returns shortcut extra-data ID. */
     3102    virtual QString shortcutExtraDataID() const /* override */
     3103    {
     3104        return QString("AddCloudConsoleProfile");
     3105    }
     3106
     3107    /** Handles translation event. */
     3108    virtual void retranslateUi() /* override */
     3109    {
     3110        setName(QApplication::translate("UIActionPool", "&Add Profile..."));
     3111        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
     3112        setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console profile"));
     3113        setToolTip(  QApplication::translate("UIActionPool", "Add Cloud Console Profile")
     3114                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     3115    }
     3116};
     3117
     3118/** Simple action extension, used as 'Perform Console Profile Remove' action class. */
     3119class UIActionMenuSelectorCloudConsolePerformProfileRemove : public UIActionSimple
     3120{
     3121    Q_OBJECT;
     3122
     3123public:
     3124
     3125    /** Constructs action passing @a pParent to the base-class. */
     3126    UIActionMenuSelectorCloudConsolePerformProfileRemove(UIActionPool *pParent)
     3127        : UIActionSimple(pParent,
     3128                         ":/cloud_console_profile_remove_32px.png",          ":/cloud_console_profile_remove_16px.png",
     3129                         ":/cloud_console_profile_remove_disabled_32px.png", ":/cloud_console_profile_remove_disabled_16px.png") /// @todo use proper icons
     3130    {
     3131        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     3132    }
     3133
     3134protected:
     3135
     3136    /** Returns shortcut extra-data ID. */
     3137    virtual QString shortcutExtraDataID() const /* override */
     3138    {
     3139        return QString("RemoveCloudConsoleProfile");
     3140    }
     3141
     3142    /** Handles translation event. */
     3143    virtual void retranslateUi() /* override */
     3144    {
     3145        setName(QApplication::translate("UIActionPool", "&Remove Profile..."));
     3146        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
     3147        setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console profile"));
     3148        setToolTip(  QApplication::translate("UIActionPool", "Remove Cloud Console Profile")
     3149                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     3150    }
     3151};
     3152
     3153/** Toggle action extension, used as 'Toggle Cloud Console Properties' action class. */
     3154class UIActionMenuSelectorCloudConsoleToggleProperties : public UIActionToggle
     3155{
     3156    Q_OBJECT;
     3157
     3158public:
     3159
     3160    /** Constructs action passing @a pParent to the base-class. */
     3161    UIActionMenuSelectorCloudConsoleToggleProperties(UIActionPool *pParent)
     3162        : UIActionToggle(pParent)
     3163    {
     3164        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     3165        setIcon(UIIconPool::iconSetFull(":/cloud_console_edit_32px.png",          ":/cloud_console_edit_16px.png",
     3166                                        ":/cloud_console_edit_disabled_32px.png", ":/cloud_console_edit_disabled_16px.png")); /// @todo use proper icons with check-boxes
     3167    }
     3168
     3169protected:
     3170
     3171    /** Returns shortcut extra-data ID. */
     3172    virtual QString shortcutExtraDataID() const /* override */
     3173    {
     3174        return QString("ToggleCloudConsoleProperties");
     3175    }
     3176
     3177    /** Returns default shortcut. */
     3178    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     3179    {
     3180        return QKeySequence("Ctrl+Shift+P");
     3181    }
     3182
     3183    /** Handles translation event. */
     3184    virtual void retranslateUi() /* override */
     3185    {
     3186        setIconText(QApplication::translate("UIActionPool", "Properties"));
     3187        setName(QApplication::translate("UIActionPool", "Console &Properties"));
     3188        setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
     3189        setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud console properties"));
     3190        setToolTip(  QApplication::translate("UIActionPool", "Open Cloud Console Properties")
     3191                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     3192    }
     3193};
     3194
    29843195
    29853196/** Menu action extension, used as 'Resources' menu class. */
     
    31833394    m_pool[UIActionIndexST_M_Cloud_S_Help] = new UIActionMenuSelectorCloudShowHelp(this);
    31843395
     3396    /* Cloud Console Manager actions: */
     3397    m_pool[UIActionIndexST_M_CloudConsoleWindow] = new UIActionMenuSelectorCloudConsole(this);
     3398    m_pool[UIActionIndexST_M_CloudConsole] = new UIActionMenuSelectorCloudConsole(this);
     3399    m_pool[UIActionIndexST_M_CloudConsole_S_ApplicationAdd] = new UIActionMenuSelectorCloudConsolePerformApplicationAdd(this);
     3400    m_pool[UIActionIndexST_M_CloudConsole_S_ApplicationRemove] = new UIActionMenuSelectorCloudConsolePerformApplicationRemove(this);
     3401    m_pool[UIActionIndexST_M_CloudConsole_S_ProfileAdd] = new UIActionMenuSelectorCloudConsolePerformProfileAdd(this);
     3402    m_pool[UIActionIndexST_M_CloudConsole_S_ProfileRemove] = new UIActionMenuSelectorCloudConsolePerformProfileRemove(this);
     3403    m_pool[UIActionIndexST_M_CloudConsole_T_Details] = new UIActionMenuSelectorCloudConsoleToggleProperties(this);
     3404
    31853405    /* VM resource Monitor actions: */
    31863406    m_pool[UIActionIndexST_M_VMResourceMonitor] = new UIActionMenuVMResourceMonitor(this);
     
    32203440    m_menuUpdateHandlers[UIActionIndexST_M_CloudWindow].ptfm =           &UIActionPoolManager::updateMenuCloudWindow;
    32213441    m_menuUpdateHandlers[UIActionIndexST_M_Cloud].ptfm =                 &UIActionPoolManager::updateMenuCloud;
     3442    m_menuUpdateHandlers[UIActionIndexST_M_CloudConsoleWindow].ptfm =    &UIActionPoolManager::updateMenuCloudConsoleWindow;
     3443    m_menuUpdateHandlers[UIActionIndexST_M_CloudConsole].ptfm =          &UIActionPoolManager::updateMenuCloudConsole;
    32223444    m_menuUpdateHandlers[UIActionIndexST_M_VMResourceMonitor].ptfm =     &UIActionPoolManager::updateMenuVMResourceMonitor;
    32233445    m_menuUpdateHandlers[UIActionIndexST_M_Snapshot].ptfm =              &UIActionPoolManager::updateMenuSnapshot;
     
    37683990    /* 'Help' action: */
    37693991    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Cloud_S_Help)) || fSeparator;
     3992}
     3993
     3994void UIActionPoolManager::updateMenuCloudConsoleWindow()
     3995{
     3996    /* Update corresponding menu: */
     3997    updateMenuCloudConsoleWrapper(action(UIActionIndexST_M_CloudConsoleWindow)->menu());
     3998
     3999    /* Mark menu as valid: */
     4000    m_invalidations.remove(UIActionIndexST_M_CloudConsoleWindow);
     4001}
     4002
     4003void UIActionPoolManager::updateMenuCloudConsole()
     4004{
     4005    /* Update corresponding menu: */
     4006    updateMenuCloudConsoleWrapper(action(UIActionIndexST_M_CloudConsole)->menu());
     4007
     4008    /* Mark menu as valid: */
     4009    m_invalidations.remove(UIActionIndexST_M_CloudConsole);
     4010}
     4011
     4012void UIActionPoolManager::updateMenuCloudConsoleWrapper(UIMenu *pMenu)
     4013{
     4014    /* Clear contents: */
     4015    pMenu->clear();
     4016
     4017    /* Separator? */
     4018    bool fSeparator = false;
     4019
     4020    /* 'Add Application' action: */
     4021    fSeparator = addAction(pMenu, action(UIActionIndexST_M_CloudConsole_S_ApplicationAdd)) || fSeparator;
     4022    /* 'Remove Application' action: */
     4023    fSeparator = addAction(pMenu, action(UIActionIndexST_M_CloudConsole_S_ApplicationRemove)) || fSeparator;
     4024
     4025    /* Separator? */
     4026    if (fSeparator)
     4027    {
     4028        pMenu->addSeparator();
     4029        fSeparator = false;
     4030    }
     4031
     4032    /* 'Add Profile' action: */
     4033    fSeparator = addAction(pMenu, action(UIActionIndexST_M_CloudConsole_S_ProfileAdd)) || fSeparator;
     4034    /* 'Remove Profile' action: */
     4035    fSeparator = addAction(pMenu, action(UIActionIndexST_M_CloudConsole_S_ProfileRemove)) || fSeparator;
     4036
     4037    /* Separator? */
     4038    if (fSeparator)
     4039    {
     4040        pMenu->addSeparator();
     4041        fSeparator = false;
     4042    }
     4043
     4044    /* 'Properties' action: */
     4045    fSeparator = addAction(pMenu, action(UIActionIndexST_M_CloudConsole_T_Details)) || fSeparator;
    37704046}
    37714047
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r85192 r85389  
    174174    UIActionIndexST_M_Cloud_S_Help,
    175175
     176    /* Cloud Console Manager actions: */
     177    UIActionIndexST_M_CloudConsoleWindow,
     178    UIActionIndexST_M_CloudConsole,
     179    UIActionIndexST_M_CloudConsole_S_ApplicationAdd,
     180    UIActionIndexST_M_CloudConsole_S_ApplicationRemove,
     181    UIActionIndexST_M_CloudConsole_S_ProfileAdd,
     182    UIActionIndexST_M_CloudConsole_S_ProfileRemove,
     183    UIActionIndexST_M_CloudConsole_T_Details,
     184
    176185    /* VM resource Monitor actions: */
    177186    UIActionIndexST_M_VMResourceMonitor,
     
    256265    void updateMenuCloudWrapper(UIMenu *pMenu);
    257266
     267    /** Updates 'Cloud Console' window menu. */
     268    void updateMenuCloudConsoleWindow();
     269    /** Updates 'Cloud Console' menu. */
     270    void updateMenuCloudConsole();
     271    /** Updates 'Cloud Console' @a pMenu. */
     272    void updateMenuCloudConsoleWrapper(UIMenu *pMenu);
     273
    258274   /** Updates 'VM Resource Monitor' menu. */
    259275    void updateMenuVMResourceMonitor();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r85111 r85389  
    20222022}
    20232023
     2024bool UIMessageCenter::confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
     2025{
     2026    return questionBinary(pParent, MessageType_Question,
     2027                          tr("<p>Do you want to remove the cloud console application <nobr><b>%1</b>?</nobr></p>")
     2028                             .arg(strName),
     2029                          0 /* auto-confirm id */,
     2030                          tr("Remove") /* ok button text */,
     2031                          QString() /* cancel button text */,
     2032                          false /* ok button by default? */);
     2033}
     2034
     2035bool UIMessageCenter::confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
     2036{
     2037    return questionBinary(pParent, MessageType_Question,
     2038                          tr("<p>Do you want to remove the cloud console profile <nobr><b>%1</b>?</nobr></p>")
     2039                             .arg(strName),
     2040                          0 /* auto-confirm id */,
     2041                          tr("Remove") /* ok button text */,
     2042                          QString() /* cancel button text */,
     2043                          false /* ok button by default? */);
     2044}
     2045
    20242046bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /* = 0*/) const
    20252047{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r85111 r85389  
    417417    void cannotAssignFormValue(const CProgress &comProgress, QWidget *pParent = 0) const;
    418418
     419    /* API: Cloud Console Manager warnings: */
     420    bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const;
     421    bool confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
     422
    419423    /* API: Wizards warnings: */
    420424    bool confirmHardDisklessMachine(QWidget *pParent = 0) const;
Note: See TracChangeset for help on using the changeset viewer.

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