VirtualBox

Ignore:
Timestamp:
Aug 3, 2017 12:42:45 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: Selector UI: Update welcome screen (desktop-pane) for the case when no machine exists.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
7 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc

    r68235 r68285  
    300300        <file alias="web_camera_unavailable_16px.png">images/web_camera_unavailable_16px.png</file>
    301301        <file alias="web_camera_unavailable_disabled_16px.png">images/web_camera_unavailable_disabled_16px.png</file>
    302         <file alias="welcome.png">images/welcome.png</file>
     302        <file alias="welcome_200px.png">images/welcome_200px.png</file>
    303303    </qresource>
    304304</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox2_hidpi.qrc

    r68235 r68285  
    294294        <file alias="web_camera_unavailable_16px_hidpi.png">images/hidpi/web_camera_unavailable_16px_hidpi.png</file>
    295295        <file alias="web_camera_unavailable_disabled_16px_hidpi.png">images/hidpi/web_camera_unavailable_disabled_16px_hidpi.png</file>
     296        <file alias="welcome_200px_hidpi.png">images/hidpi/welcome_200px_hidpi.png</file>
    296297    </qresource>
    297298</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r68282 r68285  
    272272    updateActionsAppearance();
    273273
     274    /* Update Tools-pane: */
     275    m_pPaneToolsMachine->setCurrentItem(pItem);
     276
    274277    /* If current item exists & accessible: */
    275278    if (pItem && pItem->accessible())
     
    306309            /* The VM is inaccessible: */
    307310            m_pPaneToolsMachine->setDetailsError(UIMessageCenter::formatErrorInfo(pItem->accessError()));
    308         }
    309         else
    310         {
    311             /* Default HTML support in Qt is terrible so just try to get something really simple: */
    312             m_pPaneToolsMachine->setDetailsText(
    313                 tr("<h3>Welcome to VirtualBox!</h3>"
    314                    "<p>The left part of this window is  "
    315                    "a list of all virtual machines on your computer. "
    316                    "The list is empty now because you haven't created any virtual "
    317                    "machines yet."
    318                    "<img src=:/welcome.png align=right/></p>"
    319                    "<p>In order to create a new virtual machine, press the "
    320                    "<b>New</b> button in the main tool bar located "
    321                    "at the top of the window.</p>"
    322                    "<p>You can press the <b>%1</b> key to get instant help, "
    323                    "or visit "
    324                    "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
    325                    "for the latest information and news.</p>")
    326                    .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
    327311        }
    328312
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp

    r68281 r68285  
    165165        delete pWidget;
    166166    }
    167 }
    168 
    169 void UIToolsPaneGlobal::setDetailsText(const QString &strText)
    170 {
    171     /* Update desktop pane: */
    172     AssertPtrReturnVoid(m_pPaneDesktop);
    173     m_pPaneDesktop->setToolsPaneText(strText);
    174167}
    175168
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.h

    r68235 r68285  
    7171    void closeTool(ToolTypeGlobal enmType);
    7272
    73     /** Defines @a strText and switches to text details pane. */
    74     void setDetailsText(const QString &strText);
    7573    /** Defines @a strError and switches to error details pane. */
    7674    void setDetailsError(const QString &strError);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp

    r68281 r68285  
    3131# include "UISnapshotPane.h"
    3232# include "UIToolsPaneMachine.h"
     33# include "UIVMItem.h"
    3334
    3435/* Other VBox includes: */
     
    4142    : QIWithRetranslateUI<QWidget>(pParent)
    4243    , m_pActionPool(pActionPool)
     44    , m_pItem(0)
    4345    , m_pLayout(0)
    4446    , m_pPaneDesktop(0)
     
    171173}
    172174
    173 void UIToolsPaneMachine::setDetailsText(const QString &strText)
    174 {
    175     /* Update desktop pane: */
    176     AssertPtrReturnVoid(m_pPaneDesktop);
    177     m_pPaneDesktop->setToolsPaneText(strText);
    178 }
    179 
    180175void UIToolsPaneMachine::setDetailsError(const QString &strError)
    181176{
     
    185180}
    186181
     182void UIToolsPaneMachine::setCurrentItem(UIVMItem *pItem)
     183{
     184    /* Do we need translation after that? */
     185    const bool fTranslationRequired =  !pItem && m_pItem
     186                                    || pItem && !m_pItem;
     187
     188    /* Remember new item: */
     189    m_pItem = pItem;
     190
     191    /* Retranslate if necessary: */
     192    if (fTranslationRequired)
     193        retranslateUi();
     194}
     195
    187196void UIToolsPaneMachine::setItems(const QList<UIVMItem*> &items)
    188197{
     
    202211{
    203212    /* Translate Machine Tools welcome screen: */
    204     m_pPaneDesktop->setToolsPaneIcon(UIIconPool::iconSet(":/tools_200px.png"));
    205     m_pPaneDesktop->setToolsPaneText(
    206         tr("<h3>Welcome to VirtualBox!</h3>"
    207            "<p>The left part of this window is a list of all virtual "
    208            "machines and virtual machine groups on your computer.</p>"
    209            "<p>The right part of this window represents a set of "
    210            "tools which are currently opened (or can be opened) for "
    211            "the currently chosen machine. For list of currently "
    212            "available tools check the corresponding menu at the right "
    213            "side of the main tool bar located at the top of the window. "
    214            "This list will be extended with new tools in the future releases.</p>"
    215            "<p>You can press the <b>%1</b> key to get instant help, or visit "
    216            "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
    217            "for the latest information and news.</p>")
    218            .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
     213    if (!m_pItem || !m_pItem->accessible())
     214    {
     215        m_pPaneDesktop->setToolsPaneIcon(UIIconPool::iconSet(":/welcome_200px.png"));
     216        m_pPaneDesktop->setToolsPaneText(
     217            tr("<h3>Welcome to VirtualBox!</h3>"
     218               "<p>The left part of this window is a list of all virtual "
     219               "machines and virtual machine groups on your computer. "
     220               "The list is empty now because you haven't created any "
     221               "virtual machines yet.</p>"
     222               "<p>In order to create a new virtual machine, press the "
     223               "<b>New</b> button in the main tool bar located at the "
     224               "top of the window.</p>"
     225               "<p>You can press the <b>%1</b> key to get instant help, or visit "
     226               "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
     227               "for the latest information and news.</p>")
     228               .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
     229    }
     230    else
     231    {
     232        m_pPaneDesktop->setToolsPaneIcon(UIIconPool::iconSet(":/tools_200px.png"));
     233        m_pPaneDesktop->setToolsPaneText(
     234            tr("<h3>Welcome to VirtualBox!</h3>"
     235               "<p>The left part of this window is a list of all virtual "
     236               "machines and virtual machine groups on your computer.</p>"
     237               "<p>The right part of this window represents a set of "
     238               "tools which are currently opened (or can be opened) for "
     239               "the currently chosen machine. For list of currently "
     240               "available tools check the corresponding menu at the right "
     241               "side of the main tool bar located at the top of the window. "
     242               "This list will be extended with new tools in the future releases.</p>"
     243               "<p>You can press the <b>%1</b> key to get instant help, or visit "
     244               "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
     245               "for the latest information and news.</p>")
     246               .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
     247    }
    219248
    220249    /* Wipe out the tool descriptions: */
     
    222251
    223252    /* Add tool descriptions: */
    224     QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_Details);
    225     m_pPaneDesktop->addToolDescription(pAction1,
    226                                        tr("Tool to observe virtual machine (VM) details. "
    227                                           "Reflects groups of <u>properties</u> for the currently chosen VM and allows "
    228                                           "for basic manipulations on few of them (like the machine storage devices)."));
    229     QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_Snapshots);
    230     m_pPaneDesktop->addToolDescription(pAction2,
    231                                        tr("Tool to control virtual machine (VM) snapshots. "
    232                                           "Reflects <u>snapshots</u> created for the currently chosen VM and allows "
    233                                           "for snapshot manipulations like possibility to <u>create</u>, <u>remove</u>, "
    234                                           "<u>restore</u> (make current) and observe their properties. Allows to "
    235                                           "<u>edit</u> snapshot attributes like <u>name</u> and <u>description</u>."));
     253    if (m_pItem && m_pItem->accessible())
     254    {
     255        QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_Details);
     256        m_pPaneDesktop->addToolDescription(pAction1,
     257                                           tr("Tool to observe virtual machine (VM) details. "
     258                                              "Reflects groups of <u>properties</u> for the currently chosen VM and allows "
     259                                              "for basic manipulations on few of them (like the machine storage devices)."));
     260        QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_Snapshots);
     261        m_pPaneDesktop->addToolDescription(pAction2,
     262                                           tr("Tool to control virtual machine (VM) snapshots. "
     263                                              "Reflects <u>snapshots</u> created for the currently chosen VM and allows "
     264                                              "for snapshot manipulations like possibility to <u>create</u>, <u>remove</u>, "
     265                                              "<u>restore</u> (make current) and observe their properties. Allows to "
     266                                              "<u>edit</u> snapshot attributes like <u>name</u> and <u>description</u>."));
     267    }
    236268}
    237269
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.h

    r68235 r68285  
    8282    void closeTool(ToolTypeMachine enmType);
    8383
    84     /** Defines @a strText and switches to text details pane. */
    85     void setDetailsText(const QString &strText);
    8684    /** Defines @a strError and switches to error details pane. */
    8785    void setDetailsError(const QString &strError);
     86
     87    /** Defines current machine @a pItem. */
     88    void setCurrentItem(UIVMItem *pItem);
    8889
    8990    /** Defines the machine @a items. */
     
    110111    UIActionPool *m_pActionPool;
    111112
     113    /** Holds current machine item reference. */
     114    UIVMItem *m_pItem;
     115
    112116    /** Holds the stacked-layout instance. */
    113117    QStackedLayout *m_pLayout;
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