VirtualBox

Changeset 92352 in vbox


Ignore:
Timestamp:
Nov 11, 2021 10:18:36 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148203
Message:

FE/Qt: bugref:10141. More layout fixes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r90967 r92352  
    17381738        setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
    17391739        setStatusTip(QApplication::translate("UIActionPool", "Open panel with file manager session"));
    1740         setToolTip(  QApplication::translate("UIActionPool", "Open Session Pane")
     1740        setToolTip(  QApplication::translate("UIActionPool", "Open Session Panel")
    17411741                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
    17421742    }
     
    21992199        setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)"));
    22002200        setToolTip(  QApplication::translate("UIActionPool", "Show Properties of Current Object(s)")
     2201                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     2202    }
     2203};
     2204
     2205/** Menu action extension, used as 'VISO Creator' menu class. */
     2206class UIActionMenuVISOCreator : public UIActionMenu
     2207{
     2208    Q_OBJECT;
     2209
     2210public:
     2211
     2212    /** Constructs action passing @a pParent to the base-class. */
     2213    UIActionMenuVISOCreator(UIActionPool *pParent)
     2214        : UIActionMenu(pParent)
     2215    {}
     2216
     2217protected:
     2218
     2219    /** Returns shortcut extra-data ID. */
     2220    virtual QString shortcutExtraDataID() const /* override */
     2221    {
     2222        return QString("VISOCreatorMenu");
     2223    }
     2224
     2225    /** Handles translation event. */
     2226    virtual void retranslateUi() /* override */
     2227    {
     2228        setName(QApplication::translate("UIActionPool", "VISO Creator"));
     2229    }
     2230};
     2231
     2232/** Toggle action extension, used to toggle 'VISO Creator configuration' panel in file manager. */
     2233class UIActionMenuVISOCreatorToggleConfigPanel : public UIActionToggle
     2234{
     2235    Q_OBJECT;
     2236
     2237public:
     2238
     2239    /** Constructs action passing @a pParent to the base-class. */
     2240    UIActionMenuVISOCreatorToggleConfigPanel(UIActionPool *pParent)
     2241        : UIActionToggle(pParent)
     2242    {
     2243        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     2244        setIcon(UIIconPool::iconSetFull(":/file_manager_session_32px.png",          ":/file_manager_session_16px.png",
     2245                                        ":/file_manager_session_disabled_32px.png", ":/file_manager_session_disabled_16px.png"));
     2246    }
     2247
     2248protected:
     2249
     2250    /** Returns shortcut extra-data ID. */
     2251    virtual QString shortcutExtraDataID() const /* override */
     2252    {
     2253        return QString("ToggleVISOCreatorConfigurationPanel");
     2254    }
     2255
     2256    /** Returns default shortcut. */
     2257    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2258    {
     2259        return QKeySequence();
     2260    }
     2261
     2262    /** Handles translation event. */
     2263    virtual void retranslateUi() /* override */
     2264    {
     2265        setName(QApplication::translate("UIActionPool", "Configuration"));
     2266        setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
     2267        setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator configuration"));
     2268        setToolTip(  QApplication::translate("UIActionPool", "Open Configuration Panel")
     2269                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     2270    }
     2271};
     2272
     2273/** Toggle action extension, used to toggle 'VISO Creator options' panel in file manager. */
     2274class UIActionMenuVISOCreatorToggleOptionsPanel : public UIActionToggle
     2275{
     2276    Q_OBJECT;
     2277
     2278public:
     2279
     2280    /** Constructs action passing @a pParent to the base-class. */
     2281    UIActionMenuVISOCreatorToggleOptionsPanel(UIActionPool *pParent)
     2282        : UIActionToggle(pParent)
     2283    {
     2284        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     2285        setIcon(UIIconPool::iconSetFull(":/file_manager_session_32px.png",          ":/file_manager_session_16px.png",
     2286                                        ":/file_manager_session_disabled_32px.png", ":/file_manager_session_disabled_16px.png"));
     2287    }
     2288
     2289protected:
     2290
     2291    /** Returns shortcut extra-data ID. */
     2292    virtual QString shortcutExtraDataID() const /* override */
     2293    {
     2294        return QString("ToggleVISOCreatorOptionsurationPanel");
     2295    }
     2296
     2297    /** Returns default shortcut. */
     2298    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2299    {
     2300        return QKeySequence();
     2301    }
     2302
     2303    /** Handles translation event. */
     2304    virtual void retranslateUi() /* override */
     2305    {
     2306        setName(QApplication::translate("UIActionPool", "Configuration"));
     2307        setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
     2308        setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator options"));
     2309        setToolTip(  QApplication::translate("UIActionPool", "Open Options Panel")
    22012310                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
    22022311    }
     
    25822691    m_pool[UIActionIndex_M_FileManager_S_Guest_ShowProperties] = new UIActionMenuFileManagerShowProperties(this);
    25832692
     2693    /* Create VISO Creator actions: */
     2694    m_pool[UIActionIndex_M_VISOCreator] = new UIActionMenuVISOCreator(this);
     2695    m_pool[UIActionIndex_M_VISOCreator_ToggleConfigPanel] = new UIActionMenuVISOCreatorToggleConfigPanel(this);
     2696    m_pool[UIActionIndex_M_VISOCreator_ToggleOptionsPanel] = new UIActionMenuVISOCreatorToggleOptionsPanel(this);
     2697
    25842698    /* Prepare update-handlers for known menus: */
    25852699#ifdef VBOX_WS_MAC
     
    29593073    fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Refresh)) || fSeparator;
    29603074    fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Reload)) || fSeparator;
    2961 
    29623075}
    29633076
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r90490 r92352  
    138138    UIActionIndex_M_FileManager_S_Guest_ShowProperties,
    139139
     140    /* VISO Creator actions: */
     141    UIActionIndex_M_VISOCreator,
     142    UIActionIndex_M_VISOCreator_ToggleConfigPanel,
     143    UIActionIndex_M_VISOCreator_ToggleOptionsPanel,
     144
    140145    /* Maximum index: */
    141146    UIActionIndex_Max
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r92270 r92352  
    17521752
    17531753    QWidget *pDialogParent = windowManager().realParentWindow(pParent);
    1754     UIVisoCreatorDialog *pVisoCreator = new UIVisoCreatorDialog(pDialogParent, strMachineName);
     1754    UIVisoCreatorDialog *pVisoCreator = 0;//new UIVisoCreatorDialog(pDialogParent, strMachineName);
    17551755
    17561756    if (!pVisoCreator)
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r92291 r92352  
    2323
    2424/* GUI includes: */
     25#include "UIActionPool.h"
    2526#include "QIDialogButtonBox.h"
    2627#include "UIDesktopWidgetWatchdog.h"
     
    4445*********************************************************************************************************************************/
    4546
    46 UIVisoCreatorWidget::UIVisoCreatorWidget(QWidget *pParent /* =0 */, const QString& strMachineName /* = QString() */)
     47UIVisoCreatorWidget::UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */)
    4748    : QIWithRetranslateUI<QWidget>(pParent)
    4849    , m_pActionConfiguration(0)
     
    6263    , m_pCreatorOptionsPanel(0)
    6364    , m_pConfigurationPanel(0)
     65    , m_pActionPool(pActionPool)
    6466{
    6567    m_visoOptions.m_strVisoName = !strMachineName.isEmpty() ? strMachineName : "ad-hoc";
     
    552554*   UIVisoCreatorDialog implementation.                                                                                          *
    553555*********************************************************************************************************************************/
    554 UIVisoCreatorDialog::UIVisoCreatorDialog(QWidget *pParent /* = 0 */, const QString& strMachineName /* = QString() */)
     556UIVisoCreatorDialog::UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */)
    555557    : QIWithRetranslateUI<QIMainDialog>(pParent)
    556558    , m_strMachineName(strMachineName)
    557559    , m_pVisoCreatorWidget(0)
    558560    , m_pButtonBox(0)
     561    , m_pActionPool(pActionPool)
    559562{
    560563    prepareWidgets();
     
    604607
    605608
    606     m_pVisoCreatorWidget = new UIVisoCreatorWidget(this, m_strMachineName);
     609    m_pVisoCreatorWidget = new UIVisoCreatorWidget(m_pActionPool, this, m_strMachineName);
    607610    if (m_pVisoCreatorWidget)
    608611    {
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r92289 r92352  
    2929#include "QIWithRetranslateUI.h"
    3030
     31
    3132/* Forward declarations: */
    3233class QMenu;
     
    3536class UIDialogPanel;
    3637class QIToolBar;
     38class UIActionPool;
    3739class UIVisoHostBrowser;
    3840class UIVisoContentBrowser;
     
    4951public:
    5052
    51     UIVisoCreatorWidget(QWidget *pParent = 0, const QString& strMachineName = QString());
     53    UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName = QString());
    5254    /** Returns the content of the .viso file. Each element of the list corresponds to a line in the .viso file. */
    5355    QStringList       entryList() const;
     
    6668protected:
    6769
    68     virtual void retranslateUi() /* override */;
     70    virtual void retranslateUi() final override;
    6971
    7072private slots:
     
    149151    QMap<UIDialogPanel*, QAction*> m_panelActionMap;
    150152    QList<UIDialogPanel*>          m_visiblePanelsList;
     153    QPointer<UIActionPool> m_pActionPool;
    151154};
    152155
     
    158161public:
    159162
    160     UIVisoCreatorDialog(QWidget *pParent = 0, const QString& strMachineName = QString());
     163    UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName = QString());
    161164
    162165    QStringList  entryList() const;
     
    174177    UIVisoCreatorWidget *m_pVisoCreatorWidget;
    175178    QIDialogButtonBox    *m_pButtonBox;
     179    QPointer<UIActionPool> m_pActionPool;
    176180};
    177181#endif /* !FEQT_INCLUDED_SRC_medium_viso_UIVisoCreator_h */
Note: See TracChangeset for help on using the changeset viewer.

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