UIMediumManager.h revision 85e53e311e4a1f30cc4bb620495389d43755a33b
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync/** @file
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * VBox Qt GUI - UIMediumManager class declaration.
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync/*
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * Copyright (C) 2006-2014 Oracle Corporation
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync *
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * available from http://www.virtualbox.org. This file is free software;
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * General Public License (GPL) as published by the Free Software
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync#ifndef ___UIMediumManager_h___
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync#define ___UIMediumManager_h___
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync/* GUI includes: */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync#include "UIMediumManager.gen.h"
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync#include "QIWithRetranslateUI.h"
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#include "QIMainDialog.h"
79a32911c902685a8fafa06c4b9fd7f277994d93vboxsync#include "UIMediumDefs.h"
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync/* Forward declarations: */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsyncclass UIMedium;
26ab5559e05ae622734a4047cee975670da3b0e8vboxsyncclass UIMediumItem;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsyncclass UIToolBar;
65ba0abe3ecfd47b318d49a3c37a9b48d1f6904evboxsyncclass UIEnumerationProgressBar;
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsync/** Functor interface allowing to check if passed UIMediumItem is suitable. */
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsyncclass CheckIfSuitableBy
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsync{
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsyncpublic:
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Determines whether passed @a pItem is suitable. */
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsync virtual bool isItSuitable(UIMediumItem *pItem) const = 0;
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsync};
5a062c1c10e75283bed9bd16145610874ec5bacdvboxsync
58668e366c315f45ea3be7b3a43f79224858173avboxsync/** Medium Manager dialog. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsyncclass UIMediumManager : public QIWithRetranslateUI2<QIMainDialog>, public Ui::UIMediumManager
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync{
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync Q_OBJECT;
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
03aac79017ed994516d9547741b0e7aa9224c24cvboxsync /** Item action enumerator. */
03aac79017ed994516d9547741b0e7aa9224c24cvboxsync enum Action { Action_Add, Action_Edit, Action_Copy, Action_Modify, Action_Remove, Action_Release };
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Constructor for UIMediumManager dialog. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync UIMediumManager(QWidget *pCenterWidget, bool fRefresh = true);
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Destructor for UIMediumManager dialog. */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync ~UIMediumManager();
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
26ab5559e05ae622734a4047cee975670da3b0e8vboxsyncpublic:
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Returns UIMediumManager singleton instance. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync static UIMediumManager* instance();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Shows UIMediumManager singleton instance, creates new if necessary. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync static void showModeless(QWidget *pCenterWidget, bool fRefresh = true);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsyncprivate slots:
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
58668e366c315f45ea3be7b3a43f79224858173avboxsync /** Handles VBoxGlobal::sigMediumCreated signal. */
026a45b961439e27215ecef27f81bc115857609evboxsync void sltHandleMediumCreated(const QString &strMediumID);
58668e366c315f45ea3be7b3a43f79224858173avboxsync /** Handles VBoxGlobal::sigMediumDeleted signal. */
b4e89d495c2988c10068923397d31fd27112b9ebvboxsync void sltHandleMediumDeleted(const QString &strMediumID);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
58668e366c315f45ea3be7b3a43f79224858173avboxsync /** Handles VBoxGlobal::sigMediumEnumerationStarted signal. */
0623012e80c8f7252d781d1f51cb6836afd4d3eevboxsync void sltHandleMediumEnumerationStart();
58668e366c315f45ea3be7b3a43f79224858173avboxsync /** Handles VBoxGlobal::sigMediumEnumerated signal. */
026a45b961439e27215ecef27f81bc115857609evboxsync void sltHandleMediumEnumerated(const QString &strMediumID);
58668e366c315f45ea3be7b3a43f79224858173avboxsync /** Handles VBoxGlobal::sigMediumEnumerationFinished signal. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleMediumEnumerationFinish();
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles UIMediumManager::m_pActionCopy action triggering. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltCopyMedium();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles UIMediumManager::m_pActionModify action triggering. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltModifyMedium();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles UIMediumManager::m_pActionRemove action triggering. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltRemoveMedium();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles UIMediumManager::m_pActionRelease action triggering. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltReleaseMedium();
31745ebb293d58e9140fe2573cc1bd4f34bd1aa8vboxsync /** Handles UIMediumManager::m_pActionRefresh action triggering. */
31745ebb293d58e9140fe2573cc1bd4f34bd1aa8vboxsync void sltRefreshAll();
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles tab change case. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleCurrentTabChanged();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles item change case. */
5d55446560201599879edf9a7133c74d0a5218bbvboxsync void sltHandleCurrentItemChanged();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles item double-click case. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleDoubleClick();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Handles item context-menu-call case. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleContextMenuCall(const QPoint &position);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Adjusts tree-widgets according content. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltPerformTablesAdjustment();
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsyncprivate:
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** General prepare wrapper. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepare();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare dialog. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareThis();
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync /** Prepare connections. */
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync void prepareConnections();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare actions. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareActions();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare menu-bar. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareMenuBar();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare context-menu. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareContextMenu();
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync /** Prepare central-widget. */
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync void prepareCentralWidget();
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync /** Prepare tool-bar. */
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync void prepareToolBar();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare tab-widget. */
df32f009590cc83917fb1a9c38365de26109411bvboxsync void prepareTabWidget();
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync /** Prepare tab-widget's tab. */
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync void prepareTab(UIMediumType type);
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync /** Prepare tab-widget's tree-widget. */
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync void prepareTreeWidget(UIMediumType type, int iColumns);
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync /** Prepare tab-widget's information-container. */
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync void prepareInformationContainer(UIMediumType type, int iFields);
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare button-box. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareButtonBox();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Prepare progress-bar. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareProgressBar();
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#ifdef Q_WS_MAC
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Mac OS X: Prepare <i>Window</i> menu. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void prepareMacWindowMenu();
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#endif /* Q_WS_MAC */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync
19e4b59d75d82092624cb5440dd5dbe724b61d77vboxsync /** Repopulates tree-widgets content. */
19e4b59d75d82092624cb5440dd5dbe724b61d77vboxsync void repopulateTreeWidgets();
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Updates details according latest changes in current item of passed @a type. */
5d55446560201599879edf9a7133c74d0a5218bbvboxsync void refetchCurrentMediumItem(UIMediumType type);
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Updates details according latest changes in current item of chosen type. */
5d55446560201599879edf9a7133c74d0a5218bbvboxsync void refetchCurrentChosenMediumItem();
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Updates details according latest changes in all current items. */
5d55446560201599879edf9a7133c74d0a5218bbvboxsync void refetchCurrentMediumItems();
5d55446560201599879edf9a7133c74d0a5218bbvboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Update actions according currently chosen item. */
fd5860ffe98b17e6cadfc269b2266f95bce04af9vboxsync void updateActions();
daa8487f5bc0d5c44dc3be2cbe3d34cc211a845fvboxsync /** Update action icons according currently chosen tab. */
daa8487f5bc0d5c44dc3be2cbe3d34cc211a845fvboxsync void updateActionIcons();
e352a9803c8b6a6ffba3440c75acadabf47c8e0evboxsync /** Update tab icons according last @a action happened with @a pItem. */
03aac79017ed994516d9547741b0e7aa9224c24cvboxsync void updateTabIcons(UIMediumItem *pItem, Action action);
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync /** Update information pane of passed medium @a type. */
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync void updateInformationPanes(UIMediumType type = UIMediumType_Invalid);
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync /** Update information pane for hard-drive tab. */
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync void updateInformationPanesHD();
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync /** Update information pane for optical-disk tab. */
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync void updateInformationPanesCD();
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync /** Update information pane for floppy-disk tab. */
a1d5123f3ab0fbe5f030c0fc55a812e0807a566evboxsync void updateInformationPanesFD();
fd5860ffe98b17e6cadfc269b2266f95bce04af9vboxsync
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#ifdef Q_WS_MAC
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Mac OS X: Cleanup <i>Window</i> menu. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void cleanupMacWindowMenu();
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#endif /* Q_WS_MAC */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** General cleanup wrapper. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void cleanup();
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Translates dialog content. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void retranslateUi();
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
c43988473d501fd034309ca103548285bd9fa3b2vboxsync /** Creates UIMediumItem for corresponding @a medium. */
0dce7c2dd6b0e84af789fe319304c7305f1ac960vboxsync UIMediumItem* createMediumItem(const UIMedium &medium);
31745ebb293d58e9140fe2573cc1bd4f34bd1aa8vboxsync /** Creates UIMediumItemHD for corresponding @a medium. */
31745ebb293d58e9140fe2573cc1bd4f34bd1aa8vboxsync UIMediumItem* createHardDiskItem(const UIMedium &medium);
c43988473d501fd034309ca103548285bd9fa3b2vboxsync /** Updates UIMediumItem for corresponding @a medium. */
2a3ea815abf6290c6e17e81eb350e5c19a090c64vboxsync void updateMediumItem(const UIMedium &medium);
c43988473d501fd034309ca103548285bd9fa3b2vboxsync /** Deletes UIMediumItem for corresponding @a strMediumID. */
c43988473d501fd034309ca103548285bd9fa3b2vboxsync void deleteMediumItem(const QString &strMediumID);
2a3ea815abf6290c6e17e81eb350e5c19a090c64vboxsync
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync /** Returns tree-widget for passed medium @a type. */
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync QTreeWidget* treeWidget(UIMediumType type) const;
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync /** Returns item for passed medium @a type. */
3a6db00712f591d771f60db469fd8ea0e7b0ce69vboxsync UIMediumItem* mediumItem(UIMediumType type) const;
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync /** Returns information-container for passed medium @a type. */
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync QFrame* infoContainer(UIMediumType type) const;
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync /** Returns information-label for passed medium @a type and @a iLabelIndex. */
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync QLabel* infoLabel(UIMediumType type, int iLabelIndex) const;
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync /** Returns information-field for passed medium @a type and @a iFieldIndex. */
85e53e311e4a1f30cc4bb620495389d43755a33bvboxsync QILabel* infoField(UIMediumType type, int iFieldIndex) const;
5d55446560201599879edf9a7133c74d0a5218bbvboxsync
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync /** Returns medium type for passed @a pTreeWidget. */
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync UIMediumType mediumType(QTreeWidget *pTreeWidget) const;
2cfbc16182293ab6af5fcceabe24b53f7b2b822bvboxsync
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync /** Returns current medium type. */
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync UIMediumType currentMediumType() const;
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync /** Returns current tree-widget. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync QTreeWidget* currentTreeWidget() const;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Returns current item. */
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync UIMediumItem* currentMediumItem() const;
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Defines current item for passed @a pTreeWidget as @a pItem. */
4cac31995acb30108f8070f160cd9a820b8f50acvboxsync void setCurrentItem(QTreeWidget *pTreeWidget, QTreeWidgetItem *pItem);
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync
6dcd0dbfdc6ef7c8b5b00526020236e4542bb77avboxsync /** Returns tab index for passed UIMediumType. */
6dcd0dbfdc6ef7c8b5b00526020236e4542bb77avboxsync static int tabIndex(UIMediumType type);
6dcd0dbfdc6ef7c8b5b00526020236e4542bb77avboxsync /** Returns UIMediumType for passed tab index. */
6dcd0dbfdc6ef7c8b5b00526020236e4542bb77avboxsync static UIMediumType mediumType(int iIndex);
6dcd0dbfdc6ef7c8b5b00526020236e4542bb77avboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Performs search for the @a pTree child which corresponds to the @a condition but not @a pException. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync static UIMediumItem* searchItem(QTreeWidget *pTree, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException = 0);
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Performs search for the @a pParentItem child which corresponds to the @a condition but not @a pException. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync static UIMediumItem* searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException = 0);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Checks if @a action can be used for @a pItem. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync static bool checkMediumFor(UIMediumItem *pItem, Action action);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync /** Casts passed QTreeWidgetItem @a pItem to UIMediumItem if possible. */
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync static UIMediumItem* toMediumItem(QTreeWidgetItem *pItem);
07a690d662bd122b5e07b2c996990b4ef97f14f2vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Format information-pane content. */
cfeb51c88f60cb31c8862f0fa325d7d1c4d22f8avboxsync static QString formatPaneText(const QString &strText, bool fCompact = true, const QString &strElipsis = "middle");
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Determines if passed @a medium attached to hidden machines only. */
79a32911c902685a8fafa06c4b9fd7f277994d93vboxsync static bool isMediumAttachedToHiddenMachinesOnly(const UIMedium &medium);
cf575292da27c79a7de59f7ced500686a0838b38vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** UIMediumManager singleton instance. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync static UIMediumManager *m_spInstance;
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @name General variables.
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * @{ */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Widget to center UIMediumManager according. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QWidget *m_pPseudoParentWidget;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds whether UIMediumManager should be refreshed on invoke. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool m_fRefresh;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds whether UIMediumManager should preserve current item change. */
0dce7c2dd6b0e84af789fe319304c7305f1ac960vboxsync bool m_fPreventChangeCurrentItem;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @} */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @name Tab-widget variables.
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * @{ */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds whether hard-drive tab-widget have inaccessible item. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool m_fInaccessibleHD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds whether optical-disk tab-widget have inaccessible item. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool m_fInaccessibleCD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds whether floppy-disk tab-widget have inaccessible item. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool m_fInaccessibleFD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds cached hard-drive tab-widget icon. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync const QIcon m_iconHD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds cached optical-disk tab-widget icon. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync const QIcon m_iconCD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds cached floppy-disk tab-widget icon. */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync const QIcon m_iconFD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds current hard-drive tree-view item ID. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QString m_strCurrentIdHD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds current optical-disk tree-view item ID. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QString m_strCurrentIdCD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Holds current floppy-disk tree-view item ID. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QString m_strCurrentIdFD;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @} */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @name Tool-bar and menu variables.
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * @{ */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Tool-bar widget. */
65ba0abe3ecfd47b318d49a3c37a9b48d1f6904evboxsync UIToolBar *m_pToolBar;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Context menu object. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QMenu *m_pContextMenu;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Menu-bar menu object. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QMenu *m_pMenu;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Action to <i>copy</i> current item. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QAction *m_pActionCopy;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Action to <i>modify</i> current item. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QAction *m_pActionModify;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Action to <i>remove</i> current item. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QAction *m_pActionRemove;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Action to <i>release</i> current item. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QAction *m_pActionRelease;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Action to <i>refresh</i> current item. */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync QAction *m_pActionRefresh;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @} */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @name Progress-bar variables.
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync * @{ */
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** Progress-bar widget. */
65ba0abe3ecfd47b318d49a3c37a9b48d1f6904evboxsync UIEnumerationProgressBar *m_pProgressBar;
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync /** @} */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync};
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync
cf7a2a65e777b164523f5a5a52a1ac64e4322760vboxsync#endif /* !___UIMediumManager_h___ */